rjw-genes/Source/HarmonyInit.cs

52 lines
2.3 KiB
C#
Raw Normal View History

2022-11-20 19:53:05 +00:00
using Verse;
using HarmonyLib;
using System;
2024-05-26 19:51:09 +00:00
using rjw;
2024-05-26 23:27:10 +00:00
using RJWLoveFeeding;
2024-05-28 19:40:07 +00:00
using RimWorld;
2024-06-04 11:08:37 +00:00
using System.Linq;
2022-11-20 19:53:05 +00:00
namespace RJW_Genes
{
[StaticConstructorOnStartup]
internal static class HarmonyInit
{
2024-06-04 13:49:54 +00:00
2022-11-20 19:53:05 +00:00
static HarmonyInit()
{
Harmony harmony = new Harmony("rjw_genes");
2024-05-26 19:51:09 +00:00
2024-06-04 13:49:54 +00:00
var RJW_Pregnancy_Tick_Prefixes = typeof(Hediff_Pregnant).GetMethod("Tick");
harmony.Unpatch(RJW_Pregnancy_Tick_Prefixes, HarmonyPatchType.Prefix, "rjw");
2024-05-26 19:51:09 +00:00
2022-11-20 19:53:05 +00:00
harmony.PatchAll();
2024-05-26 23:27:10 +00:00
if (ModsConfig.BiotechActive)
{
harmony.Patch(typeof(SexUtility).GetMethod("ProcessSex"), new HarmonyMethod(typeof(LustFeeding), "Postfix", null));
}
2024-05-28 19:40:07 +00:00
harmony.Patch(AccessTools.Method(typeof(SexAppraiser), nameof(SexAppraiser.would_rape)),
postfix: new HarmonyMethod(typeof(PatchImplants), nameof(PatchImplants.would_rape_PostFix)));
2024-06-04 13:49:54 +00:00
2024-05-28 19:40:07 +00:00
harmony.Patch(AccessTools.Method(typeof(xxx), nameof(xxx.is_rapist)),
postfix: new HarmonyMethod(typeof(PatchImplants), nameof(PatchImplants.is_rapist_PostFix)));
2024-06-04 13:49:54 +00:00
2024-05-28 19:40:07 +00:00
harmony.Patch(AccessTools.Method(typeof(AfterSexUtility), nameof(AfterSexUtility.think_about_sex_Rapist)),
postfix: new HarmonyMethod(typeof(PatchImplants), nameof(PatchImplants.think_about_sex_Rapist_PostFix)));
2024-06-04 13:49:54 +00:00
2024-05-28 19:40:07 +00:00
harmony.Patch(AccessTools.Method(typeof(PawnUtility), nameof(PawnUtility.BodyResourceGrowthSpeed)),
postfix: new HarmonyMethod(typeof(PatchImplants), nameof(PatchImplants.MultiplyPregnancy)));
2024-06-04 13:49:54 +00:00
2024-05-28 19:40:07 +00:00
harmony.Patch(AccessTools.Method(typeof(Hediff_Labor), nameof(Hediff_Labor.PostRemoved)),
postfix: new HarmonyMethod(typeof(PatchLitteredBirth), nameof(PatchLitteredBirth.Hediff_Labor_PostRemovedPostFix)));
2024-06-04 13:49:54 +00:00
// OvaryAgitator/Gene_LitteredBirths multibirth logic
2024-05-28 19:40:07 +00:00
harmony.Patch(AccessTools.Method(typeof(Hediff_LaborPushing), nameof(Hediff_LaborPushing.PostRemoved)),
postfix: new HarmonyMethod(typeof(PatchLitteredBirth), nameof(PatchLitteredBirth.Hediff_LaborPushing_PostRemovedPostFix)));
2024-06-04 13:49:54 +00:00
2024-06-04 11:08:37 +00:00
harmony.Patch(AccessTools.Method(typeof(Quirk), nameof(Quirk.CountSatisfiedQuirks)),
postfix: new HarmonyMethod(typeof(QuirkPatcher), nameof(QuirkPatcher.CountSatisfiedPostfix)));
2024-05-26 19:51:09 +00:00
2022-11-20 19:53:05 +00:00
}
}
}