diff --git a/1.4/Assemblies/RJW_Menstruation.dll b/1.4/Assemblies/RJW_Menstruation.dll index ad2bc84..ae8c52b 100644 Binary files a/1.4/Assemblies/RJW_Menstruation.dll and b/1.4/Assemblies/RJW_Menstruation.dll differ diff --git a/1.4/Languages/English/Keyed/RJW_Menstruation.xml b/1.4/Languages/English/Keyed/RJW_Menstruation.xml index e428696..d8d471e 100644 --- a/1.4/Languages/English/Keyed/RJW_Menstruation.xml +++ b/1.4/Languages/English/Keyed/RJW_Menstruation.xml @@ -45,7 +45,7 @@ Enable womb icon Enable button in health tab Enable animal cycle - Simulate animal cycles. This option will apply after next load Not recommended. + Simulate animal cycles. Not recommended. Implantation chance Base implantation chance of fertilized egg This value affects the chance of impregnation. Fertilization chance @@ -68,7 +68,7 @@ Show only image of a fetus after discovered pregnancy. Do not show any information about a fetus. Enable menopause - Enable menopause effect that makes pawn infertile in time progress If you have problems with long life races, turn off this option. This option will apply after save loaded. + Enable menopause effect that makes pawn infertile in time progress If you have problems with long life races, turn off this option. Use multiple pregnancy Use multiple pregnancy instead RJW's default pregnancy Disable this option if you are in trouble with impregnation RJW pregnancy should be turned on. Enable hetero ovular twins @@ -121,6 +121,9 @@ Estimated sperm lifespan Estimated egg lifespan Implantation chance of fertilized eggs. Chance of fertilization this hour: {0}% + Use basic RJW pregnancy + Use menstruation multiple pregnancy + Use Biotech pregnancy Reset to default Gather cum diff --git a/1.4/MilkModule/Assemblies/MilkModule.dll b/1.4/MilkModule/Assemblies/MilkModule.dll index c91f14d..7c22131 100644 Binary files a/1.4/MilkModule/Assemblies/MilkModule.dll and b/1.4/MilkModule/Assemblies/MilkModule.dll differ diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/Configurations.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/Configurations.cs index 31cfe5d..94daadc 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/Configurations.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/Configurations.cs @@ -53,7 +53,7 @@ namespace RJW_Menstruation public static float EstrusFuckabilityToHookup = RJWHookupSettings.MinimumFuckabilityToHookup; public static float EstrusAttractivenessToHookup = RJWHookupSettings.MinimumAttractivenessToHookup; public static float EstrusRelationshipToHookup = RJWHookupSettings.MinimumRelationshipToHookup; - public static bool UseMultiplePregnancy = true; + public static PregnancyType PregnancySource = PregnancyType.MultiplePregnancy; public static bool EnableHeteroOvularTwins = true; public static bool EnableEnzygoticTwins = true; public static float EnzygoticTwinsChance = EnzygoticTwinsChanceDefault; @@ -89,7 +89,7 @@ namespace RJW_Menstruation EnzygoticTwinsChanceAdjust = EnzygoticTwinsChanceAdjustDefault; EnableEnzygoticTwins = true; EnableHeteroOvularTwins = true; - UseMultiplePregnancy = true; + PregnancySource = PregnancyType.MultiplePregnancy; MaxEnzygoticTwins = MaxEnzygoticTwinsDefault; BleedingAmount = BleedingAmountDefault; MotherFirst = false; @@ -166,6 +166,13 @@ namespace RJW_Menstruation Hostile = 16 } + public enum PregnancyType + { + BaseRJW, + MultiplePregnancy, + Biotech + } + public override void ExposeData() { Scribe_Values.Look(ref ImplantationChanceAdjust, "ImplantationChanceAdjust", ImplantationChanceAdjust, true); @@ -189,7 +196,7 @@ namespace RJW_Menstruation Scribe_Values.Look(ref EstrusFuckabilityToHookup, "EstrusFuckabilityToHookup", EstrusFuckabilityToHookup, true); Scribe_Values.Look(ref EstrusAttractivenessToHookup, "EstrusAttractivenessToHookup", EstrusAttractivenessToHookup, true); Scribe_Values.Look(ref EstrusRelationshipToHookup, "EstrusRelationshipToHookup", EstrusRelationshipToHookup, true); - Scribe_Values.Look(ref UseMultiplePregnancy, "UseMultiplePregnancy", UseMultiplePregnancy, true); + Scribe_Values.Look(ref PregnancySource, "PregnancySource", PregnancySource, 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); @@ -245,8 +252,10 @@ namespace RJW_Menstruation public RJW_Menstruation(ModContentPack content) : base(content) { GetSettings(); - Configurations.HARActivated = ModLister.GetActiveModWithIdentifier("erdelf.HumanoidAlienRaces") != null; - Configurations.AnimalGeneticsActivated = ModLister.GetActiveModWithIdentifier("Mlie.AnimalGenetics") != null; + if (!ModsConfig.BiotechActive && Configurations.PregnancySource == Configurations.PregnancyType.Biotech) + Configurations.PregnancySource = Configurations.PregnancyType.MultiplePregnancy; + Configurations.HARActivated = ModsConfig.IsActive("erdelf.HumanoidAlienRaces"); + Configurations.AnimalGeneticsActivated = ModsConfig.IsActive("Mlie.AnimalGenetics"); } @@ -262,7 +271,8 @@ namespace RJW_Menstruation float mainRectHeight = -3f + (Configurations.EnableWombIcon || Configurations.EnableButtonInHT ? 400f : 0f) + (Configurations.EstrusOverridesHookupSettings ? 144f : 0f) + - (Configurations.UseMultiplePregnancy ? (Configurations.EnableEnzygoticTwins ? 175f : 75f) : 0f) + + // TODO: Also for modified Biotech pregnancies + (Configurations.PregnancySource == Configurations.PregnancyType.MultiplePregnancy ? (Configurations.EnableEnzygoticTwins ? 175f : 75f) : 0f) + (Configurations.EnableBirthVaginaMorph ? 48f : 0f); Rect mainRect = new Rect(0f, 0f, inRect.width - 30f, Math.Max(inRect.height + mainRectHeight, 1f)); int Adjust; @@ -415,8 +425,14 @@ namespace RJW_Menstruation Configurations.EstrusRelationshipToHookup = listmain.Slider((int)Configurations.EstrusRelationshipToHookup, -100f, 100f); } - listmain.CheckboxLabeled(Translations.Option13_Label, ref Configurations.UseMultiplePregnancy, Translations.Option13_Desc); - if (Configurations.UseMultiplePregnancy) + if (listmain.RadioButton(Translations.Option_PregnancyFromBaseRJW_Label, Configurations.PregnancySource == Configurations.PregnancyType.BaseRJW)) + Configurations.PregnancySource = Configurations.PregnancyType.BaseRJW; + if (listmain.RadioButton(Translations.Option_PregnancyFromMultiplePregnancy_Label, Configurations.PregnancySource == Configurations.PregnancyType.MultiplePregnancy)) + Configurations.PregnancySource = Configurations.PregnancyType.MultiplePregnancy; + if (ModsConfig.BiotechActive && listmain.RadioButton(Translations.Option_PregnancyFromBiotech_Label, Configurations.PregnancySource == Configurations.PregnancyType.Biotech)) + Configurations.PregnancySource = Configurations.PregnancyType.Biotech; + // TODO: Also for modified Biotech pregnancy + if (Configurations.PregnancySource == Configurations.PregnancyType.MultiplePregnancy) { float sectionheight = 75f; if (Configurations.EnableEnzygoticTwins) sectionheight += 100; @@ -459,19 +475,14 @@ namespace RJW_Menstruation listmain.EndSection(vmsection); } - - Widgets.EndScrollView(); - listmain.CheckboxLabeled(Translations.Option8_Label, ref Configurations.Debug, Translations.Option8_Desc); if (listmain.ButtonText(Translations.Button_ResetToDefault)) { Configurations.SettoDefault(); - } listmain.End(); - - + Widgets.EndScrollView(); } diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_InducedOvulator.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_InducedOvulator.cs index a1ab09a..55b7ecf 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_InducedOvulator.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_InducedOvulator.cs @@ -67,7 +67,7 @@ namespace RJW_Menstruation { get { - if (Pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) return false; + if (Pawn.HasIUD()) return false; switch (curStage) { diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs index 4ebd3b4..29b54cc 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs @@ -166,7 +166,7 @@ namespace RJW_Menstruation { get { - if (opcache >= 0) return opcache; + if (opcache > 0) return opcache; float avglittersize; try { @@ -182,6 +182,7 @@ namespace RJW_Menstruation avglittersize * yearsBeforeMenopause * (Pawn.def.race.lifeExpectancy / ThingDefOf.Human.race.lifeExpectancy)); + if (opcache == 0) opcache = 1; return opcache; } } @@ -193,7 +194,7 @@ namespace RJW_Menstruation { get { - if (!Configurations.EnableMenopause || Props.infertile) return Mathf.Min(1.0f, ovarypower / OvaryPowerThreshold); + if (!Configurations.EnableMenopause || Props.infertile) return Mathf.Max(1.0f, ovarypower / OvaryPowerThreshold); else return ovarypower / OvaryPowerThreshold; } } @@ -471,7 +472,7 @@ namespace RJW_Menstruation { get { - if (Pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) return false; + if (Pawn.HasIUD()) return false; switch (curStage) { @@ -638,7 +639,7 @@ namespace RJW_Menstruation CumOut(); - if (pregnancy == null && (Pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) || EggHealth <= 0) curStage = Stage.Infertile; + if (pregnancy == null && (Pawn.health.capacities.GetLevel(xxx.reproduction) <= 0 || EggHealth <= 0 || Pawn.SterileGenes())) curStage = Stage.Infertile; switch (curStage) { case Stage.Follicular: @@ -738,7 +739,7 @@ namespace RJW_Menstruation public void CumIn(Pawn pawn, float volume, float fertility = 1.0f, ThingDef filthdef = null) { if (volume <= 0) return; - if (Pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) fertility /= 100f; + if (Pawn.HasIUD()) fertility /= 100f; float cumd = TotalCumPercent; float tmp = TotalCum + volume; if (tmp > CumCapacity) @@ -851,7 +852,7 @@ namespace RJW_Menstruation Hediff asa = Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_ASA); float asafactor = asa?.Severity ?? 0f; - if (Pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) antisperm = 0.70f + asafactor; + if (Pawn.HasIUD()) antisperm = 0.70f + asafactor; else antisperm = 0.0f + asafactor; absorber = (Absorber)Pawn.apparel?.WornApparel?.Find(x => x is Absorber); @@ -1234,7 +1235,8 @@ namespace RJW_Menstruation if (Configurations.Debug) Log.Message($"Implanting fertilized egg of {Pawn} into {parent}, father {egg.fertilizer}"); if (pregnancy != null) { - if (Configurations.UseMultiplePregnancy && Configurations.EnableHeteroOvularTwins) + // TODO: Modified Biotech pregnancy + if (Configurations.PregnancySource == Configurations.PregnancyType.MultiplePregnancy && Configurations.EnableHeteroOvularTwins) { if (pregnancy is Hediff_MultiplePregnancy h) { @@ -1252,30 +1254,41 @@ namespace RJW_Menstruation } else { - if (!Configurations.UseMultiplePregnancy) + Configurations.PregnancyType usePregnancy = xxx.is_human(Pawn) ? Configurations.PregnancySource : Configurations.PregnancyType.MultiplePregnancy; + switch (usePregnancy) { - if (Configurations.Debug) Log.Message($"Creating new base RJW pregnancy"); - PregnancyHelper.PregnancyDecider(Pawn, egg.fertilizer); - // I hate having to do this, but it gets the newest pregnancy - List pregnancies = new List(); - Pawn.health.hediffSet.GetHediffs(ref pregnancies); - pregnancy = pregnancies.MaxBy(hediff => hediff.loadID); - pregnant = true; - break; - } - else - { - if (Configurations.Debug) Log.Message($"Creating new menstruation pregnancy"); - pregnancy = Hediff_BasePregnancy.Create(Pawn, egg.fertilizer); - pregnant = true; - deadeggs.Add(egg); + case Configurations.PregnancyType.BaseRJW: + + if (Configurations.Debug) Log.Message($"Creating new base RJW pregnancy"); + PregnancyHelper.PregnancyDecider(Pawn, egg.fertilizer); + // I hate having to do this, but it gets the newest pregnancy + List pregnancies = new List(); + Pawn.health.hediffSet.GetHediffs(ref pregnancies); + pregnancy = pregnancies.MaxBy(hediff => hediff.loadID); + pregnant = true; + break; + + case Configurations.PregnancyType.MultiplePregnancy: + if (Configurations.Debug) Log.Message($"Creating new menstruation pregnancy"); + pregnancy = Hediff_BasePregnancy.Create(Pawn, egg.fertilizer); + pregnant = true; + deadeggs.Add(egg); + break; + + case Configurations.PregnancyType.Biotech: + if (Configurations.Debug) Log.Message($"Creating new biotech pregnancy"); + pregnancy = HediffMaker.MakeHediff(HediffDefOf.PregnantHuman, Pawn); + ((Hediff_Pregnant)pregnancy).SetParents(Pawn, egg.fertilizer, PregnancyUtility.GetInheritedGeneSet(egg.fertilizer, Pawn)); + Pawn.health.AddHediff(pregnancy); + break; } if (pregnancy is Hediff_BasePregnancy rjw_preg) { + // TODO: advance biotech pregnancy rjw_preg.p_start_tick -= egg.fertstage / Configurations.CycleAcceleration * GenDate.TicksPerHour; rjw_preg.p_end_tick -= egg.fertstage / Configurations.CycleAcceleration * GenDate.TicksPerHour; } - // TODO: advance biotech pregnancy + if (!(pregnancy is Hediff_MultiplePregnancy)) break; } } @@ -1286,7 +1299,7 @@ namespace RJW_Menstruation } } - if (pregnant && (!Configurations.UseMultiplePregnancy || !Configurations.EnableHeteroOvularTwins)) + if (pregnant && (Configurations.PregnancySource != Configurations.PregnancyType.MultiplePregnancy || !Configurations.EnableHeteroOvularTwins)) { eggs.Clear(); return true; @@ -1537,7 +1550,7 @@ namespace RJW_Menstruation { if (curStageHrs >= currentIntervalHours) { - if (Pawn.health.capacities.GetLevel(xxx.reproduction) == 0 || EggHealth <= 0) + if (Pawn.health.capacities.GetLevel(xxx.reproduction) == 0 || EggHealth <= 0 || Pawn.SterileGenes()) { GoNextStage(Stage.Infertile); } @@ -1559,7 +1572,7 @@ namespace RJW_Menstruation protected virtual void InfertileAction() { - if (Pawn.health.capacities.GetLevel(xxx.reproduction) <= 0 || EggHealth <= 0) + if (Pawn.health.capacities.GetLevel(xxx.reproduction) <= 0 || EggHealth <= 0 || Pawn.SterileGenes()) { StayCurrentStageConst(Stage.Infertile); } diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs index a243f52..7d3ffa3 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs @@ -92,10 +92,7 @@ namespace RJW_Menstruation if (hediff is Hediff_MechanoidPregnancy) return ContentFinder.Get(("Womb/Mechanoid_Fluid"), true); - string icon = "Fetus/Slime_Abomi02"; - string fetustex = "Fetus/Fetus_Default"; ThingDef babydef = comp.Pawn.def; // TODO: Pregenerated babies - float gestationProgress = comp.StageProgress; int babycount = hediff is Hediff_BasePregnancy preg ? preg.babies.Count : 1; @@ -103,8 +100,9 @@ namespace RJW_Menstruation { babydef = h.babies?.FirstOrDefault()?.def ?? ThingDefOf.Human; } - - fetustex = babydef.GetModExtension()?.fetusTexPath ?? "Fetus/Fetus_Default"; + + string fetustex = babydef.GetModExtension()?.fetusTexPath ?? "Fetus/Fetus_Default"; + string icon; if (gestationProgress < 0.2f) icon = comp.WombTex + "_Implanted"; else if (gestationProgress < 0.3f) { @@ -357,5 +355,12 @@ namespace RJW_Menstruation return res; } + + public static bool HasIUD(this Pawn pawn) + { + if (pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) return true; + if (ModsConfig.BiotechActive && pawn.health.hediffSet.HasHediff(HediffDefOf.ImplantedIUD)) return true; + return false; + } } } diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs index 8abaf18..e7c91dc 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs @@ -439,10 +439,25 @@ namespace RJW_Menstruation firstbaby = baby; request.FixedGender = baby.gender; request.ForcedEndogenes = baby.genes?.Endogenes.Select(gene => gene.def).ToList(); + if (baby.genes != null && ModsConfig.BiotechActive) + { + if (GeneUtility.SameHeritableXenotype(mother, father) && mother.genes.UniqueXenotype) + { + baby.genes.xenotypeName = mother.genes.xenotypeName; + baby.genes.iconDef = mother.genes.iconDef; + } + XenotypeDef xenoTypeDef = BabyXenoTypeDecider(mother, father, out bool hybridBaby); + if (xenoTypeDef != null) baby.genes.SetXenotypeDirect(xenoTypeDef); + if(hybridBaby) + { + baby.genes.hybrid = true; + baby.genes.xenotypeName = "Hybrid".Translate(); + } + } } else { - enzygoticSiblings?.Add(baby, firstbaby); + enzygoticSiblings.Add(baby, firstbaby); if (baby.story != null) { @@ -451,6 +466,14 @@ namespace RJW_Menstruation baby.story.bodyType = firstbaby.story.bodyType; } + if (baby.genes != null && ModsConfig.BiotechActive) + { + baby.genes.SetXenotypeDirect(firstbaby.genes.Xenotype); + baby.genes.xenotypeName = firstbaby.genes.xenotypeName; + baby.genes.iconDef = firstbaby.genes.iconDef; + baby.genes.hybrid = firstbaby.genes.hybrid; + } + if (baby.IsHAR()) HARCompatibility.CopyHARProperties(baby, firstbaby); //if (Configurations.AnimalGeneticsActivated) @@ -621,6 +644,39 @@ namespace RJW_Menstruation } + public XenotypeDef BabyXenoTypeDecider(Pawn mother, Pawn father, out bool hybrid) + { + hybrid = false; + bool hybridMother = mother?.genes?.hybrid ?? false; + bool hybridFather = father?.genes?.hybrid ?? false; + if (hybridMother && hybridFather) + { + hybrid = true; + return null; + } + XenotypeDef motherInheritableXenotype = mother?.genes?.Xenotype; + XenotypeDef fatherInheritableXenotype = father?.genes?.Xenotype; + if (!motherInheritableXenotype.inheritable) motherInheritableXenotype = null; + if (!fatherInheritableXenotype.inheritable) fatherInheritableXenotype = null; + + // If they're the same (or both null) + if (motherInheritableXenotype == fatherInheritableXenotype) + { + // Both null, but one's a hybrid + if (motherInheritableXenotype == null && (hybridMother || hybridFather)) + hybrid = true; + + return motherInheritableXenotype; + } + + // If one is null and the other isn't + if ((motherInheritableXenotype == null) != (fatherInheritableXenotype == null)) return motherInheritableXenotype ?? fatherInheritableXenotype; + + // So two different inheritable ones + hybrid = true; + return null; + } + public PawnKindDef GetHybrid(Pawn first, Pawn second) { PawnKindDef res = null; diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/Biotech_Patch.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/Biotech_Patch.cs new file mode 100644 index 0000000..2257c55 --- /dev/null +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/Biotech_Patch.cs @@ -0,0 +1,64 @@ +using HarmonyLib; +using System.Linq; +using RimWorld; +using Verse; + +namespace RJW_Menstruation +{ + [HarmonyPatch(typeof(Hediff_Pregnant), "Miscarry")] + public class Miscarry_Patch + { + public static void Postfix(Hediff_Pregnant __instance) + { + HediffComp_Menstruation comp = __instance.GetMenstruationCompFromPregnancy(); + if (comp == null) return; + comp.Pregnancy = null; + } + } + + [HarmonyPatch(typeof(Hediff_Pregnant), nameof(Hediff_Pregnant.StartLabor))] + public class StartLabor_Patch + { + public static void Postfix(Hediff_Pregnant __instance) + { + HediffComp_Menstruation comp = __instance.GetMenstruationCompFromPregnancy(); + if (comp == null) return; + comp.Pregnancy = __instance.pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.PregnancyLabor); + } + } + + [HarmonyPatch(typeof(Hediff_Labor), nameof(Hediff_Labor.PreRemoved))] + public class Labor_PreRemoved_Patch + { + public static void PostFix(Hediff_Labor __instance) + { + HediffComp_Menstruation comp = __instance.GetMenstruationCompFromPregnancy(); + if (comp == null) return; + comp.Pregnancy = __instance.pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.PregnancyLaborPushing); + } + } + + [HarmonyPatch(typeof(Hediff_LaborPushing), nameof(Hediff_LaborPushing.PreRemoved))] + public class LaborPushing_PreRemoved_Patch + { + public static void PostFix(Hediff_LaborPushing __instance) + { + HediffComp_Menstruation comp = __instance.GetMenstruationCompFromPregnancy(); + if (comp == null) return; + 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; + } + } +} \ No newline at end of file diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/RJW_Patch.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/RJW_Patch.cs index 18931b3..5062aee 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/RJW_Patch.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/RJW_Patch.cs @@ -1,4 +1,5 @@ using HarmonyLib; +using RimWorld; using rjw; using rjw.Modules.Interactions.Enums; using rjw.Modules.Interactions.Objects; @@ -42,7 +43,7 @@ namespace RJW_Menstruation } else if (Genital_Helper.has_ovipositorM(pawn, pawnparts)) { - comp.CumIn(pawn, Rand.Range(0.75f, 4.5f) * pawn.BodySize, 1.0f); + comp.CumIn(pawn, Rand.Range(0.75f, 4.5f) * pawn.BodySize, partner.SterileGenes() ? 0.0f : 1.0f); } else comp.CumIn(pawn, pawn.GetCumVolume(pawnparts), 0); @@ -114,7 +115,7 @@ namespace RJW_Menstruation comp.CumIn(pawn, pawn.GetCumVolume(), 0); return false; } - else comp.CumIn(pawn, pawn.GetCumVolume(), pawn.health.capacities.GetLevel(xxx.reproduction)); + else comp.CumIn(pawn, pawn.GetCumVolume(), pawn.SterileGenes() ? 0.0f : pawn.health.capacities.GetLevel(xxx.reproduction)); return false; } } diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj b/1.4/source/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj index 35f0a1c..22ab246 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj @@ -70,6 +70,7 @@ + diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/Translations.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/Translations.cs index 8f0de67..973a90b 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/Translations.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/Translations.cs @@ -122,6 +122,9 @@ namespace RJW_Menstruation public static readonly string Option_EstrusFuckability_Label = "Option_EstrusFuckability_Label".Translate(); public static readonly string Option_EstrusAttractability_Label = "Option_EstrusAttractability_Label".Translate(); public static readonly string Option_EstrusRelationship_Label = "Option_EstrusRelationship_Label".Translate(); + public static readonly string Option_PregnancyFromBaseRJW_Label = "Option_PregnancyFromBaseRJW_Label".Translate(); + public static readonly string Option_PregnancyFromMultiplePregnancy_Label = "Option_PregnancyFromMultiplePregnancy_Label".Translate(); + public static readonly string Option_PregnancyFromBiotech_Label = "Option_PregnancyFromBiotech_Label".Translate(); public static readonly string Button_ResetToDefault = "Button_ResetToDefault".Translate(); diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_WombStatus.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_WombStatus.cs index e90643b..8a8e380 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_WombStatus.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_WombStatus.cs @@ -230,7 +230,7 @@ namespace RJW_Menstruation fontstyleright.alignment = TextAnchor.MiddleRight; buttonstyle.alignment = TextAnchor.MiddleLeft; - string father = p.Father.LabelShort; + string father = p.Father?.LabelShort ?? Translations.Dialog_FatherUnknown; GUI.Box(preginfo, "1 " + p.Mother.def.label + " " + Translations.Dialog_WombInfo02, buttonstyle); GUI.Label(preginfo, Translations.Dialog_WombInfo03 + ": " + father + " ", fontstyleright); diff --git a/About/Manifest.xml b/About/Manifest.xml index b1bb3ff..a46c110 100644 --- a/About/Manifest.xml +++ b/About/Manifest.xml @@ -1,7 +1,7 @@ RJW Menstruation - 1.0.8.0 + 1.0.8.1 diff --git a/LoadFolders.xml b/LoadFolders.xml index 4179abb..1707748 100644 --- a/LoadFolders.xml +++ b/LoadFolders.xml @@ -13,7 +13,7 @@
  • 1.4
  • -
  • 1.4/RJW Menstruation Race Support
  • +
  • 1.4/RJW Menstruation Race Support
  • \ No newline at end of file diff --git a/changelogs.txt b/changelogs.txt index 1ab4156..f1d9b91 100644 --- a/changelogs.txt +++ b/changelogs.txt @@ -1,3 +1,14 @@ +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. + - Babies conceived through the multiple pregnancy option will now properly inherit xenotypes. + - Properly track biotech pregnancy through labor. + - Pawns that are genetically sterile will no longer produce fertile cum, nor have a menstrual cycle. + - Biotech IUDs will now reduce pregnancy chances the same as an RJW IUD. Using both will not stack. + - A biotech pregnancy will pause before going into labor if another womb already is in labor. + - Fix disabling menopause not actually disabling menopause. + - Fix errors in womb dialog for Biotech pregnancies with null father. + - Properly detect AsmodeusRex's race support. + Version 1.0.8.0 - Support for RimWorld 1.4. All future changes to Menstruation will only be for Rimworld 1.4. - Existing Biotech pregnancies will appear in a womb, but no support yet for starting a Biotech pregnancy.