From b88fab8b8a81b18ee15ddd9951b9b296d0d235f2 Mon Sep 17 00:00:00 2001 From: lutepickle <28810-lutepickle@users.noreply.gitgud.io> Date: Sat, 13 Apr 2024 15:18:46 -0700 Subject: [PATCH 1/4] Update changelog --- changelogs.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/changelogs.txt b/changelogs.txt index 6634556..9848080 100644 --- a/changelogs.txt +++ b/changelogs.txt @@ -1,6 +1,7 @@ Version 1.5.0.0 - Support for RimWorld 1.5. All future changes to Menstruation will only be for RimWorld 1.5. - Not yet compatible with Animal Genetics. Compatibility will be re-enabled after it is updated for RimWorld 1.5. + - Inactive genes will no longer be applied to wombs. Version 1.0.9.4 - Added graphics for the menstruation genes with thanks to Alpenglow. From b18bbc33385fc08a65731f251112d15379de6656 Mon Sep 17 00:00:00 2001 From: lutepickle <28810-lutepickle@users.noreply.gitgud.io> Date: Sun, 14 Apr 2024 21:45:06 -0700 Subject: [PATCH 2/4] Remove unnecessary null conditional --- .../RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs b/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs index 706525a..7ed79bd 100644 --- a/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs +++ b/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs @@ -1459,7 +1459,7 @@ namespace RJW_Menstruation break; case Hediff_BasePregnancy _: default: - if (Configurations.Debug) Log.Message($"Not adding to existing pregnancy {pregnancy?.GetUniqueLoadID()}"); + if (Configurations.Debug) Log.Message($"Not adding to existing pregnancy {pregnancy.GetUniqueLoadID()}"); pregnant = true; deadeggs.Add(egg); break; From 3cdccbd8cb5cbe0a7bc0133ae1b2091e9b68758a Mon Sep 17 00:00:00 2001 From: lutepickle <28810-lutepickle@users.noreply.gitgud.io> Date: Sun, 14 Apr 2024 21:47:14 -0700 Subject: [PATCH 3/4] Replace exact float comparison with Approximately --- .../RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs b/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs index 7ed79bd..9adbd95 100644 --- a/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs +++ b/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs @@ -1480,7 +1480,7 @@ namespace RJW_Menstruation float interspeciesFactor = InterspeciesImplantFactor(egg.fertilizer); float implantChance = Configurations.ImplantationChance * ImplantChance * interspeciesFactor; Log.Message($"Fertilized egg of {Pawn} failed to implant (chance {implantChance.ToStringPercent()}, " + - (interspeciesFactor != 1.0f ? $"interspecies factor {interspeciesFactor.ToStringPercent()}, " : "") + + ((!Mathf.Approximately(interspeciesFactor, 1.0f)) ? $"interspecies factor {interspeciesFactor.ToStringPercent()}, " : "") + $"father {egg.fertilizer})"); } deadeggs.Add(egg); From a748a520c0b21a2ebfd3fb8b84c6019af74022b0 Mon Sep 17 00:00:00 2001 From: lutepickle <28810-lutepickle@users.noreply.gitgud.io> Date: Mon, 15 Apr 2024 21:25:40 -0700 Subject: [PATCH 4/4] Properly put periodic ovulators into anestrus after recovering from birth --- .../HediffComps/HediffComp_PeriodicOvulator.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_PeriodicOvulator.cs b/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_PeriodicOvulator.cs index 662c248..78b3516 100644 --- a/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_PeriodicOvulator.cs +++ b/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_PeriodicOvulator.cs @@ -92,6 +92,13 @@ namespace RJW_Menstruation ticksToNextCycle = (int)Utility.VariationRange(averageCycleIntervalTicks, cycleVariability) / 2; } + protected override void RecoverAction() + { + base.RecoverAction(); + if (curStage != Stage.Recover) + GoNextStage(Stage.Anestrus); + } + protected override void AnestrusAction() { if (ticksToNextCycle <= 0 && IsBreedingSeason())