diff --git a/Common/Defs/GeneDefs/GeneDefs_Diseases.xml b/Common/Defs/GeneDefs/GeneDefs_Diseases.xml index f26f2c0..e5c8723 100644 --- a/Common/Defs/GeneDefs/GeneDefs_Diseases.xml +++ b/Common/Defs/GeneDefs/GeneDefs_Diseases.xml @@ -20,7 +20,7 @@ 0.95 This gene makes the pawn immune against genetic STDs and some other genes that - imply negative side-effects. + imply negative side-effects. 1 -1 UI/Icons/Rituals/TrialDefend @@ -38,7 +38,7 @@ rjw_genes_minor_vulnerability This gene makes the pawn a bit more vulnerable, and a slightly more attractive - target for rape. + target for rape. 1 1 0.85 @@ -64,7 +64,7 @@ rjw_genes_major_vulnerability This gene makes the pawn more vulnerable, and a more attractive target for - rape. + rape. 2 1 UI/Icons/ColonistBar/Idle @@ -89,7 +89,7 @@ rjw_genes_infectious_hypersexuality This gene makes the pawn hypersexual, and has a chance to spread on - intercourse. + intercourse. Genes/Icons/Hypersexual 2 2 @@ -114,7 +114,7 @@ rjw_genes_infectious_bisexuality - This gene makes the pawn bisexual, and has a chance to spread on intercourse. + This gene makes the pawn bisexual, and has a chance to spread on intercourse. UI\Ideoligions\Universal\RoundC 1 0 @@ -141,7 +141,7 @@ rjw_genes_infectious_homosexuality - This gene makes the pawn homosexual, and has a chance to spread on intercourse. + This gene makes the pawn homosexual, and has a chance to spread on intercourse. UI\Ideoligions\Universal\RoundC 1 0 @@ -165,4 +165,25 @@ + + rjw_genes_fluctual_sexual_needs + + Carriers of this genetic disease have a chance to suddenly require sex, gaining a bit of energy to find quick relief. + UI/Icons/ColonistBar/Idle + 1 + 2 + 11 + RJW_Genes.Gene_FluctualSexualNeed + +
  • + 0.1 +
  • +
  • + + 30000 + 0.15 +
  • +
    +
    + \ No newline at end of file diff --git a/Source/GeneDefOf.cs b/Source/GeneDefOf.cs index af53f67..e4f4aff 100644 --- a/Source/GeneDefOf.cs +++ b/Source/GeneDefOf.cs @@ -124,6 +124,8 @@ namespace RJW_Genes // Diseases public static readonly GeneDef rjw_genes_genetic_disease_immunity; public static readonly GeneDef rjw_genes_minor_vulnerability; + public static readonly GeneDef rjw_genes_major_vulnerability; + public static readonly GeneDef rjw_genes_fluctual_sexual_needs; //Other Defs public static readonly XenotypeDef rjw_genes_succubus; diff --git a/Source/Genes/Diseases/Genes/Gene_FluctualSexualNeed.cs b/Source/Genes/Diseases/Genes/Gene_FluctualSexualNeed.cs new file mode 100644 index 0000000..b25e812 --- /dev/null +++ b/Source/Genes/Diseases/Genes/Gene_FluctualSexualNeed.cs @@ -0,0 +1,57 @@ +using rjw; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; +using static HarmonyLib.Code; +using static RimWorld.ColonistBar; + +namespace RJW_Genes +{ + public class Gene_FluctualSexualNeed : Gene + { + + int event_interval; + float event_chance; + + const float REST_INCREASE = 0.1f; + const float SET_SEXNEED_TO = 0.1f; + + public Gene_FluctualSexualNeed() : base() + { + TickBasedChanceExtension tickbasedChanceExt = GeneDefOf.rjw_genes_fluctual_sexual_needs.GetModExtension(); + event_interval = tickbasedChanceExt?.tickInterval ?? 30000; // 30K = 1/2 day + event_chance = tickbasedChanceExt?.eventChance ?? 0.1f; + } + + + public override void Tick() + { + base.Tick(); + + if (pawn.IsHashIntervalTick(event_interval) && (new Random()).NextDouble() < event_chance) + { + ModLog.Debug($"Firing Gene_FluctualSexualNeed for {pawn}"); + ApplyFluctualSexNeedEffect(pawn); + } + } + + public static void ApplyFluctualSexNeedEffect(Pawn pawn) + { + if (pawn == null || pawn.needs == null) return; + + var sexneed = pawn.needs.TryGetNeed(); + if (sexneed != null) + { + sexneed.CurLevelPercentage = SET_SEXNEED_TO; + } + + // Pump up Wake-Ness + if (pawn.needs.rest != null) + pawn.needs.rest.CurLevel += REST_INCREASE; + } + + } +} diff --git a/Source/Rjw-Genes.csproj b/Source/Rjw-Genes.csproj index aa991a2..f684926 100644 --- a/Source/Rjw-Genes.csproj +++ b/Source/Rjw-Genes.csproj @@ -76,6 +76,7 @@ + @@ -239,9 +240,7 @@ False - - - +