using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using System.Threading; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LethalCompanyInputUtils.Api; using LethalLib.Extras; using LethalLib.Modules; using LethalThings.Extensions; using LethalThings.MonoBehaviours; using LethalThings.Patches; using Microsoft.CodeAnalysis; using MonoMod.RuntimeDetour; using On; using On.GameNetcodeStuff; using TMPro; using Unity.Netcode; using Unity.Netcode.Components; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.InputSystem.Utilities; using UnityEngine.Rendering.HighDefinition; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("LethalThings")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Mod for Lethal Company")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+86ae65aa973bc30ae45609c9c37649bfb7da4c59")] [assembly: AssemblyProduct("LethalThings")] [assembly: AssemblyTitle("LethalThings")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] internal class { static () { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedIEquatable(); NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedValueEquals(); } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace LethalLib.Modules { public class SaveData { [CompilerGenerated] private static class <>O { public static hook_ResetSavedGameValues <0>__GameNetworkManager_ResetSavedGameValues; public static hook_SaveItemsInShip <1>__GameNetworkManager_SaveItemsInShip; public static hook_LoadShipGrabbableItems <2>__StartOfRound_LoadShipGrabbableItems; } public static List saveKeys = new List(); public static void Init() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0030: 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_003b: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown object obj = <>O.<0>__GameNetworkManager_ResetSavedGameValues; if (obj == null) { hook_ResetSavedGameValues val = GameNetworkManager_ResetSavedGameValues; <>O.<0>__GameNetworkManager_ResetSavedGameValues = val; obj = (object)val; } GameNetworkManager.ResetSavedGameValues += (hook_ResetSavedGameValues)obj; object obj2 = <>O.<1>__GameNetworkManager_SaveItemsInShip; if (obj2 == null) { hook_SaveItemsInShip val2 = GameNetworkManager_SaveItemsInShip; <>O.<1>__GameNetworkManager_SaveItemsInShip = val2; obj2 = (object)val2; } GameNetworkManager.SaveItemsInShip += (hook_SaveItemsInShip)obj2; object obj3 = <>O.<2>__StartOfRound_LoadShipGrabbableItems; if (obj3 == null) { hook_LoadShipGrabbableItems val3 = StartOfRound_LoadShipGrabbableItems; <>O.<2>__StartOfRound_LoadShipGrabbableItems = val3; obj3 = (object)val3; } StartOfRound.LoadShipGrabbableItems += (hook_LoadShipGrabbableItems)obj3; } private static void StartOfRound_LoadShipGrabbableItems(orig_LoadShipGrabbableItems orig, StartOfRound self) { orig.Invoke(self); SaveableObject[] array = Object.FindObjectsOfType(); SaveableNetworkBehaviour[] array2 = Object.FindObjectsOfType(); SaveableObject[] array3 = array; for (int i = 0; i < array3.Length; i++) { array3[i].LoadObjectData(); } SaveableNetworkBehaviour[] array4 = array2; for (int i = 0; i < array4.Length; i++) { array4[i].LoadObjectData(); } if (ES3.KeyExists("LethalLibItemSaveKeys", GameNetworkManager.Instance.currentSaveFileName)) { saveKeys = ES3.Load>("LethalLibItemSaveKeys", GameNetworkManager.Instance.currentSaveFileName); } } private static void GameNetworkManager_SaveItemsInShip(orig_SaveItemsInShip orig, GameNetworkManager self) { orig.Invoke(self); SaveableObject[] array = Object.FindObjectsOfType(); SaveableNetworkBehaviour[] array2 = Object.FindObjectsOfType(); SaveableObject[] array3 = array; for (int i = 0; i < array3.Length; i++) { array3[i].SaveObjectData(); } SaveableNetworkBehaviour[] array4 = array2; for (int i = 0; i < array4.Length; i++) { array4[i].SaveObjectData(); } ES3.Save>("LethalLibItemSaveKeys", saveKeys, GameNetworkManager.Instance.currentSaveFileName); } private static void GameNetworkManager_ResetSavedGameValues(orig_ResetSavedGameValues orig, GameNetworkManager self) { orig.Invoke(self); foreach (string saveKey in saveKeys) { ES3.DeleteKey(saveKey, GameNetworkManager.Instance.currentSaveFileName); } saveKeys.Clear(); } public static void SaveObjectData(string key, T data, int objectId) { List list = new List(); if (ES3.KeyExists("LethalThingsSave_" + key, GameNetworkManager.Instance.currentSaveFileName)) { list = ES3.Load>("LethalThingsSave_" + key, GameNetworkManager.Instance.currentSaveFileName); } List list2 = new List(); if (ES3.KeyExists("LethalThingsSave_objectIds_" + key, GameNetworkManager.Instance.currentSaveFileName)) { list2 = ES3.Load>("LethalThingsSave_objectIds_" + key, GameNetworkManager.Instance.currentSaveFileName); } list.Add(data); list2.Add(objectId); if (!saveKeys.Contains("LethalThingsSave_" + key)) { saveKeys.Add("LethalThingsSave_" + key); } if (!saveKeys.Contains("LethalThingsSave_objectIds_" + key)) { saveKeys.Add("LethalThingsSave_objectIds_" + key); } ES3.Save>("LethalThingsSave_" + key, list, GameNetworkManager.Instance.currentSaveFileName); ES3.Save>("LethalThingsSave_objectIds_" + key, list2, GameNetworkManager.Instance.currentSaveFileName); } public static T LoadObjectData(string key, int objectId) { List list = new List(); if (ES3.KeyExists("LethalThingsSave_" + key, GameNetworkManager.Instance.currentSaveFileName)) { list = ES3.Load>("LethalThingsSave_" + key, GameNetworkManager.Instance.currentSaveFileName); } List list2 = new List(); if (ES3.KeyExists("LethalThingsSave_objectIds_" + key, GameNetworkManager.Instance.currentSaveFileName)) { list2 = ES3.Load>("LethalThingsSave_objectIds_" + key, GameNetworkManager.Instance.currentSaveFileName); } if (!saveKeys.Contains("LethalThingsSave_" + key)) { saveKeys.Add("LethalThingsSave_" + key); } if (!saveKeys.Contains("LethalThingsSave_objectIds_" + key)) { saveKeys.Add("LethalThingsSave_objectIds_" + key); } if (list2.Contains(objectId)) { int index = list2.IndexOf(objectId); return list[index]; } return default(T); } } } namespace LethalThings { public class Config { public static ConfigEntry arsonSpawnWeight; public static ConfigEntry dirtyArsonSpawnWeight; public static ConfigEntry toimariSpawnWeight; public static ConfigEntry hamisSpawnWeight; public static ConfigEntry cookieSpawnWeight; public static ConfigEntry maxwellSpawnWeight; public static ConfigEntry evilMaxwellChance; public static ConfigEntry maxwellPlayMusicDefault; public static ConfigEntry glizzySpawnChance; public static ConfigEntry revolverSpawnChance; public static ConfigEntry gremlinSodaSpawnChance; public static ConfigEntry toyHammerEnabled; public static ConfigEntry toyHammerPrice; public static ConfigEntry pouchyBeltEnabled; public static ConfigEntry pouchyBeltPrice; public static ConfigEntry remoteRadarEnabled; public static ConfigEntry remoteRadarPrice; public static ConfigEntry rocketLauncherEnabled; public static ConfigEntry rocketLauncherPrice; public static ConfigEntry hackingToolEnabled; public static ConfigEntry hackingToolPrice; public static ConfigEntry flareGunEnabled; public static ConfigEntry flareGunPrice; public static ConfigEntry flareGunAmmoPrice; public static ConfigEntry boombaSpawnWeight; public static ConfigEntry rugsEnabled; public static ConfigEntry smallRugPrice; public static ConfigEntry largeRugPrice; public static ConfigEntry fatalitiesSignEnabled; public static ConfigEntry fatalitiesSignPrice; public static ConfigEntry dartBoardEnabled; public static ConfigEntry dartBoardPrice; public static ConfigEntry teleporterTrapsEnabled; public static ConfigEntry enableItemChargerElectrocution; public static ConfigEntry itemChargerElectrocutionDamage; public static ConfigEntry disableOverlappingModContent; public static ConfigFile VolumeConfig; public static ConfigEntry version; public static void Load() { //IL_04ae: Unknown result type (might be due to invalid IL or missing references) //IL_04b8: Expected O, but got Unknown arsonSpawnWeight = Plugin.config.Bind("Scrap", "Arson", 5, "How much does Arson spawn, higher = more common"); dirtyArsonSpawnWeight = Plugin.config.Bind("Scrap", "DirtyArson", 5, "How much does Arson (Dirty) spawn, higher = more common"); toimariSpawnWeight = Plugin.config.Bind("Scrap", "Toimari", 10, "How much does Toimari spawn, higher = more common"); hamisSpawnWeight = Plugin.config.Bind("Scrap", "Hamis", 10, "How much does Hamis spawn, higher = more common"); cookieSpawnWeight = Plugin.config.Bind("Scrap", "Cookie", 10, "How much does Cookie spawn, higher = more common"); maxwellSpawnWeight = Plugin.config.Bind("Scrap", "Maxwell", 3, "How much does Maxwell spawn, higher = more common"); evilMaxwellChance = Plugin.config.Bind("Scrap", "MaxwellEvilChance", 10f, "Chance for maxwell to be evil, percentage."); maxwellPlayMusicDefault = Plugin.config.Bind("Scrap", "MaxwellPlayMusicDefault", true, "Does Maxwell play music by default?"); glizzySpawnChance = Plugin.config.Bind("Scrap", "GlizzySpawnChance", 5, "How much do glizzies spawn, higher = more common"); revolverSpawnChance = Plugin.config.Bind("Scrap", "Revolver", 10, "How much do revolvers spawn, higher = more common"); gremlinSodaSpawnChance = Plugin.config.Bind("Scrap", "GremlinEnergyDrink", 10, "How much does Gremlin Energy Drink spawn, higher = more common"); toyHammerEnabled = Plugin.config.Bind("Items", "ToyHammer", true, "Is Toy Hammer enabled?"); toyHammerPrice = Plugin.config.Bind("Items", "ToyHammerPrice", 15, "How much does Toy Hammer cost?"); pouchyBeltEnabled = Plugin.config.Bind("Items", "PouchyBelt", true, "Is Pouchy Belt enabled?"); pouchyBeltPrice = Plugin.config.Bind("Items", "PouchyBeltPrice", 290, "How much does Pouchy Belt cost?"); remoteRadarEnabled = Plugin.config.Bind("Items", "RemoteRadar", true, "Is Remote Radar enabled?"); remoteRadarPrice = Plugin.config.Bind("Items", "RemoteRadarPrice", 150, "How much does Remote Radar cost?"); rocketLauncherEnabled = Plugin.config.Bind("Items", "RocketLauncher", true, "Is Rocket Launcher enabled?"); rocketLauncherPrice = Plugin.config.Bind("Items", "RocketLauncherPrice", 300, "How much does Rocket Launcher cost?"); hackingToolEnabled = Plugin.config.Bind("Items", "HackingTool", true, "Is Hacking Tool enabled?"); hackingToolPrice = Plugin.config.Bind("Items", "HackingToolPrice", 120, "How much does Hacking Tool cost?"); flareGunEnabled = Plugin.config.Bind("Items", "FlareGun", true, "Is Flare Gun enabled?"); flareGunPrice = Plugin.config.Bind("Items", "FlareGunPrice", 100, "How much does Flare Gun cost?"); flareGunAmmoPrice = Plugin.config.Bind("Items", "FlareGunAmmoPrice", 20, "How much does Flare Gun ammo cost?"); boombaSpawnWeight = Plugin.config.Bind("Enemies", "Boomba", 20, "How much does Boomba spawn, higher = more common"); rugsEnabled = Plugin.config.Bind("Decor", "Rugs", true, "Are rugs enabled?"); smallRugPrice = Plugin.config.Bind("Decor", "SmallRugPrice", 80, "How much does a small rug cost?"); largeRugPrice = Plugin.config.Bind("Decor", "LargeRugPrice", 110, "How much does a large rug cost?"); fatalitiesSignEnabled = Plugin.config.Bind("Decor", "FatalitiesSign", true, "Is Fatalities Sign enabled?"); fatalitiesSignPrice = Plugin.config.Bind("Decor", "FatalitiesSignPrice", 100, "How much does Fatalities Sign cost?"); dartBoardEnabled = Plugin.config.Bind("Decor", "DartBoard", true, "Is Dart Board enabled?"); dartBoardPrice = Plugin.config.Bind("Decor", "DartBoardPrice", 120, "How much does Dart Board cost?"); teleporterTrapsEnabled = Plugin.config.Bind("Traps", "TeleporterTraps", true, "Are teleporter traps enabled?"); enableItemChargerElectrocution = Plugin.config.Bind("Misc", "EnableItemChargerElectrocution", true, "Do players get electrocuted when stuffing conductive objects in the item charger."); itemChargerElectrocutionDamage = Plugin.config.Bind("Misc", "ItemChargerElectrocutionDamage", 20, "How much damage does the item charger electrocution do."); disableOverlappingModContent = Plugin.config.Bind("Misc", "DisableOverlappingModContent", true, "Disable content from other mods which exists in this one (e.g. maxwell)."); version = Plugin.config.Bind("Misc", "Version", "1.0.0", "Version of the mod config."); VolumeConfig = new ConfigFile(Paths.ConfigPath + "\\LethalThings.AudioVolume.cfg", true); } } public class Content { public class CustomItem { public string name = ""; public string itemPath = ""; public string infoPath = ""; public Action itemAction = delegate { }; public bool enabled = true; public CustomItem(string name, string itemPath, string infoPath, Action action = null) { this.name = name; this.itemPath = itemPath; this.infoPath = infoPath; if (action != null) { itemAction = action; } } public static CustomItem Add(string name, string itemPath, string infoPath = null, Action action = null) { return new CustomItem(name, itemPath, infoPath, action); } } public class CustomUnlockable { public string name = ""; public string unlockablePath = ""; public string infoPath = ""; public Action unlockableAction = delegate { }; public bool enabled = true; public int unlockCost = -1; public CustomUnlockable(string name, string unlockablePath, string infoPath, Action action = null, int unlockCost = -1) { this.name = name; this.unlockablePath = unlockablePath; this.infoPath = infoPath; if (action != null) { unlockableAction = action; } this.unlockCost = unlockCost; } public static CustomUnlockable Add(string name, string unlockablePath, string infoPath = null, Action action = null, int unlockCost = -1, bool enabled = true) { return new CustomUnlockable(name, unlockablePath, infoPath, action, unlockCost) { enabled = enabled }; } } public class CustomShopItem : CustomItem { public int itemPrice; public CustomShopItem(string name, string itemPath, string infoPath = null, int itemPrice = 0, Action action = null) : base(name, itemPath, infoPath, action) { this.itemPrice = itemPrice; } public static CustomShopItem Add(string name, string itemPath, string infoPath = null, int itemPrice = 0, Action action = null, bool enabled = true) { return new CustomShopItem(name, itemPath, infoPath, itemPrice, action) { enabled = enabled }; } } public class CustomScrap : CustomItem { public LevelTypes levelType = (LevelTypes)510; public int rarity; public CustomScrap(string name, string itemPath, LevelTypes levelType, int rarity, Action action = null) : base(name, itemPath, null, action) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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) this.levelType = levelType; this.rarity = rarity; } public static CustomScrap Add(string name, string itemPath, LevelTypes levelType, int rarity, Action action = null) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return new CustomScrap(name, itemPath, levelType, rarity, action); } } public class CustomPlainItem : CustomItem { public CustomPlainItem(string name, string itemPath, Action action = null) : base(name, itemPath, null, action) { } public static CustomPlainItem Add(string name, string itemPath, Action action = null) { return new CustomPlainItem(name, itemPath, action); } } public class CustomEnemy { public string name; public string enemyPath; public int rarity; public LevelTypes levelFlags; public SpawnType spawnType; public string infoKeyword; public string infoNode; public bool enabled = true; public CustomEnemy(string name, string enemyPath, int rarity, LevelTypes levelFlags, SpawnType spawnType, string infoKeyword, string infoNode) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) this.name = name; this.enemyPath = enemyPath; this.rarity = rarity; this.levelFlags = levelFlags; this.spawnType = spawnType; this.infoKeyword = infoKeyword; this.infoNode = infoNode; } public static CustomEnemy Add(string name, string enemyPath, int rarity, LevelTypes levelFlags, SpawnType spawnType, string infoKeyword, string infoNode, bool enabled = true) { //IL_0003: 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) return new CustomEnemy(name, enemyPath, rarity, levelFlags, spawnType, infoKeyword, infoNode) { enabled = enabled }; } } public class CustomMapObject { public string name; public string objectPath; public LevelTypes levelFlags; public Func spawnRateFunction; public bool enabled = true; public CustomMapObject(string name, string objectPath, LevelTypes levelFlags, Func spawnRateFunction = null, bool enabled = false) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) this.name = name; this.objectPath = objectPath; this.levelFlags = levelFlags; this.spawnRateFunction = spawnRateFunction; this.enabled = enabled; } public static CustomMapObject Add(string name, string objectPath, LevelTypes levelFlags, Func spawnRateFunction = null, bool enabled = false) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return new CustomMapObject(name, objectPath, levelFlags, spawnRateFunction, enabled); } } public static AssetBundle MainAssets; public static Dictionary Prefabs = new Dictionary(); public static GameObject devMenuPrefab; public static List customUnlockables; public static List customItems; public static List customEnemies; public static List customMapObjects; public static GameObject ConfigManagerPrefab; public static void TryLoadAssets() { if ((Object)(object)MainAssets == (Object)null) { MainAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "lethalthings")); Plugin.logger.LogInfo((object)"Loaded asset bundle"); } } public static void Load() { //IL_0583: Unknown result type (might be due to invalid IL or missing references) //IL_070f: Unknown result type (might be due to invalid IL or missing references) //IL_0716: Unknown result type (might be due to invalid IL or missing references) //IL_07a5: Unknown result type (might be due to invalid IL or missing references) TryLoadAssets(); customItems = new List { CustomScrap.Add("Arson", "Assets/Custom/LethalThings/Scrap/Arson/ArsonPlush.asset", (LevelTypes)510, Config.arsonSpawnWeight.Value), CustomScrap.Add("Cookie", "Assets/Custom/LethalThings/Scrap/Cookie/CookieFumo.asset", (LevelTypes)510, Config.cookieSpawnWeight.Value), CustomScrap.Add("Bilka", "Assets/Custom/LethalThings/Scrap/Toimari/ToimariPlush.asset", (LevelTypes)510, Config.toimariSpawnWeight.Value), CustomScrap.Add("Hamis", "Assets/Custom/LethalThings/Scrap/Hamis/HamisPlush.asset", (LevelTypes)510, Config.hamisSpawnWeight.Value), CustomScrap.Add("ArsonDirty", "Assets/Custom/LethalThings/Scrap/Arson/ArsonPlushDirty.asset", (LevelTypes)510, Config.dirtyArsonSpawnWeight.Value), CustomScrap.Add("Maxwell", "Assets/Custom/LethalThings/Scrap/Maxwell/Dingus.asset", (LevelTypes)510, Config.maxwellSpawnWeight.Value), CustomScrap.Add("Glizzy", "Assets/Custom/LethalThings/Scrap/glizzy/glizzy.asset", (LevelTypes)510, Config.glizzySpawnChance.Value), CustomScrap.Add("Revolver", "Assets/Custom/LethalThings/Scrap/Flaggun/Toygun.asset", (LevelTypes)510, Config.revolverSpawnChance.Value), CustomShopItem.Add("RocketLauncher", "Assets/Custom/LethalThings/Items/RocketLauncher/RocketLauncher.asset", "Assets/Custom/LethalThings/Items/RocketLauncher/RocketLauncherInfo.asset", Config.rocketLauncherPrice.Value, delegate(Item item) { NetworkPrefabs.RegisterNetworkPrefab(item.spawnPrefab.GetComponent().missilePrefab); }, Config.rocketLauncherEnabled.Value), CustomShopItem.Add("Flaregun", "Assets/Custom/LethalThings/Items/Flaregun/Flaregun.asset", "Assets/Custom/LethalThings/Items/Flaregun/FlaregunInfo.asset", Config.flareGunPrice.Value, delegate(Item item) { NetworkPrefabs.RegisterNetworkPrefab(item.spawnPrefab.GetComponent().projectilePrefab); }, Config.flareGunEnabled.Value), CustomShopItem.Add("FlaregunAmmo", "Assets/Custom/LethalThings/Items/Flaregun/FlaregunAmmo.asset", "Assets/Custom/LethalThings/Items/Flaregun/FlaregunAmmoInfo.asset", Config.flareGunAmmoPrice.Value, null, Config.flareGunEnabled.Value), CustomShopItem.Add("ToyHammer", "Assets/Custom/LethalThings/Items/ToyHammer/ToyHammer.asset", "Assets/Custom/LethalThings/Items/ToyHammer/ToyHammerInfo.asset", Config.toyHammerPrice.Value, null, Config.toyHammerEnabled.Value), CustomShopItem.Add("RemoteRadar", "Assets/Custom/LethalThings/Items/Radar/HandheldRadar.asset", "Assets/Custom/LethalThings/Items/Radar/HandheldRadarInfo.asset", Config.remoteRadarPrice.Value, null, Config.remoteRadarEnabled.Value), CustomShopItem.Add("PouchyBelt", "Assets/Custom/LethalThings/Items/Pouch/Pouch.asset", "Assets/Custom/LethalThings/Items/Pouch/PouchInfo.asset", Config.pouchyBeltPrice.Value, null, Config.pouchyBeltEnabled.Value), CustomShopItem.Add("HackingTool", "Assets/Custom/LethalThings/Items/HackingTool/HackingTool.asset", "Assets/Custom/LethalThings/Items/HackingTool/HackingToolInfo.asset", Config.hackingToolPrice.Value, null, Config.hackingToolEnabled.Value), CustomPlainItem.Add("Dart", "Assets/Custom/LethalThings/Unlockables/dartboard/Dart.asset"), CustomScrap.Add("GremlinEnergy", "Assets/Custom/LethalThings/Scrap/GremlinEnergy/GremlinEnergy.asset", (LevelTypes)510, Config.gremlinSodaSpawnChance.Value) }; customEnemies = new List { CustomEnemy.Add("Boomba", "Assets/Custom/LethalThings/Enemies/Roomba/Boomba.asset", Config.boombaSpawnWeight.Value, (LevelTypes)510, (SpawnType)0, null, "Assets/Custom/LethalThings/Enemies/Roomba/BoombaFile.asset") }; customUnlockables = new List { CustomUnlockable.Add("SmallRug", "Assets/Custom/LethalThings/Unlockables/Rug/SmallRug.asset", "Assets/Custom/LethalThings/Unlockables/Rug/RugInfo.asset", null, Config.smallRugPrice.Value, Config.rugsEnabled.Value), CustomUnlockable.Add("LargeRug", "Assets/Custom/LethalThings/Unlockables/Rug/LargeRug.asset", "Assets/Custom/LethalThings/Unlockables/Rug/RugInfo.asset", null, Config.largeRugPrice.Value, Config.rugsEnabled.Value), CustomUnlockable.Add("FatalitiesSign", "Assets/Custom/LethalThings/Unlockables/Sign/Sign.asset", "Assets/Custom/LethalThings/Unlockables/Sign/SignInfo.asset", null, Config.fatalitiesSignPrice.Value, Config.fatalitiesSignEnabled.Value), CustomUnlockable.Add("Dartboard", "Assets/Custom/LethalThings/Unlockables/dartboard/Dartboard.asset", "Assets/Custom/LethalThings/Unlockables/dartboard/DartboardInfo.asset", null, Config.dartBoardPrice.Value, Config.dartBoardEnabled.Value) }; customMapObjects = new List { CustomMapObject.Add("TeleporterTrap", "Assets/Custom/LethalThings/hazards/TeleporterTrap/TeleporterTrap.asset", (LevelTypes)510, (SelectableLevel level) => new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, 0f), new Keyframe(1f, 4f) }), Config.teleporterTrapsEnabled.Value) }; foreach (CustomItem customItem in customItems) { if (customItem.enabled) { Item val = MainAssets.LoadAsset(customItem.itemPath); if ((Object)(object)val.spawnPrefab.GetComponent() == (Object)null && (Object)(object)val.spawnPrefab.GetComponent() == (Object)null) { NetworkTransform obj = val.spawnPrefab.AddComponent(); obj.SlerpPosition = false; obj.Interpolate = false; obj.SyncPositionX = false; obj.SyncPositionY = false; obj.SyncPositionZ = false; obj.SyncScaleX = false; obj.SyncScaleY = false; obj.SyncScaleZ = false; obj.UseHalfFloatPrecision = true; } Prefabs.Add(customItem.name, val.spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab); customItem.itemAction(val); if (customItem is CustomShopItem) { TerminalNode val2 = MainAssets.LoadAsset(customItem.infoPath); Plugin.logger.LogInfo((object)$"Registering shop item {customItem.name} with price {((CustomShopItem)customItem).itemPrice}"); Items.RegisterShopItem(val, (TerminalNode)null, (TerminalNode)null, val2, ((CustomShopItem)customItem).itemPrice); } else if (customItem is CustomScrap) { Items.RegisterScrap(val, ((CustomScrap)customItem).rarity, ((CustomScrap)customItem).levelType); } else if (customItem is CustomPlainItem) { Items.RegisterItem(val); } } } foreach (CustomUnlockable customUnlockable in customUnlockables) { if (customUnlockable.enabled) { UnlockableItem unlockable = MainAssets.LoadAsset(customUnlockable.unlockablePath).unlockable; if ((Object)(object)unlockable.prefabObject != (Object)null) { NetworkPrefabs.RegisterNetworkPrefab(unlockable.prefabObject); } Prefabs.Add(customUnlockable.name, unlockable.prefabObject); TerminalNode val3 = null; if (customUnlockable.infoPath != null) { val3 = MainAssets.LoadAsset(customUnlockable.infoPath); } Unlockables.RegisterUnlockable(unlockable, (StoreType)2, (TerminalNode)null, (TerminalNode)null, val3, customUnlockable.unlockCost); } } foreach (CustomEnemy customEnemy in customEnemies) { if (customEnemy.enabled) { EnemyType val4 = MainAssets.LoadAsset(customEnemy.enemyPath); TerminalNode val5 = MainAssets.LoadAsset(customEnemy.infoNode); TerminalKeyword val6 = null; if (customEnemy.infoKeyword != null) { val6 = MainAssets.LoadAsset(customEnemy.infoKeyword); } NetworkPrefabs.RegisterNetworkPrefab(val4.enemyPrefab); Prefabs.Add(customEnemy.name, val4.enemyPrefab); Enemies.RegisterEnemy(val4, customEnemy.rarity, customEnemy.levelFlags, customEnemy.spawnType, val5, val6); } } foreach (CustomMapObject customMapObject in customMapObjects) { if (customMapObject.enabled) { SpawnableMapObjectDef val7 = MainAssets.LoadAsset(customMapObject.objectPath); NetworkPrefabs.RegisterNetworkPrefab(val7.spawnableMapObject.prefabToSpawn); Prefabs.Add(customMapObject.name, val7.spawnableMapObject.prefabToSpawn); MapObjects.RegisterMapObject(val7, customMapObject.levelFlags, customMapObject.spawnRateFunction); } } foreach (KeyValuePair prefab in Prefabs) { GameObject value = prefab.Value; string key = prefab.Key; AudioSource[] componentsInChildren = value.GetComponentsInChildren(); if (componentsInChildren.Length != 0) { ConfigEntry val8 = Config.VolumeConfig.Bind("Volume", key ?? "", 100f, "Audio volume for " + key + " (0 - 100)"); AudioSource[] array = componentsInChildren; foreach (AudioSource obj2 in array) { obj2.volume *= val8.Value / 100f; } } } GameObject obj3 = MainAssets.LoadAsset("Assets/Custom/LethalThings/DevMenu.prefab"); NetworkPrefabs.RegisterNetworkPrefab(obj3); devMenuPrefab = obj3; try { foreach (Type loadableType in Assembly.GetExecutingAssembly().GetLoadableTypes()) { MethodInfo[] methods = loadableType.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); foreach (MethodInfo methodInfo in methods) { if (methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false).Length != 0) { methodInfo.Invoke(null, null); } } } } catch (Exception) { } Plugin.logger.LogInfo((object)"Custom content loaded!"); } } public static class InputCompat { public static InputActionAsset Asset; public static bool Enabled => Chainloader.PluginInfos.ContainsKey("com.rune580.LethalCompanyInputUtils"); public static InputAction LTUtilityBeltQuick1 => Keybinds.Instance.LTUtilityBeltQuick1; public static InputAction LTUtilityBeltQuick2 => Keybinds.Instance.LTUtilityBeltQuick2; public static InputAction LTUtilityBeltQuick3 => Keybinds.Instance.LTUtilityBeltQuick3; public static InputAction LTUtilityBeltQuick4 => Keybinds.Instance.LTUtilityBeltQuick4; public static void Init() { Keybinds.Instance = new Keybinds(); Asset = Keybinds.Instance.GetAsset(); } } public class Keybinds : LcInputActions { public static Keybinds Instance; [InputAction("", Name = "[LT] Utility Belt Quick 1")] public InputAction LTUtilityBeltQuick1 { get; set; } [InputAction("", Name = "[LT] Utility Belt Quick 2")] public InputAction LTUtilityBeltQuick2 { get; set; } [InputAction("", Name = "[LT] Utility Belt Quick 3")] public InputAction LTUtilityBeltQuick3 { get; set; } [InputAction("", Name = "[LT] Utility Belt Quick 4")] public InputAction LTUtilityBeltQuick4 { get; set; } public InputActionAsset GetAsset() { return ((LcInputActions)this).Asset; } } public class Dingus : SaveableObject { public AudioSource noiseAudio; public AudioSource noiseAudioFar; public AudioSource musicAudio; public AudioSource musicAudioFar; [Space(3f)] public AudioClip[] noiseSFX; public AudioClip[] noiseSFXFar; public AudioClip evilNoise; [Space(3f)] public float noiseRange; public float maxLoudness; public float minLoudness; public float minPitch; public float maxPitch; private Random noisemakerRandom; public Animator triggerAnimator; private int timesPlayedWithoutTurningOff; private RoundManager roundManager; private float noiseInterval = 1f; public Animator danceAnimator; public bool wasLoadedFromSave; public bool exploding; private NetworkVariable isEvil = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public GameObject evilObject; public NetworkVariable isPlayingMusic = new NetworkVariable(Config.maxwellPlayMusicDefault.Value, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)1); public NetworkVariable isPipebomb = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public override void SaveObjectData() { SaveData.SaveObjectData("dingusBeEvil", isEvil.Value, uniqueId); } public override void LoadObjectData() { if (((NetworkBehaviour)this).IsHost) { bool flag = SaveData.LoadObjectData("dingusBeEvil", uniqueId); if (flag) { isEvil.Value = flag; } } } public override void Start() { ((GrabbableObject)this).Start(); roundManager = Object.FindObjectOfType(); noisemakerRandom = new Random(StartOfRound.Instance.randomMapSeed + 85); Debug.Log((object)"Making the dingus dance"); } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if (((NetworkBehaviour)this).IsOwner) { isPlayingMusic.Value = Config.maxwellPlayMusicDefault.Value; } if (((NetworkBehaviour)this).IsHost) { isEvil.Value = Random.Range(0f, 100f) <= Config.evilMaxwellChance.Value; } } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_0117: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemActivate(used, buttonDown); if (!((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null)) { int num = noisemakerRandom.Next(0, noiseSFX.Length); float num2 = (float)noisemakerRandom.Next((int)(minLoudness * 100f), (int)(maxLoudness * 100f)) / 100f; float pitch = (float)noisemakerRandom.Next((int)(minPitch * 100f), (int)(maxPitch * 100f)) / 100f; noiseAudio.pitch = pitch; noiseAudio.PlayOneShot(noiseSFX[num], num2); if ((Object)(object)noiseAudioFar != (Object)null) { noiseAudioFar.pitch = pitch; noiseAudioFar.PlayOneShot(noiseSFXFar[num], num2); } if ((Object)(object)triggerAnimator != (Object)null) { triggerAnimator.SetTrigger("playAnim"); } WalkieTalkie.TransmitOneShotAudio(noiseAudio, noiseSFX[num], num2); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, noiseRange, num2, 0, ((GrabbableObject)this).isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0); } } public override void DiscardItem() { if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { ((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = false; } ((GrabbableObject)this).isBeingUsed = false; ((GrabbableObject)this).DiscardItem(); } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); ((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = true; danceAnimator.Play("dingusIdle"); Debug.Log((object)"Making the dingus idle"); } public override void ItemInteractLeftRight(bool right) { ((GrabbableObject)this).ItemInteractLeftRight(right); if (!right && ((NetworkBehaviour)this).IsOwner) { isPlayingMusic.Value = !isPlayingMusic.Value; } } public override void InteractItem() { ((GrabbableObject)this).InteractItem(); if (isEvil.Value && !exploding && !isPipebomb.Value) { EvilMaxwellServerRpc(); } } public void EvilMaxwellTruly() { danceAnimator.Play("dingusIdle"); if (musicAudio.isPlaying) { musicAudio.Pause(); musicAudioFar.Pause(); } ((MonoBehaviour)this).StartCoroutine(evilMaxwellMoment()); } [ServerRpc(RequireOwnership = false)] public void EvilMaxwellServerRpc() { //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(88404199u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 88404199u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { isPipebomb.Value = true; EvilMaxwellClientRpc(); } } } [ClientRpc] public void EvilMaxwellClientRpc() { //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) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1120322383u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1120322383u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { EvilMaxwellTruly(); exploding = true; if (((NetworkBehaviour)this).IsOwner) { isPlayingMusic.Value = false; } timesPlayedWithoutTurningOff = 0; danceAnimator.Play("dingusIdle"); if (musicAudio.isPlaying) { musicAudio.Pause(); musicAudioFar.Pause(); } Plugin.logger.LogInfo((object)"Evil maxwell moment"); } } public IEnumerator evilMaxwellMoment() { yield return (object)new WaitForSeconds(1f); noiseAudio.PlayOneShot(evilNoise, 1f); evilObject.SetActive(true); ((Renderer)((GrabbableObject)this).mainObjectRenderer).enabled = false; if ((Object)(object)noiseAudioFar != (Object)null) { noiseAudioFar.PlayOneShot(evilNoise, 1f); } if ((Object)(object)triggerAnimator != (Object)null) { triggerAnimator.SetTrigger("playAnim"); } WalkieTalkie.TransmitOneShotAudio(noiseAudio, evilNoise, 1f); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, noiseRange, 1f, 0, ((GrabbableObject)this).isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0); yield return (object)new WaitForSeconds(1.5f); Utilities.CreateExplosion(((Component)this).transform.position, spawnExplosionEffect: true, 100, 0f, 6.4f, 6, (CauseOfDeath)3); Rigidbody[] componentsInChildren = evilObject.GetComponentsInChildren(); foreach (Rigidbody obj in componentsInChildren) { obj.isKinematic = false; obj.AddExplosionForce(1000f, evilObject.transform.position, 100f); } yield return (object)new WaitForSeconds(2f); if (((NetworkBehaviour)this).IsServer) { ((Component)this).GetComponent().Despawn(true); } } public override void Update() { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).Update(); if (isEvil.Value) { ((GrabbableObject)this).grabbable = false; ((GrabbableObject)this).grabbableToEnemies = false; } if (isPlayingMusic.Value && !exploding) { if (!musicAudio.isPlaying) { musicAudio.Play(); musicAudioFar.Play(); } if (!((GrabbableObject)this).isHeld) { danceAnimator.Play("dingusDance"); } else { danceAnimator.Play("dingusIdle"); } if (noiseInterval <= 0f) { noiseInterval = 1f; timesPlayedWithoutTurningOff++; roundManager.PlayAudibleNoise(((Component)this).transform.position, 16f, 0.9f, timesPlayedWithoutTurningOff, false, 5); } else { noiseInterval -= Time.deltaTime; } } else { timesPlayedWithoutTurningOff = 0; danceAnimator.Play("dingusIdle"); if (musicAudio.isPlaying) { musicAudio.Pause(); musicAudioFar.Pause(); } } } protected override void __initializeVariables() { if (isEvil == null) { throw new Exception("Dingus.isEvil cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)isEvil).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)isEvil, "isEvil"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)isEvil); if (isPlayingMusic == null) { throw new Exception("Dingus.isPlayingMusic cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)isPlayingMusic).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)isPlayingMusic, "isPlayingMusic"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)isPlayingMusic); if (isPipebomb == null) { throw new Exception("Dingus.isPipebomb cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)isPipebomb).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)isPipebomb, "isPipebomb"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)isPipebomb); base.__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_Dingus() { //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(88404199u, new RpcReceiveHandler(__rpc_handler_88404199)); NetworkManager.__rpc_func_table.Add(1120322383u, new RpcReceiveHandler(__rpc_handler_1120322383)); } private static void __rpc_handler_88404199(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; ((Dingus)(object)target).EvilMaxwellServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1120322383(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; ((Dingus)(object)target).EvilMaxwellClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Dingus"; } } public class Missile : NetworkBehaviour { public int damage = 50; public float maxDistance = 10f; public float minDistance; public float gravity = 2.4f; public float flightDelay = 0.5f; public float flightForce = 150f; public float flightTime = 2f; public float autoDestroyTime = 3f; private float timeAlive; public float LobForce = 100f; public ParticleSystem particleSystem; private void OnCollisionEnter(Collision collision) { if (((NetworkBehaviour)this).IsHost) { Boom(); BoomClientRpc(); } else { BoomServerRpc(); } } private void Start() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) ((Component)this).GetComponent().useGravity = false; if (((NetworkBehaviour)this).IsHost) { ((Component)this).GetComponent().AddForce(((Component)this).transform.forward * LobForce, (ForceMode)1); } } [ClientRpc] public void BoomClientRpc() { //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)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3331368301u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3331368301u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { Boom(); } } } [ServerRpc] public void BoomServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(452316787u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 452316787u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { Boom(); BoomClientRpc(); } } public void CreateExplosion() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB attacker = ((IEnumerable)StartOfRound.Instance.allPlayerScripts).FirstOrDefault((Func)((PlayerControllerB x) => ((NetworkBehaviour)x).OwnerClientId == ((NetworkBehaviour)this).OwnerClientId)); Utilities.CreateExplosion(((Component)this).transform.position, spawnExplosionEffect: true, damage, minDistance, maxDistance, 10, (CauseOfDeath)3, attacker); } public void Boom() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)particleSystem == (Object)null) { Debug.LogError((object)"No particle system set on missile, destruction time!!"); CreateExplosion(); if (((NetworkBehaviour)this).IsHost) { Object.Destroy((Object)(object)((Component)this).gameObject); } return; } particleSystem.Stop(true, (ParticleSystemStopBehavior)1); ((Component)particleSystem).transform.SetParent((Transform)null); ((Component)particleSystem).transform.localScale = Vector3.one; GameObject gameObject = ((Component)particleSystem).gameObject; MainModule main = particleSystem.main; float duration = ((MainModule)(ref main)).duration; main = particleSystem.main; MinMaxCurve startLifetime = ((MainModule)(ref main)).startLifetime; Object.Destroy((Object)(object)gameObject, duration + ((MinMaxCurve)(ref startLifetime)).constant); CreateExplosion(); if (((NetworkBehaviour)this).IsHost) { Object.Destroy((Object)(object)((Component)this).gameObject); } } private void FixedUpdate() { //IL_001d: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)this).IsHost) { return; } ((Component)this).GetComponent().useGravity = false; ((Component)this).GetComponent().AddForce(Vector3.down * gravity); if (timeAlive <= flightTime && timeAlive >= flightDelay) { ((Component)this).GetComponent().AddForce(((Component)this).transform.forward * flightForce); } timeAlive += Time.fixedDeltaTime; if (timeAlive > autoDestroyTime) { if (((NetworkBehaviour)this).IsHost) { Boom(); BoomClientRpc(); } else { BoomServerRpc(); } } else { Debug.Log((object)("Time alive: " + timeAlive + " / " + autoDestroyTime)); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_Missile() { //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(3331368301u, new RpcReceiveHandler(__rpc_handler_3331368301)); NetworkManager.__rpc_func_table.Add(452316787u, new RpcReceiveHandler(__rpc_handler_452316787)); } private static void __rpc_handler_3331368301(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; ((Missile)(object)target).BoomClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_452316787(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((Missile)(object)target).BoomServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Missile"; } } public class PouchyBelt : GrabbableObject { [CompilerGenerated] private static class <>O { public static hook_SetHoverTipAndCurrentInteractTrigger <0>__PlayerControllerB_SetHoverTipAndCurrentInteractTrigger; public static hook_BeginGrabObject <1>__PlayerControllerB_BeginGrabObject; } public Transform beltCosmetic; public Vector3 beltCosmeticPositionOffset = new Vector3(0f, 0f, 0f); public Vector3 beltCosmeticRotationOffset = new Vector3(0f, 0f, 0f); public int beltCapacity = 3; private PlayerControllerB previousPlayerHeldBy; public List slotIndexes = new List(); public static void Initialize() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0030: 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_003b: Expected O, but got Unknown object obj = <>O.<0>__PlayerControllerB_SetHoverTipAndCurrentInteractTrigger; if (obj == null) { hook_SetHoverTipAndCurrentInteractTrigger val = PlayerControllerB_SetHoverTipAndCurrentInteractTrigger; <>O.<0>__PlayerControllerB_SetHoverTipAndCurrentInteractTrigger = val; obj = (object)val; } PlayerControllerB.SetHoverTipAndCurrentInteractTrigger += (hook_SetHoverTipAndCurrentInteractTrigger)obj; object obj2 = <>O.<1>__PlayerControllerB_BeginGrabObject; if (obj2 == null) { hook_BeginGrabObject val2 = PlayerControllerB_BeginGrabObject; <>O.<1>__PlayerControllerB_BeginGrabObject = val2; obj2 = (object)val2; } PlayerControllerB.BeginGrabObject += (hook_BeginGrabObject)obj2; } public void Awake() { if (InputCompat.Enabled) { InputCompat.LTUtilityBeltQuick1.started += InputReceived; InputCompat.LTUtilityBeltQuick2.started += InputReceived; InputCompat.LTUtilityBeltQuick3.started += InputReceived; InputCompat.LTUtilityBeltQuick4.started += InputReceived; } } private static void PlayerControllerB_BeginGrabObject(orig_BeginGrabObject orig, PlayerControllerB self) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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_002c: Unknown result type (might be due to invalid IL or missing references) self.interactRay = new Ray(((Component)self.gameplayCamera).transform.position, ((Component)self.gameplayCamera).transform.forward); if (!Physics.Raycast(self.interactRay, ref self.hit, self.grabDistance, self.interactableObjectsMask) || ((Component)((RaycastHit)(ref self.hit)).collider).gameObject.layer == 8 || !(((Component)((RaycastHit)(ref self.hit)).collider).tag == "PhysicsProp") || self.twoHanded || self.sinkingValue > 0.73f) { return; } self.currentlyGrabbingObject = ((Component)((Component)((RaycastHit)(ref self.hit)).collider).transform).gameObject.GetComponent(); if ((!GameNetworkManager.Instance.gameHasStarted && !self.currentlyGrabbingObject.itemProperties.canBeGrabbedBeforeGameStart && ((Object)(object)StartOfRound.Instance.testRoom == (Object)null || !StartOfRound.Instance.testRoom.activeSelf)) || (Object)(object)self.currentlyGrabbingObject == (Object)null || self.inSpecialInteractAnimation || self.currentlyGrabbingObject.isHeld || self.currentlyGrabbingObject.isPocketed) { return; } NetworkObject networkObject = ((NetworkBehaviour)self.currentlyGrabbingObject).NetworkObject; if (!((Object)(object)networkObject == (Object)null) && networkObject.IsSpawned) { if (self.currentlyGrabbingObject is PouchyBelt && self.ItemSlots.Any((GrabbableObject x) => (Object)(object)x != (Object)null && x is PouchyBelt)) { self.currentlyGrabbingObject.grabbable = false; } orig.Invoke(self); if (self.currentlyGrabbingObject is PouchyBelt) { self.currentlyGrabbingObject.grabbable = true; } } } private static void PlayerControllerB_SetHoverTipAndCurrentInteractTrigger(orig_SetHoverTipAndCurrentInteractTrigger orig, PlayerControllerB self) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (!Physics.Raycast(self.interactRay, ref self.hit, self.grabDistance, self.interactableObjectsMask) || ((Component)((RaycastHit)(ref self.hit)).collider).gameObject.layer == 8 || !(((Component)((RaycastHit)(ref self.hit)).collider).tag == "PhysicsProp")) { return; } if (self.FirstEmptyItemSlot() == -1) { ((TMP_Text)self.cursorTip).text = "Inventory full!"; } else if (((Component)((RaycastHit)(ref self.hit)).collider).gameObject.GetComponent() is PouchyBelt) { if (self.ItemSlots.Any((GrabbableObject x) => (Object)(object)x != (Object)null && x is PouchyBelt)) { ((TMP_Text)self.cursorTip).text = "(Cannot hold more than 1 belt)"; } else { ((TMP_Text)self.cursorTip).text = "Pick up belt"; } } } public void InputReceived(CallbackContext context) { if (((NetworkBehaviour)this).IsOwner && (Object)(object)base.playerHeldBy != (Object)null && ((CallbackContext)(ref context)).started) { int num = -1; if (((CallbackContext)(ref context)).action == InputCompat.LTUtilityBeltQuick1) { num = 0; } else if (((CallbackContext)(ref context)).action == InputCompat.LTUtilityBeltQuick2) { num = 1; } else if (((CallbackContext)(ref context)).action == InputCompat.LTUtilityBeltQuick3) { num = 2; } else if (((CallbackContext)(ref context)).action == InputCompat.LTUtilityBeltQuick4) { num = 3; } if (num != -1 && num < slotIndexes.Count) { base.playerHeldBy.SwitchItemSlots(slotIndexes[num]); Plugin.logger.LogInfo((object)$"Switched to slot: {slotIndexes[num]}"); } } } public override void LateUpdate() { //IL_0076: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).LateUpdate(); if ((Object)(object)previousPlayerHeldBy != (Object)null) { ((Component)beltCosmetic).gameObject.SetActive(true); beltCosmetic.SetParent((Transform)null); ((Renderer)((Component)beltCosmetic).GetComponent()).enabled = true; if (((NetworkBehaviour)this).IsOwner) { ((Renderer)((Component)beltCosmetic).GetComponent()).enabled = false; } Transform parent = previousPlayerHeldBy.lowerSpine.parent; beltCosmetic.position = parent.position + beltCosmeticPositionOffset; Quaternion rotation = parent.rotation; Quaternion rotation2 = Quaternion.Euler(((Quaternion)(ref rotation)).eulerAngles + beltCosmeticRotationOffset); beltCosmetic.rotation = rotation2; ((Renderer)base.mainObjectRenderer).enabled = false; ((Component)this).gameObject.SetActive(true); } else { ((Component)beltCosmetic).gameObject.SetActive(false); ((Renderer)base.mainObjectRenderer).enabled = true; beltCosmetic.SetParent(((Component)this).transform); } } public void UpdateHUD(bool add) { //IL_007d: 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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) slotIndexes.Clear(); HUDManager instance = HUDManager.Instance; if (add) { int num = 0; GrabbableObject[] itemSlots = GameNetworkManager.Instance.localPlayerController.ItemSlots; for (int i = 0; i < itemSlots.Length; i++) { if (itemSlots[i] is PouchyBelt) { num++; } } Image val = instance.itemSlotIconFrames[0]; Image val2 = instance.itemSlotIcons[0]; int num2 = instance.itemSlotIconFrames.Length; ((Component)val).GetComponentInParent(); ((Component)val).GetComponentInParent(); float x2 = ((Graphic)val).rectTransform.sizeDelta.x; float y = ((Graphic)val).rectTransform.sizeDelta.y; float num3 = ((Graphic)val).rectTransform.anchoredPosition.y + 1.125f * y * (float)num; Vector3 localEulerAngles = ((Transform)((Graphic)val).rectTransform).localEulerAngles; Vector3 localEulerAngles2 = ((Transform)((Graphic)val2).rectTransform).localEulerAngles; List list = instance.itemSlotIconFrames.ToList(); List list2 = instance.itemSlotIcons.ToList(); int num4 = list.FindLastIndex((Image x) => Regex.IsMatch(((Object)((Component)x).gameObject).name.ToLowerInvariant(), "\\bslot\\d\\b")); _ = beltCapacity; _ = beltCapacity; Debug.Log((object)$"Adding {beltCapacity} item slots! Surely this will go well.."); Debug.Log((object)$"Adding after index: {num4}"); for (int j = 0; j < beltCapacity; j++) { float num5 = 0f - ((Component)((Transform)((Graphic)val).rectTransform).parent).GetComponent().sizeDelta.x / 2f - 3f + (float)j * x2 + (float)j * 15f; Image val3 = Object.Instantiate(list[0], ((Component)val).transform.parent); ((Object)val3).name = $"Slot{num2 + j}[LethalThingsBelt]"; ((Graphic)val3).rectTransform.anchoredPosition = new Vector2(num5, num3); ((Transform)((Graphic)val3).rectTransform).eulerAngles = localEulerAngles; Image component = ((Component)((Component)val3).transform.GetChild(0)).GetComponent(); ((Object)component).name = "icon"; ((Behaviour)component).enabled = false; ((Transform)((Graphic)component).rectTransform).eulerAngles = localEulerAngles2; ((Transform)((Graphic)component).rectTransform).Rotate(new Vector3(0f, 0f, -90f)); int num6 = num4 + j + 1; list.Insert(num6, val3); list2.Insert(num6, component); slotIndexes.Add(num6); ((Component)val3).transform.SetSiblingIndex(num6); } instance.itemSlotIconFrames = list.ToArray(); instance.itemSlotIcons = list2.ToArray(); Debug.Log((object)$"Added {beltCapacity} item slots!"); return; } List list3 = instance.itemSlotIconFrames.ToList(); List list4 = instance.itemSlotIcons.ToList(); int count = list3.Count; int num7 = 0; for (int num8 = count - 1; num8 >= 0; num8--) { if (((Object)list3[num8]).name.Contains("[LethalThingsBelt]")) { num7++; Image obj = list3[num8]; list3.RemoveAt(num8); list4.RemoveAt(num8); Object.Destroy((Object)(object)((Component)obj).gameObject); if (num7 >= beltCapacity) { break; } } } instance.itemSlotIconFrames = list3.ToArray(); instance.itemSlotIcons = list4.ToArray(); Debug.Log((object)$"Removed {beltCapacity} item slots!"); } public void AddItemSlots() { if ((Object)(object)base.playerHeldBy != (Object)null) { List list = base.playerHeldBy.ItemSlots.ToList(); base.playerHeldBy.ItemSlots = (GrabbableObject[])(object)new GrabbableObject[list.Count + beltCapacity]; for (int i = 0; i < list.Count; i++) { base.playerHeldBy.ItemSlots[i] = list[i]; } if ((Object)(object)base.playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { UpdateHUD(add: true); } } } public void RemoveItemSlots() { if (!((Object)(object)base.playerHeldBy != (Object)null)) { return; } int num = base.playerHeldBy.ItemSlots.Length - beltCapacity; int currentItemSlot = base.playerHeldBy.currentItemSlot; for (int i = 0; i < beltCapacity; i++) { GrabbableObject val = base.playerHeldBy.ItemSlots[num + i]; if ((Object)(object)val != (Object)null) { base.playerHeldBy.DropItem(val, num + i); } } int currentItemSlot2 = base.playerHeldBy.currentItemSlot; currentItemSlot2 = ((currentItemSlot < base.playerHeldBy.ItemSlots.Length) ? currentItemSlot : 0); List list = base.playerHeldBy.ItemSlots.ToList(); base.playerHeldBy.ItemSlots = (GrabbableObject[])(object)new GrabbableObject[list.Count - beltCapacity]; for (int j = 0; j < base.playerHeldBy.ItemSlots.Length; j++) { base.playerHeldBy.ItemSlots[j] = list[j]; } if ((Object)(object)base.playerHeldBy == (Object)(object)GameNetworkManager.Instance.localPlayerController) { UpdateHUD(add: false); } base.playerHeldBy.SwitchItemSlots(currentItemSlot2); } public override void DiscardItem() { RemoveItemSlots(); previousPlayerHeldBy = null; ((GrabbableObject)this).DiscardItem(); } public override void OnNetworkDespawn() { RemoveItemSlots(); previousPlayerHeldBy = null; ((NetworkBehaviour)this).OnNetworkDespawn(); } public void GrabItemOnClient() { ((GrabbableObject)this).GrabItemOnClient(); } public override void OnDestroy() { if (InputCompat.Enabled) { InputCompat.LTUtilityBeltQuick1.started -= InputReceived; InputCompat.LTUtilityBeltQuick2.started -= InputReceived; InputCompat.LTUtilityBeltQuick3.started -= InputReceived; InputCompat.LTUtilityBeltQuick4.started -= InputReceived; } ((NetworkBehaviour)this).OnDestroy(); } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if ((Object)(object)base.playerHeldBy != (Object)null) { if ((Object)(object)base.playerHeldBy != (Object)(object)previousPlayerHeldBy) { AddItemSlots(); } previousPlayerHeldBy = base.playerHeldBy; } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected internal override string __getTypeName() { return "PouchyBelt"; } } public class PowerOutletStun : NetworkBehaviour { private Coroutine electrocutionCoroutine; public AudioSource strikeAudio; public ParticleSystem strikeParticle; private NetworkVariable damage = new NetworkVariable(20, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public void Electrocute(ItemCharger socket) { Debug.Log((object)"Attempting electrocution"); if (electrocutionCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(electrocutionCoroutine); } electrocutionCoroutine = ((MonoBehaviour)this).StartCoroutine(electrocutionDelayed(socket)); } public void Awake() { //IL_0035: 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) StormyWeather val = Object.FindObjectOfType(true); GameObject gameObject = ((Component)val.targetedStrikeAudio).gameObject; strikeAudio = Object.Instantiate(gameObject, ((Component)this).transform).GetComponent(); ((Component)strikeAudio).transform.localPosition = Vector3.zero; ((Component)strikeAudio).gameObject.SetActive(true); strikeParticle = Object.Instantiate(((Component)val.explosionEffectParticle).gameObject, ((Component)this).transform).GetComponent(); ((Component)strikeParticle).transform.localPosition = Vector3.zero; ((Component)strikeParticle).gameObject.SetActive(true); if (((NetworkBehaviour)this).IsHost) { damage.Value = Config.itemChargerElectrocutionDamage.Value; } } private IEnumerator electrocutionDelayed(ItemCharger socket) { Debug.Log((object)"Electrocution started"); socket.zapAudio.Play(); yield return (object)new WaitForSeconds(0.75f); socket.chargeStationAnimator.SetTrigger("zap"); Debug.Log((object)"Electrocution finished"); if (((NetworkBehaviour)this).NetworkObject.IsOwner && !((NetworkBehaviour)this).NetworkObject.IsOwnedByServer) { Debug.Log((object)"Sending stun to server!!"); ElectrocutedServerRpc(((Component)this).transform.position); } else if (((NetworkBehaviour)this).NetworkObject.IsOwner && ((NetworkBehaviour)this).NetworkObject.IsOwnedByServer) { Debug.Log((object)"Sending stun to clients!!"); ElectrocutedClientRpc(((Component)this).transform.position); Electrocuted(((Component)this).transform.position); } } [ClientRpc] private void ElectrocutedClientRpc(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_00d3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(328188188u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 328188188u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { Debug.Log((object)"Stun received!!"); Electrocuted(position); } } } private void Electrocuted(Vector3 position) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) StormyWeather obj = Object.FindObjectOfType(true); Utilities.CreateExplosion(position, spawnExplosionEffect: false, Config.itemChargerElectrocutionDamage.Value, 0f, 5f, 3, (CauseOfDeath)11); strikeParticle.Play(); obj.PlayThunderEffects(position, strikeAudio); } [ServerRpc] private void ElectrocutedServerRpc(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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2844681185u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2844681185u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ElectrocutedClientRpc(position); } } protected override void __initializeVariables() { if (damage == null) { throw new Exception("PowerOutletStun.damage cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)damage).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)damage, "damage"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)damage); ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_PowerOutletStun() { //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(328188188u, new RpcReceiveHandler(__rpc_handler_328188188)); NetworkManager.__rpc_func_table.Add(2844681185u, new RpcReceiveHandler(__rpc_handler_2844681185)); } private static void __rpc_handler_328188188(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); target.__rpc_exec_stage = (__RpcExecStage)2; ((PowerOutletStun)(object)target).ElectrocutedClientRpc(position); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2844681185(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); target.__rpc_exec_stage = (__RpcExecStage)1; ((PowerOutletStun)(object)target).ElectrocutedServerRpc(position); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "PowerOutletStun"; } } public class ProjectileWeapon : SaveableObject { public AudioSource mainAudio; public AudioClip[] activateClips; public AudioClip[] noAmmoSounds; public AudioClip[] reloadSounds; public Transform aimDirection; public int maxAmmo = 4; private NetworkVariable currentAmmo = new NetworkVariable(4, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public GameObject projectilePrefab; public float LobForce = 100f; private float timeSinceLastShot; private PlayerControllerB previousPlayerHeldBy; public Animator Animator; public ParticleSystem particleSystem; public Item ammoItem; public int ammoSlotToUse = -1; public override void SaveObjectData() { SaveData.SaveObjectData("projectileWeaponAmmoData", currentAmmo.Value, uniqueId); } public override void LoadObjectData() { if (((NetworkBehaviour)this).IsHost) { currentAmmo.Value = SaveData.LoadObjectData("projectileWeaponAmmoData", uniqueId); } } public static void Init() { } private static bool GrabbableObject_UseItemBatteries(orig_UseItemBatteries orig, GrabbableObject self) { if (self is ProjectileWeapon) { return true; } return orig.Invoke(self); } public override void Start() { ((GrabbableObject)this).Start(); } public override void OnDestroy() { ((NetworkBehaviour)this).OnDestroy(); } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if (((NetworkBehaviour)this).IsServer) { currentAmmo.Value = maxAmmo; } } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemActivate(used, buttonDown); if (currentAmmo.Value > 0) { if (((NetworkBehaviour)this).IsHost) { NetworkVariable obj = currentAmmo; int value = obj.Value; obj.Value = value - 1; } PlayRandomAudio(mainAudio, activateClips); Animator.Play("fire"); particleSystem.Play(); timeSinceLastShot = 0f; if (((NetworkBehaviour)this).IsOwner) { if (((NetworkBehaviour)this).IsHost) { ProjectileSpawner(aimDirection.position, aimDirection.rotation); } else { SpawnProjectileServerRpc(aimDirection.position, aimDirection.rotation); } } } else { PlayRandomAudio(mainAudio, noAmmoSounds); } } private bool ReloadedGun() { int num = FindAmmoInInventory(); if (num == -1) { return false; } ammoSlotToUse = num; return true; } private int FindAmmoInInventory() { for (int i = 0; i < ((GrabbableObject)this).playerHeldBy.ItemSlots.Length; i++) { if (!((Object)(object)((GrabbableObject)this).playerHeldBy.ItemSlots[i] == (Object)null) && ((GrabbableObject)this).playerHeldBy.ItemSlots[i].itemProperties.itemId == ammoItem.itemId) { return i; } } return -1; } [ServerRpc] private void FixWeightServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(43845628u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 43845628u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { FixWeightClientRpc(); } } [ClientRpc] private void FixWeightClientRpc() { //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(948021082u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 948021082u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { PlayerControllerB playerHeldBy = ((GrabbableObject)this).playerHeldBy; playerHeldBy.carryWeight -= Mathf.Clamp(ammoItem.weight - 1f, 0f, 10f); } } } public override void ItemInteractLeftRight(bool right) { ((GrabbableObject)this).ItemInteractLeftRight(right); if (right || !((NetworkBehaviour)this).IsOwner) { return; } if (ReloadedGun()) { if (currentAmmo.Value > 0) { HUDManager.Instance.DisplayTip("Item already loaded.", "You can reload once you use up all the ammo.", false, false, "LC_Tip1"); return; } ReloadAmmoServerRpc(); DestroyItemInSlotAndSync(ammoSlotToUse); ammoSlotToUse = -1; } else { HUDManager.Instance.DisplayTip("No ammo found.", "Buy " + ammoItem.itemName + " from the Terminal to reload.", false, false, "LC_Tip1"); } } [ServerRpc] private void ReloadAmmoServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1064596822u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1064596822u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { currentAmmo.Value = maxAmmo; ReloadAmmoSoundClientRpc(); } } [ClientRpc] private void ReloadAmmoSoundClientRpc() { //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(3520251861u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3520251861u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { PlayRandomAudio(mainAudio, reloadSounds); Animator.Play("reload"); } } } [ServerRpc] private void SpawnProjectileServerRpc(Vector3 aimPosition, Quaternion aimRotation) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Invalid comparison between Unknown and I4 //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(681922146u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref aimPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref aimRotation); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 681922146u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ProjectileSpawner(aimPosition, aimRotation); } } private void ProjectileSpawner(Vector3 aimPosition, Quaternion aimRotation) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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) GameObject obj = Object.Instantiate(projectilePrefab, aimPosition, aimRotation); obj.GetComponent().SpawnWithOwnership(((NetworkBehaviour)this).OwnerClientId, false); obj.GetComponent().AddForce(aimDirection.forward * LobForce, (ForceMode)1); } private void PlayRandomAudio(AudioSource audioSource, AudioClip[] audioClips) { if (audioClips.Length != 0) { audioSource.PlayOneShot(audioClips[Random.Range(0, audioClips.Length)]); } } public override void Update() { ((GrabbableObject)this).Update(); timeSinceLastShot += Time.deltaTime; } private void OnEnable() { } private void OnDisable() { } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { ((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = false; } } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { ((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = false; } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); ((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = true; } public void DestroyItemInSlotAndSync(int itemSlot) { if (((NetworkBehaviour)this).IsOwner) { if (itemSlot >= ((GrabbableObject)this).playerHeldBy.ItemSlots.Length || (Object)(object)((GrabbableObject)this).playerHeldBy.ItemSlots[itemSlot] == (Object)null) { Debug.LogError((object)$"Destroy item in slot called for a slot (slot {itemSlot}) which is empty or incorrect"); } DestroyItemInSlotServerRpc(itemSlot); } } [ServerRpc] public void DestroyItemInSlotServerRpc(int itemSlot) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3656085789u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, itemSlot); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3656085789u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { DestroyItemInSlotClientRpc(itemSlot); } } [ClientRpc] public void DestroyItemInSlotClientRpc(int itemSlot) { //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_0071: 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) 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(314723133u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, itemSlot); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 314723133u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { DestroyItemInSlot(itemSlot); } } } public void DestroyItemInSlot(int itemSlot) { if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null || (Object)(object)NetworkManager.Singleton == (Object)null || NetworkManager.Singleton.ShutdownInProgress) { return; } GrabbableObject val = ((GrabbableObject)this).playerHeldBy.ItemSlots[itemSlot]; if ((Object)(object)val == (Object)null || (Object)(object)val.itemProperties == (Object)null) { Plugin.logger.LogError((object)"Item properties are null, cannot destroy item in slot"); return; } PlayerControllerB playerHeldBy = ((GrabbableObject)this).playerHeldBy; playerHeldBy.carryWeight -= Mathf.Clamp(val.itemProperties.weight - 1f, 0f, 10f); if (((GrabbableObject)this).playerHeldBy.currentItemSlot == itemSlot) { ((GrabbableObject)this).playerHeldBy.isHoldingObject = false; ((GrabbableObject)this).playerHeldBy.twoHanded = false; if (((NetworkBehaviour)((GrabbableObject)this).playerHeldBy).IsOwner) { ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetBool("cancelHolding", true); ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetTrigger("Throw"); ((Behaviour)HUDManager.Instance.holdingTwoHandedItem).enabled = false; HUDManager.Instance.ClearControlTips(); ((GrabbableObject)this).playerHeldBy.activatingItem = false; } } if (((NetworkBehaviour)this).IsOwner) { ((Behaviour)HUDManager.Instance.itemSlotIcons[itemSlot]).enabled = false; } if ((Object)(object)((GrabbableObject)this).playerHeldBy.currentlyHeldObjectServer != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy.currentlyHeldObjectServer == (Object)(object)val) { if (((NetworkBehaviour)((GrabbableObject)this).playerHeldBy).IsOwner) { ((GrabbableObject)this).playerHeldBy.SetSpecialGrabAnimationBool(false, ((GrabbableObject)this).playerHeldBy.currentlyHeldObjectServer); ((GrabbableObject)this).playerHeldBy.currentlyHeldObjectServer.DiscardItemOnClient(); } ((GrabbableObject)this).playerHeldBy.currentlyHeldObjectServer = null; } ((GrabbableObject)this).playerHeldBy.ItemSlots[itemSlot] = null; if (((NetworkBehaviour)this).IsServer) { ((NetworkBehaviour)val).NetworkObject.Despawn(true); } } protected override void __initializeVariables() { if (currentAmmo == null) { throw new Exception("ProjectileWeapon.currentAmmo cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)currentAmmo).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)currentAmmo, "currentAmmo"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)currentAmmo); base.__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_ProjectileWeapon() { //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 //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(43845628u, new RpcReceiveHandler(__rpc_handler_43845628)); NetworkManager.__rpc_func_table.Add(948021082u, new RpcReceiveHandler(__rpc_handler_948021082)); NetworkManager.__rpc_func_table.Add(1064596822u, new RpcReceiveHandler(__rpc_handler_1064596822)); NetworkManager.__rpc_func_table.Add(3520251861u, new RpcReceiveHandler(__rpc_handler_3520251861)); NetworkManager.__rpc_func_table.Add(681922146u, new RpcReceiveHandler(__rpc_handler_681922146)); NetworkManager.__rpc_func_table.Add(3656085789u, new RpcReceiveHandler(__rpc_handler_3656085789)); NetworkManager.__rpc_func_table.Add(314723133u, new RpcReceiveHandler(__rpc_handler_314723133)); } private static void __rpc_handler_43845628(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((ProjectileWeapon)(object)target).FixWeightServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_948021082(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; ((ProjectileWeapon)(object)target).FixWeightClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1064596822(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((ProjectileWeapon)(object)target).ReloadAmmoServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3520251861(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; ((ProjectileWeapon)(object)target).ReloadAmmoSoundClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_681922146(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { Vector3 aimPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref aimPosition); Quaternion aimRotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref aimRotation); target.__rpc_exec_stage = (__RpcExecStage)1; ((ProjectileWeapon)(object)target).SpawnProjectileServerRpc(aimPosition, aimRotation); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3656085789(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_0070: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { int itemSlot = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref itemSlot); target.__rpc_exec_stage = (__RpcExecStage)1; ((ProjectileWeapon)(object)target).DestroyItemInSlotServerRpc(itemSlot); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_314723133(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int itemSlot = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref itemSlot); target.__rpc_exec_stage = (__RpcExecStage)2; ((ProjectileWeapon)(object)target).DestroyItemInSlotClientRpc(itemSlot); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "ProjectileWeapon"; } } public class RocketLauncher : SaveableObject { public Light laserPointer; public Transform lightSource; public AudioSource mainAudio; public AudioClip[] activateClips; public AudioClip[] noAmmoSounds; public Transform aimDirection; public int maxAmmo = 4; private NetworkVariable currentAmmo = new NetworkVariable(4, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); private NetworkVariable isLaserOn = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)1); public GameObject missilePrefab; private float timeSinceLastShot; private PlayerControllerB previousPlayerHeldBy; private Material[] ammoLampMaterials; public Animator Animator; public ParticleSystem particleSystem; public LineRenderer laserLine; private Transform laserRoot; public override void SaveObjectData() { SaveData.SaveObjectData("rocketLauncherAmmoData", currentAmmo.Value, uniqueId); } public override void LoadObjectData() { if (((NetworkBehaviour)this).IsHost) { currentAmmo.Value = SaveData.LoadObjectData("rocketLauncherAmmoData", uniqueId); } } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if (((NetworkBehaviour)this).IsServer) { currentAmmo.Value = maxAmmo; } } public override void Awake() { base.Awake(); MeshRenderer componentInChildren = ((Component)this).GetComponentInChildren(); List list = new List(); for (int i = 1; i < ((Renderer)componentInChildren).materials.Length; i++) { list.Add(((Renderer)componentInChildren).materials[i]); } ammoLampMaterials = list.ToArray(); } public override void Start() { //IL_006c: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) laserRoot = ((Component)laserLine).transform.parent; ((Component)this).GetComponentInChildren(); for (int i = 0; i < ammoLampMaterials.Length; i++) { if (i >= currentAmmo.Value) { ammoLampMaterials[i].SetColor("_BaseColor", Color.red); ammoLampMaterials[i].SetColor("_EmissiveColor", Color.red); } else { ammoLampMaterials[i].SetColor("_BaseColor", Color.green); ammoLampMaterials[i].SetColor("_EmissiveColor", Color.green); } } ((GrabbableObject)this).Start(); } public override void Update() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).Update(); if (Time.frameCount % 30 != 0) { return; } for (int i = 0; i < ammoLampMaterials.Length; i++) { if (i >= currentAmmo.Value) { ammoLampMaterials[i].SetColor("_BaseColor", Color.red); ammoLampMaterials[i].SetColor("_EmissiveColor", Color.red); } else { ammoLampMaterials[i].SetColor("_BaseColor", Color.green); ammoLampMaterials[i].SetColor("_EmissiveColor", Color.green); } } } public override void OnDestroy() { ((NetworkBehaviour)this).OnDestroy(); } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemActivate(used, buttonDown); if (currentAmmo.Value > 0) { if (((NetworkBehaviour)this).IsHost) { NetworkVariable obj = currentAmmo; int value = obj.Value; obj.Value = value - 1; } PlayRandomAudio(mainAudio, activateClips); Animator.Play("fire"); particleSystem.Play(); for (int i = 0; i < ammoLampMaterials.Length; i++) { if (i >= currentAmmo.Value) { ammoLampMaterials[i].SetColor("_BaseColor", Color.red); ammoLampMaterials[i].SetColor("_EmissiveColor", Color.red); } else { ammoLampMaterials[i].SetColor("_BaseColor", Color.green); ammoLampMaterials[i].SetColor("_EmissiveColor", Color.green); } } if (((NetworkBehaviour)this).IsOwner) { if (((NetworkBehaviour)this).IsHost) { MissileSpawner(aimDirection.position, aimDirection.rotation); } else { SpawnMissileServerRpc(aimDirection.position, aimDirection.rotation); } } } else { PlayRandomAudio(mainAudio, noAmmoSounds); } } public override void ItemInteractLeftRight(bool right) { ((GrabbableObject)this).ItemInteractLeftRight(right); if (!right && ((NetworkBehaviour)this).IsOwner) { isLaserOn.Value = !isLaserOn.Value; } } [ServerRpc] private void SpawnMissileServerRpc(Vector3 aimPosition, Quaternion aimRotation) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Invalid comparison between Unknown and I4 //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1022332532u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref aimPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref aimRotation); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1022332532u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { MissileSpawner(aimPosition, aimRotation); } } private void MissileSpawner(Vector3 aimPosition, Quaternion aimRotation) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) Object.Instantiate(missilePrefab, aimPosition, aimRotation).GetComponent().SpawnWithOwnership(((NetworkBehaviour)this).OwnerClientId, false); } private void PlayRandomAudio(AudioSource audioSource, AudioClip[] audioClips) { if (audioClips.Length != 0) { audioSource.PlayOneShot(audioClips[Random.Range(0, audioClips.Length)]); } } public override void LateUpdate() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).LateUpdate(); RaycastHit val = default(RaycastHit); if (Physics.Raycast(laserRoot.position, aimDirection.forward, ref val, 10f, 605030721)) { ((Component)laserPointer).transform.position = ((RaycastHit)(ref val)).point; } else { Vector3 position = laserRoot.position + aimDirection.forward * 10f; ((Component)laserPointer).transform.position = position; } laserLine.SetPosition(0, laserRoot.position); laserLine.SetPosition(1, ((Component)laserPointer).transform.position); if (isLaserOn.Value) { ((Behaviour)laserPointer).enabled = true; ((Renderer)laserLine).enabled = true; } else { ((Behaviour)laserPointer).enabled = false; ((Renderer)laserLine).enabled = false; } } private void OnEnable() { } private void OnDisable() { } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { ((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = false; } } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { ((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = false; } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { previousPlayerHeldBy = ((GrabbableObject)this).playerHeldBy; ((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = true; } } protected override void __initializeVariables() { if (currentAmmo == null) { throw new Exception("RocketLauncher.currentAmmo cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)currentAmmo).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)currentAmmo, "currentAmmo"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)currentAmmo); if (isLaserOn == null) { throw new Exception("RocketLauncher.isLaserOn cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)isLaserOn).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)isLaserOn, "isLaserOn"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)isLaserOn); base.__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_RocketLauncher() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(1022332532u, new RpcReceiveHandler(__rpc_handler_1022332532)); } private static void __rpc_handler_1022332532(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { Vector3 aimPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref aimPosition); Quaternion aimRotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref aimRotation); target.__rpc_exec_stage = (__RpcExecStage)1; ((RocketLauncher)(object)target).SpawnMissileServerRpc(aimPosition, aimRotation); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "RocketLauncher"; } } public class RoombaAI : EnemyAI { private float angeredTimer; [Header("Behaviors")] public AISearchRoutine searchForPlayers; public bool investigating; public bool hasBegunInvestigating; public Vector3 investigatePosition; [Header("Landmine")] private bool mineActivated = true; public bool hasExploded; public AudioSource mineAudio; public AudioSource mineFarAudio; public AudioSource idleSound; public AudioClip mineDetonate; public AudioClip mineTrigger; public AudioClip mineDetonateFar; public AudioClip beepNoise; public AudioClip minePress; private bool sendingExplosionRPC; private RaycastHit hit; private RoundManager roundManager; private bool localPlayerOnMine; private MeshRenderer meshRenderer; public Rigidbody Rigidbody; private List lights = new List(); public float lightInterval = 1f; public float lightTimer; public float lightOnDuration = 0.1f; public override void Start() { ((EnemyAI)this).Start(); Transform val = ((Component)this).transform.Find("BoombaModel/Roomba/Cube"); meshRenderer = ((Component)val).GetComponent(); lights = ((Component)val.parent).GetComponentsInChildren().ToList(); } public override void DoAIInterval() { //IL_0021: 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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DoAIInterval(); if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } Vector3 velocity = Rigidbody.velocity; float magnitude = ((Vector3)(ref velocity)).magnitude; idleSound.pitch = Mathf.Lerp(0.8f, 1.2f, magnitude / 2f); if (((EnemyAI)this).TargetClosestPlayer(4f, true, 70f)) { ((EnemyAI)this).StopSearch(searchForPlayers, true); base.movingTowardsTargetPlayer = true; hasBegunInvestigating = false; investigating = false; } else if (investigating) { if (!hasBegunInvestigating) { hasBegunInvestigating = true; ((EnemyAI)this).StopSearch(base.currentSearch, false); ((EnemyAI)this).SetDestinationToPosition(investigatePosition, false); } if (Vector3.Distance(((Component)this).transform.position, investigatePosition) < 5f) { investigating = false; hasBegunInvestigating = false; } } else if (!searchForPlayers.inProgress) { base.movingTowardsTargetPlayer = false; ((EnemyAI)this).StartSearch(((Component)this).transform.position, searchForPlayers); } } private void FixedUpdate() { _ = base.ventAnimationFinished; } public IEnumerator disableLights(float timer) { yield return (object)new WaitForSeconds(timer); foreach (Light light in lights) { ((Behaviour)light).enabled = false; } } public override void Update() { //IL_00ea: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); if (lightTimer > 0f) { lightTimer -= Time.deltaTime; if (lightTimer <= 0f) { foreach (Light light in lights) { ((Behaviour)light).enabled = true; } ((MonoBehaviour)this).StartCoroutine(disableLights(lightOnDuration)); mineAudio.PlayOneShot(beepNoise); WalkieTalkie.TransmitOneShotAudio(mineAudio, beepNoise, 1f); } } else { lightTimer = lightInterval; } if (!base.ventAnimationFinished || !((Object)(object)base.creatureAnimator != (Object)null)) { return; } ((Behaviour)base.creatureAnimator).enabled = false; if (base.isEnemyDead || StartOfRound.Instance.allPlayersDead) { return; } _ = base.serverPosition; if (base.stunNormalizedTimer > 0f) { base.agent.speed = 0f; angeredTimer = 7f; } else if (angeredTimer > 0f) { angeredTimer -= Time.deltaTime; if (((NetworkBehaviour)this).IsOwner) { base.agent.stoppingDistance = 0.1f; base.agent.speed = 1f; } } else if (((NetworkBehaviour)this).IsOwner) { base.agent.stoppingDistance = 5f; base.agent.speed = 0.8f; } } private IEnumerator StartIdleAnimation() { roundManager = Object.FindObjectOfType(); if (!((Object)(object)roundManager == (Object)null)) { if (roundManager.BreakerBoxRandom != null) { yield return (object)new WaitForSeconds((float)roundManager.BreakerBoxRandom.NextDouble() + 0.5f); } mineAudio.pitch = Random.Range(0.9f, 1.1f); } } private void OnTriggerEnter(Collider other) { if (hasExploded) { return; } if (((Component)other).CompareTag("Player") || ((Component)((Component)other).transform.parent).CompareTag("Player")) { PlayerControllerB component = ((Component)other).gameObject.GetComponent(); if (!((Component)other).CompareTag("Player")) { component = ((Component)((Component)other).transform.parent).GetComponent(); } if (!((Object)(object)component != (Object)(object)GameNetworkManager.Instance.localPlayerController) && (Object)(object)component != (Object)null && !component.isPlayerDead) { localPlayerOnMine = true; PressMineServerRpc(); ((MonoBehaviour)this).StartCoroutine(TriggerMine(other)); } } else { if (!((Component)other).CompareTag("PlayerRagdoll")) { return; } if (Object.op_Implicit((Object)(object)((Component)other).GetComponent())) { if ((Object)(object)((Component)other).GetComponent().playerScript != (Object)(object)GameNetworkManager.Instance.localPlayerController) { return; } } else if (Object.op_Implicit((Object)(object)((Component)other).GetComponent()) && !((NetworkBehaviour)((Component)other).GetComponent()).NetworkObject.IsOwner) { return; } PressMineServerRpc(); ((MonoBehaviour)this).StartCoroutine(TriggerMine(other)); } } [ServerRpc(RequireOwnership = false)] public void PressMineServerRpc() { //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(3418551494u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3418551494u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { PressMineClientRpc(); } } } [ClientRpc] public void PressMineClientRpc() { //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(2561781742u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2561781742u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { mineAudio.PlayOneShot(minePress); WalkieTalkie.TransmitOneShotAudio(mineAudio, minePress, 1f); } } } public IEnumerator TriggerMine(Collider other) { yield return (object)new WaitForSeconds(0.5f); MineGoesBoom(other); } public void MineGoesBoom(Collider other) { if (hasExploded) { return; } if (((Component)other).CompareTag("Player") || ((Component)((Component)other).transform.parent).CompareTag("Player")) { PlayerControllerB component = ((Component)other).gameObject.GetComponent(); if (!((Component)other).CompareTag("Player")) { component = ((Component)((Component)other).transform.parent).GetComponent(); } if ((Object)(object)component != (Object)null && !component.isPlayerDead && !((Object)(object)component != (Object)(object)GameNetworkManager.Instance.localPlayerController)) { localPlayerOnMine = false; TriggerMineOnLocalClientByExiting(); } } else { if (!((Component)other).CompareTag("PlayerRagdoll")) { return; } if (Object.op_Implicit((Object)(object)((Component)other).GetComponent())) { if ((Object)(object)((Component)other).GetComponent().playerScript != (Object)(object)GameNetworkManager.Instance.localPlayerController) { return; } } else if (Object.op_Implicit((Object)(object)((Component)other).GetComponent()) && !((NetworkBehaviour)((Component)other).GetComponent()).NetworkObject.IsOwner) { return; } TriggerMineOnLocalClientByExiting(); } } private void TriggerMineOnLocalClientByExiting() { if (!hasExploded) { hasExploded = true; SetOffMineAnimation(); sendingExplosionRPC = true; ExplodeMineServerRpc(); } } [ServerRpc(RequireOwnership = false)] public void ExplodeMineServerRpc() { //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(2745793768u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2745793768u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { hasExploded = true; ExplodeMineClientRpc(); } } } [ClientRpc] public void ExplodeMineClientRpc() { //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) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2242285281u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2242285281u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { if (sendingExplosionRPC) { sendingExplosionRPC = false; } else { SetOffMineAnimation(); } } } public void SetOffMineAnimation() { hasExploded = true; mineAudio.PlayOneShot(mineTrigger, 1f); ((MonoBehaviour)this).StartCoroutine(detonateMineDelayed()); } private IEnumerator detonateMineDelayed() { yield return (object)new WaitForSeconds(0.5f); Detonate(); Object.Destroy((Object)(object)((Component)this).gameObject); } public void Detonate() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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) mineAudio.pitch = Random.Range(0.93f, 1.07f); mineAudio.PlayOneShot(mineDetonate, 1f); Utilities.CreateExplosion(((Component)this).transform.position + Vector3.up, spawnExplosionEffect: true, 100, 5.7f, 6.4f, 6, (CauseOfDeath)3); } public bool MineHasLineOfSight(Vector3 pos) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) return !Physics.Linecast(((Component)this).transform.position, pos, ref hit, 256); } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false) { ((EnemyAI)this).HitEnemy(force, playerWhoHit, false); angeredTimer = 18f; SetOffMineAnimation(); sendingExplosionRPC = true; ExplodeMineServerRpc(); } public override void DetectNoise(Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot = 0, int noiseID = 0) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DetectNoise(noisePosition, noiseLoudness, timesPlayedInOneSpot, noiseID); if (!(Vector3.Distance(noisePosition, ((Component)this).transform.position) > 15f) && !base.movingTowardsTargetPlayer) { investigatePosition = noisePosition; } } public void InvestigatePosition(Vector3 position) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (!hasBegunInvestigating) { investigatePosition = position; investigating = true; } } protected override void __initializeVariables() { ((EnemyAI)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_RoombaAI() { //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 //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(3418551494u, new RpcReceiveHandler(__rpc_handler_3418551494)); NetworkManager.__rpc_func_table.Add(2561781742u, new RpcReceiveHandler(__rpc_handler_2561781742)); NetworkManager.__rpc_func_table.Add(2745793768u, new RpcReceiveHandler(__rpc_handler_2745793768)); NetworkManager.__rpc_func_table.Add(2242285281u, new RpcReceiveHandler(__rpc_handler_2242285281)); } private static void __rpc_handler_3418551494(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; ((RoombaAI)(object)target).PressMineServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2561781742(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; ((RoombaAI)(object)target).PressMineClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2745793768(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; ((RoombaAI)(object)target).ExplodeMineServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2242285281(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; ((RoombaAI)(object)target).ExplodeMineClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "RoombaAI"; } } internal class ToyHammer : GrabbableObject { public int hammerHitForce = 1; public float hammerHitPercentage = 1f; public bool reelingUp; public bool isHoldingButton; private RaycastHit rayHit; private Coroutine reelingUpCoroutine; private RaycastHit[] objectsHitByHammer; private List objectsHitByHammerList = new List(); public AudioClip reelUp; public AudioClip swing; public AudioClip[] hitSFX; public AudioSource hammerAudio; private PlayerControllerB previousPlayerHeldBy; private int hammerMask = 11012424; public override void ItemActivate(bool used, bool buttonDown = true) { if ((Object)(object)base.playerHeldBy == (Object)null) { return; } isHoldingButton = buttonDown; if (!reelingUp && buttonDown) { reelingUp = true; previousPlayerHeldBy = base.playerHeldBy; if (reelingUpCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(reelingUpCoroutine); } reelingUpCoroutine = ((MonoBehaviour)this).StartCoroutine(reelUpHammer()); } } private IEnumerator reelUpHammer() { base.playerHeldBy.activatingItem = true; base.playerHeldBy.twoHanded = true; base.playerHeldBy.playerBodyAnimator.ResetTrigger("hammerHit"); base.playerHeldBy.playerBodyAnimator.SetBool("reelingUp", true); hammerAudio.PlayOneShot(reelUp); ReelUpSFXServerRpc(); yield return (object)new WaitForSeconds(0.35f); yield return (object)new WaitUntil((Func)(() => !isHoldingButton || !base.isHeld)); SwingHammer(!base.isHeld); yield return (object)new WaitForSeconds(0.13f); HitHammer(!base.isHeld); yield return (object)new WaitForSeconds(0.3f); reelingUp = false; reelingUpCoroutine = null; } [ServerRpc] public void ReelUpSFXServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Invalid comparison between Unknown and I4 //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3129286724u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3129286724u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ReelUpSFXClientRpc(); } } [ClientRpc] public void ReelUpSFXClientRpc() { //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(4160876605u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4160876605u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { hammerAudio.PlayOneShot(reelUp); } } } public override void DiscardItem() { base.playerHeldBy.activatingItem = false; ((GrabbableObject)this).DiscardItem(); } public void SwingHammer(bool cancel = false) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) previousPlayerHeldBy.playerBodyAnimator.SetBool("reelingUp", false); if (!cancel) { hammerAudio.PlayOneShot(swing); previousPlayerHeldBy.UpdateSpecialAnimationValue(true, (short)((Component)previousPlayerHeldBy).transform.localEulerAngles.y, 0.4f, false); } } public void HitHammer(bool cancel = false) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)previousPlayerHeldBy == (Object)null) { return; } previousPlayerHeldBy.activatingItem = false; bool flag = false; if (!cancel) { previousPlayerHeldBy.twoHanded = false; Debug.DrawRay(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * -0.35f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward * 1.85f, Color.blue, 5f); objectsHitByHammer = Physics.SphereCastAll(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * -0.35f, 0.75f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward, 1.85f, hammerMask, (QueryTriggerInteraction)2); objectsHitByHammerList = objectsHitByHammer.OrderBy((RaycastHit x) => ((RaycastHit)(ref x)).distance).ToList(); Vector3 val = ((Component)previousPlayerHeldBy.gameplayCamera).transform.position; IHittable val3 = default(IHittable); RaycastHit val5 = default(RaycastHit); for (int i = 0; i < objectsHitByHammerList.Count; i++) { RaycastHit val2 = objectsHitByHammerList[i]; if (((Component)((RaycastHit)(ref val2)).transform).gameObject.layer != 8) { val2 = objectsHitByHammerList[i]; if (((Component)((RaycastHit)(ref val2)).transform).gameObject.layer != 11) { val2 = objectsHitByHammerList[i]; if (!((Component)((RaycastHit)(ref val2)).transform).TryGetComponent(ref val3)) { continue; } val2 = objectsHitByHammerList[i]; if ((Object)(object)((RaycastHit)(ref val2)).transform == (Object)(object)((Component)previousPlayerHeldBy).transform) { continue; } val2 = objectsHitByHammerList[i]; if (!(((RaycastHit)(ref val2)).point == Vector3.zero)) { Vector3 val4 = val; val2 = objectsHitByHammerList[i]; if (Physics.Linecast(val4, ((RaycastHit)(ref val2)).point, ref val5, StartOfRound.Instance.collidersAndRoomMaskAndDefault)) { continue; } } flag = true; Vector3 forward = ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward; if (Random.Range(0f, 100f) < hammerHitPercentage) { val3.Hit(hammerHitForce, forward, previousPlayerHeldBy, true); } continue; } } val2 = objectsHitByHammerList[i]; Vector3 point = ((RaycastHit)(ref val2)).point; val2 = objectsHitByHammerList[i]; val = point + ((RaycastHit)(ref val2)).normal * 0.01f; flag = true; val2 = objectsHitByHammerList[i]; string tag = ((Component)((RaycastHit)(ref val2)).collider).gameObject.tag; for (int j = 0; j < StartOfRound.Instance.footstepSurfaces.Length; j++) { if (StartOfRound.Instance.footstepSurfaces[j].surfaceTag == tag) { hammerAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[j].hitSurfaceSFX); WalkieTalkie.TransmitOneShotAudio(hammerAudio, StartOfRound.Instance.footstepSurfaces[j].hitSurfaceSFX, 1f); break; } } } } if (flag) { int soundID = RoundManager.PlayRandomClip(hammerAudio, hitSFX, true, 1f, 0); Object.FindObjectOfType().PlayAudibleNoise(((Component)this).transform.position, 17f, 0.8f, 0, false, 0); base.playerHeldBy.playerBodyAnimator.SetTrigger("hammerHit"); HitHammerServerRpc(soundID); } } [ServerRpc] public void HitHammerServerRpc(int soundID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Invalid comparison between Unknown and I4 //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { if (((NetworkBehaviour)this).OwnerClientId != networkManager.LocalClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } return; } ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(720092577u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, soundID); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 720092577u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { HitHammerClientRpc(soundID); } } [ClientRpc] public void HitHammerClientRpc(int soundID) { //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_0071: 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) 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(3017059477u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, soundID); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3017059477u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { HitSurfaceWithHammer(soundID); } } } private void HitSurfaceWithHammer(int soundID) { if (!((NetworkBehaviour)this).IsOwner) { hammerAudio.PlayOneShot(hitSFX[soundID]); } WalkieTalkie.TransmitOneShotAudio(hammerAudio, hitSFX[soundID], 1f); } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_ToyHammer() { //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 //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(3129286724u, new RpcReceiveHandler(__rpc_handler_3129286724)); NetworkManager.__rpc_func_table.Add(4160876605u, new RpcReceiveHandler(__rpc_handler_4160876605)); NetworkManager.__rpc_func_table.Add(720092577u, new RpcReceiveHandler(__rpc_handler_720092577)); NetworkManager.__rpc_func_table.Add(3017059477u, new RpcReceiveHandler(__rpc_handler_3017059477)); } private static void __rpc_handler_3129286724(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { target.__rpc_exec_stage = (__RpcExecStage)1; ((ToyHammer)(object)target).ReelUpSFXServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4160876605(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; ((ToyHammer)(object)target).ReelUpSFXClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_720092577(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_0070: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 NetworkManager networkManager = target.NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if (rpcParams.Server.Receive.SenderClientId != target.OwnerClientId) { if ((int)networkManager.LogLevel <= 1) { Debug.LogError((object)"Only the owner can invoke a ServerRpc that requires ownership!"); } } else { int soundID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref soundID); target.__rpc_exec_stage = (__RpcExecStage)1; ((ToyHammer)(object)target).HitHammerServerRpc(soundID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3017059477(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int soundID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref soundID); target.__rpc_exec_stage = (__RpcExecStage)2; ((ToyHammer)(object)target).HitHammerClientRpc(soundID); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "ToyHammer"; } } [BepInPlugin("evaisa.lethalthings", "LethalThings", "0.8.8")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public const string ModGUID = "evaisa.lethalthings"; public const string ModName = "LethalThings"; public const string ModVersion = "0.8.8"; public static ManualLogSource logger; public static ConfigFile config; public static bool devMode; private void Awake() { logger = ((BaseUnityPlugin)this).Logger; config = ((BaseUnityPlugin)this).Config; Version version = Chainloader.PluginInfos["evaisa.lethallib"].Metadata.Version; if (version.Major > 0 || version.Minor > 6) { logger.LogInfo((object)("LethalLib version is " + version.ToString() + ", which is compatible with LethalThings 0.8.0+")); if (Chainloader.PluginInfos.ContainsKey("com.rune580.LethalCompanyInputUtils")) { Version version2 = Chainloader.PluginInfos["com.rune580.LethalCompanyInputUtils"].Metadata.Version; if (version2.Major <= 0 && (version2.Minor != 4 || version2.Build < 3) && version2.Minor <= 4) { logger.LogError((object)("[Optional dependency] LethalCompanyInputUtils version is " + version2.ToString() + ", which is not compatible with LethalThings 0.8.0+")); logger.LogError((object)"Please update LethalCompanyInputUtils to version 0.4.3 or newer"); return; } logger.LogInfo((object)("[Optional dependency] LethalCompanyInputUtils version is " + version2.ToString() + ", which is compatible with LethalThings 0.8.0+")); } if (Chainloader.PluginInfos.ContainsKey("FlipMods.ReservedItemSlotCore")) { Version version3 = Chainloader.PluginInfos["FlipMods.ReservedItemSlotCore"].Metadata.Version; if (version3.Major <= 1 && (version3.Major <= 0 || ((version3.Minor != 6 || version3.Build < 6) && version3.Minor <= 6))) { logger.LogError((object)("[Compatibility] ReservedItemSlotCore version is " + version3.ToString() + ", which is not compatible with LethalThings 0.8.0+")); logger.LogError((object)"Please update ReservedItemSlotCore to version 1.6.6 or newer"); return; } logger.LogInfo((object)("[Compatibility] ReservedItemSlotCore version is " + version3.ToString() + ", which is compatible with LethalThings 0.8.0+")); } Utilities.Init(); Config.Load(); Content.Load(); LethalThings.Patches.Patches.Load(); if (InputCompat.Enabled) { InputCompat.Init(); } ((BaseUnityPlugin)this).Logger.LogInfo((object)"LethalThings loaded successfully!!!"); } else { logger.LogError((object)("LethalLib version is " + version.ToString() + ", which is not compatible with LethalThings 0.8.0+")); logger.LogError((object)"Please update LethalLib to version 0.7.1 or newer"); } } } public class Utilities { private static Dictionary _masksByLayer; public static void Init() { GenerateLayerMap(); } public static void GenerateLayerMap() { _masksByLayer = new Dictionary(); for (int i = 0; i < 32; i++) { int num = 0; for (int j = 0; j < 32; j++) { if (!Physics.GetIgnoreLayerCollision(i, j)) { num |= 1 << j; } } _masksByLayer.Add(i, num); } } public static int MaskForLayer(int layer) { return _masksByLayer[layer]; } public static void LoadPrefab(string name, Vector3 position) { //IL_002d: 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) if (Content.Prefabs.ContainsKey(name)) { Plugin.logger.LogInfo((object)("Loading prefab " + name)); Object.Instantiate(Content.Prefabs[name], position, Quaternion.identity).GetComponent().Spawn(false); } else { Plugin.logger.LogWarning((object)("Prefab " + name + " not found!")); } } public static void TeleportPlayer(int playerObj, Vector3 teleportPos) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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) PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerObj]; if (Object.op_Implicit((Object)(object)Object.FindObjectOfType())) { Object.FindObjectOfType().audioPresets[2].ChangeAudioReverbForPlayer(val); } val.isInElevator = false; val.isInHangarShipRoom = false; val.isInsideFactory = true; val.averageVelocity = 0f; val.velocityLastFrame = Vector3.zero; StartOfRound.Instance.allPlayerScripts[playerObj].TeleportPlayer(teleportPos, false, 0f, false, true); StartOfRound.Instance.allPlayerScripts[playerObj].beamOutParticle.Play(); if ((Object)(object)val == (Object)(object)GameNetworkManager.Instance.localPlayerController) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } } public static IEnumerator TeleportPlayerBody(int playerObj, Vector3 teleportPosition) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) float startTime = Time.realtimeSinceStartup; yield return (object)new WaitUntil((Func)(() => (Object)(object)StartOfRound.Instance.allPlayerScripts[playerObj].deadBody != (Object)null || Time.realtimeSinceStartup - startTime > 2f)); if (StartOfRound.Instance.inShipPhase || SceneManager.sceneCount <= 1) { yield break; } DeadBodyInfo deadBody = StartOfRound.Instance.allPlayerScripts[playerObj].deadBody; if ((Object)(object)deadBody != (Object)null) { deadBody.attachedTo = null; deadBody.attachedLimb = null; deadBody.secondaryAttachedLimb = null; deadBody.secondaryAttachedTo = null; if ((Object)(object)deadBody.grabBodyObject != (Object)null && deadBody.grabBodyObject.isHeld && (Object)(object)deadBody.grabBodyObject.playerHeldBy != (Object)null) { deadBody.grabBodyObject.playerHeldBy.DropAllHeldItems(true, false); } deadBody.isInShip = false; deadBody.parentedToShip = false; ((Component)deadBody).transform.SetParent((Transform)null, true); deadBody.SetRagdollPositionSafely(teleportPosition, true); } } public static void TeleportEnemy(EnemyAI enemy, Vector3 teleportPos) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) enemy.serverPosition = teleportPos; ((Component)enemy).transform.position = teleportPos; enemy.agent.Warp(teleportPos); enemy.SyncPositionToClients(); } public static void CreateExplosion(Vector3 explosionPosition, bool spawnExplosionEffect = false, int damage = 20, float minDamageRange = 0f, float maxDamageRange = 1f, int enemyHitForce = 6, CauseOfDeath causeOfDeath = 3, PlayerControllerB attacker = null) { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018a: 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_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)"Spawning explosion at pos: {explosionPosition}"); Transform val = null; if ((Object)(object)RoundManager.Instance != (Object)null && (Object)(object)RoundManager.Instance.mapPropsContainer != (Object)null && (Object)(object)RoundManager.Instance.mapPropsContainer.transform != (Object)null) { val = RoundManager.Instance.mapPropsContainer.transform; } if (spawnExplosionEffect) { Object.Instantiate(StartOfRound.Instance.explosionPrefab, explosionPosition, Quaternion.Euler(-90f, 0f, 0f), val).SetActive(true); } float num = Vector3.Distance(((Component)GameNetworkManager.Instance.localPlayerController).transform.position, explosionPosition); if (num < 14f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } else if (num < 25f) { HUDManager.Instance.ShakeCamera((ScreenShakeType)0); } Collider[] array = Physics.OverlapSphere(explosionPosition, maxDamageRange, 2621448, (QueryTriggerInteraction)2); PlayerControllerB val2 = null; for (int i = 0; i < array.Length; i++) { float num2 = Vector3.Distance(explosionPosition, ((Component)array[i]).transform.position); if (num2 > 4f && Physics.Linecast(explosionPosition, ((Component)array[i]).transform.position + Vector3.up * 0.3f, 256, (QueryTriggerInteraction)1)) { continue; } if (((Component)array[i]).gameObject.layer == 3) { val2 = ((Component)array[i]).gameObject.GetComponent(); if ((Object)(object)val2 != (Object)null && ((NetworkBehaviour)val2).IsOwner) { float num3 = 1f - Mathf.Clamp01((num2 - minDamageRange) / (maxDamageRange - minDamageRange)); val2.DamagePlayer((int)((float)damage * num3), true, true, causeOfDeath, 0, false, default(Vector3)); } } else if (((Component)array[i]).gameObject.layer == 21) { Landmine componentInChildren = ((Component)array[i]).gameObject.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && !componentInChildren.hasExploded && num2 < 6f) { Debug.Log((object)"Setting off other mine"); ((MonoBehaviour)componentInChildren).StartCoroutine(componentInChildren.TriggerOtherMineDelayed(componentInChildren)); } } else if (((Component)array[i]).gameObject.layer == 19) { EnemyAICollisionDetect componentInChildren2 = ((Component)array[i]).gameObject.GetComponentInChildren(); if ((Object)(object)componentInChildren2 != (Object)null && ((NetworkBehaviour)componentInChildren2.mainScript).IsOwner && num2 < 4.5f) { componentInChildren2.mainScript.HitEnemyOnLocalClient(enemyHitForce, default(Vector3), attacker, false); } } } int num4 = ~LayerMask.GetMask(new string[1] { "Room" }); num4 = ~LayerMask.GetMask(new string[1] { "Colliders" }); array = Physics.OverlapSphere(explosionPosition, 10f, num4); for (int j = 0; j < array.Length; j++) { Rigidbody component = ((Component)array[j]).GetComponent(); if ((Object)(object)component != (Object)null) { component.AddExplosionForce(70f, explosionPosition, 10f); } } } } } namespace LethalThings.Patches { public class Debug { [CompilerGenerated] private static class <>O { public static hook_Update <0>__StartOfRound_Update; public static hook_Start <1>__StartOfRound_Start; } private static List currentCheatCode = new List(); private static List devModeCode = new List { (Key)63, (Key)63, (Key)64, (Key)64, (Key)61, (Key)62, (Key)61, (Key)62, (Key)16, (Key)15, (Key)2 }; public static void Load() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0030: 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_003b: Expected O, but got Unknown object obj = <>O.<0>__StartOfRound_Update; if (obj == null) { hook_Update val = StartOfRound_Update; <>O.<0>__StartOfRound_Update = val; obj = (object)val; } StartOfRound.Update += (hook_Update)obj; object obj2 = <>O.<1>__StartOfRound_Start; if (obj2 == null) { hook_Start val2 = StartOfRound_Start; <>O.<1>__StartOfRound_Start = val2; obj2 = (object)val2; } StartOfRound.Start += (hook_Start)obj2; } private static void ShipBuildModeManager_Update(orig_Update orig, ShipBuildModeManager self) { //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_042f: Unknown result type (might be due to invalid IL or missing references) //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_043d: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_03e8: Unknown result type (might be due to invalid IL or missing references) //IL_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_046c: Unknown result type (might be due to invalid IL or missing references) //IL_0477: Unknown result type (might be due to invalid IL or missing references) //IL_0481: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_049b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)GameNetworkManager.Instance == (Object)null || (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null) { return; } self.player = GameNetworkManager.Instance.localPlayerController; if (!self.PlayerMeetsConditionsToBuild(false)) { self.CancelBuildMode(true); } if ((Object)(object)self.placingObject == (Object)null) { self.CancelBuildMode(true); } if (self.InBuildMode) { if ((Object)(object)self.currentCollider == (Object)null) { ref BoxCollider currentCollider = ref self.currentCollider; Collider placeObjectCollider = self.placingObject.placeObjectCollider; currentCollider = (BoxCollider)(object)((placeObjectCollider is BoxCollider) ? placeObjectCollider : null); } if (IngamePlayerSettings.Instance.playerInput.actions.FindAction("ReloadBatteries", false).IsPressed()) { goto IL_00cb; } if (StartOfRound.Instance.localPlayerUsingController) { MovementActions movement = self.playerActions.Movement; if (((MovementActions)(ref movement)).InspectItem.IsPressed()) { goto IL_00cb; } } goto IL_0117; } self.timeSincePlacingObject += Time.deltaTime; return; IL_0117: self.playerCameraRay = new Ray(((Component)self.player.gameplayCamera).transform.position, ((Component)self.player.gameplayCamera).transform.forward); if (Physics.Raycast(self.playerCameraRay, ref self.rayHit, 4f, self.placementMask, (QueryTriggerInteraction)1)) { if (Vector3.Angle(((RaycastHit)(ref self.rayHit)).normal, Vector3.up) < 45f) { self.ghostObject.position = ((RaycastHit)(ref self.rayHit)).point + Vector3.up * self.placingObject.yOffset; } else if (self.placingObject.AllowPlacementOnWalls) { self.ghostObject.position = self.OffsetObjectFromWallBasedOnDimensions(((RaycastHit)(ref self.rayHit)).point, self.rayHit); if (Physics.Raycast(self.ghostObject.position, Vector3.down, ref self.rayHit, self.placingObject.yOffset, self.placementMask, (QueryTriggerInteraction)1)) { Transform ghostObject = self.ghostObject; ghostObject.position += Vector3.up * ((RaycastHit)(ref self.rayHit)).distance; } } else if (Physics.Raycast(self.OffsetObjectFromWallBasedOnDimensions(((RaycastHit)(ref self.rayHit)).point, self.rayHit), Vector3.down, ref self.rayHit, 20f, self.placementMask, (QueryTriggerInteraction)1)) { self.ghostObject.position = ((RaycastHit)(ref self.rayHit)).point + Vector3.up * self.placingObject.yOffset; } } else if (Physics.Raycast(((Ray)(ref self.playerCameraRay)).GetPoint(4f), Vector3.down, ref self.rayHit, 20f, self.placementMask, (QueryTriggerInteraction)1)) { self.ghostObject.position = ((RaycastHit)(ref self.rayHit)).point + Vector3.up * self.placingObject.yOffset; } bool flag = Physics.CheckBox(self.ghostObject.position, self.currentCollider.size * 0.5f * 0.57f, Quaternion.Euler(self.ghostObject.eulerAngles), self.placementMaskAndBlockers, (QueryTriggerInteraction)1); if (!flag && self.placingObject.doCollisionPointCheck) { Vector3 val = self.ghostObject.position + self.ghostObject.forward * self.placingObject.collisionPointCheck.z + self.ghostObject.right * self.placingObject.collisionPointCheck.x + self.ghostObject.up * self.placingObject.collisionPointCheck.y; Debug.DrawRay(val, Vector3.up * 2f, Color.blue); if (Physics.CheckSphere(val, 1f, self.placementMaskAndBlockers, (QueryTriggerInteraction)1)) { flag = true; } } int canConfirmPosition; if (!flag) { Bounds bounds = StartOfRound.Instance.shipInnerRoomBounds.bounds; canConfirmPosition = (((Bounds)(ref bounds)).Contains(self.ghostObject.position) ? 1 : 0); } else { canConfirmPosition = 0; } self.CanConfirmPosition = (byte)canConfirmPosition != 0; if (flag) { ((Renderer)self.ghostObjectRenderer).sharedMaterial = self.ghostObjectRed; Collider[] array = Physics.OverlapBox(self.ghostObject.position, self.currentCollider.size * 0.5f * 0.57f, Quaternion.Euler(self.ghostObject.eulerAngles), self.placementMaskAndBlockers, (QueryTriggerInteraction)1); foreach (Collider val2 in array) { Debug.Log((object)("Collider: " + ((Object)((Component)val2).gameObject).name)); } } else { ((Renderer)self.ghostObjectRenderer).sharedMaterial = self.ghostObjectGreen; } return; IL_00cb: self.ghostObject.eulerAngles = new Vector3(self.ghostObject.eulerAngles.x, self.ghostObject.eulerAngles.y + Time.deltaTime * 155f, self.ghostObject.eulerAngles.z); goto IL_0117; } private static void StartOfRound_Start(orig_Start orig, StartOfRound self) { orig.Invoke(self); if (Plugin.devMode && (Object)(object)DevMenu.Instance == (Object)null) { Object.Instantiate(Content.devMenuPrefab).GetComponent().Spawn(false); } } private static void RoundManager_Update(orig_Update orig, RoundManager self) { orig.Invoke(self); } private static void StartOfRound_Update(orig_Update orig, StartOfRound self) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)self).IsHost && (Object)(object)DevMenu.Instance == (Object)null) { Enumerator enumerator = Keyboard.current.allKeys.GetEnumerator(); try { while (enumerator.MoveNext()) { KeyControl current = enumerator.Current; if (((ButtonControl)current).wasReleasedThisFrame) { currentCheatCode.Add(current.keyCode); } } } finally { ((IDisposable)enumerator).Dispose(); } for (int i = 0; i < currentCheatCode.Count; i++) { if (currentCheatCode[i] != devModeCode[i]) { currentCheatCode.Clear(); break; } } if (currentCheatCode.Count == devModeCode.Count) { currentCheatCode.Clear(); Plugin.logger.LogMessage((object)"Dev mode enabled, press F1 to open dev menu."); Object.Instantiate(Content.devMenuPrefab).GetComponent().Spawn(false); } } orig.Invoke(self); } } public class Miscellaneous { [CompilerGenerated] private static class <>O { public static hook_SetSpecialGrabAnimationBool <0>__PlayerControllerB_SetSpecialGrabAnimationBool; public static hook_Start <1>__StartOfRound_Start; } public static void Load() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0130: 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_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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_0047: Expected O, but got Unknown object obj = <>O.<0>__PlayerControllerB_SetSpecialGrabAnimationBool; if (obj == null) { hook_SetSpecialGrabAnimationBool val = PlayerControllerB_SetSpecialGrabAnimationBool; <>O.<0>__PlayerControllerB_SetSpecialGrabAnimationBool = val; obj = (object)val; } PlayerControllerB.SetSpecialGrabAnimationBool += (hook_SetSpecialGrabAnimationBool)obj; if (Config.disableOverlappingModContent.Value) { object obj2 = <>O.<1>__StartOfRound_Start; if (obj2 == null) { hook_Start val2 = StartOfRound_Start; <>O.<1>__StartOfRound_Start = val2; obj2 = (object)val2; } StartOfRound.Start += (hook_Start)obj2; } new Hook((MethodBase)typeof(Object).GetMethod("Instantiate", new Type[3] { typeof(Object), typeof(Transform), typeof(bool) }), typeof(Miscellaneous).GetMethod("InstantiateOPI")); new Hook((MethodBase)typeof(Object).GetMethod("Instantiate", new Type[2] { typeof(Object), typeof(Transform) }), typeof(Miscellaneous).GetMethod("InstantiateOP")); new Hook((MethodBase)typeof(Object).GetMethod("Instantiate", new Type[1] { typeof(Object) }), typeof(Miscellaneous).GetMethod("InstantiateO")); new Hook((MethodBase)typeof(Object).GetMethod("Instantiate", new Type[3] { typeof(Object), typeof(Vector3), typeof(Quaternion) }), typeof(Miscellaneous).GetMethod("InstantiateOPR")); new Hook((MethodBase)typeof(Object).GetMethod("Instantiate", new Type[4] { typeof(Object), typeof(Vector3), typeof(Quaternion), typeof(Transform) }), typeof(Miscellaneous).GetMethod("InstantiateOPRP")); } public static Object InstantiateOPI(Func orig, Object original, Transform parent, bool instantiateInWorldSpace) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown Object val = orig(original, parent, instantiateInWorldSpace); if (val != (Object)null && val is GameObject) { GameObject val2 = (GameObject)val; Collider[] componentsInChildren = val2.GetComponentsInChildren(); foreach (Collider val3 in componentsInChildren) { if (!((Object)(object)((Component)val3).gameObject.GetComponent() != (Object)null)) { ((Component)val3).gameObject.AddComponent().root = val2.transform; } } } return val; } public static Object InstantiateOP(Func orig, Object original, Transform parent) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown Object val = orig(original, parent); if (val != (Object)null && val is GameObject) { GameObject val2 = (GameObject)val; Collider[] componentsInChildren = val2.GetComponentsInChildren(); foreach (Collider val3 in componentsInChildren) { if (!((Object)(object)((Component)val3).gameObject.GetComponent() != (Object)null)) { ((Component)val3).gameObject.AddComponent().root = val2.transform; } } } return val; } public static Object InstantiateO(Func orig, Object original) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown Object val = orig(original); if (val != (Object)null && val is GameObject) { GameObject val2 = (GameObject)val; Collider[] componentsInChildren = val2.GetComponentsInChildren(); foreach (Collider val3 in componentsInChildren) { if (!((Object)(object)((Component)val3).gameObject.GetComponent() != (Object)null)) { ((Component)val3).gameObject.AddComponent().root = val2.transform; } } } return val; } public static Object InstantiateOPR(Func orig, Object original, Vector3 position, Quaternion rotation) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown Object val = orig(original, position, rotation); if (val != (Object)null && val is GameObject) { GameObject val2 = (GameObject)val; Collider[] componentsInChildren = val2.GetComponentsInChildren(); foreach (Collider val3 in componentsInChildren) { if (!((Object)(object)((Component)val3).gameObject.GetComponent() != (Object)null)) { ((Component)val3).gameObject.AddComponent().root = val2.transform; } } } return val; } public static Object InstantiateOPRP(Func orig, Object original, Vector3 position, Quaternion rotation, Transform parent) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown Object val = orig(original, position, rotation, parent); if (val != (Object)null && val is GameObject) { GameObject val2 = (GameObject)val; Collider[] componentsInChildren = val2.GetComponentsInChildren(); foreach (Collider val3 in componentsInChildren) { if (!((Object)(object)((Component)val3).gameObject.GetComponent() != (Object)null)) { ((Component)val3).gameObject.AddComponent().root = val2.transform; } } } return val; } private static void StartOfRound_Start(orig_Start orig, StartOfRound self) { orig.Invoke(self); SelectableLevel[] levels = self.levels; for (int i = 0; i < levels.Length; i++) { levels[i].spawnableScrap.RemoveAll((SpawnableItemWithRarity scrap) => ((Object)scrap.spawnableItem).name == "dingus"); } self.allItemsList.itemsList.RemoveAll((Item item) => ((Object)item).name == "dingus"); } private static void PlayerControllerB_SetSpecialGrabAnimationBool(orig_SetSpecialGrabAnimationBool orig, PlayerControllerB self, bool setTrue, GrabbableObject currentItem) { if ((Object)(object)currentItem == (Object)null) { currentItem = self.currentlyGrabbingObject; } if (!((Object)(object)currentItem != (Object)null) || !(currentItem.itemProperties.grabAnim == "none")) { orig.Invoke(self, setTrue, currentItem); } } } public class Patches { public static void Load() { SaveData.Init(); PowerOutletStun.Load(); Miscellaneous.Load(); PouchyBelt.Initialize(); HandheldRadar.Load(); HackingTool.Load(); FlareController.Init(); DecalRandomizer.Init(); Dart.Init(); FatalitiesSign.Init(); GremlinEnergy.Init(); Arson.Init(); Debug.Load(); } } public class PowerOutletStun { [CompilerGenerated] private static class <>O { public static hook_ChargeItem <0>__ItemCharger_ChargeItem; public static hook_Update <1>__ItemCharger_Update; public static hook_Start <2>__GameNetworkManager_Start; } public static void Load() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_003c: 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_0047: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown if (Config.enableItemChargerElectrocution.Value) { object obj = <>O.<0>__ItemCharger_ChargeItem; if (obj == null) { hook_ChargeItem val = ItemCharger_ChargeItem; <>O.<0>__ItemCharger_ChargeItem = val; obj = (object)val; } ItemCharger.ChargeItem += (hook_ChargeItem)obj; object obj2 = <>O.<1>__ItemCharger_Update; if (obj2 == null) { hook_Update val2 = ItemCharger_Update; <>O.<1>__ItemCharger_Update = val2; obj2 = (object)val2; } ItemCharger.Update += (hook_Update)obj2; object obj3 = <>O.<2>__GameNetworkManager_Start; if (obj3 == null) { hook_Start val3 = GameNetworkManager_Start; <>O.<2>__GameNetworkManager_Start = val3; obj3 = (object)val3; } GameNetworkManager.Start += (hook_Start)obj3; } } private static void GameNetworkManager_Start(orig_Start orig, GameNetworkManager self) { orig.Invoke(self); foreach (NetworkPrefab prefab in ((Component)self).GetComponent().NetworkConfig.Prefabs.m_Prefabs) { if ((Object)(object)prefab.Prefab.GetComponent() != (Object)null && prefab.Prefab.GetComponent().itemProperties.isConductiveMetal) { prefab.Prefab.AddComponent(); } } } private static void ItemCharger_Update(orig_Update orig, ItemCharger self) { orig.Invoke(self); if (self.updateInterval == 0f && (Object)(object)GameNetworkManager.Instance != (Object)null && (Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null) { self.triggerScript.interactable = (Object)(object)GameNetworkManager.Instance.localPlayerController.currentlyHeldObjectServer != (Object)null && (GameNetworkManager.Instance.localPlayerController.currentlyHeldObjectServer.itemProperties.requiresBattery || GameNetworkManager.Instance.localPlayerController.currentlyHeldObjectServer.itemProperties.isConductiveMetal); } } private static void ItemCharger_ChargeItem(orig_ChargeItem orig, ItemCharger self) { GrabbableObject currentlyHeldObjectServer = GameNetworkManager.Instance.localPlayerController.currentlyHeldObjectServer; if ((Object)(object)currentlyHeldObjectServer == (Object)null) { return; } if (!currentlyHeldObjectServer.itemProperties.requiresBattery) { if (currentlyHeldObjectServer.itemProperties.isConductiveMetal) { ((Component)currentlyHeldObjectServer).GetComponent().Electrocute(self); } } else { orig.Invoke(self); } } } } namespace LethalThings.MonoBehaviours { public class Arson : GrabbableObject { [CompilerGenerated] private static class <>O { public static hook_CheckBoundsForPlayers <0>__ShowerTrigger_CheckBoundsForPlayers; } public AudioSource noiseAudio; public AudioSource noiseAudioFar; [Space(3f)] public AudioClip[] noiseSFX; public AudioClip[] noiseSFXFar; [Space(3f)] public float noiseRange; public float maxLoudness; public float minLoudness; public float minPitch; public float maxPitch; private Random noisemakerRandom; public Animator triggerAnimator; public bool isCleanable; public Item cleanArson; public bool arsonBeingShowered; public float showerTime; public float totalShowerTime = 5f; public static List allArsonList = new List(); public bool canBeShowered; public ShowerTrigger currentShower; public static void Init() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown object obj = <>O.<0>__ShowerTrigger_CheckBoundsForPlayers; if (obj == null) { hook_CheckBoundsForPlayers val = ShowerTrigger_CheckBoundsForPlayers; <>O.<0>__ShowerTrigger_CheckBoundsForPlayers = val; obj = (object)val; } ShowerTrigger.CheckBoundsForPlayers += (hook_CheckBoundsForPlayers)obj; } private static void ShowerTrigger_CheckBoundsForPlayers(orig_CheckBoundsForPlayers orig, ShowerTrigger self) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) if (Time.realtimeSinceStartup - self.cleanInterval < 1.5f) { return; } Collider showerCollider = self.showerCollider; _ = showerCollider.bounds; for (int i = 0; i < allArsonList.Count; i++) { Arson arson = allArsonList[i]; if (!arson.arsonBeingShowered && arson.isCleanable) { Plugin.logger.LogMessage((object)("Checking arson " + ((Object)((Component)arson).gameObject).name)); BoxCollider component = ((Component)arson).GetComponent(); Bounds bounds = showerCollider.bounds; if (((Bounds)(ref bounds)).Intersects(((Collider)component).bounds)) { arson.arsonBeingShowered = true; arson.currentShower = self; Plugin.logger.LogMessage((object)"Eww!! stinky arson."); } else { arson.arsonBeingShowered = false; arson.showerTime = 0f; } } } orig.Invoke(self); } public override void Update() { //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).Update(); if (!arsonBeingShowered) { return; } if ((Object)(object)currentShower == (Object)null || !currentShower.showerOn) { arsonBeingShowered = false; return; } showerTime += Time.deltaTime; if (!(showerTime >= totalShowerTime)) { return; } arsonBeingShowered = false; showerTime = 0f; if (((NetworkBehaviour)this).IsHost) { GameObject obj = Object.Instantiate(cleanArson.spawnPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation); obj.GetComponent().Spawn(false); obj.transform.rotation = ((Component)this).transform.rotation; GrabbableObject component = obj.GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.itemProperties) && component.itemProperties.isScrap && Object.op_Implicit((Object)(object)RoundManager.Instance)) { int scrapValue = (int)((float)Random.Range(component.itemProperties.minValue, component.itemProperties.maxValue) * RoundManager.Instance.scrapValueMultiplier); component.SetScrapValue(scrapValue); syncScrapValueClientRpc(NetworkObjectReference.op_Implicit(((Component)component).GetComponent()), scrapValue, base.isInElevator, base.isInShipRoom); } ((Component)this).GetComponent().Despawn(true); } } [ClientRpc] public void syncScrapValueClientRpc(NetworkObjectReference obj, int scrapValue, bool itemIsInElevator, bool itemIsInShipRoom) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: 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) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3016238730u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref obj, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, scrapValue); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref itemIsInElevator, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref itemIsInShipRoom, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3016238730u, val, (RpcDelivery)0); } NetworkObject val3 = default(NetworkObject); if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && ((NetworkObjectReference)(ref obj)).TryGet(ref val3, (NetworkManager)null)) { GrabbableObject component = ((Component)val3).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.SetScrapValue(scrapValue); StartOfRound.Instance.localPlayerController.SetItemInElevator(itemIsInShipRoom, itemIsInElevator, component); } } } public void Awake() { allArsonList.Add(this); } public override void OnDestroy() { ((NetworkBehaviour)this).OnDestroy(); allArsonList.Remove(this); } public override void Start() { ((GrabbableObject)this).Start(); noisemakerRandom = new Random(StartOfRound.Instance.randomMapSeed + 85); } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0185: 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) ((GrabbableObject)this).ItemActivate(used, buttonDown); if (!((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null)) { int num = noisemakerRandom.Next(0, noiseSFX.Length); float num2 = (float)noisemakerRandom.Next((int)(minLoudness * 100f), (int)(maxLoudness * 100f)) / 100f; float pitch = (float)noisemakerRandom.Next((int)(minPitch * 100f), (int)(maxPitch * 100f)) / 100f; noiseAudio.pitch = pitch; noiseAudio.PlayOneShot(noiseSFX[num], num2); if ((Object)(object)noiseAudioFar != (Object)null) { noiseAudioFar.pitch = pitch; noiseAudioFar.PlayOneShot(noiseSFXFar[num], num2); } if ((Object)(object)triggerAnimator != (Object)null) { triggerAnimator.SetTrigger("playAnim"); } WalkieTalkie.TransmitOneShotAudio(noiseAudio, noiseSFX[num], num2); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, noiseRange, num2, 0, base.isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0); if (((Object)noiseSFX[num]).name.Contains("chomp") && ((NetworkBehaviour)this).IsOwner) { base.playerHeldBy.DamagePlayer(30, true, true, (CauseOfDeath)6, 0, false, default(Vector3)); base.playerHeldBy.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true); } } } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_Arson() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(3016238730u, new RpcReceiveHandler(__rpc_handler_3016238730)); } private static void __rpc_handler_3016238730(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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference obj = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref obj, default(ForNetworkSerializable)); int scrapValue = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref scrapValue); bool itemIsInElevator = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemIsInElevator, default(ForPrimitives)); bool itemIsInShipRoom = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref itemIsInShipRoom, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)2; ((Arson)(object)target).syncScrapValueClientRpc(obj, scrapValue, itemIsInElevator, itemIsInShipRoom); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Arson"; } } public class CustomNetworkTransform : NetworkBehaviour { public bool syncPosition = true; public bool syncRotation = true; public bool syncScale = true; public float positionDiffLimit = 0.1f; public float rotationDiffLimit = 0.1f; public float scaleDiffLimit = 0.1f; public bool lerpPosition = true; public bool lerpRotation = true; public bool lerpScale = true; public float positionLerpSpeed = 10f; public float rotationLerpSpeed = 10f; public float scaleLerpSpeed = 10f; private Vector3 _lastPosition; private Vector3 _lastRotation; private Vector3 _lastScale; private Vector3 _targetPosition; private Quaternion _targetRotation; private Vector3 _targetScale; public void FixedUpdate() { //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0172: 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_0189: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //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_009b: 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) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsServer) { if (syncPosition && Vector3.Distance(((Component)this).transform.position, _lastPosition) > positionDiffLimit) { _lastPosition = ((Component)this).transform.position; UpdatePositionClientRpc(((Component)this).transform.position); } if (syncRotation && Quaternion.Angle(Quaternion.Euler(((Component)this).transform.eulerAngles), Quaternion.Euler(_lastRotation)) > rotationDiffLimit) { _lastRotation = ((Component)this).transform.eulerAngles; UpdateRotationClientRpc(((Component)this).transform.eulerAngles); } if (syncScale && Vector3.Distance(((Component)this).transform.localScale, _lastScale) > scaleDiffLimit) { _lastScale = ((Component)this).transform.localScale; UpdateScaleClientRpc(((Component)this).transform.localScale); } } else { if (lerpPosition) { ((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, _targetPosition, Time.fixedDeltaTime * positionLerpSpeed); } if (lerpRotation) { ((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, _targetRotation, Time.fixedDeltaTime * rotationLerpSpeed); } if (lerpScale) { ((Component)this).transform.localScale = Vector3.Lerp(((Component)this).transform.localScale, _targetScale, Time.fixedDeltaTime * scaleLerpSpeed); } } } [ClientRpc] public void UpdatePositionClientRpc(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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: 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)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4183437368u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4183437368u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && !((NetworkBehaviour)this).IsServer && syncPosition) { if (lerpPosition) { _targetPosition = position; } else { ((Component)this).transform.position = position; } } } [ClientRpc] public void UpdateRotationClientRpc(Vector3 rotation) { //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_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3640121277u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref rotation); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3640121277u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && !((NetworkBehaviour)this).IsServer && syncRotation) { if (lerpRotation) { _targetRotation = Quaternion.Euler(rotation); } else { ((Component)this).transform.rotation = Quaternion.Euler(rotation); } } } [ClientRpc] public void UpdateScaleClientRpc(Vector3 scale) { //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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: 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)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1830875685u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref scale); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1830875685u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && !((NetworkBehaviour)this).IsServer && syncScale) { if (lerpScale) { _targetScale = scale; } else { ((Component)this).transform.localScale = scale; } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_CustomNetworkTransform() { //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(4183437368u, new RpcReceiveHandler(__rpc_handler_4183437368)); NetworkManager.__rpc_func_table.Add(3640121277u, new RpcReceiveHandler(__rpc_handler_3640121277)); NetworkManager.__rpc_func_table.Add(1830875685u, new RpcReceiveHandler(__rpc_handler_1830875685)); } private static void __rpc_handler_4183437368(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); target.__rpc_exec_stage = (__RpcExecStage)2; ((CustomNetworkTransform)(object)target).UpdatePositionClientRpc(position); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3640121277(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 rotation = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation); target.__rpc_exec_stage = (__RpcExecStage)2; ((CustomNetworkTransform)(object)target).UpdateRotationClientRpc(rotation); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1830875685(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 scale = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref scale); target.__rpc_exec_stage = (__RpcExecStage)2; ((CustomNetworkTransform)(object)target).UpdateScaleClientRpc(scale); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "CustomNetworkTransform"; } } [ExecuteAlways] public class Dart : GrabbableRigidbody { [CompilerGenerated] private static class <>O { public static hook_AssignNewNodes <0>__HUDManager_AssignNewNodes; public static hook_NodeIsNotVisible <1>__HUDManager_NodeIsNotVisible; public static hook_MeetsScanNodeRequirements <2>__HUDManager_MeetsScanNodeRequirements; } private PlayerControllerB playerThrownBy; public Transform dartTip; public float throwForce = 10f; private float t; public bool isThrown; private NetworkVariable throwDir = new NetworkVariable(Vector3.zero, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)1); private NetworkVariable isKinematic = new NetworkVariable(false, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public AudioClip dartHitSound; public AudioSource audioSource; public GameObject trackingPoint; public BoxCollider collider; public override void Start() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) base.Start(); if (((NetworkBehaviour)this).IsHost) { rb.isKinematic = false; rb.AddForce(dartTip.forward * throwForce, (ForceMode)1); t = 0f; isThrown = true; } collider = ((Component)this).GetComponent(); } public static void Init() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0030: 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_003b: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown object obj = <>O.<0>__HUDManager_AssignNewNodes; if (obj == null) { hook_AssignNewNodes val = HUDManager_AssignNewNodes; <>O.<0>__HUDManager_AssignNewNodes = val; obj = (object)val; } HUDManager.AssignNewNodes += (hook_AssignNewNodes)obj; object obj2 = <>O.<1>__HUDManager_NodeIsNotVisible; if (obj2 == null) { hook_NodeIsNotVisible val2 = HUDManager_NodeIsNotVisible; <>O.<1>__HUDManager_NodeIsNotVisible = val2; obj2 = (object)val2; } HUDManager.NodeIsNotVisible += (hook_NodeIsNotVisible)obj2; object obj3 = <>O.<2>__HUDManager_MeetsScanNodeRequirements; if (obj3 == null) { hook_MeetsScanNodeRequirements val3 = HUDManager_MeetsScanNodeRequirements; <>O.<2>__HUDManager_MeetsScanNodeRequirements = val3; obj3 = (object)val3; } HUDManager.MeetsScanNodeRequirements += (hook_MeetsScanNodeRequirements)obj3; } private static bool HUDManager_MeetsScanNodeRequirements(orig_MeetsScanNodeRequirements orig, HUDManager self, ScanNodeProperties node, PlayerControllerB playerScript) { //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) //IL_0067: 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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_009c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)node != (Object)null && (Object)(object)((Component)node).transform != (Object)null && (Object)(object)((Component)node).transform.parent != (Object)null && (Object)(object)((Component)((Component)node).transform.parent).GetComponent() != (Object)null) { Vector3 val = GameNetworkManager.Instance.localPlayerController.gameplayCamera.WorldToViewportPoint(((Component)node).transform.position); if (val.x < 0f || val.x > 1f || val.y < 0f || val.y > 1f || val.z <= 0f) { return false; } } return orig.Invoke(self, node, playerScript); } private static bool HUDManager_NodeIsNotVisible(orig_NodeIsNotVisible orig, HUDManager self, ScanNodeProperties node, int elementIndex) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)node != (Object)null && (Object)(object)((Component)node).transform != (Object)null && (Object)(object)((Component)node).transform.parent != (Object)null && (Object)(object)((Component)((Component)node).transform.parent).GetComponent() != (Object)null) { Vector3 val = GameNetworkManager.Instance.localPlayerController.gameplayCamera.WorldToViewportPoint(((Component)node).transform.position); if (val.x < 0f || val.x > 1f || val.y < 0f || val.y > 1f || val.z <= 0f) { self.nodesOnScreen.Remove(node); } } return orig.Invoke(self, node, elementIndex); } private static void HUDManager_AssignNewNodes(orig_AssignNewNodes orig, HUDManager self, PlayerControllerB playerScript) { //IL_0059: 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) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, playerScript); if (self.nodesOnScreen.Count >= self.scanElements.Length) { return; } Dart[] array = Object.FindObjectsOfType(); foreach (Dart dart in array) { ScanNodeProperties componentInChildren = ((Component)dart).GetComponentInChildren(); if (!((Object)(object)componentInChildren != (Object)null)) { continue; } Vector3 val = GameNetworkManager.Instance.localPlayerController.gameplayCamera.WorldToViewportPoint(((Component)componentInChildren).transform.position); if (!(val.x < 0f) && !(val.x > 1f) && !(val.y < 0f) && !(val.y > 1f) && !(val.z <= 0f)) { int maxRange = componentInChildren.maxRange; if (Vector3.Distance(((Component)playerScript).transform.position, ((Component)dart).transform.position) < (float)maxRange) { self.AttemptScanNode(componentInChildren, 0, playerScript); } } } } public override void EquipItem() { base.EquipItem(); isThrown = false; rb.isKinematic = false; t = 0f; } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemActivate(used, buttonDown); playerThrownBy = ((GrabbableObject)this).playerHeldBy; if (((NetworkBehaviour)this).IsOwner) { PlayerControllerB playerHeldBy = ((GrabbableObject)this).playerHeldBy; Vector3 val = default(Vector3); playerHeldBy.DiscardHeldObject(false, (NetworkObject)null, val, true); rb.isKinematic = false; throwDir.Value = dartTip.forward; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(((Component)playerThrownBy.gameplayCamera).transform.position, ((Component)playerThrownBy.gameplayCamera).transform.forward, ref val2, 100f, Utilities.MaskForLayer(((Component)this).gameObject.layer), (QueryTriggerInteraction)1)) { NetworkVariable obj = throwDir; val = ((RaycastHit)(ref val2)).point - dartTip.position; obj.Value = ((Vector3)(ref val)).normalized; } ThrowDartServerRpc(throwDir.Value); } } [ServerRpc(RequireOwnership = false)] public void ThrowDartServerRpc(Vector3 throwDir) { //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_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0118: 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(465068232u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref throwDir); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 465068232u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { t = 0f; rb.isKinematic = false; isThrown = true; Plugin.logger.LogMessage((object)$"Throwing dart with velocity: {throwDir * throwForce}"); rb.AddForce(throwDir * throwForce, (ForceMode)1); } } } [ServerRpc(RequireOwnership = false)] public void PlayDartHitSoundServerRpc() { //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(2304379636u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2304379636u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { PlayDartHitSoundClientRpc(); } } } [ClientRpc] public void PlayDartHitSoundClientRpc() { //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(3900828955u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3900828955u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { audioSource.PlayOneShot(dartHitSound); } } } public override void Update() { //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: 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) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) if (isKinematic.Value != rb.isKinematic && !((NetworkBehaviour)this).IsHost) { rb.isKinematic = isKinematic.Value; } else if (((NetworkBehaviour)this).IsHost && rb.isKinematic != isKinematic.Value) { isKinematic.Value = rb.isKinematic; } if (isKinematic.Value) { ((Collider)collider).isTrigger = true; } else { ((Collider)collider).isTrigger = false; } if (((NetworkBehaviour)this).IsHost) { if (rb.isKinematic && !((GrabbableObject)this).isHeld) { rb.position = trackingPoint.transform.position; rb.rotation = trackingPoint.transform.rotation; } if (isThrown) { Vector3 velocity = rb.velocity; if (((Vector3)(ref velocity)).magnitude > 0.1f) { ((Component)this).transform.LookAt(((Component)this).transform.position + rb.velocity); } t += Time.deltaTime; if (t > 5f) { isThrown = false; rb.isKinematic = true; } RaycastHit val = default(RaycastHit); if (Physics.SphereCast(dartTip.position, 0.01f, ((Component)this).transform.forward, ref val, 0.01f, Utilities.MaskForLayer(((Component)this).gameObject.layer), (QueryTriggerInteraction)1)) { Transform transform = ((RaycastHit)(ref val)).transform; if (((Object)(object)playerThrownBy != (Object)null && ((Object)(object)transform == (Object)(object)((Component)playerThrownBy).transform || transform.IsChildOf(((Component)playerThrownBy).transform))) || (Object)(object)((Component)transform).GetComponent() != (Object)null || (Object)(object)((Component)transform).GetComponentInParent() != (Object)null) { return; } TryParent(((RaycastHit)(ref val)).collider); Plugin.logger.LogMessage((object)$"(1) Hit target ({transform}) wawa!!! Layer: ({((Component)transform).gameObject.layer})"); PlayDartHitSoundServerRpc(); isThrown = false; rb.isKinematic = true; } } } base.Update(); } public void TryParent(Collider collider) { //IL_005c: 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) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Expected O, but got Unknown //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Expected O, but got Unknown //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) RootMarker component = ((Component)collider).GetComponent(); if ((Object)(object)component != (Object)null) { Transform root = component.root; if ((Object)(object)((Component)root).GetComponent() != (Object)null || (Object)(object)((Component)root).GetComponentInParent() != (Object)null || ((Object)root).name == "DartTrackingPoint") { SetParent(((Component)collider).transform); } Transform val = root; float num = Vector3.Distance(((Component)this).transform.position, val.position); foreach (Transform item in root) { Transform val2 = item; if (!((Object)(object)((Component)val2).GetComponent() != (Object)null) && !(((Object)val2).name == "DartTrackingPoint")) { float num2 = Vector3.Distance(((Component)this).transform.position, val2.position); if (num2 < num) { val = val2; num = num2; } } } SetParent(val); } else { bool flag = false; Transform val3 = ((Component)collider).transform; while (!flag && !((Object)(object)val3 == (Object)null)) { if (Object.op_Implicit((Object)(object)((Component)val3).GetComponent())) { flag = true; } else { val3 = val3.parent; } } if (!flag) { SetParent(((Component)collider).transform); } else { Transform val4 = val3; float num3 = Vector3.Distance(((Component)this).transform.position, val4.position); foreach (Transform item2 in val3) { Transform val5 = item2; if (!((Object)(object)((Component)val5).GetComponent() != (Object)null) && !(((Object)val5).name == "DartTrackingPoint")) { float num4 = Vector3.Distance(((Component)this).transform.position, val5.position); if (num4 < num3) { val4 = val5; num3 = num4; } } } SetParent(val4); } } isKinematic.Value = true; rb.isKinematic = true; Plugin.logger.LogMessage((object)$"Parented to: {((Component)this).transform.parent}"); } public void SetParent(Transform parent) { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: 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_0033: Expected O, but got Unknown //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) Plugin.logger.LogInfo((object)("Setting parent to: " + ((Object)parent).name)); if ((Object)(object)trackingPoint == (Object)null) { trackingPoint = new GameObject(); ((Object)trackingPoint).name = "DartTrackingPoint"; trackingPoint.transform.SetParent(parent); trackingPoint.transform.position = ((Component)this).transform.position; trackingPoint.transform.rotation = ((Component)this).transform.rotation; } else { trackingPoint.transform.SetParent(parent); trackingPoint.transform.position = ((Component)this).transform.position; trackingPoint.transform.rotation = ((Component)this).transform.rotation; } } public override void OnDestroy() { ((NetworkBehaviour)this).OnDestroy(); if ((Object)(object)trackingPoint != (Object)null) { Object.Destroy((Object)(object)trackingPoint); } } public void OnTriggerEnter(Collider collision) { if (((NetworkBehaviour)this).IsHost && !collision.isTrigger && (Object)(object)((Component)collision).gameObject.GetComponent() == (Object)null && (Object)(object)((Component)collision).gameObject.GetComponentInParent() == (Object)null && isThrown) { Transform transform = ((Component)collision).transform; Plugin.logger.LogMessage((object)$"(2) Hit target ({transform}) wawa!!! Layer: ({((Component)transform).gameObject.layer})"); if ((Utilities.MaskForLayer(((Component)this).gameObject.layer) & (1 << ((Component)transform).gameObject.layer)) != 0 && (!((Object)(object)playerThrownBy != (Object)null) || (!((Object)(object)transform == (Object)(object)((Component)playerThrownBy).transform) && !transform.IsChildOf(((Component)playerThrownBy).transform)))) { TryParent(collision); isThrown = false; rb.isKinematic = true; PlayDartHitSoundServerRpc(); } } } public void OnCollisionEnter(Collision collision) { if (((NetworkBehaviour)this).IsHost && !collision.collider.isTrigger && (Object)(object)collision.gameObject.GetComponent() == (Object)null && (Object)(object)collision.gameObject.GetComponentInParent() == (Object)null && isThrown) { Transform transform = collision.transform; Plugin.logger.LogMessage((object)$"(3) Hit target ({transform}) wawa!!! Layer: ({((Component)transform).gameObject.layer})"); if ((Utilities.MaskForLayer(((Component)this).gameObject.layer) & (1 << ((Component)transform).gameObject.layer)) != 0 && (!((Object)(object)playerThrownBy != (Object)null) || (!((Object)(object)transform == (Object)(object)((Component)playerThrownBy).transform) && !transform.IsChildOf(((Component)playerThrownBy).transform)))) { TryParent(collision.collider); isThrown = false; rb.isKinematic = true; PlayDartHitSoundServerRpc(); } } } protected override void __initializeVariables() { if (throwDir == null) { throw new Exception("Dart.throwDir cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)throwDir).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)throwDir, "throwDir"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)throwDir); if (isKinematic == null) { throw new Exception("Dart.isKinematic cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)isKinematic).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)isKinematic, "isKinematic"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)isKinematic); base.__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_Dart() { //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(465068232u, new RpcReceiveHandler(__rpc_handler_465068232)); NetworkManager.__rpc_func_table.Add(2304379636u, new RpcReceiveHandler(__rpc_handler_2304379636)); NetworkManager.__rpc_func_table.Add(3900828955u, new RpcReceiveHandler(__rpc_handler_3900828955)); } private static void __rpc_handler_465068232(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 val = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref val); target.__rpc_exec_stage = (__RpcExecStage)1; ((Dart)(object)target).ThrowDartServerRpc(val); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2304379636(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; ((Dart)(object)target).PlayDartHitSoundServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3900828955(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; ((Dart)(object)target).PlayDartHitSoundClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "Dart"; } } public class DartboardInit : NetworkBehaviour { public Transform[] dartSpawns; public GameObject dartPrefab; public List dartInstances = new List(); public int dartsToSpawn = 3; public override void OnNetworkSpawn() { //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: 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) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) ((NetworkBehaviour)this).OnNetworkSpawn(); if (!((NetworkBehaviour)this).IsHost) { return; } Dart[] array = Object.FindObjectsOfType(); Dart[] array2 = array; foreach (Dart dart in array2) { dartInstances.Add(((Component)dart).gameObject); } List list = new List(dartSpawns); List list2 = new List(); for (int j = array.Length; j < dartsToSpawn; j++) { int index = Random.Range(0, list.Count); list2.Add(list[index]); list.RemoveAt(index); } foreach (Transform item in list2) { GameObject val = Object.Instantiate(dartPrefab, item.position, item.rotation, ((Component)this).transform); Dart component = val.GetComponent(); Transform transform = val.transform; transform.position -= val.transform.forward * Vector3.Distance(component.dartTip.position, item.position); dartInstances.Add(val); val.GetComponent().Spawn(false); } } public void Update() { //IL_005d: 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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) if (Time.frameCount % 120 != 0) { return; } List list = new List(); bool flag = false; foreach (GameObject dartInstance in dartInstances) { if ((Object)(object)dartInstance == (Object)null) { flag = true; int num = Random.Range(0, dartSpawns.Length); Transform val = dartSpawns[num]; GameObject val2 = Object.Instantiate(dartPrefab, val.position, val.rotation, ((Component)this).transform); Dart component = val2.GetComponent(); Transform transform = val2.transform; transform.position -= val2.transform.forward * Vector3.Distance(component.dartTip.position, val.position); list.Add(val2); val2.GetComponent().Spawn(false); } else { list.Add(dartInstance); } } if (flag) { dartInstances = list; } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected internal override string __getTypeName() { return "DartboardInit"; } } public class DecalRandomizer : SaveableNetworkBehaviour { [CompilerGenerated] private static class <>O { public static hook_EnableItemMeshes <0>__GrabbableObject_EnableItemMeshes; } public List decalProjectors = new List(); private NetworkList decalIndexes = new NetworkList((IEnumerable)new List(), (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public List decalMaterials = new List(); public override void SaveObjectData() { List list = new List(); for (int i = 0; i < decalIndexes.Count; i++) { list.Add(decalIndexes[i]); } SaveData.SaveObjectData("decalData", list, uniqueId); } public override void LoadObjectData() { if (((NetworkBehaviour)this).IsHost) { decalIndexes.Clear(); List list = SaveData.LoadObjectData>("decalData", uniqueId); if (list == null) { list = new List(); } for (int i = 0; i < list.Count; i++) { decalIndexes.Add(list[i]); } } } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if (((NetworkBehaviour)this).IsHost) { for (int i = 0; i < decalProjectors.Count; i++) { decalIndexes.Add(Random.Range(0, decalMaterials.Count)); } } } public void Start() { if (((NetworkBehaviour)this).IsServer) { for (int i = 0; i < decalProjectors.Count; i++) { decalIndexes[i] = Random.Range(0, decalMaterials.Count); } } for (int j = 0; j < decalProjectors.Count; j++) { decalProjectors[j].material = decalMaterials[decalIndexes[j]]; } } public static void Init() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown object obj = <>O.<0>__GrabbableObject_EnableItemMeshes; if (obj == null) { hook_EnableItemMeshes val = GrabbableObject_EnableItemMeshes; <>O.<0>__GrabbableObject_EnableItemMeshes = val; obj = (object)val; } GrabbableObject.EnableItemMeshes += (hook_EnableItemMeshes)obj; } private static void GrabbableObject_EnableItemMeshes(orig_EnableItemMeshes orig, GrabbableObject self, bool enable) { orig.Invoke(self, enable); DecalProjector[] componentsInChildren = ((Component)self).gameObject.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { ((Behaviour)componentsInChildren[i]).enabled = enable; } } protected override void __initializeVariables() { if (decalIndexes == null) { throw new Exception("DecalRandomizer.decalIndexes cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)decalIndexes).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)decalIndexes, "decalIndexes"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)decalIndexes); base.__initializeVariables(); } protected internal override string __getTypeName() { return "DecalRandomizer"; } } [ExecuteAlways] public class DecorPlacementDebug : MonoBehaviour { private int placementMaskAndBlockers = 605030721; public PlaceableShipObject placeableShipObject; private void OnDrawGizmos() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)placeableShipObject == (Object)null) { return; } Collider placeObjectCollider = placeableShipObject.placeObjectCollider; BoxCollider val = (BoxCollider)(object)((placeObjectCollider is BoxCollider) ? placeObjectCollider : null); _ = ((Component)placeableShipObject).transform; Gizmos.color = Color.red; Gizmos.DrawWireCube(((Component)this).transform.position, val.size * 0.5f * 0.57f); string text = ""; for (int i = 0; i < 32; i++) { if ((placementMaskAndBlockers & (1 << i)) != 0) { text = text + LayerMask.LayerToName(i) + ", "; } } Debug.Log((object)text); } } public class DevMenu : NetworkBehaviour { private enum EnemyTypes { inside, outside, daytime } public List