Fixed biotech pregnancy not counting for pregnancy precepts

This commit is contained in:
amevarashi 2022-10-29 16:22:41 +05:00
parent 450c835d2b
commit b6942e3c10
6 changed files with 18 additions and 8 deletions

View file

@ -80,5 +80,18 @@ namespace RJWSexperience.Ideology
return bestSeenSize;
}
public static bool IsVisiblyPregnant(Pawn pawn)
{
Hediff pregnancy = PregnancyHelper.GetPregnancy(pawn);
// Currently RJW does not check Biotech pregnancy
if (pregnancy == null && VariousDefOf.PregnantHuman != null)
{
pregnancy = pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.PregnantHuman);
}
return pregnancy?.Visible == true;
}
}
}

View file

@ -1,5 +1,4 @@
using RimWorld;
using rjw;
using Verse;
namespace RJWSexperience.Ideology.PreceptWorkers
@ -15,7 +14,7 @@ namespace RJWSexperience.Ideology.PreceptWorkers
/// <returns></returns>
protected override ThoughtState ShouldHaveThought(Pawn p)
{
return p?.DevelopmentalStage == DevelopmentalStage.Adult && PregnancyHelper.GetPregnancy(p)?.Visible != true;
return p?.DevelopmentalStage == DevelopmentalStage.Adult && !IdeoUtility.IsVisiblyPregnant(p);
}
}
}

View file

@ -1,5 +1,4 @@
using RimWorld;
using rjw;
using Verse;
namespace RJWSexperience.Ideology.PreceptWorkers
@ -18,7 +17,7 @@ namespace RJWSexperience.Ideology.PreceptWorkers
{
return otherPawn?.DevelopmentalStage == DevelopmentalStage.Adult &&
p?.DevelopmentalStage == DevelopmentalStage.Adult &&
PregnancyHelper.GetPregnancy(otherPawn)?.Visible != true;
!IdeoUtility.IsVisiblyPregnant(otherPawn);
}
}
}

View file

@ -1,5 +1,4 @@
using RimWorld;
using rjw;
using Verse;
namespace RJWSexperience.Ideology.PreceptWorkers
@ -15,7 +14,7 @@ namespace RJWSexperience.Ideology.PreceptWorkers
/// <returns></returns>
protected override ThoughtState ShouldHaveThought(Pawn p)
{
return p?.DevelopmentalStage == DevelopmentalStage.Adult && PregnancyHelper.GetPregnancy(p)?.Visible == true;
return p?.DevelopmentalStage == DevelopmentalStage.Adult && IdeoUtility.IsVisiblyPregnant(p);
}
}
}

View file

@ -1,5 +1,4 @@
using RimWorld;
using rjw;
using Verse;
namespace RJWSexperience.Ideology.PreceptWorkers
@ -18,7 +17,7 @@ namespace RJWSexperience.Ideology.PreceptWorkers
{
return otherPawn?.DevelopmentalStage == DevelopmentalStage.Adult &&
p?.DevelopmentalStage == DevelopmentalStage.Adult &&
PregnancyHelper.GetPregnancy(otherPawn)?.Visible == true;
IdeoUtility.IsVisiblyPregnant(otherPawn);
}
}
}

View file

@ -22,5 +22,6 @@ namespace RJWSexperience.Ideology
[MayRequireIdeology] public static readonly PreceptDef Submissive_Male;
[MayRequireIdeology] public static readonly PreceptDef Submissive_Female;
[MayRequireIdeology] public static readonly PreceptDef ProselyzingByOrgasm;
[MayRequireBiotech] public static readonly HediffDef PregnantHuman;
}
}