Replaced manual sexperience patch with the Prepare method
This commit is contained in:
parent
7e30ebe68e
commit
be1e5c5d5d
|
@ -1,25 +1,14 @@
|
||||||
using HarmonyLib;
|
using System.Reflection;
|
||||||
using RJWSexperience.Ideology.Patches;
|
|
||||||
using System.Reflection;
|
|
||||||
using Verse;
|
using Verse;
|
||||||
|
|
||||||
namespace RJWSexperience.Ideology
|
namespace RJWSexperience.Ideology
|
||||||
{
|
{
|
||||||
[StaticConstructorOnStartup]
|
[StaticConstructorOnStartup]
|
||||||
internal static class First
|
internal static class Harmony
|
||||||
{
|
{
|
||||||
static First()
|
static Harmony()
|
||||||
{
|
{
|
||||||
var harmony = new Harmony("RJW_Sexperience.Ideology");
|
new HarmonyLib.Harmony("RJW_Sexperience.Ideology").PatchAll(Assembly.GetExecutingAssembly());
|
||||||
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))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
using rjw;
|
using HarmonyLib;
|
||||||
|
using rjw;
|
||||||
using RJWSexperience.Ideology.HistoryEvents;
|
using RJWSexperience.Ideology.HistoryEvents;
|
||||||
using Verse;
|
using Verse;
|
||||||
|
|
||||||
namespace RJWSexperience.Ideology.Patches
|
namespace RJWSexperience.Ideology.Patches
|
||||||
{
|
{
|
||||||
|
[HarmonyPatch("RJWSexperience.RJWUtility", "ThrowVirginHistoryEvent")]
|
||||||
public static class Sexperience_Patch_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)
|
public static void Postfix(Pawn exVirgin, Pawn partner, SexProps props, int degree)
|
||||||
{
|
{
|
||||||
const int femaleAfterSurgery = 1;
|
const int femaleAfterSurgery = 1;
|
||||||
|
|
Loading…
Reference in New Issue