diff --git a/1.4/Assemblies/RJW_Menstruation.dll b/1.4/Assemblies/RJW_Menstruation.dll index 1ef9e7f..bd3e682 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_PregeneratedBabies.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_PregeneratedBabies.cs index c83daef..5f94980 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_PregeneratedBabies.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_PregeneratedBabies.cs @@ -94,11 +94,12 @@ namespace RJW_Menstruation Pawn baby = PawnGenerator.GeneratePawn(request); if (baby == null) break; PregnancyCommon.SetupBabyXenotype(mother, father, baby); // Probably redundant with Biotech post-birth xenotyping - baby.Drawer.renderer.graphics.ResolveAllGraphics(); if (division > 1) { if (i == 0) { + if (baby.IsHAR()) + baby.Drawer.renderer.graphics.ResolveAllGraphics(); firstbaby = baby; request.FixedGender = baby.gender; request.ForcedEndogenes = baby.genes?.Endogenes.Select(gene => gene.def).ToList(); @@ -113,7 +114,6 @@ namespace RJW_Menstruation baby.story.hairDef = firstbaby.story.hairDef; baby.story.bodyType = firstbaby.story.bodyType; baby.story.furDef = firstbaby.story.furDef; - baby.story.skinColorOverride = firstbaby.story.skinColorOverride; } if (baby.genes != null) @@ -163,8 +163,6 @@ namespace RJW_Menstruation Pawn baby = comp.PopBaby(); if (baby == null) return PawnGenerator.GeneratePawn(request); // Shouldn't happen - baby.ageTracker.AgeBiologicalTicks = 0; - baby.ageTracker.AgeChronologicalTicks = 0; if (request.ForceDead) baby.Kill(null, null); return baby; } @@ -283,18 +281,4 @@ namespace RJW_Menstruation } } } - - // HAR patches ApplyBirthOutcome to produce multiple babies based on the mother's littersize. But the pregenerated babies system already makes multiple babies - // So make it always consider the mother to have one baby - public static class HAR_LitterSize_Undo - { - public static void Postfix(ref int __result, Pawn mother) - { - if (Configurations.PregnancySource != Configurations.PregnancyType.Biotech || !Configurations.EnableBiotechTwins) return; - // 'mother' is the genetic mother, but unless she's in labor at the same time the birtherthing is spitting out, this will work as intended - if (mother?.health.hediffSet.GetFirstHediff()?.TryGetComp()?.HasBaby ?? false) - __result = 0; - return; - } - } } 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 907b36a..0d44d2e 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs @@ -331,14 +331,12 @@ namespace RJW_Menstruation Pawn baby = GenerateBaby(request, mother, father, parentTraits, traitSeed); if (baby == null) break; PregnancyCommon.SetupBabyXenotype(mother, father, baby); - // HAR and some xenotype mods don't randomize graphics until it's rendered - // So poke it early - baby.Drawer.renderer.graphics.ResolveAllGraphics(); if (division > 1) { if (i == 0) - { - + { + if (baby.IsHAR()) // Have HAR determine the first baby's properties + baby.Drawer.renderer.graphics.ResolveAllGraphics(); firstbaby = baby; request.FixedGender = baby.gender; request.ForcedEndogenes = baby.genes?.Endogenes.Select(gene => gene.def).ToList(); @@ -353,7 +351,6 @@ namespace RJW_Menstruation baby.story.hairDef = firstbaby.story.hairDef; baby.story.bodyType = firstbaby.story.bodyType; baby.story.furDef = firstbaby.story.furDef; - baby.story.skinColorOverride = firstbaby.story.skinColorOverride; } if (baby.genes != null && ModsConfig.BiotechActive) diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/Harmony.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/Harmony.cs index 29978fd..d701d49 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/Harmony.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/Harmony.cs @@ -1,5 +1,4 @@ -using AlienRace; -using HarmonyLib; +using HarmonyLib; using rjw; using rjw.Modules.Interactions.Internals.Implementation; using rjw.Modules.Interactions.Rules.PartKindUsageRules; @@ -17,11 +16,6 @@ namespace RJW_Menstruation { Harmony har = new Harmony("RJW_Menstruation"); har.PatchAll(Assembly.GetExecutingAssembly()); - if (ModsConfig.IsActive("erdelf.HumanoidAlienRaces")) // Don't use the cached in Configurations, it isn't initialized yet - { - har.Patch(typeof(AlienRace.HarmonyPatches).GetMethod(nameof(AlienRace.HarmonyPatches.BirthOutcomeMultiplier)), - postfix: new HarmonyMethod(typeof(HAR_LitterSize_Undo).GetMethod(nameof(HAR_LitterSize_Undo.Postfix)))); - } InjectIntoRjwInteractionServices(); }