rjw-sexperience-ideology/Source/IdeologyAddon/Patches/Sexperience_Patch.cs

26 lines
829 B
C#

using HarmonyLib;
using rjw;
using RJWSexperience.Ideology.HistoryEvents;
using Verse;
namespace RJWSexperience.Ideology.Patches
{
[HarmonyPatch("RJWSexperience.RJWUtility", "ThrowVirginHistoryEvent")]
public static class Sexperience_Patch_ThrowVirginHistoryEvent
{
public static bool Prepare() => ModsConfig.IsActive("rjw.sexperience");
public static void Postfix(Pawn exVirgin, Pawn partner, SexProps props, int degree)
{
const int femaleAfterSurgery = 1;
if (props.isRape && exVirgin == props.partner)
RsiHistoryEventDefOf.RSI_VirginStolen.RecordEventWithPartner(exVirgin, partner);
else if (degree != femaleAfterSurgery)
RsiHistoryEventDefOf.RSI_VirginTaken.RecordEventWithPartner(exVirgin, partner);
RsiHistoryEventDefOf.RSI_TookVirgin.RecordEventWithPartner(partner, exVirgin);
}
}
}