Only remove cramps if no other womb is bleeding

This commit is contained in:
lutepickle 2022-12-27 06:52:33 -08:00
parent 398f1b7066
commit ba3f24cba3
2 changed files with 4 additions and 8 deletions

View file

@ -1528,7 +1528,7 @@ namespace RJW_Menstruation
if (curStageHrs >= currentIntervalHours) if (curStageHrs >= currentIntervalHours)
{ {
Hediff hediff = Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_MenstrualCramp); Hediff hediff = Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_MenstrualCramp);
if (hediff != null) Pawn.health.RemoveHediff(hediff); if (hediff != null && !Pawn.GetMenstruationComps().Any(comp => comp != this && comp.curStage == Stage.Bleeding)) Pawn.health.RemoveHediff(hediff);
int totalFollicularHours = PeriodRandomizer(Stage.Follicular); // The total amount of time for both bleeding and follicular int totalFollicularHours = PeriodRandomizer(Stage.Follicular); // The total amount of time for both bleeding and follicular
if (totalFollicularHours <= currentIntervalHours) // We've bled for so long that we completely missed the follicular phase if (totalFollicularHours <= currentIntervalHours) // We've bled for so long that we completely missed the follicular phase
GoOvulatoryStage(); GoOvulatoryStage();

View file

@ -1,4 +1,5 @@
using RimWorld; using RimWorld;
using System.Linq;
using Verse; using Verse;
namespace RJW_Menstruation namespace RJW_Menstruation
@ -61,17 +62,12 @@ namespace RJW_Menstruation
if (curStageHrs >= currentIntervalHours) if (curStageHrs >= currentIntervalHours)
{ {
Hediff hediff = Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_MenstrualCramp); Hediff hediff = Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_MenstrualCramp);
if (hediff != null) Pawn.health.RemoveHediff(hediff); if (hediff != null && !Pawn.GetMenstruationComps().Any(comp => comp != this && comp.curStage == Stage.Bleeding)) Pawn.health.RemoveHediff(hediff);
estrusflag = false; estrusflag = false;
GoNextStage(Stage.Anestrus); GoNextStage(Stage.Anestrus);
return; return;
} }
else else base.BleedingAction();
{
if (curStageHrs < currentIntervalHours / 4) for (int i = 0; i < Configurations.CycleAcceleration; i++) BleedOut();
curStageHrs += Configurations.CycleAcceleration;
StayCurrentStage();
}
} }
protected override void PregnantAction() protected override void PregnantAction()