Simple gene for blocking Masturbation with a PostFix

This commit is contained in:
Vegapnk 2024-07-11 12:54:04 +02:00
parent 0032913a57
commit 32774ca3be
4 changed files with 46 additions and 4 deletions

View file

@ -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;

View file

@ -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);
}
}
}
}