2022-11-20 19:53:05 +00:00
|
|
|
|
using Verse;
|
|
|
|
|
using HarmonyLib;
|
2022-11-26 20:32:32 +00:00
|
|
|
|
using System;
|
2022-11-20 19:53:05 +00:00
|
|
|
|
|
|
|
|
|
namespace RJW_Genes
|
|
|
|
|
{
|
|
|
|
|
[StaticConstructorOnStartup]
|
|
|
|
|
internal static class HarmonyInit
|
|
|
|
|
{
|
|
|
|
|
static HarmonyInit()
|
|
|
|
|
{
|
|
|
|
|
Harmony harmony = new Harmony("rjw_genes");
|
|
|
|
|
harmony.PatchAll();
|
2022-11-26 20:32:32 +00:00
|
|
|
|
|
|
|
|
|
// Patch Licentia, if Licentia exists
|
|
|
|
|
// Logic & Explanation taken from https://rimworldwiki.com/wiki/Modding_Tutorials/Compatibility_with_DLLs
|
|
|
|
|
// Adjusted to use ModsConfig (which makes it work, the example above does not run out of the box)
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
((Action)(() =>
|
|
|
|
|
{
|
|
|
|
|
if (ModsConfig.IsActive("LustLicentia.RJWLabs"))
|
|
|
|
|
{
|
2022-11-27 07:36:44 +00:00
|
|
|
|
// Gene: Cumflation Immunity [Prefix Patch]
|
2022-11-26 20:32:32 +00:00
|
|
|
|
harmony.Patch(AccessTools.Method(typeof(LicentiaLabs.CumflationHelper), nameof(LicentiaLabs.CumflationHelper.Cumflation)),
|
|
|
|
|
prefix: new HarmonyMethod(typeof(Patch_Cumflation), nameof(Patch_Cumflation.Prefix)));
|
2022-11-27 07:36:44 +00:00
|
|
|
|
// Gene: Generous Donor [Postfix Patch]
|
|
|
|
|
harmony.Patch(AccessTools.Method(typeof(LicentiaLabs.CumflationHelper), nameof(LicentiaLabs.CumflationHelper.TransferNutrition)),
|
|
|
|
|
postfix: new HarmonyMethod(typeof(Patch_TransferNutrition), nameof(Patch_TransferNutrition.Postfix)));
|
2023-01-22 08:59:16 +00:00
|
|
|
|
// Gene: CumEater [Postfix Patch]
|
2022-12-31 15:40:37 +00:00
|
|
|
|
harmony.Patch(AccessTools.Method(typeof(rjw.JobDriver_Sex), nameof(rjw.JobDriver_Sex.ChangePsyfocus)),
|
|
|
|
|
postfix: new HarmonyMethod(typeof(Patch_SexTicks_ChangePsyfocus), nameof(Patch_SexTicks_ChangePsyfocus.Postfix)));
|
2022-11-26 20:32:32 +00:00
|
|
|
|
}
|
|
|
|
|
}))();
|
|
|
|
|
}
|
|
|
|
|
catch (TypeLoadException ex) {
|
|
|
|
|
// To be expected for people without Licentia Labs
|
|
|
|
|
}
|
2022-11-20 19:53:05 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|