diff --git a/1.4/Assemblies/RJW_Menstruation.dll b/1.4/Assemblies/RJW_Menstruation.dll index de4e12b..bb75ed9 100644 Binary files a/1.4/Assemblies/RJW_Menstruation.dll and b/1.4/Assemblies/RJW_Menstruation.dll differ diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs index f4fd872..4b265f4 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs @@ -198,20 +198,9 @@ namespace RJW_Menstruation get { if (opcache > 0) return opcache; - float avglittersize; - try - { - avglittersize = Mathf.Max(Rand.ByCurveAverage(Pawn.RaceProps.litterSizeCurve), 1.0f); - } - catch - { - // Any exceptions in that will have been reported elsewhere in the code by now - avglittersize = 1.0f; - }; - avglittersize *= ovulationFactor; const float yearsBeforeMenopause = 6.0f; opcache = (int)(RaceCyclesPerYear() * - avglittersize * + AverageLitterSize() * yearsBeforeMenopause * (Pawn.RaceProps.lifeExpectancy / ThingDefOf.Human.race.lifeExpectancy)); if (opcache == 0) opcache = 1; @@ -1220,6 +1209,21 @@ namespace RJW_Menstruation { } + protected float AverageLitterSize() + { + float avglittersize; + try + { + avglittersize = Mathf.Max(Rand.ByCurveAverage(Pawn.RaceProps.litterSizeCurve), 1.0f); + } + catch (NullReferenceException) + { + avglittersize = 1.0f; + } + avglittersize *= ovulationFactor; + return avglittersize; + } + protected virtual float RaceCyclesPerYear() { int breedingSeasons = 0; @@ -1242,16 +1246,7 @@ namespace RJW_Menstruation public int GetOvaryPowerByAge() { - float avglittersize; - try - { - avglittersize = Mathf.Max(Rand.ByCurveAverage(Pawn.RaceProps.litterSizeCurve), 1.0f); - } - catch (NullReferenceException) - { - avglittersize = 1.0f; - } - avglittersize *= ovulationFactor; + 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); @@ -1972,7 +1967,7 @@ namespace RJW_Menstruation public int EggsRestoredPerBiosculptor(float yearsWorth) { - return Math.Max(1, (int)((float)RaceCyclesPerYear() * yearsWorth)); + return Math.Max(1, (int)(RaceCyclesPerYear() * yearsWorth * AverageLitterSize())); } public void RestoreEggs(float yearsWorth) diff --git a/About/Manifest.xml b/About/Manifest.xml index eb861f5..6b4c770 100644 --- a/About/Manifest.xml +++ b/About/Manifest.xml @@ -1,7 +1,7 @@ RJW Menstruation - 1.0.9.2 + 1.0.9.3 diff --git a/changelogs.txt b/changelogs.txt index 2000239..8b21fe2 100644 --- a/changelogs.txt +++ b/changelogs.txt @@ -1,3 +1,6 @@ +Version 1.0.9.3 + - The biosculptor egg restoration cycle will now give more eggs to races that ovulate more than one egg at a time. + Version 1.0.9.2 - Updated Traditional Chinese translation by Hydrogen. - Fixed the no bleeding gene having positive metabolic efficiency instead of negative.