Decompiled source of Zikeji s Convenience Modpack Lite v2.4.3
MoreShipUpgrades/MoreShipUpgrades.dll
Decompiled 2 years ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using CSync.Lib; using CSync.Util; using GameNetcodeStuff; using HarmonyLib; using LethalCompanyInputUtils.Api; using LethalLib.Extras; using LethalLib.Modules; using Microsoft.CodeAnalysis; using MoreShipUpgrades.Compat; using MoreShipUpgrades.Input; using MoreShipUpgrades.Managers; using MoreShipUpgrades.Misc; using MoreShipUpgrades.Misc.TerminalNodes; using MoreShipUpgrades.Misc.Upgrades; using MoreShipUpgrades.NetcodePatcher; 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.PortableTeleporter; using MoreShipUpgrades.UpgradeComponents.Items.RadarBooster; using MoreShipUpgrades.UpgradeComponents.Items.Wheelbarrow; using MoreShipUpgrades.UpgradeComponents.OneTimeUpgrades; using MoreShipUpgrades.UpgradeComponents.TierUpgrades; using MoreShipUpgrades.UpgradeComponents.TierUpgrades.AttributeUpgrades; using Newtonsoft.Json; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.InputSystem.LowLevel; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] internal class <Module> { static <Module>() { } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace MoreShipUpgrades { [BepInPlugin("com.malco.lethalcompany.moreshipupgrades", "More Ship Upgrades", "3.4.3")] [BepInDependency("evaisa.lethallib", "0.13.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { private readonly Harmony harmony = new Harmony("com.malco.lethalcompany.moreshipupgrades"); internal static readonly ManualLogSource mls = Logger.CreateLogSource("More Ship Upgrades"); private AudioClip itemBreak; private AudioClip buttonPressed; private AudioClip error; private AudioClip[] wheelbarrowSound; private AudioClip[] shoppingCartSound; public static PluginConfig Config; private void Awake() { //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Expected O, but got Unknown //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Expected O, but got Unknown Config = new PluginConfig(((BaseUnityPlugin)this).Config); IEnumerable<Type> enumerable; try { enumerable = Assembly.GetExecutingAssembly().GetTypes(); } catch (ReflectionTypeLoadException ex) { enumerable = ex.Types.Where((Type t) => t != null); } foreach (Type item in enumerable) { MethodInfo[] methods = item.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array = methods; foreach (MethodInfo methodInfo in array) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "shipupgrades"); AssetBundle bundle = AssetBundle.LoadFromFile(text); GameObject val = new GameObject("UpgradeBus"); ((Object)val).hideFlags = (HideFlags)61; val.AddComponent<UpgradeBus>(); val = new GameObject("SpawnItemManager"); val.AddComponent<SpawnItemManager>(); UpgradeBus.Instance.version = "3.4.3"; UpgradeBus.Instance.UpgradeAssets = bundle; SetupModStore(ref bundle); SetupIntroScreen(); SetupItems(); SetupPerks(); SetupContractMapObjects(ref bundle); if (InputUtils_Compat.Enabled) { InputUtils_Compat.Init(); } harmony.PatchAll(); mls.LogDebug((object)"LGU has been patched"); } public void sendModInfo() { foreach (KeyValuePair<string, PluginInfo> item in Chainloader.PluginInfos.Where((KeyValuePair<string, PluginInfo> plugin) => plugin.Value.Metadata.GUID.Contains("ModSync"))) { try { List<string> list = new List<string> { "malco", "LateGameUpgrades" }; ((Component)item.Value.Instance).BroadcastMessage("getModInfo", (object)list, (SendMessageOptions)1); } catch (Exception ex) { mls.LogDebug((object)("Failed to send info to ModSync, go yell at Minx for " + ex.StackTrace)); } } } private void SetupContractMapObjects(ref AssetBundle bundle) { //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) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown AnimationCurve curve = new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, 1f), new Keyframe(1f, 1f) }); SetupScavContract(ref bundle, curve); SetupExterminatorContract(curve); SetupDataContract(curve); SetupExorcismContract(curve); SetupBombContract(curve); } private void SetupBombContract(AnimationCurve curve) { //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown Item itemObject = AssetBundleHandler.GetItemObject("Bomb"); itemObject.spawnPrefab.AddComponent<ScrapValueSyncer>(); itemObject.isConductiveMetal = false; DefusalContract defusalContract = itemObject.spawnPrefab.AddComponent<DefusalContract>(); defusalContract.SetPosition = true; BombDefusalScript bombDefusalScript = itemObject.spawnPrefab.AddComponent<BombDefusalScript>(); bombDefusalScript.snip = AssetBundleHandler.GetAudioClip("Bomb Cut"); bombDefusalScript.tick = AssetBundleHandler.GetAudioClip("Bomb Tick"); Utilities.FixMixerGroups(itemObject.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(itemObject.spawnPrefab); Items.RegisterItem(itemObject); SpawnableMapObjectDef val = ScriptableObject.CreateInstance<SpawnableMapObjectDef>(); val.spawnableMapObject = new SpawnableMapObject(); val.spawnableMapObject.prefabToSpawn = itemObject.spawnPrefab; MapObjects.RegisterMapObject(val, (LevelTypes)(-1), (Func<SelectableLevel, AnimationCurve>)((SelectableLevel level) => curve)); } private void SetupExorcismContract(AnimationCurve curve) { //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Expected O, but got Unknown Item itemObject = AssetBundleHandler.GetItemObject("Demon Tome"); itemObject.spawnPrefab.AddComponent<ScrapValueSyncer>(); Items.RegisterItem(itemObject); Utilities.FixMixerGroups(itemObject.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(itemObject.spawnPrefab); Item itemObject2 = AssetBundleHandler.GetItemObject("Pentagram"); for (int i = 0; i < 5; i++) { Item itemObject3 = AssetBundleHandler.GetItemObject("RitualItem" + i); itemObject3.spawnPrefab.AddComponent<ExorcismContract>(); Items.RegisterItem(itemObject3); Utilities.FixMixerGroups(itemObject3.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(itemObject3.spawnPrefab); SpawnableMapObjectDef val = ScriptableObject.CreateInstance<SpawnableMapObjectDef>(); val.spawnableMapObject = new SpawnableMapObject(); val.spawnableMapObject.prefabToSpawn = itemObject3.spawnPrefab; MapObjects.RegisterMapObject(val, (LevelTypes)(-1), (Func<SelectableLevel, AnimationCurve>)((SelectableLevel level) => new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, 3f), new Keyframe(1f, 3f) }))); } ExorcismContract exorcismContract = itemObject2.spawnPrefab.AddComponent<ExorcismContract>(); exorcismContract.SetPosition = true; PentagramScript pentagramScript = itemObject2.spawnPrefab.AddComponent<PentagramScript>(); pentagramScript.loot = itemObject.spawnPrefab; pentagramScript.chant = AssetBundleHandler.GetAudioClip("Ritual Fail"); pentagramScript.portal = AssetBundleHandler.GetAudioClip("Ritual Success"); Utilities.FixMixerGroups(itemObject2.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(itemObject2.spawnPrefab); Items.RegisterItem(itemObject2); SpawnableMapObjectDef val2 = ScriptableObject.CreateInstance<SpawnableMapObjectDef>(); val2.spawnableMapObject = new SpawnableMapObject(); val2.spawnableMapObject.prefabToSpawn = itemObject2.spawnPrefab; MapObjects.RegisterMapObject(val2, (LevelTypes)(-1), (Func<SelectableLevel, AnimationCurve>)((SelectableLevel level) => curve)); } private void SetupExterminatorContract(AnimationCurve curve) { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown Item itemObject = AssetBundleHandler.GetItemObject("HoardingBugEggsLoot"); itemObject.spawnPrefab.AddComponent<ScrapValueSyncer>(); Items.RegisterItem(itemObject); Utilities.FixMixerGroups(itemObject.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(itemObject.spawnPrefab); Item itemObject2 = AssetBundleHandler.GetItemObject("HoardingBugEggs"); ExterminatorContract exterminatorContract = itemObject2.spawnPrefab.AddComponent<ExterminatorContract>(); exterminatorContract.SetPosition = true; BugNestScript bugNestScript = itemObject2.spawnPrefab.AddComponent<BugNestScript>(); bugNestScript.loot = itemObject.spawnPrefab; Utilities.FixMixerGroups(itemObject2.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(itemObject2.spawnPrefab); Items.RegisterItem(itemObject2); SpawnableMapObjectDef val = ScriptableObject.CreateInstance<SpawnableMapObjectDef>(); val.spawnableMapObject = new SpawnableMapObject(); val.spawnableMapObject.prefabToSpawn = itemObject2.spawnPrefab; MapObjects.RegisterMapObject(val, (LevelTypes)(-1), (Func<SelectableLevel, AnimationCurve>)((SelectableLevel level) => curve)); } private void SetupScavContract(ref AssetBundle bundle, AnimationCurve curve) { //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Expected O, but got Unknown Item itemObject = AssetBundleHandler.GetItemObject("Scavenger"); if (!((Object)(object)itemObject == (Object)null)) { itemObject.weight = SyncedInstance<PluginConfig>.Instance.CONTRACT_EXTRACT_WEIGHT.Value; ExtractionContract extractionContract = itemObject.spawnPrefab.AddComponent<ExtractionContract>(); extractionContract.SetPosition = true; ExtractPlayerScript extractPlayerScript = itemObject.spawnPrefab.AddComponent<ExtractPlayerScript>(); itemObject.spawnPrefab.AddComponent<ScrapValueSyncer>(); TextAsset genericAsset = AssetBundleHandler.GetGenericAsset<TextAsset>("Scavenger Sounds"); Dictionary<string, string[]> dictionary = JsonConvert.DeserializeObject<Dictionary<string, string[]>>(genericAsset.text); ExtractPlayerScript.clipDict.Add("lost", CreateAudioClipArray(dictionary["lost"], ref bundle)); ExtractPlayerScript.clipDict.Add("heal", CreateAudioClipArray(dictionary["heal"], ref bundle)); ExtractPlayerScript.clipDict.Add("safe", CreateAudioClipArray(dictionary["safe"], ref bundle)); ExtractPlayerScript.clipDict.Add("held", CreateAudioClipArray(dictionary["held"], ref bundle)); Utilities.FixMixerGroups(itemObject.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(itemObject.spawnPrefab); Items.RegisterItem(itemObject); SpawnableMapObjectDef val = ScriptableObject.CreateInstance<SpawnableMapObjectDef>(); val.spawnableMapObject = new SpawnableMapObject(); val.spawnableMapObject.prefabToSpawn = itemObject.spawnPrefab; MapObjects.RegisterMapObject(val, (LevelTypes)(-1), (Func<SelectableLevel, AnimationCurve>)((SelectableLevel level) => curve)); } } private void SetupDataContract(AnimationCurve curve) { //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown Item itemObject = AssetBundleHandler.GetItemObject("Floppy Disk"); itemObject.spawnPrefab.AddComponent<ScrapValueSyncer>(); Items.RegisterItem(itemObject); Utilities.FixMixerGroups(itemObject.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(itemObject.spawnPrefab); Item itemObject2 = AssetBundleHandler.GetItemObject("Laptop"); DataRetrievalContract dataRetrievalContract = itemObject2.spawnPrefab.AddComponent<DataRetrievalContract>(); dataRetrievalContract.SetPosition = true; DataPCScript dataPCScript = itemObject2.spawnPrefab.AddComponent<DataPCScript>(); dataPCScript.error = AssetBundleHandler.GetAudioClip("Laptop Error"); dataPCScript.startup = AssetBundleHandler.GetAudioClip("Laptop Start"); dataPCScript.loot = itemObject.spawnPrefab; Utilities.FixMixerGroups(itemObject2.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(itemObject2.spawnPrefab); Items.RegisterItem(itemObject2); SpawnableMapObjectDef val = ScriptableObject.CreateInstance<SpawnableMapObjectDef>(); val.spawnableMapObject = new SpawnableMapObject(); val.spawnableMapObject.prefabToSpawn = itemObject2.spawnPrefab; MapObjects.RegisterMapObject(val, (LevelTypes)(-1), (Func<SelectableLevel, AnimationCurve>)((SelectableLevel level) => curve)); } private AudioClip[] CreateAudioClipArray(string[] paths, ref AssetBundle bundle) { AudioClip[] array = (AudioClip[])(object)new AudioClip[paths.Length]; for (int i = 0; i < paths.Length; i++) { array[i] = AssetBundleHandler.TryLoadAudioClipAsset(ref bundle, paths[i]); } return array; } private void SetupModStore(ref AssetBundle bundle) { GameObject val = AssetBundleHandler.TryLoadGameObjectAsset(ref bundle, "Assets/ShipUpgrades/LguStore.prefab"); if (!((Object)(object)val == (Object)null)) { val.AddComponent<ContractManager>(); val.AddComponent<LguStore>(); NetworkPrefabs.RegisterNetworkPrefab(val); UpgradeBus.Instance.modStorePrefab = val; } } private void SetupIntroScreen() { UpgradeBus.Instance.IntroScreen = AssetBundleHandler.GetPerkGameObject("Intro Screen"); if ((Object)(object)UpgradeBus.Instance.IntroScreen != (Object)null) { UpgradeBus.Instance.IntroScreen.AddComponent<IntroScreenScript>(); } } private void SetupItems() { SetupTeleporterButtons(); SetupNightVision(); SetupMedkit(); SetupPeeper(); SetupSamples(); SetupHelmet(); SetupDivingKit(); SetupWheelbarrows(); } private void SetupSamples() { Dictionary<string, int> dictionary = new Dictionary<string, int> { { "centipede", SyncedInstance<PluginConfig>.Instance.SNARE_FLEA_SAMPLE_MINIMUM_VALUE.Value }, { "bunker spider", SyncedInstance<PluginConfig>.Instance.BUNKER_SPIDER_SAMPLE_MINIMUM_VALUE.Value }, { "hoarding bug", SyncedInstance<PluginConfig>.Instance.HOARDING_BUG_SAMPLE_MINIMUM_VALUE.Value }, { "flowerman", SyncedInstance<PluginConfig>.Instance.BRACKEN_SAMPLE_MINIMUM_VALUE.Value }, { "mouthdog", SyncedInstance<PluginConfig>.Instance.EYELESS_DOG_SAMPLE_MINIMUM_VALUE.Value }, { "baboon hawk", SyncedInstance<PluginConfig>.Instance.BABOON_HAWK_SAMPLE_MINIMUM_VALUE.Value }, { "crawler", SyncedInstance<PluginConfig>.Instance.THUMPER_SAMPLE_MINIMUM_VALUE.Value } }; Dictionary<string, int> dictionary2 = new Dictionary<string, int> { { "centipede", SyncedInstance<PluginConfig>.Instance.SNARE_FLEA_SAMPLE_MAXIMUM_VALUE.Value }, { "bunker spider", SyncedInstance<PluginConfig>.Instance.BUNKER_SPIDER_SAMPLE_MAXIMUM_VALUE.Value }, { "hoarding bug", SyncedInstance<PluginConfig>.Instance.HOARDING_BUG_SAMPLE_MAXIMUM_VALUE.Value }, { "flowerman", SyncedInstance<PluginConfig>.Instance.BRACKEN_SAMPLE_MAXIMUM_VALUE.Value }, { "mouthdog", SyncedInstance<PluginConfig>.Instance.EYELESS_DOG_SAMPLE_MAXIMUM_VALUE.Value }, { "baboon hawk", SyncedInstance<PluginConfig>.Instance.BABOON_HAWK_SAMPLE_MAXIMUM_VALUE.Value }, { "crawler", SyncedInstance<PluginConfig>.Instance.THUMPER_SAMPLE_MAXIMUM_VALUE.Value } }; foreach (string key in AssetBundleHandler.samplePaths.Keys) { Item itemObject = AssetBundleHandler.GetItemObject(key); MonsterSample monsterSample = itemObject.spawnPrefab.AddComponent<MonsterSample>(); ((GrabbableObject)monsterSample).grabbable = true; ((GrabbableObject)monsterSample).grabbableToEnemies = true; ((GrabbableObject)monsterSample).itemProperties = itemObject; ((GrabbableObject)monsterSample).itemProperties.minValue = dictionary[key]; ((GrabbableObject)monsterSample).itemProperties.maxValue = dictionary2[key]; itemObject.spawnPrefab.AddComponent<ScrapValueSyncer>(); NetworkPrefabs.RegisterNetworkPrefab(itemObject.spawnPrefab); SpawnItemManager.Instance.samplePrefabs.Add(key, itemObject.spawnPrefab); } } private void SetupTeleporterButtons() { itemBreak = AssetBundleHandler.GetAudioClip("Break"); error = AssetBundleHandler.GetAudioClip("Error"); buttonPressed = AssetBundleHandler.GetAudioClip("Button Press"); if (!((Object)(object)itemBreak == (Object)null) && !((Object)(object)error == (Object)null) && !((Object)(object)buttonPressed == (Object)null)) { SetupRegularTeleporterButton(); SetupAdvancedTeleporterButton(); } } private void SetupHelmet() { Item itemObject = AssetBundleHandler.GetItemObject("HelmetItem"); UpgradeBus.Instance.helmetModel = AssetBundleHandler.GetPerkGameObject("HelmetModel"); if (!((Object)(object)itemObject == (Object)null)) { UpgradeBus.Instance.SFX.Add("helmet", AssetBundleHandler.GetAudioClip("HelmetHit")); UpgradeBus.Instance.SFX.Add("breakWood", AssetBundleHandler.GetAudioClip("breakWood")); Helmet helmet = itemObject.spawnPrefab.AddComponent<Helmet>(); ((GrabbableObject)helmet).itemProperties = itemObject; ((GrabbableObject)helmet).grabbable = true; ((GrabbableObject)helmet).grabbableToEnemies = true; itemObject.creditsWorth = SyncedInstance<PluginConfig>.Instance.HELMET_PRICE.Value; NetworkPrefabs.RegisterNetworkPrefab(itemObject.spawnPrefab); UpgradeBus.Instance.ItemsToSync.Add("Helmet", itemObject); SetupStoreItem(itemObject); } } private TerminalNode SetupInfoNode(Item storeItem) { TerminalNode val = ScriptableObject.CreateInstance<TerminalNode>(); GrabbableObject component = storeItem.spawnPrefab.GetComponent<GrabbableObject>(); if (component is IDisplayInfo displayInfo) { val.displayText = val.displayText + displayInfo.GetDisplayInfo() + "\n"; } if (component is IItemWorldBuilding itemWorldBuilding) { val.displayText = val.displayText + itemWorldBuilding.GetWorldBuildingText() + "\n"; } val.clearPreviousText = true; return val; } private void SetupStoreItem(Item storeItem) { TerminalNode val = SetupInfoNode(storeItem); Items.RegisterShopItem(storeItem, (TerminalNode)null, (TerminalNode)null, val, storeItem.creditsWorth); } private void SetupRegularTeleporterButton() { Item itemObject = AssetBundleHandler.GetItemObject("Portable Tele"); if (!((Object)(object)itemObject == (Object)null)) { itemObject.itemName = "Portable Tele"; itemObject.itemId = 492012; RegularPortableTeleporter regularPortableTeleporter = itemObject.spawnPrefab.AddComponent<RegularPortableTeleporter>(); ((GrabbableObject)regularPortableTeleporter).itemProperties = itemObject; ((GrabbableObject)regularPortableTeleporter).grabbable = true; ((GrabbableObject)regularPortableTeleporter).grabbableToEnemies = true; regularPortableTeleporter.ItemBreak = itemBreak; ((GrabbableObject)regularPortableTeleporter).useCooldown = 2f; regularPortableTeleporter.error = error; regularPortableTeleporter.buttonPress = buttonPressed; itemObject.creditsWorth = SyncedInstance<PluginConfig>.Instance.WEAK_TELE_PRICE.Value; NetworkPrefabs.RegisterNetworkPrefab(itemObject.spawnPrefab); UpgradeBus.Instance.ItemsToSync.Add("Tele", itemObject); SetupStoreItem(itemObject); } } private void SetupAdvancedTeleporterButton() { Item itemObject = AssetBundleHandler.GetItemObject("Advanced Portable Tele"); if (!((Object)(object)itemObject == (Object)null)) { itemObject.creditsWorth = SyncedInstance<PluginConfig>.Instance.ADVANCED_TELE_PRICE.Value; itemObject.itemName = "Advanced Portable Tele"; itemObject.itemId = 492013; AdvancedPortableTeleporter advancedPortableTeleporter = itemObject.spawnPrefab.AddComponent<AdvancedPortableTeleporter>(); ((GrabbableObject)advancedPortableTeleporter).itemProperties = itemObject; ((GrabbableObject)advancedPortableTeleporter).grabbable = true; ((GrabbableObject)advancedPortableTeleporter).useCooldown = 2f; ((GrabbableObject)advancedPortableTeleporter).grabbableToEnemies = true; advancedPortableTeleporter.ItemBreak = itemBreak; advancedPortableTeleporter.error = error; advancedPortableTeleporter.buttonPress = buttonPressed; NetworkPrefabs.RegisterNetworkPrefab(itemObject.spawnPrefab); UpgradeBus.Instance.ItemsToSync.Add("AdvTele", itemObject); SetupStoreItem(itemObject); } } private void SetupNightVision() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) Item itemObject = AssetBundleHandler.GetItemObject("Night Vision"); if (!((Object)(object)itemObject == (Object)null)) { itemObject.creditsWorth = SyncedInstance<PluginConfig>.Instance.NIGHT_VISION_PRICE.Value; itemObject.spawnPrefab.transform.localScale = new Vector3(0.3f, 0.3f, 0.3f); itemObject.itemId = 492014; NightVisionGoggles nightVisionGoggles = itemObject.spawnPrefab.AddComponent<NightVisionGoggles>(); ((GrabbableObject)nightVisionGoggles).itemProperties = itemObject; ((GrabbableObject)nightVisionGoggles).grabbable = true; ((GrabbableObject)nightVisionGoggles).useCooldown = 2f; ((GrabbableObject)nightVisionGoggles).grabbableToEnemies = true; NetworkPrefabs.RegisterNetworkPrefab(itemObject.spawnPrefab); UpgradeBus.Instance.ItemsToSync.Add("Night", itemObject); SetupStoreItem(itemObject); } } private void SetupDivingKit() { Item itemObject = AssetBundleHandler.GetItemObject("Diving Kit"); if (!((Object)(object)itemObject == (Object)null)) { itemObject.creditsWorth = SyncedInstance<PluginConfig>.Instance.DIVEKIT_PRICE.Value; itemObject.itemId = 492015; itemObject.twoHanded = SyncedInstance<PluginConfig>.Instance.DIVEKIT_TWO_HANDED.Value; itemObject.weight = SyncedInstance<PluginConfig>.Instance.DIVEKIT_WEIGHT.Value; itemObject.itemSpawnsOnGround = true; DivingKit divingKit = itemObject.spawnPrefab.AddComponent<DivingKit>(); ((GrabbableObject)divingKit).itemProperties = itemObject; ((GrabbableObject)divingKit).grabbable = true; ((GrabbableObject)divingKit).grabbableToEnemies = true; NetworkPrefabs.RegisterNetworkPrefab(itemObject.spawnPrefab); UpgradeBus.Instance.ItemsToSync.Add("Dive", itemObject); SetupStoreItem(itemObject); } } private void SetupMedkit() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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_0077: Expected O, but got Unknown //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Expected O, but got Unknown Item itemObject = AssetBundleHandler.GetItemObject("Medkit"); if ((Object)(object)itemObject == (Object)null) { return; } AnimationCurve curve = new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, (float)SyncedInstance<PluginConfig>.Instance.EXTRACTION_CONTRACT_AMOUNT_MEDKITS.Value), new Keyframe(1f, (float)SyncedInstance<PluginConfig>.Instance.EXTRACTION_CONTRACT_AMOUNT_MEDKITS.Value) }); itemObject.creditsWorth = SyncedInstance<PluginConfig>.Instance.MEDKIT_PRICE.Value; itemObject.itemId = 492016; Medkit medkit = itemObject.spawnPrefab.AddComponent<Medkit>(); ((GrabbableObject)medkit).itemProperties = itemObject; ((GrabbableObject)medkit).grabbable = true; ((GrabbableObject)medkit).useCooldown = 2f; ((GrabbableObject)medkit).grabbableToEnemies = true; medkit.error = error; medkit.use = buttonPressed; NetworkPrefabs.RegisterNetworkPrefab(itemObject.spawnPrefab); SetupStoreItem(itemObject); Item itemObject2 = AssetBundleHandler.GetItemObject("MedkitMapItem"); if (!((Object)(object)itemObject2 == (Object)null)) { Medkit medkit2 = itemObject2.spawnPrefab.AddComponent<Medkit>(); itemObject2.spawnPrefab.AddComponent<ExtractionContract>(); ((GrabbableObject)medkit2).itemProperties = itemObject2; ((GrabbableObject)medkit2).grabbable = true; ((GrabbableObject)medkit2).useCooldown = 2f; ((GrabbableObject)medkit2).grabbableToEnemies = true; medkit2.error = error; medkit2.use = buttonPressed; NetworkPrefabs.RegisterNetworkPrefab(itemObject2.spawnPrefab); SpawnableMapObjectDef val = ScriptableObject.CreateInstance<SpawnableMapObjectDef>(); val.spawnableMapObject = new SpawnableMapObject(); val.spawnableMapObject.prefabToSpawn = itemObject2.spawnPrefab; MapObjects.RegisterMapObject(val, (LevelTypes)(-1), (Func<SelectableLevel, AnimationCurve>)((SelectableLevel level) => curve)); UpgradeBus.Instance.spawnableMapObjects["MedkitMapItem"] = val; UpgradeBus.Instance.spawnableMapObjectsAmount["MedkitMapItem"] = SyncedInstance<PluginConfig>.Instance.EXTRACTION_CONTRACT_AMOUNT_MEDKITS.Value; UpgradeBus.Instance.ItemsToSync.Add("Medkit", itemObject); } } private void SetupPeeper() { //IL_0064: Unknown result type (might be due to invalid IL or missing references) Item itemObject = AssetBundleHandler.GetItemObject("Peeper"); if (!((Object)(object)itemObject == (Object)null)) { itemObject.creditsWorth = SyncedInstance<PluginConfig>.Instance.PEEPER_PRICE.Value; itemObject.twoHanded = false; itemObject.itemId = 492017; itemObject.twoHandedAnimation = false; itemObject.spawnPrefab.transform.localScale = new Vector3(0.3f, 0.3f, 0.3f); Peeper peeper = itemObject.spawnPrefab.AddComponent<Peeper>(); ((GrabbableObject)peeper).itemProperties = itemObject; ((GrabbableObject)peeper).grabbable = true; ((GrabbableObject)peeper).grabbableToEnemies = true; NetworkPrefabs.RegisterNetworkPrefab(itemObject.spawnPrefab); UpgradeBus.Instance.ItemsToSync.Add("Peeper", itemObject); SetupStoreItem(itemObject); } } private void SetupWheelbarrows() { wheelbarrowSound = GetAudioClipList("Wheelbarrow Sound", 4); shoppingCartSound = GetAudioClipList("Scrap Wheelbarrow Sound", 4); SetupStoreWheelbarrow(); SetupScrapWheelbarrow(); } private AudioClip[] GetAudioClipList(string name, int length) { AudioClip[] array = (AudioClip[])(object)new AudioClip[length]; for (int i = 0; i < length; i++) { array[i] = AssetBundleHandler.GetAudioClip($"{name} {i}"); } return array; } private void SetupScrapWheelbarrow() { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Expected O, but got Unknown //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Expected O, but got Unknown Item itemObject = AssetBundleHandler.GetItemObject("Scrap Wheelbarrow"); if (!((Object)(object)itemObject == (Object)null)) { itemObject.itemId = 492018; itemObject.minValue = SyncedInstance<PluginConfig>.Instance.SCRAP_WHEELBARROW_MINIMUM_VALUE.Value; itemObject.maxValue = SyncedInstance<PluginConfig>.Instance.SCRAP_WHEELBARROW_MAXIMUM_VALUE.Value; itemObject.twoHanded = true; itemObject.twoHandedAnimation = true; itemObject.grabAnim = "HoldJetpack"; itemObject.floorYOffset = -90; itemObject.positionOffset = new Vector3(0f, -1.7f, 0.35f); itemObject.allowDroppingAheadOfPlayer = true; itemObject.isConductiveMetal = true; itemObject.isScrap = true; itemObject.weight = 0.99f + SyncedInstance<PluginConfig>.Instance.SCRAP_WHEELBARROW_WEIGHT.Value / 100f; itemObject.canBeGrabbedBeforeGameStart = true; ScrapWheelbarrow scrapWheelbarrow = itemObject.spawnPrefab.AddComponent<ScrapWheelbarrow>(); itemObject.toolTips = SetupWheelbarrowTooltips(); ((GrabbableObject)scrapWheelbarrow).itemProperties = itemObject; scrapWheelbarrow.wheelsClip = shoppingCartSound; itemObject.spawnPrefab.AddComponent<ScrapValueSyncer>(); NetworkPrefabs.RegisterNetworkPrefab(itemObject.spawnPrefab); Items.RegisterItem(itemObject); Utilities.FixMixerGroups(itemObject.spawnPrefab); int num = (SyncedInstance<PluginConfig>.Instance.SCRAP_WHEELBARROW_ENABLED.Value ? 1 : 0); AnimationCurve curve = new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, 0f), new Keyframe(1f - SyncedInstance<PluginConfig>.Instance.SCRAP_WHEELBARROW_RARITY.Value, (float)num), new Keyframe(1f, (float)num) }); SpawnableMapObjectDef val = ScriptableObject.CreateInstance<SpawnableMapObjectDef>(); val.spawnableMapObject = new SpawnableMapObject(); val.spawnableMapObject.prefabToSpawn = itemObject.spawnPrefab; MapObjects.RegisterMapObject(val, (LevelTypes)(-1), (Func<SelectableLevel, AnimationCurve>)((SelectableLevel level) => curve)); } } private void SetupStoreWheelbarrow() { //IL_0078: 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) Item itemObject = AssetBundleHandler.GetItemObject("Store Wheelbarrow"); if (!((Object)(object)itemObject == (Object)null)) { itemObject.itemId = 492019; itemObject.creditsWorth = SyncedInstance<PluginConfig>.Instance.WHEELBARROW_PRICE.Value; itemObject.twoHanded = true; itemObject.twoHandedAnimation = true; itemObject.grabAnim = "HoldJetpack"; itemObject.floorYOffset = -90; itemObject.verticalOffset = 0.3f; itemObject.positionOffset = new Vector3(0f, -0.7f, 1.4f); itemObject.allowDroppingAheadOfPlayer = true; itemObject.isConductiveMetal = true; itemObject.weight = 0.99f + SyncedInstance<PluginConfig>.Instance.WHEELBARROW_WEIGHT.Value / 100f; itemObject.canBeGrabbedBeforeGameStart = true; StoreWheelbarrow storeWheelbarrow = itemObject.spawnPrefab.AddComponent<StoreWheelbarrow>(); itemObject.toolTips = SetupWheelbarrowTooltips(); ((GrabbableObject)storeWheelbarrow).itemProperties = itemObject; storeWheelbarrow.wheelsClip = wheelbarrowSound; NetworkPrefabs.RegisterNetworkPrefab(itemObject.spawnPrefab); Utilities.FixMixerGroups(itemObject.spawnPrefab); UpgradeBus.Instance.ItemsToSync.Add("Wheel", itemObject); SetupStoreItem(itemObject); } } private string[] SetupWheelbarrowTooltips() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) Key val = (Key)0; MouseButton val2 = (MouseButton)2; string value = SyncedInstance<PluginConfig>.Default.WHEELBARROW_DROP_ALL_CONTROL_BIND.Value; bool flag; if (Enum.TryParse<Key>(value, out Key result)) { val = result; flag = true; } else { flag = false; } bool flag2; if (Enum.TryParse<MouseButton>(value, out MouseButton result2)) { val2 = result2; flag2 = true; } else { flag2 = false; } string text = (flag2 ? ((object)(MouseButton)(ref val2)).ToString() : "MMB"); string text2 = (flag ? ((object)(Key)(ref val)).ToString() : text); return new string[1] { "Drop all items: [" + text2 + "]" }; } private void SetupPerks() { SetupBeekeeper(); SetupProteinPowder(); SetupBiggerLungs(); SetupRunningShoes(); SetupStrongLegs(); SetupMalwareBroadcaster(); SetupNightVisionBattery(); SetupDiscombobulator(); SetupBetterScanner(); SetupWalkieGPS(); SetupFasterDropPod(); SetupSigurd(); SetupBackMuscles(); SetupInterns(); SetupPager(); SetupLightningRod(); SetupLocksmith(); SetupPlayerHealth(); SetupHunter(); SetupSickBeats(); SetupExtendDeadline(); SetupDoorsHydraulicsBattery(); SetupScrapInsurance(); SetupMarketInfluence(); SetupBargainConnections(); SetupLethalDeals(); SetupQuantumDisruptor(); SetupChargingBooster(); SetupEfficientEngines(); SetupClimbingGloves(); } private void SetupSickBeats() { SetupGenericPerk<SickBeats>("Sick Beats"); } private void SetupBeekeeper() { SetupGenericPerk<Beekeeper>("Beekeeper"); } private void SetupHunter() { SetupGenericPerk<Hunter>("Hunter"); } private void SetupProteinPowder() { SetupGenericPerk<ProteinPowder>("Protein Powder"); } private void SetupBiggerLungs() { SetupGenericPerk<BiggerLungs>("Bigger Lungs"); } private void SetupRunningShoes() { SetupGenericPerk<RunningShoes>("Running Shoes"); } private void SetupStrongLegs() { SetupGenericPerk<StrongLegs>("Strong Legs"); } private void SetupMalwareBroadcaster() { SetupGenericPerk<MalwareBroadcaster>(MalwareBroadcaster.UPGRADE_NAME); } private void SetupNightVisionBattery() { SetupGenericPerk<NightVision>("NV Headset Batteries"); } private void SetupDiscombobulator() { AudioClip audioClip = AssetBundleHandler.GetAudioClip("Flashbang"); if ((Object)(object)audioClip != (Object)null) { UpgradeBus.Instance.flashNoise = audioClip; } SetupGenericPerk<Discombobulator>("Discombobulator"); } private void SetupBetterScanner() { SetupGenericPerk<BetterScanner>("Better Scanner"); } private void SetupWalkieGPS() { SetupGenericPerk<WalkieGPS>("Walkie GPS"); } private void SetupFasterDropPod() { SetupGenericPerk<FasterDropPod>("Drop Pod Thrusters"); } private void SetupSigurd() { SetupGenericPerk<Sigurd>("Sigurd Access"); } private void SetupBackMuscles() { SetupGenericPerk<BackMuscles>("Back Muscles"); } private void SetupInterns() { SetupGenericPerk<Interns>("Interns"); } private void SetupPager() { SetupGenericPerk<FastEncryption>("Fast Encryption"); } private void SetupLightningRod() { SetupGenericPerk<LightningRod>("Lightning Rod"); } private void SetupLocksmith() { SetupGenericPerk<LockSmith>(LockSmith.UPGRADE_NAME); } private void SetupPlayerHealth() { SetupGenericPerk<Stimpack>("Stimpack"); } private void SetupExtendDeadline() { SetupGenericPerk<ExtendDeadlineScript>("Extend Deadline"); } private void SetupDoorsHydraulicsBattery() { SetupGenericPerk<DoorsHydraulicsBattery>("Shutter Batteries"); } private void SetupScrapInsurance() { SetupGenericPerk<ScrapInsurance>("Scrap Insurance"); } private void SetupMarketInfluence() { SetupGenericPerk<MarketInfluence>("Market Influence"); } private void SetupBargainConnections() { SetupGenericPerk<BargainConnections>("Bargain Connections"); } private void SetupLethalDeals() { SetupGenericPerk<LethalDeals>("Lethal Deals"); } private void SetupQuantumDisruptor() { SetupGenericPerk<QuantumDisruptor>("Quantum Disruptor"); } private void SetupChargingBooster() { SetupGenericPerk<ChargingBooster>("Charging Booster"); } private void SetupEfficientEngines() { SetupGenericPerk<EfficientEngines>("Efficient Engines"); } private void SetupClimbingGloves() { SetupGenericPerk<ClimbingGloves>("Climbing Gloves"); } private void SetupGenericPerk<T>(string upgradeName) where T : Component { GameObject perkGameObject = AssetBundleHandler.GetPerkGameObject(upgradeName); if (Object.op_Implicit((Object)(object)perkGameObject)) { perkGameObject.AddComponent<T>(); ((Object)perkGameObject).hideFlags = (HideFlags)61; NetworkPrefabs.RegisterNetworkPrefab(perkGameObject); } } } 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 BackMuscles : TierUpgrade, IUpgradeWorldBuilding { internal float alteredWeight = 1f; internal static BackMuscles Instance; public const string UPGRADE_NAME = "Back Muscles"; public const string PRICES_DEFAULT = "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"; private void Awake() { upgradeName = "Back Muscles"; 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 DecreasePossibleWeight(float defaultWeight) { if (!BaseUpgrade.GetActiveUpgrade("Back Muscles")) { return defaultWeight; } return defaultWeight * (UpgradeBus.Instance.PluginConfiguration.CARRY_WEIGHT_REDUCTION.Value - (float)BaseUpgrade.GetUpgradeLevel("Back Muscles") * UpgradeBus.Instance.PluginConfiguration.CARRY_WEIGHT_INCREMENT.Value); } public static void UpdatePlayerWeight() { 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) { Func<int, float> infoFunction = (int level) => (UpgradeBus.Instance.PluginConfiguration.CARRY_WEIGHT_REDUCTION.Value - (float)level * UpgradeBus.Instance.PluginConfiguration.CARRY_WEIGHT_INCREMENT.Value) * 100f; string infoFromJSON = AssetBundleHandler.GetInfoFromJSON("Back Muscles"); return Tools.GenerateInfoForUpgrade(infoFromJSON, initialPrice, incrementalPrices, infoFunction); } internal override bool CanInitializeOnStart() { string[] array = UpgradeBus.Instance.PluginConfiguration.BACK_MUSCLES_UPGRADE_PRICES.Value.Split(','); return UpgradeBus.Instance.PluginConfiguration.BACK_MUSCLES_PRICE.Value <= 0 && array.Length == 1 && (array[0] == "" || array[0] == "0"); } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "BackMuscles"; } } internal class BargainConnections : TierUpgrade { internal const string UPGRADE_NAME = "Bargain Connections"; internal const string PRICES_DEFAULT = "225,300,375"; internal override void Start() { upgradeName = "Bargain Connections"; base.Start(); } public static int GetBargainConnectionsAdditionalItems(int defaultAmountItems) { if (!BaseUpgrade.GetActiveUpgrade("Bargain Connections")) { return defaultAmountItems; } return defaultAmountItems + UpgradeBus.Instance.PluginConfiguration.BARGAIN_CONNECTIONS_INITIAL_ITEM_AMOUNT.Value + BaseUpgrade.GetUpgradeLevel("Bargain Connections") * UpgradeBus.Instance.PluginConfiguration.BARGAIN_CONNECTIONS_INCREMENTAL_ITEM_AMOUNT.Value; } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { Func<int, float> infoFunction = (int level) => UpgradeBus.Instance.PluginConfiguration.BARGAIN_CONNECTIONS_INITIAL_ITEM_AMOUNT.Value + level * UpgradeBus.Instance.PluginConfiguration.BARGAIN_CONNECTIONS_INCREMENTAL_ITEM_AMOUNT.Value; string infoFormat = "LVL {0} - ${1} - Increases the amount of items that can be on sale by {2}\n"; return Tools.GenerateInfoForUpgrade(infoFormat, initialPrice, incrementalPrices, infoFunction); } internal override bool CanInitializeOnStart() { string[] array = UpgradeBus.Instance.PluginConfiguration.BARGAIN_CONNECTIONS_PRICES.Value.Split(','); return UpgradeBus.Instance.PluginConfiguration.BARGAIN_CONNECTIONS_PRICE.Value <= 0 && array.Length == 1 && (array[0] == "" || array[0] == "0"); } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "BargainConnections"; } } internal class Beekeeper : TierUpgrade, IUpgradeWorldBuilding { internal bool increaseHivePrice = false; internal static Beekeeper Instance; public const string UPGRADE_NAME = "Beekeeper"; public const string PRICES_DEFAULT = "225,280,340"; internal const string WORLD_BUILDING_TEXT = "\n\nOn-the-job training package that teaches {0} proper Circuit Bee Nest handling techniques. Also comes with a weekly issuance of alkaline pills to partially inoculate {0} against Circuit Bee Venom.\n\n"; private void Awake() { upgradeName = "Beekeeper"; Instance = this; } public override void Increment() { base.Increment(); if (BaseUpgrade.GetUpgradeLevel("Beekeeper") == UpgradeBus.Instance.PluginConfiguration.BEEKEEPER_UPGRADE_PRICES.Value.Split(',').Length) { ToggleIncreaseHivePriceServerRpc(); } } public static int CalculateBeeDamage(int damageNumber) { if (!BaseUpgrade.GetActiveUpgrade("Beekeeper")) { return damageNumber; } return Mathf.Clamp((int)((float)damageNumber * (UpgradeBus.Instance.PluginConfiguration.BEEKEEPER_DAMAGE_MULTIPLIER.Value - (float)BaseUpgrade.GetUpgradeLevel("Beekeeper") * UpgradeBus.Instance.PluginConfiguration.BEEKEEPER_DAMAGE_MULTIPLIER_INCREMENT.Value)), 0, damageNumber); } public static int GetHiveScrapValue(int originalValue) { if (!UpgradeBus.Instance.PluginConfiguration.BEEKEEPER_ENABLED.Value || !Instance.increaseHivePrice) { return originalValue; } return (int)((float)originalValue * UpgradeBus.Instance.PluginConfiguration.BEEKEEPER_HIVE_VALUE_INCREASE.Value); } public string GetWorldBuildingText(bool shareStatus = false) { return string.Format("\n\nOn-the-job training package that teaches {0} proper Circuit Bee Nest handling techniques. Also comes with a weekly issuance of alkaline pills to partially inoculate {0} against Circuit Bee Venom.\n\n", shareStatus ? "your crew" : "you"); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { Func<int, float> infoFunction = (int level) => 100f * (UpgradeBus.Instance.PluginConfiguration.BEEKEEPER_DAMAGE_MULTIPLIER.Value - (float)level * UpgradeBus.Instance.PluginConfiguration.BEEKEEPER_DAMAGE_MULTIPLIER_INCREMENT.Value); string infoFromJSON = AssetBundleHandler.GetInfoFromJSON("Beekeeper"); return Tools.GenerateInfoForUpgrade(infoFromJSON, initialPrice, incrementalPrices, infoFunction); } [ServerRpc(RequireOwnership = false)] public void ToggleIncreaseHivePriceServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3970566516u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3970566516u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ToggleIncreaseHivePriceClientRpc(); } } } [ClientRpc] public void ToggleIncreaseHivePriceClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(708329620u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 708329620u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { increaseHivePrice = true; } } } internal override bool CanInitializeOnStart() { string[] array = UpgradeBus.Instance.PluginConfiguration.BEEKEEPER_UPGRADE_PRICES.Value.Split(','); return UpgradeBus.Instance.PluginConfiguration.BEEKEEPER_PRICE.Value <= 0 && array.Length == 1 && (array[0] == "" || array[0] == "0"); } protected override void __initializeVariables() { base.__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_Beekeeper() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(3970566516u, new RpcReceiveHandler(__rpc_handler_3970566516)); NetworkManager.__rpc_func_table.Add(708329620u, new RpcReceiveHandler(__rpc_handler_708329620)); } private static void __rpc_handler_3970566516(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((Beekeeper)(object)target).ToggleIncreaseHivePriceServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_708329620(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)2; ((Beekeeper)(object)target).ToggleIncreaseHivePriceClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Beekeeper"; } } internal class BetterScanner : TierUpgrade, IUpgradeWorldBuilding { public const string UPGRADE_NAME = "Better Scanner"; internal const string WORLD_BUILDING_TEXT = "\n\nA serialized Company-Issue Magazine subscription, called 'Stuff Finders'. Uniquely, {0} must subscribe to each issue of 'Stuff Finders' individually. Each separate subscription promises and delivers a weekly issuance of a magazine with the exact same information in it as last time, organized in a different order and with slightly different printing qualities each time. There are only three 'unique' issues, and each issue only has one or two pieces of actual useful information in it. The rest of the magazine is just ads for The Company's other offerings. There is an extra fee for cancelling a subscription of 'Stuff Finders' before terminating your employment. The useful information always comes in the form of an unlabelled service key or Ship terminal hyperlink.\n\n"; private static LguLogger logger = new LguLogger("Better Scanner"); internal override void Start() { upgradeName = "Better Scanner"; base.Start(); } public static void AddScannerNodeToValve(ref SteamValveHazard steamValveHazard) { if (BaseUpgrade.GetActiveUpgrade("Better Scanner")) { logger.LogDebug("Inserting a Scan Node on a broken steam valve..."); LguScanNodeProperties.AddGeneralScanNode(((Component)steamValveHazard).gameObject, "Bursted Steam Valve", "Fix it to get rid of the steam", -1, 3); } } public static void RemoveScannerNodeFromValve(ref SteamValveHazard steamValveHazard) { logger.LogDebug("Removing the Scan Node from a fixed steam valve..."); LguScanNodeProperties.RemoveScanNode(((Component)steamValveHazard).gameObject); } public static string GetBetterScannerInfo(int level, int price) { switch (level) { case 1: return string.Format(AssetBundleHandler.GetInfoFromJSON("Better Scanner1"), level, price, UpgradeBus.Instance.PluginConfiguration.NODE_DISTANCE_INCREASE.Value, UpgradeBus.Instance.PluginConfiguration.SHIP_AND_ENTRANCE_DISTANCE_INCREASE.Value); case 2: return string.Format(AssetBundleHandler.GetInfoFromJSON("Better Scanner2"), level, price); case 3: { string text = string.Format(AssetBundleHandler.GetInfoFromJSON("Better Scanner3"), level, price, UpgradeBus.Instance.PluginConfiguration.BETTER_SCANNER_ENEMIES.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 string.Format("\n\nA serialized Company-Issue Magazine subscription, called 'Stuff Finders'. Uniquely, {0} must subscribe to each issue of 'Stuff Finders' individually. Each separate subscription promises and delivers a weekly issuance of a magazine with the exact same information in it as last time, organized in a different order and with slightly different printing qualities each time. There are only three 'unique' issues, and each issue only has one or two pieces of actual useful information in it. The rest of the magazine is just ads for The Company's other offerings. There is an extra fee for cancelling a subscription of 'Stuff Finders' before terminating your employment. The useful information always comes in the form of an unlabelled service key or Ship terminal hyperlink.\n\n", shareStatus ? "a department" : "one"); } 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(); } internal override bool CanInitializeOnStart() { return UpgradeBus.Instance.PluginConfiguration.BETTER_SCANNER_PRICE.Value <= 0 && UpgradeBus.Instance.PluginConfiguration.BETTER_SCANNER_PRICE2.Value <= 0 && UpgradeBus.Instance.PluginConfiguration.BETTER_SCANNER_PRICE3.Value <= 0; } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "BetterScanner"; } } internal class ChargingBooster : TierUpgrade { internal const string UPGRADE_NAME = "Charging Booster"; internal float chargeCooldown; internal static ChargingBooster Instance { get; private set; } private void Awake() { Instance = this; } internal override void Start() { upgradeName = "Charging Booster"; chargeCooldown = UpgradeBus.Instance.PluginConfiguration.CHARGING_BOOSTER_COOLDOWN.Value; base.Start(); } public override void Load() { base.Load(); RadarBoosterItem[] array = Object.FindObjectsOfType<RadarBoosterItem>(); foreach (RadarBoosterItem val in array) { if (!((Object)(object)((Component)val).GetComponent<ChargingStationManager>() != (Object)null)) { ((Component)val).gameObject.AddComponent<ChargingStationManager>(); } } } public override void Increment() { base.Increment(); chargeCooldown = Mathf.Clamp(chargeCooldown - UpgradeBus.Instance.PluginConfiguration.CHARGING_BOOSTER_INCREMENTAL_COOLDOWN_DECREASE.Value, 0f, UpgradeBus.Instance.PluginConfiguration.CHARGING_BOOSTER_COOLDOWN.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_00d8: 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(3584915330u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkBehaviourReference>(ref radarBooster, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3584915330u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3718277922u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkBehaviourReference>(ref radarBooster, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3718277922u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } RadarBoosterItem val3 = default(RadarBoosterItem); ((NetworkBehaviourReference)(ref radarBooster)).TryGet<RadarBoosterItem>(ref val3, (NetworkManager)null); if (!((Object)(object)val3 == (Object)null)) { ChargingStationManager component = ((Component)val3).GetComponent<ChargingStationManager>(); if (!((Object)(object)component == (Object)null)) { component.cooldown = chargeCooldown; } } } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { Func<int, float> infoFunction = (int level) => UpgradeBus.Instance.PluginConfiguration.CHARGING_BOOSTER_COOLDOWN.Value - (float)(level + 1) * UpgradeBus.Instance.PluginConfiguration.CHARGING_BOOSTER_INCREMENTAL_COOLDOWN_DECREASE.Value; string infoFormat = "LVL {0} - ${1} - Radar boosters will have a recharge cooldown of {2} seconds.\n"; return $"LVL 0 - ${initialPrice} - Provides charging stations to the radar boosters. After used, goes on cooldown for {UpgradeBus.Instance.PluginConfiguration.CHARGING_BOOSTER_COOLDOWN.Value} seconds\n" + Tools.GenerateInfoForUpgrade(infoFormat, incrementalPrices[0], incrementalPrices.Skip(1).ToArray(), infoFunction); } internal override bool CanInitializeOnStart() { string[] array = UpgradeBus.Instance.PluginConfiguration.CHARGING_BOOSTER_PRICES.Value.Split(','); return UpgradeBus.Instance.PluginConfiguration.CHARGING_BOOSTER_PRICE.Value <= 0 && array.Length == 1 && (array[0] == "" || array[0] == "0"); } protected override void __initializeVariables() { base.__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_ChargingBooster() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(3584915330u, new RpcReceiveHandler(__rpc_handler_3584915330)); NetworkManager.__rpc_func_table.Add(3718277922u, new RpcReceiveHandler(__rpc_handler_3718277922)); } private static void __rpc_handler_3584915330(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<NetworkBehaviourReference>(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_3718277922(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<NetworkBehaviourReference>(ref radarBooster, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)2; ((ChargingBooster)(object)target).UpdateCooldownClientRpc(radarBooster); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "ChargingBooster"; } } internal class Discombobulator : TierUpgrade, IUpgradeWorldBuilding { internal float flashCooldown = 0f; private static LguLogger logger = new LguLogger("Discombobulator"); public static Discombobulator instance; public const string UPGRADE_NAME = "Discombobulator"; public const string PRICES_DEFAULT = "330,460,620"; internal const string WORLD_BUILDING_TEXT = "\n\nService key for the Ship's terminal which allows {0} to legally use the Ship's 'Discombobulator' module. Comes with a list of opt-in maintenance procedures that promise to optimze the discharge and refractory of the system. Said document contains no mention of whatever it might be that it was included in the Ship's design to discombobulate.\n\n"; private void Awake() { upgradeName = "Discombobulator"; instance = this; } private void Update() { if (flashCooldown > 0f) { flashCooldown -= Time.deltaTime; } } [ServerRpc(RequireOwnership = false)] public void PlayAudioAndUpdateCooldownServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2657042876u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2657042876u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { PlayAudioAndUpdateCooldownClientRpc(); } } } [ClientRpc] private void PlayAudioAndUpdateCooldownClientRpc() { //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_011c: 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 != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1866209176u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1866209176u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } Terminal terminal = UpgradeBus.Instance.GetTerminal(); terminal.terminalAudio.maxDistance = 100f; terminal.terminalAudio.PlayOneShot(UpgradeBus.Instance.flashNoise); ((MonoBehaviour)this).StartCoroutine(ResetRange(terminal)); flashCooldown = UpgradeBus.Instance.PluginConfiguration.DISCOMBOBULATOR_COOLDOWN.Value; Collider[] array = Physics.OverlapSphere(((Component)terminal).transform.position, UpgradeBus.Instance.PluginConfiguration.DISCOMBOBULATOR_RADIUS.Value, 524288); if (array.Length == 0) { return; } for (int i = 0; i < array.Length; i++) { EnemyAICollisionDetect component = ((Component)array[i]).GetComponent<EnemyAICollisionDetect>(); if (!((Object)(object)component == (Object)null)) { EnemyAI mainScript = component.mainScript; if (CanDealDamage()) { int num = UpgradeBus.Instance.PluginConfiguration.DISCOMBOBULATOR_INITIAL_DAMAGE.Value + UpgradeBus.Instance.PluginConfiguration.DISCOMBOBULATOR_DAMAGE_INCREASE.Value * (BaseUpgrade.GetUpgradeLevel("Discombobulator") - UpgradeBus.Instance.PluginConfiguration.DISCOMBOBULATOR_DAMAGE_LEVEL.Value); mainScript.HitEnemy(num, (PlayerControllerB)null, false); } if (!mainScript.isEnemyDead) { mainScript.SetEnemyStunned(true, UpgradeBus.Instance.PluginConfiguration.DISCOMBOBULATOR_STUN_DURATION.Value + UpgradeBus.Instance.PluginConfiguration.DISCOMBOBULATOR_INCREMENT.Value * (float)BaseUpgrade.GetUpgradeLevel("Discombobulator"), (PlayerControllerB)null); } } } } private bool CanDealDamage() { return UpgradeBus.Instance.PluginConfiguration.DISCOMBOBULATOR_DAMAGE_LEVEL.Value > 0 && BaseUpgrade.GetUpgradeLevel("Discombobulator") + 1 >= UpgradeBus.Instance.PluginConfiguration.DISCOMBOBULATOR_DAMAGE_LEVEL.Value; } private IEnumerator ResetRange(Terminal terminal) { yield return (object)new WaitForSeconds(2f); terminal.terminalAudio.maxDistance = 17f; } public string GetWorldBuildingText(bool shareStatus = false) { return string.Format("\n\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) { Func<int, float> infoFunction = (int level) => UpgradeBus.Instance.PluginConfiguration.DISCOMBOBULATOR_STUN_DURATION.Value + (float)level * UpgradeBus.Instance.PluginConfiguration.DISCOMBOBULATOR_INCREMENT.Value; string infoFromJSON = AssetBundleHandler.GetInfoFromJSON("Discombobulator"); return Tools.GenerateInfoForUpgrade(infoFromJSON, initialPrice, incrementalPrices, infoFunction); } internal override bool CanInitializeOnStart() { string[] array = UpgradeBus.Instance.PluginConfiguration.DISCO_UPGRADE_PRICES.Value.Split(','); return UpgradeBus.Instance.PluginConfiguration.DISCOMBOBULATOR_PRICE.Value <= 0 && array.Length == 1 && (array[0] == "" || array[0] == "0"); } protected override void __initializeVariables() { base.__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_Discombobulator() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(2657042876u, new RpcReceiveHandler(__rpc_handler_2657042876)); NetworkManager.__rpc_func_table.Add(1866209176u, new RpcReceiveHandler(__rpc_handler_1866209176)); } private static void __rpc_handler_2657042876(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).PlayAudioAndUpdateCooldownServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1866209176(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)2; ((Discombobulator)(object)target).PlayAudioAndUpdateCooldownClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Discombobulator"; } } internal class EfficientEngines : TierUpgrade { internal const string UPGRADE_NAME = "Efficient Engines"; private void Awake() { upgradeName = "Efficient Engines"; } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { Func<int, float> infoFunction = (int level) => UpgradeBus.Instance.PluginConfiguration.EFFICIENT_ENGINES_INITIAL_DISCOUNT.Value + level * UpgradeBus.Instance.PluginConfiguration.EFFICIENT_ENGINES_INCREMENTAL_DISCOUNT.Value; string infoFormat = "LVL {0} - ${1} - Moon routing will be {2}% cheaper\n"; return Tools.GenerateInfoForUpgrade(infoFormat, initialPrice, incrementalPrices, infoFunction); } public static int GetDiscountedMoonPrice(int defaultPrice) { if (!UpgradeBus.Instance.PluginConfiguration.EFFICIENT_ENGINES_ENABLED.Value) { return defaultPrice; } if (!BaseUpgrade.GetActiveUpgrade("Efficient Engines")) { return defaultPrice; } if (defaultPrice == 0) { return defaultPrice; } float num = (float)defaultPrice * (1f - (float)(UpgradeBus.Instance.PluginConfiguration.EFFICIENT_ENGINES_INITIAL_DISCOUNT.Value + BaseUpgrade.GetUpgradeLevel("Efficient Engines") * UpgradeBus.Instance.PluginConfiguration.EFFICIENT_ENGINES_INCREMENTAL_DISCOUNT.Value) / 100f); return Mathf.CeilToInt(Mathf.Clamp(num, 0f, (float)defaultPrice)); } internal override bool CanInitializeOnStart() { string[] array = UpgradeBus.Instance.PluginConfiguration.EFFICIENT_ENGINES_PRICES.Value.Split(','); return UpgradeBus.Instance.PluginConfiguration.EFFICIENT_ENGINES_PRICE.Value <= 0 && array.Length == 1 && (array[0] == "" || array[0] == "0"); } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "EfficientEngines"; } } internal class Hunter : TierUpgrade, IUpgradeWorldBuilding { private static readonly LguLogger logger = new LguLogger("Hunter"); internal static Hunter Instance; public const string UPGRADE_NAME = "Hunter"; 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<string, string> monsterNames = new Dictionary<string, string> { { "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" } }; private static Dictionary<string, int> levels; public static void SetupLevels() { levels = new Dictionary<string, int>(); string[] array = UpgradeBus.Instance.PluginConfiguration.HUNTER_SAMPLE_TIERS.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("{fullName} appears twice is samples config! Appearing now as {monster}"); continue; } logger.LogInfo($"{value} set to be harvestable at level {i + 1}"); levels[value] = i; } else { logger.LogError("Unrecognized enemy name: {monster}"); } } } } 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"; 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, price, 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) { string text = GetHunterInfo(0, initialPrice); for (int i = 0; i < maxLevels; i++) { text += GetHunterInfo(i + 1, incrementalPrices[i]); } return text; } internal override bool CanInitializeOnStart() { string[] array = UpgradeBus.Instance.PluginConfiguration.HUNTER_UPGRADE_PRICES.Value.Split(','); return UpgradeBus.Instance.PluginConfiguration.HUNTER_PRICE.Value <= 0 && array.Length == 1 && (array[0] == "" || array[0] == "0"); } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "Hunter"; } } internal class MarketInfluence : TierUpgrade { internal const string UPGRADE_NAME = "Market Influence"; internal const string PRICES_DEFAULT = "200,350,500"; internal override void Start() { upgradeName = "Market Influence"; base.Start(); } public static int GetGuaranteedPercentageSale(int defaultPercentage, int maxValue) { if (!BaseUpgrade.GetActiveUpgrade("Market Influence")) { return defaultPercentage; } return Mathf.Clamp(defaultPercentage + UpgradeBus.Instance.PluginConfiguration.MARKET_INFLUENCE_INITIAL_PERCENTAGE.Value + BaseUpgrade.GetUpgradeLevel("Market Influence") * UpgradeBus.Instance.PluginConfiguration.MARKET_INFLUENCE_INCREMENTAL_PERCENTAGE.Value, 0, maxValue); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { Func<int, float> infoFunction = (int level) => UpgradeBus.Instance.PluginConfiguration.MARKET_INFLUENCE_INITIAL_PERCENTAGE.Value + level * UpgradeBus.Instance.PluginConfiguration.MARKET_INFLUENCE_INCREMENTAL_PERCENTAGE.Value; string infoFormat = "LVL {0} - ${1} - Guarantees the item sales' percentage to be at least {2}%\n"; return Tools.GenerateInfoForUpgrade(infoFormat, initialPrice, incrementalPrices, infoFunction); } internal override bool CanInitializeOnStart() { string[] array = UpgradeBus.Instance.PluginConfiguration.MARKET_INFLUENCE_PRICES.Value.Split(','); return UpgradeBus.Instance.PluginConfiguration.MARKET_INFLUENCE_PRICE.Value <= 0 && array.Length == 1 && (array[0] == "" || array[0] == "0"); } protected override void __initializeVariables() { base.__initializeVariables(); } protected internal override string __getTypeName() { return "MarketInfluence"; } } internal class NightVision : TierUpgrade { 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 UPGRADE_NAME = "NV Headset Batteries"; public const string PRICES_DEFAULT = "300,400,500"; private static LguLogger logger = new LguLogger("NV Headset Batteries"); public static NightVision Instance { get; internal set; } private void Awake() { Instance = this; upgradeName = "NV Headset Batteries"; nightVisionPrefab = AssetBundleHandler.GetItemObject("Night Vision").spawnPrefab; } internal override void Start() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) base.Start(); ((Graphic)((Component)((Component)this).transform.GetChild(0).GetChild(0)).GetComponent<Image>()).color = Tools.ConvertValueToColor(SyncedInstance<PluginConfig>.Default.NIGHT_VIS_UI_BAR_COLOR.Value, Color.green); ((Graphic)((Component)((Component)this).transform.GetChild(0).GetChild(1)).GetComponent<Text>()).color = Tools.ConvertValueToColor(SyncedInstance<PluginConfig>.Default.NIGHT_VIS_UI_TEXT_COLOR.Value, Color.white); ((Graphic)((Component)((Component)this).transform.GetChild(0).GetChild(2)).GetComponent<Image>()).color = Tools.ConvertValueToColor(SyncedInstance<PluginConfig>.Default.NIGHT_VIS_UI_BAR_COLOR.Value, Color.green); ((Component)((Component)this).transform.GetChild(0)).gameObject.SetActive(false); } private void LateUpdate() { //IL_021b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)client == (Object)null) { return; } float num = UpgradeBus.Instance.PluginConfiguration.NIGHT_BATTERY_MAX.Value + (float)BaseUpgrade.GetUpgradeLevel("NV Headset Batteries") * UpgradeBus.Instance.PluginConfiguration.NIGHT_VIS_BATTERY_INCREMENT.Value; if (nightVisionActive) { nightBattery -= Time.deltaTime * (UpgradeBus.Instance.PluginConfiguration.NIGHT_VIS_DRAIN_SPEED.Value - (float)BaseUpgrade.GetUpgradeLevel("NV Headset Batteries") * UpgradeBus.Instance.PluginConfiguration.NIGHT_VIS_DRAIN_INCREMENT.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 * (UpgradeBus.Instance.PluginConfiguration.NIGHT_VIS_REGEN_SPEED.Value + (float)BaseUpgrade.GetUpgradeLevel("NV Headset Batteries") * UpgradeBus.Instance.PluginConfiguration.NIGHT_VIS_REGEN_INCREMENT.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); } } if (client.isInsideFactory || nightVisionActive) { ((Behaviour)client.nightVision).enabled = true; } else { ((Behaviour)client.nightVision).enabled = false; } float num2 = nightBattery / num; ((Component)this).transform.GetChild(0).GetChild(0).localScale = new Vector3(num2, 1f, 1f); } public void Toggle() { if (BaseUpgrade.GetActiveUpgrade("NV Headset Batteries") && !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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) nightVisColor = client.nightVision.color; nightVisRange = client.nightVision.range; nightVisIntensity = client.nightVision.intensity; client.nightVision.color = Tools.ConvertValueToColor(SyncedInstance<PluginConfig>.Default.NIGHT_VIS_COLOR.Value, Color.green); client.nightVision.range = UpgradeBus.Instance.PluginConfiguration.NIGHT_VIS_RANGE.Value + (float)BaseUpgrade.GetUpgradeLevel("NV Headset Batteries") * UpgradeBus.Instance.PluginConfiguration.NIGHT_VIS_RANGE_INCREMENT.Value; client.nightVision.intensity = UpgradeBus.Instance.PluginConfiguration.NIGHT_VIS_INTENSITY.Value + (float)BaseUpgrade.GetUpgradeLevel("NV Headset Batteries") * UpgradeBus.Instance.PluginConfiguration.NIGHT_VIS_INTENSITY_INCREMENT.Value; nightBattery -= UpgradeBus.Instance.PluginConfiguration.NIGHT_VIS_STARTUP.Value; } private IEnumerator BatteryRecovery() { yield return (object)new WaitForSeconds(UpgradeBus.Instance.PluginConfiguration.NIGHT_VIS_EXHAUST.Value); batteryExhaustion = false; } public override void Increment() { base.Increment(); LguStore.Instance.UpdateLGUSaveServerRpc(GameNetworkManager.Instance.localPlayerController.playerSteamId, JsonConvert.SerializeObject((object)new SaveInfo())); } public override void Load() { base.Load(); EnableOnClient(save: false); } public override void Unwind() { base.Unwind(); 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) 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(1013472646u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1013472646u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3091963562u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3091963562u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { 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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: 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) 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(2325508725u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2325508725u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { GameObject val3 = Object.Instantiate<GameObject>(nightVisionPrefab, position + Vector3.up, Quaternion.identity); val3.GetComponent<NetworkObject>().Spawn(false); logger.LogInfo("Request to spawn night vision goggles received."); } } } public void EnableOnClient(bool save = true) { if ((Object)(object)client == (Object)null) { client = GameNetworkManager.Instance.localPlayerController; } ((Component)((Component)this).transform.GetChild(0)).gameObject.SetActive(true); UpgradeBus.Instance.activeUpgrades["NV Headset Batteries"] = true; if (save) { LguStore.Instance.UpdateLGUSaveServerRpc(client.playerSteamId, JsonConvert.SerializeObject((object)new SaveInfo())); } TextMeshProUGUI chatText = HUDManager.Instance.chatText; ((TMP_Text)chatText).text = ((TMP_Text)chatText).text + "\n<color=#FF0000>Press " + InputActionRebindingExtensions.GetBindingDisplayString(Keybinds.NvgAction, (DisplayStringOptions)0, (string)null) + " to toggle Night Vision!!!</color>"; } public void DisableOnClient() { //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; ((Component)((Component)this).transform.GetChild(0)).gameObject.SetActive(false); UpgradeBus.Instance.activeUpgrades["NV Headset Batteries"] = false; LguStore.Instance.UpdateLGUSaveServerRpc(client.playerSteamId, JsonConvert.SerializeObject((object)new SaveInfo())); client = null; } public static string GetNightVisionInfo(int level, int price) { if (level == 1) { float num = (UpgradeBus.Instance.PluginConfiguration.NIGHT_BATTERY_MAX.Value - UpgradeBus.Instance.PluginConfiguration.NIGHT_BATTERY_MAX.Value * UpgradeBus.Instance.PluginConfiguration.NIGHT_VIS_STARTUP.Value) / UpgradeBus.Instance.PluginConfiguration.NIGHT_VIS_DRAIN_SPEED.Value; float num2 = UpgradeBus.Instance.PluginConfiguration.NIGHT_BATTERY_MAX.Value / UpgradeBus.Instance.PluginConfiguration.NIGHT_VIS_REGEN_SPEED.Value; return string.Format(AssetBundleHandler.GetInfoFromJSON("NV Headset Batteries"), level, price, num, num2); } float num3 = Mathf.Clamp(UpgradeBus.Instance.PluginConfiguration.NIGHT_VIS_REGEN_SPEED.Value + UpgradeBus.Instance.PluginConfiguration.NIGHT_VIS_REGEN_INCREMENT.Value * (float)(level - 1), 0f, 1000f); float num4 = Mathf.Clamp(UpgradeBus.Instance.PluginConfiguration.NIGHT_VIS_DRAIN_SPEED.Value - UpgradeBus.Instance.PluginConfiguration.NIGHT_VIS_DRAIN_INCREMENT.Value * (float)(level - 1), 0f, 1000f); float num5 = UpgradeBus.Instance.PluginConfiguration.NIGHT_BATTERY_MAX.Value + UpgradeBus.Instance.PluginConfiguration.NIGHT_VIS_BATTERY_INCREMENT.Value * (float)(level - 1); string text = "infinite"; if (num4 != 0f) { text = ((num5 - num5 * UpgradeBus.Instance.PluginConfiguration.NIGHT_VIS_STARTUP.Value) / num4).ToString("F2"); } string text2 = "infinite"; if (num3 != 0f) { text2 = (num5 / num3).ToString("F2"); } return string.Format(AssetBundleHandler.GetInfoFromJSON("NV Headset Batteries"), level, price, text, text2); } public override string GetDisplayInfo(int initialPrice = -1, int maxLevels = -1, int[] incrementalPrices = null) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append(GetNightVisionInfo(1, initialPrice)); for (int i = 0; i < maxLevels; i++) { stringBuilder.Append(GetNightVisionInfo(i + 2, incrementalPrices[i])); } return stringBuilder.ToString(); } internal override bool CanInitializeOnStart() { string[] array = UpgradeBus.Instance.PluginConfiguration.NIGHT_VISION_UPGRADE_PRICES.Value.Split(','); return UpgradeBus.Instance.PluginConfiguration.NIGHT_VISION_PRICE.Value <= 0 && array.Length == 1 && (array[0] == "" || array[0] == "0"); } protected override void __initializeVariables() { base.__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_NightVision() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(1013472646u, new RpcReceiveHandler(__rpc_handler_1013472646)); NetworkManager.__rpc_func_table.Add(3091963562u, new RpcReceiveHandler(__rpc_handler_3091963562)); NetworkManager.__rpc_func_table.Add(2325508725u, new RpcReceiveHandler(__rpc_handler_2325508725)); } private static void __rpc_handler_1013472646(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_3091963562(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)2; ((NightVision)(object)target).EnableNightVisionClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2325508725(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 && networkM