diff --git a/Common/Assemblies/Rjw-Genes.dll b/Common/Assemblies/Rjw-Genes.dll
index 4c7463c..5785b36 100644
Binary files a/Common/Assemblies/Rjw-Genes.dll and b/Common/Assemblies/Rjw-Genes.dll differ
diff --git a/Common/Defs/Genes/GeneDefs_SexSpecial.xml b/Common/Defs/Genes/GeneDefs_SexSpecial.xml
index 51d4269..3b29889 100644
--- a/Common/Defs/Genes/GeneDefs_SexSpecial.xml
+++ b/Common/Defs/Genes/GeneDefs_SexSpecial.xml
@@ -9,5 +9,16 @@
UI/Memes/FleshPurity
1
-
+
+
+ rjw_genes_aphrodisiac_pheromones
+
+ rjw_genes_special
+ RJW_Genes.Gene_Aphrodisiac_Pheromones
+ Pheremones of this pawn induce an incressed sexdrive to others nearby.
+ UI/Memes/FleshPurity
+ 2
+ 1
+ 1
+
\ No newline at end of file
diff --git a/Common/Defs/HediffDefs/Hediffs_Genes.xml b/Common/Defs/HediffDefs/Hediffs_Genes.xml
new file mode 100644
index 0000000..bebfce9
--- /dev/null
+++ b/Common/Defs/HediffDefs/Hediffs_Genes.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+ Aphrodisiac_Pheromone
+ HediffWithComps
+
+ Aphrodisiac pheromone effects.
+ (1,0,0.5)
+ true
+ 1.0
+
+
+ -4.0
+
+
+
+
+ false
+
+ 2
+
+
+
+
+
\ No newline at end of file
diff --git a/Source/Animal_Inheritance/InheritanceUtility.cs b/Source/Animal_Inheritance/InheritanceUtility.cs
index 1996589..ee5c664 100644
--- a/Source/Animal_Inheritance/InheritanceUtility.cs
+++ b/Source/Animal_Inheritance/InheritanceUtility.cs
@@ -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.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)
diff --git a/Source/Animal_Inheritance/PatchRJWBestialityPregnancyUtility.cs b/Source/Animal_Inheritance/PatchRJWBestialityPregnancyUtility.cs
index 5224c4f..8160c8c 100644
--- a/Source/Animal_Inheritance/PatchRJWBestialityPregnancyUtility.cs
+++ b/Source/Animal_Inheritance/PatchRJWBestialityPregnancyUtility.cs
@@ -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)
diff --git a/Source/Animal_Inheritance/PatchVanillaPregnancyUtility.cs b/Source/Animal_Inheritance/PatchVanillaPregnancyUtility.cs
index 0f5cc90..baa72f5 100644
--- a/Source/Animal_Inheritance/PatchVanillaPregnancyUtility.cs
+++ b/Source/Animal_Inheritance/PatchVanillaPregnancyUtility.cs
@@ -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 genes = InheritanceUtility.AnimalInheritedGenes(father, mother);
if (genes.Any())
{
diff --git a/Source/Animal_Inheritance/RJW_BGSSettings.cs b/Source/Animal_Inheritance/RJW_BGSSettings.cs
index 1d5d859..4847d89 100644
--- a/Source/Animal_Inheritance/RJW_BGSSettings.cs
+++ b/Source/Animal_Inheritance/RJW_BGSSettings.cs
@@ -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(ref RJW_BGSSettings.enabled, "enabled", RJW_BGSSettings.enabled, true);
+ Scribe_Values.Look(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;
}
}
diff --git a/Source/Animal_Inheritance/RJW_BGSSettingsController.cs b/Source/Animal_Inheritance/RJW_BGSSettingsController.cs
index 53a7659..12ef107 100644
--- a/Source/Animal_Inheritance/RJW_BGSSettingsController.cs
+++ b/Source/Animal_Inheritance/RJW_BGSSettingsController.cs
@@ -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
{
diff --git a/Source/GeneDefOf.cs b/Source/GeneDefOf.cs
index 744eb11..e592100 100644
--- a/Source/GeneDefOf.cs
+++ b/Source/GeneDefOf.cs
@@ -70,6 +70,6 @@ namespace RJW_Genes
// Special
public static readonly GeneDef rjw_genes_orgasm_rush;
-
+ public static readonly GeneDef rjw_genes_aphrodisiac_pheromones;
}
}
diff --git a/Source/Genes/Special/Gene_Aphrodisiac_Pheromones_.cs b/Source/Genes/Special/Gene_Aphrodisiac_Pheromones_.cs
new file mode 100644
index 0000000..267f625
--- /dev/null
+++ b/Source/Genes/Special/Gene_Aphrodisiac_Pheromones_.cs
@@ -0,0 +1,53 @@
+using HarmonyLib;
+using rjw;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Verse;
+using RimWorld;
+
+namespace RJW_Genes
+{
+ public class Gene_Aphrodisiac_Pheromones : Gene
+ {
+ public override void Tick()
+ {
+ base.Tick();
+ if (this.pawn.IsHashIntervalTick(2500))
+ {
+ foreach (Pawn pawn in this.AffectedPawns(this.pawn.Position, this.pawn.Map))
+ {
+ this.InduceAphrodisiac(pawn);
+ }
+ }
+ }
+
+ private IEnumerable AffectedPawns(IntVec3 pos, Map map)
+ {
+ foreach (Pawn pawn in map.mapPawns.AllPawns)
+ {
+ if (pos.DistanceTo(pawn.Position) < 5)
+ {
+ yield return pawn;
+ }
+ }
+ //IEnumerator enumerator = null;
+ yield break;
+ }
+
+ private void InduceAphrodisiac(Pawn pawn)
+ {
+ Hediff hediff = pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.Aphrodisiac_Pheromone);
+ if (hediff != null)
+ {
+ hediff.Severity = 1f;
+ }
+ else
+ {
+ pawn.health.AddHediff(HediffDefOf.Aphrodisiac_Pheromone);
+ }
+ }
+ }
+}
diff --git a/Source/HediffDefOf.cs b/Source/HediffDefOf.cs
new file mode 100644
index 0000000..9e70ad2
--- /dev/null
+++ b/Source/HediffDefOf.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Verse;
+using RimWorld;
+
+namespace RJW_Genes
+{
+ [DefOf]
+ public static class HediffDefOf
+ {
+ public static readonly HediffDef Aphrodisiac_Pheromone;
+ }
+}
diff --git a/Source/Rjw-Genes.csproj b/Source/Rjw-Genes.csproj
index c7b5a48..f98d314 100644
--- a/Source/Rjw-Genes.csproj
+++ b/Source/Rjw-Genes.csproj
@@ -116,8 +116,10 @@
+
+