mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
Restructuring, some sorting into folders
This commit is contained in:
parent
ac1fdc99be
commit
31e96bd5e3
36 changed files with 80 additions and 65 deletions
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using HarmonyLib;
|
||||
using RimWorld;
|
||||
using Verse;
|
||||
|
||||
namespace RJW_BGS
|
||||
{
|
||||
/// <summary>
|
||||
/// This Patch is applied to change the normal pregnancy to add animal-inheritance.
|
||||
/// If the settings allow animal gene inheritance,
|
||||
/// the genes are determined and "simply added".
|
||||
/// </summary>
|
||||
[HarmonyPatch(typeof(PregnancyUtility), "GetInheritedGeneSet", new Type[]
|
||||
{
|
||||
typeof(Pawn),
|
||||
typeof(Pawn),
|
||||
//typeof(bool)
|
||||
}
|
||||
)]
|
||||
public static class Patch_Vanilla_PregnancyUtility
|
||||
{
|
||||
[HarmonyPostfix]
|
||||
public static void AnimalInheritedGenes(Pawn father, Pawn mother, ref GeneSet __result)
|
||||
{
|
||||
if (!RJW_BGSSettings.rjw_bgs_enabled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
List<GeneDef> genes = InheritanceUtility.AnimalInheritedGenes(father, mother);
|
||||
if (genes.Any())
|
||||
{
|
||||
foreach (GeneDef gene in genes)
|
||||
{
|
||||
__result.AddGene(gene);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue