rjw-genes/1.6/Source/Genes/Breeding/Patches/Patch_BlockedMasturbation.cs
Telanda-DDS dde1c98b18 - Incremented version to 2.5.1
- Removed DDS Files
- Added Initial Support for Rimworld 1.6
- Added Additional mod requirement to PatchBSShared.xml to prevent premature loading.
- Refactored Cumpilation integration to make it optional rather then a Required Mod.
- Disabled succubus tail interactions pending rewrite for RJW's new interactions system.
- Disabled Quirks pending rewrite RJW separating them into their own mod.
2025-07-17 21:07:51 +10:00

30 lines
893 B
C#

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
{
/// <summary>
/// Makes the `can_masturbate` return false with certain genes.
/// This is not the only relevant file, please check #127 and #147 on the matter.
/// </summary>
[HarmonyPatch(typeof(xxx), "can_masturbate")]
public class Patch_BlockedMasturbation
{
public void PostFix(Pawn pawn, ref bool __result)
{
if (pawn != null && !pawn.IsAnimal() && pawn.genes != null)
{
__result = __result
&& !pawn.genes.HasActiveGene(GeneDefOf.rjw_genes_blocked_masturbation)
&& !pawn.genes.HasActiveGene(GeneDefOf.rjw_genes_infectious_blocked_masturbation);
}
}
}
}