Compare commits

..

5 commits

Author SHA1 Message Date
ADHD_Coder
eaa28a2232 Merge branch 'forceTwinDrug' into 'dev'
Add drug forcing enzygotic twin creation

See merge request lutepickle/rjw_menstruation!9
2024-08-03 19:52:59 +00:00
lutepickle
36c88d2752 Null check for pawn job in GetOvaryIcon 2024-08-03 08:59:06 -07:00
lutepickle
3d9b22776e Remove vaginal washing order for pawns that don't cycle 2024-07-31 15:20:07 -07:00
lutepickle
80611882c9 Don't show stage or time to next stage for pawns that don't cycle 2024-07-31 15:16:06 -07:00
lutepickle
f70c2ad585 Put a warning in the log when loading a pregnancy with mother == father 2024-07-31 07:22:20 -07:00
3 changed files with 18 additions and 6 deletions

View file

@ -639,8 +639,12 @@ namespace RJW_Menstruation
if (Scribe.mode == LoadSaveMode.PostLoadInit) if (Scribe.mode == LoadSaveMode.PostLoadInit)
{ {
Initialize(); Initialize();
if (pregnancy is HediffWithParents vanillaPreg && vanillaPreg.Mother == vanillaPreg.Father) // Fix mother == father issue // Biotech labor errors if the mother is also the father, so don't let that happen
if (pregnancy is HediffWithParents vanillaPreg && vanillaPreg.Mother == vanillaPreg.Father && vanillaPreg.Mother != null)
{
Log.Warning($"Pregnancy of {Pawn} has same mother and father, setting father to null");
vanillaPreg.SetParents(vanillaPreg.Mother, null, vanillaPreg.geneSet); vanillaPreg.SetParents(vanillaPreg.Mother, null, vanillaPreg.geneSet);
}
} }
} }
@ -790,7 +794,7 @@ namespace RJW_Menstruation
{ {
get get
{ {
if (Pawn.Dead) return null; if (Pawn.Dead || !Pawn.ShouldCycle()) return null;
StringBuilder tip = new StringBuilder(); StringBuilder tip = new StringBuilder();
tip.Append(Translations.Dialog_WombInfo01); tip.Append(Translations.Dialog_WombInfo01);
tip.Append(": "); tip.Append(": ");
@ -812,7 +816,11 @@ namespace RJW_Menstruation
public override string CompDebugString() public override string CompDebugString()
{ {
if (Pawn.Dead || curStage == Stage.None || curStage == Stage.Infertile || curStage == Stage.Pregnant) return null; if (Pawn.Dead ||
!Pawn.ShouldCycle() ||
curStage == Stage.None ||
curStage == Stage.Infertile ||
curStage == Stage.Pregnant) return null;
StringBuilder debugString = new StringBuilder(); StringBuilder debugString = new StringBuilder();
debugString.Append($"Time to next state: "); debugString.Append($"Time to next state: ");
debugString.Append(GenDate.ToStringTicksToPeriod(TicksToNextStage())); debugString.Append(GenDate.ToStringTicksToPeriod(TicksToNextStage()));

View file

@ -242,7 +242,7 @@ namespace RJW_Menstruation
bool isInduced = comp is HediffComp_InducedOvulator; bool isInduced = comp is HediffComp_InducedOvulator;
if (comp.curStage == HediffComp_Menstruation.Stage.Follicular && if (comp.curStage == HediffComp_Menstruation.Stage.Follicular &&
isInduced && isInduced &&
comp.Pawn.jobs.curDriver is JobDriver_Sex job && comp.Pawn.jobs?.curDriver is JobDriver_Sex job &&
job.Sexprops != null && job.Sexprops != null &&
!UsingCondom(comp.Pawn, job.Partner) && !UsingCondom(comp.Pawn, job.Partner) &&
(job.Sexprops.sexType == xxx.rjwSextype.Vaginal || job.Sexprops.sexType == xxx.rjwSextype.DoublePenetration)) (job.Sexprops.sexType == xxx.rjwSextype.Vaginal || job.Sexprops.sexType == xxx.rjwSextype.DoublePenetration))

View file

@ -33,8 +33,12 @@ namespace RJW_Menstruation
foreach (LocalTargetInfo t in selftargets) foreach (LocalTargetInfo t in selftargets)
{ {
if (t.Pawn == pawn && pawn.HasMenstruationComp()) opts.AddDistinct(MakeSelfMenu(pawn, t)); if (t.Pawn == pawn)
break; {
if (pawn.HasMenstruationComp() && pawn.ShouldCycle())
opts.AddDistinct(MakeSelfMenu(pawn, t));
break;
}
} }
} }