diff --git a/1.4/Languages/ChineseTraditional/DefInjected/RecipeDef/Recipes_Surgery_Breast.xml b/1.4/Languages/ChineseTraditional/DefInjected/Recipe_Surgery/Recipes_Surgery_Breast.xml similarity index 100% rename from 1.4/Languages/ChineseTraditional/DefInjected/RecipeDef/Recipes_Surgery_Breast.xml rename to 1.4/Languages/ChineseTraditional/DefInjected/Recipe_Surgery/Recipes_Surgery_Breast.xml diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Breast.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Breast.cs index b0d8b79..6edeabe 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Breast.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Breast.cs @@ -257,7 +257,7 @@ namespace RJW_Menstruation } } // Scenario B: Pregnant, grow in the second half of first trimester - else if (Pawn.IsRJWPregnant() || Pawn.IsBiotechPregnant()) + else if (Pawn.IsRJWPregnant()) { float pregnancySize = Mathf.InverseLerp(breastGrowthStart, breastGrowthEnd, Pawn.GetFarthestPregnancyProgress()) * MaxBreastIncrement; if (breastSizeIncreased > pregnancySize) @@ -293,7 +293,7 @@ namespace RJW_Menstruation float newNippleProgress; if (ageOfLastBirth + BabyHalfAge * GenDate.TicksPerYear > Pawn.ageTracker.AgeBiologicalTicks) newNippleProgress = 1f; - else if (Pawn.IsRJWPregnant() || Pawn.IsBiotechPregnant()) + else if (Pawn.IsRJWPregnant()) newNippleProgress = nippleTransitions.Evaluate(Pawn.GetFarthestPregnancyProgress()); else newNippleProgress = 0f; 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 18a9604..7d3ffa3 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/MenstruationUtility.cs @@ -362,34 +362,5 @@ namespace RJW_Menstruation if (ModsConfig.BiotechActive && pawn.health.hediffSet.HasHediff(HediffDefOf.ImplantedIUD)) return true; return false; } - - public static float DamagePants(this Pawn pawn, float fluidAmount) - { - if (pawn.apparel == null) return 0; - Apparel pants = null; - foreach(Apparel apparel in pawn.apparel.WornApparel.Where(app => app.def.apparel.bodyPartGroups.Contains(BodyPartGroupDefOf.Legs))) - { - if (apparel.def.apparel.LastLayer == ApparelLayerDefOf.OnSkin) - { - pants = apparel; - break; - } - else if (pants == null || apparel.def.apparel.LastLayer == ApparelLayerDefOf.Middle) - // Either grab whatever's available or reassign the pants from shell to a middle - pants = apparel; - // Pants are middle and this is a shell - else continue; - } - if (pants == null) return 0; - - const float HPPerMl = 0.5f; - - DamageWorker.DamageResult damage = pants.TakeDamage(new DamageInfo(DamageDefOf.Deterioration, fluidAmount * HPPerMl, spawnFilth: false)); - - if (pants.Destroyed && PawnUtility.ShouldSendNotificationAbout(pawn) && !pawn.Dead) - Messages.Message("MessageWornApparelDeterioratedAway".Translate(GenLabel.ThingLabel(pants.def, pants.Stuff), pawn).CapitalizeFirst(), pawn, MessageTypeDefOf.NegativeEvent); - - return damage.totalDamageDealt; - } } } 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 0641e24..699cf02 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs @@ -426,10 +426,10 @@ namespace RJW_Menstruation } if (division > 1) { + if (baby.IsHAR()) // necessary for HAR to decide on graphical properties pre-birth + baby.Drawer.renderer.graphics.ResolveAllGraphics(); 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(); 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 index a6d34e2..f9dc764 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/Biotech_Patch.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/Biotech_Patch.cs @@ -141,7 +141,7 @@ namespace RJW_Menstruation // Also called for Recipe_TerminatePregnancy.ApplyOnPawn public static IEnumerable Transpiler(IEnumerable instructions) { - if (GetPregnancyHediff == null || GetPregnancyHediff.ReturnType != typeof(Hediff)) throw new System.InvalidOperationException("GetPregnancyHediff not found"); + if (GetPregnancyHediff == null) throw new System.InvalidOperationException("GetPregnancyHediff not found"); foreach (CodeInstruction instruction in instructions) { if (instruction.Calls(GetPregnancyHediff)) 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 63eb888..cb98f78 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 @@ -132,7 +132,7 @@ namespace RJW_Menstruation private static readonly MethodInfo IsPregnant = AccessTools.Method(typeof(PawnExtensions), nameof(PawnExtensions.IsPregnant), new System.Type[] {typeof(Pawn), typeof(bool)}); public static IEnumerable Transpiler(IEnumerable instructions) { - if (IsPregnant == null || IsPregnant.ReturnType != typeof(bool)) throw new System.InvalidOperationException("IsPregnant not found"); + if (IsPregnant == null) throw new System.InvalidOperationException("IsPregnant not found"); foreach(CodeInstruction instruction in instructions) { if (instruction.Calls(IsPregnant)) @@ -239,7 +239,7 @@ namespace RJW_Menstruation private static readonly FieldInfo MinimumFuckabilityToHookup = AccessTools.Field(typeof(RJWHookupSettings), nameof(RJWHookupSettings.MinimumFuckabilityToHookup)); public static IEnumerable Transpiler(IEnumerable instructions) { - if (MinimumFuckabilityToHookup == null || MinimumFuckabilityToHookup.FieldType != typeof(float)) throw new System.InvalidOperationException("MinimumFuckabilityToHookup not found"); + if (MinimumFuckabilityToHookup == null) throw new System.InvalidOperationException("MinimumFuckabilityToHookup not found"); bool first_fuckability = true; foreach (CodeInstruction instruction in instructions) { @@ -275,8 +275,8 @@ namespace RJW_Menstruation private static readonly FieldInfo MinimumRelationshipToHookup = AccessTools.Field(typeof(RJWHookupSettings), nameof(RJWHookupSettings.MinimumRelationshipToHookup)); public static IEnumerable Transpiler(IEnumerable instructions) { - if (MinimumAttractivenessToHookup == null || MinimumAttractivenessToHookup.FieldType != typeof(float)) throw new System.InvalidOperationException("MinimumAttractivenessToHookup not found"); - if (MinimumRelationshipToHookup == null || MinimumRelationshipToHookup.FieldType != typeof(float)) throw new System.InvalidOperationException("MinimumRelationshipToHookup not found"); + if (MinimumAttractivenessToHookup == null) throw new System.InvalidOperationException("MinimumAttractivenessToHookup not found"); + if (MinimumRelationshipToHookup == null) throw new System.InvalidOperationException("MinimumRelationshipToHookup not found"); LocalBuilder pawn_index = null; // Like in the last one, we switch the arguments around for the second load bool first_attractiveness = true; diff --git a/changelogs.txt b/changelogs.txt index 965c2a1..6dc78a5 100644 --- a/changelogs.txt +++ b/changelogs.txt @@ -1,6 +1,5 @@ Version 1.0.8.4 - Fix Biotech xenotype inheritance for single-child pregnancies. - - Fix error in Traditional Chinese translation. - Newborns should now be baseliners if there are no xenotypes to inherit. - The Biotech terminate pregnancy recipe can now terminate a menstruation pregnancy, too.