Don't let a biotech pregnancy go into labor if another womb already is
This commit is contained in:
parent
2846117881
commit
8c213c4fe6
|
@ -1,4 +1,5 @@
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using System.Linq;
|
||||||
using RimWorld;
|
using RimWorld;
|
||||||
using Verse;
|
using Verse;
|
||||||
|
|
||||||
|
@ -47,4 +48,17 @@ namespace RJW_Menstruation
|
||||||
comp.Pregnancy = null;
|
comp.Pregnancy = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Prevents a pregnancy from going into labor if another pregnancy already is
|
||||||
|
[HarmonyPatch(typeof(Hediff_Pregnant), nameof(Hediff_Pregnant.GestationProgress), MethodType.Getter)]
|
||||||
|
public class Hediff_Pregnant_GestationProgess_Patch
|
||||||
|
{
|
||||||
|
public static void PostFix(Hediff_Pregnant __instance, ref float __result)
|
||||||
|
{
|
||||||
|
if (__result < 1f) return;
|
||||||
|
Pawn pawn = __instance.pawn;
|
||||||
|
if (pawn.health.hediffSet.hediffs.Any(hediff => hediff.def == HediffDefOf.PregnancyLabor || hediff.def == HediffDefOf.PregnancyLaborPushing))
|
||||||
|
__result = 0.999f;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
Version 1.0.8.1
|
Version 1.0.8.1
|
||||||
- Added the option for humans to start Biotech pregnancies if the DLC is enabled. If set, non-humans will use the old multiple pregnancy instead.
|
- Added the option for humans to start Biotech pregnancies if the DLC is enabled. If set, non-humans will use the old multiple pregnancy instead.
|
||||||
- Properly track biotech pregnancy through labor.
|
- Properly track biotech pregnancy through labor.
|
||||||
|
- A biotech pregnancy will pause before going into labor if another womb already is in labor.
|
||||||
|
|
||||||
Version 1.0.8.0
|
Version 1.0.8.0
|
||||||
- Support for RimWorld 1.4. All future changes to Menstruation will only be for Rimworld 1.4.
|
- Support for RimWorld 1.4. All future changes to Menstruation will only be for Rimworld 1.4.
|
||||||
|
|
Loading…
Reference in New Issue