From 32774ca3beb169b7f2cc8cbfe115c601e9868680 Mon Sep 17 00:00:00 2001 From: Vegapnk Date: Thu, 11 Jul 2024 12:54:04 +0200 Subject: [PATCH] Simple gene for blocking Masturbation with a PostFix --- CHANGELOG.md | 10 ++++++-- Common/Defs/GeneDefs/GeneDefs_Breeding.xml | 10 ++++++++ Source/GeneDefOf.cs | 5 ++-- .../Patches/Patch_BlockedMasturbation.cs | 25 +++++++++++++++++++ 4 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 Source/Genes/Breeding/Patches/Patch_BlockedMasturbation.cs diff --git a/CHANGELOG.md b/CHANGELOG.md index 0afadbd..830271e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -111,7 +111,7 @@ Because this is the genes mod, and I find things here quite robust. **Additions:** -- Passive Gene: Genetic Disease Immunity. cannot get infected by any genetic diseases, and won't be affected by some other genes (see relevant genes) +- Gene: Genetic Disease Immunity. cannot get infected by any genetic diseases, and won't be affected by some other genes (see relevant genes) - Disease Gene: Vulnerability. Pawn is likelier to be raped - Disease Gene: Infectious Hypersexuality - Disease Gene: Infectious Homosexuality & Bisexuality @@ -125,7 +125,8 @@ Because this is the genes mod, and I find things here quite robust. - (Archite) Gene: Sexual Genetic Thief. Pawns have a chance to steal a gene from their sexpartner. Genetic Disease Immunity shields against this. - Gene: Sperm Displacement. Pawns might overwrite an existing pregnancy, becoming the new father. The pregnancy will stay in its gestation progress. - Gene: Twinkification: Pawns turn their (male) sexual partners into breedable twinks. -- Gene: Feminization: Pawns turn their (male) sexual partners into women. +- Gene: Feminization: Pawns turn their (male) sexual partners into women. +- Gene: Blocked Masturbation: Pawns cannot masturbate. - Pawns will have negative thoughts about pawns with more genetic diseases than themselves. - Faction Penalties for spreading diseases, stealing genes and aging pawns with age transfer - Patch for [Imphilee Xeno](https://steamcommunity.com/sharedfiles/filedetails/?id=2990674516) by @Bunuffin @@ -161,6 +162,11 @@ Verse.Log:Error (string) This is not dangerous. +*Blocked Masturbation* + +Might not be fully working - for testing, I run things in DevMode, and I can just order people to masturbate. +Please playtest this a bit for me, as I want to make it work nicely. + *Supporting* You can now support me with [buying me a coffee](https://buymeacoffee.com/vegapnk). diff --git a/Common/Defs/GeneDefs/GeneDefs_Breeding.xml b/Common/Defs/GeneDefs/GeneDefs_Breeding.xml index 33a8078..7162135 100644 --- a/Common/Defs/GeneDefs/GeneDefs_Breeding.xml +++ b/Common/Defs/GeneDefs/GeneDefs_Breeding.xml @@ -153,4 +153,14 @@ 0 + + rjw_genes_blocked_masturbation + + Carriers of this gene are unable to masturbate - they need a partner or equipment. + Genes/Icons/Hypersexual + 60 + 1 + 1 + + \ No newline at end of file diff --git a/Source/GeneDefOf.cs b/Source/GeneDefOf.cs index 64b84f6..99b421b 100644 --- a/Source/GeneDefOf.cs +++ b/Source/GeneDefOf.cs @@ -74,8 +74,9 @@ namespace RJW_Genes public static readonly GeneDef rjw_genes_insectbreeder; public static readonly GeneDef rjw_genes_insectincubator; public static readonly GeneDef rjw_genes_hardwired_progenity; - - // Cum + public static readonly GeneDef rjw_genes_blocked_masturbation; + + // Cum public static readonly GeneDef rjw_genes_no_cum; public static readonly GeneDef rjw_genes_much_cum; public static readonly GeneDef rjw_genes_very_much_cum; diff --git a/Source/Genes/Breeding/Patches/Patch_BlockedMasturbation.cs b/Source/Genes/Breeding/Patches/Patch_BlockedMasturbation.cs new file mode 100644 index 0000000..fad376f --- /dev/null +++ b/Source/Genes/Breeding/Patches/Patch_BlockedMasturbation.cs @@ -0,0 +1,25 @@ +using HarmonyLib; +using rjw; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; + +namespace RJW_Genes +{ + [HarmonyPatch(typeof(xxx), "can_masturbate")] + public class Patch_BlockedMasturbation + { + public void PostFix(Pawn pawn, ref bool __result) + { + // Simply check if the pawn has genes, and if so, if they have the active gene for blocked masturbation + if (pawn.genes != null) + { + __result = __result && !pawn.genes.HasActiveGene(GeneDefOf.rjw_genes_blocked_masturbation); + } + } + + } +}