Implement weight fuuckery for zompiercer
This commit is contained in:
@@ -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;
|
||||||
|
@@ -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")]
|
||||||
|
Reference in New Issue
Block a user