rjw-quirks/RJW-Quirks/HarmonyPatches/Patch_ThinkNode_ChancePerHour_Fappin.cs
Matthew be5f2bdf9a Updated to refactored quirk removal
Updated to parity with quirk removal updates that added helper functions
2023-02-20 15:50:53 -05:00

28 lines
786 B
C#

using HarmonyLib;
using rjw;
using rjwquirks.Modules.Quirks;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using Verse.AI;
namespace rjwquirks.HarmonyPatches
{
[HarmonyPatch(typeof(ThinkNode_ChancePerHour_Fappin), nameof(ThinkNode_ChancePerHour_Fappin.AloneFactor))]
public static class Patch_ThinkNode_ChancePerHour_Fappin
{
[HarmonyPostfix]
public static void Postfix(Pawn pawn, ref float __result)
{
bool isAlone = !pawn.Map.mapPawns.AllPawnsSpawned.Any(x => pawn.CanSee(x) && xxx.is_human(x));
if (pawn.HasQuirk(QuirkDefOf.Exhibitionist))
{
__result = isAlone ? 1.0f : 0.6f;
}
}
}
}