From b2e368bbe6092086a234a092ab9d6cdb6e9d7f3e Mon Sep 17 00:00:00 2001 From: amevarashi Date: Sat, 16 Jul 2022 21:14:06 +0500 Subject: [PATCH] Extremely basic masturbation precepts --- .../Patches/RJW_Patch_ChancePerHour.cs | 11 ++++- .../Ideology/RsiHistoryEventDefOf.cs | 1 + .../PreceptDefs/Precepts_Masturbation.xml | 47 +++++++++++++++++++ .../Patches/InteractionDef/Masturbation.xml | 14 ++++++ 4 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Masturbation.xml create mode 100644 RJWSexperience_Ideology/Patches/InteractionDef/Masturbation.xml diff --git a/RJWSexperience/IdeologyAddon/Ideology/Patches/RJW_Patch_ChancePerHour.cs b/RJWSexperience/IdeologyAddon/Ideology/Patches/RJW_Patch_ChancePerHour.cs index b0da2bd..2a22c2c 100644 --- a/RJWSexperience/IdeologyAddon/Ideology/Patches/RJW_Patch_ChancePerHour.cs +++ b/RJWSexperience/IdeologyAddon/Ideology/Patches/RJW_Patch_ChancePerHour.cs @@ -62,8 +62,15 @@ namespace RJWSexperience.Ideology.Patches { public static void Postfix(Pawn p, ref float __result) { - if (__result > 0f && p.Ideo != null) // ideo is null if don't have dlc - __result *= IdeoUtility.GetPreceptsMtbMultiplier(p.Ideo); + if (__result < 0f || p.Ideo == null) // ideo is null if don't have dlc + return; + + if (!RsiHistoryEventDefOf.RSI_Masturbated.CreateEvent(p).DoerWillingToDo()) + { + __result = -2f; + return; + } + __result *= IdeoUtility.GetPreceptsMtbMultiplier(p.Ideo); } } } diff --git a/RJWSexperience/IdeologyAddon/Ideology/RsiHistoryEventDefOf.cs b/RJWSexperience/IdeologyAddon/Ideology/RsiHistoryEventDefOf.cs index beb7905..0155d66 100644 --- a/RJWSexperience/IdeologyAddon/Ideology/RsiHistoryEventDefOf.cs +++ b/RJWSexperience/IdeologyAddon/Ideology/RsiHistoryEventDefOf.cs @@ -13,5 +13,6 @@ namespace RJWSexperience.Ideology [MayRequireIdeology] public static readonly HistoryEventDef RSI_VirginTaken; [MayRequireIdeology] public static readonly HistoryEventDef RSI_VirginStolen; [MayRequireIdeology] public static readonly HistoryEventDef RSI_TookVirgin; + [MayRequireIdeology] public static readonly HistoryEventDef RSI_Masturbated; } } diff --git a/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Masturbation.xml b/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Masturbation.xml new file mode 100644 index 0000000..5951b94 --- /dev/null +++ b/RJWSexperience_Ideology/Defs/PreceptDefs/Precepts_Masturbation.xml @@ -0,0 +1,47 @@ + + + + + + Masturbation + + UI/Issues/Bestiality + + + + RSI_Masturbated + + + + + + Masturbation_Abhorrent + Masturbation + + Masturbation is unacceptable. + Medium + 40 + 100 + +
  • + RSI_Masturbated +
  • +
    +
    + + + Masturbation_Disapproved + Masturbation + + Masturbation is somewhat shameful. + Low + 20 + 100 + +
  • + 2.0 +
  • +
    +
    + +
    \ No newline at end of file diff --git a/RJWSexperience_Ideology/Patches/InteractionDef/Masturbation.xml b/RJWSexperience_Ideology/Patches/InteractionDef/Masturbation.xml new file mode 100644 index 0000000..53a35ac --- /dev/null +++ b/RJWSexperience_Ideology/Patches/InteractionDef/Masturbation.xml @@ -0,0 +1,14 @@ + + + + + /Defs/InteractionDef[defName="Masturbation_AutoBreastjob" or defName="Masturbation_AutoFellatio" or defName="Masturbation_Breastjob" or defName="Masturbation_HandjobA" or defName="Masturbation_HandjobP" or defName="Masturbation_HandjobV"] + +
  • + +
  • RSI_Masturbated
  • + + +
    +
    +
    \ No newline at end of file