Decompiled source of Lategame Upgrades KR v1.0.2

BeplnEx/plugins/MoreShipUpgradesKR/MoreShipUpgrades.dll

Decompiled a day ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using CSync.Extensions;
using CSync.Lib;
using CustomItemBehaviourLibrary.AbstractItems;
using GameNetcodeStuff;
using GoodItemScan;
using HarmonyLib;
using InteractiveTerminalAPI.Compat;
using InteractiveTerminalAPI.UI;
using InteractiveTerminalAPI.UI.Application;
using InteractiveTerminalAPI.UI.Cursor;
using InteractiveTerminalAPI.UI.Page;
using InteractiveTerminalAPI.UI.Screen;
using LCVR.Player;
using LethalCompanyInputUtils.Api;
using LethalLevelLoader;
using LethalLib.Extras;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using MoreShipUpgrades.API;
using MoreShipUpgrades.Compat;
using MoreShipUpgrades.Input;
using MoreShipUpgrades.Managers;
using MoreShipUpgrades.Misc;
using MoreShipUpgrades.Misc.Commands;
using MoreShipUpgrades.Misc.TerminalNodes;
using MoreShipUpgrades.Misc.UI.Application;
using MoreShipUpgrades.Misc.UI.Cursor;
using MoreShipUpgrades.Misc.Upgrades;
using MoreShipUpgrades.Misc.Util;
using MoreShipUpgrades.NetcodePatcher;
using MoreShipUpgrades.Patches.Enemies;
using MoreShipUpgrades.Patches.HUD;
using MoreShipUpgrades.Patches.Interactables;
using MoreShipUpgrades.Patches.Items;
using MoreShipUpgrades.Patches.NetworkManager;
using MoreShipUpgrades.Patches.PlayerController;
using MoreShipUpgrades.Patches.RoundComponents;
using MoreShipUpgrades.Patches.TerminalComponents;
using MoreShipUpgrades.Patches.Weather;
using MoreShipUpgrades.UpgradeComponents.Commands;
using MoreShipUpgrades.UpgradeComponents.Contracts;
using MoreShipUpgrades.UpgradeComponents.Interfaces;
using MoreShipUpgrades.UpgradeComponents.Items;
using MoreShipUpgrades.UpgradeComponents.Items.Contracts.BombDefusal;
using MoreShipUpgrades.UpgradeComponents.Items.Contracts.DataRetrieval;
using MoreShipUpgrades.UpgradeComponents.Items.Contracts.Exorcism;
using MoreShipUpgrades.UpgradeComponents.Items.Contracts.Exterminator;
using MoreShipUpgrades.UpgradeComponents.Items.Contracts.Extraction;
using MoreShipUpgrades.UpgradeComponents.Items.RadarBooster;
using MoreShipUpgrades.UpgradeComponents.OneTimeUpgrades;
using MoreShipUpgrades.UpgradeComponents.OneTimeUpgrades.Enemies;
using MoreShipUpgrades.UpgradeComponents.OneTimeUpgrades.Items;
using MoreShipUpgrades.UpgradeComponents.OneTimeUpgrades.Player;
using MoreShipUpgrades.UpgradeComponents.OneTimeUpgrades.Ship;
using MoreShipUpgrades.UpgradeComponents.OneTimeUpgrades.Store;
using MoreShipUpgrades.UpgradeComponents.TierUpgrades;
using MoreShipUpgrades.UpgradeComponents.TierUpgrades.AttributeUpgrades;
using MoreShipUpgrades.UpgradeComponents.TierUpgrades.Enemies;
using MoreShipUpgrades.UpgradeComponents.TierUpgrades.Items;
using MoreShipUpgrades.UpgradeComponents.TierUpgrades.Items.RadarBooster;
using MoreShipUpgrades.UpgradeComponents.TierUpgrades.Items.Shotgun;
using MoreShipUpgrades.UpgradeComponents.TierUpgrades.Items.WeedKiller;
using MoreShipUpgrades.UpgradeComponents.TierUpgrades.Items.Zapgun;
using MoreShipUpgrades.UpgradeComponents.TierUpgrades.Player;
using MoreShipUpgrades.UpgradeComponents.TierUpgrades.Ship;
using MoreShipUpgrades.UpgradeComponents.TierUpgrades.Store;
using Newtonsoft.Json;
using Oxygen.GameObjects;
using TMPro;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[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 MoreShipUpgrades
{
	[BepInPlugin("com.malco.lethalcompany.moreshipupgrades", "More Ship Upgrades", "3.10.2")]
	[BepInDependency("evaisa.lethallib", "0.13.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		internal static ManualLogSource mls;

		internal static readonly Dictionary<string, GameObject> networkPrefabs = new Dictionary<string, GameObject>();

		private void Awake()
		{
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Expected O, but got Unknown
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Expected O, but got Unknown
			mls = ((BaseUnityPlugin)this).Logger;
			LategameConfiguration lategameConfiguration = new LategameConfiguration(((BaseUnityPlugin)this).Config);
			IEnumerable<Type> types;
			try
			{
				types = Assembly.GetExecutingAssembly().GetTypes();
			}
			catch (ReflectionTypeLoadException ex)
			{
				types = ex.Types.Where((Type t) => t != null);
			}
			foreach (Type item in types)
			{
				MethodInfo[] methods = item.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				foreach (MethodInfo methodInfo in methods)
				{
					object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
					if (customAttributes.Length != 0)
					{
						methodInfo.Invoke(null, null);
					}
				}
			}
			string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "shipupgrades");
			AssetBundle bundle = AssetBundle.LoadFromFile(text);
			GameObject val = new GameObject("UpgradeBus")
			{
				hideFlags = (HideFlags)61
			};
			val.AddComponent<UpgradeBus>();
			val = new GameObject("SpawnItemManager");
			val.AddComponent<ItemManager>();
			UpgradeBus.Instance.UpgradeAssets = bundle;
			UpgradeBus.Instance.SetConfiguration(lategameConfiguration);
			SetupModStore(ref bundle);
			SetupItems(ref types);
			SetupCommands(ref types);
			SetupPerks(ref types);
			ContractManager.SetupContractMapObjects(ref bundle);
			InputUtilsCompat.Init();
			PatchManager.PatchMainVersion();
			InteractiveTerminalManager.RegisterApplication<UpgradeStoreApplication>(new string[2] { "lgu", "lategame store" }, false);
			InteractiveTerminalManager.RegisterApplication<ContractApplication>("contracts", false);
			if (!SyncedEntry<bool>.op_Implicit(lategameConfiguration.CONTRACT_PROVIDE_RANDOM_ONLY))
			{
				InteractiveTerminalManager.RegisterApplication<ContractApplication>("contract", false);
			}
			mls.LogInfo((object)"More Ship Upgrades 3.10.2 has been loaded successfully.");
		}

		private void SetupModStore(ref AssetBundle bundle)
		{
			GameObject val = AssetBundleHandler.TryLoadGameObjectAsset(ref bundle, "Assets/ShipUpgrades/LguStore.prefab");
			val.AddComponent<ContractManager>();
			val.AddComponent<LguStore>();
			NetworkPrefabs.RegisterNetworkPrefab(val);
			UpgradeBus.Instance.modStorePrefab = val;
		}

		private void SetupItems(ref IEnumerable<Type> types)
		{
			foreach (Type type in types)
			{
				if (type.IsSubclassOf(typeof(LategameItem)) && !(type == typeof(LategameItem)))
				{
					UpgradeBus.Instance.itemTypes.Add(type);
					MethodInfo method = type.GetMethod("LoadItem", BindingFlags.Static | BindingFlags.Public);
					if (!(method == null))
					{
						method.Invoke(null, null);
					}
				}
			}
			mls.LogInfo((object)"Items have been setup");
		}

		private void SetupPerks(ref IEnumerable<Type> types)
		{
			foreach (Type type in types)
			{
				if (type.IsSubclassOf(typeof(BaseUpgrade)) && !(type == typeof(OneTimeUpgrade)) && !(type == typeof(TierUpgrade)) && !(type == typeof(GameAttributeTierUpgrade)))
				{
					UpgradeBus.Instance.upgradeTypes.Add(type);
					MethodInfo method = type.GetMethod("RegisterUpgrade", BindingFlags.Static | BindingFlags.Public);
					method.Invoke(null, null);
				}
			}
			mls.LogInfo((object)"Upgrades have been setup");
		}

		private void SetupCommands(ref IEnumerable<Type> types)
		{
			foreach (Type type in types)
			{
				if (type.IsSubclassOf(typeof(BaseCommand)))
				{
					UpgradeBus.Instance.commandTypes.Add(type);
					MethodInfo method = type.GetMethod("RegisterCommand", BindingFlags.Static | BindingFlags.Public);
					method.Invoke(null, null);
				}
			}
			mls.LogInfo((object)"Commands have been setup");
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "MoreShipUpgrades";

		public const string PLUGIN_NAME = "MoreShipUpgrades";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace MoreShipUpgrades.UpgradeComponents.TierUpgrades
{
	internal class Beekeeper : TierUpgrade, IUpgradeWorldBuilding
	{
		internal bool increaseHivePrice = false;

		internal static Beekeeper Instance;

		public const string UPGRADE_NAME = "Beekeeper";

		public const string PRICES_DEFAULT = "225,280,340";

		internal const string WORLD_BUILDING_TEXT = "\n\nOn-the-job training package that teaches {0} proper Circuit Bee Nest handling techniques. Also comes with a weekly issuance of alkaline pills to partially inoculate {0} against Circuit Bee Venom.\n\n";

		public override bool CanInitializeOnStart
		{
			get
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				string[] array = configuration.BEEKEEPER_UPGRADE_PRICES.Value.Split(',');
				return configuration.BEEKEEPER_PRICE.Value <= 0 && array.Length == 1 && (array[0].Length == 0 || array[0] == "0");
			}
		}

		private void Awake()
		{
			upgradeName = "Beekeeper";
			overridenUpgradeName = SyncedEntry<string>.op_Implicit(BaseUpgrade.GetConfiguration().BEEKEEPER_OVERRIDE_NAME);
			Instance = this;
		}

		public override void Increment()
		{
			base.Increment();
			if (BaseUpgrade.GetUpgradeLevel("Beekeeper") == BaseUpgrade.GetConfiguration().BEEKEEPER_UPGRADE_PRICES.Value.Split(',').Length)
			{
				ToggleIncreaseHivePriceServerRpc();
			}
		}

		public static int CalculateBeeDamage(int damageNumber)
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			if (!SyncedEntry<bool>.op_Implicit(configuration.BEEKEEPER_ENABLED))
			{
				return damageNumber;
			}
			if (!BaseUpgrade.GetActiveUpgrade("Beekeeper"))
			{
				return damageNumber;
			}
			return Mathf.Clamp((int)((float)damageNumber * (configuration.BEEKEEPER_DAMAGE_MULTIPLIER.Value - (float)BaseUpgrade.GetUpgradeLevel("Beekeeper") * configuration.BEEKEEPER_DAMAGE_MULTIPLIER_INCREMENT.Value)), 0, damageNumber);
		}

		public static int GetHiveScrapValue(int originalValue)
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			if (!configuration.BEEKEEPER_ENABLED.Value || !Instance.increaseHivePrice)
			{
				return originalValue;
			}
			return (int)((float)originalValue * configuration.BEEKEEPER_HIVE_VALUE_INCREASE.Value);
		}

		public string GetWorldBuildingText(bool shareStatus = false)
		{
			return string.Format("\n\n{0}에게 적절한 회로 벌집 처리 기술을 가르치는 직무 교육 패키지입니다. 또한 {0}이(가) 회로 벌레 독에 부분적으로 면역되도록 매주 알칼리성 알약이 제공됩니다.\n\n", shareStatus ? "당신의 크루" : "당신");
		}

		public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null)
		{
			string infoFromJSON = AssetBundleHandler.GetInfoFromJSON("Beekeeper");
			return Tools.GenerateInfoForUpgrade(infoFromJSON, initialPrice, incrementalPrices, infoFunction) + $"\n최대 레벨에서는 벌집의 가치가 {(SyncedEntry<float>.op_Implicit(BaseUpgrade.GetConfiguration().BEEKEEPER_HIVE_VALUE_INCREASE) - 1f) * 100f:F0}% 증가합니다.";
			static float infoFunction(int level)
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				return 100f * (configuration.BEEKEEPER_DAMAGE_MULTIPLIER.Value - (float)level * configuration.BEEKEEPER_DAMAGE_MULTIPLIER_INCREMENT.Value);
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void ToggleIncreaseHivePriceServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3970566516u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3970566516u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					ToggleIncreaseHivePriceClientRpc();
				}
			}
		}

		[ClientRpc]
		public void ToggleIncreaseHivePriceClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(708329620u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 708329620u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					increaseHivePrice = true;
				}
			}
		}

		public new static (string, string[]) RegisterScrapToUpgrade()
		{
			return ("Beekeeper", BaseUpgrade.GetConfiguration().BEEKEEPER_ITEM_PROGRESSION_ITEMS.Value.Split(","));
		}

		public new static void RegisterUpgrade()
		{
			BaseUpgrade.SetupGenericPerk<Beekeeper>("Beekeeper");
		}

		public new static CustomTerminalNode RegisterTerminalNode()
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Beekeeper", configuration.SHARED_UPGRADES.Value || !configuration.BEEKEEPER_INDIVIDUAL.Value, configuration.BEEKEEPER_ENABLED.Value, configuration.BEEKEEPER_PRICE.Value, UpgradeBus.ParseUpgradePrices(configuration.BEEKEEPER_UPGRADE_PRICES.Value), SyncedEntry<bool>.op_Implicit(configuration.OVERRIDE_UPGRADE_NAMES) ? SyncedEntry<string>.op_Implicit(configuration.BEEKEEPER_OVERRIDE_NAME) : "");
		}

		protected override void __initializeVariables()
		{
			base.__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_Beekeeper()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(3970566516u, new RpcReceiveHandler(__rpc_handler_3970566516));
			NetworkManager.__rpc_func_table.Add(708329620u, new RpcReceiveHandler(__rpc_handler_708329620));
		}

		private static void __rpc_handler_3970566516(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Beekeeper)(object)target).ToggleIncreaseHivePriceServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_708329620(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((Beekeeper)(object)target).ToggleIncreaseHivePriceClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "Beekeeper";
		}
	}
	internal class BiggerLungs : TierUpgrade, IUpgradeWorldBuilding
	{
		public const string UPGRADE_NAME = "Bigger Lungs";

		internal const string PRICES_DEFAULT = "350,450,550";

		internal const string WORLD_BUILDING_TEXT = "\n\nService package for {0}. Opting into every maintenance procedure will arrange for your suit's pipes to be cleaned and repaired, filters re-issued, and DRM removed from the integrated air conditioning system.\n\n";

		public override bool CanInitializeOnStart
		{
			get
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				string[] array = configuration.BIGGER_LUNGS_UPGRADE_PRICES.Value.Split(',');
				return configuration.BIGGER_LUNGS_PRICE.Value <= 0 && array.Length == 1 && (array[0].Length == 0 || array[0] == "0");
			}
		}

		private void Awake()
		{
			upgradeName = "Bigger Lungs";
			overridenUpgradeName = SyncedEntry<string>.op_Implicit(BaseUpgrade.GetConfiguration().BIGGER_LUNGS_OVERRIDE_NAME);
		}

		public static float ApplyPossibleIncreasedStaminaRegen(float regenValue)
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			if (!configuration.BIGGER_LUNGS_ENABLED.Value)
			{
				return regenValue;
			}
			if (!BaseUpgrade.GetActiveUpgrade("Bigger Lungs") || BaseUpgrade.GetUpgradeLevel("Bigger Lungs") < configuration.BIGGER_LUNGS_STAMINA_REGEN_APPLY_LEVEL.Value - 1)
			{
				return regenValue;
			}
			return regenValue * Mathf.Clamp(configuration.BIGGER_LUNGS_STAMINA_REGEN_INCREASE.Value + SyncedEntry<float>.op_Implicit(configuration.BIGGER_LUNGS_STAMINA_REGEN_INCREMENTAL_INCREASE) * (float)Mathf.Abs(BaseUpgrade.GetUpgradeLevel("Bigger Lungs") - configuration.BIGGER_LUNGS_STAMINA_REGEN_APPLY_LEVEL.Value - 1), 0f, 10f);
		}

		public static float GetAdditionalStaminaTime(float defaultValue)
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			if (!SyncedEntry<bool>.op_Implicit(configuration.BIGGER_LUNGS_ENABLED))
			{
				return defaultValue;
			}
			if (!BaseUpgrade.GetActiveUpgrade("Bigger Lungs"))
			{
				return defaultValue;
			}
			float num = SyncedEntry<float>.op_Implicit(configuration.SPRINT_TIME_INCREASE_UNLOCK) + (float)BaseUpgrade.GetUpgradeLevel("Bigger Lungs") * SyncedEntry<float>.op_Implicit(configuration.SPRINT_TIME_INCREMENT);
			return Mathf.Clamp(defaultValue + num, defaultValue, float.MaxValue);
		}

		public static float ApplyPossibleReducedJumpStaminaCost(float jumpCost)
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			if (!configuration.BIGGER_LUNGS_ENABLED.Value)
			{
				return jumpCost;
			}
			if (!BaseUpgrade.GetActiveUpgrade("Bigger Lungs") || BaseUpgrade.GetUpgradeLevel("Bigger Lungs") < configuration.BIGGER_LUNGS_JUMP_STAMINA_APPLY_LEVEL.Value - 1)
			{
				return jumpCost;
			}
			return jumpCost * Mathf.Clamp(configuration.BIGGER_LUNGS_JUMP_STAMINA_COST_DECREASE.Value - SyncedEntry<float>.op_Implicit(configuration.BIGGER_LUNGS_JUMP_STAMINA_COST_INCREMENTAL_DECREASE) * (float)Mathf.Abs(BaseUpgrade.GetUpgradeLevel("Bigger Lungs") - configuration.BIGGER_LUNGS_JUMP_STAMINA_APPLY_LEVEL.Value - 1), 0f, 10f);
		}

		public string GetWorldBuildingText(bool shareStatus = false)
		{
			return string.Format("\n\n{0}용 서비스 패키지입니다. 모든 유지보수 절차를 선택하면, 당신의 슈트의 배관이 청소 및 수리되고, 필터가 다시 발급되며, 통합 공기 조절 시스템의 DRM이 제거됩니다.\n\n", shareStatus ? "당신의 슈트의 산소 공급 시스템" : "승무원의 우주복 산소 공급 시스템");
		}

		private string GetBiggerlungsInfo(int level, int price)
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.AppendFormat(AssetBundleHandler.GetInfoFromJSON("Bigger Lungs"), level, price, infoFunction(level - 1));
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			if (level >= configuration.BIGGER_LUNGS_STAMINA_REGEN_APPLY_LEVEL.Value)
			{
				stringBuilder.Append($"스태미나 회복 속도가 {Mathf.FloorToInt(staminaRegenerationInfo(level) * 100f)}% 증가합니다.\n");
			}
			if (level >= configuration.BIGGER_LUNGS_JUMP_STAMINA_APPLY_LEVEL.Value)
			{
				stringBuilder.Append($"점프할 때 사용되는 스태미나가 {Mathf.FloorToInt(costReductionInfo(level) * 100f)}% 감소합니다.\n");
			}
			return stringBuilder.ToString();
			static float costReductionInfo(int level)
			{
				LategameConfiguration configuration2 = BaseUpgrade.GetConfiguration();
				return 1f - (configuration2.BIGGER_LUNGS_JUMP_STAMINA_COST_DECREASE.Value - (float)level * configuration2.BIGGER_LUNGS_JUMP_STAMINA_COST_INCREMENTAL_DECREASE.Value);
			}
			static float infoFunction(int level)
			{
				LategameConfiguration configuration4 = BaseUpgrade.GetConfiguration();
				return configuration4.SPRINT_TIME_INCREASE_UNLOCK.Value + (float)level * configuration4.SPRINT_TIME_INCREMENT.Value;
			}
			static float staminaRegenerationInfo(int level)
			{
				LategameConfiguration configuration3 = BaseUpgrade.GetConfiguration();
				return configuration3.BIGGER_LUNGS_STAMINA_REGEN_INCREASE.Value + (float)level * configuration3.BIGGER_LUNGS_STAMINA_REGEN_INCREMENTAL_INCREASE.Value - 1f;
			}
		}

		public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null)
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append(GetBiggerlungsInfo(1, initialPrice));
			for (int i = 0; i < maxLevels; i++)
			{
				stringBuilder.Append(GetBiggerlungsInfo(i + 2, incrementalPrices[i]));
			}
			return stringBuilder.ToString();
		}

		public new static (string, string[]) RegisterScrapToUpgrade()
		{
			return ("Bigger Lungs", BaseUpgrade.GetConfiguration().BIGGER_LUNGS_ITEM_PROGRESSION_ITEMS.Value.Split(","));
		}

		public new static void RegisterUpgrade()
		{
			BaseUpgrade.SetupGenericPerk<BiggerLungs>("Bigger Lungs");
		}

		public new static CustomTerminalNode RegisterTerminalNode()
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Bigger Lungs", configuration.SHARED_UPGRADES.Value || !configuration.BIGGER_LUNGS_INDIVIDUAL.Value, configuration.BIGGER_LUNGS_ENABLED.Value, configuration.BIGGER_LUNGS_PRICE.Value, UpgradeBus.ParseUpgradePrices(configuration.BIGGER_LUNGS_UPGRADE_PRICES.Value), SyncedEntry<bool>.op_Implicit(configuration.OVERRIDE_UPGRADE_NAMES) ? SyncedEntry<string>.op_Implicit(configuration.BIGGER_LUNGS_OVERRIDE_NAME) : "");
		}

		protected override void __initializeVariables()
		{
			base.__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "BiggerLungs";
		}
	}
	internal class ClimbingGloves : TierUpgrade
	{
		internal const string UPGRADE_NAME = "Climbing Gloves";

		internal const string DEFAULT_PRICES = "200,250,300";

		public override bool CanInitializeOnStart
		{
			get
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				string[] array = configuration.CLIMBING_GLOVES_PRICES.Value.Split(',');
				return configuration.CLIMBING_GLOVES_PRICE.Value <= 0 && array.Length == 1 && (array[0].Length == 0 || array[0] == "0");
			}
		}

		private void Awake()
		{
			upgradeName = "Climbing Gloves";
			overridenUpgradeName = SyncedEntry<string>.op_Implicit(UpgradeBus.Instance.PluginConfiguration.CLIMBING_GLOVES_OVERRIDE_NAME);
		}

		public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null)
		{
			return Tools.GenerateInfoForUpgrade("LVL {0} - ${1} - 사다리를 오르는 속도가 {2} 증가합니다.\n", initialPrice, incrementalPrices, infoFunction);
			static float infoFunction(int level)
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				return configuration.INITIAL_CLIMBING_SPEED_BOOST.Value + (float)level * configuration.INCREMENTAL_CLIMBING_SPEED_BOOST.Value;
			}
		}

		public static float GetAdditionalClimbingSpeed(float defaultValue)
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			if (!SyncedEntry<bool>.op_Implicit(configuration.CLIMBING_GLOVES_ENABLED))
			{
				return defaultValue;
			}
			if (!BaseUpgrade.GetActiveUpgrade("Climbing Gloves"))
			{
				return defaultValue;
			}
			float num = SyncedEntry<float>.op_Implicit(configuration.INITIAL_CLIMBING_SPEED_BOOST) + (float)BaseUpgrade.GetUpgradeLevel("Climbing Gloves") * SyncedEntry<float>.op_Implicit(configuration.INCREMENTAL_CLIMBING_SPEED_BOOST);
			return Mathf.Clamp(defaultValue + num, defaultValue, float.MaxValue);
		}

		public new static (string, string[]) RegisterScrapToUpgrade()
		{
			return ("Climbing Gloves", BaseUpgrade.GetConfiguration().CLIMBING_GLOVES_ITEM_PROGRESSION_ITEMS.Value.Split(","));
		}

		public new static void RegisterUpgrade()
		{
			BaseUpgrade.SetupGenericPerk<ClimbingGloves>("Climbing Gloves");
		}

		public new static CustomTerminalNode RegisterTerminalNode()
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Climbing Gloves", configuration.SHARED_UPGRADES.Value || !configuration.CLIMBING_GLOVES_INDIVIDUAL.Value, configuration.CLIMBING_GLOVES_ENABLED.Value, configuration.CLIMBING_GLOVES_PRICE.Value, UpgradeBus.ParseUpgradePrices(configuration.CLIMBING_GLOVES_PRICES.Value), SyncedEntry<bool>.op_Implicit(configuration.OVERRIDE_UPGRADE_NAMES) ? SyncedEntry<string>.op_Implicit(configuration.CLIMBING_GLOVES_OVERRIDE_NAME) : "");
		}

		protected override void __initializeVariables()
		{
			base.__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "ClimbingGloves";
		}
	}
	internal class ProteinPowder : TierUpgrade, IUpgradeWorldBuilding
	{
		public const string UPGRADE_NAME = "Protein Powder";

		internal const string WORLD_BUILDING_TEXT = "\n\nMultivitamins, creatine, and military surplus stimulants blended together and repackaged, then offered on subscription. Known to be habit-forming. The label includes a Company Surgeon General's warning about increased aggression.\n\n";

		private const int CRIT_DAMAGE_VALUE = 100;

		public const string ENABLED_SECTION = "Enable Protein Powder Upgrade";

		public const bool ENABLED_DEFAULT = true;

		public const string ENABLED_DESCRIPTION = "Do more damage with shovels";

		public const string PRICE_SECTION = "Price of Protein Powder Upgrade";

		public const int PRICE_DEFAULT = 1000;

		public const string UNLOCK_FORCE_SECTION = "Initial additional hit force";

		public const int UNLOCK_FORCE_DEFAULT = 1;

		public const string UNLOCK_FORCE_DESCRIPTION = "The value added to hit force on initial unlock.";

		public const string INCREMENT_FORCE_SECTION = "Additional hit force per level";

		public const int INCREMENT_FORCE_DEFAULT = 1;

		public const string INCREMENT_FORCE_DESCRIPTION = "Every time Protein Powder is upgraded this value will be added to the value above.";

		public const string PRICES_DEFAULT = "700";

		public const string CRIT_CHANCE_SECTION = "Chance of dealing a crit which will instakill the enemy.";

		public const float CRIT_CHANCE_DEFAULT = 0.01f;

		public const string CRIT_CHANCE_DESCRIPTION = "This value is only valid when maxed out Protein Powder. Any previous levels will not apply crit.";

		public override bool CanInitializeOnStart
		{
			get
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				string[] array = configuration.PROTEIN_UPGRADE_PRICES.Value.Split(',');
				return configuration.PROTEIN_PRICE.Value <= 0 && array.Length == 1 && (array[0].Length == 0 || array[0] == "0");
			}
		}

		internal override void Start()
		{
			upgradeName = "Protein Powder";
			overridenUpgradeName = SyncedEntry<string>.op_Implicit(BaseUpgrade.GetConfiguration().PROTEIN_POWDER_OVERRIDE_NAME);
			base.Start();
		}

		public static int GetShovelHitForce(int force)
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			if (!configuration.PROTEIN_ENABLED.Value)
			{
				return force;
			}
			if (!BaseUpgrade.GetActiveUpgrade("Protein Powder"))
			{
				return force;
			}
			int num = (TryToCritEnemy() ? 100 : (configuration.PROTEIN_UNLOCK_FORCE.Value + configuration.PROTEIN_INCREMENT.Value * BaseUpgrade.GetUpgradeLevel("Protein Powder")));
			return force + num;
		}

		private static bool TryToCritEnemy()
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			string[] array = configuration.PROTEIN_UPGRADE_PRICES.Value.Split(',');
			int num = array.Length;
			int upgradeLevel = BaseUpgrade.GetUpgradeLevel("Protein Powder");
			if (upgradeLevel != num && (array.Length != 1 || (array[0].Length != 0 && !(array[0] == "0"))))
			{
				return false;
			}
			return Random.value < configuration.PROTEIN_CRIT_CHANCE.Value;
		}

		public string GetWorldBuildingText(bool shareStatus = false)
		{
			return "\n\n멀티비타민, 크레아틴,안쓰는 군용 자극제를 혼합하여 재포장한 후 구독 서비스로 제공됩니다. 중독성이 있는 것으로 알려져 있습니다. 라벨에는 공격성 증가에 대한 회사 외과 의사의 경고가 포함되어 있습니다.\n\n";
		}

		public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null)
		{
			string infoFromJSON = AssetBundleHandler.GetInfoFromJSON("Protein Powder");
			return Tools.GenerateInfoForUpgrade(infoFromJSON, initialPrice, incrementalPrices, infoFunction);
			static float infoFunction(int level)
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				return configuration.PROTEIN_UNLOCK_FORCE.Value + configuration.PROTEIN_INCREMENT.Value * level;
			}
		}

		public new static (string, string[]) RegisterScrapToUpgrade()
		{
			return ("Protein Powder", BaseUpgrade.GetConfiguration().PROTEIN_POWDER_ITEM_PROGRESSION_ITEMS.Value.Split(","));
		}

		public new static void RegisterUpgrade()
		{
			BaseUpgrade.SetupGenericPerk<ProteinPowder>("Protein Powder");
		}

		public new static CustomTerminalNode RegisterTerminalNode()
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Protein Powder", configuration.SHARED_UPGRADES.Value || !configuration.PROTEIN_INDIVIDUAL.Value, configuration.PROTEIN_ENABLED.Value, configuration.PROTEIN_PRICE.Value, UpgradeBus.ParseUpgradePrices(configuration.PROTEIN_UPGRADE_PRICES.Value), SyncedEntry<bool>.op_Implicit(configuration.OVERRIDE_UPGRADE_NAMES) ? SyncedEntry<string>.op_Implicit(configuration.PROTEIN_POWDER_OVERRIDE_NAME) : "");
		}

		protected override void __initializeVariables()
		{
			base.__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "ProteinPowder";
		}
	}
	internal class EfficientEngines : TierUpgrade
	{
		internal const string UPGRADE_NAME = "Efficient Engines";

		internal const string DEFAULT_PRICES = "600, 750, 900";

		public override bool CanInitializeOnStart
		{
			get
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				string[] array = configuration.EFFICIENT_ENGINES_PRICES.Value.Split(',');
				return configuration.EFFICIENT_ENGINES_PRICE.Value <= 0 && array.Length == 1 && (array[0].Length == 0 || array[0] == "0");
			}
		}

		private void Awake()
		{
			upgradeName = "Efficient Engines";
			overridenUpgradeName = SyncedEntry<string>.op_Implicit(BaseUpgrade.GetConfiguration().EFFICIENT_ENGINES_OVERRIDE_NAME);
		}

		public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null)
		{
			return Tools.GenerateInfoForUpgrade("LVL {0} - ${1} - 위성 경로 설정이 {2}% 더 저렴해집니다.\n", initialPrice, incrementalPrices, infoFunction);
			static float infoFunction(int level)
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				return configuration.EFFICIENT_ENGINES_INITIAL_DISCOUNT.Value + level * configuration.EFFICIENT_ENGINES_INCREMENTAL_DISCOUNT.Value;
			}
		}

		public static int GetDiscountedMoonPrice(int defaultPrice)
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			if (!configuration.EFFICIENT_ENGINES_ENABLED.Value)
			{
				return defaultPrice;
			}
			if (!BaseUpgrade.GetActiveUpgrade("Efficient Engines"))
			{
				return defaultPrice;
			}
			if (defaultPrice == 0)
			{
				return defaultPrice;
			}
			float num = (float)defaultPrice * (1f - (float)(configuration.EFFICIENT_ENGINES_INITIAL_DISCOUNT.Value + BaseUpgrade.GetUpgradeLevel("Efficient Engines") * configuration.EFFICIENT_ENGINES_INCREMENTAL_DISCOUNT.Value) / 100f);
			return Mathf.CeilToInt(Mathf.Clamp(num, 0f, (float)defaultPrice));
		}

		public new static (string, string[]) RegisterScrapToUpgrade()
		{
			return ("Efficient Engines", BaseUpgrade.GetConfiguration().EFFICIENT_ENGINES_ITEM_PROGRESSION_ITEMS.Value.Split(","));
		}

		public new static void RegisterUpgrade()
		{
			BaseUpgrade.SetupGenericPerk<EfficientEngines>("Efficient Engines");
		}

		public new static CustomTerminalNode RegisterTerminalNode()
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Efficient Engines", shareStatus: true, configuration.EFFICIENT_ENGINES_ENABLED.Value, configuration.EFFICIENT_ENGINES_PRICE.Value, UpgradeBus.ParseUpgradePrices(configuration.EFFICIENT_ENGINES_PRICES.Value), SyncedEntry<bool>.op_Implicit(configuration.OVERRIDE_UPGRADE_NAMES) ? SyncedEntry<string>.op_Implicit(configuration.EFFICIENT_ENGINES_OVERRIDE_NAME) : "");
		}

		protected override void __initializeVariables()
		{
			base.__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "EfficientEngines";
		}
	}
	internal class LandingThrusters : TierUpgrade
	{
		internal const string UPGRADE_NAME = "Landing Thrusters";

		internal const string DEFAULT_PRICES = "250,450,650";

		public override bool CanInitializeOnStart
		{
			get
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				string[] array = configuration.LANDING_THRUSTERS_PRICES.Value.Split(',');
				return configuration.LANDING_THRUSTERS_PRICE.Value <= 0 && array.Length == 1 && (array[0].Length == 0 || array[0] == "0");
			}
		}

		private void Awake()
		{
			upgradeName = "Landing Thrusters";
			overridenUpgradeName = SyncedEntry<string>.op_Implicit(BaseUpgrade.GetConfiguration().LANDING_THRUSTERS_OVERRIDE_NAME);
		}

		public static float GetInteractMutliplier()
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			if (!SyncedEntry<bool>.op_Implicit(configuration.LANDING_THRUSTERS_ENABLED))
			{
				return 1f;
			}
			if (!SyncedEntry<bool>.op_Implicit(configuration.LANDING_THRUSTERS_AFFECT_LANDING))
			{
				return 1f;
			}
			if (!BaseUpgrade.GetActiveUpgrade("Landing Thrusters"))
			{
				return 1f;
			}
			return 1f + Mathf.Max(0f, (float)(SyncedEntry<int>.op_Implicit(configuration.LANDING_THRUSTERS_INITIAL_SPEED_INCREASE) + BaseUpgrade.GetUpgradeLevel("Landing Thrusters") * SyncedEntry<int>.op_Implicit(configuration.LANDING_THRUSTERS_INCREMENTAL_SPEED_INCREASE)) / 100f);
		}

		public static float GetLandingSpeedMultiplier()
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			if (!SyncedEntry<bool>.op_Implicit(configuration.LANDING_THRUSTERS_ENABLED))
			{
				return 1f;
			}
			if (!BaseUpgrade.GetActiveUpgrade("Landing Thrusters"))
			{
				return 1f;
			}
			return 1f + Mathf.Max(0f, (float)(SyncedEntry<int>.op_Implicit(configuration.LANDING_THRUSTERS_INITIAL_SPEED_INCREASE) + BaseUpgrade.GetUpgradeLevel("Landing Thrusters") * SyncedEntry<int>.op_Implicit(configuration.LANDING_THRUSTERS_INCREMENTAL_SPEED_INCREASE)) / 100f);
		}

		public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null)
		{
			return Tools.GenerateInfoForUpgrade("LVL {0} - ${1} - 함선의 착륙 속도가 {2}% 증가합니다.\n", initialPrice, incrementalPrices, infoFunction);
			static float infoFunction(int level)
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				return configuration.LANDING_THRUSTERS_INITIAL_SPEED_INCREASE.Value + level * configuration.LANDING_THRUSTERS_INCREMENTAL_SPEED_INCREASE.Value;
			}
		}

		public new static (string, string[]) RegisterScrapToUpgrade()
		{
			return ("Landing Thrusters", BaseUpgrade.GetConfiguration().LANDING_THRUSTERS_ITEM_PROGRESSION_ITEMS.Value.Split(","));
		}

		public new static void RegisterUpgrade()
		{
			BaseUpgrade.SetupGenericPerk<LandingThrusters>("Landing Thrusters");
		}

		public new static CustomTerminalNode RegisterTerminalNode()
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Landing Thrusters", shareStatus: true, SyncedEntry<bool>.op_Implicit(configuration.LANDING_THRUSTERS_ENABLED), SyncedEntry<int>.op_Implicit(configuration.LANDING_THRUSTERS_PRICE), UpgradeBus.ParseUpgradePrices(SyncedEntry<string>.op_Implicit(configuration.LANDING_THRUSTERS_PRICES)), SyncedEntry<bool>.op_Implicit(configuration.OVERRIDE_UPGRADE_NAMES) ? SyncedEntry<string>.op_Implicit(configuration.LANDING_THRUSTERS_OVERRIDE_NAME) : "");
		}

		protected override void __initializeVariables()
		{
			base.__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "LandingThrusters";
		}
	}
	internal class ShutterBatteries : TierUpgrade
	{
		public const string UPGRADE_NAME = "Shutter Batteries";

		public const string PRICES_DEFAULT = "200,300,400";

		public const string ENABLED_SECTION = "Enable Shutter Batteries";

		public const string ENABLED_DESCRIPTION = "Increases the amount of time the doors can remain shut";

		public const string PRICE_SECTION = "Price of Shutter Batteries";

		public const int PRICE_DEFAULT = 300;

		public const string INITIAL_SECTION = "Initial battery boost";

		public const float INITIAL_DEFAULT = 5f;

		public const string INITIAL_DESCRIPTION = "Initial battery boost for the doors' lock on first purchase";

		public const string INCREMENTAL_SECTION = "Incremental battery boost";

		public const float INCREMENTAL_DEFAULT = 5f;

		public const string INCREMENTAL_DESCRIPTION = "Incremental battery boost for the doors' lock after purchase";

		public override bool CanInitializeOnStart
		{
			get
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				string[] array = configuration.DOOR_HYDRAULICS_BATTERY_PRICES.Value.Split(',');
				return configuration.DOOR_HYDRAULICS_BATTERY_PRICE.Value <= 0 && array.Length == 1 && (array[0].Length == 0 || array[0] == "0");
			}
		}

		private void Awake()
		{
			upgradeName = "Shutter Batteries";
			overridenUpgradeName = SyncedEntry<string>.op_Implicit(BaseUpgrade.GetConfiguration().SHUTTER_BATTERIES_OVERRIDE_NAME);
		}

		public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null)
		{
			return Tools.GenerateInfoForUpgrade("LVL {0} - ${1} - 문의 유압 용량이 {2} 증가하여 닫힌 상태를 오래 유지합니다.\n", initialPrice, incrementalPrices, infoFunction);
			static float infoFunction(int level)
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				return configuration.DOOR_HYDRAULICS_BATTERY_INITIAL.Value + (float)level * configuration.DOOR_HYDRAULICS_BATTERY_INCREMENTAL.Value;
			}
		}

		public static float GetAdditionalDoorTime(float defaultValue)
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			if (!SyncedEntry<bool>.op_Implicit(configuration.DOOR_HYDRAULICS_BATTERY_ENABLED))
			{
				return defaultValue;
			}
			if (!BaseUpgrade.GetActiveUpgrade("Shutter Batteries"))
			{
				return defaultValue;
			}
			float num = SyncedEntry<float>.op_Implicit(configuration.DOOR_HYDRAULICS_BATTERY_INITIAL) + (float)BaseUpgrade.GetUpgradeLevel("Shutter Batteries") * SyncedEntry<float>.op_Implicit(configuration.DOOR_HYDRAULICS_BATTERY_INCREMENTAL);
			return Mathf.Clamp(defaultValue + num, defaultValue, float.MaxValue);
		}

		public new static (string, string[]) RegisterScrapToUpgrade()
		{
			return ("Shutter Batteries", BaseUpgrade.GetConfiguration().SHUTTER_BATTERIES_ITEM_PROGRESSION_ITEMS.Value.Split(","));
		}

		public new static void RegisterUpgrade()
		{
			BaseUpgrade.SetupGenericPerk<ShutterBatteries>("Shutter Batteries");
		}

		public new static CustomTerminalNode RegisterTerminalNode()
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Shutter Batteries", shareStatus: true, configuration.DOOR_HYDRAULICS_BATTERY_ENABLED.Value, configuration.DOOR_HYDRAULICS_BATTERY_PRICE.Value, UpgradeBus.ParseUpgradePrices(configuration.DOOR_HYDRAULICS_BATTERY_PRICES.Value), SyncedEntry<bool>.op_Implicit(configuration.OVERRIDE_UPGRADE_NAMES) ? SyncedEntry<string>.op_Implicit(configuration.SHUTTER_BATTERIES_OVERRIDE_NAME) : "");
		}

		protected override void __initializeVariables()
		{
			base.__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "ShutterBatteries";
		}
	}
}
namespace MoreShipUpgrades.UpgradeComponents.TierUpgrades.Store
{
	internal class BargainConnections : TierUpgrade
	{
		internal const string UPGRADE_NAME = "Bargain Connections";

		internal const string PRICES_DEFAULT = "225,300,375";

		public override bool CanInitializeOnStart
		{
			get
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				string[] array = configuration.BARGAIN_CONNECTIONS_PRICES.Value.Split(',');
				return configuration.BARGAIN_CONNECTIONS_PRICE.Value <= 0 && array.Length == 1 && (array[0].Length == 0 || array[0] == "0");
			}
		}

		internal override void Start()
		{
			upgradeName = "Bargain Connections";
			overridenUpgradeName = SyncedEntry<string>.op_Implicit(BaseUpgrade.GetConfiguration().BARGAIN_CONNECTIONS_OVERRIDE_NAME);
			base.Start();
		}

		public static int GetBargainConnectionsAdditionalItems(int defaultAmountItems)
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			if (!BaseUpgrade.GetActiveUpgrade("Bargain Connections"))
			{
				return defaultAmountItems;
			}
			return defaultAmountItems + configuration.BARGAIN_CONNECTIONS_INITIAL_ITEM_AMOUNT.Value + BaseUpgrade.GetUpgradeLevel("Bargain Connections") * configuration.BARGAIN_CONNECTIONS_INCREMENTAL_ITEM_AMOUNT.Value;
		}

		public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null)
		{
			return Tools.GenerateInfoForUpgrade("LVL {0} - ${1} - 판매 가능한 아이템 수가 {2}개 증가합니다\n", initialPrice, incrementalPrices, infoFunction);
			static float infoFunction(int level)
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				return configuration.BARGAIN_CONNECTIONS_INITIAL_ITEM_AMOUNT.Value + level * configuration.BARGAIN_CONNECTIONS_INCREMENTAL_ITEM_AMOUNT.Value;
			}
		}

		public new static (string, string[]) RegisterScrapToUpgrade()
		{
			return ("Bargain Connections", BaseUpgrade.GetConfiguration().BARGAIN_CONNECTIONS_ITEM_PROGRESSION_ITEMS.Value.Split(","));
		}

		public new static void RegisterUpgrade()
		{
			BaseUpgrade.SetupGenericPerk<BargainConnections>("Bargain Connections");
		}

		public new static CustomTerminalNode RegisterTerminalNode()
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Bargain Connections", shareStatus: true, configuration.BARGAIN_CONNECTIONS_ENABLED.Value, configuration.BARGAIN_CONNECTIONS_PRICE.Value, UpgradeBus.ParseUpgradePrices(configuration.BARGAIN_CONNECTIONS_PRICES.Value), SyncedEntry<bool>.op_Implicit(configuration.OVERRIDE_UPGRADE_NAMES) ? SyncedEntry<string>.op_Implicit(configuration.BARGAIN_CONNECTIONS_OVERRIDE_NAME) : "");
		}

		protected override void __initializeVariables()
		{
			base.__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "BargainConnections";
		}
	}
	internal class MarketInfluence : TierUpgrade
	{
		internal const string UPGRADE_NAME = "Market Influence";

		internal const string PRICES_DEFAULT = "200,350,500";

		public override bool CanInitializeOnStart
		{
			get
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				string[] array = configuration.MARKET_INFLUENCE_PRICES.Value.Split(',');
				return configuration.MARKET_INFLUENCE_PRICE.Value <= 0 && array.Length == 1 && (array[0].Length == 0 || array[0] == "0");
			}
		}

		internal override void Start()
		{
			upgradeName = "Market Influence";
			overridenUpgradeName = SyncedEntry<string>.op_Implicit(BaseUpgrade.GetConfiguration().MARKET_INFLUENCE_OVERRIDE_NAME);
			base.Start();
		}

		public static int GetGuaranteedPercentageSale(int defaultPercentage, int maxValue)
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			if (!SyncedEntry<bool>.op_Implicit(configuration.MARKET_INFLUENCE_ENABLED))
			{
				return defaultPercentage;
			}
			if (!BaseUpgrade.GetActiveUpgrade("Market Influence"))
			{
				return defaultPercentage;
			}
			return Mathf.Clamp(defaultPercentage + configuration.MARKET_INFLUENCE_INITIAL_PERCENTAGE.Value + BaseUpgrade.GetUpgradeLevel("Market Influence") * configuration.MARKET_INFLUENCE_INCREMENTAL_PERCENTAGE.Value, 0, maxValue);
		}

		public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null)
		{
			return Tools.GenerateInfoForUpgrade("LVL {0} - ${1} - 아이템 판매 시 최소 {2}%의 가치를 보장합니다.\n", initialPrice, incrementalPrices, infoFunction);
			static float infoFunction(int level)
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				return configuration.MARKET_INFLUENCE_INITIAL_PERCENTAGE.Value + level * configuration.MARKET_INFLUENCE_INCREMENTAL_PERCENTAGE.Value;
			}
		}

		public new static (string, string[]) RegisterScrapToUpgrade()
		{
			return ("Market Influence", BaseUpgrade.GetConfiguration().MARKET_INFLUENCE_ITEM_PROGRESSION_ITEMS.Value.Split(","));
		}

		public new static void RegisterUpgrade()
		{
			BaseUpgrade.SetupGenericPerk<MarketInfluence>("Market Influence");
		}

		public new static CustomTerminalNode RegisterTerminalNode()
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Market Influence", shareStatus: true, configuration.MARKET_INFLUENCE_ENABLED.Value, configuration.MARKET_INFLUENCE_PRICE.Value, UpgradeBus.ParseUpgradePrices(configuration.MARKET_INFLUENCE_PRICES.Value), SyncedEntry<bool>.op_Implicit(configuration.OVERRIDE_UPGRADE_NAMES) ? SyncedEntry<string>.op_Implicit(configuration.MARKET_INFLUENCE_OVERRIDE_NAME) : "");
		}

		protected override void __initializeVariables()
		{
			base.__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "MarketInfluence";
		}
	}
}
namespace MoreShipUpgrades.UpgradeComponents.TierUpgrades.Ship
{
	internal class Discombobulator : TierUpgrade, IUpgradeWorldBuilding
	{
		internal float flashCooldown = 0f;

		public static Discombobulator instance;

		public const string UPGRADE_NAME = "Discombobulator";

		public const string PRICES_DEFAULT = "330,460,620";

		internal const string WORLD_BUILDING_TEXT = "\n\nService key for the Ship's terminal which allows {0} to legally use the Ship's 'Discombobulator' module. Comes with a list of opt-in maintenance procedures that promise to optimze the discharge and refractory of the system. Said document contains no mention of whatever it might be that it was included in the Ship's design to discombobulate.\n\n";

		public override bool CanInitializeOnStart
		{
			get
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				string[] array = configuration.DISCO_UPGRADE_PRICES.Value.Split(',');
				return configuration.DISCOMBOBULATOR_PRICE.Value <= 0 && array.Length == 1 && (array[0].Length == 0 || array[0] == "0");
			}
		}

		private void Awake()
		{
			upgradeName = "Discombobulator";
			overridenUpgradeName = SyncedEntry<string>.op_Implicit(BaseUpgrade.GetConfiguration().DISCOMBOBULATOR_OVERRIDE_NAME);
			instance = this;
		}

		private void Update()
		{
			if (flashCooldown > 0f)
			{
				flashCooldown -= Time.deltaTime;
			}
		}

		[ServerRpc(RequireOwnership = false)]
		public void UseDiscombobulatorServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3612237191u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3612237191u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					UseDiscombobulatorClientRpc();
				}
			}
		}

		[ClientRpc]
		private void UseDiscombobulatorClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(760292881u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 760292881u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					Terminal terminal = UpgradeBus.Instance.GetTerminal();
					PlayAudio(ref terminal);
					flashCooldown = BaseUpgrade.GetConfiguration().DISCOMBOBULATOR_COOLDOWN.Value;
					StunNearbyEnemies(ref terminal);
				}
			}
		}

		private void StunNearbyEnemies(ref Terminal terminal)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			Collider[] array = Physics.OverlapSphere(((Component)terminal).transform.position, configuration.DISCOMBOBULATOR_RADIUS.Value, 524288);
			if (array.Length == 0)
			{
				return;
			}
			for (int i = 0; i < array.Length; i++)
			{
				EnemyAICollisionDetect component = ((Component)array[i]).GetComponent<EnemyAICollisionDetect>();
				if (!((Object)(object)component == (Object)null))
				{
					EnemyAI mainScript = component.mainScript;
					if (CanDealDamage())
					{
						int num = configuration.DISCOMBOBULATOR_INITIAL_DAMAGE.Value + configuration.DISCOMBOBULATOR_DAMAGE_INCREASE.Value * (BaseUpgrade.GetUpgradeLevel("Discombobulator") - configuration.DISCOMBOBULATOR_DAMAGE_LEVEL.Value);
						mainScript.HitEnemy(num, (PlayerControllerB)null, false, -1);
					}
					if (!mainScript.isEnemyDead)
					{
						mainScript.SetEnemyStunned(true, configuration.DISCOMBOBULATOR_STUN_DURATION.Value + configuration.DISCOMBOBULATOR_INCREMENT.Value * (float)BaseUpgrade.GetUpgradeLevel("Discombobulator"), (PlayerControllerB)null);
					}
				}
			}
		}

		private void PlayAudio(ref Terminal terminal)
		{
			terminal.terminalAudio.maxDistance = 100f;
			terminal.terminalAudio.PlayOneShot(UpgradeBus.Instance.flashNoise);
			((MonoBehaviour)this).StartCoroutine(ResetRange(terminal));
		}

		private bool CanDealDamage()
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			return configuration.DISCOMBOBULATOR_DAMAGE_LEVEL.Value > 0 && BaseUpgrade.GetUpgradeLevel("Discombobulator") + 1 >= configuration.DISCOMBOBULATOR_DAMAGE_LEVEL.Value;
		}

		private IEnumerator ResetRange(Terminal terminal)
		{
			yield return (object)new WaitForSeconds(2f);
			terminal.terminalAudio.maxDistance = 17f;
		}

		public string GetWorldBuildingText(bool shareStatus = false)
		{
			return string.Format("\n\n{0}가 합법적으로 함선의 '혼란 유발기' 모듈을 사용할 수 있게 해주는 함선 터미널용 서비스 키입니다. 시스템의 방전과 재충전 최적화를 약속하는 선택적 유지 보수 절차 목록이 함께 제공됩니다. 해당 문서에는 함선 설계에 혼란 유발기가 포함된 이유나 그것이 무엇을 혼란시키는지에 대한 언급이 전혀 없습니다.\n\n", shareStatus ? "당신의 크루" : "당신");
		}

		public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null)
		{
			string infoFromJSON = AssetBundleHandler.GetInfoFromJSON("Discombobulator");
			return Tools.GenerateInfoForUpgrade(infoFromJSON, initialPrice, incrementalPrices, infoFunction);
			static float infoFunction(int level)
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				return configuration.DISCOMBOBULATOR_STUN_DURATION.Value + (float)level * configuration.DISCOMBOBULATOR_INCREMENT.Value;
			}
		}

		public new static (string, string[]) RegisterScrapToUpgrade()
		{
			return ("Discombobulator", BaseUpgrade.GetConfiguration().DISCOMBOBULATOR_ITEM_PROGRESSION_ITEMS.Value.Split(","));
		}

		public new static void RegisterUpgrade()
		{
			UpgradeBus.Instance.flashNoise = AssetBundleHandler.GetAudioClip("Flashbang");
			BaseUpgrade.SetupGenericPerk<Discombobulator>("Discombobulator");
		}

		public new static CustomTerminalNode RegisterTerminalNode()
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			AudioClip audioClip = AssetBundleHandler.GetAudioClip("Flashbang");
			if (!Object.op_Implicit((Object)(object)audioClip))
			{
				return null;
			}
			UpgradeBus.Instance.flashNoise = audioClip;
			return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Discombobulator", configuration.SHARED_UPGRADES.Value || !configuration.DISCOMBOBULATOR_INDIVIDUAL.Value, configuration.DISCOMBOBULATOR_ENABLED.Value, configuration.DISCOMBOBULATOR_PRICE.Value, UpgradeBus.ParseUpgradePrices(configuration.DISCO_UPGRADE_PRICES.Value), SyncedEntry<bool>.op_Implicit(configuration.OVERRIDE_UPGRADE_NAMES) ? SyncedEntry<string>.op_Implicit(configuration.DISCOMBOBULATOR_OVERRIDE_NAME) : "");
		}

		protected override void __initializeVariables()
		{
			base.__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_Discombobulator()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(3612237191u, new RpcReceiveHandler(__rpc_handler_3612237191));
			NetworkManager.__rpc_func_table.Add(760292881u, new RpcReceiveHandler(__rpc_handler_760292881));
		}

		private static void __rpc_handler_3612237191(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((Discombobulator)(object)target).UseDiscombobulatorServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_760292881(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((Discombobulator)(object)target).UseDiscombobulatorClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "Discombobulator";
		}
	}
	public class LifeInsurance : TierUpgrade
	{
		internal const string UPGRADE_NAME = "Life Insurance";

		internal const string DEFAULT_PRICES = "200,250,300";

		public override bool CanInitializeOnStart
		{
			get
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				string[] array = configuration.LIFE_INSURANCE_PRICES.Value.Split(',');
				return configuration.LIFE_INSURANCE_PRICE.Value <= 0 && array.Length == 1 && (array[0].Length == 0 || array[0] == "0");
			}
		}

		private void Awake()
		{
			upgradeName = "Life Insurance";
			overridenUpgradeName = SyncedEntry<string>.op_Implicit(BaseUpgrade.GetConfiguration().LIFE_INSURANCE_OVERRIDE_NAME);
		}

		public static float CalculateDecreaseMultiplier()
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			if (!SyncedEntry<bool>.op_Implicit(configuration.LIFE_INSURANCE_ENABLED) || !BaseUpgrade.GetActiveUpgrade("Life Insurance"))
			{
				return 0f;
			}
			return (float)(SyncedEntry<int>.op_Implicit(configuration.LIFE_INSURANCE_INITIAL_COST_PERCENTAGE_DECREASE) + SyncedEntry<int>.op_Implicit(configuration.LIFE_INSURANCE_INCREMENTAL_COST_PERCENTAGE_DECREASE) * BaseUpgrade.GetUpgradeLevel("Life Insurance")) / 100f;
		}

		public static float ReduceCreditCostPercentage(float defaultValue)
		{
			float num = CalculateDecreaseMultiplier();
			return Mathf.Clamp(1f - num, 0f, 1f) * defaultValue;
		}

		public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null)
		{
			return Tools.GenerateInfoForUpgrade("LVL {0} - ${1} - 위성을 떠날 때 남겨진 시체로 인한 크레딧 손실을 {2}% 줄입니다.\n", initialPrice, incrementalPrices, infoFunction);
			static float infoFunction(int level)
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				return configuration.LIFE_INSURANCE_INITIAL_COST_PERCENTAGE_DECREASE.Value + level * configuration.LIFE_INSURANCE_INCREMENTAL_COST_PERCENTAGE_DECREASE.Value;
			}
		}

		public new static (string, string[]) RegisterScrapToUpgrade()
		{
			return ("Life Insurance", BaseUpgrade.GetConfiguration().LIFE_INSURANCE_ITEM_PROGRESSION_ITEMS.Value.Split(","));
		}

		public new static void RegisterUpgrade()
		{
			GameObject val = NetworkPrefabs.CreateNetworkPrefab("Life Insurance");
			val.AddComponent<LifeInsurance>();
			NetworkPrefabs.RegisterNetworkPrefab(val);
			Plugin.networkPrefabs["Life Insurance"] = val;
		}

		public new static CustomTerminalNode RegisterTerminalNode()
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Life Insurance", shareStatus: true, SyncedEntry<bool>.op_Implicit(configuration.LIFE_INSURANCE_ENABLED), SyncedEntry<int>.op_Implicit(configuration.LIFE_INSURANCE_PRICE), UpgradeBus.ParseUpgradePrices(SyncedEntry<string>.op_Implicit(configuration.LIFE_INSURANCE_PRICES)), SyncedEntry<bool>.op_Implicit(configuration.OVERRIDE_UPGRADE_NAMES) ? SyncedEntry<string>.op_Implicit(configuration.LIFE_INSURANCE_OVERRIDE_NAME) : "", Plugin.networkPrefabs["Life Insurance"]);
		}

		protected override void __initializeVariables()
		{
			base.__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "LifeInsurance";
		}
	}
	public class QuantumDisruptor : TierUpgrade
	{
		public enum UpgradeModes
		{
			SlowdownTime,
			RevertTime
		}

		public enum ResetModes
		{
			MoonLanding,
			MoonRerouting,
			NewQuota
		}

		internal const string UPGRADE_NAME = "Quantum Disruptor";

		internal const string PRICES_DEFAULT = "1200,1500,1800";

		internal int availableUsages = -1;

		internal int currentUsages = 0;

		internal int hoursToReduce = -1;

		internal static QuantumDisruptor Instance { get; set; }

		internal static UpgradeModes CurrentMode => SyncedEntry<UpgradeModes>.op_Implicit(BaseUpgrade.GetConfiguration().QUANTUM_DISRUPTOR_UPGRADE_MODE);

		internal static ResetModes CurrentResetMode => BaseUpgrade.GetConfiguration().QUANTUM_DISRUPTOR_RESET_MODE.Value;

		public override bool CanInitializeOnStart
		{
			get
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				string[] array = configuration.QUANTUM_DISRUPTOR_PRICES.Value.Split(',');
				return configuration.QUANTUM_DISRUPTOR_PRICE.Value <= 0 && array.Length == 1 && (array[0].Length == 0 || array[0] == "0");
			}
		}

		private static void SetInstance(QuantumDisruptor instance)
		{
			Instance = instance;
		}

		private void Awake()
		{
			SetInstance(this);
			upgradeName = "Quantum Disruptor";
			overridenUpgradeName = SyncedEntry<string>.op_Implicit(BaseUpgrade.GetConfiguration().QUANTUM_DISRUPTOR_OVERRIDE_NAME);
		}

		public override void Unwind()
		{
			switch (CurrentMode)
			{
			case UpgradeModes.SlowdownTime:
				base.Unwind();
				break;
			case UpgradeModes.RevertTime:
				availableUsages = -1;
				hoursToReduce = -1;
				base.Unwind();
				break;
			}
		}

		public override void Increment()
		{
			switch (CurrentMode)
			{
			case UpgradeModes.SlowdownTime:
				base.Increment();
				break;
			case UpgradeModes.RevertTime:
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				availableUsages += SyncedEntry<int>.op_Implicit(configuration.QUANTUM_DISRUPTOR_INCREMENTAL_USES);
				hoursToReduce += SyncedEntry<int>.op_Implicit(configuration.QUANTUM_DISRUPTOR_INCREMENTAL_HOURS_REVERT_ON_USE);
				base.Increment();
				break;
			}
			}
		}

		public override void Load()
		{
			switch (CurrentMode)
			{
			case UpgradeModes.SlowdownTime:
				base.Load();
				break;
			case UpgradeModes.RevertTime:
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				availableUsages = configuration.QUANTUM_DISRUPTOR_INITIAL_USES.Value + BaseUpgrade.GetUpgradeLevel("Quantum Disruptor") * SyncedEntry<int>.op_Implicit(configuration.QUANTUM_DISRUPTOR_INCREMENTAL_USES);
				hoursToReduce = configuration.QUANTUM_DISRUPTOR_INITIAL_HOURS_REVERT_ON_USE.Value + BaseUpgrade.GetUpgradeLevel("Quantum Disruptor") * SyncedEntry<int>.op_Implicit(configuration.QUANTUM_DISRUPTOR_INCREMENTAL_HOURS_REVERT_ON_USE);
				base.Load();
				break;
			}
			}
		}

		public static float GetGlobalSpeedMultiplier(float defaultValue)
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			if (!SyncedEntry<bool>.op_Implicit(configuration.QUANTUM_DISRUPTOR_ENABLED))
			{
				return defaultValue;
			}
			if (!BaseUpgrade.GetActiveUpgrade("Quantum Disruptor"))
			{
				return defaultValue;
			}
			if (CurrentMode != 0)
			{
				return defaultValue;
			}
			float num = SyncedEntry<float>.op_Implicit(configuration.QUANTUM_DISRUPTOR_INITIAL_MULTIPLIER) + (float)BaseUpgrade.GetUpgradeLevel("Quantum Disruptor") * SyncedEntry<float>.op_Implicit(configuration.QUANTUM_DISRUPTOR_INCREMENTAL_MULTIPLIER);
			return Mathf.Clamp(defaultValue - num, 0.01f, defaultValue);
		}

		private string GetQuantumDisruptorRevertInfo(int level, int price)
		{
			string text = string.Empty;
			switch (CurrentResetMode)
			{
			case ResetModes.MoonLanding:
				text = "moon landing";
				break;
			case ResetModes.MoonRerouting:
				text = "moon routing";
				break;
			case ResetModes.NewQuota:
				text = "completed quota";
				break;
			}
			StringBuilder stringBuilder = new StringBuilder();
			if (level == 1)
			{
				stringBuilder.Append($"LVL {level} - ${price}: Unlocks 'quantum' command which reverts curret moon's time by {infoFunctionHours(level - 1)} hours and can only be used {infoFunctionUsages(level - 1)} times per {text}\n");
			}
			else
			{
				stringBuilder.Append($"LVL {level} - ${price}: Reverts curret moon's time by {infoFunctionHours(level - 1)} hours and can only be used {infoFunctionUsages(level - 1)} times per {text}\n");
			}
			return stringBuilder.ToString();
			static float infoFunctionHours(int level)
			{
				LategameConfiguration configuration2 = BaseUpgrade.GetConfiguration();
				return configuration2.QUANTUM_DISRUPTOR_INITIAL_HOURS_REVERT_ON_USE.Value + level * configuration2.QUANTUM_DISRUPTOR_INCREMENTAL_HOURS_REVERT_ON_USE.Value;
			}
			static float infoFunctionUsages(int level)
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				return configuration.QUANTUM_DISRUPTOR_INITIAL_USES.Value + level * configuration.QUANTUM_DISRUPTOR_INCREMENTAL_USES.Value;
			}
		}

		public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null)
		{
			switch (CurrentMode)
			{
			case UpgradeModes.SlowdownTime:
				return Tools.GenerateInfoForUpgrade("LVL {0} - ${1} - 착륙한 위성의 회전력을(흐르는 시간) {2}% 감소시킵니다.\n", initialPrice, incrementalPrices, infoFunction);
			case UpgradeModes.RevertTime:
			{
				StringBuilder stringBuilder = new StringBuilder();
				stringBuilder.Append(GetQuantumDisruptorRevertInfo(1, initialPrice));
				for (int i = 0; i < maxLevels; i++)
				{
					stringBuilder.Append(GetQuantumDisruptorRevertInfo(i + 2, incrementalPrices[i]));
				}
				return stringBuilder.ToString();
			}
			default:
				return string.Empty;
			}
			static float infoFunction(int level)
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				return (configuration.QUANTUM_DISRUPTOR_INITIAL_MULTIPLIER.Value + (float)level * configuration.QUANTUM_DISRUPTOR_INCREMENTAL_MULTIPLIER.Value) * 100f;
			}
		}

		internal (bool, string) CanRevertTime()
		{
			if (CurrentMode != UpgradeModes.RevertTime)
			{
				return (false, "This command is not available for selected '" + overridenUpgradeName + "' upgrade.\n");
			}
			if (StartOfRound.Instance.inShipPhase)
			{
				return (false, "Cannot execute this command while in orbit.\n");
			}
			if (!StartOfRound.Instance.shipHasLanded)
			{
				return (false, "Cannot execute this command while landing on a moon.\n");
			}
			if (!TimeOfDay.Instance.currentDayTimeStarted)
			{
				return (false, "Cannot execute this command during a time freeze.\n");
			}
			float globalTime = TimeOfDay.Instance.globalTime;
			globalTime -= TimeOfDay.Instance.lengthOfHours * (float)hoursToReduce;
			if (globalTime < 0f)
			{
				return (false, "This command cannot be executed due to the new time being before you started landing on the moon (Leads to negative time).\n");
			}
			string text = string.Empty;
			switch (CurrentResetMode)
			{
			case ResetModes.MoonLanding:
				text = "Come back to orbit";
				break;
			case ResetModes.MoonRerouting:
				text = "Route to a different moon";
				break;
			case ResetModes.NewQuota:
				text = "Finish your current quota";
				break;
			}
			return (currentUsages < availableUsages, "Reached maximum amount of usages during this moon trip. " + text + " to recharge the disruptor.\n");
		}

		internal void TryResetValues(ResetModes requestedMode)
		{
			if (CurrentMode == UpgradeModes.RevertTime && CurrentResetMode == requestedMode)
			{
				ResetUsageCounterClientRpc();
			}
		}

		internal static void TryResetQuantum(ResetModes mode)
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			if (SyncedEntry<bool>.op_Implicit(configuration.QUANTUM_DISRUPTOR_ENABLED) && ((NetworkBehaviour)Instance).IsHost)
			{
				Instance.TryResetValues(mode);
			}
		}

		[ClientRpc]
		internal void RevertTimeClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3272842575u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3272842575u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					RevertTime();
				}
			}
		}

		internal void RevertTime()
		{
			float num = TimeOfDay.Instance.lengthOfHours * (float)hoursToReduce;
			TimeOfDay instance = TimeOfDay.Instance;
			instance.globalTime -= num;
			Plugin.mls.LogDebug((object)$"Before reverting time on quota: {TimeOfDay.Instance.timeUntilDeadline}");
			TimeOfDay instance2 = TimeOfDay.Instance;
			instance2.timeUntilDeadline += num;
			Plugin.mls.LogDebug((object)$"After reverting time on quota: {TimeOfDay.Instance.timeUntilDeadline}");
			currentUsages++;
		}

		[ClientRpc]
		internal void ResetUsageCounterClientRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2403649136u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2403649136u, val, (RpcDelivery)0);
				}
				if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					ResetUsageCounter();
				}
			}
		}

		internal void ResetUsageCounter()
		{
			currentUsages = 0;
		}

		public new static (string, string[]) RegisterScrapToUpgrade()
		{
			return ("Quantum Disruptor", BaseUpgrade.GetConfiguration().QUANTUM_DISRUPTOR_ITEM_PROGRESSION_ITEMS.Value.Split(","));
		}

		public new static void RegisterUpgrade()
		{
			BaseUpgrade.SetupGenericPerk<QuantumDisruptor>("Quantum Disruptor");
		}

		public new static CustomTerminalNode RegisterTerminalNode()
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Quantum Disruptor", shareStatus: true, configuration.QUANTUM_DISRUPTOR_ENABLED.Value, configuration.QUANTUM_DISRUPTOR_PRICE.Value, UpgradeBus.ParseUpgradePrices(configuration.QUANTUM_DISRUPTOR_PRICES.Value), SyncedEntry<bool>.op_Implicit(configuration.OVERRIDE_UPGRADE_NAMES) ? SyncedEntry<string>.op_Implicit(configuration.QUANTUM_DISRUPTOR_OVERRIDE_NAME) : "");
		}

		protected override void __initializeVariables()
		{
			base.__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_QuantumDisruptor()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(3272842575u, new RpcReceiveHandler(__rpc_handler_3272842575));
			NetworkManager.__rpc_func_table.Add(2403649136u, new RpcReceiveHandler(__rpc_handler_2403649136));
		}

		private static void __rpc_handler_3272842575(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((QuantumDisruptor)(object)target).RevertTimeClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2403649136(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((QuantumDisruptor)(object)target).ResetUsageCounterClientRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "QuantumDisruptor";
		}
	}
	internal class ScavengerInstincts : TierUpgrade
	{
		internal const string UPGRADE_NAME = "Scavenger Instincts";

		internal const string DEFAULT_PRICES = "800,1000,1200,1400";

		public override bool CanInitializeOnStart
		{
			get
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				string[] array = configuration.SCAVENGER_INSTINCTS_PRICES.Value.Split(',');
				return configuration.SCAVENGER_INSTINCTS_PRICE.Value <= 0 && array.Length == 1 && (array[0].Length == 0 || array[0] == "0");
			}
		}

		private void Awake()
		{
			upgradeName = "Scavenger Instincts";
			overridenUpgradeName = SyncedEntry<string>.op_Implicit(BaseUpgrade.GetConfiguration().SCAVENGER_INSTINCTS_OVERRIDE_NAME);
		}

		public static int IncreaseScrapAmount(int defaultValue)
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			if (!BaseUpgrade.GetActiveUpgrade("Scavenger Instincts"))
			{
				return defaultValue;
			}
			int num = configuration.SCAVENGER_INSTINCTS_INITIAL_AMOUNT_SCRAP_INCREASE.Value + BaseUpgrade.GetUpgradeLevel("Scavenger Instincts") * configuration.SCAVENGER_INSTINCTS_INCREMENTAL_AMOUN_SCRAP_INCREASE.Value;
			return Mathf.Clamp(defaultValue + Mathf.CeilToInt((float)num / RoundManager.Instance.scrapAmountMultiplier), defaultValue, int.MaxValue);
		}

		public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null)
		{
			return Tools.GenerateInfoForUpgrade("LVL {0} - ${1} - 평균 폐품 생성량이 {2}개 증가합니다.\n", initialPrice, incrementalPrices, infoFunction);
			static float infoFunction(int level)
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				return configuration.SCAVENGER_INSTINCTS_INITIAL_AMOUNT_SCRAP_INCREASE.Value + level * configuration.SCAVENGER_INSTINCTS_INCREMENTAL_AMOUN_SCRAP_INCREASE.Value;
			}
		}

		public new static (string, string[]) RegisterScrapToUpgrade()
		{
			return ("Scavenger Instincts", BaseUpgrade.GetConfiguration().SCAVENGER_INSTINCTS_ITEM_PROGRESSION_ITEMS.Value.Split(","));
		}

		public new static void RegisterUpgrade()
		{
			BaseUpgrade.SetupGenericPerk<ScavengerInstincts>("Scavenger Instincts");
		}

		public new static CustomTerminalNode RegisterTerminalNode()
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Scavenger Instincts", shareStatus: true, SyncedEntry<bool>.op_Implicit(configuration.SCAVENGER_INSTINCTS_ENABLED), SyncedEntry<int>.op_Implicit(configuration.SCAVENGER_INSTINCTS_PRICE), UpgradeBus.ParseUpgradePrices(SyncedEntry<string>.op_Implicit(configuration.SCAVENGER_INSTINCTS_PRICES)), SyncedEntry<bool>.op_Implicit(configuration.OVERRIDE_UPGRADE_NAMES) ? SyncedEntry<string>.op_Implicit(configuration.SCAVENGER_INSTINCTS_OVERRIDE_NAME) : "");
		}

		protected override void __initializeVariables()
		{
			base.__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "ScavengerInstincts";
		}
	}
}
namespace MoreShipUpgrades.UpgradeComponents.TierUpgrades.Player
{
	internal class BetterScanner : TierUpgrade, IUpgradeWorldBuilding
	{
		public const string UPGRADE_NAME = "Better Scanner";

		internal const string WORLD_BUILDING_TEXT = "\n\nA serialized Company-Issue Magazine subscription, called 'Stuff Finders'. Uniquely, {0} must subscribe to each issue of 'Stuff Finders' individually. Each separate subscription promises and delivers a weekly issuance of a magazine with the exact same information in it as last time, organized in a different order and with slightly different printing qualities each time. There are only three 'unique' issues, and each issue only has one or two pieces of actual useful information in it. The rest of the magazine is just ads for The Company's other offerings. There is an extra fee for cancelling a subscription of 'Stuff Finders' before terminating your employment. The useful information always comes in the form of an unlabelled service key or Ship terminal hyperlink.\n\n";

		public override bool CanInitializeOnStart => BaseUpgrade.GetConfiguration().BETTER_SCANNER_PRICE.Value <= 0 && BaseUpgrade.GetConfiguration().BETTER_SCANNER_PRICE2.Value <= 0 && BaseUpgrade.GetConfiguration().BETTER_SCANNER_PRICE3.Value <= 0;

		internal override void Start()
		{
			upgradeName = "Better Scanner";
			overridenUpgradeName = SyncedEntry<string>.op_Implicit(BaseUpgrade.GetConfiguration().BETTER_SCANNER_OVERRIDE_NAME);
			base.Start();
		}

		public override void Load()
		{
			base.Load();
			if (GoodItemScanCompat.Enabled)
			{
				int upgradeLevel = BaseUpgrade.GetUpgradeLevel("Better Scanner");
				if (upgradeLevel > 0)
				{
					LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
					GoodItemScanCompat.IncreaseScanDistance((int)SyncedEntry<float>.op_Implicit(configuration.NODE_DISTANCE_INCREASE));
					GoodItemScanCompat.IncreaseEnemyScanDistance((int)SyncedEntry<float>.op_Implicit(configuration.NODE_DISTANCE_INCREASE));
				}
				if (upgradeLevel == 2)
				{
					GoodItemScanCompat.ToggleScanThroughWalls(scanThroughWalls: true);
				}
			}
		}

		public override void Increment()
		{
			base.Increment();
			if (GoodItemScanCompat.Enabled)
			{
				int upgradeLevel = BaseUpgrade.GetUpgradeLevel("Better Scanner");
				if (upgradeLevel == 2)
				{
					GoodItemScanCompat.ToggleScanThroughWalls(scanThroughWalls: true);
				}
			}
		}

		public static void AddScannerNodeToValve(ref SteamValveHazard steamValveHazard)
		{
			if (BaseUpgrade.GetActiveUpgrade("Better Scanner"))
			{
				LguScanNodeProperties.AddGeneralScanNode(((Component)steamValveHazard).gameObject, "Bursted Steam Valve", "Fix it to get rid of the steam", -1, 3);
			}
		}

		public static void RemoveScannerNodeFromValve(ref SteamValveHazard steamValveHazard)
		{
			LguScanNodeProperties.RemoveScanNode(((Component)steamValveHazard).gameObject);
		}

		public static string GetBetterScannerInfo(int level, int price)
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			switch (level)
			{
			case 1:
				return string.Format(AssetBundleHandler.GetInfoFromJSON("Better Scanner1"), level, price, configuration.NODE_DISTANCE_INCREASE.Value, configuration.SHIP_AND_ENTRANCE_DISTANCE_INCREASE.Value);
			case 2:
				return string.Format(AssetBundleHandler.GetInfoFromJSON("Better Scanner2"), level, price);
			case 3:
			{
				string text = string.Format(AssetBundleHandler.GetInfoFromJSON("Better Scanner3"), level, price, configuration.BETTER_SCANNER_ENEMIES.Value ? " 그리고 enemies" : "");
				return text + "hives과 scrap 명령어는 지도상에서 가장 가치 있는 벌집과 폐품의 위치를 표시합니다.\n";
			}
			default:
				return "";
			}
		}

		public string GetWorldBuildingText(bool shareStatus = false)
		{
			return string.Format("\n\n'스터프 파인더스'라는 회사 발행 잡지 구독권입니다. 특이하게도 {0}는 '스터프 파인더스'의 각 호를 개별적으로 구독해야 합니다. 각 구독은 매주 정확히 이전과 동일한 정보가 담긴 잡지를 약속하고 제공하지만, 매번 다른 순서로 구성되어 있고 인쇄 품질이 약간씩 다릅니다. '고유한' 호는 단 세 가지뿐이며, 각 호에는 실제로 유용한 정보가 한두 개 정도밖에 없습니다. 잡지의 나머지 부분은 회사의 다른 상품에 대한 광고로 채워져 있습니다. 퇴사 전에 '스터프 파인더스' 구독을 취소할 경우 추가 요금이 부과됩니다. 유용한 정보는 항상 라벨이 없는 서비스 키나 선박 터미널 하이퍼링크 형태로 제공됩니다.\n\n", shareStatus ? "각 부서" : "하나");
		}

		public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null)
		{
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append(GetBetterScannerInfo(1, initialPrice));
			for (int i = 0; i < maxLevels; i++)
			{
				stringBuilder.Append(GetBetterScannerInfo(i + 2, incrementalPrices[i]));
			}
			return stringBuilder.ToString();
		}

		public new static void RegisterUpgrade()
		{
			BaseUpgrade.SetupGenericPerk<BetterScanner>("Better Scanner");
		}

		public new static (string, string[]) RegisterScrapToUpgrade()
		{
			return ("Better Scanner", BaseUpgrade.GetConfiguration().BETTER_SCANNER_ITEM_PROGRESSION_ITEMS.Value.Split(","));
		}

		public new static CustomTerminalNode RegisterTerminalNode()
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Better Scanner", configuration.SHARED_UPGRADES.Value || !configuration.BETTER_SCANNER_INDIVIDUAL.Value, configuration.BETTER_SCANNER_ENABLED.Value, configuration.BETTER_SCANNER_PRICE.Value, new int[2]
			{
				configuration.BETTER_SCANNER_PRICE2.Value,
				configuration.BETTER_SCANNER_PRICE3.Value
			}, SyncedEntry<bool>.op_Implicit(configuration.OVERRIDE_UPGRADE_NAMES) ? SyncedEntry<string>.op_Implicit(configuration.BETTER_SCANNER_OVERRIDE_NAME) : "");
		}

		protected override void __initializeVariables()
		{
			base.__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "BetterScanner";
		}
	}
	internal class CarbonKneejoints : TierUpgrade
	{
		internal const string UPGRADE_NAME = "Carbon Kneejoints";

		internal const string DEFAULT_PRICES = "50,100,150";

		public override bool CanInitializeOnStart
		{
			get
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				string[] array = configuration.CARBON_KNEEJOINTS_PRICES.Value.Split(',');
				return configuration.CARBON_KNEEJOINTS_PRICE.Value <= 0 && array.Length == 1 && (array[0].Length == 0 || array[0] == "0");
			}
		}

		private void Awake()
		{
			upgradeName = "Carbon Kneejoints";
			overridenUpgradeName = SyncedEntry<string>.op_Implicit(BaseUpgrade.GetConfiguration().CARBON_KNEEJOINTS_OVERRIDE_NAME);
		}

		public static float CalculateDecreaseMultiplier()
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			if (!SyncedEntry<bool>.op_Implicit(configuration.CARBON_KNEEJOINTS_ENABLED) || !BaseUpgrade.GetActiveUpgrade("Carbon Kneejoints"))
			{
				return 0f;
			}
			return (float)(SyncedEntry<int>.op_Implicit(configuration.CARBON_KNEEJOINTS_INITIAL_CROUCH_DEBUFF_DECREASE) + SyncedEntry<int>.op_Implicit(configuration.CARBON_KNEEJOINTS_INCREMENTAL_CROUCH_DEBUFF_DECREASE) * BaseUpgrade.GetUpgradeLevel("Carbon Kneejoints")) / 100f;
		}

		public static float ReduceCrouchMovementSpeedDebuff(float defaultValue)
		{
			float num = CalculateDecreaseMultiplier();
			float num2 = 1f - defaultValue;
			return defaultValue - Mathf.Clamp(1f - num, 0f, 1f) * num2;
		}

		public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null)
		{
			return Tools.GenerateInfoForUpgrade("레벨 {0} - ${1} - 웅크리는 동안의 이동 속도 감소를 {2}% 줄입니다\n", initialPrice, incrementalPrices, infoFunction);
			static float infoFunction(int level)
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				return configuration.CARBON_KNEEJOINTS_INITIAL_CROUCH_DEBUFF_DECREASE.Value + level * configuration.CARBON_KNEEJOINTS_INCREMENTAL_CROUCH_DEBUFF_DECREASE.Value;
			}
		}

		public new static (string, string[]) RegisterScrapToUpgrade()
		{
			return ("Carbon Kneejoints", BaseUpgrade.GetConfiguration().CARBON_KNEEJOINTS_ITEM_PROGRESSION_ITEMS.Value.Split(","));
		}

		public new static void RegisterUpgrade()
		{
			GameObject val = NetworkPrefabs.CreateNetworkPrefab("Carbon Kneejoints");
			val.AddComponent<CarbonKneejoints>();
			NetworkPrefabs.RegisterNetworkPrefab(val);
			Plugin.networkPrefabs["Carbon Kneejoints"] = val;
		}

		public new static CustomTerminalNode RegisterTerminalNode()
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Carbon Kneejoints", SyncedEntry<bool>.op_Implicit(configuration.SHARED_UPGRADES) || !SyncedEntry<bool>.op_Implicit(configuration.CARBON_KNEEJOINTS_INDIVIDUAL), SyncedEntry<bool>.op_Implicit(configuration.CARBON_KNEEJOINTS_ENABLED), SyncedEntry<int>.op_Implicit(configuration.CARBON_KNEEJOINTS_PRICE), UpgradeBus.ParseUpgradePrices(SyncedEntry<string>.op_Implicit(configuration.CARBON_KNEEJOINTS_PRICES)), SyncedEntry<bool>.op_Implicit(configuration.OVERRIDE_UPGRADE_NAMES) ? SyncedEntry<string>.op_Implicit(configuration.CARBON_KNEEJOINTS_OVERRIDE_NAME) : "", Plugin.networkPrefabs["Carbon Kneejoints"]);
		}

		protected override void __initializeVariables()
		{
			base.__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "CarbonKneejoints";
		}
	}
	internal class DeepPockets : TierUpgrade
	{
		internal const string UPGRADE_NAME = "Deeper Pockets";

		internal const string DEFAULT_PRICES = "750";

		public override bool CanInitializeOnStart
		{
			get
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				string[] array = configuration.DEEPER_POCKETS_PRICES.Value.Split(',');
				return configuration.DEEPER_POCKETS_PRICE.Value <= 0 && array.Length == 1 && (array[0].Length == 0 || array[0] == "0");
			}
		}

		internal override void Start()
		{
			upgradeName = "Deeper Pockets";
			overridenUpgradeName = SyncedEntry<string>.op_Implicit(BaseUpgrade.GetConfiguration().DEEPER_POCKETS_OVERRIDE_NAME);
			base.Start();
		}

		public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null)
		{
			return Tools.GenerateInfoForUpgrade("LVL {0} - ${1} - 플레이어의 양손 운반 용량이 {2} 증가합니다.\n", initialPrice, incrementalPrices, infoFunction);
			static float infoFunction(int level)
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				return configuration.DEEPER_POCKETS_INITIAL_TWO_HANDED_ITEMS.Value + level * configuration.DEEPER_POCKETS_INCREMENTAL_TWO_HANDED_ITEMS.Value;
			}
		}

		public new static (string, string[]) RegisterScrapToUpgrade()
		{
			return ("Deeper Pockets", BaseUpgrade.GetConfiguration().DEEPER_POCKETS_ITEM_PROGRESSION_ITEMS.Value.Split(","));
		}

		public new static void RegisterUpgrade()
		{
			BaseUpgrade.SetupGenericPerk<DeepPockets>("Deeper Pockets");
		}

		public new static CustomTerminalNode RegisterTerminalNode()
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Deeper Pockets", SyncedEntry<bool>.op_Implicit(configuration.SHARED_UPGRADES) || !SyncedEntry<bool>.op_Implicit(configuration.DEEPER_POCKETS_INDIVIDUAL), SyncedEntry<bool>.op_Implicit(configuration.DEEPER_POCKETS_ENABLED), SyncedEntry<int>.op_Implicit(configuration.DEEPER_POCKETS_PRICE), UpgradeBus.ParseUpgradePrices(SyncedEntry<string>.op_Implicit(configuration.DEEPER_POCKETS_PRICES)), SyncedEntry<bool>.op_Implicit(configuration.OVERRIDE_UPGRADE_NAMES) ? SyncedEntry<string>.op_Implicit(configuration.DEEPER_POCKETS_OVERRIDE_NAME) : "");
		}

		protected override void __initializeVariables()
		{
			base.__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "DeepPockets";
		}
	}
	internal class HikingBoots : TierUpgrade
	{
		internal const string UPGRADE_NAME = "Hiking Boots";

		internal const string PRICES_DEFAULT = "100,150,175";

		public override bool CanInitializeOnStart
		{
			get
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				string[] array = configuration.HIKING_BOOTS_PRICES.Value.Split(',');
				return configuration.HIKING_BOOTS_PRICE.Value <= 0 && array.Length == 1 && (array[0].Length == 0 || array[0] == "0");
			}
		}

		private void Awake()
		{
			upgradeName = "Hiking Boots";
			overridenUpgradeName = SyncedEntry<string>.op_Implicit(BaseUpgrade.GetConfiguration().HIKING_BOOTS_OVERRIDE_NAME);
		}

		private static float ComputeUphillSlopeDebuffMultiplier()
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			return 1f - (float)(SyncedEntry<int>.op_Implicit(configuration.HIKING_BOOTS_INITIAL_DECREASE) + BaseUpgrade.GetUpgradeLevel("Hiking Boots") * SyncedEntry<int>.op_Implicit(configuration.HIKING_BOOTS_INCREMENTAL_DECREASE)) / 100f;
		}

		public static float ReduceUphillSlopeDebuff(float defaultValue)
		{
			if (!SyncedEntry<bool>.op_Implicit(BaseUpgrade.GetConfiguration().HIKING_BOOTS_ENABLED))
			{
				return defaultValue;
			}
			if (!BaseUpgrade.GetActiveUpgrade("Hiking Boots"))
			{
				return defaultValue;
			}
			float num = ComputeUphillSlopeDebuffMultiplier();
			return Mathf.Clamp(defaultValue * num, 0f, defaultValue);
		}

		public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null)
		{
			return Tools.GenerateInfoForUpgrade("LVL {0} - ${1} - 경사면을 지날 때 속도 변화가 {2}% 감소합니다.\n", initialPrice, incrementalPrices, infoFunction);
			static float infoFunction(int level)
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				return configuration.HIKING_BOOTS_INITIAL_DECREASE.Value + level * configuration.HIKING_BOOTS_INCREMENTAL_DECREASE.Value;
			}
		}

		public new static (string, string[]) RegisterScrapToUpgrade()
		{
			return ("Hiking Boots", BaseUpgrade.GetConfiguration().HIKING_BOOTS_ITEM_PROGRESSION_ITEMS.Value.Split(","));
		}

		public new static void RegisterUpgrade()
		{
			BaseUpgrade.SetupGenericPerk<HikingBoots>("Hiking Boots");
		}

		public new static CustomTerminalNode RegisterTerminalNode()
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Hiking Boots", SyncedEntry<bool>.op_Implicit(configuration.SHARED_UPGRADES) || !SyncedEntry<bool>.op_Implicit(configuration.HIKING_BOOTS_INDIVIDUAL), SyncedEntry<bool>.op_Implicit(configuration.HIKING_BOOTS_ENABLED), SyncedEntry<int>.op_Implicit(configuration.HIKING_BOOTS_PRICE), UpgradeBus.ParseUpgradePrices(SyncedEntry<string>.op_Implicit(configuration.HIKING_BOOTS_PRICES)), SyncedEntry<bool>.op_Implicit(configuration.OVERRIDE_UPGRADE_NAMES) ? SyncedEntry<string>.op_Implicit(configuration.HIKING_BOOTS_OVERRIDE_NAME) : "");
		}

		protected override void __initializeVariables()
		{
			base.__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "HikingBoots";
		}
	}
	internal class MechanicalArms : TierUpgrade
	{
		internal const string UPGRADE_NAME = "Mechanical Arms";

		internal const string PRICES_DEFAULT = "400,600,800";

		public override bool CanInitializeOnStart
		{
			get
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				string[] array = configuration.MECHANICAL_ARMS_PRICES.Value.Split(',');
				return configuration.MECHANICAL_ARMS_PRICE.Value <= 0 && array.Length == 1 && (array[0].Length == 0 || array[0] == "0");
			}
		}

		internal override void Start()
		{
			upgradeName = "Mechanical Arms";
			overridenUpgradeName = SyncedEntry<string>.op_Implicit(BaseUpgrade.GetConfiguration().MECHANICAL_ARMS_OVERRIDE_NAME);
			base.Start();
		}

		public static float GetIncreasedGrabDistance(float defaultValue)
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			if (!SyncedEntry<bool>.op_Implicit(configuration.MECHANICAL_ARMS_ENABLED))
			{
				return defaultValue;
			}
			if (!BaseUpgrade.GetActiveUpgrade("Mechanical Arms"))
			{
				return defaultValue;
			}
			float num = SyncedEntry<float>.op_Implicit(configuration.MECHANICAL_ARMS_INITIAL_RANGE_INCREASE) + (float)BaseUpgrade.GetUpgradeLevel("Mechanical Arms") * SyncedEntry<float>.op_Implicit(configuration.MECHANICAL_ARMS_INCREMENTAL_RANGE_INCREASE);
			return Mathf.Clamp(defaultValue + num, defaultValue, float.MaxValue);
		}

		public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null)
		{
			return Tools.GenerateInfoForUpgrade("LVL {0} - ${1} - 플레이어의 상호작용 범위가 {2} 만큼 증가합니다.\n", initialPrice, incrementalPrices, infoFunction);
			static float infoFunction(int level)
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				return configuration.MECHANICAL_ARMS_INITIAL_RANGE_INCREASE.Value + (float)level * configuration.MECHANICAL_ARMS_INCREMENTAL_RANGE_INCREASE.Value;
			}
		}

		public new static (string, string[]) RegisterScrapToUpgrade()
		{
			return ("Mechanical Arms", BaseUpgrade.GetConfiguration().MECHANICAL_ARMS_ITEM_PROGRESSION_ITEMS.Value.Split(","));
		}

		public new static void RegisterUpgrade()
		{
			BaseUpgrade.SetupGenericPerk<MechanicalArms>("Mechanical Arms");
		}

		public new static CustomTerminalNode RegisterTerminalNode()
		{
			LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
			return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Mechanical Arms", SyncedEntry<bool>.op_Implicit(configuration.SHARED_UPGRADES) || !SyncedEntry<bool>.op_Implicit(configuration.MECHANICAL_ARMS_INDIVIDUAL), configuration.MECHANICAL_ARMS_ENABLED.Value, configuration.MECHANICAL_ARMS_PRICE.Value, UpgradeBus.ParseUpgradePrices(configuration.MECHANICAL_ARMS_PRICES.Value), SyncedEntry<bool>.op_Implicit(configuration.OVERRIDE_UPGRADE_NAMES) ? SyncedEntry<string>.op_Implicit(configuration.MECHANICAL_ARMS_OVERRIDE_NAME) : "");
		}

		protected override void __initializeVariables()
		{
			base.__initializeVariables();
		}

		protected internal override string __getTypeName()
		{
			return "MechanicalArms";
		}
	}
	internal class NightVision : TierUpgrade, IPlayerSync
	{
		private float nightBattery;

		private PlayerControllerB client;

		public bool batteryExhaustion;

		internal GameObject nightVisionPrefab;

		internal bool nightVisionActive = false;

		internal float nightVisRange;

		internal float nightVisIntensity;

		internal Color nightVisColor;

		public const string SIMPLE_UPGRADE_NAME = "Night Vision";

		public const string UPGRADE_NAME = "NV Headset Batteries";

		public const string PRICES_DEFAULT = "300,400,500";

		private static readonly LguLogger logger = new LguLogger("NV Headset Batteries");

		public static NightVision Instance { get; internal set; }

		public override bool CanInitializeOnStart
		{
			get
			{
				LategameConfiguration configuration = BaseUpgrade.GetConfiguration();
				string[] array = configuration.NIGHT_VISION_UPGRADE_PRICES.Value.Split(',');
				return configuration.NIGHT_VISION_PRICE.Value <= 0 && array.Length == 1 && (array[0].Length == 0 || array[0] == "0");
			}
		}

		private void Awake()
		{
			Instance = this;