mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
Add compatibility code for Animal Genetics
This commit is contained in:
parent
215a94f4f5
commit
87d950eb26
6 changed files with 39 additions and 0 deletions
Binary file not shown.
|
@ -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>();
|
||||||
|
fatherGeneticInformation = fatherGeneticInformationComp?.GeneticInformation;
|
||||||
|
}
|
||||||
|
|
||||||
|
ParentReferences.Push(new ParentReferences.Record { Mother = motherGeneticInformation, Father = fatherGeneticInformation });
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void PostBirth()
|
||||||
|
{
|
||||||
|
ParentReferences.Pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -105,6 +105,7 @@ namespace RJW_Menstruation
|
||||||
|
|
||||||
|
|
||||||
public static bool HARActivated = false;
|
public static bool HARActivated = false;
|
||||||
|
public static bool AnimalGeneticsActivated = false;
|
||||||
|
|
||||||
public enum DetailLevel
|
public enum DetailLevel
|
||||||
{
|
{
|
||||||
|
@ -245,6 +246,7 @@ namespace RJW_Menstruation
|
||||||
{
|
{
|
||||||
GetSettings<Configurations>();
|
GetSettings<Configurations>();
|
||||||
Configurations.HARActivated = ModLister.GetActiveModWithIdentifier("erdelf.HumanoidAlienRaces") != null;
|
Configurations.HARActivated = ModLister.GetActiveModWithIdentifier("erdelf.HumanoidAlienRaces") != null;
|
||||||
|
Configurations.AnimalGeneticsActivated = ModLister.GetActiveModWithIdentifier("Mlie.AnimalGenetics") != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,8 @@ namespace RJW_Menstruation
|
||||||
|
|
||||||
foreach (Pawn baby in babies)
|
foreach (Pawn baby in babies)
|
||||||
{
|
{
|
||||||
|
if (Configurations.AnimalGeneticsActivated) AnimalGeneticsCompatibility.PreBirth(pawn, Utility.GetFather(baby, pawn), this);
|
||||||
|
|
||||||
if (xxx.is_animal(baby))
|
if (xxx.is_animal(baby))
|
||||||
{
|
{
|
||||||
BestialBirth(baby);
|
BestialBirth(baby);
|
||||||
|
@ -66,6 +68,8 @@ namespace RJW_Menstruation
|
||||||
HumanlikeBirth(baby);
|
HumanlikeBirth(baby);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Configurations.AnimalGeneticsActivated) AnimalGeneticsCompatibility.PostBirth();
|
||||||
|
|
||||||
baby.ageTracker.AgeChronologicalTicks = 0;
|
baby.ageTracker.AgeChronologicalTicks = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
<None Include="App.config" />
|
<None Include="App.config" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Compile Include="Compatibility\AnimalGeneticsCompatibility.cs" />
|
||||||
<Compile Include="Compatibility\HARCompatibility.cs" />
|
<Compile Include="Compatibility\HARCompatibility.cs" />
|
||||||
<Compile Include="Configurations.cs" />
|
<Compile Include="Configurations.cs" />
|
||||||
<Compile Include="Cum.cs" />
|
<Compile Include="Cum.cs" />
|
||||||
|
@ -95,6 +96,10 @@
|
||||||
<HintPath>..\..\..\..\..\..\..\..\workshop\content\294100\839005762\1.3\Assemblies\AlienRace.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\..\..\workshop\content\294100\839005762\1.3\Assemblies\AlienRace.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="AnimalGenetics">
|
||||||
|
<HintPath>..\..\..\..\..\..\..\..\workshop\content\294100\2226725974\1.3\Assemblies\AnimalGenetics.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
|
</Reference>
|
||||||
<Reference Include="Assembly-CSharp">
|
<Reference Include="Assembly-CSharp">
|
||||||
<HintPath>..\..\..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
|
|
|
@ -4,6 +4,7 @@ Version 1.0.7.5
|
||||||
- Properly calculate cramp pain falloff again.
|
- 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.
|
- 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 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
|
Version 1.0.7.4
|
||||||
- Fix errors when using other mods with bad HediffCompProperties.
|
- Fix errors when using other mods with bad HediffCompProperties.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue