mirror of
https://gitgud.io/amevarashi/rjw-sexperience-ideology.git
synced 2024-08-15 00:43:19 +00:00
Replaced manual sexperience patch with the Prepare method
This commit is contained in:
parent
7e30ebe68e
commit
be1e5c5d5d
2 changed files with 9 additions and 16 deletions
|
@ -1,25 +1,14 @@
|
|||
using HarmonyLib;
|
||||
using RJWSexperience.Ideology.Patches;
|
||||
using System.Reflection;
|
||||
using System.Reflection;
|
||||
using Verse;
|
||||
|
||||
namespace RJWSexperience.Ideology
|
||||
{
|
||||
[StaticConstructorOnStartup]
|
||||
internal static class First
|
||||
internal static class Harmony
|
||||
{
|
||||
static First()
|
||||
static Harmony()
|
||||
{
|
||||
var harmony = new Harmony("RJW_Sexperience.Ideology");
|
||||
harmony.PatchAll(Assembly.GetExecutingAssembly());
|
||||
|
||||
if (ModLister.HasActiveModWithName("RJW Sexperience"))
|
||||
{
|
||||
harmony.Patch(AccessTools.Method("RJWSexperience.RJWUtility:ThrowVirginHistoryEvent"),
|
||||
prefix: null,
|
||||
postfix: new HarmonyMethod(typeof(Sexperience_Patch_ThrowVirginHistoryEvent), nameof(Sexperience_Patch_ThrowVirginHistoryEvent.Postfix))
|
||||
);
|
||||
}
|
||||
new HarmonyLib.Harmony("RJW_Sexperience.Ideology").PatchAll(Assembly.GetExecutingAssembly());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
using rjw;
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue