For multiple vaginas, concealed estrus won't occur if in visible estrus, and visible estrus will cancel concealed estrus

This commit is contained in:
lutepickle 2022-07-12 19:09:19 -07:00
parent 1907820265
commit 2b8d822542
4 changed files with 14 additions and 2 deletions

Binary file not shown.

View File

@ -1023,14 +1023,26 @@ namespace RJW_Menstruation
public void SetEstrus(int days)
{
HediffDef estrusdef = Props.concealedEstrus ? VariousDefOf.Hediff_Estrus_Concealed : VariousDefOf.Hediff_Estrus;
HediffWithComps hediff = (HediffWithComps)parent.pawn.health.hediffSet.GetFirstHediffOfDef(estrusdef);
Hediff hediff = parent.pawn.health.hediffSet.GetFirstHediffOfDef(estrusdef);
if (Props.concealedEstrus)
{
if (parent.pawn.health.hediffSet.HasHediff(VariousDefOf.Hediff_Estrus)) return;
}
else
{
HediffDef concealedEstrusDef = VariousDefOf.Hediff_Estrus_Concealed;
Hediff concealedHediff = parent.pawn.health.hediffSet.GetFirstHediffOfDef(concealedEstrusDef);
if (parent.pawn.health.hediffSet.HasHediff(concealedEstrusDef)) parent.pawn.health.RemoveHediff(concealedHediff);
}
if (hediff != null)
{
hediff.Severity = (float)days / Configurations.CycleAcceleration + 0.2f;
}
else
{
hediff = (HediffWithComps)HediffMaker.MakeHediff(estrusdef, parent.pawn);
hediff = HediffMaker.MakeHediff(estrusdef, parent.pawn);
hediff.Severity = (float)days / Configurations.CycleAcceleration + 0.2f;
parent.pawn.health.AddHediff(hediff);
}