Add money prefix

This commit is contained in:
2024-09-27 21:53:08 +02:00
parent 54406c7c8a
commit b0b46db004
2 changed files with 23 additions and 13 deletions

View File

@@ -1,7 +1,14 @@
using System.Linq; using System;
using System.Linq;
using Il2CppFunGI.ATTT.Game.Gameplay.FinancialReport;
using MelonLoader; using MelonLoader;
namespace ArmsTradeTycoonTanks { namespace ArmsTradeTycoonTanks {
public static class Global {
public static bool Debug = true;
public static float MoneyMultiplier = 1.0f;
}
public class ArmsTradeTycoonTanksMelonMod : MelonMod { public class ArmsTradeTycoonTanksMelonMod : MelonMod {
public override void OnInitializeMelon() { public override void OnInitializeMelon() {
LoggerInstance.Msg("Phat Melon mod loaded"); LoggerInstance.Msg("Phat Melon mod loaded");
@@ -18,18 +25,18 @@ namespace ArmsTradeTycoonTanks {
[HarmonyLib.HarmonyPatch] [HarmonyLib.HarmonyPatch]
public class Patches { public class Patches {
// [HarmonyLib.HarmonyPrefix] [HarmonyLib.HarmonyPrefix]
// [HarmonyLib.HarmonyPatch(typeof(TavernModel), "ChangeMoney")] [HarmonyLib.HarmonyPatch(typeof(FinancialReportSystem), "ChangeMoney")]
// public static void PrefixMoney(ref int value) { public static void PrefixMoney(ref long __0) {
// if (Main.debug.Value) if (Global.Debug)
// Console.WriteLine($"Money is {value}"); Console.WriteLine($"Money is {__0}");
// if (value > 0) { if (__0 > 0) {
// value = (int)(value * Main.moneyMultiplier.Value); __0 = (long)(__0 * Global.MoneyMultiplier);
// if (Main.debug.Value) if (Global.Debug)
// Console.WriteLine($"Money modified to {value}"); Console.WriteLine($"Money modified to {__0}");
// } }
// } }
// [HarmonyLib.HarmonyPostfix] // [HarmonyLib.HarmonyPostfix]
// [HarmonyLib.HarmonyPatch(typeof(TechTreeModel), nameof(TechTreeModel.GetBonusPeoplePerMinute))] // [HarmonyLib.HarmonyPatch(typeof(TechTreeModel), nameof(TechTreeModel.GetBonusPeoplePerMinute))]
// public static void PostfixPeoplePerMinute(ref float __result) { // public static void PostfixPeoplePerMinute(ref float __result) {

View File

@@ -54,6 +54,9 @@
<Reference Include="UnityEngine.CoreModule"> <Reference Include="UnityEngine.CoreModule">
<HintPath>$(GAME_MANAGED)/UnityEngine.CoreModule.dll</HintPath> <HintPath>$(GAME_MANAGED)/UnityEngine.CoreModule.dll</HintPath>
</Reference> </Reference>
<Reference Include="Il2CppFunGI">
<HintPath>$(GAME_MANAGED)/Il2CppATTT.Game.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets"/> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets"/>
</Project> </Project>