Implement weight fuuckery for zompiercer

This commit is contained in:
2025-03-07 02:01:26 +01:00
parent 2c1f5d5688
commit 793fc2b48d
2 changed files with 19 additions and 6 deletions

View File

@@ -15,9 +15,11 @@ namespace Zompiercer {
private const string PluginVersion = "1.0.0"; private const string PluginVersion = "1.0.0";
public static ConfigEntry<bool> debug; public static ConfigEntry<bool> debug;
public static ConfigEntry<float> weightMultiplier;
public void Awake() { public void Awake() {
debug = Config.Bind("General", "Debug", false); debug = Config.Bind("General", "Debug", false);
weightMultiplier = Config.Bind("General", "Weight Multiplier", 1.0f, "Multiplier for the weight of the tank");
Logger.LogInfo("Cyka mod loaded"); Logger.LogInfo("Cyka mod loaded");
HarmonyFileLog.Enabled = true; HarmonyFileLog.Enabled = true;

View File

@@ -1,13 +1,24 @@
using HarmonyLib; using System;
using HarmonyLib;
namespace Zompiercer { namespace Zompiercer {
[HarmonyPatch] [HarmonyPatch]
public class Patches { public class Patches {
//[HarmonyPrefix] [HarmonyPostfix]
//[HarmonyPatch(typeof(ManLicenses), "AddXP")] [HarmonyPatch(typeof(InventoryItem), "GetWeight")]
//static void XpMulti(FactionSubTypes corporation, ref int xp, bool showUI = true) { static void GetWeight(ref float __result) {
// xp = (int)(xp * Main.xpMultiplier.Value); if (Main.debug.Value)
//} Console.WriteLine("GetWeight: " + __result);
__result = __result * Main.weightMultiplier.Value;
}
[HarmonyPostfix]
[HarmonyPatch(typeof(InventoryItem), "GetWeightOfOneItem")]
static void GetWeightOfOneItem(ref float __result) {
if (Main.debug.Value)
Console.WriteLine("GetWeightOfOneItem: " + __result);
__result = __result * Main.weightMultiplier.Value;
}
//[HarmonyPrefix] //[HarmonyPrefix]
//[HarmonyPatch(typeof(ManPlayer), "AddMoney")] //[HarmonyPatch(typeof(ManPlayer), "AddMoney")]