generated from dave/MelonTemplate
40 lines
1.3 KiB
C#
40 lines
1.3 KiB
C#
using System.Linq;
|
|
using MelonLoader;
|
|
|
|
namespace MelonTemplate {
|
|
public class MelonTemplateMod : MelonMod {
|
|
public override void OnInitializeMelon() {
|
|
LoggerInstance.Msg("Phat Melon mod loaded");
|
|
HarmonyLib.Harmony harmony = HarmonyInstance;
|
|
harmony.PatchAll();
|
|
var originalMethods = harmony.GetPatchedMethods();
|
|
var methodBases = originalMethods.ToList();
|
|
LoggerInstance.Msg("Patched " + methodBases.Count() + " methods");
|
|
foreach (var method in methodBases) {
|
|
LoggerInstance.Msg("Patched " + method.Name);
|
|
}
|
|
}
|
|
}
|
|
|
|
[HarmonyLib.HarmonyPatch]
|
|
public class Patches {
|
|
// [HarmonyLib.HarmonyPrefix]
|
|
// [HarmonyLib.HarmonyPatch(typeof(TavernModel), "ChangeMoney")]
|
|
// public static void PrefixMoney(ref int value) {
|
|
// if (Main.debug.Value)
|
|
// Console.WriteLine($"Money is {value}");
|
|
// if (value > 0) {
|
|
// value = (int)(value * Main.moneyMultiplier.Value);
|
|
// if (Main.debug.Value)
|
|
// Console.WriteLine($"Money modified to {value}");
|
|
// }
|
|
// }
|
|
|
|
// [HarmonyLib.HarmonyPostfix]
|
|
// [HarmonyLib.HarmonyPatch(typeof(TechTreeModel), nameof(TechTreeModel.GetBonusPeoplePerMinute))]
|
|
// public static void PostfixPeoplePerMinute(ref float __result) {
|
|
// __result *= Main.peoplePerMinuteMultiplier.Value;
|
|
// __result += Main.peoplePerMinuteOffset.Value;
|
|
// }
|
|
}
|
|
} |