mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
Compare commits
No commits in common. "bf37fcb3f2dfc0c2b0d33d64fe255be33a0cae8d" and "9eff6cc2cd3e70135796767ea355036531c28b56" have entirely different histories.
bf37fcb3f2
...
9eff6cc2cd
4 changed files with 15 additions and 17 deletions
Binary file not shown.
|
@ -202,7 +202,7 @@ namespace RJW_Menstruation
|
|||
if (comp?.HasBaby ?? false)
|
||||
{
|
||||
OutcomeChance thisOutcome = outcome;
|
||||
Precept_Ritual precept_Ritual = (Precept_Ritual)comp.Pawn.Ideo.GetPrecept(RimWorld.PreceptDefOf.ChildBirth);
|
||||
Precept_Ritual precept_Ritual = (Precept_Ritual)comp.Pawn.Ideo.GetPrecept(PreceptDefOf.ChildBirth);
|
||||
float birthQuality = PregnancyUtility.GetBirthQualityFor(mother);
|
||||
do
|
||||
{
|
||||
|
|
|
@ -109,6 +109,10 @@
|
|||
<HintPath>..\..\..\..\..\..\..\..\workshop\content\294100\2830943477\1.4\Assemblies\AnimalGenetics.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>..\..\..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="RJW">
|
||||
<HintPath>..\..\..\..\..\rjw\1.4\Assemblies\RJW.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
|
@ -169,9 +173,6 @@
|
|||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Krafs.Rimworld.Ref">
|
||||
<Version>1.4.3901</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Lib.Harmony">
|
||||
<Version>2.2.2</Version>
|
||||
<ExcludeAssets>runtime</ExcludeAssets>
|
||||
|
|
|
@ -716,6 +716,7 @@ namespace RJW_Menstruation
|
|||
|
||||
BeforeSimulator();
|
||||
|
||||
if (ShouldBeInfertile()) GoNextStage(Stage.Infertile);
|
||||
switch (curStage)
|
||||
{
|
||||
case Stage.Follicular:
|
||||
|
@ -748,7 +749,6 @@ namespace RJW_Menstruation
|
|||
GoNextStage(Stage.Follicular);
|
||||
break;
|
||||
}
|
||||
|
||||
AfterSimulator();
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
@ -1222,7 +1222,7 @@ namespace RJW_Menstruation
|
|||
float avglittersize = AverageLitterSize();
|
||||
|
||||
float fertStartAge = Pawn.RaceProps.lifeStageAges?.Find(stage => stage.def.reproductive)?.minAge ?? 0.0f;
|
||||
float fertEndAge = Pawn.RaceProps.lifeExpectancy * (Pawn.IsAnimal() ? 0.96f : 0.58f); // RJW default fertility_endage for animal and humanlike
|
||||
float fertEndAge = Pawn.RaceProps.lifeExpectancy * (Pawn.IsAnimal() ? RJWPregnancySettings.fertility_endage_female_animal : RJWPregnancySettings.fertility_endage_female_humanlike);
|
||||
if (fertEndAge < fertStartAge) fertEndAge = fertStartAge;
|
||||
|
||||
float raceCyclesPerYear = RaceCyclesPerYear();
|
||||
|
@ -1263,11 +1263,6 @@ namespace RJW_Menstruation
|
|||
|
||||
protected virtual void AfterSimulator()
|
||||
{
|
||||
if (ShouldBeInfertile())
|
||||
{
|
||||
eggs.Clear();
|
||||
GoNextStage(Stage.Infertile);
|
||||
}
|
||||
if (EggHealth < 1f)
|
||||
{
|
||||
if (sexNeed == null) sexNeed = Pawn.needs.TryGetNeed(VariousDefOf.SexNeed);
|
||||
|
@ -1732,7 +1727,11 @@ namespace RJW_Menstruation
|
|||
{
|
||||
if (curStageTicks >= currentIntervalTicks)
|
||||
{
|
||||
if (!IsBreedingSeason())
|
||||
if (ShouldBeInfertile())
|
||||
{
|
||||
GoNextStage(Stage.Infertile);
|
||||
}
|
||||
else if (!IsBreedingSeason())
|
||||
{
|
||||
GoNextStage(Stage.Anestrus);
|
||||
}
|
||||
|
@ -1854,20 +1853,18 @@ namespace RJW_Menstruation
|
|||
|
||||
protected int PeriodRandomizer(Stage stage)
|
||||
{
|
||||
float CycleSkew(float factor) => 1 + (cycleSpeed - 1) * factor;
|
||||
|
||||
float variabilityFactor = (EggHealth < 1.0f) ? 6.0f : 1.0f;
|
||||
// Most cycle lengthening or shortening occurs in the follicular phase, so weight towards that
|
||||
switch (stage)
|
||||
{
|
||||
case Stage.Follicular:
|
||||
return (int)(Utility.VariationRange(Props.follicularIntervalDays * GenDate.TicksPerDay, cycleVariability * 1.5f * variabilityFactor) / CycleSkew(1.5f));
|
||||
return (int)(Utility.VariationRange(Props.follicularIntervalDays * GenDate.TicksPerDay, cycleVariability * 1.5f * variabilityFactor) / (1 + (cycleSpeed - 1) * 1.5f));
|
||||
case Stage.Ovulatory:
|
||||
return Props.ovulationIntervalHours * GenDate.TicksPerHour; // No variability for now
|
||||
case Stage.Luteal:
|
||||
return (int)(Utility.VariationRange(Props.lutealIntervalDays * GenDate.TicksPerDay, cycleVariability * 0.5f * variabilityFactor) / CycleSkew(0.5f));
|
||||
return (int)(Utility.VariationRange(Props.lutealIntervalDays * GenDate.TicksPerDay, cycleVariability * 0.5f * variabilityFactor) / (1 + (cycleSpeed - 1) * 0.5f));
|
||||
case Stage.Bleeding:
|
||||
return (int)(Utility.VariationRange(Props.bleedingIntervalDays * GenDate.TicksPerDay, cycleVariability * 0.5f * variabilityFactor) / CycleSkew(0.5f));
|
||||
return (int)(Utility.VariationRange(Props.bleedingIntervalDays * GenDate.TicksPerDay, cycleVariability * 0.5f * variabilityFactor) / (1 + (cycleSpeed - 1) * 0.5f));
|
||||
case Stage.Recover:
|
||||
return (int)Utility.VariationRange(Props.recoveryIntervalDays * GenDate.TicksPerDay, 0.05f);
|
||||
case Stage.Pregnant:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue