Compare commits
5 Commits
9eff6cc2cd
...
bf37fcb3f2
Author | SHA1 | Date |
---|---|---|
lutepickle | bf37fcb3f2 | |
lutepickle | e3647caf2a | |
lutepickle | 9d66be1e49 | |
lutepickle | 5fbed7073a | |
lutepickle | 2facc09926 |
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(PreceptDefOf.ChildBirth);
|
||||
Precept_Ritual precept_Ritual = (Precept_Ritual)comp.Pawn.Ideo.GetPrecept(RimWorld.PreceptDefOf.ChildBirth);
|
||||
float birthQuality = PregnancyUtility.GetBirthQualityFor(mother);
|
||||
do
|
||||
{
|
||||
|
|
|
@ -109,10 +109,6 @@
|
|||
<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>
|
||||
|
@ -173,6 +169,9 @@
|
|||
</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,7 +716,6 @@ namespace RJW_Menstruation
|
|||
|
||||
BeforeSimulator();
|
||||
|
||||
if (ShouldBeInfertile()) GoNextStage(Stage.Infertile);
|
||||
switch (curStage)
|
||||
{
|
||||
case Stage.Follicular:
|
||||
|
@ -749,6 +748,7 @@ 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() ? RJWPregnancySettings.fertility_endage_female_animal : RJWPregnancySettings.fertility_endage_female_humanlike);
|
||||
float fertEndAge = Pawn.RaceProps.lifeExpectancy * (Pawn.IsAnimal() ? 0.96f : 0.58f); // RJW default fertility_endage for animal and humanlike
|
||||
if (fertEndAge < fertStartAge) fertEndAge = fertStartAge;
|
||||
|
||||
float raceCyclesPerYear = RaceCyclesPerYear();
|
||||
|
@ -1263,6 +1263,11 @@ 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);
|
||||
|
@ -1727,11 +1732,7 @@ namespace RJW_Menstruation
|
|||
{
|
||||
if (curStageTicks >= currentIntervalTicks)
|
||||
{
|
||||
if (ShouldBeInfertile())
|
||||
{
|
||||
GoNextStage(Stage.Infertile);
|
||||
}
|
||||
else if (!IsBreedingSeason())
|
||||
if (!IsBreedingSeason())
|
||||
{
|
||||
GoNextStage(Stage.Anestrus);
|
||||
}
|
||||
|
@ -1853,18 +1854,20 @@ 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) / (1 + (cycleSpeed - 1) * 1.5f));
|
||||
return (int)(Utility.VariationRange(Props.follicularIntervalDays * GenDate.TicksPerDay, cycleVariability * 1.5f * variabilityFactor) / CycleSkew(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) / (1 + (cycleSpeed - 1) * 0.5f));
|
||||
return (int)(Utility.VariationRange(Props.lutealIntervalDays * GenDate.TicksPerDay, cycleVariability * 0.5f * variabilityFactor) / CycleSkew(0.5f));
|
||||
case Stage.Bleeding:
|
||||
return (int)(Utility.VariationRange(Props.bleedingIntervalDays * GenDate.TicksPerDay, cycleVariability * 0.5f * variabilityFactor) / (1 + (cycleSpeed - 1) * 0.5f));
|
||||
return (int)(Utility.VariationRange(Props.bleedingIntervalDays * GenDate.TicksPerDay, cycleVariability * 0.5f * variabilityFactor) / CycleSkew(0.5f));
|
||||
case Stage.Recover:
|
||||
return (int)Utility.VariationRange(Props.recoveryIntervalDays * GenDate.TicksPerDay, 0.05f);
|
||||
case Stage.Pregnant:
|
||||
|
|
Loading…
Reference in New Issue