Compare commits

...

2 commits

Author SHA1 Message Date
lutepickle
5c27575446 Save the Biotech twins setting 2023-02-27 21:36:31 -08:00
lutepickle
92ace30022 Properly show multiple fetuses with pregenerated babies 2023-02-27 21:33:14 -08:00
4 changed files with 17 additions and 8 deletions

Binary file not shown.

View file

@ -202,7 +202,7 @@ namespace RJW_Menstruation
Scribe_Values.Look(ref EstrusAttractivenessToHookup, "EstrusAttractivenessToHookup", EstrusAttractivenessToHookup, true);
Scribe_Values.Look(ref EstrusRelationshipToHookup, "EstrusRelationshipToHookup", EstrusRelationshipToHookup, true);
Scribe_Values.Look(ref PregnancySource, "PregnancySource", PregnancySource, true);
Scribe_Values.Look(ref EnableBiotechTwins, "EnableBiotechTwins", EnableBiotechTwins, false); // Don't force save this, for now
Scribe_Values.Look(ref EnableBiotechTwins, "EnableBiotechTwins", EnableBiotechTwins, true);
Scribe_Values.Look(ref EnableHeteroOvularTwins, "EnableHeteroOvularTwins", EnableHeteroOvularTwins, true);
Scribe_Values.Look(ref EnableEnzygoticTwins, "EnableEnzygoticTwins", EnableEnzygoticTwins, true);
Scribe_Values.Look(ref EnzygoticTwinsChance, "EnzygoticTwinsChance", EnzygoticTwinsChance, true);

View file

@ -115,16 +115,25 @@ namespace RJW_Menstruation
if (hediff is Hediff_MechanoidPregnancy)
return ContentFinder<Texture2D>.Get(("Womb/Mechanoid_Fluid"), true);
ThingDef babydef = comp.Pawn.def;
HediffComp_PregeneratedBabies babiescomp = hediff?.TryGetComp<HediffComp_PregeneratedBabies>();
if (babiescomp?.HasBaby ?? false)
babydef = babiescomp.babies.First().def;
float gestationProgress = comp.StageProgress;
int babycount = hediff is Hediff_BasePregnancy preg ? preg.babies.Count : 1;
if (hediff is Hediff_BasePregnancy h)
ThingDef babydef;
int babycount;
HediffComp_PregeneratedBabies babiescomp = hediff?.TryGetComp<HediffComp_PregeneratedBabies>();
if (hediff is Hediff_BasePregnancy preg)
{
babydef = h.babies?.FirstOrDefault()?.def ?? ThingDefOf.Human;
babydef = preg.babies?.FirstOrDefault()?.def ?? ThingDefOf.Human;
babycount = preg.babies?.Count ?? 1;
}
else if (babiescomp?.HasBaby ?? false)
{
babydef = babiescomp.babies.First().def;
babycount = babiescomp.babies.Count;
}
else
{
babydef = comp.Pawn.def;
babycount = 1;
}
string fetustex = babydef.GetModExtension<PawnDNAModExtension>()?.fetusTexPath ?? "Fetus/Fetus_Default";