mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
Minor Naming Changes - again
This commit is contained in:
parent
51ab700ec2
commit
17872508af
3 changed files with 13 additions and 20 deletions
|
@ -7,17 +7,13 @@ using Verse;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using rjw;
|
using rjw;
|
||||||
using RimWorld;
|
|
||||||
|
|
||||||
namespace RJW_BGS
|
namespace RJW_BGS
|
||||||
{
|
{
|
||||||
[HarmonyPatch(typeof(Hediff_BasePregnancy))]
|
[HarmonyPatch(typeof(Hediff_BasePregnancy))]
|
||||||
public class BasePregnancyPatcher
|
public class BasePregnancyPatcher
|
||||||
{
|
{
|
||||||
/// <summary>
|
public static List<string> supportedHybridRaces = new List<string>()
|
||||||
/// The supported races that are produced by Vanilla Genetics Expanded, that can lead to different offsprings when in Human - Animal Sex
|
|
||||||
/// </summary>
|
|
||||||
public static List<string> firstGenerationOffspringRaces = new List<string>()
|
|
||||||
{
|
{
|
||||||
"GR_Manbear",
|
"GR_Manbear",
|
||||||
"GR_Bearman",
|
"GR_Bearman",
|
||||||
|
@ -39,10 +35,7 @@ namespace RJW_BGS
|
||||||
"GR_Lizardman"
|
"GR_Lizardman"
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
public static List<string> supportedInitialAnimalRaces = new List<string>()
|
||||||
/// The supported races that can produce Vanilla Genetics hybrids as Human - Animal Sex results.
|
|
||||||
/// </summary>
|
|
||||||
public static List<string> parentGenerationOffspringRaces = new List<string>()
|
|
||||||
{
|
{
|
||||||
"Bear_Grizzly",
|
"Bear_Grizzly",
|
||||||
"Bear_Polar",
|
"Bear_Polar",
|
||||||
|
@ -91,16 +84,18 @@ namespace RJW_BGS
|
||||||
"Tortoise"
|
"Tortoise"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public static HediffDef controler = DefDatabase<HediffDef>.GetNamed("rjw_genes_animal_control_hediff", false);
|
||||||
|
|
||||||
[HarmonyPostfix]
|
[HarmonyPostfix]
|
||||||
[HarmonyPatch("GenerateBabies")]
|
[HarmonyPatch("GenerateBabies")]
|
||||||
public static void AddComfortableWithHumansHediff (Hediff_BasePregnancy __instance)
|
public static void addHedif (Hediff_BasePregnancy __instance)
|
||||||
{
|
{
|
||||||
|
if (controler == null) return;
|
||||||
|
|
||||||
foreach (Pawn baby in __instance.babies)
|
foreach (Pawn baby in __instance.babies)
|
||||||
{
|
{
|
||||||
if (baby != null && firstGenerationOffspringRaces.Contains(baby.kindDef.race.defName))
|
if(baby != null && supportedHybridRaces.Contains(baby.kindDef.race.defName))
|
||||||
{
|
baby.health.AddHediff(controler);
|
||||||
baby.health.AddHediff(RJW_Genes.HediffDefOf.rjw_genes_animal_control_hediff);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,10 +21,10 @@ namespace RJW_BGS
|
||||||
{
|
{
|
||||||
if (!RJW_BGSSettings.rjw_bgs_VE_genetics) return true;
|
if (!RJW_BGSSettings.rjw_bgs_VE_genetics) return true;
|
||||||
if (mother == null || father == null) return true;
|
if (mother == null || father == null) return true;
|
||||||
bool humanMotherAndSupportedAnimal = mother.IsHuman() && BasePregnancyPatcher.parentGenerationOffspringRaces.Contains(father.kindDef.race.defName);
|
bool humanMotherAndSupportedAnimal = mother.IsHuman() && BasePregnancyPatcher.supportedInitialAnimalRaces.Contains(father.kindDef.race.defName);
|
||||||
bool humanMotherAndSupportedHybrid = mother.IsHuman() && BasePregnancyPatcher.firstGenerationOffspringRaces.Contains(father.kindDef.race.defName);
|
bool humanMotherAndSupportedHybrid = mother.IsHuman() && BasePregnancyPatcher.supportedHybridRaces.Contains(father.kindDef.race.defName);
|
||||||
bool humanFatherAndSupportedAnimal = father.IsHuman() && BasePregnancyPatcher.parentGenerationOffspringRaces.Contains(mother.kindDef.race.defName);
|
bool humanFatherAndSupportedAnimal = father.IsHuman() && BasePregnancyPatcher.supportedInitialAnimalRaces.Contains(mother.kindDef.race.defName);
|
||||||
bool humanFatherAndSupportedHybrid = father.IsHuman() && BasePregnancyPatcher.firstGenerationOffspringRaces.Contains(mother.kindDef.race.defName);
|
bool humanFatherAndSupportedHybrid = father.IsHuman() && BasePregnancyPatcher.supportedHybridRaces.Contains(mother.kindDef.race.defName);
|
||||||
|
|
||||||
if (!(humanMotherAndSupportedAnimal || humanMotherAndSupportedHybrid||humanFatherAndSupportedAnimal|| humanFatherAndSupportedHybrid)) return true;
|
if (!(humanMotherAndSupportedAnimal || humanMotherAndSupportedHybrid||humanFatherAndSupportedAnimal|| humanFatherAndSupportedHybrid)) return true;
|
||||||
if (humanMotherAndSupportedAnimal)
|
if (humanMotherAndSupportedAnimal)
|
||||||
|
|
|
@ -22,7 +22,5 @@ namespace RJW_Genes
|
||||||
|
|
||||||
public static readonly HediffDef OvaryAgitator;
|
public static readonly HediffDef OvaryAgitator;
|
||||||
public static readonly HediffDef Bioscaffold;
|
public static readonly HediffDef Bioscaffold;
|
||||||
|
|
||||||
public static readonly HediffDef rjw_genes_animal_control_hediff;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue