diff --git a/1.4/Assemblies/RJW_Menstruation.dll b/1.4/Assemblies/RJW_Menstruation.dll index 7aadb4a..4179a95 100644 Binary files a/1.4/Assemblies/RJW_Menstruation.dll and b/1.4/Assemblies/RJW_Menstruation.dll differ 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 55b7ecf..a1ab09a 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.HasIUD()) return false; + if (Pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) 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 88cb3f8..b3b1e84 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 @@ -472,7 +472,7 @@ namespace RJW_Menstruation { get { - if (Pawn.HasIUD()) return false; + if (Pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) return false; switch (curStage) { @@ -639,7 +639,7 @@ namespace RJW_Menstruation CumOut(); - if (pregnancy == null && (Pawn.health.capacities.GetLevel(xxx.reproduction) <= 0 || EggHealth <= 0 || Pawn.SterileGenes())) curStage = Stage.Infertile; + if (pregnancy == null && (Pawn.health.capacities.GetLevel(xxx.reproduction) <= 0) || EggHealth <= 0) curStage = Stage.Infertile; switch (curStage) { case Stage.Follicular: @@ -739,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.HasIUD()) fertility /= 100f; + if (Pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) fertility /= 100f; float cumd = TotalCumPercent; float tmp = TotalCum + volume; if (tmp > CumCapacity) @@ -852,7 +852,7 @@ namespace RJW_Menstruation Hediff asa = Pawn.health.hediffSet.GetFirstHediffOfDef(VariousDefOf.Hediff_ASA); float asafactor = asa?.Severity ?? 0f; - if (Pawn.HasIUD()) antisperm = 0.70f + asafactor; + if (Pawn.health.hediffSet.HasHediff(VariousDefOf.RJW_IUD)) antisperm = 0.70f + asafactor; else antisperm = 0.0f + asafactor; absorber = (Absorber)Pawn.apparel?.WornApparel?.Find(x => x is Absorber); 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 7d3ffa3..a243f52 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs @@ -92,7 +92,10 @@ 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; @@ -100,9 +103,8 @@ namespace RJW_Menstruation { babydef = h.babies?.FirstOrDefault()?.def ?? ThingDefOf.Human; } - - string fetustex = babydef.GetModExtension()?.fetusTexPath ?? "Fetus/Fetus_Default"; - string icon; + + fetustex = babydef.GetModExtension()?.fetusTexPath ?? "Fetus/Fetus_Default"; if (gestationProgress < 0.2f) icon = comp.WombTex + "_Implanted"; else if (gestationProgress < 0.3f) { @@ -355,12 +357,5 @@ 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 e7c91dc..1142ff4 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs @@ -439,15 +439,14 @@ 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) { - 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); + baby.genes.xenotypeName = mother.genes.xenotypeName; + baby.genes.iconDef = mother.genes.iconDef; + } + if (baby.genes != null) + { + baby.genes.SetXenotypeDirect(BabyXenoTypeDecider(mother, father, out bool hybridBaby)); if(hybridBaby) { baby.genes.hybrid = true; @@ -457,7 +456,7 @@ namespace RJW_Menstruation } else { - enzygoticSiblings.Add(baby, firstbaby); + enzygoticSiblings?.Add(baby, firstbaby); if (baby.story != null) { @@ -466,7 +465,7 @@ namespace RJW_Menstruation baby.story.bodyType = firstbaby.story.bodyType; } - if (baby.genes != null && ModsConfig.BiotechActive) + if (baby.genes != null) { baby.genes.SetXenotypeDirect(firstbaby.genes.Xenotype); baby.genes.xenotypeName = firstbaby.genes.xenotypeName; 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 5062aee..18931b3 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,5 +1,4 @@ using HarmonyLib; -using RimWorld; using rjw; using rjw.Modules.Interactions.Enums; using rjw.Modules.Interactions.Objects; @@ -43,7 +42,7 @@ namespace RJW_Menstruation } else if (Genital_Helper.has_ovipositorM(pawn, pawnparts)) { - comp.CumIn(pawn, Rand.Range(0.75f, 4.5f) * pawn.BodySize, partner.SterileGenes() ? 0.0f : 1.0f); + comp.CumIn(pawn, Rand.Range(0.75f, 4.5f) * pawn.BodySize, 1.0f); } else comp.CumIn(pawn, pawn.GetCumVolume(pawnparts), 0); @@ -115,7 +114,7 @@ namespace RJW_Menstruation comp.CumIn(pawn, pawn.GetCumVolume(), 0); return false; } - else comp.CumIn(pawn, pawn.GetCumVolume(), pawn.SterileGenes() ? 0.0f : pawn.health.capacities.GetLevel(xxx.reproduction)); + else comp.CumIn(pawn, pawn.GetCumVolume(), pawn.health.capacities.GetLevel(xxx.reproduction)); return false; } } 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 8a8e380..e90643b 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 ?? Translations.Dialog_FatherUnknown; + string father = p.Father.LabelShort; GUI.Box(preginfo, "1 " + p.Mother.def.label + " " + Translations.Dialog_WombInfo02, buttonstyle); GUI.Label(preginfo, Translations.Dialog_WombInfo03 + ": " + father + " ", fontstyleright); diff --git a/changelogs.txt b/changelogs.txt index 5242c1d..0b61fda 100644 --- a/changelogs.txt +++ b/changelogs.txt @@ -2,10 +2,7 @@ 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 errors in womb dialog for Biotech pregnancies with null father. Version 1.0.8.0 - Support for RimWorld 1.4. All future changes to Menstruation will only be for Rimworld 1.4.