using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using HarmonyLib; using LGUUpgradeMerge.Upgrades; using Microsoft.CodeAnalysis; using MoreShipUpgrades.Managers; using MoreShipUpgrades.Misc.Upgrades; using MoreShipUpgrades.UI.TerminalNodes; using MoreShipUpgrades.UpgradeComponents.TierUpgrades; using MoreShipUpgrades.UpgradeComponents.TierUpgrades.AttributeUpgrades; using MoreShipUpgrades.UpgradeComponents.TierUpgrades.Player; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("ClientNetworkTransform")] [assembly: IgnoresAccessChecksTo("com.olegknyazev.softmask")] [assembly: IgnoresAccessChecksTo("DissonanceVoip")] [assembly: IgnoresAccessChecksTo("EasyTextEffects")] [assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")] [assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")] [assembly: IgnoresAccessChecksTo("MoreShipUpgrades")] [assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")] [assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging")] [assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging.DocCodeExamples")] [assembly: IgnoresAccessChecksTo("Unity.Burst")] [assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")] [assembly: IgnoresAccessChecksTo("Unity.Collections")] [assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")] [assembly: IgnoresAccessChecksTo("Unity.Jobs")] [assembly: IgnoresAccessChecksTo("Unity.Mathematics")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.Common")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.MetricTypes")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStats")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Component")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Configuration")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Implementation")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsReporting")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkProfiler.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkSolutionInterface")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Components")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Networking.Transport")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Csg")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.KdTree")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Poly2Tri")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Stl")] [assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Config.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")] [assembly: IgnoresAccessChecksTo("Unity.Services.Authentication")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Analytics")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Configuration")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Device")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments.Internal")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Internal")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Networking")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Registration")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Scheduler")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Telemetry")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Threading")] [assembly: IgnoresAccessChecksTo("Unity.Services.QoS")] [assembly: IgnoresAccessChecksTo("Unity.Services.Relay")] [assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")] [assembly: IgnoresAccessChecksTo("Unity.Timeline")] [assembly: IgnoresAccessChecksTo("Unity.VisualEffectGraph.Runtime")] [assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.UI")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("LGUUpgradeMerge")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("Merged tier upgrades for LateGameUpgrades")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+8c5521e37f37e3d76518a16d04e5d1051842f105")] [assembly: AssemblyProduct("LGUUpgradeMerge")] [assembly: AssemblyTitle("LGUUpgradeMerge")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace LGUUpgradeMerge { [BepInPlugin("com.lguupgrademerge", "LGUUpgradeMerge", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public const string GUID = "com.lguupgrademerge"; public const string NAME = "LGUUpgradeMerge"; public const string VERSION = "1.0.0"; internal static ManualLogSource Log; internal static readonly Dictionary networkPrefabs = new Dictionary(); private void Awake() { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; MergedReinforcedBoots.RegisterUpgrade(); PhysicalConditioning.RegisterUpgrade(); ThickSkin.RegisterUpgrade(); QuickHandsMerge.RegisterUpgrade(); UpgradeBus.Instance.upgradeTypes.Add(typeof(MergedReinforcedBoots)); UpgradeBus.Instance.upgradeTypes.Add(typeof(PhysicalConditioning)); UpgradeBus.Instance.upgradeTypes.Add(typeof(ThickSkin)); UpgradeBus.Instance.upgradeTypes.Add(typeof(QuickHandsMerge)); Harmony val = new Harmony("com.lguupgrademerge"); val.PatchAll(typeof(Plugin).Assembly); Log.LogInfo((object)"LGUUpgradeMerge v1.0.0 loaded successfully."); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "LGUUpgradeMerge"; public const string PLUGIN_NAME = "LGUUpgradeMerge"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace LGUUpgradeMerge.Upgrades { public class MergedReinforcedBoots : TierUpgrade { public const string UPGRADE_NAME = "Reinforced Boots"; public const string PRICES = "500,1100,1800,2400,3000"; public const float RUBBER_BOOTS_DECREASE = 20f; public const float TRACTION_INCREASE = 25f; public const float HIKING_SLOPE_DECREASE = 25f; public const float CARBON_CROUCH_DECREASE = 20f; public const float FALL_DAMAGE_REDUCTION = 25f; public override bool CanInitializeOnStart => false; private void Awake() { ((BaseUpgrade)this).upgradeName = "Reinforced Boots"; ((BaseUpgrade)this).overridenUpgradeName = "Reinforced Boots"; } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { string text = $"LVL 1 - {FormatPrice(initialPrice)} - Reduces water/quicksand movement penalty by {20f}%\n"; if (incrementalPrices != null) { if (incrementalPrices.Length != 0) { text += $"LVL 2 - {FormatPrice(incrementalPrices[0])} - Increases ground traction by {25f}%\n"; } if (incrementalPrices.Length > 1) { text += $"LVL 3 - {FormatPrice(incrementalPrices[1])} - Reduces uphill slope debuff by {25f}%\n"; } if (incrementalPrices.Length > 2) { text += $"LVL 4 - {FormatPrice(incrementalPrices[2])} - Reduces crouch speed penalty by {20f}%\n"; } if (incrementalPrices.Length > 3) { text += $"LVL 5 - {FormatPrice(incrementalPrices[3])} - Reduces fall damage by {25f}%\n"; } } return text; } public static void RegisterUpgrade() { GameObject val = ItemManager.CreateNetworkPrefab("Reinforced Boots"); val.AddComponent(); Plugin.networkPrefabs["Reinforced Boots"] = val; } public static CustomTerminalNode RegisterTerminalNode() { if (!Plugin.networkPrefabs.ContainsKey("Reinforced Boots")) { return null; } int[] array = ParsePrices("500,1100,1800,2400,3000"); int num = array[0]; int[] array2 = new int[array.Length - 1]; Array.Copy(array, 1, array2, 0, array2.Length); return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Reinforced Boots", false, true, num, array2, "", Plugin.networkPrefabs["Reinforced Boots"], true, (PurchaseMode)2, false, 1f); } public static (string, string[]) RegisterScrapToUpgrade() { return ("Reinforced Boots", Array.Empty()); } internal static string FormatPrice(int price) { return BaseUpgrade.GetUpgradePrice(price, (PurchaseMode)2); } internal static int[] ParsePrices(string prices) { string[] array = prices.Split(','); int[] array2 = new int[array.Length]; for (int i = 0; i < array.Length; i++) { int.TryParse(array[i].Trim(), out array2[i]); } return array2; } public override void __initializeVariables() { ((TierUpgrade)this).__initializeVariables(); } public override void __initializeRpcs() { ((TierUpgrade)this).__initializeRpcs(); } public override string __getTypeName() { return "MergedReinforcedBoots"; } } public class PhysicalConditioning : TierUpgrade { public const string UPGRADE_NAME = "Physical Conditioning"; public const string PRICES = "1000,1700,2300,3000"; public const float MOVEMENT_SPEED_INITIAL = 1.4f; public const float SPRINT_TIME_INITIAL = 6f; public const float STAMINA_REGEN_MULT = 1.05f; public const float JUMP_FORCE_INITIAL = 3f; public const float JUMP_FORCE_INCREMENT = 0.75f; public const float NOISE_REDUCTION = 10f; public override bool CanInitializeOnStart => false; private void Awake() { ((BaseUpgrade)this).upgradeName = "Physical Conditioning"; ((BaseUpgrade)this).overridenUpgradeName = "Physical Conditioning"; } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { string text = $"LVL 1 - {FormatPrice(initialPrice)} - Increases movement speed by {1.4f}\n"; if (incrementalPrices != null) { if (incrementalPrices.Length != 0) { text += $"LVL 2 - {FormatPrice(incrementalPrices[0])} - Increases stamina by {6f}s, regen by {4.999995f}%\n"; } if (incrementalPrices.Length > 1) { text += $"LVL 3 - {FormatPrice(incrementalPrices[1])} - Increases jump height by {3f}\n"; } if (incrementalPrices.Length > 2) { text += $"LVL 4 - {FormatPrice(incrementalPrices[2])} - Jump height +{0.75f}, footstep noise -{10f}\n"; } } return text; } public static void RegisterUpgrade() { GameObject val = ItemManager.CreateNetworkPrefab("Physical Conditioning"); val.AddComponent(); Plugin.networkPrefabs["Physical Conditioning"] = val; } public static CustomTerminalNode RegisterTerminalNode() { if (!Plugin.networkPrefabs.ContainsKey("Physical Conditioning")) { return null; } int[] array = MergedReinforcedBoots.ParsePrices("1000,1700,2300,3000"); int num = array[0]; int[] array2 = new int[array.Length - 1]; Array.Copy(array, 1, array2, 0, array2.Length); return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Physical Conditioning", false, true, num, array2, "", Plugin.networkPrefabs["Physical Conditioning"], true, (PurchaseMode)2, false, 1f); } public static (string, string[]) RegisterScrapToUpgrade() { return ("Physical Conditioning", Array.Empty()); } private static string FormatPrice(int price) { return BaseUpgrade.GetUpgradePrice(price, (PurchaseMode)2); } public override void __initializeVariables() { ((TierUpgrade)this).__initializeVariables(); } public override void __initializeRpcs() { ((TierUpgrade)this).__initializeRpcs(); } public override string __getTypeName() { return "PhysicalConditioning"; } } public class QuickHandsMerge : TierUpgrade { public const string UPGRADE_NAME = "Quick Hands"; public const string PRICES = "400,500,750,1000,1250"; public const float GRAB_DISTANCE_PER_TIER = 1f; public const int MECHANICAL_ARMS_MAX_TIERS = 4; public const int INTERACTION_SPEED_PER_TIER = 20; public override bool CanInitializeOnStart => false; private void Awake() { ((BaseUpgrade)this).upgradeName = "Quick Hands"; ((BaseUpgrade)this).overridenUpgradeName = "Quick Hands"; } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { string text = ""; int[] array = ParsePrices("400,500,750,1000,1250"); for (int i = 0; i < array.Length; i++) { int num = i + 1; string text2 = FormatPrice(array[i]); float num2 = (float)Mathf.Min(num, 4) * 1f; int num3 = num * 20; text = ((num > 4) ? (text + $"LVL {num} - {text2} - +{num3}% interaction speed\n") : (text + $"LVL {num} - {text2} - +{num2} interaction range, +{num3}% interaction speed\n")); } return text; } public static void RegisterUpgrade() { GameObject val = ItemManager.CreateNetworkPrefab("Quick Hands"); val.AddComponent(); Plugin.networkPrefabs["Quick Hands"] = val; } public static CustomTerminalNode RegisterTerminalNode() { if (!Plugin.networkPrefabs.ContainsKey("Quick Hands")) { return null; } int[] array = ParsePrices("400,500,750,1000,1250"); int num = array[0]; int[] array2 = new int[array.Length - 1]; Array.Copy(array, 1, array2, 0, array2.Length); return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Quick Hands", false, true, num, array2, "", Plugin.networkPrefabs["Quick Hands"], true, (PurchaseMode)2, false, 1f); } public static (string, string[]) RegisterScrapToUpgrade() { return ("Quick Hands", Array.Empty()); } internal static string FormatPrice(int price) { return BaseUpgrade.GetUpgradePrice(price, (PurchaseMode)2); } internal static int[] ParsePrices(string prices) { string[] array = prices.Split(','); int[] array2 = new int[array.Length]; for (int i = 0; i < array.Length; i++) { int.TryParse(array[i].Trim(), out array2[i]); } return array2; } public override void __initializeVariables() { ((TierUpgrade)this).__initializeVariables(); } public override void __initializeRpcs() { ((TierUpgrade)this).__initializeRpcs(); } public override string __getTypeName() { return "QuickHandsMerge"; } } public class ThickSkin : TierUpgrade { public const string UPGRADE_NAME = "Thick Skin"; public const string PRICES = "1000,1500,2000,2500"; public const int HEALTH_REGEN_INCREASE = 1; public const float HEALTH_CAP_PERCENT = 50f; public const int HEALTH_INCREASE_PER_TIER = 20; public override bool CanInitializeOnStart => false; private void Awake() { ((BaseUpgrade)this).upgradeName = "Thick Skin"; ((BaseUpgrade)this).overridenUpgradeName = "Thick Skin"; } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { int[] array = MergedReinforcedBoots.ParsePrices("1000,1500,2000,2500"); string text = ""; for (int i = 0; i < array.Length; i++) { int num = i + 1; int num2 = num * 20; string text2 = FormatPrice(array[i]); text = num switch { 1 => text + $"LVL {num} - {text2} - +{num2} max HP, +{1} health regen\n", 2 => text + $"LVL {num} - {text2} - +{num2} max HP, +{50f}% regen cap\n", _ => text + $"LVL {num} - {text2} - +{num2} max HP\n", }; } return text; } public static void RegisterUpgrade() { GameObject val = ItemManager.CreateNetworkPrefab("Thick Skin"); val.AddComponent(); Plugin.networkPrefabs["Thick Skin"] = val; } public static CustomTerminalNode RegisterTerminalNode() { if (!Plugin.networkPrefabs.ContainsKey("Thick Skin")) { return null; } int[] array = MergedReinforcedBoots.ParsePrices("1000,1500,2000,2500"); int num = array[0]; int[] array2 = new int[array.Length - 1]; Array.Copy(array, 1, array2, 0, array2.Length); return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Thick Skin", false, true, num, array2, "", Plugin.networkPrefabs["Thick Skin"], true, (PurchaseMode)2, false, 1f); } public static (string, string[]) RegisterScrapToUpgrade() { return ("Thick Skin", Array.Empty()); } private static string FormatPrice(int price) { return BaseUpgrade.GetUpgradePrice(price, (PurchaseMode)2); } public override void __initializeVariables() { ((TierUpgrade)this).__initializeVariables(); } public override void __initializeRpcs() { ((TierUpgrade)this).__initializeRpcs(); } public override string __getTypeName() { return "ThickSkin"; } } } namespace LGUUpgradeMerge.Patches { [HarmonyPatch(typeof(RunningShoes), "GetAdditionalMovementSpeed")] internal static class RunningShoesMovementPatch { [HarmonyPostfix] private static void Postfix(ref float __result, float defaultValue) { if (BaseUpgrade.GetActiveUpgrade("Physical Conditioning")) { float num = Mathf.Clamp(defaultValue + 1.4f, defaultValue, float.MaxValue); __result = Mathf.Max(__result, num); } } } [HarmonyPatch(typeof(BiggerLungs), "GetAdditionalStaminaTime")] internal static class BiggerLungsStaminaTimePatch { [HarmonyPostfix] private static void Postfix(ref float __result, float defaultValue) { if (BaseUpgrade.GetActiveUpgrade("Physical Conditioning") && BaseUpgrade.GetUpgradeLevel("Physical Conditioning") >= 1) { float num = Mathf.Clamp(defaultValue + 6f, defaultValue, float.MaxValue); __result = Mathf.Max(__result, num); } } } [HarmonyPatch(typeof(BiggerLungs), "ApplyPossibleIncreasedStaminaRegen")] internal static class BiggerLungsStaminaRegenPatch { [HarmonyPostfix] private static void Postfix(ref float __result, float regenValue) { if (BaseUpgrade.GetActiveUpgrade("Physical Conditioning") && BaseUpgrade.GetUpgradeLevel("Physical Conditioning") >= 1) { float num = regenValue * 1.05f; __result = Mathf.Max(__result, num); } } } [HarmonyPatch(typeof(StrongLegs), "GetAdditionalJumpForce")] internal static class StrongLegsJumpPatch { [HarmonyPostfix] private static void Postfix(ref float __result, float defaultValue) { if (!BaseUpgrade.GetActiveUpgrade("Physical Conditioning")) { return; } int upgradeLevel = BaseUpgrade.GetUpgradeLevel("Physical Conditioning"); if (upgradeLevel >= 2) { float num = 3f; if (upgradeLevel >= 3) { num += 0.75f; } float num2 = Mathf.Clamp(defaultValue + num, defaultValue, float.MaxValue); __result = Mathf.Max(__result, num2); } } } [HarmonyPatch(typeof(RunningShoes), "ApplyPossibleReducedNoiseRange")] internal static class RunningShoesNoisePatch { [HarmonyPostfix] private static void Postfix(ref float __result, float defaultValue) { if (BaseUpgrade.GetActiveUpgrade("Physical Conditioning") && BaseUpgrade.GetUpgradeLevel("Physical Conditioning") >= 3) { float num = Mathf.Clamp(defaultValue - 10f, 0f, defaultValue); __result = Mathf.Min(__result, num); } } } [HarmonyPatch(typeof(MechanicalArms), "GetIncreasedGrabDistance")] internal static class MechanicalArmsGrabDistancePatch { [HarmonyPostfix] private static void Postfix(ref float __result, float defaultValue) { try { if (BaseUpgrade.GetActiveUpgrade("Quick Hands")) { int upgradeLevel = BaseUpgrade.GetUpgradeLevel("Quick Hands"); int num = Math.Min(upgradeLevel + 1, 4); float num2 = (float)num * 1f; float num3 = Mathf.Clamp(defaultValue + num2, defaultValue, float.MaxValue); __result = Mathf.Max(__result, num3); } } catch (Exception arg) { Plugin.Log.LogError((object)$"QuickHandsMerge MechanicalArms patch failed: {arg}"); } } } [HarmonyPatch(typeof(QuickHands), "IncreaseInteractionSpeed")] internal static class QuickHandsInteractionSpeedPatch { [HarmonyPostfix] private static void Postfix(ref float __result, float defaultValue) { try { if (BaseUpgrade.GetActiveUpgrade("Quick Hands")) { int upgradeLevel = BaseUpgrade.GetUpgradeLevel("Quick Hands"); int num = upgradeLevel + 1; float num2 = (float)(num * 20) / 100f; float num3 = (int)Mathf.Clamp(defaultValue + defaultValue * num2, defaultValue, float.MaxValue); __result = Mathf.Max(__result, num3); } } catch (Exception arg) { Plugin.Log.LogError((object)$"QuickHandsMerge QuickHands patch failed: {arg}"); } } } [HarmonyPatch(typeof(RubberBoots), "CalculateDecreaseMultiplier")] internal static class RubberBootsDecreaseMultiplierPatch { [HarmonyPostfix] private static void Postfix(ref float __result) { if (BaseUpgrade.GetActiveUpgrade("Reinforced Boots")) { float num = 0.2f; __result = Mathf.Max(__result, num); } } } [HarmonyPatch(typeof(TractionBoots), "GetAdditionalTractionForce")] internal static class TractionBootsForcePatch { [HarmonyPostfix] private static void Postfix(ref float __result, float defaultValue) { if (BaseUpgrade.GetActiveUpgrade("Reinforced Boots") && BaseUpgrade.GetUpgradeLevel("Reinforced Boots") >= 1) { float num = 1.25f; float num2 = Mathf.Clamp(num * defaultValue, defaultValue, float.MaxValue); __result = Mathf.Max(__result, num2); } } } [HarmonyPatch(typeof(HikingBoots), "ReduceUphillSlopeDebuff")] internal static class HikingBootsSlopePatch { [HarmonyPostfix] private static void Postfix(ref float __result, float defaultValue) { if (BaseUpgrade.GetActiveUpgrade("Reinforced Boots") && BaseUpgrade.GetUpgradeLevel("Reinforced Boots") >= 2) { float num = 0.75f; float num2 = Mathf.Clamp(defaultValue * num, 0f, defaultValue); __result = Mathf.Min(__result, num2); } } } [HarmonyPatch(typeof(CarbonKneejoints), "CalculateDecreaseMultiplier")] internal static class CarbonKneejointsDecreaseMultiplierPatch { [HarmonyPostfix] private static void Postfix(ref float __result) { if (BaseUpgrade.GetActiveUpgrade("Reinforced Boots") && BaseUpgrade.GetUpgradeLevel("Reinforced Boots") >= 3) { float num = 0.2f; __result = Mathf.Max(__result, num); } } } [HarmonyPatch(typeof(ReinforcedBoots), "ReduceFallDamage")] internal static class ReinforcedBootsFallDamagePatch { [HarmonyPostfix] private static void Postfix(ref int __result, int defaultValue) { if (BaseUpgrade.GetActiveUpgrade("Reinforced Boots") && BaseUpgrade.GetUpgradeLevel("Reinforced Boots") >= 4) { float num = 0.75f; int num2 = (int)Mathf.Clamp((float)defaultValue * num, 0f, (float)defaultValue); __result = Mathf.Min(__result, num2); } } } [HarmonyPatch(typeof(Stimpack), "CheckForAdditionalHealth")] internal static class StimpackCheckForAdditionalHealthPatch { [HarmonyPostfix] private static void Postfix(ref int __result, int health) { try { if (BaseUpgrade.GetActiveUpgrade("Thick Skin")) { int upgradeLevel = BaseUpgrade.GetUpgradeLevel("Thick Skin"); int num = upgradeLevel + 1; int num2 = num * 20; int num3 = health + num2; __result = Mathf.Max(__result, num3); } } catch (Exception arg) { Plugin.Log.LogError((object)$"ThickSkin Stimpack patch failed: {arg}"); } } } [HarmonyPatch(typeof(EffectiveBandaids), "GetIncreasedHealthRegenerated")] internal static class EffectiveBandaidsPatch { [HarmonyPostfix] private static void Postfix(ref int __result, int defaultValue) { try { if (BaseUpgrade.GetActiveUpgrade("Thick Skin")) { int num = Mathf.Clamp(defaultValue + 1, defaultValue, Stimpack.CheckForAdditionalHealth(100)); __result = Mathf.Max(__result, num); } } catch (Exception arg) { Plugin.Log.LogError((object)$"ThickSkin EffectiveBandaids patch failed: {arg}"); } } } [HarmonyPatch(typeof(MedicalNanobots), "GetIncreasedHealthRegeneration")] internal static class MedicalNanobotsPatch { [HarmonyPostfix] private static void Postfix(ref int __result, int defaultValue) { try { if (BaseUpgrade.GetActiveUpgrade("Thick Skin") && BaseUpgrade.GetUpgradeLevel("Thick Skin") >= 1) { float num = 0.5f; int num2 = Mathf.Clamp(defaultValue + (int)((float)defaultValue * num), defaultValue, Stimpack.CheckForAdditionalHealth(100)); __result = Mathf.Max(__result, num2); } } catch (Exception arg) { Plugin.Log.LogError((object)$"ThickSkin MedicalNanobots patch failed: {arg}"); } } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }