Added Gene Aphrodisiac Pheromones and some settings

This commit is contained in:
Shabakur 2022-12-25 12:38:05 +01:00
parent 7bf8efb00d
commit f0a9cce9c9
12 changed files with 134 additions and 6 deletions

View file

@ -47,7 +47,7 @@ namespace RJW_BGS
{
foreach (BestialityGeneInheritanceDef gene in raceGeneDef.genes)
{
if (gene.chance >= Rand.Range(0.01f,1f))
if (gene.chance * RJW_BGSSettings.global_gene_chance >= Rand.Range(0.01f,1f))
{
genelist.Add(DefDatabase<GeneDef>.GetNamed(gene.defName));
}
@ -64,8 +64,13 @@ namespace RJW_BGS
}
}
//For ParchRJWHediffInsect_egg
public static void NewGenes(Pawn mother, Pawn dad, Pawn baby)
{
if (!RJW_BGSSettings.enabled)
{
return;
}
if (baby.RaceProps.Humanlike)
{
if (baby.genes == null)

View file

@ -16,6 +16,10 @@ namespace RJW_BGS
[HarmonyPostfix]
public static void AddGenes(Pawn mother, Pawn dad, ref Hediff_BasePregnancy __instance)
{
if (!RJW_BGSSettings.enabled)
{
return;
}
foreach (Pawn baby in __instance.babies)
{
if (baby.RaceProps.Humanlike)

View file

@ -22,6 +22,10 @@ namespace RJW_BGS
[HarmonyPostfix]
public static void AnimalInheritedGenes(Pawn father, Pawn mother, ref GeneSet __result)
{
if (!RJW_BGSSettings.enabled)
{
return;
}
List<GeneDef> genes = InheritanceUtility.AnimalInheritedGenes(father, mother);
if (genes.Any())
{

View file

@ -6,7 +6,7 @@ using System.Threading.Tasks;
using Verse;
using UnityEngine;
namespace RJW_Genes.Animal_Inheritance
namespace RJW_BGS
{
public class RJW_BGSSettings : ModSettings
{
@ -23,6 +23,10 @@ namespace RJW_Genes.Animal_Inheritance
listing_Standard.Gap(24f);
listing_Standard.CheckboxLabeled("enabled", ref enabled, "no function yet", 0f, 1f);
//listing_Standard.CheckboxLabeled("sexfrenzy", ref sexfrenzy, "disable the effects", 0f, 1f);
listing_Standard.Gap(5f);
listing_Standard.Label("gene inheritance chance"+ ": " +
Math.Round((double)(RJW_BGSSettings.global_gene_chance * 100f), 0).ToString() + "%", -1f, "modify chance for a gene to be inherited.");
RJW_BGSSettings.global_gene_chance = listing_Standard.Slider(RJW_BGSSettings.global_gene_chance, 0f, 5f);
listing_Standard.End();
}
@ -30,8 +34,10 @@ namespace RJW_Genes.Animal_Inheritance
{
base.ExposeData();
Scribe_Values.Look<bool>(ref RJW_BGSSettings.enabled, "enabled", RJW_BGSSettings.enabled, true);
Scribe_Values.Look<float>(ref RJW_BGSSettings.global_gene_chance, "global_gene_chance", RJW_BGSSettings.global_gene_chance, true);
}
public static bool enabled;
public static float global_gene_chance = 1f;
public static bool enabled = true;
}
}

View file

@ -6,7 +6,7 @@ using System.Threading.Tasks;
using Verse;
using UnityEngine;
namespace RJW_Genes.Animal_Inheritance
namespace RJW_BGS
{
public class RJW_BGSSettingsController : Mod
{