This commit is contained in:
moreoreganostodump 2021-06-13 00:51:34 +09:00
parent 51cbc68c91
commit 2d43ff1717
13 changed files with 222 additions and 84 deletions

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Manifest> <Manifest>
<identifier>RJW Menstruation</identifier> <identifier>RJW Menstruation</identifier>
<version>1.0.3.0</version> <version>1.0.3.1</version>
<dependencies> <dependencies>
</dependencies> </dependencies>
<incompatibleWith /> <incompatibleWith />

Binary file not shown.

View file

@ -145,8 +145,49 @@
</value> </value>
</Operation> </Operation>
<Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="SlimeVagina"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_InducedOvulator">
<maxCumCapacity>5</maxCumCapacity>
<baseImplantationChanceFactor>2.0</baseImplantationChanceFactor>
<basefertilizationChanceFactor>2.0</basefertilizationChanceFactor>
<deviationFactor>0.05</deviationFactor>
<folicularIntervalDays>12</folicularIntervalDays>
<lutealIntervalDays>9</lutealIntervalDays>
<bleedingIntervalDays>0</bleedingIntervalDays>
<recoveryIntervalDays>3</recoveryIntervalDays>
<eggLifespanDays>1</eggLifespanDays>
<wombTex>Womb/Womb</wombTex>
<vagTex>Genitals/Vagina</vagTex>
<estrusDaysBeforeOvulation>6</estrusDaysBeforeOvulation>
</li>
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="DemonVagina"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_InducedOvulator">
<maxCumCapacity>10</maxCumCapacity>
<baseImplantationChanceFactor>2.0</baseImplantationChanceFactor>
<basefertilizationChanceFactor>2.0</basefertilizationChanceFactor>
<deviationFactor>0.05</deviationFactor>
<folicularIntervalDays>14</folicularIntervalDays>
<lutealIntervalDays>14</lutealIntervalDays>
<bleedingIntervalDays>0</bleedingIntervalDays>
<recoveryIntervalDays>3</recoveryIntervalDays>
<eggLifespanDays>1</eggLifespanDays>
<wombTex>Womb/Womb</wombTex>
<vagTex>Genitals/Vagina</vagTex>
<estrusDaysBeforeOvulation>6</estrusDaysBeforeOvulation>
</li>
</comps>
</value>
</Operation>
</Patch> </Patch>

View file

@ -1,11 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- one cycle = folicularIntervalDays + lutealIntervalDays -->
<!-- folicularIntervalDays includes bleedingIntervalDays. -->
<!-- bleedingIntervalDays must be smaller than folicularIntervalDays -->
<!-- unit of maxCumCapacity is ml -->
<!-- actual max cum capacity is 500times of maxCumCapacity -->
<!-- one egg = 1 ovaryPower-->
<Patch> <Patch>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
@ -20,4 +14,16 @@
</value> </value>
</Operation> </Operation>
<Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="SlimeBreasts"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Breast">
<BreastTex>Breasts/Breast</BreastTex>
<BlacknippleColor>(55,20,0)</BlacknippleColor>
</li>
</comps>
</value>
</Operation>
</Patch> </Patch>

View file

@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<Patch>
<Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="BigRaceBreats"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Breast">
<BreastTex>Breasts/Breast</BreastTex>
<BlacknippleColor>(55,20,0)</BlacknippleColor>
</li>
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="OrcBreasts"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Breast">
<BreastTex>Breasts/Breast</BreastTex>
<BlacknippleColor>(55,20,0)</BlacknippleColor>
</li>
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="GhoulBreasts"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Breast">
<BreastTex>Breasts/Breast</BreastTex>
<BlacknippleColor>(55,20,0)</BlacknippleColor>
</li>
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="GhostBreasts"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Breast">
<BreastTex>Breasts/Breast</BreastTex>
<BlacknippleColor>(55,20,0)</BlacknippleColor>
</li>
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="NecroBreasts"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Breast">
<BreastTex>Breasts/Breast</BreastTex>
<BlacknippleColor>(55,20,0)</BlacknippleColor>
</li>
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="NephilaBreasts"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Breast">
<BreastTex>Breasts/Breast</BreastTex>
<BlacknippleColor>(55,20,0)</BlacknippleColor>
</li>
</comps>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>Defs/rjw.HediffDef_PartBase[defName="NephilaSlimeBreasts"]</xpath>
<value>
<comps>
<li Class="RJW_Menstruation.CompProperties_Breast">
<BreastTex>Breasts/Breast</BreastTex>
<BlacknippleColor>(55,20,0)</BlacknippleColor>
</li>
</comps>
</value>
</Operation>
</Patch>

View file

@ -1,3 +1,9 @@
Version 1.0.3.1
- fixed problems that pawns get climacteric stage after pregnancy even the menopause setting is off
- now implantation chance is independent with rjw pregnancy settings
- fixed broken vagina support
- breasts support for race support
Version 1.0.3.0 Version 1.0.3.0
- added various fetus images (thanks to GluxDesigns) - added various fetus images (thanks to GluxDesigns)
- added twin fetus image - added twin fetus image

View file

@ -46,7 +46,7 @@ namespace RJW_Menstruation
float width = 450f + 2 * windowMargin; float width = 450f + 2 * windowMargin;
float height = 820f; float height = 820f;
if (!Configurations.DrawWombStatus) height -= wombRectHeight; if (!Configurations.DrawWombStatus) height -= wombRectHeight;
if (!Configurations.DrawVaginaStatus) width -= 150f; if (!Configurations.DrawVaginaStatus || pawn.IsAnimal()) width -= 150f;
return new Vector2(width, height); return new Vector2(width, height);
} }
} }
@ -59,6 +59,9 @@ namespace RJW_Menstruation
public void ChangePawn(Pawn pawn, HediffComp_Menstruation comp) public void ChangePawn(Pawn pawn, HediffComp_Menstruation comp)
{ {
if (this.pawn.IsAnimal() && !pawn.IsAnimal()) windowRect.width += 150f;
else if (!this.pawn.IsAnimal() && pawn.IsAnimal()) windowRect.width -= 150f;
this.pawn = pawn; this.pawn = pawn;
this.comp = comp; this.comp = comp;
} }

View file

@ -12,6 +12,7 @@ namespace RJW_Menstruation
|| comp.curStage.Equals(HediffComp_Menstruation.Stage.Luteal) || comp.curStage.Equals(HediffComp_Menstruation.Stage.Luteal)
|| comp.curStage.Equals(HediffComp_Menstruation.Stage.ClimactericFollicular) || comp.curStage.Equals(HediffComp_Menstruation.Stage.ClimactericFollicular)
|| comp.curStage.Equals(HediffComp_Menstruation.Stage.ClimactericLuteal) || comp.curStage.Equals(HediffComp_Menstruation.Stage.ClimactericLuteal)
|| comp.curStage.Equals(HediffComp_Menstruation.Stage.Anestrus)
)) ))
{ {
comp.SetEstrus(comp.Props.eggLifespanDays); comp.SetEstrus(comp.Props.eggLifespanDays);

View file

@ -203,8 +203,8 @@ namespace RJW_Menstruation
{ {
float factor = 1.0f; float factor = 1.0f;
if (parent.pawn.Has(Quirk.Breeder)) factor = 10.0f; if (parent.pawn.Has(Quirk.Breeder)) factor = 10.0f;
if (xxx.is_animal(parent.pawn)) factor *= RJWPregnancySettings.animal_impregnation_chance / 100f; //if (xxx.is_animal(parent.pawn)) factor *= RJWPregnancySettings.animal_impregnation_chance / 100f;
else factor *= RJWPregnancySettings.humanlike_impregnation_chance / 100f; //else factor *= RJWPregnancySettings.humanlike_impregnation_chance / 100f;
return parent.pawn.health.capacities.GetLevel(xxx.reproduction) * factor; return parent.pawn.health.capacities.GetLevel(xxx.reproduction) * factor;
} }
} }
@ -640,7 +640,7 @@ namespace RJW_Menstruation
} }
} }
public void AfterNotCumIn() public virtual void AfterNotCumIn()
{ {
} }
@ -649,61 +649,12 @@ namespace RJW_Menstruation
/// Action for both Cum and NotCum /// Action for both Cum and NotCum
/// </summary> /// </summary>
/// <param name="fd">Fluid deviation</param> /// <param name="fd">Fluid deviation</param>
public void AfterFluidIn(float fd) public virtual void AfterFluidIn(float fd)
{ {
//ModLog.Message("LLActivated: " + Configurations.LLActivated);
//if (Configurations.LLActivated)
//{
// LLCumflationIn(fd);
//}
} }
/// <summary>
/// Cumflation for Licentia Labs
/// </summary>
/// <param name="fd"></param>
public void LLCumflationIn(float fd)
{
if (TotalCumPercent > 1.0f)
{
ModLog.Message("cumflation in");
BodyPartRecord genital = Genital_Helper.get_genitalsBPR(parent.pawn);
HediffWithComps hediff = parent.pawn.health?.hediffSet?.GetHediffs<HediffWithComps>()?.FirstOrDefault(x => x.def == VariousDefOf.Cumflation && x.Part.Equals(genital));
if (hediff == null) // 1.0 fd = 0.002 severity
{
ModLog.Message("hediff null");
hediff = (HediffWithComps)HediffMaker.MakeHediff(VariousDefOf.Cumflation, parent.pawn);
hediff.Severity = (TotalCumPercent - 1.0f) * 0.002f;
parent.pawn.health.AddHediff(hediff, genital);
ModLog.Message("added hediff");
}
else
{
ModLog.Message("increase severity: " + hediff.Part.Label);
hediff.Severity += fd * 0.002f;
}
}
}
public void LLCumflationOut(float fd)
{
HediffWithComps hediff = parent.pawn.health?.hediffSet?.GetHediffs<HediffWithComps>()?.FirstOrDefault(x => x.def == VariousDefOf.Cumflation && x.Part.def.Equals(xxx.genitalsDef));
if (hediff != null)
{
if (TotalCumPercent < 1.0f) parent.pawn.health.RemoveHediff(hediff);
else
{
ModLog.Message("decrease severity: " + hediff?.Part?.Label + TotalCumPercent * 0.002f);
hediff.Severity -= fd * 0.002f;
if (hediff.Severity < TotalCumPercent * 0.002f) hediff.Severity = TotalCumPercent * 0.002f;
}
}
}
public void BeforeCumOut(out Absorber absorber) public void BeforeCumOut(out Absorber absorber)
{ {
@ -718,7 +669,7 @@ namespace RJW_Menstruation
/// <summary> /// <summary>
/// For natural leaking /// For natural leaking
/// </summary> /// </summary>
public void AfterCumOut() public virtual void AfterCumOut()
{ {
parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.LeakingFluids); parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.LeakingFluids);
} }
@ -727,12 +678,9 @@ namespace RJW_Menstruation
/// For all type of leaking /// For all type of leaking
/// </summary> /// </summary>
/// <param name="fd"></param> /// <param name="fd"></param>
public void AfterFluidOut(float fd) public virtual void AfterFluidOut(float fd)
{ {
//if (Configurations.LLActivated)
//{
// LLCumflationOut(fd);
//}
} }
@ -905,14 +853,7 @@ namespace RJW_Menstruation
if (!Configurations.EnableMenopause) if (!Configurations.EnableMenopause)
{ {
Hediff hediff = parent.pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_Climacteric); RemoveClimactericEffect();
if (hediff != null) parent.pawn.health.RemoveHediff(hediff);
hediff = parent.pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_Menopause);
if (hediff != null) parent.pawn.health.RemoveHediff(hediff);
if (curStage == Stage.ClimactericBleeding) curStage = Stage.Bleeding;
else if (curStage == Stage.ClimactericFollicular) curStage = Stage.Follicular;
else if (curStage == Stage.ClimactericLuteal) curStage = Stage.Luteal;
} }
else if (ovarypower < -50000) else if (ovarypower < -50000)
{ {
@ -1413,7 +1354,7 @@ namespace RJW_Menstruation
{ {
if (curStageHrs >= recoveryIntervalhours) if (curStageHrs >= recoveryIntervalhours)
{ {
if (ovarypower < ovarypowerthreshold) if (Configurations.EnableMenopause && ovarypower < ovarypowerthreshold)
{ {
GoNextStage(Stage.ClimactericFollicular); GoNextStage(Stage.ClimactericFollicular);
} }
@ -1446,7 +1387,12 @@ namespace RJW_Menstruation
case Stage.ClimactericFollicular: case Stage.ClimactericFollicular:
action = delegate action = delegate
{ {
if (curStageHrs >= (follicularIntervalhours - bleedingIntervalhours) * CycleFactor) if (!Configurations.EnableMenopause)
{
RemoveClimactericEffect();
StayCurrentStage();
}
else if (curStageHrs >= (follicularIntervalhours - bleedingIntervalhours) * CycleFactor)
{ {
GoNextStage(Stage.Ovulatory); GoNextStage(Stage.Ovulatory);
} }
@ -1465,7 +1411,12 @@ namespace RJW_Menstruation
case Stage.ClimactericLuteal: case Stage.ClimactericLuteal:
action = delegate action = delegate
{ {
if (!eggs.NullOrEmpty()) if (!Configurations.EnableMenopause)
{
RemoveClimactericEffect();
StayCurrentStage();
}
else if (!eggs.NullOrEmpty())
{ {
FertilizationCheck(); FertilizationCheck();
EggDecay(); EggDecay();
@ -1509,7 +1460,12 @@ namespace RJW_Menstruation
case Stage.ClimactericBleeding: case Stage.ClimactericBleeding:
action = delegate action = delegate
{ {
if (curStageHrs >= bleedingIntervalhours) if (!Configurations.EnableMenopause)
{
RemoveClimactericEffect();
StayCurrentStage();
}
else if (curStageHrs >= bleedingIntervalhours)
{ {
follicularIntervalhours = PeriodRandomizer(follicularIntervalhours, Props.deviationFactor * 6); follicularIntervalhours = PeriodRandomizer(follicularIntervalhours, Props.deviationFactor * 6);
GoNextStage(Stage.ClimactericFollicular); GoNextStage(Stage.ClimactericFollicular);
@ -1588,6 +1544,16 @@ namespace RJW_Menstruation
} }
} }
protected void RemoveClimactericEffect()
{
Hediff hediff = parent.pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_Climacteric);
if (hediff != null) parent.pawn.health.RemoveHediff(hediff);
hediff = parent.pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_Menopause);
if (hediff != null) parent.pawn.health.RemoveHediff(hediff);
if (curStage == Stage.ClimactericBleeding) curStage = Stage.Bleeding;
else if (curStage == Stage.ClimactericFollicular) curStage = Stage.Follicular;
else if (curStage == Stage.ClimactericLuteal) curStage = Stage.Luteal;
}
protected int PeriodRandomizer(int intervalhours, float deviation) protected int PeriodRandomizer(int intervalhours, float deviation)
{ {

View file

@ -5,6 +5,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using UnityEngine; using UnityEngine;
using Verse; using Verse;
using rjw;
namespace RJW_Menstruation namespace RJW_Menstruation
{ {
@ -110,6 +111,31 @@ namespace RJW_Menstruation
} }
[HarmonyPatch(typeof(PawnColumnWorker_Pregnant), "GetIconFor")]
public class PawnColumnWorker_Patch_Icon
{
public static void Postfix(Pawn pawn, ref Texture2D __result)
{
if (pawn.IsPregnant()) __result = ContentFinder<Texture2D>.Get("UI/Icons/Animal/Pregnant", true);
}
}
[HarmonyPatch(typeof(PawnColumnWorker_Pregnant), "GetTooltipText")]
public class PawnColumnWorker_Patch_Tooltip
{
public static bool Prefix(Pawn pawn, ref string __result)
{
float gestationProgress = PregnancyHelper.GetPregnancy(pawn).Severity;
int num = (int)(pawn.RaceProps.gestationPeriodDays * 60000f);
int numTicks = (int)(gestationProgress * (float)num);
__result = "PregnantIconDesc".Translate(numTicks.ToStringTicksToDays("F0"), num.ToStringTicksToDays("F0"));
return false;
}
}
//[HarmonyPatch(typeof(JobGiver_OptimizeApparel), "ApparelScoreGain_NewTmp")] //[HarmonyPatch(typeof(JobGiver_OptimizeApparel), "ApparelScoreGain_NewTmp")]
//public class OptimizeApparel_Patch //public class OptimizeApparel_Patch

View file

@ -46,10 +46,7 @@ namespace RJW_Menstruation
public static readonly JobDef Job_LactateSelf = DefDatabase<JobDef>.GetNamed("LactateSelf"); public static readonly JobDef Job_LactateSelf = DefDatabase<JobDef>.GetNamed("LactateSelf");
// Defs from Licentia Labs
public static readonly HediffDef Cumflation = DefDatabase<HediffDef>.GetNamedSilentFail("Cumflation");
public static readonly ThoughtDef GotOverCumflated = DefDatabase<ThoughtDef>.GetNamedSilentFail("GotOverCumflated");
public static readonly ThoughtDef GotOverCumflatedEnjoyed = DefDatabase<ThoughtDef>.GetNamedSilentFail("GotOverCumflatedEnjoyed");