diff --git a/1.3/Assemblies/RJW_Menstruation.dll b/1.3/Assemblies/RJW_Menstruation.dll index 7a73b7b..35e4c1c 100644 Binary files a/1.3/Assemblies/RJW_Menstruation.dll and b/1.3/Assemblies/RJW_Menstruation.dll differ diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Compatibility/AnimalGeneticsCompatibility.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Compatibility/AnimalGeneticsCompatibility.cs new file mode 100644 index 0000000..4242008 --- /dev/null +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Compatibility/AnimalGeneticsCompatibility.cs @@ -0,0 +1,27 @@ +using AnimalGenetics; +using Verse; + +namespace RJW_Menstruation +{ + public static class AnimalGeneticsCompatibility + { + public static void PreBirth(Pawn mother, Pawn father, Hediff pregnancy) + { + GeneticInformation motherGeneticInformation = mother?.AnimalGenetics(); + GeneticInformation fatherGeneticInformation = father?.AnimalGenetics(); + + if (fatherGeneticInformation == null && motherGeneticInformation != null) + { + FatherGeneticInformation fatherGeneticInformationComp = pregnancy.TryGetComp(); + fatherGeneticInformation = fatherGeneticInformationComp?.GeneticInformation; + } + + ParentReferences.Push(new ParentReferences.Record { Mother = motherGeneticInformation, Father = fatherGeneticInformation }); + } + + public static void PostBirth() + { + ParentReferences.Pop(); + } + } +} diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Configurations.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Configurations.cs index e7a1611..44061f7 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Configurations.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Configurations.cs @@ -105,6 +105,7 @@ namespace RJW_Menstruation public static bool HARActivated = false; + public static bool AnimalGeneticsActivated = false; public enum DetailLevel { @@ -245,6 +246,7 @@ namespace RJW_Menstruation { GetSettings(); Configurations.HARActivated = ModLister.GetActiveModWithIdentifier("erdelf.HumanoidAlienRaces") != null; + Configurations.AnimalGeneticsActivated = ModLister.GetActiveModWithIdentifier("Mlie.AnimalGenetics") != null; } diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs index c05487e..fd62aae 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs @@ -57,6 +57,8 @@ namespace RJW_Menstruation foreach (Pawn baby in babies) { + if (Configurations.AnimalGeneticsActivated) AnimalGeneticsCompatibility.PreBirth(pawn, Utility.GetFather(baby, pawn), this); + if (xxx.is_animal(baby)) { BestialBirth(baby); @@ -66,6 +68,8 @@ namespace RJW_Menstruation HumanlikeBirth(baby); } + if (Configurations.AnimalGeneticsActivated) AnimalGeneticsCompatibility.PostBirth(); + baby.ageTracker.AgeChronologicalTicks = 0; } diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj b/1.3/source/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj index fee1ccc..0cf5bde 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj @@ -58,6 +58,7 @@ + @@ -95,6 +96,10 @@ ..\..\..\..\..\..\..\..\workshop\content\294100\839005762\1.3\Assemblies\AlienRace.dll False + + ..\..\..\..\..\..\..\..\workshop\content\294100\2226725974\1.3\Assemblies\AnimalGenetics.dll + False + ..\..\..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll False diff --git a/changelogs.txt b/changelogs.txt index 09a4ee8..ab992e7 100644 --- a/changelogs.txt +++ b/changelogs.txt @@ -4,6 +4,7 @@ Version 1.0.7.5 - Properly calculate cramp pain falloff again. - Climacteric and menopause are now per-womb, appearing in the womb dialog instead of as hediffs. Any old hediffs should disappear upon loading the save. - Added new property to vaginas to multiply the number of eggs available. Archotech vaginas will have quadruple the normal amount. + - Added support for Animal Genetics (Continued) Version 1.0.7.4 - Fix errors when using other mods with bad HediffCompProperties.