From 0c92e0e1b78d4957acd0b21cf828d81be420be4f Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Tue, 23 Jul 2024 22:19:44 +0200 Subject: [PATCH] Update regiments --- Projects/Regiments/Regiments/Patches.cs | 334 +++++++++--------- Projects/Regiments/Regiments/Regiments.csproj | 152 ++++---- ...ework,Version=v4.8.1.AssemblyAttributes.cs | 8 +- .../Regiments.csproj.AssemblyReference.cache | Bin 14694 -> 14681 bytes 4 files changed, 247 insertions(+), 247 deletions(-) diff --git a/Projects/Regiments/Regiments/Patches.cs b/Projects/Regiments/Regiments/Patches.cs index cfac95e..8de7bf8 100644 --- a/Projects/Regiments/Regiments/Patches.cs +++ b/Projects/Regiments/Regiments/Patches.cs @@ -1,167 +1,167 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection.Emit; -using birdseye; -using birdseye.Regiments; -using birdseye.Regiments.Commanders; -using birdseye.Regiments.GameModes; -using birdseye.Regiments.Menu.GUI; -using birdseye.Regiments.Platoons; -using birdseye.Regiments.Platoons.Modules; -using birdseye.Regiments.Units.WeaponSystems; -using birdseye.Regiments.Zones; -using HarmonyLib; -using UnityEngine; - -// Patch maxSupPoints in PlatoonSupplyModule -// Patch Operational Authority point gain - -namespace Regiments { - [HarmonyPatch] - public class Patches { - private static float baseHqValue = 0; - private static float baseSupplyValue = 0; - - [HarmonyPrefix] - [HarmonyPatch(typeof(SupplyPointsController), "AddSPs")] - static void SpMultiplier(ref float value) { - if (value == 0) { - return; - } - - float multiplier = Main.SPMultiplier.Value; - // Console.WriteLine("Multiplying SP {0} by {1}", value, multiplier); - value *= multiplier; - } - - [HarmonyPrefix] - [HarmonyPatch(typeof(TacAidPointsController), "AddTP")] - static void TpMultiplier(ref float val) { - if (val == 0) { - return; - } - - float multiplier = Main.TPMultiplier.Value; - // Console.WriteLine("Multiplying TP {0} by {1}", val, multiplier); - val *= multiplier; - } - - [HarmonyPrefix] - [HarmonyPatch(typeof(MapZoneFactory), "MakeRefitZone")] - static void SupplyAoeMultiplier(ref eSides side, ref Vector3 position, ref float size) { - float multiplier = Main.SupplyAOEMultiplier.Value; - Console.WriteLine("Multiplying supply aoe {0} by {1}", size, multiplier); - size *= multiplier; - } - - [HarmonyPrefix] - [HarmonyPatch(typeof(PlatoonHQVisuals), "Start")] - static void HqAoeMultiplier(PlatoonHQVisuals __instance) { - Console.WriteLine("Patching HQ radius - base range {0}", baseHqValue); - if (baseHqValue == 0) { - baseHqValue = __instance.platoon.parameters.HQRadius; - Console.WriteLine("Base range is 0, assigning new: {0}", baseHqValue); - } - - __instance.platoon.parameters.HQRadius = baseHqValue * Main.HQAOEMultiplier.Value; - Console.WriteLine("HQ radius patched to: {0}", __instance.platoon.parameters.HQRadius); - } - - [HarmonyPrefix] - [HarmonyPatch(typeof(PlatoonSupplyModule), "Start")] - static void SupplyAoeMultiplier(PlatoonSupplyModule __instance) { - Console.WriteLine("Patching supply amount - base amount {0}", baseSupplyValue); - if (baseSupplyValue == 0) { - baseSupplyValue = __instance.platoon.parameters.supplyPointsPerUnit; - Console.WriteLine("Base amount is 0, assigning new: {0}", baseSupplyValue); - } - - __instance.platoon.parameters.supplyPointsPerUnit = - (int)(baseSupplyValue * Main.SupplyAmountMultiplier.Value); - Console.WriteLine("Supply amount patched to: {0}", __instance.platoon.parameters.supplyPointsPerUnit); - } - - [HarmonyPostfix] - [HarmonyPatch(typeof(WeaponAttackBase), "GetReloadInterval")] - static void FireRateMultiplier(ref float __result) { - Console.WriteLine("Patching fire rate"); - - __result *= Main.FireRateMultiplier.Value; - Console.WriteLine("Fire rate patched to: {0}", __result); - } - - [HarmonyPostfix] - [HarmonyPatch(typeof(WeaponAttackBase), "GetAimInterval")] - static void AimingIntervalMultiplier(ref float __result) { - Console.WriteLine("Patching aim interval - base amount {0}", baseSupplyValue); - - __result *= Main.AimIntervalMultiplier.Value; - Console.WriteLine("Aim interval patched to: {0}", __result); - } - - [HarmonyPrefix] - [HarmonyPatch(typeof(TimerManager), "GetPersistentTimer")] - static void Transpiler(ref float interval, ref string hint) { - if (hint == "burst") { - Console.WriteLine("Patching burst interval from: {0}", interval); - interval *= Main.FireRateMultiplier.Value; - Console.WriteLine("Burst interval patched to: {0}", interval); - } - } - - [HarmonyPostfix] - [HarmonyPatch(typeof(RefitZone), "OnRefitStep")] - static void SupplyRateMultiplier(ref float hpVal, ref float ammoVal) { - Console.WriteLine("Patching refit step from: {0} {1}", hpVal, ammoVal); - hpVal *= Main.SupplyRateMultiplier.Value; - ammoVal *= Main.SupplyRateMultiplier.Value; - Console.WriteLine("Patching refit step to: {0} {1}", hpVal, ammoVal); - } - - // [HarmonyPatch(typeof(AdvancedRulesData), "Validate")] - // static IEnumerable Transpiler(IEnumerable instructions) { - // var codes = new List(instructions); - // - // foreach (var code in codes) { - // if (code.opcode == OpCodes.Ldc_R4) { - // Console.WriteLine("Changing " + code); - // code.operand = (float)code.operand * 2; - // Console.WriteLine("Changed " + code); - // } - // } - // - // return codes.AsEnumerable(); - // } - - // [HarmonyPatch(typeof(AdvancedRulesData), "IsWithinLimits")] - // static IEnumerable Transpiler2(IEnumerable instructions) { - // var codes = new List(instructions); - // - // foreach (var code in codes) { - // if (code.opcode == OpCodes.Ldc_R4) { - // Console.WriteLine("Changing " + code); - // code.operand = (float)code.operand * 2; - // Console.WriteLine("Changed " + code); - // } - // } - // - // return codes.AsEnumerable(); - // } - - // private static float baseAccuracy; - // - // [HarmonyPostfix] - // [HarmonyPatch(typeof(SkirmishAdvancedRules), "Update")] - // static void AccuracyPatch(SkirmishAdvancedRules __instance) { - // var accMod = Traverse.Create(__instance).Field("currentARD").Field("accuracyModifier"); - // if (baseAccuracy == 0) { - // baseAccuracy = (float)accMod.GetValue(); - // Console.WriteLine("Base accuracy set to {0}", baseAccuracy); - // } - // - // accMod.SetValue(baseAccuracy * 4f); - // Console.WriteLine("Accuracy now: {0}", accMod.GetValue()); - // } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection.Emit; +using birdseye; +using birdseye.Regiments; +using birdseye.Regiments.Commanders; +using birdseye.Regiments.GameModes; +using birdseye.Regiments.Menu.GUI; +using birdseye.Regiments.Platoons; +using birdseye.Regiments.Platoons.Modules; +using birdseye.Regiments.Units.WeaponSystems; +using birdseye.Regiments.Zones; +using HarmonyLib; +using UnityEngine; + +// Patch maxSupPoints in PlatoonSupplyModule +// Patch Operational Authority point gain + +namespace Regiments { + [HarmonyPatch] + public class Patches { + private static float baseHqValue = 0; + private static float baseSupplyValue = 0; + + [HarmonyPrefix] + [HarmonyPatch(typeof(SupplyPointsController), "AddSPs")] + static void SpMultiplier(ref float value) { + if (value == 0) { + return; + } + + float multiplier = Main.SPMultiplier.Value; + // Console.WriteLine("Multiplying SP {0} by {1}", value, multiplier); + value *= multiplier; + } + + [HarmonyPrefix] + [HarmonyPatch(typeof(TacAidPointsController), "AddTP")] + static void TpMultiplier(ref float val) { + if (val == 0) { + return; + } + + float multiplier = Main.TPMultiplier.Value; + // Console.WriteLine("Multiplying TP {0} by {1}", val, multiplier); + val *= multiplier; + } + + [HarmonyPrefix] + [HarmonyPatch(typeof(MapZoneFactory), "MakeRefitZone")] + static void SupplyAoeMultiplier(ref eSides side, ref Vector3 position, ref float size) { + float multiplier = Main.SupplyAOEMultiplier.Value; + Console.WriteLine("Multiplying supply aoe {0} by {1}", size, multiplier); + size *= multiplier; + } + + [HarmonyPrefix] + [HarmonyPatch(typeof(PlatoonHQVisuals), "Start")] + static void HqAoeMultiplier(PlatoonHQVisuals __instance) { + Console.WriteLine("Patching HQ radius - base range {0}", baseHqValue); + if (baseHqValue == 0) { + baseHqValue = __instance.platoon.parameters.HQRadius; + Console.WriteLine("Base range is 0, assigning new: {0}", baseHqValue); + } + + __instance.platoon.parameters.HQRadius = baseHqValue * Main.HQAOEMultiplier.Value; + Console.WriteLine("HQ radius patched to: {0}", __instance.platoon.parameters.HQRadius); + } + + [HarmonyPrefix] + [HarmonyPatch(typeof(PlatoonSupplyModule), "Start")] + static void SupplyAoeMultiplier(PlatoonSupplyModule __instance) { + Console.WriteLine("Patching supply amount - base amount {0}", baseSupplyValue); + if (baseSupplyValue == 0) { + baseSupplyValue = __instance.platoon.parameters.supplyPointsPerUnit; + Console.WriteLine("Base amount is 0, assigning new: {0}", baseSupplyValue); + } + + __instance.platoon.parameters.supplyPointsPerUnit = + (int)(baseSupplyValue * Main.SupplyAmountMultiplier.Value); + Console.WriteLine("Supply amount patched to: {0}", __instance.platoon.parameters.supplyPointsPerUnit); + } + + [HarmonyPostfix] + [HarmonyPatch(typeof(WeaponAttackBase), "GetReloadInterval")] + static void FireRateMultiplier(ref float __result) { + Console.WriteLine("Patching fire rate"); + + __result *= Main.FireRateMultiplier.Value; + Console.WriteLine("Fire rate patched to: {0}", __result); + } + + [HarmonyPostfix] + [HarmonyPatch(typeof(WeaponAttackBase), "GetAimInterval")] + static void AimingIntervalMultiplier(ref float __result) { + Console.WriteLine("Patching aim interval - base amount {0}", baseSupplyValue); + + __result *= Main.AimIntervalMultiplier.Value; + Console.WriteLine("Aim interval patched to: {0}", __result); + } + + [HarmonyPrefix] + [HarmonyPatch(typeof(TimerManager), "GetPersistentTimer")] + static void Transpiler(ref float interval, ref string hint) { + if (hint == "burst") { + Console.WriteLine("Patching burst interval from: {0}", interval); + interval *= Main.FireRateMultiplier.Value; + Console.WriteLine("Burst interval patched to: {0}", interval); + } + } + + [HarmonyPostfix] + [HarmonyPatch(typeof(RefitZone), "OnRefitStep")] + static void SupplyRateMultiplier(ref float hpVal, ref float ammoVal) { + Console.WriteLine("Patching refit step from: {0} {1}", hpVal, ammoVal); + hpVal *= Main.SupplyRateMultiplier.Value; + ammoVal *= Main.SupplyRateMultiplier.Value; + Console.WriteLine("Patching refit step to: {0} {1}", hpVal, ammoVal); + } + + // [HarmonyPatch(typeof(AdvancedRulesData), "Validate")] + // static IEnumerable Transpiler(IEnumerable instructions) { + // var codes = new List(instructions); + // + // foreach (var code in codes) { + // if (code.opcode == OpCodes.Ldc_R4) { + // Console.WriteLine("Changing " + code); + // code.operand = (float)code.operand * 2; + // Console.WriteLine("Changed " + code); + // } + // } + // + // return codes.AsEnumerable(); + // } + + // [HarmonyPatch(typeof(AdvancedRulesData), "IsWithinLimits")] + // static IEnumerable Transpiler2(IEnumerable instructions) { + // var codes = new List(instructions); + // + // foreach (var code in codes) { + // if (code.opcode == OpCodes.Ldc_R4) { + // Console.WriteLine("Changing " + code); + // code.operand = (float)code.operand * 2; + // Console.WriteLine("Changed " + code); + // } + // } + // + // return codes.AsEnumerable(); + // } + + // private static float baseAccuracy; + // + // [HarmonyPostfix] + // [HarmonyPatch(typeof(SkirmishAdvancedRules), "Update")] + // static void AccuracyPatch(SkirmishAdvancedRules __instance) { + // var accMod = Traverse.Create(__instance).Field("currentARD").Field("accuracyModifier"); + // if (baseAccuracy == 0) { + // baseAccuracy = (float)accMod.GetValue(); + // Console.WriteLine("Base accuracy set to {0}", baseAccuracy); + // } + // + // accMod.SetValue(baseAccuracy * 4f); + // Console.WriteLine("Accuracy now: {0}", accMod.GetValue()); + // } + } +} diff --git a/Projects/Regiments/Regiments/Regiments.csproj b/Projects/Regiments/Regiments/Regiments.csproj index 4b89eb4..083cbda 100644 --- a/Projects/Regiments/Regiments/Regiments.csproj +++ b/Projects/Regiments/Regiments/Regiments.csproj @@ -1,76 +1,76 @@ - - - - - Debug - AnyCPU - {DA9D274E-486F-4F82-84FF-CD9388CB0B09} - Library - Properties - Regiments - Regiments - v4.8.1 - 512 - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - libs\0Harmony.dll - - - libs\Assembly-CSharp.dll - - - libs\BepInEx.dll - - - libs\ConfigurationManager.dll - - - libs\MainAssembly.dll - - - - - - - libs\UnityEngine.dll - - - libs\UnityEngine.CoreModule.dll - - - - - - - - - - - - + + + + + Debug + AnyCPU + {DA9D274E-486F-4F82-84FF-CD9388CB0B09} + Library + Properties + Regiments + Regiments + v4.8.1 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + C:\Program Files (x86)\Steam\steamapps\common\Regiments\BepInEx\core\0Harmony.dll + + + C:\Program Files (x86)\Steam\steamapps\common\Regiments\Regiments_Data\Managed\Assembly-CSharp.dll + + + C:\Program Files (x86)\Steam\steamapps\common\Regiments\BepInEx\core\BepInEx.dll + + + C:\Program Files (x86)\Steam\steamapps\common\Regiments\BepInEx\plugins\ConfigurationManager\ConfigurationManager.dll + + + C:\Program Files (x86)\Steam\steamapps\common\Regiments\Regiments_Data\Managed\MainAssembly.dll + + + + + + + C:\Program Files (x86)\Steam\steamapps\common\Regiments\Regiments_Data\Managed\UnityEngine.dll + + + C:\Program Files (x86)\Steam\steamapps\common\Regiments\Regiments_Data\Managed\UnityEngine.CoreModule.dll + + + + + + + + + + + + diff --git a/Projects/Regiments/Regiments/obj/Debug/.NETFramework,Version=v4.8.1.AssemblyAttributes.cs b/Projects/Regiments/Regiments/obj/Debug/.NETFramework,Version=v4.8.1.AssemblyAttributes.cs index 0af6d86..0851892 100644 --- a/Projects/Regiments/Regiments/obj/Debug/.NETFramework,Version=v4.8.1.AssemblyAttributes.cs +++ b/Projects/Regiments/Regiments/obj/Debug/.NETFramework,Version=v4.8.1.AssemblyAttributes.cs @@ -1,4 +1,4 @@ -// -using System; -using System.Reflection; -[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8.1", FrameworkDisplayName = ".NET Framework 4.8.1")] +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8.1", FrameworkDisplayName = ".NET Framework 4.8.1")] diff --git a/Projects/Regiments/Regiments/obj/Debug/Regiments.csproj.AssemblyReference.cache b/Projects/Regiments/Regiments/obj/Debug/Regiments.csproj.AssemblyReference.cache index 30db482d58282a986cf1058365c284bde90acd6f..c22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