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.Cryptography; using System.Security.Permissions; using System.Text; using System.Threading.Tasks; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using BrutalCompanyMinus; using BrutalCompanyMinus.Minus.Handlers; using BrutalCompanyMinus.Minus.MonoBehaviours; using CSync.Extensions; using CSync.Lib; using CustomItemBehaviourLibrary.AbstractItems; using Dawn; 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 LethalConstellations.PluginCore; using LethalLevelLoader; using LethalLib.Extras; using LethalLib.Modules; using Microsoft.CodeAnalysis; using MissileTurret; using MoreShipUpgrades.API; using MoreShipUpgrades.Compat; using MoreShipUpgrades.Configuration; using MoreShipUpgrades.Configuration.Contracts; using MoreShipUpgrades.Configuration.Contracts.Abstractions; using MoreShipUpgrades.Configuration.Upgrades.Abstractions.OneTimeUpgrades; using MoreShipUpgrades.Configuration.Upgrades.Abstractions.TIerUpgrades; using MoreShipUpgrades.Configuration.Upgrades.Custom; using MoreShipUpgrades.Configuration.Upgrades.Interfaces; using MoreShipUpgrades.Configuration.Upgrades.Interfaces.OneTimeUpgrades; using MoreShipUpgrades.Configuration.Upgrades.Interfaces.TierUpgrades; using MoreShipUpgrades.Extensions; using MoreShipUpgrades.Input; using MoreShipUpgrades.Managers; using MoreShipUpgrades.Misc; using MoreShipUpgrades.Misc.Commands; 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.UI.Application; using MoreShipUpgrades.UI.Cursor; using MoreShipUpgrades.UI.TerminalNodes; 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.Jetpack; 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.General; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.UI; using com.github.zehsteam.ToilHead.MonoBehaviours; [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] 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.13.1")] [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.*/)] [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 networkPrefabs = new Dictionary(); private void Awake() { //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown mls = ((BaseUnityPlugin)this).Logger; LategameConfiguration lategameConfiguration = new LategameConfiguration(((BaseUnityPlugin)this).Config); IEnumerable types; try { types = Assembly.GetExecutingAssembly().GetTypes(); } catch (ReflectionTypeLoadException ex) { types = ex.Types.Where((Type t) => t != 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(); val = new GameObject("SpawnItemManager"); val.AddComponent(); 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(); if (CurrencyManager.Enabled) { InteractiveTerminalManager.RegisterApplication(LguConstants.TRADE_PLAYER_CREDITS_COMMAND_PROMPT, false); InteractiveTerminalManager.RegisterApplication(LguConstants.CONVERT_PLAYER_CREDITS_COMMAND_PROMPT, false); } InteractiveTerminalManager.RegisterApplication(LguConstants.LGU_COMMAND_PROMPTS, false); if (SyncedEntry.op_Implicit(lategameConfiguration.ContractsConfiguration.Enabled)) { List list = new List(LguConstants.CONTRACT_COMMAND_PROMPT); if (SyncedEntry.op_Implicit(lategameConfiguration.ContractsConfiguration.RandomOnly)) { list.Remove("contract"); } InteractiveTerminalManager.RegisterApplication(list.ToArray(), false); } mls.LogInfo((object)"More Ship Upgrades 3.13.1 has been loaded successfully."); } private void SetupModStore(ref AssetBundle bundle) { GameObject val = AssetBundleHandler.TryLoadGameObjectAsset(ref bundle, "Assets/ShipUpgrades/LguStore.prefab"); val.AddComponent(); val.AddComponent(); val.AddComponent(); ItemManager.RegisterNetworkPrefab(val); UpgradeBus.Instance.modStorePrefab = val; } private void SetupItems(ref IEnumerable 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 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 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 static Beekeeper Instance; public const string UPGRADE_NAME = "Beekeeper"; public const string PRICES_DEFAULT = "450,225,280,340"; internal const string WORLD_BUILDING_TEXT = "\n\nOn-the-job training package that instructs {0} how to more safely and efficiently handle Circuit Bee Nests. Departments with a LVL {1} Certification in Circuit Bee Nest Handling earn an extra commission for every Nest they sell.\n\n"; protected bool CanIncreaseHivePrice => BaseUpgrade.GetUpgradeLevel("Beekeeper") == BaseUpgrade.GetConfiguration().BeekeeperConfiguration.Prices.Value.Split(',').Length; public override bool CanInitializeOnStart { get { ITierMultipleEffectUpgradeConfiguration beekeeperConfiguration = BaseUpgrade.GetConfiguration().BeekeeperConfiguration; string[] array = beekeeperConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } private void Awake() { upgradeName = "Beekeeper"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().BeekeeperConfiguration.OverrideName); Instance = this; } public static int CalculateBeeDamage(int damageNumber) { ITierMultipleEffectUpgradeConfiguration beekeeperConfiguration = BaseUpgrade.GetConfiguration().BeekeeperConfiguration; if (!SyncedEntry.op_Implicit(beekeeperConfiguration.Enabled)) { return damageNumber; } if (!BaseUpgrade.GetActiveUpgrade("Beekeeper")) { return damageNumber; } (SyncedEntry, SyncedEntry) effectPair = beekeeperConfiguration.GetEffectPair(0); return Mathf.Clamp((int)((float)damageNumber * (effectPair.Item1.Value - (float)BaseUpgrade.GetUpgradeLevel("Beekeeper") * effectPair.Item2.Value)), 0, damageNumber); } public static int GetHiveScrapValue(int originalValue) { ITierMultipleEffectUpgradeConfiguration beekeeperConfiguration = BaseUpgrade.GetConfiguration().BeekeeperConfiguration; if (!beekeeperConfiguration.Enabled.Value || !Instance.CanIncreaseHivePrice) { return originalValue; } return (int)((float)originalValue * beekeeperConfiguration.GetEffectPair(1).Item1.Value); } public string GetWorldBuildingText(bool shareStatus = false) { return string.Format("\n\nOn-the-job training package that instructs {0} how to more safely and efficiently handle Circuit Bee Nests. Departments with a LVL {1} Certification in Circuit Bee Nest Handling earn an extra commission for every Nest they sell.\n\n", shareStatus ? "your crew" : "you", BaseUpgrade.GetConfiguration().BeekeeperConfiguration.Prices.Value.Split(',').Length); } 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, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().BeekeeperConfiguration.PurchaseMode)) + $"\nOn maximum level, applies a {(SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().BeekeeperConfiguration.GetEffectPair(1).Item1) - 1f) * 100f:F0}% scrap value increase on beehives."; static float infoFunction(int level) { ITierMultipleEffectUpgradeConfiguration beekeeperConfiguration = BaseUpgrade.GetConfiguration().BeekeeperConfiguration; (SyncedEntry, SyncedEntry) effectPair = beekeeperConfiguration.GetEffectPair(0); return 100f * (effectPair.Item1.Value - (float)level * effectPair.Item2.Value); } } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Beekeeper", BaseUpgrade.GetConfiguration().BeekeeperConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Beekeeper"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Beekeeper", BaseUpgrade.GetConfiguration().BeekeeperConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "Beekeeper"; } } internal class BiggerLungs : TierUpgrade, IUpgradeWorldBuilding { public const string UPGRADE_NAME = "Bigger Lungs"; internal const string PRICES_DEFAULT = "600,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 { BiggerLungsUpgradeConfiguration biggerLungsConfiguration = BaseUpgrade.GetConfiguration().BiggerLungsConfiguration; string[] array = biggerLungsConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } private void Awake() { upgradeName = "Bigger Lungs"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().BiggerLungsConfiguration.OverrideName); } public static float ApplyPossibleIncreasedStaminaRegen(float regenValue) { BiggerLungsUpgradeConfiguration biggerLungsConfiguration = BaseUpgrade.GetConfiguration().BiggerLungsConfiguration; if (!biggerLungsConfiguration.Enabled.Value) { return regenValue; } if (!BaseUpgrade.GetActiveUpgrade("Bigger Lungs") || BaseUpgrade.GetUpgradeLevel("Bigger Lungs") < biggerLungsConfiguration.StaminaRegenerationLevel.Value - 1) { return regenValue; } (SyncedEntry, SyncedEntry) effectPair = biggerLungsConfiguration.GetEffectPair(1); return regenValue * Mathf.Clamp(effectPair.Item1.Value + SyncedEntry.op_Implicit(effectPair.Item2) * (float)Mathf.Abs(BaseUpgrade.GetUpgradeLevel("Bigger Lungs") - biggerLungsConfiguration.StaminaRegenerationLevel.Value - 1), 0f, 10f); } public static float GetAdditionalStaminaTime(float defaultValue) { BiggerLungsUpgradeConfiguration biggerLungsConfiguration = BaseUpgrade.GetConfiguration().BiggerLungsConfiguration; if (!SyncedEntry.op_Implicit(biggerLungsConfiguration.Enabled)) { return defaultValue; } if (!BaseUpgrade.GetActiveUpgrade("Bigger Lungs")) { return defaultValue; } (SyncedEntry, SyncedEntry) effectPair = biggerLungsConfiguration.GetEffectPair(0); float num = SyncedEntry.op_Implicit(effectPair.Item1) + (float)BaseUpgrade.GetUpgradeLevel("Bigger Lungs") * SyncedEntry.op_Implicit(effectPair.Item2); return Mathf.Clamp(defaultValue + num, defaultValue, float.MaxValue); } public static float ApplyPossibleReducedJumpStaminaCost(float jumpCost) { BiggerLungsUpgradeConfiguration biggerLungsConfiguration = BaseUpgrade.GetConfiguration().BiggerLungsConfiguration; if (!biggerLungsConfiguration.Enabled.Value) { return jumpCost; } if (!BaseUpgrade.GetActiveUpgrade("Bigger Lungs") || BaseUpgrade.GetUpgradeLevel("Bigger Lungs") < biggerLungsConfiguration.JumpReductionLevel.Value - 1) { return jumpCost; } (SyncedEntry, SyncedEntry) effectPair = biggerLungsConfiguration.GetEffectPair(2); return jumpCost * Mathf.Clamp(effectPair.Item1.Value - SyncedEntry.op_Implicit(effectPair.Item2) * (float)Mathf.Abs(BaseUpgrade.GetUpgradeLevel("Bigger Lungs") - biggerLungsConfiguration.JumpReductionLevel.Value - 1), 0f, 10f); } public string GetWorldBuildingText(bool shareStatus = false) { return string.Format("\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", shareStatus ? "your crew's suit oxigen delivery systems" : "your suit's oxygen delivery system"); } private string GetBiggerlungsInfo(int level, int price) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendFormat(AssetBundleHandler.GetInfoFromJSON("Bigger Lungs"), level, BaseUpgrade.GetUpgradePrice(price, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().BiggerLungsConfiguration.PurchaseMode)), infoFunction(level - 1)); BiggerLungsUpgradeConfiguration biggerLungsConfiguration = BaseUpgrade.GetConfiguration().BiggerLungsConfiguration; if (level >= SyncedEntry.op_Implicit(biggerLungsConfiguration.StaminaRegenerationLevel)) { stringBuilder.Append($"Stamina regeneration is increased by {Mathf.FloorToInt(staminaRegenerationInfo(level) * 100f)}%\n"); } if (level >= biggerLungsConfiguration.JumpReductionLevel.Value) { stringBuilder.Append($"Stamina used when jumping is reduced by {Mathf.FloorToInt(costReductionInfo(level) * 100f)}%\n"); } return stringBuilder.ToString(); static float costReductionInfo(int level) { BiggerLungsUpgradeConfiguration biggerLungsConfiguration2 = BaseUpgrade.GetConfiguration().BiggerLungsConfiguration; (SyncedEntry, SyncedEntry) effectPair = biggerLungsConfiguration2.GetEffectPair(2); return 1f - (effectPair.Item1.Value - (float)level * effectPair.Item2.Value); } static float infoFunction(int level) { BiggerLungsUpgradeConfiguration biggerLungsConfiguration4 = BaseUpgrade.GetConfiguration().BiggerLungsConfiguration; (SyncedEntry, SyncedEntry) effectPair3 = biggerLungsConfiguration4.GetEffectPair(0); return effectPair3.Item1.Value + (float)level * effectPair3.Item2.Value; } static float staminaRegenerationInfo(int level) { BiggerLungsUpgradeConfiguration biggerLungsConfiguration3 = BaseUpgrade.GetConfiguration().BiggerLungsConfiguration; (SyncedEntry, SyncedEntry) effectPair2 = biggerLungsConfiguration3.GetEffectPair(1); return effectPair2.Item1.Value + (float)level * effectPair2.Item2.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().BiggerLungsConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Bigger Lungs"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Bigger Lungs", BaseUpgrade.GetConfiguration().BiggerLungsConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "BiggerLungs"; } } internal class ClimbingGloves : TierUpgrade, IUpgradeWorldBuilding { internal const string UPGRADE_NAME = "Climbing Gloves"; internal const string DEFAULT_PRICES = "150,200,250,300"; internal const string WORLD_BUILDING_TEXT = "\n\nIn the 'GEAR' section of the Company Catalogue, at the bottom of the last page sandwiched between two ads, you find an entry for this product. They are Premium Synthetic Proprietary Ladder Gripping Gloves. The sales screed promises a 2% increase in your department's efficiency at outdoor traversal if you buy this.\n\n"; public override bool CanInitializeOnStart { get { ITierEffectUpgradeConfiguration climblingGlovesConfiguration = BaseUpgrade.GetConfiguration().ClimblingGlovesConfiguration; string[] array = climblingGlovesConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nIn the 'GEAR' section of the Company Catalogue, at the bottom of the last page sandwiched between two ads, you find an entry for this product. They are Premium Synthetic Proprietary Ladder Gripping Gloves. The sales screed promises a 2% increase in your department's efficiency at outdoor traversal if you buy this.\n\n"; } private void Awake() { upgradeName = "Climbing Gloves"; overridenUpgradeName = SyncedEntry.op_Implicit(UpgradeBus.Instance.PluginConfiguration.ClimblingGlovesConfiguration.OverrideName); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { return Tools.GenerateInfoForUpgrade("LVL {0} - {1} - Increases the speed of climbing ladders by {2} units.\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().ClimblingGlovesConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration climblingGlovesConfiguration = BaseUpgrade.GetConfiguration().ClimblingGlovesConfiguration; return climblingGlovesConfiguration.InitialEffect.Value + (float)level * climblingGlovesConfiguration.IncrementalEffect.Value; } } public static float GetAdditionalClimbingSpeed(float defaultValue) { ITierEffectUpgradeConfiguration climblingGlovesConfiguration = BaseUpgrade.GetConfiguration().ClimblingGlovesConfiguration; if (!SyncedEntry.op_Implicit(climblingGlovesConfiguration.Enabled)) { return defaultValue; } if (!BaseUpgrade.GetActiveUpgrade("Climbing Gloves")) { return defaultValue; } float num = SyncedEntry.op_Implicit(climblingGlovesConfiguration.InitialEffect) + (float)BaseUpgrade.GetUpgradeLevel("Climbing Gloves") * SyncedEntry.op_Implicit(climblingGlovesConfiguration.IncrementalEffect); return Mathf.Clamp(defaultValue + num, defaultValue, float.MaxValue); } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Climbing Gloves", BaseUpgrade.GetConfiguration().ClimblingGlovesConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Climbing Gloves"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Climbing Gloves", BaseUpgrade.GetConfiguration().ClimblingGlovesConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } 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 = "1000,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 { ITierUpgradeConfiguration proteinPowderConfiguration = BaseUpgrade.GetConfiguration().ProteinPowderConfiguration; string[] array = proteinPowderConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } internal override void Start() { upgradeName = "Protein Powder"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().ProteinPowderConfiguration.OverrideName); base.Start(); } public static int GetShovelHitForce(int force) { ITierMultipleEffectUpgradeConfiguration proteinPowderConfiguration = BaseUpgrade.GetConfiguration().ProteinPowderConfiguration; if (!proteinPowderConfiguration.Enabled.Value) { return force; } if (!BaseUpgrade.GetActiveUpgrade("Protein Powder")) { return force; } (SyncedEntry, SyncedEntry) effectPair = proteinPowderConfiguration.GetEffectPair(0); int num = (TryToCritEnemy() ? 100 : (effectPair.Item1.Value + effectPair.Item2.Value * BaseUpgrade.GetUpgradeLevel("Protein Powder"))); return force + num; } private static bool TryToCritEnemy() { ITierMultipleEffectUpgradeConfiguration proteinPowderConfiguration = BaseUpgrade.GetConfiguration().ProteinPowderConfiguration; string[] array = proteinPowderConfiguration.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; } (SyncedEntry, SyncedEntry) secondEffectPair = proteinPowderConfiguration.GetSecondEffectPair(0); return Random.value < secondEffectPair.Item1.Value; } public string GetWorldBuildingText(bool shareStatus = false) { return "\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"; } 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, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().ProteinPowderConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierMultipleEffectUpgradeConfiguration proteinPowderConfiguration = BaseUpgrade.GetConfiguration().ProteinPowderConfiguration; (SyncedEntry, SyncedEntry) effectPair = proteinPowderConfiguration.GetEffectPair(0); return effectPair.Item1.Value + effectPair.Item2.Value * level; } } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Protein Powder", BaseUpgrade.GetConfiguration().ProteinPowderConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Protein Powder"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Protein Powder", BaseUpgrade.GetConfiguration().ProteinPowderConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "ProteinPowder"; } } internal class EfficientEngines : TierUpgrade, IUpgradeWorldBuilding { internal const string UPGRADE_NAME = "Efficient Engines"; internal const string DEFAULT_PRICES = "450,600, 750, 900"; internal const string WORLD_BUILDING_TEXT = "\n\nService package for your Ship's autopiloting system that tweaks the parameters by which it routes between moons. By default, the autopiloting software is configured to only use the safest routes, but this package will authorize it to use faster but slightly more dangerous \"Liability Routes\" and certain spatial anomalies to expedite travel, conserving fuel costs.\n\n"; public override bool CanInitializeOnStart { get { string[] array = BaseUpgrade.GetConfiguration().EfficientEnginesConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nService package for your Ship's autopiloting system that tweaks the parameters by which it routes between moons. By default, the autopiloting software is configured to only use the safest routes, but this package will authorize it to use faster but slightly more dangerous \"Liability Routes\" and certain spatial anomalies to expedite travel, conserving fuel costs.\n\n"; } private void Awake() { upgradeName = "Efficient Engines"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().EfficientEnginesConfiguration.OverrideName); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { return Tools.GenerateInfoForUpgrade("LVL {0} - {1} - Moon routing will be {2}% cheaper\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().EfficientEnginesConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration efficientEnginesConfiguration = BaseUpgrade.GetConfiguration().EfficientEnginesConfiguration; return efficientEnginesConfiguration.InitialEffect.Value + level * efficientEnginesConfiguration.IncrementalEffect.Value; } } public static int GetDiscountedMoonPrice(int defaultPrice) { ITierEffectUpgradeConfiguration efficientEnginesConfiguration = BaseUpgrade.GetConfiguration().EfficientEnginesConfiguration; if (!efficientEnginesConfiguration.Enabled.Value) { return defaultPrice; } if (!BaseUpgrade.GetActiveUpgrade("Efficient Engines")) { return defaultPrice; } if (defaultPrice == 0) { return defaultPrice; } float num = (float)defaultPrice * (1f - (float)(efficientEnginesConfiguration.InitialEffect.Value + BaseUpgrade.GetUpgradeLevel("Efficient Engines") * efficientEnginesConfiguration.IncrementalEffect.Value) / 100f); return Mathf.CeilToInt(Mathf.Clamp(num, 0f, (float)defaultPrice)); } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Efficient Engines", BaseUpgrade.GetConfiguration().EfficientEnginesConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Efficient Engines"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Efficient Engines", BaseUpgrade.GetConfiguration().EfficientEnginesConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "EfficientEngines"; } } internal class LandingThrusters : TierUpgrade, IUpgradeWorldBuilding { internal const string UPGRADE_NAME = "Landing Thrusters"; internal const string DEFAULT_PRICES = "300,250,450,650"; internal const string WORLD_BUILDING_TEXT = "\n\nOptimization procedure for your Ship's in-atmosphere thrusters that makes quicker landings possible by ordering the autopilot to commit to a longer freefall. Technically more dangerous, but it'll be fine."; public override bool CanInitializeOnStart { get { ITierUpgradeConfiguration landingThrustersConfiguration = BaseUpgrade.GetConfiguration().LandingThrustersConfiguration; string[] array = landingThrustersConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nOptimization procedure for your Ship's in-atmosphere thrusters that makes quicker landings possible by ordering the autopilot to commit to a longer freefall. Technically more dangerous, but it'll be fine."; } private void Awake() { upgradeName = "Landing Thrusters"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().LandingThrustersConfiguration.OverrideName); } public static float GetInteractMutliplier() { LandingThrusterUpgradeConfiguration landingThrustersConfiguration = BaseUpgrade.GetConfiguration().LandingThrustersConfiguration; if (!SyncedEntry.op_Implicit(landingThrustersConfiguration.Enabled)) { return 1f; } if (!SyncedEntry.op_Implicit(landingThrustersConfiguration.AffectLanding)) { return 1f; } if (!BaseUpgrade.GetActiveUpgrade("Landing Thrusters")) { return 1f; } return 1f + Mathf.Max(0f, (float)(SyncedEntry.op_Implicit(landingThrustersConfiguration.InitialEffect) + BaseUpgrade.GetUpgradeLevel("Landing Thrusters") * SyncedEntry.op_Implicit(landingThrustersConfiguration.IncrementalEffect)) / 100f); } public static float GetLandingSpeedMultiplier() { LandingThrusterUpgradeConfiguration landingThrustersConfiguration = BaseUpgrade.GetConfiguration().LandingThrustersConfiguration; if (!SyncedEntry.op_Implicit(landingThrustersConfiguration.Enabled)) { return 1f; } if (!BaseUpgrade.GetActiveUpgrade("Landing Thrusters")) { return 1f; } return 1f + Mathf.Max(0f, (float)(SyncedEntry.op_Implicit(landingThrustersConfiguration.InitialEffect) + BaseUpgrade.GetUpgradeLevel("Landing Thrusters") * SyncedEntry.op_Implicit(landingThrustersConfiguration.IncrementalEffect)) / 100f); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { return Tools.GenerateInfoForUpgrade("LVL {0} - {1} - Increases the ship's landing speed by {2}%\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().LandingThrustersConfiguration.PurchaseMode)); static float infoFunction(int level) { LandingThrusterUpgradeConfiguration landingThrustersConfiguration = BaseUpgrade.GetConfiguration().LandingThrustersConfiguration; return landingThrustersConfiguration.InitialEffect.Value + level * landingThrustersConfiguration.IncrementalEffect.Value; } } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Landing Thrusters", BaseUpgrade.GetConfiguration().LandingThrustersConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Landing Thrusters"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Landing Thrusters", BaseUpgrade.GetConfiguration().LandingThrustersConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "LandingThrusters"; } } internal class ShutterBatteries : TierUpgrade, IUpgradeWorldBuilding { public const string UPGRADE_NAME = "Shutter Batteries"; public const string PRICES_DEFAULT = "300,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"; internal const string WORLD_BUILDING_TEXT = "\n\nService package of maintenance procedures for your Ship's Proprietary Emergency Lockout Door System, the two-button monitor you control the Ship's airlock from while moonside. Opting into all of the procedures will improve the uptime of the lockout function, which may improve your department's Fatality Record Over Time by up to 11%.\n\n"; public override bool CanInitializeOnStart { get { ITierEffectUpgradeConfiguration shutterBatteriesConfiguration = BaseUpgrade.GetConfiguration().ShutterBatteriesConfiguration; string[] array = shutterBatteriesConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nService package of maintenance procedures for your Ship's Proprietary Emergency Lockout Door System, the two-button monitor you control the Ship's airlock from while moonside. Opting into all of the procedures will improve the uptime of the lockout function, which may improve your department's Fatality Record Over Time by up to 11%.\n\n"; } private void Awake() { upgradeName = "Shutter Batteries"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().ShutterBatteriesConfiguration.OverrideName); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { return Tools.GenerateInfoForUpgrade("LVL {0} - {1} - Increases the door's hydraulic capacity to remain closed by {2} units\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().ShutterBatteriesConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration shutterBatteriesConfiguration = BaseUpgrade.GetConfiguration().ShutterBatteriesConfiguration; return shutterBatteriesConfiguration.InitialEffect.Value + (float)level * shutterBatteriesConfiguration.IncrementalEffect.Value; } } public static float GetAdditionalDoorTime(float defaultValue) { ITierEffectUpgradeConfiguration shutterBatteriesConfiguration = BaseUpgrade.GetConfiguration().ShutterBatteriesConfiguration; if (!SyncedEntry.op_Implicit(shutterBatteriesConfiguration.Enabled)) { return defaultValue; } if (!BaseUpgrade.GetActiveUpgrade("Shutter Batteries")) { return defaultValue; } float num = SyncedEntry.op_Implicit(shutterBatteriesConfiguration.InitialEffect) + (float)BaseUpgrade.GetUpgradeLevel("Shutter Batteries") * SyncedEntry.op_Implicit(shutterBatteriesConfiguration.IncrementalEffect); return Mathf.Clamp(defaultValue + num, defaultValue, float.MaxValue); } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Shutter Batteries", BaseUpgrade.GetConfiguration().ShutterBatteriesConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Shutter Batteries"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Shutter Batteries", BaseUpgrade.GetConfiguration().ShutterBatteriesConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "ShutterBatteries"; } } } namespace MoreShipUpgrades.UpgradeComponents.TierUpgrades.Store { internal class BargainConnections : TierUpgrade, IUpgradeWorldBuilding { internal const string UPGRADE_NAME = "Bargain Connections"; internal const string PRICES_DEFAULT = "200,225,300,375"; internal const string WORLD_BUILDING_TEXT = "\n\nSubscription to 'Coupon Cutters' magazine. Every once in a while the magazine comes with coupons already cut out from it. Strange.\n\n"; public override bool CanInitializeOnStart { get { ITierEffectUpgradeConfiguration bargainConnectionsConfiguration = BaseUpgrade.GetConfiguration().BargainConnectionsConfiguration; string[] array = bargainConnectionsConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } internal override void Start() { upgradeName = "Bargain Connections"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().BargainConnectionsConfiguration.OverrideName); base.Start(); } public static int GetBargainConnectionsAdditionalItems(int defaultAmountItems) { ITierEffectUpgradeConfiguration bargainConnectionsConfiguration = BaseUpgrade.GetConfiguration().BargainConnectionsConfiguration; if (!BaseUpgrade.GetActiveUpgrade("Bargain Connections")) { return defaultAmountItems; } return defaultAmountItems + bargainConnectionsConfiguration.InitialEffect.Value + BaseUpgrade.GetUpgradeLevel("Bargain Connections") * bargainConnectionsConfiguration.IncrementalEffect.Value; } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { return Tools.GenerateInfoForUpgrade("LVL {0} - {1} - Increases the amount of items that can be on sale by {2}\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().BargainConnectionsConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration bargainConnectionsConfiguration = BaseUpgrade.GetConfiguration().BargainConnectionsConfiguration; return bargainConnectionsConfiguration.InitialEffect.Value + level * bargainConnectionsConfiguration.IncrementalEffect.Value; } } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Bargain Connections", BaseUpgrade.GetConfiguration().BargainConnectionsConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Bargain Connections"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Bargain Connections", BaseUpgrade.GetConfiguration().BargainConnectionsConfiguration); } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nSubscription to 'Coupon Cutters' magazine. Every once in a while the magazine comes with coupons already cut out from it. Strange.\n\n"; } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "BargainConnections"; } } internal class MarketInfluence : TierUpgrade, IUpgradeWorldBuilding { internal const string UPGRADE_NAME = "Market Influence"; internal const string PRICES_DEFAULT = "200,350,500"; internal const string WORLD_BUILDING_TEXT = "\n\nBy investing scrip into the Company's subsidiaries that produce your equipment instead of buying the equipment itself, you are sometimes awarded coupons in the mail for various Company Store offerings.\n\n"; public override bool CanInitializeOnStart { get { ITierEffectUpgradeConfiguration marketInfluenceConfiguration = BaseUpgrade.GetConfiguration().MarketInfluenceConfiguration; string[] array = marketInfluenceConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nBy investing scrip into the Company's subsidiaries that produce your equipment instead of buying the equipment itself, you are sometimes awarded coupons in the mail for various Company Store offerings.\n\n"; } internal override void Start() { upgradeName = "Market Influence"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().MarketInfluenceConfiguration.OverrideName); base.Start(); } public static int GetGuaranteedPercentageSale(int defaultPercentage, int maxValue) { ITierEffectUpgradeConfiguration marketInfluenceConfiguration = BaseUpgrade.GetConfiguration().MarketInfluenceConfiguration; if (!SyncedEntry.op_Implicit(marketInfluenceConfiguration.Enabled)) { return defaultPercentage; } if (!BaseUpgrade.GetActiveUpgrade("Market Influence")) { return defaultPercentage; } return Mathf.Clamp(defaultPercentage + marketInfluenceConfiguration.InitialEffect.Value + BaseUpgrade.GetUpgradeLevel("Market Influence") * marketInfluenceConfiguration.IncrementalEffect.Value, 0, maxValue); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { return Tools.GenerateInfoForUpgrade("LVL {0} - {1} - Guarantees the item sales' percentage to be at least {2}%\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().MarketInfluenceConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration marketInfluenceConfiguration = BaseUpgrade.GetConfiguration().MarketInfluenceConfiguration; return marketInfluenceConfiguration.InitialEffect.Value + level * marketInfluenceConfiguration.IncrementalEffect.Value; } } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Market Influence", BaseUpgrade.GetConfiguration().MarketInfluenceConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Market Influence"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Market Influence", BaseUpgrade.GetConfiguration().MarketInfluenceConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "MarketInfluence"; } } } namespace MoreShipUpgrades.UpgradeComponents.TierUpgrades.Ship { internal class Discombobulator : TierUpgrade, IUpgradeWorldBuilding { [CompilerGenerated] private sealed class d__14 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Terminal terminal; public Discombobulator <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__14(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(2f); <>1__state = 1; return true; case 1: <>1__state = -1; terminal.terminalAudio.maxDistance = 17f; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } internal float flashCooldown = 0f; public static Discombobulator instance; public const string UPGRADE_NAME = "Discombobulator"; public const string PRICES_DEFAULT = "450,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 { DiscombobulatorUpgradeConfiguration discombobulatorUpgradeConfiguration = BaseUpgrade.GetConfiguration().DiscombobulatorUpgradeConfiguration; string[] array = discombobulatorUpgradeConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } private void Awake() { upgradeName = "Discombobulator"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().DiscombobulatorUpgradeConfiguration.OverrideName); 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) //IL_00c1: 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)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; UseDiscombobulatorClientRpc(); } } } [ClientRpc] internal 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) //IL_00c1: 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.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 == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Terminal terminal = UpgradeBus.Instance.GetTerminal(); PlayAudio(ref terminal); flashCooldown = BaseUpgrade.GetConfiguration().DiscombobulatorUpgradeConfiguration.Cooldown.Value; StunNearbyEnemies(ref terminal); } } } private void StunNearbyEnemies(ref Terminal terminal) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) DiscombobulatorUpgradeConfiguration discombobulatorUpgradeConfiguration = BaseUpgrade.GetConfiguration().DiscombobulatorUpgradeConfiguration; Collider[] array = Physics.OverlapSphere(((Component)terminal).transform.position, discombobulatorUpgradeConfiguration.Radius.Value, 524288); if (array.Length == 0) { return; } for (int i = 0; i < array.Length; i++) { EnemyAICollisionDetect component = ((Component)array[i]).GetComponent(); if ((Object)(object)component == (Object)null) { continue; } EnemyAI mainScript = component.mainScript; if (!IsEnemyBlacklisted(mainScript)) { if (CanDealDamage()) { int num = discombobulatorUpgradeConfiguration.InitialDamage.Value + discombobulatorUpgradeConfiguration.IncrementalDamage.Value * Mathf.Max(BaseUpgrade.GetUpgradeLevel("Discombobulator") - discombobulatorUpgradeConfiguration.DamageLevel.Value, 0); mainScript.HitEnemy(num, (PlayerControllerB)null, false, -1); } float num2 = discombobulatorUpgradeConfiguration.InitialEffect.Value + discombobulatorUpgradeConfiguration.IncrementalEffect.Value * (float)BaseUpgrade.GetUpgradeLevel("Discombobulator"); if (SyncedEntry.op_Implicit(discombobulatorUpgradeConfiguration.Absolute)) { num2 /= mainScript.enemyType.stunTimeMultiplier; } if (!mainScript.isEnemyDead) { mainScript.SetEnemyStunned(true, num2, (PlayerControllerB)null); } } } } private bool IsEnemyBlacklisted(EnemyAI enemy) { string enemyName = enemy.enemyType.enemyName; string[] blacklistedEnemies = BaseUpgrade.GetConfiguration().DiscombobulatorUpgradeConfiguration.BlacklistEnemies.Value.Split(","); if (ContainsEnemyName(enemyName, blacklistedEnemies)) { return true; } ScanNodeProperties componentInChildren = ((Component)enemy).gameObject.GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null) { return false; } enemyName = componentInChildren.headerText; return ContainsEnemyName(enemyName, blacklistedEnemies); } private bool ContainsEnemyName(string enemyName, string[] blacklistedEnemies) { foreach (string value in blacklistedEnemies) { if (enemyName.Equals(value, StringComparison.OrdinalIgnoreCase)) { return true; } } return false; } private void PlayAudio(ref Terminal terminal) { terminal.terminalAudio.maxDistance = 100f; terminal.terminalAudio.PlayOneShot(UpgradeBus.Instance.flashNoise); ((MonoBehaviour)this).StartCoroutine(ResetRange(terminal)); } private bool CanDealDamage() { DiscombobulatorUpgradeConfiguration discombobulatorUpgradeConfiguration = BaseUpgrade.GetConfiguration().DiscombobulatorUpgradeConfiguration; return discombobulatorUpgradeConfiguration.DamageLevel.Value > 0 && BaseUpgrade.GetUpgradeLevel("Discombobulator") + 1 >= discombobulatorUpgradeConfiguration.DamageLevel.Value; } [IteratorStateMachine(typeof(d__14))] private IEnumerator ResetRange(Terminal terminal) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__14(0) { <>4__this = this, terminal = terminal }; } public string GetWorldBuildingText(bool shareStatus = false) { return string.Format("\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", shareStatus ? "your crew" : "you"); } 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, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().DiscombobulatorUpgradeConfiguration.PurchaseMode)); static float infoFunction(int level) { DiscombobulatorUpgradeConfiguration discombobulatorUpgradeConfiguration = BaseUpgrade.GetConfiguration().DiscombobulatorUpgradeConfiguration; return discombobulatorUpgradeConfiguration.InitialEffect.Value + (float)level * discombobulatorUpgradeConfiguration.IncrementalEffect.Value; } } [ServerRpc(RequireOwnership = false)] public void SetCooldownServerRpc(float cooldown) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: 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(1424881251u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref cooldown, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1424881251u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetCooldownClientRpc(cooldown); } } } [ClientRpc] public void SetCooldownClientRpc(float cooldown) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: 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.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(550063720u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref cooldown, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 550063720u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; flashCooldown = Mathf.Clamp(cooldown, 0f, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().DiscombobulatorUpgradeConfiguration.Cooldown)); } } } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Discombobulator", BaseUpgrade.GetConfiguration().DiscombobulatorUpgradeConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { UpgradeBus.Instance.flashNoise = AssetBundleHandler.GetAudioClip("Flashbang"); BaseUpgrade.SetupGenericPerk("Discombobulator"); } public new static CustomTerminalNode RegisterTerminalNode() { AudioClip audioClip = AssetBundleHandler.GetAudioClip("Flashbang"); if (!Object.op_Implicit((Object)(object)audioClip)) { return null; } UpgradeBus.Instance.flashNoise = audioClip; return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Discombobulator", BaseUpgrade.GetConfiguration().DiscombobulatorUpgradeConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3612237191u, new RpcReceiveHandler(__rpc_handler_3612237191), "UseDiscombobulatorServerRpc"); ((NetworkBehaviour)this).__registerRpc(760292881u, new RpcReceiveHandler(__rpc_handler_760292881), "UseDiscombobulatorClientRpc"); ((NetworkBehaviour)this).__registerRpc(1424881251u, new RpcReceiveHandler(__rpc_handler_1424881251), "SetCooldownServerRpc"); ((NetworkBehaviour)this).__registerRpc(550063720u, new RpcReceiveHandler(__rpc_handler_550063720), "SetCooldownClientRpc"); base.__initializeRpcs(); } 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)1; ((Discombobulator)(object)target).UseDiscombobulatorClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1424881251(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float cooldownServerRpc = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref cooldownServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Discombobulator)(object)target).SetCooldownServerRpc(cooldownServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_550063720(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float cooldownClientRpc = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref cooldownClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((Discombobulator)(object)target).SetCooldownClientRpc(cooldownClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Discombobulator"; } } internal class FusionMatter : TierUpgrade, IUpgradeWorldBuilding { public enum ItemCategories { All, Tools, Scrap } internal const string UPGRADE_NAME = "Fusion Matter"; internal const string DEFAULT_PRICES = "500, 650, 700"; internal const string WORLD_BUILDING_TEXT = "\n\nBy default, the Ship's onboard Teleporter system is configured not to bring any objects along with it... but isn't it kind of strange how you don't arrive naked anytime you use the Teleporter? As it turns out, this limitation is imposed and not inherent. By requesting & signing a handful of certain liability waivers by their technical names and paying forward a series of fees, you can expand the capabilities of your Ship's Teleporter. The Teleporter can still only safely transport Company-issued equipment, since the rough dimensions of these objects are well-documented. The same cannot be said for salvage materials.\n\n"; private static Dictionary levels; private static Dictionary categoryLevels; public override bool CanInitializeOnStart { get { string[] array = BaseUpgrade.GetConfiguration().FusionMatterConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nBy default, the Ship's onboard Teleporter system is configured not to bring any objects along with it... but isn't it kind of strange how you don't arrive naked anytime you use the Teleporter? As it turns out, this limitation is imposed and not inherent. By requesting & signing a handful of certain liability waivers by their technical names and paying forward a series of fees, you can expand the capabilities of your Ship's Teleporter. The Teleporter can still only safely transport Company-issued equipment, since the rough dimensions of these objects are well-documented. The same cannot be said for salvage materials.\n\n"; } internal static void SetupLevels() { levels = new Dictionary(); categoryLevels = new Dictionary(); string[] array = BaseUpgrade.GetConfiguration().FusionMatterConfiguration.TierCollection.Value.ToLower().Split('@'); for (int i = 0; i < array.Length; i++) { foreach (string item in from x in array[i].Split(',') select x.Trim().ToLower()) { ItemCategories result; if (levels.ContainsKey(item)) { Plugin.mls.LogWarning((object)(item + " is already registered in the tiers collection of Fusion Matter")); } else if (Enum.TryParse(item, ignoreCase: true, out result) && !categoryLevels.ContainsKey(result)) { Plugin.mls.LogInfo((object)string.Format("Registering \"{0}\" category under level {1} of {2}", item, i, "Fusion Matter")); categoryLevels[result] = i; } else { Plugin.mls.LogInfo((object)string.Format("Registering {0} item under level {1} of {2}", item, i, "Fusion Matter")); levels[item] = i; } } } } public static bool IsItemWithinCategory(GrabbableObject grabbableObject, ItemCategories category) { return category switch { ItemCategories.All => true, ItemCategories.Tools => !grabbableObject.itemProperties.isScrap, ItemCategories.Scrap => grabbableObject.itemProperties.isScrap, _ => false, }; } public static bool CanHoldItem(GrabbableObject grabbableObject, PlayerControllerB player) { if ((Object)(object)grabbableObject == (Object)null || !player.IsTeleporting() || player.isPlayerDead) { return false; } if (!BaseUpgrade.GetActiveUpgrade("Fusion Matter")) { return false; } bool flag = false; foreach (KeyValuePair categoryLevel in categoryLevels) { flag |= IsItemWithinCategory(grabbableObject, categoryLevel.Key) && BaseUpgrade.GetUpgradeLevel("Fusion Matter") >= categoryLevel.Value; } if (flag) { return flag; } string text = grabbableObject.itemProperties.itemName.Trim().ToLower(); if (levels.TryGetValue(text, out var value)) { Plugin.mls.LogDebug((object)$"{text} can be safeguarded by Fusion Matter at level {value + 1}"); return BaseUpgrade.GetUpgradeLevel("Fusion Matter") >= value; } Plugin.mls.LogDebug((object)(text + " from item properties was not found, checking other sources...")); ScanNodeProperties componentInChildren = ((Component)grabbableObject).GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null) { Plugin.mls.LogDebug((object)(text + " does not contain a scan node, ran out of sources...")); return false; } text = componentInChildren.headerText.Trim().ToLower(); if (levels.TryGetValue(text, out value)) { Plugin.mls.LogDebug((object)$"{text} can be safeguarded by Fusion Matter at level {value + 1}"); return BaseUpgrade.GetUpgradeLevel("Fusion Matter") >= value; } Plugin.mls.LogDebug((object)(text + " from scan node was not found, ran out of sources...")); return false; } private void Awake() { upgradeName = "Fusion Matter"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().FusionMatterConfiguration.OverrideName); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append(GetFusionMatterInfo(0, initialPrice)); for (int i = 0; i < maxLevels; i++) { stringBuilder.Append(GetFusionMatterInfo(i + 1, incrementalPrices[i])); } return stringBuilder.ToString(); } public static string GetFusionMatterInfo(int level, int price) { IEnumerable first = from item in levels where item.Value == level select item.Key; IEnumerable second = from category in categoryLevels where category.Value == level select category.Key.ToString(); string arg = string.Join(", ", first.Concat(second)); return $"LVL {level + 1} - {BaseUpgrade.GetUpgradePrice(price, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().FusionMatterConfiguration.PurchaseMode))} - Allows safekeeping the following items when teleporting: {arg}\n"; } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Fusion Matter", BaseUpgrade.GetConfiguration().FusionMatterConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { GameObject val = ItemManager.CreateNetworkPrefab("Fusion Matter"); val.AddComponent(); ItemManager.RegisterNetworkPrefab(val); Plugin.networkPrefabs["Fusion Matter"] = val; } public new static CustomTerminalNode RegisterTerminalNode() { SetupLevels(); return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Fusion Matter", UpgradeBus.Instance.PluginConfiguration.FusionMatterConfiguration, Plugin.networkPrefabs["Fusion Matter"]); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "FusionMatter"; } } public class LifeInsurance : TierUpgrade, IUpgradeWorldBuilding { internal const string UPGRADE_NAME = "Life Insurance"; internal const string DEFAULT_PRICES = "200,200,250,300"; internal const string WORLD_BUILDING_TEXT = "\n\nHigh-grossing departments that operate in sectors of severe risk can optimize body retrieval costs by essentially hiring the cleanup crew on a retainer. These arrangements are made Ship-to-Ship between individual Company Departments and require a lot of phonecalls and paperwork.\n\n"; public override bool CanInitializeOnStart { get { ITierEffectUpgradeConfiguration lifeInsuranceConfiguration = BaseUpgrade.GetConfiguration().LifeInsuranceConfiguration; string[] array = lifeInsuranceConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nHigh-grossing departments that operate in sectors of severe risk can optimize body retrieval costs by essentially hiring the cleanup crew on a retainer. These arrangements are made Ship-to-Ship between individual Company Departments and require a lot of phonecalls and paperwork.\n\n"; } private void Awake() { upgradeName = "Life Insurance"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().LifeInsuranceConfiguration.OverrideName); } public static float CalculateDecreaseMultiplier() { ITierEffectUpgradeConfiguration lifeInsuranceConfiguration = BaseUpgrade.GetConfiguration().LifeInsuranceConfiguration; if (!SyncedEntry.op_Implicit(lifeInsuranceConfiguration.Enabled) || !BaseUpgrade.GetActiveUpgrade("Life Insurance")) { return 0f; } return (float)(SyncedEntry.op_Implicit(lifeInsuranceConfiguration.InitialEffect) + SyncedEntry.op_Implicit(lifeInsuranceConfiguration.IncrementalEffect) * 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} - Reduces the credit loss when leaving a body behind when exiting a moon by {2}%\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().LifeInsuranceConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration lifeInsuranceConfiguration = BaseUpgrade.GetConfiguration().LifeInsuranceConfiguration; return lifeInsuranceConfiguration.InitialEffect.Value + level * lifeInsuranceConfiguration.IncrementalEffect.Value; } } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Life Insurance", BaseUpgrade.GetConfiguration().LifeInsuranceConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { GameObject val = ItemManager.CreateNetworkPrefab("Life Insurance"); val.AddComponent(); ItemManager.RegisterNetworkPrefab(val); Plugin.networkPrefabs["Life Insurance"] = val; } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Life Insurance", BaseUpgrade.GetConfiguration().LifeInsuranceConfiguration, Plugin.networkPrefabs["Life Insurance"]); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "LifeInsurance"; } } internal class MidasTouch : TierUpgrade, IUpgradeWorldBuilding { internal const string UPGRADE_NAME = "Midas Touch"; internal const string DEFAULT_PRICES = "1000,1000,1500,1800,2000"; internal const string WORLD_BUILDING_TEXT = "\n\nYour commitment to Company Standards & Values 3E-60-92-43 and adherence to Work Code & Ethics 429-A-71-36 has appeased The Company a little bit. The memories attached to objects handled by your department are among The Company's favorites to review.\n\n"; public override bool CanInitializeOnStart { get { ITierEffectUpgradeConfiguration midasTouchConfiguration = BaseUpgrade.GetConfiguration().MidasTouchConfiguration; string[] array = midasTouchConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nYour commitment to Company Standards & Values 3E-60-92-43 and adherence to Work Code & Ethics 429-A-71-36 has appeased The Company a little bit. The memories attached to objects handled by your department are among The Company's favorites to review.\n\n"; } private void Awake() { upgradeName = "Midas Touch"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().MidasTouchConfiguration.OverrideName); } private static float GetIncreasedScrapValueMultiplier() { ITierEffectUpgradeConfiguration midasTouchConfiguration = BaseUpgrade.GetConfiguration().MidasTouchConfiguration; return (float)(SyncedEntry.op_Implicit(midasTouchConfiguration.InitialEffect) + BaseUpgrade.GetUpgradeLevel("Midas Touch") * SyncedEntry.op_Implicit(midasTouchConfiguration.IncrementalEffect)) / 100f; } public static float IncreaseScrapValue(float defaultValue) { ITierEffectUpgradeConfiguration midasTouchConfiguration = BaseUpgrade.GetConfiguration().MidasTouchConfiguration; if (!SyncedEntry.op_Implicit(midasTouchConfiguration.Enabled)) { return defaultValue; } if (!BaseUpgrade.GetActiveUpgrade("Midas Touch")) { return defaultValue; } float increasedScrapValueMultiplier = GetIncreasedScrapValueMultiplier(); return Mathf.Clamp(defaultValue + defaultValue * increasedScrapValueMultiplier, defaultValue, float.MaxValue); } public static int IncreaseScrapValueInteger(int defaultValue) { ITierEffectUpgradeConfiguration midasTouchConfiguration = BaseUpgrade.GetConfiguration().MidasTouchConfiguration; if (!SyncedEntry.op_Implicit(midasTouchConfiguration.Enabled)) { return defaultValue; } if (!BaseUpgrade.GetActiveUpgrade("Midas Touch")) { return defaultValue; } float num = 1f + GetIncreasedScrapValueMultiplier(); return Mathf.Clamp(Mathf.CeilToInt((float)defaultValue * num), defaultValue, int.MaxValue); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { return Tools.GenerateInfoForUpgrade("LVL {0} - {1} - Increases the value of the scrap found in the moons by {2}%.\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().MidasTouchConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration midasTouchConfiguration = BaseUpgrade.GetConfiguration().MidasTouchConfiguration; return midasTouchConfiguration.InitialEffect.Value + level * midasTouchConfiguration.IncrementalEffect.Value; } } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Midas Touch", BaseUpgrade.GetConfiguration().MidasTouchConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { GameObject val = ItemManager.CreateNetworkPrefab("Midas Touch"); val.AddComponent(); ItemManager.RegisterNetworkPrefab(val); Plugin.networkPrefabs["Midas Touch"] = val; } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Midas Touch", BaseUpgrade.GetConfiguration().MidasTouchConfiguration, Plugin.networkPrefabs["Midas Touch"]); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "MidasTouch"; } } internal class ParticleInfuser : TierUpgrade, IUpgradeWorldBuilding { [CompilerGenerated] private sealed class <>c__DisplayClass15_0 { public ShipTeleporter teleporter; internal bool b__0() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) AnimatorStateInfo currentAnimatorStateInfo = teleporter.teleporterAnimator.GetCurrentAnimatorStateInfo(0); return ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).normalizedTime < 1f; } } [CompilerGenerated] private sealed class d__15 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ShipTeleporter teleporter; public ParticleInfuser <>4__this; private <>c__DisplayClass15_0 <>8__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__15(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass15_0(); <>8__1.teleporter = teleporter; <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = (object)new WaitWhile((Func)delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) AnimatorStateInfo currentAnimatorStateInfo = <>8__1.teleporter.teleporterAnimator.GetCurrentAnimatorStateInfo(0); return ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).normalizedTime < 1f; }); <>1__state = 2; return true; case 2: { <>1__state = -1; Animator teleporterAnimator = <>8__1.teleporter.teleporterAnimator; teleporterAnimator.speed /= IncreaseTeleportSpeed(); AudioSource shipTeleporterAudio = <>8__1.teleporter.shipTeleporterAudio; shipTeleporterAudio.pitch /= IncreaseTeleportSpeed(); return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } internal const string UPGRADE_NAME = "Particle Infuser"; internal const string DEFAULT_PRICES = "650,400,600"; internal static ParticleInfuser instance; internal const string WORLD_BUILDING_TEXT = "\n\nThe original spooling process of the Ship's onboard Teleporter is overly long for legal reasons. There are several redundant safety checks that must be completed by the Ship's computer before the Teleporter system can fire. Under duress, it's actually more important that the Teleporter operates quickly than safely. Health complications will kill your coworker in a matter of months or years, but the facility will kill them in a matter of minutes or even seconds. Any amount of timesaving matters.\n\n"; public override bool CanInitializeOnStart { get { ITierEffectUpgradeConfiguration particleInfuserConfiguration = BaseUpgrade.GetConfiguration().ParticleInfuserConfiguration; string[] array = particleInfuserConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nThe original spooling process of the Ship's onboard Teleporter is overly long for legal reasons. There are several redundant safety checks that must be completed by the Ship's computer before the Teleporter system can fire. Under duress, it's actually more important that the Teleporter operates quickly than safely. Health complications will kill your coworker in a matter of months or years, but the facility will kill them in a matter of minutes or even seconds. Any amount of timesaving matters.\n\n"; } private void Awake() { upgradeName = "Particle Infuser"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().ParticleInfuserConfiguration.OverrideName); instance = this; } public static float GetIncreasedTeleportSpeedMultiplier() { ITierEffectUpgradeConfiguration particleInfuserConfiguration = BaseUpgrade.GetConfiguration().ParticleInfuserConfiguration; return (float)(SyncedEntry.op_Implicit(particleInfuserConfiguration.InitialEffect) + BaseUpgrade.GetUpgradeLevel("Particle Infuser") * SyncedEntry.op_Implicit(particleInfuserConfiguration.IncrementalEffect)) / 100f; } public static float DecreaseTeleportTime(float defaultValue) { ITierEffectUpgradeConfiguration particleInfuserConfiguration = BaseUpgrade.GetConfiguration().ParticleInfuserConfiguration; if (!SyncedEntry.op_Implicit(particleInfuserConfiguration.Enabled)) { return defaultValue; } if (!BaseUpgrade.GetActiveUpgrade("Particle Infuser")) { return defaultValue; } float increasedTeleportSpeedMultiplier = GetIncreasedTeleportSpeedMultiplier(); return Mathf.Clamp(defaultValue - defaultValue * increasedTeleportSpeedMultiplier, 0f, defaultValue); } public static float IncreaseTeleportSpeed() { ITierEffectUpgradeConfiguration particleInfuserConfiguration = BaseUpgrade.GetConfiguration().ParticleInfuserConfiguration; if (!SyncedEntry.op_Implicit(particleInfuserConfiguration.Enabled)) { return 1f; } if (!BaseUpgrade.GetActiveUpgrade("Particle Infuser")) { return 1f; } float increasedTeleportSpeedMultiplier = GetIncreasedTeleportSpeedMultiplier(); return Mathf.Clamp(3f + increasedTeleportSpeedMultiplier, 1f, float.MaxValue); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { return Tools.GenerateInfoForUpgrade("LVL {0} - {1} - Increases the teleporter's speed by {2}%\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().ParticleInfuserConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration particleInfuserConfiguration = BaseUpgrade.GetConfiguration().ParticleInfuserConfiguration; return particleInfuserConfiguration.InitialEffect.Value + level * particleInfuserConfiguration.IncrementalEffect.Value; } } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Particle Infuser", BaseUpgrade.GetConfiguration().ParticleInfuserConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { GameObject val = ItemManager.CreateNetworkPrefab("Particle Infuser"); val.AddComponent(); ItemManager.RegisterNetworkPrefab(val); Plugin.networkPrefabs["Particle Infuser"] = val; } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Particle Infuser", BaseUpgrade.GetConfiguration().ParticleInfuserConfiguration, Plugin.networkPrefabs["Particle Infuser"]); } [IteratorStateMachine(typeof(d__15))] public IEnumerator ResetTeleporterSpeed(ShipTeleporter teleporter) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__15(0) { <>4__this = this, teleporter = teleporter }; } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "ParticleInfuser"; } } public class QuantumDisruptor : TierUpgrade, IUpgradeWorldBuilding { public enum UpgradeModes { SlowdownTime, RevertTime } public enum ResetModes { MoonLanding, MoonRerouting, NewQuota } internal const string UPGRADE_NAME = "Quantum Disruptor"; internal const string PRICES_DEFAULT = "1000,1200,1500,1800"; internal const string WORLD_BUILDING_TEXT = "\n\nSigning the Overtime Risk Waiver and paying forward a series of fees authorizes your department to override the Ship's autopilot system and stay moonside for longer.\n\n"; internal int availableUsages = -1; internal int currentUsages = 0; internal int hoursToReduce = -1; internal static QuantumDisruptor Instance { get; set; } internal static UpgradeModes CurrentMode => SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().QuantumDisruptorConfiguration.AlternativeMode); internal static ResetModes CurrentResetMode => SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().QuantumDisruptorConfiguration.ResetMode); public override bool CanInitializeOnStart { get { QuantumDisruptorUpgradeConfiguration quantumDisruptorConfiguration = BaseUpgrade.GetConfiguration().QuantumDisruptorConfiguration; string[] array = quantumDisruptorConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } private static void SetInstance(QuantumDisruptor instance) { Instance = instance; } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nSigning the Overtime Risk Waiver and paying forward a series of fees authorizes your department to override the Ship's autopilot system and stay moonside for longer.\n\n"; } private void Awake() { SetInstance(this); upgradeName = "Quantum Disruptor"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().QuantumDisruptorConfiguration.OverrideName); } 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: { QuantumDisruptorUpgradeConfiguration quantumDisruptorConfiguration = BaseUpgrade.GetConfiguration().QuantumDisruptorConfiguration; (SyncedEntry, SyncedEntry) effectPair = quantumDisruptorConfiguration.GetEffectPair(1); (SyncedEntry, SyncedEntry) effectPair2 = quantumDisruptorConfiguration.GetEffectPair(2); availableUsages += SyncedEntry.op_Implicit(effectPair.Item2); hoursToReduce += SyncedEntry.op_Implicit(effectPair2.Item2); base.Increment(); break; } } } public override void Load() { switch (CurrentMode) { case UpgradeModes.SlowdownTime: base.Load(); break; case UpgradeModes.RevertTime: { QuantumDisruptorUpgradeConfiguration quantumDisruptorConfiguration = BaseUpgrade.GetConfiguration().QuantumDisruptorConfiguration; (SyncedEntry, SyncedEntry) effectPair = quantumDisruptorConfiguration.GetEffectPair(1); (SyncedEntry, SyncedEntry) effectPair2 = quantumDisruptorConfiguration.GetEffectPair(2); availableUsages = SyncedEntry.op_Implicit(effectPair.Item1) + BaseUpgrade.GetUpgradeLevel("Quantum Disruptor") * SyncedEntry.op_Implicit(effectPair.Item2); hoursToReduce = SyncedEntry.op_Implicit(effectPair2.Item1) + BaseUpgrade.GetUpgradeLevel("Quantum Disruptor") * SyncedEntry.op_Implicit(effectPair2.Item2); base.Load(); break; } } } public static float GetGlobalSpeedMultiplier(float defaultValue) { QuantumDisruptorUpgradeConfiguration quantumDisruptorConfiguration = BaseUpgrade.GetConfiguration().QuantumDisruptorConfiguration; if (!SyncedEntry.op_Implicit(quantumDisruptorConfiguration.Enabled)) { return defaultValue; } if (!BaseUpgrade.GetActiveUpgrade("Quantum Disruptor")) { return defaultValue; } if (CurrentMode != 0) { return defaultValue; } (SyncedEntry, SyncedEntry) effectPair = quantumDisruptorConfiguration.GetEffectPair(0); float num = (float)(SyncedEntry.op_Implicit(effectPair.Item1) + BaseUpgrade.GetUpgradeLevel("Quantum Disruptor") * SyncedEntry.op_Implicit(effectPair.Item2)) / 100f; return Mathf.Clamp(defaultValue - 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} - {BaseUpgrade.GetUpgradePrice(price, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().QuantumDisruptorConfiguration.PurchaseMode))}: 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} - {BaseUpgrade.GetUpgradePrice(price, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().QuantumDisruptorConfiguration.PurchaseMode))}: 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) { QuantumDisruptorUpgradeConfiguration quantumDisruptorConfiguration2 = BaseUpgrade.GetConfiguration().QuantumDisruptorConfiguration; (SyncedEntry, SyncedEntry) effectPair2 = quantumDisruptorConfiguration2.GetEffectPair(2); return effectPair2.Item1.Value + level * effectPair2.Item2.Value; } static float infoFunctionUsages(int level) { QuantumDisruptorUpgradeConfiguration quantumDisruptorConfiguration = BaseUpgrade.GetConfiguration().QuantumDisruptorConfiguration; (SyncedEntry, SyncedEntry) effectPair = quantumDisruptorConfiguration.GetEffectPair(1); return effectPair.Item1.Value + level * effectPair.Item2.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} - Decreases the landed moon's rotation force (time passing) by {2}%\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().QuantumDisruptorConfiguration.PurchaseMode)); 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) { (SyncedEntry, SyncedEntry) effectPair = BaseUpgrade.GetConfiguration().QuantumDisruptorConfiguration.GetEffectPair(0); return effectPair.Item1.Value + level * effectPair.Item2.Value; } } 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) { QuantumDisruptorUpgradeConfiguration quantumDisruptorConfiguration = BaseUpgrade.GetConfiguration().QuantumDisruptorConfiguration; if (SyncedEntry.op_Implicit(quantumDisruptorConfiguration.Enabled) && ((NetworkBehaviour)Instance).IsHost) { Instance.TryResetValues(mode); } } [ServerRpc(RequireOwnership = false)] internal void RevertTimeServerRpc() { //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) //IL_00c1: 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(211342570u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 211342570u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RevertTimeClientRpc(); } } } [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) //IL_00c1: 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.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 == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RevertTime(); } } } internal void RevertTime() { float num = TimeOfDay.Instance.lengthOfHours * (float)hoursToReduce; TimeOfDay instance = TimeOfDay.Instance; instance.globalTime -= num; TimeOfDay instance2 = TimeOfDay.Instance; instance2.timeUntilDeadline += num; 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) //IL_00c1: 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.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 == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ResetUsageCounter(); } } } internal void ResetUsageCounter() { currentUsages = 0; } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Quantum Disruptor", BaseUpgrade.GetConfiguration().QuantumDisruptorConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Quantum Disruptor"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Quantum Disruptor", BaseUpgrade.GetConfiguration().QuantumDisruptorConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(211342570u, new RpcReceiveHandler(__rpc_handler_211342570), "RevertTimeServerRpc"); ((NetworkBehaviour)this).__registerRpc(3272842575u, new RpcReceiveHandler(__rpc_handler_3272842575), "RevertTimeClientRpc"); ((NetworkBehaviour)this).__registerRpc(2403649136u, new RpcReceiveHandler(__rpc_handler_2403649136), "ResetUsageCounterClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_211342570(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; ((QuantumDisruptor)(object)target).RevertTimeServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } 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)1; ((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)1; ((QuantumDisruptor)(object)target).ResetUsageCounterClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "QuantumDisruptor"; } } internal class ScavengerInstincts : TierUpgrade, IUpgradeWorldBuilding { internal const string UPGRADE_NAME = "Scavenger Instincts"; internal const string DEFAULT_PRICES = "800,800,1000,1200,1400"; internal const string WORLD_BUILDING_TEXT = "\n\nAfter spending a lot of time in the facility, you begin to notice certain patterns in the location of valuable objects. Your department's output increases, but the implications are disturbing.\n\n"; public override bool CanInitializeOnStart { get { ITierEffectUpgradeConfiguration scavengerInstictsConfiguration = BaseUpgrade.GetConfiguration().ScavengerInstictsConfiguration; string[] array = scavengerInstictsConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nAfter spending a lot of time in the facility, you begin to notice certain patterns in the location of valuable objects. Your department's output increases, but the implications are disturbing.\n\n"; } private void Awake() { upgradeName = "Scavenger Instincts"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().ScavengerInstictsConfiguration.OverrideName); } public static int IncreaseScrapAmount(int defaultValue) { ITierEffectUpgradeConfiguration scavengerInstictsConfiguration = BaseUpgrade.GetConfiguration().ScavengerInstictsConfiguration; if (!SyncedEntry.op_Implicit(scavengerInstictsConfiguration.Enabled)) { return defaultValue; } if (!BaseUpgrade.GetActiveUpgrade("Scavenger Instincts")) { return defaultValue; } int num = scavengerInstictsConfiguration.InitialEffect.Value + BaseUpgrade.GetUpgradeLevel("Scavenger Instincts") * scavengerInstictsConfiguration.IncrementalEffect.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} - Increases the average amount of scrap spawns by {2} additional items.\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().ScavengerInstictsConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration scavengerInstictsConfiguration = BaseUpgrade.GetConfiguration().ScavengerInstictsConfiguration; return scavengerInstictsConfiguration.InitialEffect.Value + level * scavengerInstictsConfiguration.IncrementalEffect.Value; } } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Scavenger Instincts", BaseUpgrade.GetConfiguration().ScavengerInstictsConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Scavenger Instincts"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Scavenger Instincts", BaseUpgrade.GetConfiguration().ScavengerInstictsConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } 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\nSubscription to 'Stuff Finders' magazine, which comes in three tiers; 'Basic Subscription', 'Pro Package', and 'Diamond Membership'. The magazine comes every week, but the contents of it are always the same, even the ads. Some departments use unwanted issuances of 'Stuff Finders' as toilet paper.\n\n"; public override bool CanInitializeOnStart => BaseUpgrade.GetConfiguration().BetterScannerUpgradeConfiguration.Price.Value <= 0 && BaseUpgrade.GetConfiguration().BetterScannerUpgradeConfiguration.SecondPrice.Value <= 0 && BaseUpgrade.GetConfiguration().BetterScannerUpgradeConfiguration.ThirdPrice.Value <= 0; internal override void Start() { upgradeName = "Better Scanner"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().BetterScannerUpgradeConfiguration.OverrideName); base.Start(); } public override void Load() { base.Load(); if (GoodItemScanCompat.Enabled) { BetterScannerUpgradeConfiguration betterScannerUpgradeConfiguration = BaseUpgrade.GetConfiguration().BetterScannerUpgradeConfiguration; GoodItemScanCompat.IncreaseScanDistance((int)SyncedEntry.op_Implicit(betterScannerUpgradeConfiguration.NodeRangeIncrease)); GoodItemScanCompat.IncreaseEnemyScanDistance((int)SyncedEntry.op_Implicit(betterScannerUpgradeConfiguration.NodeRangeIncrease)); int upgradeLevel = BaseUpgrade.GetUpgradeLevel("Better Scanner"); 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 AddScannerNodeToEntrance(ref EntranceTeleport entrance) { if (BaseUpgrade.GetActiveUpgrade("Better Scanner") && entrance.isEntranceToBuilding) { LguScanNodeProperties.AddGeneralScanNode(((Component)entrance).gameObject, "Entrance Point", "", -1, 0, Mathf.CeilToInt(UpgradeBus.Instance.PluginConfiguration.BetterScannerUpgradeConfiguration.OutsideNodesRangeIncrease.Value), requiresLineOfSight: false); } } public static void RemoveScannerNodeFromValve(ref SteamValveHazard steamValveHazard) { LguScanNodeProperties.RemoveScanNode(((Component)steamValveHazard).gameObject); } public static int GetAdditionalMaximumScanNodeRange(int defaultValue, ScanNodeProperties scanNode) { if (!BaseUpgrade.GetActiveUpgrade("Better Scanner")) { return defaultValue; } string text = scanNode.headerText.ToLower().Trim(); string text2 = text; float num = ((!(text2 == "main entrance") && !(text2 == "ship")) ? SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().BetterScannerUpgradeConfiguration.NodeRangeIncrease) : SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().BetterScannerUpgradeConfiguration.OutsideNodesRangeIncrease)); return Mathf.CeilToInt((float)defaultValue + num); } public static bool CanSeeScrapThroughWall(ScanNodeProperties scanNode) { return BaseUpgrade.GetActiveUpgrade("Better Scanner") && BaseUpgrade.GetUpgradeLevel("Better Scanner") == 2 && scanNode.nodeType == 2; } public static bool CanSeeEnemiesThroughWall(ScanNodeProperties scanNode) { return BaseUpgrade.GetActiveUpgrade("Better Scanner") && BaseUpgrade.GetUpgradeLevel("Better Scanner") == 2 && scanNode.nodeType == 1 && SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().BetterScannerUpgradeConfiguration.SeeEnemiesThroughWalls); } public static string GetBetterScannerInfo(int level, int price) { BetterScannerUpgradeConfiguration betterScannerUpgradeConfiguration = BaseUpgrade.GetConfiguration().BetterScannerUpgradeConfiguration; switch (level) { case 1: return string.Format(AssetBundleHandler.GetInfoFromJSON("Better Scanner1"), level, BaseUpgrade.GetUpgradePrice(price, SyncedEntry.op_Implicit(betterScannerUpgradeConfiguration.PurchaseMode)), betterScannerUpgradeConfiguration.NodeRangeIncrease.Value, betterScannerUpgradeConfiguration.OutsideNodesRangeIncrease.Value); case 2: return string.Format(AssetBundleHandler.GetInfoFromJSON("Better Scanner2"), level, BaseUpgrade.GetUpgradePrice(price, SyncedEntry.op_Implicit(betterScannerUpgradeConfiguration.PurchaseMode))); case 3: { string text = string.Format(AssetBundleHandler.GetInfoFromJSON("Better Scanner3"), level, BaseUpgrade.GetUpgradePrice(price, SyncedEntry.op_Implicit(betterScannerUpgradeConfiguration.PurchaseMode)), betterScannerUpgradeConfiguration.SeeEnemiesThroughWalls.Value ? " and enemies" : ""); return text + "hives and scrap command display the location of the most valuable hives and scrap on the map.\n"; } default: return ""; } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nSubscription to 'Stuff Finders' magazine, which comes in three tiers; 'Basic Subscription', 'Pro Package', and 'Diamond Membership'. The magazine comes every week, but the contents of it are always the same, even the ads. Some departments use unwanted issuances of 'Stuff Finders' as toilet paper.\n\n"; } 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("Better Scanner"); } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Better Scanner", BaseUpgrade.GetConfiguration().BetterScannerUpgradeConfiguration.ItemProgressionItems.Value.Split(",")); } public new static CustomTerminalNode RegisterTerminalNode() { BetterScannerUpgradeConfiguration betterScannerUpgradeConfiguration = BaseUpgrade.GetConfiguration().BetterScannerUpgradeConfiguration; PurchaseMode purchaseMode = SyncedEntry.op_Implicit(SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().AlternativeCurrencyConfiguration.EnableGlobalPurchase) ? BaseUpgrade.GetConfiguration().AlternativeCurrencyConfiguration.GlobalPurchaseMode : betterScannerUpgradeConfiguration.PurchaseMode); bool refundable = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().REFUND_UPGRADES) || SyncedEntry.op_Implicit(betterScannerUpgradeConfiguration.Refundable); float refundPercentage = (float)SyncedEntry.op_Implicit(betterScannerUpgradeConfiguration.RefundPercentage) / 100f; return UpgradeBus.Instance.SetupMultiplePurchasableTerminalNode("Better Scanner", BaseUpgrade.GetConfiguration().SHARED_UPGRADES.Value || !betterScannerUpgradeConfiguration.Individual.Value, betterScannerUpgradeConfiguration.Enabled.Value, betterScannerUpgradeConfiguration.Price.Value, new int[2] { betterScannerUpgradeConfiguration.SecondPrice.Value, betterScannerUpgradeConfiguration.ThirdPrice.Value }, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().OVERRIDE_UPGRADE_NAMES) ? SyncedEntry.op_Implicit(betterScannerUpgradeConfiguration.OverrideName) : "", CurrencyManager.Enabled, purchaseMode, refundable, refundPercentage); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "BetterScanner"; } } internal class CarbonKneejoints : TierUpgrade, IUpgradeWorldBuilding { internal const string UPGRADE_NAME = "Carbon Kneejoints"; internal const string DEFAULT_PRICES = "100,50,100,150"; internal const string WORLD_BUILDING_TEXT = "\n\nSpecial kneebrace & lower body harness system that supports your joints. Makes you feel prepared to sneak around. Also makes your butt look amazing.\n\n"; public override bool CanInitializeOnStart { get { ITierUpgradeConfiguration carbonKneejointsConfiguration = BaseUpgrade.GetConfiguration().CarbonKneejointsConfiguration; string[] array = carbonKneejointsConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } private void Awake() { upgradeName = "Carbon Kneejoints"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().CarbonKneejointsConfiguration.OverrideName); } public static float CalculateDecreaseMultiplier() { ITierEffectUpgradeConfiguration carbonKneejointsConfiguration = BaseUpgrade.GetConfiguration().CarbonKneejointsConfiguration; if (!SyncedEntry.op_Implicit(carbonKneejointsConfiguration.Enabled) || !BaseUpgrade.GetActiveUpgrade("Carbon Kneejoints")) { return 0f; } return (float)(SyncedEntry.op_Implicit(carbonKneejointsConfiguration.InitialEffect) + SyncedEntry.op_Implicit(carbonKneejointsConfiguration.IncrementalEffect) * 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("LVL {0} - {1} - Reduces the movement speed loss while crouching by {2}%\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().CarbonKneejointsConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration carbonKneejointsConfiguration = BaseUpgrade.GetConfiguration().CarbonKneejointsConfiguration; return carbonKneejointsConfiguration.InitialEffect.Value + level * carbonKneejointsConfiguration.IncrementalEffect.Value; } } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Carbon Kneejoints", BaseUpgrade.GetConfiguration().CarbonKneejointsConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { GameObject val = ItemManager.CreateNetworkPrefab("Carbon Kneejoints"); val.AddComponent(); ItemManager.RegisterNetworkPrefab(val); Plugin.networkPrefabs["Carbon Kneejoints"] = val; } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Carbon Kneejoints", BaseUpgrade.GetConfiguration().CarbonKneejointsConfiguration, Plugin.networkPrefabs["Carbon Kneejoints"]); } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nSpecial kneebrace & lower body harness system that supports your joints. Makes you feel prepared to sneak around. Also makes your butt look amazing.\n\n"; } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "CarbonKneejoints"; } } internal class DeepPockets : TierUpgrade, IUpgradeWorldBuilding { internal const string UPGRADE_NAME = "Deeper Pockets"; internal const string DEFAULT_PRICES = "500,750"; internal const string WORLD_BUILDING_TEXT = "In the 'GEAR' section of the Company Catalogue, in the middle of the second page, there is an advert for this. It's basically just a requisition of carabiners and bungee cords, but it's being marketed aggressively as a life-changing solution for hauling scrap."; public override bool CanInitializeOnStart { get { ITierUpgradeConfiguration deeperPocketsConfiguration = BaseUpgrade.GetConfiguration().DeeperPocketsConfiguration; string[] array = deeperPocketsConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "In the 'GEAR' section of the Company Catalogue, in the middle of the second page, there is an advert for this. It's basically just a requisition of carabiners and bungee cords, but it's being marketed aggressively as a life-changing solution for hauling scrap."; } internal override void Start() { upgradeName = "Deeper Pockets"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().DeeperPocketsConfiguration.OverrideName); base.Start(); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { return Tools.GenerateInfoForUpgrade("LVL {0} - {1} - Increases the two handed carry capacity of the player by {2}\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().DeeperPocketsConfiguration.PurchaseMode)); static float infoFunction(int level) { DeeperPocketsUpgradeConfiguration deeperPocketsConfiguration = BaseUpgrade.GetConfiguration().DeeperPocketsConfiguration; return deeperPocketsConfiguration.InitialEffect.Value + level * deeperPocketsConfiguration.IncrementalEffect.Value; } } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Deeper Pockets", BaseUpgrade.GetConfiguration().DeeperPocketsConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Deeper Pockets"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Deeper Pockets", BaseUpgrade.GetConfiguration().DeeperPocketsConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "DeepPockets"; } } internal class EffectiveBandaids : TierUpgrade { internal const string UPGRADE_NAME = "Effective Bandaids"; internal const string DEFAULT_PRICES = "250,300,400,550"; public override bool CanInitializeOnStart { get { ITierUpgradeConfiguration effectiveBandaidsConfiguration = BaseUpgrade.GetConfiguration().EffectiveBandaidsConfiguration; string[] array = effectiveBandaidsConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } internal override void Start() { upgradeName = "Effective Bandaids"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().EffectiveBandaidsConfiguration.OverrideName); base.Start(); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { return Tools.GenerateInfoForUpgrade("LVL {0} - {1} - Increases the amount of health regenerated by {2}\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().EffectiveBandaidsConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration effectiveBandaidsConfiguration = BaseUpgrade.GetConfiguration().EffectiveBandaidsConfiguration; return effectiveBandaidsConfiguration.InitialEffect.Value + level * effectiveBandaidsConfiguration.IncrementalEffect.Value; } } public static int GetIncreasedHealthRegenerated(int defaultValue) { ITierEffectUpgradeConfiguration effectiveBandaidsConfiguration = BaseUpgrade.GetConfiguration().EffectiveBandaidsConfiguration; if (!SyncedEntry.op_Implicit(effectiveBandaidsConfiguration.Enabled)) { return defaultValue; } if (!BaseUpgrade.GetActiveUpgrade("Effective Bandaids")) { return defaultValue; } int num = SyncedEntry.op_Implicit(effectiveBandaidsConfiguration.InitialEffect) + BaseUpgrade.GetUpgradeLevel("Effective Bandaids") * SyncedEntry.op_Implicit(effectiveBandaidsConfiguration.IncrementalEffect); return Mathf.Clamp(defaultValue + num, defaultValue, Stimpack.CheckForAdditionalHealth(100)); } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Effective Bandaids", BaseUpgrade.GetConfiguration().EffectiveBandaidsConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { GameObject val = ItemManager.CreateNetworkPrefab("Effective Bandaids"); val.AddComponent(); ItemManager.RegisterNetworkPrefab(val); Plugin.networkPrefabs["Effective Bandaids"] = val; } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Effective Bandaids", BaseUpgrade.GetConfiguration().EffectiveBandaidsConfiguration, Plugin.networkPrefabs["Effective Bandaids"]); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "EffectiveBandaids"; } } internal class HikingBoots : TierUpgrade, IUpgradeWorldBuilding { internal const string UPGRADE_NAME = "Hiking Boots"; internal const string PRICES_DEFAULT = "75,100,150,175"; internal const string WORLD_BUILDING_TEXT = "\n\nIn the 'GEAR' section of the Company Catalogue, the very last ad on the thirtieth page is for this product. It's a requisition of calf-length boots made of flexible synthetic fiber. Supports your ankles while walking on inclines, allowing your gait to adjust more effortlessly.\n\n"; public override bool CanInitializeOnStart { get { ITierUpgradeConfiguration hikingBootsConfiguration = BaseUpgrade.GetConfiguration().HikingBootsConfiguration; string[] array = hikingBootsConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nIn the 'GEAR' section of the Company Catalogue, the very last ad on the thirtieth page is for this product. It's a requisition of calf-length boots made of flexible synthetic fiber. Supports your ankles while walking on inclines, allowing your gait to adjust more effortlessly.\n\n"; } private void Awake() { upgradeName = "Hiking Boots"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().HikingBootsConfiguration.OverrideName); } private static float ComputeUphillSlopeDebuffMultiplier() { ITierEffectUpgradeConfiguration hikingBootsConfiguration = BaseUpgrade.GetConfiguration().HikingBootsConfiguration; return 1f - (float)(SyncedEntry.op_Implicit(hikingBootsConfiguration.InitialEffect) + BaseUpgrade.GetUpgradeLevel("Hiking Boots") * SyncedEntry.op_Implicit(hikingBootsConfiguration.IncrementalEffect)) / 100f; } public static float ReduceUphillSlopeDebuff(float defaultValue) { if (!SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().HikingBootsConfiguration.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} - Reduces the movement speed change when going through slopes by {2}%\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().HikingBootsConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration hikingBootsConfiguration = BaseUpgrade.GetConfiguration().HikingBootsConfiguration; return hikingBootsConfiguration.InitialEffect.Value + level * hikingBootsConfiguration.IncrementalEffect.Value; } } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Hiking Boots", BaseUpgrade.GetConfiguration().HikingBootsConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Hiking Boots"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Hiking Boots", BaseUpgrade.GetConfiguration().HikingBootsConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "HikingBoots"; } } internal class MechanicalArms : TierUpgrade, IUpgradeWorldBuilding { internal const string UPGRADE_NAME = "Mechanical Arms"; internal const string PRICES_DEFAULT = "300,400,600,800"; internal const string WORLD_BUILDING_TEXT = "\n\nYou were pricked by a weirdly sharp metal fragment in the facility one day. You fell ill and collapsed for twenty minutes and awoke feeling bizarre. Ever since then, for some reason, you've been able to grab items and open doors from further away.\n\n"; public override bool CanInitializeOnStart { get { ITierEffectUpgradeConfiguration mechanicalArmsConfiguration = BaseUpgrade.GetConfiguration().MechanicalArmsConfiguration; string[] array = mechanicalArmsConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nYou were pricked by a weirdly sharp metal fragment in the facility one day. You fell ill and collapsed for twenty minutes and awoke feeling bizarre. Ever since then, for some reason, you've been able to grab items and open doors from further away.\n\n"; } internal override void Start() { upgradeName = "Mechanical Arms"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().MechanicalArmsConfiguration.OverrideName); base.Start(); } public static float GetIncreasedGrabDistance(float defaultValue) { ITierEffectUpgradeConfiguration mechanicalArmsConfiguration = BaseUpgrade.GetConfiguration().MechanicalArmsConfiguration; if (!SyncedEntry.op_Implicit(mechanicalArmsConfiguration.Enabled)) { return defaultValue; } if (!BaseUpgrade.GetActiveUpgrade("Mechanical Arms")) { return defaultValue; } float num = SyncedEntry.op_Implicit(mechanicalArmsConfiguration.InitialEffect) + (float)BaseUpgrade.GetUpgradeLevel("Mechanical Arms") * SyncedEntry.op_Implicit(mechanicalArmsConfiguration.IncrementalEffect); 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} - Increases the player's interaction range by {2} units.\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().MechanicalArmsConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration mechanicalArmsConfiguration = BaseUpgrade.GetConfiguration().MechanicalArmsConfiguration; return mechanicalArmsConfiguration.InitialEffect.Value + (float)level * mechanicalArmsConfiguration.IncrementalEffect.Value; } } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Mechanical Arms", BaseUpgrade.GetConfiguration().MechanicalArmsConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Mechanical Arms"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Mechanical Arms", BaseUpgrade.GetConfiguration().MechanicalArmsConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "MechanicalArms"; } } internal class MedicalNanobots : TierUpgrade { internal const string UPGRADE_NAME = "Medical Nanobots"; internal const string DEFAULT_PRICES = "300,400,500,750"; public override bool CanInitializeOnStart { get { ITierUpgradeConfiguration medicalNanobotsConfiguration = BaseUpgrade.GetConfiguration().MedicalNanobotsConfiguration; string[] array = medicalNanobotsConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } internal override void Start() { upgradeName = "Medical Nanobots"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().MedicalNanobotsConfiguration.OverrideName); base.Start(); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { return Tools.GenerateInfoForUpgrade("LVL {0} - {1} - Increases the player's health regeneration cap by {2}%\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().MedicalNanobotsConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration medicalNanobotsConfiguration = BaseUpgrade.GetConfiguration().MedicalNanobotsConfiguration; return medicalNanobotsConfiguration.InitialEffect.Value + level * medicalNanobotsConfiguration.IncrementalEffect.Value; } } public static int GetIncreasedHealthRegeneration(int defaultValue) { ITierEffectUpgradeConfiguration medicalNanobotsConfiguration = BaseUpgrade.GetConfiguration().MedicalNanobotsConfiguration; if (!SyncedEntry.op_Implicit(medicalNanobotsConfiguration.Enabled)) { return defaultValue; } if (!BaseUpgrade.GetActiveUpgrade("Medical Nanobots")) { return defaultValue; } float num = (float)(SyncedEntry.op_Implicit(medicalNanobotsConfiguration.InitialEffect) + BaseUpgrade.GetUpgradeLevel("Medical Nanobots") * SyncedEntry.op_Implicit(medicalNanobotsConfiguration.IncrementalEffect)) / 100f; return Mathf.Clamp(defaultValue + (int)((float)defaultValue * num), defaultValue, Stimpack.CheckForAdditionalHealth(100)); } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Medical Nanobots", BaseUpgrade.GetConfiguration().MedicalNanobotsConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { GameObject val = ItemManager.CreateNetworkPrefab("Medical Nanobots"); val.AddComponent(); ItemManager.RegisterNetworkPrefab(val); Plugin.networkPrefabs["Medical Nanobots"] = val; } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Medical Nanobots", BaseUpgrade.GetConfiguration().MedicalNanobotsConfiguration, Plugin.networkPrefabs["Medical Nanobots"]); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "MedicalNanobots"; } } internal class NightVision : TierUpgrade, IPlayerSync, IUpgradeWorldBuilding { [CompilerGenerated] private sealed class d__24 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public NightVision <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__24(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(BaseUpgrade.GetConfiguration().NightVisionUpgradeConfiguration.ExhaustTime.Value); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.batteryExhaustion = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } 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"; internal const string WORLD_BUILDING_TEXT = "\n\nService package for your crew's Night Vision Headset that optimizes the function of its capacitor, leading to improved uptime and shorter recharge period.\n\n"; private static readonly LguLogger logger = new LguLogger("NV Headset Batteries"); public static NightVision Instance { get; internal set; } public override bool CanInitializeOnStart { get { NightVisionUpgradeConfiguration nightVisionUpgradeConfiguration = BaseUpgrade.GetConfiguration().NightVisionUpgradeConfiguration; string[] array = nightVisionUpgradeConfiguration.Prices.Value.Split(','); return nightVisionUpgradeConfiguration.ItemPrice.Value <= 0 && array.Length == 1 && (array[0].Length == 0 || array[0] == "0"); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nService package for your crew's Night Vision Headset that optimizes the function of its capacitor, leading to improved uptime and shorter recharge period.\n\n"; } private void Awake() { Instance = this; upgradeName = "NV Headset Batteries"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().NightVisionUpgradeConfiguration.OverrideName); nightVisionPrefab = AssetBundleHandler.GetItemObject("Night Vision").spawnPrefab; } internal override void Start() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) base.Start(); NightVisionUpgradeConfiguration nightVisionUpgradeConfiguration = BaseUpgrade.GetConfiguration().NightVisionUpgradeConfiguration; ((Graphic)((Component)((Component)this).transform.GetChild(0).GetChild(0)).GetComponent()).color = Tools.ConvertValueToColor(nightVisionUpgradeConfiguration.BarColour.LocalValue, Color.green); ((Graphic)((Component)((Component)this).transform.GetChild(0).GetChild(1)).GetComponent()).color = Tools.ConvertValueToColor(nightVisionUpgradeConfiguration.TextColour.LocalValue, Color.white); ((Graphic)((Component)((Component)this).transform.GetChild(0).GetChild(2)).GetComponent()).color = Tools.ConvertValueToColor(nightVisionUpgradeConfiguration.BarColour.LocalValue, Color.green); ((Component)((Component)this).transform.GetChild(0)).gameObject.SetActive(false); } private void LateUpdate() { //IL_0201: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)client == (Object)null) { return; } NightVisionUpgradeConfiguration nightVisionUpgradeConfiguration = BaseUpgrade.GetConfiguration().NightVisionUpgradeConfiguration; float num = nightVisionUpgradeConfiguration.InitialEffects[0].Value + (float)(BaseUpgrade.GetUpgradeLevel("NV Headset Batteries") + 1) * nightVisionUpgradeConfiguration.IncrementalEffects[0].Value; if (nightVisionActive) { nightBattery -= Time.deltaTime * (nightVisionUpgradeConfiguration.InitialEffects[2].Value - (float)(BaseUpgrade.GetUpgradeLevel("NV Headset Batteries") + 1) * nightVisionUpgradeConfiguration.IncrementalEffects[2].Value); nightBattery = Mathf.Clamp(nightBattery, 0f, num); ((Component)((Component)this).transform.GetChild(0)).gameObject.SetActive(true); if (nightBattery <= 0f) { TurnOff(exhaust: true); } } else if (!batteryExhaustion) { nightBattery += Time.deltaTime * (nightVisionUpgradeConfiguration.InitialEffects[1].Value + (float)(BaseUpgrade.GetUpgradeLevel("NV Headset Batteries") + 1) * nightVisionUpgradeConfiguration.IncrementalEffects[1].Value); nightBattery = Mathf.Clamp(nightBattery, 0f, num); if (nightBattery >= num) { ((Component)((Component)this).transform.GetChild(0)).gameObject.SetActive(false); } else { ((Component)((Component)this).transform.GetChild(0)).gameObject.SetActive(true); } } ((Behaviour)client.nightVision).enabled = client.isInsideFactory || nightVisionActive; float num2 = nightBattery / num; ((Component)this).transform.GetChild(0).GetChild(0).localScale = new Vector3(num2, 1f, 1f); } public void Toggle() { if (BaseUpgrade.GetActiveUpgrade("Night Vision") && !UpgradeBus.Instance.GetLocalPlayer().inTerminalMenu) { nightVisionActive = !nightVisionActive; if ((Object)(object)client == (Object)null) { client = GameNetworkManager.Instance.localPlayerController; } if (nightVisionActive) { TurnOn(); } else { TurnOff(); } } } private void TurnOff(bool exhaust = false) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) nightVisionActive = false; client.nightVision.color = nightVisColor; client.nightVision.range = nightVisRange; client.nightVision.intensity = nightVisIntensity; if (exhaust) { batteryExhaustion = true; ((MonoBehaviour)this).StartCoroutine(BatteryRecovery()); } } private void TurnOn() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) nightVisColor = client.nightVision.color; nightVisRange = client.nightVision.range; nightVisIntensity = client.nightVision.intensity; NightVisionUpgradeConfiguration nightVisionUpgradeConfiguration = BaseUpgrade.GetConfiguration().NightVisionUpgradeConfiguration; client.nightVision.color = Tools.ConvertValueToColor(nightVisionUpgradeConfiguration.LightColour.LocalValue, Color.green); client.nightVision.range = nightVisionUpgradeConfiguration.InitialEffects[3].Value + (float)BaseUpgrade.GetUpgradeLevel("NV Headset Batteries") * nightVisionUpgradeConfiguration.IncrementalEffects[3].Value; client.nightVision.intensity = nightVisionUpgradeConfiguration.InitialEffects[4].Value + (float)BaseUpgrade.GetUpgradeLevel("NV Headset Batteries") * nightVisionUpgradeConfiguration.IncrementalEffects[4].Value; nightBattery -= nightVisionUpgradeConfiguration.StartupPercentage.Value; } [IteratorStateMachine(typeof(d__24))] private IEnumerator BatteryRecovery() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__24(0) { <>4__this = this }; } public override void Load() { base.Load(); if (BaseUpgrade.GetActiveUpgrade("Night Vision")) { EnableOnClient(); } } public override void Unwind() { base.Unwind(); if (BaseUpgrade.GetActiveUpgrade("Night Vision")) { DisableOnClient(); } } [ServerRpc(RequireOwnership = false)] public void EnableNightVisionServerRpc() { //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) //IL_00c1: 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(369455900u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 369455900u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; logger.LogDebug("Enabling night vision for all clients..."); EnableNightVisionClientRpc(); } } } [ClientRpc] private void EnableNightVisionClientRpc() { //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) //IL_00c1: 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.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2005067157u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2005067157u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; logger.LogDebug("Request to enable night vision on this client received."); EnableOnClient(); } } } [ServerRpc(RequireOwnership = false)] public void SpawnNightVisionItemOnDeathServerRpc(Vector3 position) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: 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(1636884937u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1636884937u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; GameObject val3 = Object.Instantiate(nightVisionPrefab, position + Vector3.up, Quaternion.identity); val3.GetComponent().Spawn(false); logger.LogInfo("Request to spawn night vision goggles received."); } } } public void EnableOnClient() { if ((Object)(object)client == (Object)null) { client = GameNetworkManager.Instance.localPlayerController; } ((Component)((Component)this).transform.GetChild(0)).gameObject.SetActive(true); UpgradeBus.Instance.activeUpgrades["Night Vision"] = true; TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\nPress " + InputActionRebindingExtensions.GetBindingDisplayString(Keybinds.NvgAction, (DisplayStringOptions)0, (string)null) + " to toggle Night Vision!!!"; } public void DisableOnClient() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) nightVisionActive = false; if ((Object)(object)client != (Object)null && (Object)(object)client.nightVision != (Object)null) { client.nightVision.color = nightVisColor; client.nightVision.range = nightVisRange; client.nightVision.intensity = nightVisIntensity; } ((Component)((Component)this).transform.GetChild(0)).gameObject.SetActive(false); UpgradeBus.Instance.activeUpgrades["Night Vision"] = false; client = null; } public static string GetNightVisionInfo(int level, int price) { NightVisionUpgradeConfiguration nightVisionUpgradeConfiguration = BaseUpgrade.GetConfiguration().NightVisionUpgradeConfiguration; float num = Mathf.Clamp(nightVisionUpgradeConfiguration.InitialEffects[1].Value + nightVisionUpgradeConfiguration.IncrementalEffects[1].Value * (float)level, 0f, 1000f); float num2 = Mathf.Clamp(nightVisionUpgradeConfiguration.InitialEffects[2].Value - nightVisionUpgradeConfiguration.IncrementalEffects[2].Value * (float)level, 0f, 1000f); float num3 = nightVisionUpgradeConfiguration.InitialEffects[0].Value + nightVisionUpgradeConfiguration.IncrementalEffects[0].Value * (float)level; string text = "infinite"; if (num2 != 0f) { text = ((num3 - num3 * nightVisionUpgradeConfiguration.StartupPercentage.Value) / num2).ToString("F2"); } string text2 = "infinite"; if (num != 0f) { text2 = (num3 / num).ToString("F2"); } return string.Format(AssetBundleHandler.GetInfoFromJSON("NV Headset Batteries"), level, BaseUpgrade.GetUpgradePrice(price, SyncedEntry.op_Implicit(nightVisionUpgradeConfiguration.PurchaseMode)), text, text2); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { StringBuilder stringBuilder = new StringBuilder(); NightVisionUpgradeConfiguration nightVisionUpgradeConfiguration = BaseUpgrade.GetConfiguration().NightVisionUpgradeConfiguration; float num = (nightVisionUpgradeConfiguration.InitialEffects[0].Value - nightVisionUpgradeConfiguration.IncrementalEffects[0].Value * nightVisionUpgradeConfiguration.StartupPercentage.Value) / nightVisionUpgradeConfiguration.InitialEffects[2].Value; float num2 = nightVisionUpgradeConfiguration.InitialEffects[0].Value / nightVisionUpgradeConfiguration.InitialEffects[1].Value; stringBuilder.Append($"The affected item (Night vision Googles) has a base drain time to empty of {num} seconds and regeneration time to full of {num2} seconds.\n\n"); stringBuilder.Append(GetNightVisionInfo(1, initialPrice)); for (int i = 0; i < maxLevels; i++) { stringBuilder.Append(GetNightVisionInfo(i + 2, incrementalPrices[i])); } return stringBuilder.ToString(); } public new static (string, string[]) RegisterScrapToUpgrade() { return ("NV Headset Batteries", BaseUpgrade.GetConfiguration().NightVisionUpgradeConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("NV Headset Batteries"); } public new static CustomTerminalNode RegisterTerminalNode() { NightVisionUpgradeConfiguration nightVisionUpgradeConfiguration = BaseUpgrade.GetConfiguration().NightVisionUpgradeConfiguration; return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("NV Headset Batteries", nightVisionUpgradeConfiguration); } public void ResetPlayerAttribute() { if (!((Object)(object)client == (Object)null)) { DisableOnClient(); } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(369455900u, new RpcReceiveHandler(__rpc_handler_369455900), "EnableNightVisionServerRpc"); ((NetworkBehaviour)this).__registerRpc(2005067157u, new RpcReceiveHandler(__rpc_handler_2005067157), "EnableNightVisionClientRpc"); ((NetworkBehaviour)this).__registerRpc(1636884937u, new RpcReceiveHandler(__rpc_handler_1636884937), "SpawnNightVisionItemOnDeathServerRpc"); base.__initializeRpcs(); } private static void __rpc_handler_369455900(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; ((NightVision)(object)target).EnableNightVisionServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2005067157(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; ((NightVision)(object)target).EnableNightVisionClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1636884937(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); target.__rpc_exec_stage = (__RpcExecStage)1; ((NightVision)(object)target).SpawnNightVisionItemOnDeathServerRpc(position); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "NightVision"; } } public class OxygenCanisters : TierUpgrade, IUpgradeWorldBuilding { internal const string UPGRADE_NAME = "Oxygen Canisters"; internal const string DEFAULT_PRICES = "100,100,200,400"; internal const string WORLD_BUILDING_TEXT = "\n\nPremium Condensed Air Tanks from OxyCo that come in a variety of flavors.\n\n"; public override bool CanInitializeOnStart { get { ITierEffectUpgradeConfiguration oxygenCanistersConfiguration = BaseUpgrade.GetConfiguration().OxygenCanistersConfiguration; string[] array = oxygenCanistersConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nPremium Condensed Air Tanks from OxyCo that come in a variety of flavors.\n\n"; } private void Awake() { upgradeName = "Oxygen Canisters"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().OxygenCanistersConfiguration.OverrideName); } public static float CalculateDecreaseMultiplier() { ITierEffectUpgradeConfiguration oxygenCanistersConfiguration = BaseUpgrade.GetConfiguration().OxygenCanistersConfiguration; if (!SyncedEntry.op_Implicit(oxygenCanistersConfiguration.Enabled) || !BaseUpgrade.GetActiveUpgrade("Oxygen Canisters")) { return 0f; } return (float)(SyncedEntry.op_Implicit(oxygenCanistersConfiguration.InitialEffect) + SyncedEntry.op_Implicit(oxygenCanistersConfiguration.IncrementalEffect) * BaseUpgrade.GetUpgradeLevel("Oxygen Canisters")) / 100f; } public static float ReduceOxygenConsumption(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} - Reduces oxygen consumption rate by {2}%\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().OxygenCanistersConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration oxygenCanistersConfiguration = BaseUpgrade.GetConfiguration().OxygenCanistersConfiguration; return oxygenCanistersConfiguration.InitialEffect.Value + level * oxygenCanistersConfiguration.IncrementalEffect.Value; } } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Oxygen Canisters", BaseUpgrade.GetConfiguration().OxygenCanistersConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { GameObject val = ItemManager.CreateNetworkPrefab("Oxygen Canisters"); val.AddComponent(); ItemManager.RegisterNetworkPrefab(val); Plugin.networkPrefabs["Oxygen Canisters"] = val; } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Oxygen Canisters", BaseUpgrade.GetConfiguration().OxygenCanistersConfiguration, Plugin.networkPrefabs["Oxygen Canisters"]); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "OxygenCanisters"; } } internal class QuickHands : TierUpgrade, IUpgradeWorldBuilding { internal const string UPGRADE_NAME = "Quick Hands"; internal const string DEFAULT_PRICES = "100,100,150,200,250"; internal const string WORLD_BUILDING_TEXT = "\n\nThe 'Intern Tremble' is a known reoccuring phenomena among contractors in this field. Employees get nervous while exploring the Ruins and it manifests as a constant shaking in the wrists. In the back of a magazine you found an advert for 'Stress Management Lozenges' and decided to take it up. Your wrists don't shake anymore.\n\n"; public override bool CanInitializeOnStart { get { ITierEffectUpgradeConfiguration quickHandsConfiguration = BaseUpgrade.GetConfiguration().QuickHandsConfiguration; string[] array = quickHandsConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nThe 'Intern Tremble' is a known reoccuring phenomena among contractors in this field. Employees get nervous while exploring the Ruins and it manifests as a constant shaking in the wrists. In the back of a magazine you found an advert for 'Stress Management Lozenges' and decided to take it up. Your wrists don't shake anymore.\n\n"; } private void Awake() { upgradeName = "Quick Hands"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().QuickHandsConfiguration.OverrideName); } public static float GetIncreasedInteractionSpeedMultiplier() { ITierEffectUpgradeConfiguration quickHandsConfiguration = BaseUpgrade.GetConfiguration().QuickHandsConfiguration; return (float)(SyncedEntry.op_Implicit(quickHandsConfiguration.InitialEffect) + BaseUpgrade.GetUpgradeLevel("Quick Hands") * SyncedEntry.op_Implicit(quickHandsConfiguration.IncrementalEffect)) / 100f; } public static float IncreaseInteractionSpeed(float defaultValue) { if (!SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().QuickHandsConfiguration.Enabled)) { return defaultValue; } if (!BaseUpgrade.GetActiveUpgrade("Quick Hands")) { return defaultValue; } float increasedInteractionSpeedMultiplier = GetIncreasedInteractionSpeedMultiplier(); return (int)Mathf.Clamp(defaultValue + defaultValue * increasedInteractionSpeedMultiplier, defaultValue, float.MaxValue); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { return Tools.GenerateInfoForUpgrade("LVL {0} - {1} - Increases interaction speed of the player by {2}%\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().QuickHandsConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration quickHandsConfiguration = BaseUpgrade.GetConfiguration().QuickHandsConfiguration; return quickHandsConfiguration.InitialEffect.Value + level * quickHandsConfiguration.IncrementalEffect.Value; } } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Quick Hands", BaseUpgrade.GetConfiguration().QuickHandsConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { GameObject val = ItemManager.CreateNetworkPrefab("Quick Hands"); val.AddComponent(); ItemManager.RegisterNetworkPrefab(val); Plugin.networkPrefabs["Quick Hands"] = val; } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Quick Hands", BaseUpgrade.GetConfiguration().QuickHandsConfiguration, Plugin.networkPrefabs["Quick Hands"]); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "QuickHands"; } } internal class ReinforcedBoots : TierUpgrade, IUpgradeWorldBuilding { internal const string UPGRADE_NAME = "Reinforced Boots"; internal const string DEFAULT_PRICES = "250,200,300,400,500"; internal const string WORLD_BUILDING_TEXT = "\n\nIn the 'GEAR' section of the Company Catalogue, the third ad on the first page is for this product. They're Premium High-Impact Shock Absorbent Heel & Toe Pads for your crew's boots. The rhetoric of the advertisement promised a 19% increase in your departent's overall safety when traversing outdoors.\n\n"; public override bool CanInitializeOnStart { get { ITierUpgradeConfiguration reinforcedBootsConfiguration = BaseUpgrade.GetConfiguration().ReinforcedBootsConfiguration; string[] array = reinforcedBootsConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nIn the 'GEAR' section of the Company Catalogue, the third ad on the first page is for this product. They're Premium High-Impact Shock Absorbent Heel & Toe Pads for your crew's boots. The rhetoric of the advertisement promised a 19% increase in your departent's overall safety when traversing outdoors.\n\n"; } private void Awake() { upgradeName = "Reinforced Boots"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().ReinforcedBootsConfiguration.OverrideName); } public static int ReduceFallDamage(int defaultValue) { ITierEffectUpgradeConfiguration reinforcedBootsConfiguration = BaseUpgrade.GetConfiguration().ReinforcedBootsConfiguration; if (!SyncedEntry.op_Implicit(reinforcedBootsConfiguration.Enabled)) { return defaultValue; } if (!BaseUpgrade.GetActiveUpgrade("Reinforced Boots")) { return defaultValue; } float num = 1f - (float)(SyncedEntry.op_Implicit(reinforcedBootsConfiguration.InitialEffect) + BaseUpgrade.GetUpgradeLevel("Reinforced Boots") * SyncedEntry.op_Implicit(reinforcedBootsConfiguration.IncrementalEffect)) / 100f; return (int)Mathf.Clamp((float)defaultValue * num, 0f, (float)defaultValue); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { return Tools.GenerateInfoForUpgrade("LVL {0} - {1} - Reduces fall damage by {2}%\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().ReinforcedBootsConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration reinforcedBootsConfiguration = BaseUpgrade.GetConfiguration().ReinforcedBootsConfiguration; return reinforcedBootsConfiguration.InitialEffect.Value + level * reinforcedBootsConfiguration.IncrementalEffect.Value; } } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Reinforced Boots", BaseUpgrade.GetConfiguration().ReinforcedBootsConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Reinforced Boots"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Reinforced Boots", BaseUpgrade.GetConfiguration().ReinforcedBootsConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "ReinforcedBoots"; } } public class RubberBoots : TierUpgrade, IUpgradeWorldBuilding { internal const string UPGRADE_NAME = "Rubber Boots"; internal const string DEFAULT_PRICES = "50,50,100,200"; internal const string WORLD_BUILDING_TEXT = "\n\nIn the 'GEAR' section of the Company Catalogue, the twelfth ad on the fourth page is for this product. It's a knee-high boot of rubbery synthetic material that fits over your standard footwear. The boots are flexible enough to be folded for compact storage in a pouch or hip bag.\n\n"; public override bool CanInitializeOnStart { get { ITierEffectUpgradeConfiguration rubberBootsConfiguration = BaseUpgrade.GetConfiguration().RubberBootsConfiguration; string[] array = rubberBootsConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nIn the 'GEAR' section of the Company Catalogue, the twelfth ad on the fourth page is for this product. It's a knee-high boot of rubbery synthetic material that fits over your standard footwear. The boots are flexible enough to be folded for compact storage in a pouch or hip bag.\n\n"; } private void Awake() { upgradeName = "Rubber Boots"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().RubberBootsConfiguration.OverrideName); } public static float CalculateDecreaseMultiplier() { ITierEffectUpgradeConfiguration rubberBootsConfiguration = BaseUpgrade.GetConfiguration().RubberBootsConfiguration; if (!SyncedEntry.op_Implicit(rubberBootsConfiguration.Enabled) || !BaseUpgrade.GetActiveUpgrade("Rubber Boots")) { return 0f; } return (float)(SyncedEntry.op_Implicit(rubberBootsConfiguration.InitialEffect) + SyncedEntry.op_Implicit(rubberBootsConfiguration.IncrementalEffect) * BaseUpgrade.GetUpgradeLevel("Rubber Boots")) / 100f; } public static int ClearMovementHinderance(int defaultValue) { if (CalculateDecreaseMultiplier() >= 1f) { return 0; } return defaultValue; } public static float ReduceMovementHinderance(float defaultValue) { float num = CalculateDecreaseMultiplier(); return Mathf.Clamp(Mathf.Clamp(1f - num, 0f, 1f) * defaultValue, 1f, 100f); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { return Tools.GenerateInfoForUpgrade("LVL {0} - {1} - Reduces the movement debuff when walking on water surfaces by {2}%\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().RubberBootsConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration rubberBootsConfiguration = BaseUpgrade.GetConfiguration().RubberBootsConfiguration; return rubberBootsConfiguration.InitialEffect.Value + level * rubberBootsConfiguration.IncrementalEffect.Value; } } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Rubber Boots", BaseUpgrade.GetConfiguration().RubberBootsConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { GameObject val = ItemManager.CreateNetworkPrefab("Rubber Boots"); val.AddComponent(); ItemManager.RegisterNetworkPrefab(val); Plugin.networkPrefabs["Rubber Boots"] = val; } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Rubber Boots", BaseUpgrade.GetConfiguration().RubberBootsConfiguration, Plugin.networkPrefabs["Rubber Boots"]); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "RubberBoots"; } } internal class RunningShoes : TierUpgrade, IUpgradeWorldBuilding { public const string UPGRADE_NAME = "Running Shoes"; public const string PRICES_DEFAULT = "650,500,750,1000"; internal const string WORLD_BUILDING_TEXT = "\n\nA new pair of boots {0} a whole new lease on life. In this instance, it might also result in fewer wet sock incidents and consequent trenchfoot. After all, who knows how many people have walked in {1} shoes?\n\n"; public override bool CanInitializeOnStart { get { ITierMultipleEffectUpgradeConfiguration runningShoesConfiguration = BaseUpgrade.GetConfiguration().RunningShoesConfiguration; string[] array = runningShoesConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } private void Awake() { upgradeName = "Running Shoes"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().RunningShoesConfiguration.OverrideName); } public static float ApplyPossibleReducedNoiseRange(float defaultValue) { ITierMultipleEffectUpgradeConfiguration runningShoesConfiguration = BaseUpgrade.GetConfiguration().RunningShoesConfiguration; if (!SyncedEntry.op_Implicit(runningShoesConfiguration.Enabled) || !BaseUpgrade.GetActiveUpgrade("Running Shoes") || BaseUpgrade.GetUpgradeLevel("Running Shoes") != runningShoesConfiguration.Prices.Value.Split(',').Length) { return defaultValue; } return Mathf.Clamp(defaultValue - runningShoesConfiguration.GetEffectPair(1).Item1.Value, 0f, defaultValue); } public string GetWorldBuildingText(bool shareStatus = false) { return string.Format("\n\nA new pair of boots {0} a whole new lease on life. In this instance, it might also result in fewer wet sock incidents and consequent trenchfoot. After all, who knows how many people have walked in {1} shoes?\n\n", shareStatus ? "could give your crew" : "can give you", shareStatus ? "y'all's" : "your"); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { string infoFromJSON = AssetBundleHandler.GetInfoFromJSON("Running Shoes"); return Tools.GenerateInfoForUpgrade(infoFromJSON, initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().RunningShoesConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierMultipleEffectUpgradeConfiguration runningShoesConfiguration = BaseUpgrade.GetConfiguration().RunningShoesConfiguration; (SyncedEntry, SyncedEntry) effectPair = runningShoesConfiguration.GetEffectPair(0); return effectPair.Item1.Value + (float)level * effectPair.Item2.Value; } } public static float GetAdditionalMovementSpeed(float defaultValue) { ITierMultipleEffectUpgradeConfiguration runningShoesConfiguration = BaseUpgrade.GetConfiguration().RunningShoesConfiguration; if (!SyncedEntry.op_Implicit(runningShoesConfiguration.Enabled)) { return defaultValue; } if (!BaseUpgrade.GetActiveUpgrade("Running Shoes")) { return defaultValue; } (SyncedEntry, SyncedEntry) effectPair = runningShoesConfiguration.GetEffectPair(0); float num = SyncedEntry.op_Implicit(effectPair.Item1) + (float)BaseUpgrade.GetUpgradeLevel("Running Shoes") * SyncedEntry.op_Implicit(effectPair.Item2); return Mathf.Clamp(defaultValue + num, defaultValue, float.MaxValue); } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Running Shoes", BaseUpgrade.GetConfiguration().RunningShoesConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Running Shoes"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Running Shoes", BaseUpgrade.GetConfiguration().RunningShoesConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "RunningShoes"; } } internal class StrongLegs : TierUpgrade, IUpgradeWorldBuilding { public const string UPGRADE_NAME = "Strong Legs"; public const string PRICES_DEFAULT = "300,150,190,250"; internal const string WORLD_BUILDING_TEXT = "\n\nOne-time issuance of {0}. Comes with a vague list of opt-in maintenance procedures offered by The Company, which includes such gems as 'actuation optimization', 'weight & balance personalization', and similar nigh-meaningless corpo-tech jargon. All of it is expensive.\n\n"; public override bool CanInitializeOnStart { get { ITierEffectUpgradeConfiguration strongLegsConfiguration = BaseUpgrade.GetConfiguration().StrongLegsConfiguration; string[] array = strongLegsConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } private void Awake() { upgradeName = "Strong Legs"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().StrongLegsConfiguration.OverrideName); } public string GetWorldBuildingText(bool shareStatus = false) { return string.Format("\n\nOne-time issuance of {0}. Comes with a vague list of opt-in maintenance procedures offered by The Company, which includes such gems as 'actuation optimization', 'weight & balance personalization', and similar nigh-meaningless corpo-tech jargon. All of it is expensive.\n\n", shareStatus ? "proprietary pressure-assisted kneebraces to your crew" : "a proprietary pressure-assisted kneebrace"); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { string infoFromJSON = AssetBundleHandler.GetInfoFromJSON("Strong Legs"); return Tools.GenerateInfoForUpgrade(infoFromJSON, initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().StrongLegsConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration strongLegsConfiguration = BaseUpgrade.GetConfiguration().StrongLegsConfiguration; return strongLegsConfiguration.InitialEffect.Value + (float)level * strongLegsConfiguration.IncrementalEffect.Value; } } public static float GetAdditionalJumpForce(float defaultValue) { ITierEffectUpgradeConfiguration strongLegsConfiguration = BaseUpgrade.GetConfiguration().StrongLegsConfiguration; if (!SyncedEntry.op_Implicit(strongLegsConfiguration.Enabled)) { return defaultValue; } if (!BaseUpgrade.GetActiveUpgrade("Strong Legs")) { return defaultValue; } float num = SyncedEntry.op_Implicit(strongLegsConfiguration.InitialEffect) + (float)BaseUpgrade.GetUpgradeLevel("Strong Legs") * SyncedEntry.op_Implicit(strongLegsConfiguration.IncrementalEffect); return Mathf.Clamp(defaultValue + num, defaultValue, float.MaxValue); } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Strong Legs", BaseUpgrade.GetConfiguration().StrongLegsConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Strong Legs"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Strong Legs", BaseUpgrade.GetConfiguration().StrongLegsConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "StrongLegs"; } } internal class TractionBoots : TierUpgrade, IUpgradeWorldBuilding { internal const string UPGRADE_NAME = "Traction Boots"; internal const string PRICES_DEFAULT = "100,100,150,250"; internal const string WORLD_BUILDING_TEXT = "\n\nIn the 'GEAR' section of the Company Catalogue, the first ad on the first page is for these. They're magnetic cleats that hook onto the Proprietary Steel Toe & Heel Reinforcements on your boots. These things have been known to hook into grated metal flooring and come off without the wearer's notice, so be careful.\n\n"; public override bool CanInitializeOnStart { get { ITierEffectUpgradeConfiguration tractionBootsConfiguration = BaseUpgrade.GetConfiguration().TractionBootsConfiguration; string[] array = tractionBootsConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nIn the 'GEAR' section of the Company Catalogue, the first ad on the first page is for these. They're magnetic cleats that hook onto the Proprietary Steel Toe & Heel Reinforcements on your boots. These things have been known to hook into grated metal flooring and come off without the wearer's notice, so be careful.\n\n"; } internal override void Start() { upgradeName = "Traction Boots"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().TractionBootsConfiguration.OverrideName); base.Start(); } public static float ComputeAdditionalTractionForce() { ITierEffectUpgradeConfiguration tractionBootsConfiguration = BaseUpgrade.GetConfiguration().TractionBootsConfiguration; return 1f + (float)(SyncedEntry.op_Implicit(tractionBootsConfiguration.InitialEffect) + BaseUpgrade.GetUpgradeLevel("Traction Boots") * SyncedEntry.op_Implicit(tractionBootsConfiguration.IncrementalEffect)) / 100f; } public static float GetAdditionalTractionForce(float defaultValue) { if (!SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().TractionBootsConfiguration.Enabled)) { return defaultValue; } if (!BaseUpgrade.GetActiveUpgrade("Traction Boots")) { return defaultValue; } float num = ComputeAdditionalTractionForce(); return Mathf.Clamp(num * defaultValue, defaultValue, float.MaxValue); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { return Tools.GenerateInfoForUpgrade("LVL {0} - {1} - Increases the player's traction to the ground by {2}%\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().TractionBootsConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration tractionBootsConfiguration = BaseUpgrade.GetConfiguration().TractionBootsConfiguration; return tractionBootsConfiguration.InitialEffect.Value + level * tractionBootsConfiguration.IncrementalEffect.Value; } } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Traction Boots", BaseUpgrade.GetConfiguration().TractionBootsConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Traction Boots"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Traction Boots", BaseUpgrade.GetConfiguration().TractionBootsConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "TractionBoots"; } } } namespace MoreShipUpgrades.UpgradeComponents.TierUpgrades.AttributeUpgrades { public class BackMuscles : TierUpgrade, IUpgradeWorldBuilding { public enum UpgradeMode { ReduceWeight, ReduceCarryInfluence, ReduceCarryStrain } internal float alteredWeight = 1f; internal static BackMuscles Instance; public const string UPGRADE_NAME = "Back Muscles"; public const string PRICES_DEFAULT = "715,600,700,800"; internal const string WORLD_BUILDING_TEXT = "\n\nCompany-issued hydraulic girdles which are only awarded to high-performing {0} who can afford to opt in. Highly valued by all employees of The Company for their combination of miraculous health-preserving benefits and artificial, intentionally-implemented scarcity. Sardonically called the 'Back Muscles Upgrade' by some. Comes with a user manual, which mostly contains minimalistic ads for girdle maintenance contractors. Most of the phone numbers don't work anymore.\n\n"; public static UpgradeMode CurrentUpgradeMode => SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().BackMusclesConfiguration.AlternativeMode); public override bool CanInitializeOnStart { get { ITierAlternativeEffectUpgradeConfiguration backMusclesConfiguration = BaseUpgrade.GetConfiguration().BackMusclesConfiguration; string[] array = backMusclesConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } private void Awake() { upgradeName = "Back Muscles"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().BackMusclesConfiguration.OverrideName); Instance = this; } public override void Increment() { base.Increment(); UpdatePlayerWeight(); } public override void Load() { base.Load(); UpdatePlayerWeight(); } public override void Unwind() { base.Unwind(); UpdatePlayerWeight(); } public static float DecreaseStrain(float defaultWeight) { return DecreaseValue(defaultWeight, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().BackMusclesConfiguration.Enabled), UpgradeMode.ReduceCarryStrain, 1f); } public static float DecreaseCarryLoss(float defaultWeight) { return DecreaseValue(defaultWeight, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().BackMusclesConfiguration.Enabled), UpgradeMode.ReduceCarryInfluence, 1f); } public static float DecreasePossibleWeight(float defaultWeight) { return DecreaseValue(defaultWeight, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().BackMusclesConfiguration.Enabled), UpgradeMode.ReduceWeight, 0f); } public static float DecreaseValue(float defaultWeight, bool enabled, UpgradeMode intendedMode, float lowerBound) { if (!enabled) { return defaultWeight; } if (CurrentUpgradeMode != intendedMode) { return defaultWeight; } if (!BaseUpgrade.GetActiveUpgrade("Back Muscles")) { return defaultWeight; } ITierAlternativeEffectUpgradeConfiguration backMusclesConfiguration = BaseUpgrade.GetConfiguration().BackMusclesConfiguration; return Mathf.Max(defaultWeight * (backMusclesConfiguration.InitialEffect.Value - (float)BaseUpgrade.GetUpgradeLevel("Back Muscles") * backMusclesConfiguration.IncrementalEffect.Value), lowerBound); } public static void UpdatePlayerWeight() { if (CurrentUpgradeMode != 0) { return; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (localPlayerController.ItemSlots.Length == 0) { return; } Instance.alteredWeight = 1f; for (int i = 0; i < localPlayerController.ItemSlots.Length; i++) { GrabbableObject val = localPlayerController.ItemSlots[i]; if (!((Object)(object)val == (Object)null)) { Instance.alteredWeight += Mathf.Clamp(DecreasePossibleWeight(val.itemProperties.weight - 1f), 0f, 10f); } } localPlayerController.carryWeight = Instance.alteredWeight; if (localPlayerController.carryWeight < 1f) { localPlayerController.carryWeight = 1f; } } public string GetWorldBuildingText(bool shareStatus = false) { return string.Format("\n\nCompany-issued hydraulic girdles which are only awarded to high-performing {0} who can afford to opt in. Highly valued by all employees of The Company for their combination of miraculous health-preserving benefits and artificial, intentionally-implemented scarcity. Sardonically called the 'Back Muscles Upgrade' by some. Comes with a user manual, which mostly contains minimalistic ads for girdle maintenance contractors. Most of the phone numbers don't work anymore.\n\n", shareStatus ? "departments" : "employees"); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { return Tools.GenerateInfoForUpgrade(CurrentUpgradeMode switch { UpgradeMode.ReduceWeight => AssetBundleHandler.GetInfoFromJSON("Back Muscles"), UpgradeMode.ReduceCarryInfluence => "LVL {0} - {1} - Reduces the weight's influence on player's running speed by {2}%\n", UpgradeMode.ReduceCarryStrain => "LVL {0} - {1} - Reduces the weight's influence on player's stamina consumption while running by {2}%\n", _ => "Undefined", }, initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().BackMusclesConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierAlternativeEffectUpgradeConfiguration backMusclesConfiguration = BaseUpgrade.GetConfiguration().BackMusclesConfiguration; return (backMusclesConfiguration.InitialEffect.Value - (float)level * backMusclesConfiguration.IncrementalEffect.Value) * 100f; } } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Back Muscles"); } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Back Muscles", BaseUpgrade.GetConfiguration().BackMusclesConfiguration.ItemProgressionItems.Value.Split(",")); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Back Muscles", BaseUpgrade.GetConfiguration().BackMusclesConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "BackMuscles"; } } internal class Stimpack : GameAttributeTierUpgrade, IUpgradeWorldBuilding { internal Dictionary playerHealthLevels = new Dictionary(); internal static Stimpack Instance; public const string UPGRADE_NAME = "Stimpack"; internal const string WORLD_BUILDING_TEXT = "\n\nAn experimental Company-offered 'health treatment' program advertised only on old, peeling Ship posters, which are themselves only present in about 40% of all Company-issued Ships. Some Ships even have multiple. Nothing is known from the outside about how it works, and in order to be eligible for the program, {0} must sign an NDA.\n\n"; public const string ENABLED_SECTION = "Enable Stimpack Upgrade"; public const bool ENABLED_DEFAULT = true; public const string ENABLED_DESCRIPTION = "Increases player's health."; public const string PRICE_SECTION = "Stimpack Price"; public const int PRICE_DEFAULT = 600; public const string PRICES_DEFAULT = "600,300, 450, 600"; public const string ADDITIONAL_HEALTH_UNLOCK_SECTION = "Initial health boost"; public const int ADDITIONAL_HEALTH_UNLOCK_DEFAULT = 20; public const string ADDITIONAL_HEALTH_UNLOCK_DESCRIPTION = "Amount of health gained when unlocking the upgrade"; public const string ADDITIONAL_HEALTH_INCREMENT_SECTION = "Additional health boost"; public const int ADDITIONAL_HEALTH_INCREMENT_DEFAULT = 20; public const string ADDITIONAL_HEALTH_INCREMENT_DESCRIPTION = "Every time Stimpack is upgraded this value will be added to the value above."; public override bool CanInitializeOnStart { get { ITierUpgradeConfiguration stimpackConfiguration = BaseUpgrade.GetConfiguration().StimpackConfiguration; string[] array = stimpackConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } private void Awake() { ITierEffectUpgradeConfiguration stimpackConfiguration = BaseUpgrade.GetConfiguration().StimpackConfiguration; upgradeName = "Stimpack"; overridenUpgradeName = SyncedEntry.op_Implicit(stimpackConfiguration.OverrideName); logger = new LguLogger("Stimpack"); Instance = this; changingAttribute = GameAttribute.PLAYER_HEALTH; initialValue = stimpackConfiguration.InitialEffect.Value; incrementalValue = stimpackConfiguration.IncrementalEffect.Value; } public override void Load() { base.Load(); UpdatePlayerHealthLevel(); } public override void Increment() { base.Increment(); UpdatePlayerHealthLevel(); } private void UpdatePlayerHealthLevel() { PlayerControllerB localPlayer = UpgradeBus.Instance.GetLocalPlayer(); PlayerHealthUpdateLevelServerRpc(localPlayer.playerSteamId, BaseUpgrade.GetUpgradeLevel("Stimpack")); } public override void Unwind() { base.Unwind(); PlayerControllerB localPlayer = UpgradeBus.Instance.GetLocalPlayer(); PlayerHealthUpdateLevelServerRpc(localPlayer.playerSteamId, -1); } public static int CheckForAdditionalHealth(int health) { ITierEffectUpgradeConfiguration stimpackConfiguration = BaseUpgrade.GetConfiguration().StimpackConfiguration; if (!stimpackConfiguration.Enabled.Value) { return health; } PlayerControllerB localPlayer = UpgradeBus.Instance.GetLocalPlayer(); if (!Instance.playerHealthLevels.ContainsKey(localPlayer.playerSteamId)) { return health; } int num = Instance.playerHealthLevels[localPlayer.playerSteamId]; return health + stimpackConfiguration.InitialEffect.Value + num * stimpackConfiguration.IncrementalEffect.Value; } public static int GetHealthFromPlayer(int health, ulong steamId) { int num = Instance.playerHealthLevels[steamId]; ITierEffectUpgradeConfiguration stimpackConfiguration = BaseUpgrade.GetConfiguration().StimpackConfiguration; return health + stimpackConfiguration.InitialEffect.Value + num * stimpackConfiguration.IncrementalEffect.Value; } public string GetWorldBuildingText(bool shareStatus = false) { return string.Format("\n\nAn experimental Company-offered 'health treatment' program advertised only on old, peeling Ship posters, which are themselves only present in about 40% of all Company-issued Ships. Some Ships even have multiple. Nothing is known from the outside about how it works, and in order to be eligible for the program, {0} must sign an NDA.\n\n", shareStatus ? "your crew" : "you"); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { string infoFromJSON = AssetBundleHandler.GetInfoFromJSON("Stimpack"); return Tools.GenerateInfoForUpgrade(infoFromJSON, initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().StimpackConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration stimpackConfiguration = BaseUpgrade.GetConfiguration().StimpackConfiguration; return stimpackConfiguration.InitialEffect.Value + level * stimpackConfiguration.IncrementalEffect.Value; } } [ServerRpc(RequireOwnership = false)] public void PlayerHealthUpdateLevelServerRpc(ulong id, int level) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: 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(237193921u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); BytePacker.WriteValueBitPacked(val2, level); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 237193921u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; logger.LogInfo("Request to update player max healths received. Calling ClientRpc..."); PlayerHealthUpdateLevelClientRpc(id, level); } } } [ClientRpc] private void PlayerHealthUpdateLevelClientRpc(ulong id, int level) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(50592250u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); BytePacker.WriteValueBitPacked(val2, level); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 50592250u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; logger.LogInfo($"Setting max health level for player {id} to {level}"); if (level == -1) { Instance.playerHealthLevels.Remove(id); } else { Instance.playerHealthLevels[id] = level; } } } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Stimpack", BaseUpgrade.GetConfiguration().StimpackConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Stimpack"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Stimpack", BaseUpgrade.GetConfiguration().StimpackConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(237193921u, new RpcReceiveHandler(__rpc_handler_237193921), "PlayerHealthUpdateLevelServerRpc"); ((NetworkBehaviour)this).__registerRpc(50592250u, new RpcReceiveHandler(__rpc_handler_50592250), "PlayerHealthUpdateLevelClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_237193921(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong id = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref id); int level = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref level); target.__rpc_exec_stage = (__RpcExecStage)1; ((Stimpack)(object)target).PlayerHealthUpdateLevelServerRpc(id, level); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_50592250(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong id = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref id); int level = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref level); target.__rpc_exec_stage = (__RpcExecStage)1; ((Stimpack)(object)target).PlayerHealthUpdateLevelClientRpc(id, level); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Stimpack"; } } } namespace MoreShipUpgrades.UpgradeComponents.TierUpgrades.Items { internal class ItemDuplicator : TierUpgrade { public const string UPGRADE_NAME = "Item Duplicator"; internal const string PRICES_DEFAULT = "250,350,500,750"; public override bool CanInitializeOnStart { get { ITierEffectUpgradeConfiguration itemDuplicatorUpgradeConfiguration = BaseUpgrade.GetConfiguration().ItemDuplicatorUpgradeConfiguration; string[] array = itemDuplicatorUpgradeConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } internal override void Start() { upgradeName = "Item Duplicator"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().ItemDuplicatorUpgradeConfiguration.OverrideName); base.Start(); } public static float GetChanceForDuplication() { ITierEffectUpgradeConfiguration itemDuplicatorUpgradeConfiguration = BaseUpgrade.GetConfiguration().ItemDuplicatorUpgradeConfiguration; if (!SyncedEntry.op_Implicit(itemDuplicatorUpgradeConfiguration.Enabled)) { return 0f; } if (!BaseUpgrade.GetActiveUpgrade("Item Duplicator")) { return 0f; } return (float)(SyncedEntry.op_Implicit(itemDuplicatorUpgradeConfiguration.InitialEffect) + BaseUpgrade.GetUpgradeLevel("Item Duplicator") * SyncedEntry.op_Implicit(itemDuplicatorUpgradeConfiguration.IncrementalEffect)) / 100f; } public static void AttemptDuplication(ref List itemsToDeliver) { List list = itemsToDeliver.ToList(); float chanceForDuplication = GetChanceForDuplication(); for (int i = 0; i < itemsToDeliver.Count; i++) { if (Random.Range(0f, 1f) < chanceForDuplication) { list.Add(itemsToDeliver[i]); } } itemsToDeliver = list; } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { return Tools.GenerateInfoForUpgrade("LVL {0} - {1} - Whenever purchasing an item from the Company store, it has {2}% chance of being duplicated when dropped (without occupying space).\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, BaseUpgrade.GetConfiguration().ClayGlassesConfiguration.PurchaseMode.Value); static float infoFunction(int level) { ITierEffectUpgradeConfiguration itemDuplicatorUpgradeConfiguration = BaseUpgrade.GetConfiguration().ItemDuplicatorUpgradeConfiguration; return itemDuplicatorUpgradeConfiguration.InitialEffect.Value + level * itemDuplicatorUpgradeConfiguration.IncrementalEffect.Value; } } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Item Duplicator", BaseUpgrade.GetConfiguration().ItemDuplicatorUpgradeConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { GameObject val = ItemManager.CreateNetworkPrefab("Item Duplicator"); val.AddComponent(); ItemManager.RegisterNetworkPrefab(val); Plugin.networkPrefabs["Item Duplicator"] = val; } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Item Duplicator", BaseUpgrade.GetConfiguration().ItemDuplicatorUpgradeConfiguration, Plugin.networkPrefabs["Item Duplicator"]); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "ItemDuplicator"; } } internal class LithiumBatteries : TierUpgrade, IUpgradeWorldBuilding { internal const string UPGRADE_NAME = "Lithium Batteries"; internal const string PRICES_DEFAULT = "100,150, 200, 250, 300"; internal const string WORLD_BUILDING_TEXT = "\n\nHobby-grade rechargeable batteries for your crew-portable electronic equipment. There is no battery recollection program offered by the Company, so there's no need to hold onto the old batteries. Just throw them in the ocean.\n\n"; public override bool CanInitializeOnStart { get { ITierEffectUpgradeConfiguration lithiumBatteriesConfiguration = BaseUpgrade.GetConfiguration().LithiumBatteriesConfiguration; string[] array = lithiumBatteriesConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nHobby-grade rechargeable batteries for your crew-portable electronic equipment. There is no battery recollection program offered by the Company, so there's no need to hold onto the old batteries. Just throw them in the ocean.\n\n"; } internal override void Start() { upgradeName = "Lithium Batteries"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().LithiumBatteriesConfiguration.OverrideName); base.Start(); } public static float GetChargeRateMultiplier(float defaultChargeRate) { ITierEffectUpgradeConfiguration lithiumBatteriesConfiguration = BaseUpgrade.GetConfiguration().LithiumBatteriesConfiguration; if (!SyncedEntry.op_Implicit(lithiumBatteriesConfiguration.Enabled)) { return defaultChargeRate; } if (!BaseUpgrade.GetActiveUpgrade("Lithium Batteries")) { return defaultChargeRate; } float num = lithiumBatteriesConfiguration.InitialEffect.Value; num += (float)(BaseUpgrade.GetUpgradeLevel("Lithium Batteries") * lithiumBatteriesConfiguration.IncrementalEffect.Value); num = (100f - num) / 100f; return defaultChargeRate * num; } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { return Tools.GenerateInfoForUpgrade("LVL {0} - {1} - Decreases the rate of battery used on the items by {2}%\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().LithiumBatteriesConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration lithiumBatteriesConfiguration = BaseUpgrade.GetConfiguration().LithiumBatteriesConfiguration; return lithiumBatteriesConfiguration.InitialEffect.Value + level * lithiumBatteriesConfiguration.IncrementalEffect.Value; } } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Lithium Batteries", BaseUpgrade.GetConfiguration().LithiumBatteriesConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Lithium Batteries"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Lithium Batteries", BaseUpgrade.GetConfiguration().LithiumBatteriesConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "LithiumBatteries"; } } public class ScrapKeeper : TierUpgrade, IUpgradeWorldBuilding { internal const string UPGRADE_NAME = "Scrap Keeper"; internal const string PRICES_DEFAULT = "1000,1000,1500,3000"; internal const string WORLD_BUILDING_TEXT = "\n\nIn the race to the bottom of all possible operating costs, The Company has made many compromises. Some of these compromises end up being pretty questionable, and it's up to individual departments to handle these problems on their own. There is a design flaw in the standard-issue Company Ship that causes it to empty its contents when it's forced to leave a moon and there is no-one onboard to ensure the doors close at the right time. You'd think this would be a simple fix, but for so many reasons it'd be a waste of both our time to describe, no. No, it very much isn't.\n\n"; public override bool CanInitializeOnStart { get { ITierUpgradeConfiguration scrapKeeperConfiguration = BaseUpgrade.GetConfiguration().ScrapKeeperConfiguration; string[] array = scrapKeeperConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nIn the race to the bottom of all possible operating costs, The Company has made many compromises. Some of these compromises end up being pretty questionable, and it's up to individual departments to handle these problems on their own. There is a design flaw in the standard-issue Company Ship that causes it to empty its contents when it's forced to leave a moon and there is no-one onboard to ensure the doors close at the right time. You'd think this would be a simple fix, but for so many reasons it'd be a waste of both our time to describe, no. No, it very much isn't.\n\n"; } internal override void Start() { upgradeName = "Scrap Keeper"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().ScrapKeeperConfiguration.OverrideName); base.Start(); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { return Tools.GenerateInfoForUpgrade("LVL {0} - {1} - In case of a full team wipe, each scrap present in the ship has a {2}% chance of not being discarded.\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().ScrapKeeperConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration scrapKeeperConfiguration = BaseUpgrade.GetConfiguration().ScrapKeeperConfiguration; return scrapKeeperConfiguration.InitialEffect.Value + level * scrapKeeperConfiguration.IncrementalEffect.Value; } } public static float ComputeScrapKeeperKeepScrapChance() { ITierEffectUpgradeConfiguration scrapKeeperConfiguration = BaseUpgrade.GetConfiguration().ScrapKeeperConfiguration; int num = SyncedEntry.op_Implicit(scrapKeeperConfiguration.InitialEffect) + BaseUpgrade.GetUpgradeLevel("Scrap Keeper") * SyncedEntry.op_Implicit(scrapKeeperConfiguration.IncrementalEffect); return (float)num / 100f; } public static bool CanKeepScrapBasedOnChance(GrabbableObject item) { ScrapKeeperUpgradeConfiguration scrapKeeperConfiguration = BaseUpgrade.GetConfiguration().ScrapKeeperConfiguration; if (!SyncedEntry.op_Implicit(scrapKeeperConfiguration.Enabled)) { return false; } if (!BaseUpgrade.GetActiveUpgrade("Scrap Keeper")) { return false; } if (SyncedEntry.op_Implicit(scrapKeeperConfiguration.OnlyKeepItemsInShip) && !item.scrapPersistedThroughRounds) { return false; } float num = Mathf.Clamp(ComputeScrapKeeperKeepScrapChance(), 0f, 1f); return Random.Range(0f, 1f) <= num; } public static bool CheckIfKeptScrap() { if (!SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().ScrapKeeperConfiguration.Enabled)) { return false; } if (!BaseUpgrade.GetActiveUpgrade("Scrap Keeper")) { return false; } return true; } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Scrap Keeper", BaseUpgrade.GetConfiguration().ScrapKeeperConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { GameObject val = ItemManager.CreateNetworkPrefab("Scrap Keeper"); val.AddComponent(); ItemManager.RegisterNetworkPrefab(val); Plugin.networkPrefabs["Scrap Keeper"] = val; } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Scrap Keeper", BaseUpgrade.GetConfiguration().ScrapKeeperConfiguration, Plugin.networkPrefabs["Scrap Keeper"]); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "ScrapKeeper"; } } internal class SmarterLockpick : TierUpgrade { internal const string UPGRADE_NAME = "Smarter Lockpick"; internal const string PRICES_DEFAULT = "200,300,350,450"; public override bool CanInitializeOnStart { get { ITierUpgradeConfiguration smarterLockpickUpgradeConfiguration = BaseUpgrade.GetConfiguration().SmarterLockpickUpgradeConfiguration; string[] array = smarterLockpickUpgradeConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } internal override void Start() { upgradeName = "Smarter Lockpick"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().SmarterLockpickUpgradeConfiguration.OverrideName); base.Start(); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { return Tools.GenerateInfoForUpgrade("LVL {0} - {1} - The lockpicker item is {2}% more efficient (faster) at opening up locked doors.\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().SmarterLockpickUpgradeConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration smarterLockpickUpgradeConfiguration = BaseUpgrade.GetConfiguration().SmarterLockpickUpgradeConfiguration; return smarterLockpickUpgradeConfiguration.InitialEffect.Value + level * smarterLockpickUpgradeConfiguration.IncrementalEffect.Value; } } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Smarter Lockpick", BaseUpgrade.GetConfiguration().SmarterLockpickUpgradeConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { GameObject val = ItemManager.CreateNetworkPrefab("Smarter Lockpick"); val.AddComponent(); ItemManager.RegisterNetworkPrefab(val); Plugin.networkPrefabs["Smarter Lockpick"] = val; } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Smarter Lockpick", BaseUpgrade.GetConfiguration().SmarterLockpickUpgradeConfiguration, Plugin.networkPrefabs["Smarter Lockpick"]); } public static float IncreaseLockpickEfficiency(float defaultAmount) { ITierEffectUpgradeConfiguration smarterLockpickUpgradeConfiguration = BaseUpgrade.GetConfiguration().SmarterLockpickUpgradeConfiguration; if (!SyncedEntry.op_Implicit(smarterLockpickUpgradeConfiguration.Enabled)) { return defaultAmount; } if (!BaseUpgrade.GetActiveUpgrade("Smarter Lockpick")) { return defaultAmount; } float num = (float)(SyncedEntry.op_Implicit(smarterLockpickUpgradeConfiguration.InitialEffect) + SyncedEntry.op_Implicit(smarterLockpickUpgradeConfiguration.IncrementalEffect) * BaseUpgrade.GetUpgradeLevel("Smarter Lockpick")) / 100f; num = Mathf.Clamp(num, 1f, float.MaxValue); return defaultAmount + defaultAmount * num; } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "SmarterLockpick"; } } } namespace MoreShipUpgrades.UpgradeComponents.TierUpgrades.Items.Zapgun { internal class AluminiumCoils : TierUpgrade, IUpgradeWorldBuilding { internal const string UPGRADE_NAME = "Aluminium Coils"; internal const string DEFAULT_PRICES = "750,600, 800, 1000"; internal const string WORLD_BUILDING_TEXT = "\n\nOn-the-job training package that instructs your crew on how to more safely and efficiently wield the Zap Gun.\n\n"; public override bool CanInitializeOnStart { get { ITierMultipleEffectUpgradeConfiguration aluminiumCoilConfiguration = BaseUpgrade.GetConfiguration().AluminiumCoilConfiguration; string[] array = aluminiumCoilConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } internal override void Start() { upgradeName = "Aluminium Coils"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().AluminiumCoilConfiguration.OverrideName); base.Start(); } public static float ApplyDifficultyDecrease(float defaultDifficulty) { ITierMultipleEffectUpgradeConfiguration aluminiumCoilConfiguration = BaseUpgrade.GetConfiguration().AluminiumCoilConfiguration; if (!SyncedEntry.op_Implicit(aluminiumCoilConfiguration.Enabled)) { return defaultDifficulty; } if (!BaseUpgrade.GetActiveUpgrade("Aluminium Coils")) { return defaultDifficulty; } (SyncedEntry, SyncedEntry) effectPair = aluminiumCoilConfiguration.GetEffectPair(0); float num = 1f - (float)(effectPair.Item1.Value + BaseUpgrade.GetUpgradeLevel("Aluminium Coils") * effectPair.Item2.Value) / 100f; return Mathf.Clamp(defaultDifficulty * num, 0f, defaultDifficulty); } public static float ApplyCooldownDecrease(float defaultCooldown) { ITierMultipleEffectUpgradeConfiguration aluminiumCoilConfiguration = BaseUpgrade.GetConfiguration().AluminiumCoilConfiguration; if (!SyncedEntry.op_Implicit(aluminiumCoilConfiguration.Enabled)) { return defaultCooldown; } if (!BaseUpgrade.GetActiveUpgrade("Aluminium Coils")) { return defaultCooldown; } (SyncedEntry, SyncedEntry) effectPair = aluminiumCoilConfiguration.GetEffectPair(1); float num = 1f - (float)(effectPair.Item1.Value + BaseUpgrade.GetUpgradeLevel("Aluminium Coils") * effectPair.Item2.Value) / 100f; return Mathf.Clamp(defaultCooldown * num, 0f, defaultCooldown); } public static float ApplyIncreasedStunTimer(float defaultStunTimer) { ITierMultipleEffectUpgradeConfiguration aluminiumCoilConfiguration = BaseUpgrade.GetConfiguration().AluminiumCoilConfiguration; if (!SyncedEntry.op_Implicit(aluminiumCoilConfiguration.Enabled)) { return defaultStunTimer; } if (!BaseUpgrade.GetActiveUpgrade("Aluminium Coils")) { return defaultStunTimer; } (SyncedEntry, SyncedEntry) secondEffectPair = aluminiumCoilConfiguration.GetSecondEffectPair(0); float num = secondEffectPair.Item1.Value + (float)BaseUpgrade.GetUpgradeLevel("Aluminium Coils") * secondEffectPair.Item2.Value; return defaultStunTimer + num; } public static float ApplyIncreasedStunRange(float defaultRange) { ITierMultipleEffectUpgradeConfiguration aluminiumCoilConfiguration = BaseUpgrade.GetConfiguration().AluminiumCoilConfiguration; if (!SyncedEntry.op_Implicit(aluminiumCoilConfiguration.Enabled)) { return defaultRange; } if (!BaseUpgrade.GetActiveUpgrade("Aluminium Coils")) { return defaultRange; } (SyncedEntry, SyncedEntry) secondEffectPair = aluminiumCoilConfiguration.GetSecondEffectPair(1); float num = secondEffectPair.Item1.Value + (float)BaseUpgrade.GetUpgradeLevel("Aluminium Coils") * secondEffectPair.Item2.Value; return defaultRange + num; } private string GetAluminiumCoilsInfo(int level, int price) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append($"LVL {level} - {BaseUpgrade.GetUpgradePrice(price, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().AluminiumCoilConfiguration.PurchaseMode))}: Upgrades to zap gun:\n"); stringBuilder.Append($"- Increases zap gun's range by {rangeInfo(level - 1) / 13f * 100f:F0}%\n"); stringBuilder.Append($"- Stun time increased by {stunTimerInfo(level - 1)} seconds\n"); stringBuilder.Append($"- Decreases the minigame's difficulty by {difficultyInfo(level - 1):F0}%\n"); stringBuilder.Append($"- Decreases the zap gun's cooldown by {cooldownInfo(level - 1):F0}%\n"); stringBuilder.Append('\n'); return stringBuilder.ToString(); static float cooldownInfo(int level) { ITierMultipleEffectUpgradeConfiguration aluminiumCoilConfiguration = BaseUpgrade.GetConfiguration().AluminiumCoilConfiguration; (SyncedEntry, SyncedEntry) effectPair = aluminiumCoilConfiguration.GetEffectPair(1); return effectPair.Item1.Value + level * effectPair.Item2.Value; } static float difficultyInfo(int level) { ITierMultipleEffectUpgradeConfiguration aluminiumCoilConfiguration2 = BaseUpgrade.GetConfiguration().AluminiumCoilConfiguration; (SyncedEntry, SyncedEntry) effectPair2 = aluminiumCoilConfiguration2.GetEffectPair(0); return effectPair2.Item1.Value + level * effectPair2.Item2.Value; } static float rangeInfo(int level) { ITierMultipleEffectUpgradeConfiguration aluminiumCoilConfiguration4 = BaseUpgrade.GetConfiguration().AluminiumCoilConfiguration; (SyncedEntry, SyncedEntry) secondEffectPair2 = aluminiumCoilConfiguration4.GetSecondEffectPair(1); return secondEffectPair2.Item1.Value + (float)level * secondEffectPair2.Item2.Value; } static float stunTimerInfo(int level) { ITierMultipleEffectUpgradeConfiguration aluminiumCoilConfiguration3 = BaseUpgrade.GetConfiguration().AluminiumCoilConfiguration; (SyncedEntry, SyncedEntry) secondEffectPair = aluminiumCoilConfiguration3.GetSecondEffectPair(0); return secondEffectPair.Item1.Value + (float)level * secondEffectPair.Item2.Value; } } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append(GetAluminiumCoilsInfo(1, initialPrice)); for (int i = 0; i < maxLevels; i++) { stringBuilder.Append(GetAluminiumCoilsInfo(i + 2, incrementalPrices[i])); } return stringBuilder.ToString(); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Aluminium Coils"); } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Aluminium Coils", BaseUpgrade.GetConfiguration().AluminiumCoilConfiguration.ItemProgressionItems.Value.Split(",")); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Aluminium Coils", BaseUpgrade.GetConfiguration().AluminiumCoilConfiguration); } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nOn-the-job training package that instructs your crew on how to more safely and efficiently wield the Zap Gun.\n\n"; } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "AluminiumCoils"; } } } namespace MoreShipUpgrades.UpgradeComponents.TierUpgrades.Items.WeedKiller { internal class WeedGeneticManipulation : TierUpgrade { internal const string UPGRADE_NAME = "Weed Genetic Manipulation"; internal const string PRICES_DEFAULT = "100,100,150,200"; internal const string WORLD_BUILDING_TEXT = "\n\nYou figured out that pissing into the Weed Killer makes it more effective. The cost of this upgrade comes from extra portable water requisitions your department needs to order to make the project happen.\n\n"; public override bool CanInitializeOnStart { get { ITierEffectUpgradeConfiguration weedGeneticManipulationConfiguration = BaseUpgrade.GetConfiguration().WeedGeneticManipulationConfiguration; string[] array = weedGeneticManipulationConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nYou figured out that pissing into the Weed Killer makes it more effective. The cost of this upgrade comes from extra portable water requisitions your department needs to order to make the project happen.\n\n"; } internal override void Start() { upgradeName = "Weed Genetic Manipulation"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().WeedGeneticManipulationConfiguration.OverrideName); base.Start(); } public static float ComputeWeedKillerEffectiveness() { ITierEffectUpgradeConfiguration weedGeneticManipulationConfiguration = BaseUpgrade.GetConfiguration().WeedGeneticManipulationConfiguration; int num = SyncedEntry.op_Implicit(weedGeneticManipulationConfiguration.InitialEffect) + BaseUpgrade.GetUpgradeLevel("Weed Genetic Manipulation") * SyncedEntry.op_Implicit(weedGeneticManipulationConfiguration.IncrementalEffect); return (float)num / 100f; } public static float GetWeedKillerEffectiveness(float defaultValue) { if (!SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().WeedGeneticManipulationConfiguration.Enabled)) { return defaultValue; } if (!BaseUpgrade.GetActiveUpgrade("Weed Genetic Manipulation")) { return defaultValue; } float num = ComputeWeedKillerEffectiveness(); 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} - Effectiveness of the Weed Killer item in eradicating plants is increased by {2}%\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().WeedGeneticManipulationConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration weedGeneticManipulationConfiguration = BaseUpgrade.GetConfiguration().WeedGeneticManipulationConfiguration; return weedGeneticManipulationConfiguration.InitialEffect.Value + level * weedGeneticManipulationConfiguration.IncrementalEffect.Value; } } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Weed Genetic Manipulation", BaseUpgrade.GetConfiguration().WeedGeneticManipulationConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Weed Genetic Manipulation"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Weed Genetic Manipulation", BaseUpgrade.GetConfiguration().WeedGeneticManipulationConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "WeedGeneticManipulation"; } } } namespace MoreShipUpgrades.UpgradeComponents.TierUpgrades.Items.Shotgun { public class HollowPoint : TierUpgrade, IUpgradeWorldBuilding { internal const string UPGRADE_NAME = "Hollow Point"; internal const string DEFAULT_PRICES = "800,1000"; internal const string WORLD_BUILDING_TEXT = "\n\nBy trading expedition notes and a few ration tickets with another crew during sale, you have acquired a set of instructions on how to make something called 'Cruelty Slugs'. The Company really shouldn't know about these... please keep this to yourselves.\n\n"; public override bool CanInitializeOnStart { get { ITierUpgradeConfiguration hollowPointConfiguration = BaseUpgrade.GetConfiguration().HollowPointConfiguration; string[] array = hollowPointConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nBy trading expedition notes and a few ration tickets with another crew during sale, you have acquired a set of instructions on how to make something called 'Cruelty Slugs'. The Company really shouldn't know about these... please keep this to yourselves.\n\n"; } internal override void Start() { upgradeName = "Hollow Point"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().HollowPointConfiguration.OverrideName); base.Start(); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { return Tools.GenerateInfoForUpgrade("LVL {0} - {1} - Damage dealt by the shotgun is increased by {2}\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().HollowPointConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration hollowPointConfiguration = BaseUpgrade.GetConfiguration().HollowPointConfiguration; return hollowPointConfiguration.InitialEffect.Value + level * hollowPointConfiguration.IncrementalEffect.Value; } } public static int ComputeHollowPointDamageBoost() { ITierEffectUpgradeConfiguration hollowPointConfiguration = BaseUpgrade.GetConfiguration().HollowPointConfiguration; return SyncedEntry.op_Implicit(hollowPointConfiguration.InitialEffect) + BaseUpgrade.GetUpgradeLevel("Hollow Point") * SyncedEntry.op_Implicit(hollowPointConfiguration.IncrementalEffect); } public static int GetHollowPointDamageBoost(int defaultValue) { if (!SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().HollowPointConfiguration.Enabled)) { return defaultValue; } if (!BaseUpgrade.GetActiveUpgrade("Hollow Point")) { return defaultValue; } int num = ComputeHollowPointDamageBoost(); return defaultValue + num; } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Hollow Point", BaseUpgrade.GetConfiguration().HollowPointConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { GameObject val = ItemManager.CreateNetworkPrefab("Hollow Point"); val.AddComponent(); ItemManager.RegisterNetworkPrefab(val); Plugin.networkPrefabs["Hollow Point"] = val; } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Hollow Point", BaseUpgrade.GetConfiguration().HollowPointConfiguration, Plugin.networkPrefabs["Hollow Point"]); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "HollowPoint"; } } internal class LongBarrel : TierUpgrade, IUpgradeWorldBuilding { internal const string UPGRADE_NAME = "Long Barrel"; internal const string DEFAULT_PRICES = "500,500,750"; internal const string WORLD_BUILDING_TEXT = "\n\nThe shotguns Nutcrackers are issued with break a lot of common gunsmithing conventions. For one thing, the barrels are overly short, and sometimes one tube is longer than the other. You got some help from a friend prying a few sections of spare pipe off the walls of the Factory. The parts appear capable of baring pressure, and the kind of adhesive you need is available in the Company Catalogue, but it's expensive...\n\n"; public override bool CanInitializeOnStart { get { ITierUpgradeConfiguration longBarrelConfiguration = BaseUpgrade.GetConfiguration().LongBarrelConfiguration; string[] array = longBarrelConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nThe shotguns Nutcrackers are issued with break a lot of common gunsmithing conventions. For one thing, the barrels are overly short, and sometimes one tube is longer than the other. You got some help from a friend prying a few sections of spare pipe off the walls of the Factory. The parts appear capable of baring pressure, and the kind of adhesive you need is available in the Company Catalogue, but it's expensive...\n\n"; } internal override void Start() { upgradeName = "Long Barrel"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().LongBarrelConfiguration.OverrideName); base.Start(); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { return Tools.GenerateInfoForUpgrade("LVL {0} - {1} - Shotgun's range and its effective damage ranges are increased by {2}%\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().LongBarrelConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration longBarrelConfiguration = BaseUpgrade.GetConfiguration().LongBarrelConfiguration; return longBarrelConfiguration.InitialEffect.Value + level * longBarrelConfiguration.IncrementalEffect.Value; } } public static float ComputeLongBarrelRangeBoost() { ITierEffectUpgradeConfiguration longBarrelConfiguration = BaseUpgrade.GetConfiguration().LongBarrelConfiguration; int num = SyncedEntry.op_Implicit(longBarrelConfiguration.InitialEffect) + BaseUpgrade.GetUpgradeLevel("Long Barrel") * SyncedEntry.op_Implicit(longBarrelConfiguration.IncrementalEffect); return (float)num / 100f; } public static float GetLongBarrelRangeBoost(float defaultValue) { if (!SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().LongBarrelConfiguration.Enabled)) { return defaultValue; } if (!BaseUpgrade.GetActiveUpgrade("Long Barrel")) { return defaultValue; } float num = ComputeLongBarrelRangeBoost(); return defaultValue + Mathf.Clamp(defaultValue * num, 0f, float.MaxValue); } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Long Barrel", BaseUpgrade.GetConfiguration().LongBarrelConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { GameObject val = ItemManager.CreateNetworkPrefab("Long Barrel"); val.AddComponent(); ItemManager.RegisterNetworkPrefab(val); Plugin.networkPrefabs["Long Barrel"] = val; } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Long Barrel", BaseUpgrade.GetConfiguration().LongBarrelConfiguration, Plugin.networkPrefabs["Long Barrel"]); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "LongBarrel"; } } internal class SleightOfHand : TierUpgrade, IUpgradeWorldBuilding { internal const string UPGRADE_NAME = "Sleight of Hand"; internal const string PRICES_DEFAULT = "100,150,200,250"; internal const string WORLD_BUILDING_TEXT = "\n\nOn-the-job training package detailing the safe & efficient handling and application of firearms.\n\n"; public override bool CanInitializeOnStart { get { ITierEffectUpgradeConfiguration sleightOfHandConfiguration = BaseUpgrade.GetConfiguration().SleightOfHandConfiguration; string[] array = sleightOfHandConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nOn-the-job training package detailing the safe & efficient handling and application of firearms.\n\n"; } internal override void Start() { upgradeName = "Sleight of Hand"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().SleightOfHandConfiguration.OverrideName); base.Start(); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { return Tools.GenerateInfoForUpgrade("LVL {0} - {1} - The reload speed of weaponry is increased by {2}%\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().SleightOfHandConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration sleightOfHandConfiguration = BaseUpgrade.GetConfiguration().SleightOfHandConfiguration; return sleightOfHandConfiguration.InitialEffect.Value + level * sleightOfHandConfiguration.IncrementalEffect.Value; } } public static float ComputeSleightOfHandSpeedBoost() { ITierEffectUpgradeConfiguration sleightOfHandConfiguration = BaseUpgrade.GetConfiguration().SleightOfHandConfiguration; int num = SyncedEntry.op_Implicit(sleightOfHandConfiguration.InitialEffect) + BaseUpgrade.GetUpgradeLevel("Sleight of Hand") * SyncedEntry.op_Implicit(sleightOfHandConfiguration.IncrementalEffect); return (float)num / 100f; } public static float GetSleightOfHandSpeedBoost(float defaultValue) { if (!SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().SleightOfHandConfiguration.Enabled)) { return defaultValue; } if (!BaseUpgrade.GetActiveUpgrade("Sleight of Hand")) { return defaultValue; } float num = ComputeSleightOfHandSpeedBoost() / 2f; return Mathf.Clamp(defaultValue * (1f - num), 0f, defaultValue); } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Sleight of Hand", BaseUpgrade.GetConfiguration().SleightOfHandConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Sleight of Hand"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Sleight of Hand", BaseUpgrade.GetConfiguration().SleightOfHandConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "SleightOfHand"; } } } namespace MoreShipUpgrades.UpgradeComponents.TierUpgrades.Items.RadarBooster { internal class ChargingBooster : TierUpgrade, IUpgradeWorldBuilding { internal const string UPGRADE_NAME = "Charging Booster"; internal const string WORLD_BUILDING_TEXT = "Terminal hyperlink that leads to an old, decaying section of the Company Portal. The design of the page is bare and archaic, and all text is written in caps. There is a barely-labeled transaction window with your payment credentials autofilled. Clicking 'ACCEPT' causes a hissing noise to emanate from your nearby Radar Booster."; internal float chargeCooldown; internal static ChargingBooster Instance { get; private set; } public override bool CanInitializeOnStart { get { ITierMultipleEffectUpgradeConfiguration chargingBoosterConfiguration = BaseUpgrade.GetConfiguration().ChargingBoosterConfiguration; string[] array = chargingBoosterConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "Terminal hyperlink that leads to an old, decaying section of the Company Portal. The design of the page is bare and archaic, and all text is written in caps. There is a barely-labeled transaction window with your payment credentials autofilled. Clicking 'ACCEPT' causes a hissing noise to emanate from your nearby Radar Booster."; } private void Awake() { Instance = this; } internal override void Start() { upgradeName = "Charging Booster"; ITierMultipleEffectUpgradeConfiguration chargingBoosterConfiguration = BaseUpgrade.GetConfiguration().ChargingBoosterConfiguration; overridenUpgradeName = SyncedEntry.op_Implicit(chargingBoosterConfiguration.OverrideName); chargeCooldown = SyncedEntry.op_Implicit(chargingBoosterConfiguration.GetEffectPair(0).Item1); base.Start(); } public override void Load() { base.Load(); RadarBoosterItem[] array = Object.FindObjectsOfType(); foreach (RadarBoosterItem val in array) { if (!((Object)(object)((Component)val).GetComponent() != (Object)null)) { ((Component)val).gameObject.AddComponent(); } } } public override void Increment() { base.Increment(); ITierMultipleEffectUpgradeConfiguration chargingBoosterConfiguration = BaseUpgrade.GetConfiguration().ChargingBoosterConfiguration; (SyncedEntry, SyncedEntry) effectPair = chargingBoosterConfiguration.GetEffectPair(0); chargeCooldown = Mathf.Clamp(chargeCooldown - effectPair.Item2.Value, 0f, effectPair.Item1.Value); } [ServerRpc(RequireOwnership = false)] internal void UpdateCooldownServerRpc(NetworkBehaviourReference radarBooster) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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(2189107060u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref radarBooster, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2189107060u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; UpdateCooldownClientRpc(radarBooster); } } } [ClientRpc] private void UpdateCooldownClientRpc(NetworkBehaviourReference radarBooster) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2898446694u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref radarBooster, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2898446694u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RadarBoosterItem val3 = default(RadarBoosterItem); ((NetworkBehaviourReference)(ref radarBooster)).TryGet(ref val3, (NetworkManager)null); if (!((Object)(object)val3 == (Object)null)) { ChargingStationManager component = ((Component)val3).GetComponent(); if (!((Object)(object)component == (Object)null)) { component.cooldown = chargeCooldown; } } } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { ITierMultipleEffectUpgradeConfiguration chargingBoosterConfiguration = BaseUpgrade.GetConfiguration().ChargingBoosterConfiguration; (SyncedEntry, SyncedEntry) effectPair = chargingBoosterConfiguration.GetEffectPair(0); return $"LVL 1 - {BaseUpgrade.GetUpgradePrice(initialPrice, SyncedEntry.op_Implicit(chargingBoosterConfiguration.PurchaseMode))} - Provides charging stations to the radar boosters. After used, goes on cooldown for {effectPair.Item1.Value} seconds\n" + Tools.GenerateInfoForUpgrade("LVL {0} - {1} - Radar boosters will have a recharge cooldown of {2} seconds.\n", 0, incrementalPrices, infoFunction, skipFirst: true, SyncedEntry.op_Implicit(chargingBoosterConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierMultipleEffectUpgradeConfiguration chargingBoosterConfiguration2 = BaseUpgrade.GetConfiguration().ChargingBoosterConfiguration; return chargingBoosterConfiguration2.GetEffectPair(0).Item1.Value - (float)level * chargingBoosterConfiguration2.GetEffectPair(0).Item2.Value; } } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Charging Booster", BaseUpgrade.GetConfiguration().ChargingBoosterConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Charging Booster"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Charging Booster", BaseUpgrade.GetConfiguration().ChargingBoosterConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2189107060u, new RpcReceiveHandler(__rpc_handler_2189107060), "UpdateCooldownServerRpc"); ((NetworkBehaviour)this).__registerRpc(2898446694u, new RpcReceiveHandler(__rpc_handler_2898446694), "UpdateCooldownClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_2189107060(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkBehaviourReference radarBooster = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref radarBooster, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((ChargingBooster)(object)target).UpdateCooldownServerRpc(radarBooster); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2898446694(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkBehaviourReference radarBooster = default(NetworkBehaviourReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref radarBooster, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((ChargingBooster)(object)target).UpdateCooldownClientRpc(radarBooster); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "ChargingBooster"; } } } namespace MoreShipUpgrades.UpgradeComponents.TierUpgrades.Items.Jetpack { internal class JetFuel : TierUpgrade, IUpgradeWorldBuilding { internal const string UPGRADE_NAME = "Jet Fuel"; internal const string DEFAULT_PRICES = "400,200,400,500"; internal const string WORLD_BUILDING_TEXT = "\n\nOptimization procedure for your jetpack's fuel injector that results in a cleaner and more efficient detonation of the propellant.\n\n"; public override bool CanInitializeOnStart { get { ITierUpgradeConfiguration jetFuelConfiguration = BaseUpgrade.GetConfiguration().JetFuelConfiguration; string[] array = jetFuelConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nOptimization procedure for your jetpack's fuel injector that results in a cleaner and more efficient detonation of the propellant.\n\n"; } internal override void Start() { upgradeName = "Jet Fuel"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().JetFuelConfiguration.OverrideName); base.Start(); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { return Tools.GenerateInfoForUpgrade("LVL {0} - {1} - The acceleration of the jetpack during flight is increased by {2}%\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().JetFuelConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration jetFuelConfiguration = BaseUpgrade.GetConfiguration().JetFuelConfiguration; return jetFuelConfiguration.InitialEffect.Value + level * jetFuelConfiguration.IncrementalEffect.Value; } } public static float GetIncreasedAcceleration() { ITierEffectUpgradeConfiguration jetFuelConfiguration = BaseUpgrade.GetConfiguration().JetFuelConfiguration; int num = SyncedEntry.op_Implicit(jetFuelConfiguration.InitialEffect) + BaseUpgrade.GetUpgradeLevel("Jet Fuel") * SyncedEntry.op_Implicit(jetFuelConfiguration.IncrementalEffect); return (float)num / 100f; } public static float IncreaseJetpackAcceleration(float defaultValue) { if (!SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().JetFuelConfiguration.Enabled)) { return defaultValue; } if (!BaseUpgrade.GetActiveUpgrade("Jet Fuel")) { return defaultValue; } float increasedAcceleration = GetIncreasedAcceleration(); return Mathf.Clamp(defaultValue + defaultValue * increasedAcceleration, defaultValue, float.MaxValue); } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Jet Fuel", BaseUpgrade.GetConfiguration().JetFuelConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { GameObject val = ItemManager.CreateNetworkPrefab("Jet Fuel"); val.AddComponent(); ItemManager.RegisterNetworkPrefab(val); Plugin.networkPrefabs["Jet Fuel"] = val; } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Jet Fuel", BaseUpgrade.GetConfiguration().JetFuelConfiguration, Plugin.networkPrefabs["Jet Fuel"]); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "JetFuel"; } } internal class JetpackThrusters : TierUpgrade, IUpgradeWorldBuilding { internal const string UPGRADE_NAME = "Jetpack Thrusters"; internal const string DEFAULT_PRICES = "300,150,300,400"; internal const string WORLD_BUILDING_TEXT = "\n\nOptimization procedure for your jetpack's thrust nozzles that results in a higher terminal velocity at maximum thrust.\n\n"; public override bool CanInitializeOnStart { get { ITierUpgradeConfiguration jetpackThrustersConfiguration = BaseUpgrade.GetConfiguration().JetpackThrustersConfiguration; string[] array = jetpackThrustersConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nOptimization procedure for your jetpack's thrust nozzles that results in a higher terminal velocity at maximum thrust.\n\n"; } internal override void Start() { upgradeName = "Jetpack Thrusters"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().JetpackThrustersConfiguration.OverrideName); base.Start(); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { return Tools.GenerateInfoForUpgrade("LVL {0} - {1} - The maximum speed of the jetpack during flight is increased by {2}%\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().JetpackThrustersConfiguration.PurchaseMode)); static float infoFunction(int level) { ITierEffectUpgradeConfiguration jetpackThrustersConfiguration = BaseUpgrade.GetConfiguration().JetpackThrustersConfiguration; return jetpackThrustersConfiguration.InitialEffect.Value + level * jetpackThrustersConfiguration.IncrementalEffect.Value; } } public static float GetIncreasedMaximumPower() { ITierEffectUpgradeConfiguration jetpackThrustersConfiguration = BaseUpgrade.GetConfiguration().JetpackThrustersConfiguration; int num = SyncedEntry.op_Implicit(jetpackThrustersConfiguration.InitialEffect) + BaseUpgrade.GetUpgradeLevel("Jetpack Thrusters") * SyncedEntry.op_Implicit(jetpackThrustersConfiguration.IncrementalEffect); return (float)num / 100f; } public static float IncreaseJetpackMaximumPower(float defaultValue) { if (!SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().JetpackThrustersConfiguration.Enabled)) { return defaultValue; } if (!BaseUpgrade.GetActiveUpgrade("Jetpack Thrusters")) { return defaultValue; } float increasedMaximumPower = GetIncreasedMaximumPower(); return Mathf.Clamp(defaultValue + defaultValue * increasedMaximumPower, defaultValue, float.MaxValue); } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Jetpack Thrusters", BaseUpgrade.GetConfiguration().JetpackThrustersConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { GameObject val = ItemManager.CreateNetworkPrefab("Jetpack Thrusters"); val.AddComponent(); ItemManager.RegisterNetworkPrefab(val); Plugin.networkPrefabs["Jetpack Thrusters"] = val; } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Jetpack Thrusters", BaseUpgrade.GetConfiguration().JetpackThrustersConfiguration, Plugin.networkPrefabs["Jetpack Thrusters"]); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "JetpackThrusters"; } } } namespace MoreShipUpgrades.UpgradeComponents.TierUpgrades.Enemies { public class BabyPacifier : TierUpgrade { public const string UPGRADE_NAME = "Baby Pacifier"; internal const string PRICES_DEFAULT = "100,100,200,200,400"; public override bool CanInitializeOnStart { get { ITierEffectUpgradeConfiguration babyPacifierUpgradeConfiguration = BaseUpgrade.GetConfiguration().BabyPacifierUpgradeConfiguration; string[] array = babyPacifierUpgradeConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } internal override void Start() { upgradeName = "Baby Pacifier"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().BabyPacifierUpgradeConfiguration.OverrideName); base.Start(); } public static float GetDecreasedGrowthRate(float defaultValue) { ITierEffectUpgradeConfiguration babyPacifierUpgradeConfiguration = BaseUpgrade.GetConfiguration().BabyPacifierUpgradeConfiguration; if (!SyncedEntry.op_Implicit(babyPacifierUpgradeConfiguration.Enabled)) { return defaultValue; } if (!BaseUpgrade.GetActiveUpgrade("Baby Pacifier")) { return defaultValue; } float num = (float)(SyncedEntry.op_Implicit(babyPacifierUpgradeConfiguration.InitialEffect) + BaseUpgrade.GetUpgradeLevel("Baby Pacifier") * SyncedEntry.op_Implicit(babyPacifierUpgradeConfiguration.IncrementalEffect)) / 100f; return Mathf.Clamp(defaultValue - defaultValue * num, 0f, defaultValue); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { return Tools.GenerateInfoForUpgrade("LVL {0} - {1} - The amount of growth increase when the maneater is crying is decreased by {2}%\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, BaseUpgrade.GetConfiguration().ClayGlassesConfiguration.PurchaseMode.Value); static float infoFunction(int level) { ITierEffectUpgradeConfiguration babyPacifierUpgradeConfiguration = BaseUpgrade.GetConfiguration().BabyPacifierUpgradeConfiguration; return babyPacifierUpgradeConfiguration.InitialEffect.Value + level * babyPacifierUpgradeConfiguration.IncrementalEffect.Value; } } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Baby Pacifier", BaseUpgrade.GetConfiguration().BabyPacifierUpgradeConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { GameObject val = ItemManager.CreateNetworkPrefab("Baby Pacifier"); val.AddComponent(); ItemManager.RegisterNetworkPrefab(val); Plugin.networkPrefabs["Baby Pacifier"] = val; } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Baby Pacifier", BaseUpgrade.GetConfiguration().BabyPacifierUpgradeConfiguration, Plugin.networkPrefabs["Baby Pacifier"]); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "BabyPacifier"; } } public class ClayGlasses : TierUpgrade, IUpgradeWorldBuilding { public const string UPGRADE_NAME = "Clay Glasses"; internal const string WORLD_BUILDING_TEXT = "\n\nSubscription to 'Prestidigitation Press' magazine. Comes every week. The magazines are full of supposed-eyewitness testimony of supernatural occurences. Most of the content of the magazine appears blatantly fake to you, but the fact that the Clay Surgeon is mentioned and described in exacting detail sends a shiver down your spine.\n\n"; internal const string PRICES_DEFAULT = "200,300,400,500,600"; public override bool CanInitializeOnStart { get { ITierEffectUpgradeConfiguration clayGlassesConfiguration = BaseUpgrade.GetConfiguration().ClayGlassesConfiguration; string[] array = clayGlassesConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nSubscription to 'Prestidigitation Press' magazine. Comes every week. The magazines are full of supposed-eyewitness testimony of supernatural occurences. Most of the content of the magazine appears blatantly fake to you, but the fact that the Clay Surgeon is mentioned and described in exacting detail sends a shiver down your spine.\n\n"; } internal override void Start() { upgradeName = "Clay Glasses"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().ClayGlassesConfiguration.OverrideName); base.Start(); } public static float GetAdditionalMaximumDistance(float defaultValue) { ITierEffectUpgradeConfiguration clayGlassesConfiguration = BaseUpgrade.GetConfiguration().ClayGlassesConfiguration; if (!SyncedEntry.op_Implicit(clayGlassesConfiguration.Enabled)) { return defaultValue; } if (!BaseUpgrade.GetActiveUpgrade("Clay Glasses")) { return defaultValue; } float num = SyncedEntry.op_Implicit(clayGlassesConfiguration.InitialEffect) + (float)BaseUpgrade.GetUpgradeLevel("Clay Glasses") * SyncedEntry.op_Implicit(clayGlassesConfiguration.IncrementalEffect); 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} - The maximum distance to spot a \"Clay Surgeon\" entity is increased by {2} additional units.\n", initialPrice, incrementalPrices, infoFunction, skipFirst: false, BaseUpgrade.GetConfiguration().ClayGlassesConfiguration.PurchaseMode.Value); static float infoFunction(int level) { ITierEffectUpgradeConfiguration clayGlassesConfiguration = BaseUpgrade.GetConfiguration().ClayGlassesConfiguration; return clayGlassesConfiguration.InitialEffect.Value + (float)level * clayGlassesConfiguration.IncrementalEffect.Value; } } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Clay Glasses", BaseUpgrade.GetConfiguration().ClayGlassesConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Clay Glasses"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Clay Glasses", BaseUpgrade.GetConfiguration().ClayGlassesConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "ClayGlasses"; } } internal class Hunter : TierUpgrade, IUpgradeWorldBuilding { private static readonly LguLogger logger = new LguLogger("Hunter"); internal static Hunter Instance; public const string UPGRADE_NAME = "Hunter"; public const string PRICES_DEFAULT = "500,600,700"; internal const string WORLD_BUILDING_TEXT = "\n\nOn-the-job training program that teaches your crew how to properly collect lab-ready samples of blood, skin, and organ tissue from entities found within the facility. These samples are valuable to The Company. Used to be a part of the standard onboarding procedure, but was made opt-in only in 2005 to cut onboarding costs.\n\n"; private static readonly Dictionary monsterNames = new Dictionary { { "hoarding", "Hoarding Bug" }, { "hoarding bug", "Hoarding Bug" }, { "snare", "Snare Flea" }, { "flea", "Snare Flea" }, { "snare flea", "Snare Flea" }, { "centipede", "Snare Flea" }, { "bunker spider", "Bunker Spider" }, { "bunker", "Bunker Spider" }, { "bunk", "Bunker Spider" }, { "spider", "Bunker Spider" }, { "baboon hawk", "Baboon Hawk" }, { "baboon", "Baboon Hawk" }, { "hawk", "Baboon Hawk" }, { "flowerman", "Bracken" }, { "bracken", "Bracken" }, { "crawler", "Half/Thumper" }, { "half", "Half/Thumper" }, { "thumper", "Half/Thumper" }, { "mouthdog", "Eyeless Dog" }, { "eyeless dog", "Eyeless Dog" }, { "eyeless", "Eyeless Dog" }, { "dog", "Eyeless Dog" }, { "tulip snake", "Tulip Snake" }, { "slowersnake", "Tulip Snake" }, { "flower snake", "Tulip Snake" }, { "snake", "Tulip Snake" }, { "forest giant", "Forest Giant" }, { "forest keeper", "Forest Giant" }, { "forestgiant", "Forest Giant" }, { "forestkeeper", "Forest Giant" }, { "manticoil", "Manticoil" }, { "manti coil", "Manticoil" }, { "bird", "Manticoil" }, { "puffer", "Spore Lizard" }, { "sporelizard", "Spore Lizard" }, { "spore lizard", "Spore Lizard" }, { "lizard", "Spore Lizard" }, { "fox", "Kidnapper Fox" }, { "kidnapper fox", "Kidnapper Fox" }, { "kidnapperfox", "Kidnapper Fox" }, { "bush wolf", "Kidnapper Fox" }, { "bushwolf", "Kidnapper Fox" }, { "wolf", "Kidnapper Fox" }, { "maneater", "Maneater" }, { "cave dweller", "Maneater" }, { "cavedweller", "Maneater" }, { "baby", "Maneater" }, { "babyeater", "Maneater" }, { "giant sapsucker", "Giant Kiwi" }, { "giant kiwi", "Giant Kiwi" }, { "woodpecker", "Giant Kiwi" }, { "giantkiwi", "Giant Kiwi" } }; private static Dictionary levels; public override bool CanInitializeOnStart { get { ITierUpgradeConfiguration hunterConfiguration = BaseUpgrade.GetConfiguration().HunterConfiguration; string[] array = hunterConfiguration.Prices.Value.Split(','); return array.Length == 0 || (array.Length == 1 && (array[0].Length == 0 || array[0] == "0")); } } public static void SetupLevels() { levels = new Dictionary(); string[] array = BaseUpgrade.GetConfiguration().HunterConfiguration.TierCollection.Value.ToLower().Split('-'); for (int i = 0; i < array.Length; i++) { foreach (string item in from x in array[i].Split(',') select x.Trim().ToLower()) { if (monsterNames.TryGetValue(item, out var value)) { if (levels.ContainsKey(value)) { logger.LogError(value + " appears twice in samples config! Appearing now as " + item); continue; } logger.LogInfo($"{value} set to be harvestable at level {i + 1}"); levels[value] = i; } else { logger.LogError("Unrecognized enemy name: " + item); } } } foreach (string key in HunterSamples.moddedLevels.Keys) { levels[key] = HunterSamples.moddedLevels[key]; monsterNames[key.ToLower()] = key; } } public static bool CanHarvest(string shortName) { if (!monsterNames.TryGetValue(shortName.ToLower(), out var value)) { logger.LogDebug(shortName + " is not harvestable"); return false; } if (levels.TryGetValue(value, out var value2)) { logger.LogDebug($"{value} can be harvested at level {value2 + 1}"); return value2 <= BaseUpgrade.GetUpgradeLevel("Hunter"); } logger.LogDebug(value + " cannot be harvested at any level"); return false; } private void Awake() { upgradeName = "Hunter"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().HunterConfiguration.OverrideName); Instance = this; } public static string GetHunterInfo(int level, int price) { string arg = string.Join(", ", from item in levels where item.Value == level select item.Key); return string.Format(AssetBundleHandler.GetInfoFromJSON("Hunter"), level + 1, BaseUpgrade.GetUpgradePrice(price, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().HunterConfiguration.PurchaseMode)), arg); } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nOn-the-job training program that teaches your crew how to properly collect lab-ready samples of blood, skin, and organ tissue from entities found within the facility. These samples are valuable to The Company. Used to be a part of the standard onboarding procedure, but was made opt-in only in 2005 to cut onboarding costs.\n\n"; } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append(GetHunterInfo(0, initialPrice)); for (int i = 0; i < maxLevels; i++) { stringBuilder.Append(GetHunterInfo(i + 1, incrementalPrices[i])); } return stringBuilder.ToString(); } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Hunter", BaseUpgrade.GetConfiguration().HunterConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Hunter"); } public new static CustomTerminalNode RegisterTerminalNode() { SetupLevels(); return UpgradeBus.Instance.SetupMultiplePurchaseableTerminalNode("Hunter", BaseUpgrade.GetConfiguration().HunterConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "Hunter"; } } } namespace MoreShipUpgrades.UpgradeComponents.OneTimeUpgrades { public class LightningRod : OneTimeUpgrade, IUpgradeWorldBuilding { public enum UpgradeMode { EffectiveRange, AlwaysRerouteItem, AlwaysRerouteRandom, AlwaysRerouteAll } public const string UPGRADE_NAME = "Lightning Rod"; internal const string WORLD_BUILDING_TEXT = "\n\nService key for the Ship's terminal which allows your crew to legally use the Ship's 'Static Attraction Field' module. Comes with a list of opt-in maintenance procedures that promise to optimize the module's function and field of influence. This Company-issued document is saddled with the uniquely-awkward task of having to ransom a safety feature back to the employee in text while not also admitting to the existence of an occupational hazard that was previously denied in court.\n\n"; public static LightningRod instance; private StormyWeather StormyWeather; public const string ENABLED_SECTION = "Enable Lightning Rod Upgrade"; public const bool ENABLED_DEFAULT = true; public const string ENABLED_DESCRIPTION = "A device which redirects lightning bolts to the ship."; public const string PRICE_SECTION = "Lightning Rod Price"; public const int PRICE_DEFAULT = 1000; public const string ACTIVE_SECTION = "Active on Purchase"; public const bool ACTIVE_DEFAULT = true; public const string ACTIVE_DESCRIPTION = "If true: Lightning Rod will be active on purchase."; public const string ACCESS_DENIED_MESSAGE = "You don't have access to this command yet. Purchase the 'Lightning Rod'.\n"; public const string TOGGLE_ON_MESSAGE = "Lightning Rod has been enabled. Lightning bolts will now be redirected to the ship.\n"; public const string TOGGLE_OFF_MESSAGE = "Lightning Rod has been disabled. Lightning bolts will no longer be redirected to the ship.\n"; public const string DIST_SECTION = "Effective Distance of Lightning Rod."; public const float DIST_DEFAULT = 175f; public const string DIST_DESCRIPTION = "The closer you are the more likely the rod will reroute lightning."; public const string UPGRADE_MODE_SECTION = "Current Upgrade Mode for Lightning Rod"; public const UpgradeMode UPGRADE_MODE_DEFAULT = UpgradeMode.EffectiveRange; public const string UPGRADE_MODE_DESCRIPTION = "Supported Values:\nEffectiveRange: The closer the item is to the ship, the more likely the lightning directed to it will be redirected to the ship instead.\nAlwaysRerouteItem: Whenever an item is picked to be hit by lightning, the bolt will be redirected to the ship instead.\nAlwaysRerouteRandom: Whenever a random lightning bolt (not the one used to target items) is produced, the bolt will be redirected to the ship instead.\nAlwaysRerouteAll: Whenever any kind of lightning bolt is produced, the bolt will be redirected to the ship instead.\n"; public static UpgradeMode CurrentUpgradeMode => SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().LightningRodConfiguration.AlternativeMode); public bool LightningIntercepted { get; internal set; } public override bool CanInitializeOnStart => BaseUpgrade.GetConfiguration().LightningRodConfiguration.Price.Value <= 0; private void Awake() { instance = this; upgradeName = "Lightning Rod"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().LightningRodConfiguration.OverrideName); } public static void TryInterceptLightning(ref StormyWeather __instance, ref GrabbableObject ___targetingMetalObject) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) bool flag = false; switch (CurrentUpgradeMode) { case UpgradeMode.EffectiveRange: { if ((Object)(object)___targetingMetalObject == (Object)null) { flag = false; break; } Terminal terminal = UpgradeBus.Instance.GetTerminal(); float num = Vector3.Distance(((Component)___targetingMetalObject).transform.position, ((Component)terminal).transform.position); if (num > BaseUpgrade.GetConfiguration().LightningRodConfiguration.Effect.Value) { return; } num /= BaseUpgrade.GetConfiguration().LightningRodConfiguration.Effect.Value; float num2 = 1f - num; float value = Random.value; flag = value < num2; break; } case UpgradeMode.AlwaysRerouteItem: flag = (Object)(object)___targetingMetalObject != (Object)null; break; case UpgradeMode.AlwaysRerouteRandom: flag = (Object)(object)___targetingMetalObject == (Object)null; break; case UpgradeMode.AlwaysRerouteAll: flag = true; break; } if (flag) { __instance.staticElectricityParticle.Stop(); instance.LightningIntercepted = true; instance.CoordinateInterceptionClientRpc(); } } public static void RerouteLightningBolt(ref Vector3 strikePosition, ref StormyWeather __instance) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) Terminal terminal = UpgradeBus.Instance.GetTerminal(); strikePosition = ((Component)terminal).transform.position; instance.LightningIntercepted = false; ((Component)__instance.staticElectricityParticle).gameObject.SetActive(true); } [ClientRpc] public void CoordinateInterceptionClientRpc() { //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) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1440413900u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1440413900u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; LightningIntercepted = true; if ((Object)(object)StormyWeather == (Object)null) { StormyWeather = Object.FindObjectOfType(true); } ((Component)StormyWeather.staticElectricityParticle).gameObject.SetActive(false); } } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nService key for the Ship's terminal which allows your crew to legally use the Ship's 'Static Attraction Field' module. Comes with a list of opt-in maintenance procedures that promise to optimize the module's function and field of influence. This Company-issued document is saddled with the uniquely-awkward task of having to ransom a safety feature back to the employee in text while not also admitting to the existence of an occupational hazard that was previously denied in court.\n\n"; } public override string GetDisplayInfo(int price = -1) { UpgradeMode currentUpgradeMode = CurrentUpgradeMode; if (1 == 0) { } string result = currentUpgradeMode switch { UpgradeMode.EffectiveRange => string.Format(AssetBundleHandler.GetInfoFromJSON("Lightning Rod"), BaseUpgrade.GetUpgradePrice(price, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().LightningRodConfiguration.PurchaseMode)), BaseUpgrade.GetConfiguration().LightningRodConfiguration.Effect.Value), UpgradeMode.AlwaysRerouteItem => "$" + BaseUpgrade.GetUpgradePrice(price, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().LightningRodConfiguration.PurchaseMode)) + " - Reroutes all lightning bolts directed to metallic objects to the ship's lightning rod.", UpgradeMode.AlwaysRerouteRandom => "$" + BaseUpgrade.GetUpgradePrice(price, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().LightningRodConfiguration.PurchaseMode)) + " - Reroutes all non-targetting lightning bolts to the ship's lightning rod.", UpgradeMode.AlwaysRerouteAll => "$" + BaseUpgrade.GetUpgradePrice(price, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().LightningRodConfiguration.PurchaseMode)) + " - Reroutes all kind of lightning bolts to the ship's lightning rod", _ => string.Empty, }; if (1 == 0) { } return result; } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Lightning Rod", BaseUpgrade.GetConfiguration().LightningRodConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Lightning Rod"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupOneTimeTerminalNode("Lightning Rod", BaseUpgrade.GetConfiguration().LightningRodConfiguration); } internal void ResetValues() { StormyWeather = null; } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1440413900u, new RpcReceiveHandler(__rpc_handler_1440413900), "CoordinateInterceptionClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_1440413900(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; ((LightningRod)(object)target).CoordinateInterceptionClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "LightningRod"; } } internal class MalwareBroadcaster : OneTimeUpgrade, IUpgradeWorldBuilding { internal const string UPGRADE_NAME = "Malware Broadcaster"; internal const string WORLD_BUILDING_TEXT = "\n\nIt used to be, back before the War, there was this rumor spread around about a 'failsafe equation' you could use to dispel forgotten landmines when you were exploring the Ruins. This string of logic has been hollered down dark stone hallways, been hurriedly punched into keypads, and been etched into peoples' mailboxes & doorjambs all over the Solar System for a century. The Company is selling your own cultural memories back to you.\n\n"; public static MalwareBroadcaster instance; public override bool CanInitializeOnStart => BaseUpgrade.GetConfiguration().MalwareBroadcasterUpgradeConfiguration.Price.Value <= 0; public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nIt used to be, back before the War, there was this rumor spread around about a 'failsafe equation' you could use to dispel forgotten landmines when you were exploring the Ruins. This string of logic has been hollered down dark stone hallways, been hurriedly punched into keypads, and been etched into peoples' mailboxes & doorjambs all over the Solar System for a century. The Company is selling your own cultural memories back to you.\n\n"; } private void Awake() { upgradeName = "Malware Broadcaster"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().MalwareBroadcasterUpgradeConfiguration.OverrideName); instance = this; } [ServerRpc(RequireOwnership = false)] public void ReqDestroyObjectServerRpc(NetworkObjectReference go) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(457311902u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref go, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 457311902u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val3 = default(NetworkObject); ((NetworkObjectReference)(ref go)).TryGet(ref val3, (NetworkManager)null); if ((Object)(object)val3 == (Object)null) { HUDManager.Instance.AddTextToChatOnServer("Can't retrieve obj", 0); return; } if (BaseUpgrade.GetConfiguration().MalwareBroadcasterUpgradeConfiguration.ExplodeTraps.Value) { SpawnExplosionClientRpc(((Component)val3).gameObject.transform.position); } val3.Despawn(true); } internal static bool IsMapHazard(ref TerminalAccessibleObject possibleHazard) { if (((Component)possibleHazard).gameObject.layer == LayerMask.NameToLayer("MapHazards")) { return true; } if ((Object)(object)((Component)possibleHazard).transform.parent != (Object)null && ((Component)((Component)possibleHazard).transform.parent).gameObject.layer == LayerMask.NameToLayer("MapHazards")) { return true; } if (IsLandmine(ref possibleHazard)) { return true; } if (IsTurret(ref possibleHazard)) { return true; } if (MissileTurretsCompat.Enabled && MissileTurretsCompat.IsMissileTurret(ref possibleHazard)) { return true; } return IsSpikeRoofTrap(ref possibleHazard); } internal static bool IsLandmine(ref TerminalAccessibleObject possibleHazard) { return (Object)(object)((Component)possibleHazard).GetComponent() != (Object)null; } internal static bool IsTurret(ref TerminalAccessibleObject possibleHazard) { return (Object)(object)((Component)possibleHazard).GetComponent() != (Object)null; } internal static bool IsSpikeRoofTrap(ref TerminalAccessibleObject possibleHazard) { Transform parent = ((Component)possibleHazard).transform.parent; if ((Object)(object)parent == (Object)null) { return false; } Transform val = parent.Find("AnimContainer"); if ((Object)(object)val == (Object)null) { return false; } return (Object)(object)((Component)val).GetComponentInChildren() != (Object)null; } [ClientRpc] private void SpawnExplosionClientRpc(Vector3 position) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2073079289u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2073079289u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (BaseUpgrade.GetConfiguration().MalwareBroadcasterUpgradeConfiguration.ExplodeTraps.Value) { Tools.SpawnExplosion(position + Vector3.up, spawnExplosionEffect: true, 5.7f, 6.4f); } } } public override string GetDisplayInfo(int price = -1) { return string.Concat(str2: (!BaseUpgrade.GetConfiguration().MalwareBroadcasterUpgradeConfiguration.DestroyTraps.Value) ? $"Broadcasted codes now disable map hazards for {BaseUpgrade.GetConfiguration().MalwareBroadcasterUpgradeConfiguration.DisarmTime.Value} seconds." : ((!BaseUpgrade.GetConfiguration().MalwareBroadcasterUpgradeConfiguration.ExplodeTraps.Value) ? "Broadcasted codes now destroy map hazards." : "Broadcasted codes now explode map hazards."), str0: BaseUpgrade.GetUpgradePrice(price, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().MalwareBroadcasterUpgradeConfiguration.PurchaseMode)), str1: " - "); } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Malware Broadcaster", BaseUpgrade.GetConfiguration().MalwareBroadcasterUpgradeConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Malware Broadcaster"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupOneTimeTerminalNode("Malware Broadcaster", BaseUpgrade.GetConfiguration().MalwareBroadcasterUpgradeConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(457311902u, new RpcReceiveHandler(__rpc_handler_457311902), "ReqDestroyObjectServerRpc"); ((NetworkBehaviour)this).__registerRpc(2073079289u, new RpcReceiveHandler(__rpc_handler_2073079289), "SpawnExplosionClientRpc"); base.__initializeRpcs(); } private static void __rpc_handler_457311902(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference go = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref go, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((MalwareBroadcaster)(object)target).ReqDestroyObjectServerRpc(go); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2073079289(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); target.__rpc_exec_stage = (__RpcExecStage)1; ((MalwareBroadcaster)(object)target).SpawnExplosionClientRpc(position); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "MalwareBroadcaster"; } } } namespace MoreShipUpgrades.UpgradeComponents.OneTimeUpgrades.Store { internal class FasterDropPod : OneTimeUpgrade, IUpgradeWorldBuilding { public const string UPGRADE_NAME = "Drop Pod Thrusters"; internal const string WORLD_BUILDING_TEXT = "\n\nPlaces your department on the 'Priority Shipping List'; your purchases should arrive ~30 minutes faster than before. It's estimated that for every department that signs up for this package, every department on the standard shipping list has their orders delayed by roughly 1.7 seconds.\n\n"; public static FasterDropPod Instance; public override bool CanInitializeOnStart => BaseUpgrade.GetConfiguration().DropPodThrustersConfiguration.Price.Value <= 0; public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nPlaces your department on the 'Priority Shipping List'; your purchases should arrive ~30 minutes faster than before. It's estimated that for every department that signs up for this package, every department on the standard shipping list has their orders delayed by roughly 1.7 seconds.\n\n"; } internal override void Start() { upgradeName = "Drop Pod Thrusters"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().DropPodThrustersConfiguration.OverrideName); base.Start(); } private void Awake() { Instance = this; } public static float GetFirstOrderTimer(float defaultValue) { DropPodThrustersUpgradeConfiguration dropPodThrustersConfiguration = BaseUpgrade.GetConfiguration().DropPodThrustersConfiguration; if (!dropPodThrustersConfiguration.Enabled.Value) { return defaultValue; } if (!BaseUpgrade.GetActiveUpgrade("Drop Pod Thrusters")) { return defaultValue; } return Mathf.Clamp(defaultValue + dropPodThrustersConfiguration.InitialTimer.Value, defaultValue, defaultValue + dropPodThrustersConfiguration.Timer.Value); } public static float GetUpgradedTimer(float defaultValue) { DropPodThrustersUpgradeConfiguration dropPodThrustersConfiguration = BaseUpgrade.GetConfiguration().DropPodThrustersConfiguration; if (!dropPodThrustersConfiguration.Enabled.Value) { return defaultValue; } if (!BaseUpgrade.GetActiveUpgrade("Drop Pod Thrusters")) { return defaultValue; } return Mathf.Clamp(defaultValue - dropPodThrustersConfiguration.Timer.Value, 0f, defaultValue); } public static bool CanLeaveEarly(float shipTimer) { return shipTimer > BaseUpgrade.GetConfiguration().DropPodThrustersConfiguration.ExitTimer.Value; } public static bool IsUpgradeActive() { return BaseUpgrade.GetActiveUpgrade("Drop Pod Thrusters"); } public override string GetDisplayInfo(int price = -1) { return "$" + BaseUpgrade.GetUpgradePrice(price, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().DropPodThrustersConfiguration.PurchaseMode)) + " - Make the Drop Pod, the ship that deliver items bought on the terminal, land faster."; } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Drop Pod Thrusters", BaseUpgrade.GetConfiguration().DropPodThrustersConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Drop Pod Thrusters"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupOneTimeTerminalNode("Drop Pod Thrusters", BaseUpgrade.GetConfiguration().DropPodThrustersConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "FasterDropPod"; } } internal class LethalDeals : OneTimeUpgrade, IUpgradeWorldBuilding { public const string UPGRADE_NAME = "Lethal Deals"; internal const string WORLD_BUILDING_TEXT = "\n\nThe Company Store Loyalty Rewards Program. For a small fee and all of your personally-identifying information, you will be made eligible for one GUARANTEED random discount each Store rotation. Comes with a little plastic card for your keychain. There's a barcode on it, but the Terminal has nothing to scan the barcode with, so who knows what it's really for.\n\n"; private const int GUARANTEED_ITEMS_AMOUNT = 1; public override bool CanInitializeOnStart => BaseUpgrade.GetConfiguration().LethalDealsConfiguration.Price.Value <= 0; public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nThe Company Store Loyalty Rewards Program. For a small fee and all of your personally-identifying information, you will be made eligible for one GUARANTEED random discount each Store rotation. Comes with a little plastic card for your keychain. There's a barcode on it, but the Terminal has nothing to scan the barcode with, so who knows what it's really for.\n\n"; } private void Awake() { upgradeName = "Lethal Deals"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().LethalDealsConfiguration.OverrideName); } public static int GetLethalDealsGuaranteedItems(int amount) { if (!BaseUpgrade.GetActiveUpgrade("Lethal Deals")) { return amount; } return 1; } public override string GetDisplayInfo(int price = -1) { return "$" + BaseUpgrade.GetUpgradePrice(price, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().LethalDealsConfiguration.PurchaseMode)) + " - Guarantees at least one item will be on sale in the store."; } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Lethal Deals", BaseUpgrade.GetConfiguration().LethalDealsConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Lethal Deals"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupOneTimeTerminalNode("Lethal Deals", BaseUpgrade.GetConfiguration().LethalDealsConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "LethalDeals"; } } public class Sigurd : OneTimeUpgrade, IUpgradeWorldBuilding { public enum FunctionModes { LastDay, AllDays } public const string UPGRADE_NAME = "Sigurd Access"; internal const string WORLD_BUILDING_TEXT = "\n\nSigurd always laughed at Desmond when he remembered the stories about The Company paying 120% of the value of the scrap. Before disappearing, Sigurd found a module for the ship's terminal. After installing this mysterious module, the last scrap sale that Sigurd made was recorded at a value above normal."; public static Sigurd Instance; public override bool CanInitializeOnStart => BaseUpgrade.GetConfiguration().SigurdAccessConfiguration.Enabled.Value && BaseUpgrade.GetConfiguration().SigurdAccessConfiguration.Price.Value <= 0; internal override void Start() { upgradeName = "Sigurd Access"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().SigurdAccessConfiguration.OverrideName); base.Start(); } private void Awake() { Instance = this; } public static float GetBuyingRate(float defaultValue) { SigurdAccessUpgradeConfiguration sigurdAccessConfiguration = BaseUpgrade.GetConfiguration().SigurdAccessConfiguration; if (!sigurdAccessConfiguration.Enabled.Value) { return defaultValue; } if (!BaseUpgrade.GetActiveUpgrade("Sigurd Access")) { return defaultValue; } switch (sigurdAccessConfiguration.AlternativeMode.Value) { case FunctionModes.LastDay: if (TimeOfDay.Instance.daysUntilDeadline != 0) { return defaultValue; } break; } Random random = new Random(StartOfRound.Instance.randomMapSeed); if ((float)random.Next(0, 100) < Mathf.Clamp(sigurdAccessConfiguration.Chance.Value, 0f, 100f)) { return defaultValue + sigurdAccessConfiguration.Effect.Value / 100f; } return defaultValue; } public override string GetDisplayInfo(int price = -1) { return BaseUpgrade.GetUpgradePrice(price, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().SigurdAccessConfiguration.PurchaseMode)) + " - There's a chance that the company will pay more."; } public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nSigurd always laughed at Desmond when he remembered the stories about The Company paying 120% of the value of the scrap. Before disappearing, Sigurd found a module for the ship's terminal. After installing this mysterious module, the last scrap sale that Sigurd made was recorded at a value above normal."; } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Sigurd Access", BaseUpgrade.GetConfiguration().SigurdAccessConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Sigurd Access"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupOneTimeTerminalNode("Sigurd Access", BaseUpgrade.GetConfiguration().SigurdAccessConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "Sigurd"; } } } namespace MoreShipUpgrades.UpgradeComponents.OneTimeUpgrades.Ship { internal class FastEncryption : OneTimeUpgrade, IUpgradeWorldBuilding { public const string UPGRADE_NAME = "Fast Encryption"; internal const string WORLD_BUILDING_TEXT = "\n\nA small tweak for the signal translator that optimizes the way it compresses text over the Proprietary Network. Don't forget that the Company keeps records of all department transmissions for training purposes, and that your on-the-job conversations may be subject to playback and review by your Employer.\n\n"; public static FastEncryption instance; private const float TRANSMIT_MULTIPLIER = 0.2f; public override bool CanInitializeOnStart => BaseUpgrade.GetConfiguration().FastEncryptionConfiguration.Price.Value <= 0; public string GetWorldBuildingText(bool shareStatus = false) { return "\n\nA small tweak for the signal translator that optimizes the way it compresses text over the Proprietary Network. Don't forget that the Company keeps records of all department transmissions for training purposes, and that your on-the-job conversations may be subject to playback and review by your Employer.\n\n"; } private void Awake() { upgradeName = "Fast Encryption"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().FastEncryptionConfiguration.OverrideName); instance = this; } public static int GetLimitOfCharactersTransmit(int defaultLimit, string message) { if (!BaseUpgrade.GetActiveUpgrade("Fast Encryption")) { return defaultLimit; } return message.Length; } public static float GetMultiplierOnSignalTextTimer(float defaultMultiplier) { if (!BaseUpgrade.GetActiveUpgrade("Fast Encryption")) { return defaultMultiplier; } return defaultMultiplier * 0.2f; } public override string GetDisplayInfo(int price = -1) { return BaseUpgrade.GetUpgradePrice(price, SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().FastEncryptionConfiguration.PurchaseMode)) + " - The transmitter will write the letters faster and the restriction of characters will be lifted."; } public new static (string, string[]) RegisterScrapToUpgrade() { return ("Fast Encryption", BaseUpgrade.GetConfiguration().FastEncryptionConfiguration.ItemProgressionItems.Value.Split(",")); } public new static void RegisterUpgrade() { BaseUpgrade.SetupGenericPerk("Fast Encryption"); } public new static CustomTerminalNode RegisterTerminalNode() { return UpgradeBus.Instance.SetupOneTimeTerminalNode("Fast Encryption", BaseUpgrade.GetConfiguration().FastEncryptionConfiguration); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } protected internal override string __getTypeName() { return "FastEncryption"; } } } namespace MoreShipUpgrades.UpgradeComponents.OneTimeUpgrades.Player { internal class LockSmith : OneTimeUpgrade, IUpgradeWorldBuilding { [CompilerGenerated] private sealed class d__19 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public List lst; public LockSmith <>4__this; private int 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__19(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.75f); <>1__state = 1; return true; case 1: <>1__state = -1; 5__1 = 0; break; case 2: <>1__state = -1; ((Graphic)<>4__this.pins[lst[5__1]].GetComponent()).color = Color.white; 5__1++; break; } if (5__1 < lst.Count) { ((Graphic)<>4__this.pins[lst[5__1]].GetComponent()).color = Color.green; <>2__current = (object)new WaitForSeconds(0.25f); <>1__state = 2; return true; } <>4__this.canPick = true; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } internal const string UPGRADE_NAME = "Locksmith"; internal const string WORLD_BUILDING_TEXT = "\n\nOn-the-job training package that supplies {0} with proprietary knowledge of the 'Ram, Scan, Bump' technique for bypassing The Company's proprietary Low-Tech Manual Security Doors' security system. Comes with an 'all-nines-notched' key, a rubber gasket, and a plastic handle on a metal rod {1}.\n\n"; public static LockSmith instance; private List pins; private readonly List order = new List(5) { 0, 1, 2, 3, 4 }; private int currentPin; public DoorLock currentDoor; private bool canPick; public int timesStruck; public override bool CanInitializeOnStart => BaseUpgrade.GetConfiguration().LocksmithConfiguration.Price.Value <= 0; private void Awake() { upgradeName = "Locksmith"; overridenUpgradeName = SyncedEntry.op_Implicit(BaseUpgrade.GetConfiguration().LocksmithConfiguration.OverrideName); instance = this; } internal override void Start() { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Expected O, but got Unknown //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Expected O, but got Unknown base.Start(); Transform child = ((Component)this).transform.GetChild(0).GetChild(0).GetChild(0); GameObject gameObject = ((Component)child.GetChild(0)).gameObject; GameObject gameObject2 = ((Component)child.GetChild(1)).gameObject; GameObject gameObject3 = ((Component)child.GetChild(2)).gameObject; GameObject gameObject4 = ((Component)child.GetChild(3)).gameObject; GameObject gameObject5 = ((Component)child.GetChild(4)).gameObject; ((UnityEvent)((Component)gameObject.transform.GetChild(0)).GetComponent