Decompiled source of L extention WIP v0.1.0
Welcome_To_Ooblterra.dll
Decompiled 10 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using DunGen.Adapters; using GameNetcodeStuff; using HarmonyLib; using LethalLevelLoader; using LethalLib.Modules; using Microsoft.CodeAnalysis; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using Welcome_To_Ooblterra.Enemies; using Welcome_To_Ooblterra.Items; using Welcome_To_Ooblterra.Patches; using Welcome_To_Ooblterra.Properties; using Welcome_To_Ooblterra.RoomBehaviors; using Welcome_To_Ooblterra.Things; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("Welcome_To_Ooblterra")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Welcome_To_Ooblterra")] [assembly: AssemblyCopyright("Copyright © 2023")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("8ef012de-dac8-42a5-b383-0c7886f684ae")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [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 <Module> { static <Module>() { } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Welcome_To_Ooblterra { internal class WTONetworkHandler : NetworkBehaviour { public static WTONetworkHandler Instance { get; private set; } public static event Action<string> LevelEvent; public override void OnNetworkSpawn() { WTONetworkHandler.LevelEvent = null; if (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer) { WTONetworkHandler instance = Instance; if (instance != null) { ((Component)instance).gameObject.GetComponent<NetworkObject>().Despawn(true); } } Instance = this; ((NetworkBehaviour)this).OnNetworkSpawn(); } [ClientRpc] public void EventClientRpc(string eventName) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_0088: 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_00ba: 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(1907558404u, val, (RpcDelivery)0); bool flag = eventName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(eventName, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1907558404u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { WTONetworkHandler.LevelEvent?.Invoke(eventName); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_WTONetworkHandler() { //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(1907558404u, new RpcReceiveHandler(__rpc_handler_1907558404)); } private static void __rpc_handler_1907558404(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_0061: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string eventName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref eventName, false); } target.__rpc_exec_stage = (__RpcExecStage)2; ((WTONetworkHandler)(object)target).EventClientRpc(eventName); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "WTONetworkHandler"; } } } namespace Welcome_To_Ooblterra.Properties { internal class WTOConfig { public static ConfigEntry<bool> OoblterraEnabled; public static ConfigEntry<string> CustomInteriorEnabled; public static ConfigEntry<bool> WTOCustomSuits; public static ConfigEntry<string> SpawnScrapStatus; public static ConfigEntry<string> SpawnIndoorEnemyStatus; public static ConfigEntry<string> SpawnOutdoorEnemyStatus; public static ConfigEntry<string> SpawnAmbientEnemyStatus; public static ConfigEntry<string> SpawnSecurityStatus; private void Load() { OoblterraEnabled = WTOBase.ConfigFile.Bind<bool>("General", "Enable Ooblterra", true, "Whether or not to enable Ooblterra in the moons list and allow navigation to it. \n Default value: true \n Accepted values: true, false \n\n"); CustomInteriorEnabled = WTOBase.ConfigFile.Bind<string>("General", "Enable Ooblterra Interior", "CustomLevelOnly", "If the custom interior map is allowed to spawn, and where. Draws over the \"Manor\" configuration.\n Default value: CustomLevelOnly \n Accepted values: Off, CustomLevelOnly, AllLevels \n The Off value will cause Ooblterra to use the \"Manor\" interior map by default. \n\n "); WTOCustomSuits = WTOBase.ConfigFile.Bind<bool>("Items", "Add Suits", true, "Whether or not to add WTO's custom suits. \n Default value: true \n Accepted values: true, false \n Turn off if you have other custom suit mods and are at risk of exceeding the 12 suit limit.\n\n"); SpawnScrapStatus = WTOBase.ConfigFile.Bind<string>("Items", "Custom Scrap", "CustomLevelOnly", "If custom scrap should be allowed to spawn, and where.\n Default value: CustomLevelOnly \n Accepted values: Off, CustomLevelOnly, AllLevels \n\n"); SpawnIndoorEnemyStatus = WTOBase.ConfigFile.Bind<string>("Enemies", "Custom Enemies (Indoors)", "CustomLevelOnly", "If custom indoor enemies should be allowed to spawn, and where.\n Default value: CustomLevelOnly \n Accepted values: Off, CustomLevelOnly, AllLevels \n\n"); SpawnOutdoorEnemyStatus = WTOBase.ConfigFile.Bind<string>("Enemies", "Custom Enemies (Outdoor)", "CustomLevelOnly", "If custom outdoor enemies should be allowed to spawn, and where.\n Default value: CustomLevelOnly \n Accepted values: Off, CustomLevelOnly, AllLevels \n\n"); SpawnAmbientEnemyStatus = WTOBase.ConfigFile.Bind<string>("Enemies", "Custom Enemies (Daytime)", "CustomLevelOnly", "If custom daytime enemies should be allowed to spawn, and where.\n Default value: CustomLevelOnly \n Accepted values: Off, CustomLevelOnly, AllLevels \n Daytime Enemies are ambient types that spawn before you land, such as birds, bees, and locusts. \n\n"); SpawnSecurityStatus = WTOBase.ConfigFile.Bind<string>("Enemies", "Custom Security", "CustomLevelOnly", "If custom security objects should be allowed to spawn, and where.\n Default value: CustomLevelOnly \n Accepted values: Off, CustomLevelOnly, AllLevels \n Security objects are objects such as Landmines and Turrets that can be disabled via the terminal. \n\n"); } } [BepInPlugin("SkullCrusher.WTO", "Welcome To Ooblterra", "0.8")] public class WTOBase : BaseUnityPlugin { public enum AllowedState { Off, CustomLevelOnly, AllLevels } public static ConfigFile ConfigFile; private const string modGUID = "SkullCrusher.WTO"; private const string modName = "Welcome To Ooblterra"; private const string modVersion = "0.8"; private readonly Harmony WTOHarmony = new Harmony("SkullCrusher.WTO"); internal ManualLogSource WTOLogSource; public static WTOBase Instance; public static AssetBundle LevelAssetBundle; public static AssetBundle ItemAssetBundle; public static AssetBundle FactoryAssetBundle; public static AssetBundle MonsterAssetBundle; [HarmonyPatch(typeof(StartOfRound), "Update")] [HarmonyPostfix] public static void DebugHelper(StartOfRound __instance) { if (((ButtonControl)Keyboard.current.f8Key).wasPressedThisFrame) { BatteryRecepticle batteryRecepticle = Object.FindObjectOfType<BatteryRecepticle>(); batteryRecepticle.TurnOnPower(); } } private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } WTOLogSource = Logger.CreateLogSource("SkullCrusher.WTO"); WTOLogSource.LogInfo((object)"Welcome to Ooblterra! "); WTOHarmony.PatchAll(typeof(WTOBase)); WTOHarmony.PatchAll(typeof(FactoryPatch)); WTOHarmony.PatchAll(typeof(ItemPatch)); WTOHarmony.PatchAll(typeof(MonsterPatch)); WTOHarmony.PatchAll(typeof(MoonPatch)); WTOHarmony.PatchAll(typeof(SuitPatch)); WTOHarmony.PatchAll(typeof(TerminalPatch)); bool flag = true; LogToConsole("BEGIN PRINTING LOADED ASSETS"); bool flag2 = true; string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "customdungeon"); FactoryAssetBundle = AssetBundle.LoadFromFile(text); bool flag3 = true; string text2 = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "customitems"); ItemAssetBundle = AssetBundle.LoadFromFile(text2); bool flag4 = true; string text3 = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "custommoon"); LevelAssetBundle = AssetBundle.LoadFromFile(text3); string text4 = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "customenemies"); MonsterAssetBundle = AssetBundle.LoadFromFile(text4); FactoryPatch.Start(); ItemPatch.Start(); MonsterPatch.Start(); MoonPatch.Start(); TerminalPatch.Start(); Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } } public static void LogToConsole(string text) { text = "=======" + text + "======="; Debug.Log((object)text); } } } namespace Welcome_To_Ooblterra.Patches { internal class ItemPatch { public class ItemData { private string AssetName; private int Rarity; private Item Itemref; public ItemData(string name, int rarity) { AssetName = "Assets/CustomItems/" + name; Rarity = rarity; } public string GetItemPath() { return AssetName; } public int GetRarity() { return Rarity; } public void SetItem(Item ItemToSet) { Itemref = ItemToSet; } public Item GetItem() { return Itemref; } } private const string ItemPath = "Assets/CustomItems/"; public static ItemData[] ItemList = new ItemData[11] { new ItemData("AlienCrate.asset", 30), new ItemData("FiveSixShovel.asset", 10), new ItemData("HandCrystal.asset", 30), new ItemData("OoblCorpse.asset", 5), new ItemData("StatueSmall.asset", 40), new ItemData("WandCorpse.asset", 5), new ItemData("WandFeed.asset", 20), new ItemData("SprintTotem.asset", 25), new ItemData("CursedTotem.asset", 20), new ItemData("Chems.asset", 0), new ItemData("Battery.asset", 0) }; [HarmonyPatch(typeof(RoundManager), "SetLockedDoors")] [HarmonyPrefix] private static void ReplaceKeys(RoundManager __instance) { if (!(__instance.currentLevel.PlanetName != MoonPatch.MoonFriendlyName)) { GameObject keyPrefab = Object.Instantiate<GameObject>(WTOBase.ItemAssetBundle.LoadAsset<GameObject>("Assets/CustomItems/OoblKey.prefab"), __instance.mapPropsContainer.transform); __instance.keyPrefab = keyPrefab; } } public static void Start() { ItemData[] itemList = ItemList; foreach (ItemData itemData in itemList) { Item val = WTOBase.ItemAssetBundle.LoadAsset<Item>(itemData.GetItemPath()); NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab); Items.RegisterScrap(val, itemData.GetRarity(), (LevelTypes)1, new string[1] { "OoblterraLevel" }); itemData.SetItem(val); Debug.Log((object)("Item Loaded: " + ((Object)val).name)); } NetworkPrefabs.RegisterNetworkPrefab(WTOBase.ItemAssetBundle.LoadAsset<GameObject>("Assets/CustomItems/OoblKey.prefab")); } } internal class TerminalPatch { private static readonly AssetBundle LevelBundle = WTOBase.LevelAssetBundle; private static Terminal ActiveTerminal; private static TerminalKeyword RouteKeyword; private static TerminalKeyword CancelKeyword; private static TerminalKeyword ConfirmKeyword; private static TerminalKeyword MoonTerminalWord; private const string TerminalPath = "Assets/CustomTerminal/"; private static bool DontRun = false; public static TerminalKeyword InfoKeyword { get; private set; } [HarmonyPatch(typeof(StartOfRound), "Awake")] [HarmonyPostfix] private static void ExpandTerminal(StartOfRound __instance) { } [HarmonyPatch(typeof(RoundManager), "Start")] [HarmonyPostfix] [HarmonyPriority(500)] private static void SwitchNodes(RoundManager __instance) { ExtendedLevel OoblterraRef = LevelBundle.LoadAsset<ExtendedLevel>("Assets/CustomMoon/OoblterraExtendedLevel.asset"); ExtendedLevel val = PatchedContent.ExtendedLevels.Find((ExtendedLevel x) => (Object)(object)x.selectableLevel == (Object)(object)OoblterraRef.selectableLevel); val.routeConfirmNode.displayText = "Routing autopilot to 523-Ooblterra.\r\nYour new balance is [playerCredits].\r\n\r\nRouting to external planets may take a while.\r\nPlease enjoy your flight.\r\n\r\n"; } public static void Start() { ExtendedLevel val = LevelBundle.LoadAsset<ExtendedLevel>("Assets/CustomMoon/OoblterraExtendedLevel.asset"); val.infoNode = LevelBundle.LoadAsset<TerminalNode>("Assets/CustomTerminal/OoblterraInfo.asset"); val.routeNode = LevelBundle.LoadAsset<TerminalNode>("Assets/CustomTerminal/523route.asset"); val.routeConfirmNode = LevelBundle.LoadAsset<TerminalNode>("Assets/CustomTerminal/523routeConfirm.asset"); PatchedContent.RegisterExtendedLevel(val); } private static void GrabActiveTerminal() { ActiveTerminal = GameObject.Find("TerminalScript").GetComponent<Terminal>(); RouteKeyword = ActiveTerminal.terminalNodes.allKeywords[26]; InfoKeyword = ActiveTerminal.terminalNodes.allKeywords[6]; CancelKeyword = ActiveTerminal.terminalNodes.allKeywords[4]; ConfirmKeyword = ActiveTerminal.terminalNodes.allKeywords[3]; } public static void AddToKeyword(TerminalKeyword KeywordToAddTo, TerminalKeyword NewNoun, TerminalNode NewResult) { //IL_0027: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown Array.Resize(ref KeywordToAddTo.compatibleNouns, KeywordToAddTo.compatibleNouns.Length + 1); KeywordToAddTo.compatibleNouns[KeywordToAddTo.compatibleNouns.Length - 1] = new CompatibleNoun { noun = NewNoun, result = NewResult }; } public static void AddMoonToList(string MoonName) { if (!DontRun) { Array.Resize(ref ActiveTerminal.moonsCatalogueList, ActiveTerminal.moonsCatalogueList.Length + 1); ActiveTerminal.moonsCatalogueList[ActiveTerminal.moonsCatalogueList.Length - 1] = MoonPatch.MyNewMoon; MoonTerminalWord = LevelBundle.LoadAsset<TerminalKeyword>("Assets/CustomTerminal/523-Ooblterra.asset"); MoonTerminalWord.defaultVerb = RouteKeyword; Array.Resize(ref ActiveTerminal.terminalNodes.allKeywords, ActiveTerminal.terminalNodes.allKeywords.Length + 1); ActiveTerminal.terminalNodes.allKeywords[ActiveTerminal.terminalNodes.allKeywords.Length - 1] = MoonTerminalWord; TerminalNode specialKeywordResult = ActiveTerminal.terminalNodes.allKeywords[21].specialKeywordResult; specialKeywordResult.displayText.Substring(specialKeywordResult.displayText.Length - 3); specialKeywordResult.displayText = specialKeywordResult.displayText + "\n* " + MoonName + " [planetTime]\n\n"; DontRun = true; } } public static void CreateRoute() { TerminalNode val = LevelBundle.LoadAsset<TerminalNode>("Assets/CustomTerminal/523route.asset"); val.terminalOptions[0].noun = CancelKeyword; val.terminalOptions[1].noun = ConfirmKeyword; AddToKeyword(RouteKeyword, MoonTerminalWord, val); } } internal class FactoryPatch { public static EntranceTeleport MainExit; public static EntranceTeleport FireExit; private static readonly AssetBundle FactoryBundle = WTOBase.FactoryAssetBundle; private static readonly AssetBundle LLLBundle; private static NetworkManager networkManagerRef; private const string DungeonPath = "Assets/CustomDungeon/Data/"; private const string BehaviorPath = "Assets/CustomDungeon/Behaviors/"; private const string SecurityPath = "Assets/CustomDungeon/Security/"; private const string DoorPath = "Assets/CustomDungeon/Doors/"; public static List<SpawnableMapObject> SecurityList = new List<SpawnableMapObject>(); [HarmonyPatch(typeof(StartOfRound), "Awake")] [HarmonyPostfix] private static void GetNetworkManager(StartOfRound __instance) { networkManagerRef = ((NetworkBehaviour)__instance).NetworkManager; } [HarmonyPatch(typeof(RoundManager), "SpawnMapObjects")] [HarmonyPrefix] private static bool WTOSpawnMapObjects(RoundManager __instance) { //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: 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_0182: Unknown result type (might be due to invalid IL or missing references) if (__instance.currentLevel.PlanetName != MoonPatch.MoonFriendlyName) { return true; } if (__instance.currentLevel.spawnableMapObjects.Length == 0) { return true; } Random random = new Random(StartOfRound.Instance.randomMapSeed + 587); __instance.mapPropsContainer = GameObject.FindGameObjectWithTag("MapPropsContainer"); RandomMapObject[] array = Object.FindObjectsOfType<RandomMapObject>(); for (int i = 0; i < __instance.currentLevel.spawnableMapObjects.Length; i++) { List<RandomMapObject> list = new List<RandomMapObject>(); int num = (int)__instance.currentLevel.spawnableMapObjects[i].numberToSpawn.Evaluate((float)random.NextDouble()); if (__instance.increasedMapHazardSpawnRateIndex == i) { num = Mathf.Min(num * 2, 150); } if (num <= 0) { continue; } for (int j = 0; j < array.Length; j++) { if (array[j].spawnablePrefabs.Contains(__instance.currentLevel.spawnableMapObjects[i].prefabToSpawn)) { list.Add(array[j]); } } for (int k = 0; k < num; k++) { if (list.Count > 0) { RandomMapObject val = list[random.Next(0, list.Count)]; Vector3 position = ((Component)val).transform.position; GameObject val2 = Object.Instantiate<GameObject>(__instance.currentLevel.spawnableMapObjects[i].prefabToSpawn, position, ((Component)val).transform.rotation, __instance.mapPropsContainer.transform); val2.GetComponent<NetworkObject>().Spawn(true); list.Remove(val); } } } return false; } public static void Start() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown ExtendedDungeonFlow val = FactoryBundle.LoadAsset<ExtendedDungeonFlow>("Assets/CustomDungeon/Data/OoblLabExtendedDungeonFlow.asset"); val.manualPlanetNameReferenceList.Clear(); val.manualPlanetNameReferenceList.Add(new StringWithRarity("523 Ooblterra", 300)); PatchedContent.RegisterExtendedDungeonFlow(val); NetworkPrefabs.RegisterNetworkPrefab(FactoryBundle.LoadAsset<GameObject>("Assets/CustomDungeon/Behaviors/ChargedBattery.prefab")); NetworkPrefabs.RegisterNetworkPrefab(FactoryBundle.LoadAsset<GameObject>("Assets/CustomDungeon/Security/TeslaCoil.prefab")); NetworkPrefabs.RegisterNetworkPrefab(FactoryBundle.LoadAsset<GameObject>("Assets/CustomDungeon/Security/SpikeTrap.prefab")); } private static void DestroyExit(EntranceTeleport ExitToDestroy) { if (!((Object)(object)ExitToDestroy == (Object)null)) { if (networkManagerRef.IsHost) { ((Component)ExitToDestroy).GetComponent<NetworkObject>().Despawn(true); } Object.Destroy((Object)(object)ExitToDestroy); } } private static void ReplaceVents() { //IL_00b6: 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) int num = 0; SpawnSyncedObject[] source = Object.FindObjectsOfType<SpawnSyncedObject>(); NetworkPrefab val = networkManagerRef.NetworkConfig.Prefabs.m_Prefabs.First((NetworkPrefab x) => ((Object)x.Prefab).name == "VentEntrance"); if (val == null) { WTOBase.LogToConsole("LC Vent Prefab not found!!"); return; } foreach (SpawnSyncedObject item in source.Where((SpawnSyncedObject objectToTest) => ((Object)objectToTest.spawnPrefab).name == "VentDummy")) { num++; Object.Instantiate<GameObject>(val.Prefab); val.Prefab.transform.position = ((Component)item).transform.position; val.Prefab.transform.rotation = ((Component)item).transform.rotation; } WTOBase.LogToConsole("Vents Found: " + num); } private static EntranceTeleport CreateExit(string SpawnLocationName, EntranceTeleport ExistingEntrance) { //IL_0090: 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) GameObject[] source = Object.FindObjectsOfType<GameObject>(); EntranceTeleport NewExit = Object.Instantiate<EntranceTeleport>(ExistingEntrance); if (networkManagerRef.IsHost) { ((Component)NewExit).GetComponent<NetworkObject>().Spawn(false); } using (IEnumerator<GameObject> enumerator = source.Where((GameObject Obj) => ((Object)Obj).name.Contains(SpawnLocationName)).GetEnumerator()) { if (enumerator.MoveNext()) { GameObject current = enumerator.Current; ((Component)NewExit).transform.position = current.transform.position; ((Component)NewExit).transform.rotation = current.transform.rotation; InteractTrigger component = ((Component)NewExit).GetComponent<InteractTrigger>(); ((UnityEventBase)component.onInteract).RemoveAllListeners(); ((UnityEvent<PlayerControllerB>)(object)component.onInteract).AddListener((UnityAction<PlayerControllerB>)delegate { NewExit.TeleportPlayer(); }); NewExit.isEntranceToBuilding = false; return NewExit; } } WTOBase.LogToConsole("Exit Spawn not found!!!!"); return null; } } internal class MonsterPatch { public static List<SpawnableEnemyWithRarity> InsideEnemies = new List<SpawnableEnemyWithRarity>(); public static List<SpawnableEnemyWithRarity> OutsideEnemies = new List<SpawnableEnemyWithRarity>(); public static List<SpawnableEnemyWithRarity> DaytimeEnemies = new List<SpawnableEnemyWithRarity>(); public static List<SpawnableEnemyWithRarity> AdultWandererContainer = new List<SpawnableEnemyWithRarity>(); private const string EnemyPathRoot = "Assets/CustomEnemies/"; private static bool EnemiesInList; public const bool ShouldDebugEnemies = true; [HarmonyPatch(typeof(QuickMenuManager), "Debug_SetEnemyDropdownOptions")] [HarmonyPrefix] private static void AddMonstersToDebug(QuickMenuManager __instance) { //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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Expected O, but got Unknown //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Expected O, but got Unknown //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Expected O, but got Unknown if (EnemiesInList) { return; } SelectableLevel testAllEnemiesLevel = __instance.testAllEnemiesLevel; SpawnableEnemyWithRarity val = testAllEnemiesLevel.Enemies.FirstOrDefault(); if (val == null) { Debug.Log((object)"Failed to get first enemy for debug list!"); return; } List<SpawnableEnemyWithRarity> enemies = testAllEnemiesLevel.Enemies; List<SpawnableEnemyWithRarity> outsideEnemies = testAllEnemiesLevel.OutsideEnemies; List<SpawnableEnemyWithRarity> daytimeEnemies = testAllEnemiesLevel.DaytimeEnemies; enemies.Clear(); foreach (SpawnableEnemyWithRarity insideEnemy in InsideEnemies) { if (!enemies.Contains(insideEnemy)) { enemies.Add(new SpawnableEnemyWithRarity { enemyType = insideEnemy.enemyType, rarity = insideEnemy.rarity }); Debug.Log((object)("Added " + ((Object)insideEnemy.enemyType).name + "To debug list")); } } daytimeEnemies.Clear(); foreach (SpawnableEnemyWithRarity daytimeEnemy in DaytimeEnemies) { if (!daytimeEnemies.Contains(daytimeEnemy)) { daytimeEnemies.Add(new SpawnableEnemyWithRarity { enemyType = daytimeEnemy.enemyType, rarity = daytimeEnemy.rarity }); Debug.Log((object)("Added " + ((Object)daytimeEnemy.enemyType).name + "To debug list")); } } outsideEnemies.Clear(); outsideEnemies.Add(new SpawnableEnemyWithRarity { enemyType = AdultWandererContainer[0].enemyType, rarity = AdultWandererContainer[0].rarity }); Debug.Log((object)("Added " + ((Object)AdultWandererContainer[0].enemyType).name + "To debug list")); EnemiesInList = true; } [HarmonyPatch(typeof(EnemyAI), "SetEnemyStunned")] [HarmonyPostfix] private static void SetOwnershipToStunningPlayer(EnemyAI __instance) { if (__instance is WTOEnemy && !((Object)(object)__instance.stunnedByPlayer == (Object)null)) { WTOBase.LogToConsole($"Enemy: {((object)__instance).GetType()} STUNNED BY: {__instance.stunnedByPlayer}; Switching ownership..."); __instance.ChangeOwnershipOfEnemy(__instance.stunnedByPlayer.actualClientId); } } public static void Start() { CreateEnemy("Wanderer.asset", DaytimeEnemies, 50, (SpawnType)1, "WandererTerminal.asset", "WandererKeyword.asset"); CreateEnemy("AdultWanderer.asset", AdultWandererContainer, 0, (SpawnType)2, "AdultWandererTerminal.asset", "AdultWandererKeyword.asset"); CreateEnemy("Gallenarma.asset", InsideEnemies, 30, (SpawnType)0, "GallenTerminal.asset", "GallenKeyword.asset"); CreateEnemy("EyeSecurity.asset", InsideEnemies, 20, (SpawnType)0, "EyeSecTerminal.asset", "EyeSecKeyword.asset"); CreateEnemy("Lurker.asset", InsideEnemies, 20, (SpawnType)0, "LurkerTerminal.asset", "LurkerKeyword.asset"); } public static void CreateEnemy(string EnemyName, List<SpawnableEnemyWithRarity> EnemyList, int rarity, SpawnType SpawnType, string InfoName = null, string KeywordName = null) { //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown string text = EnemyName.Remove(EnemyName.Length - 6, 6) + "/"; TerminalNode val = null; TerminalKeyword val2 = null; EnemyType val3 = WTOBase.MonsterAssetBundle.LoadAsset<EnemyType>("Assets/CustomEnemies/" + text + EnemyName); val3.enemyPrefab.GetComponent<EnemyAI>().debugEnemyAI = false; if (InfoName != null) { val = WTOBase.MonsterAssetBundle.LoadAsset<TerminalNode>("Assets/CustomEnemies/" + text + InfoName); } if (KeywordName != null) { val2 = WTOBase.MonsterAssetBundle.LoadAsset<TerminalKeyword>("Assets/CustomEnemies/" + text + KeywordName); val2.defaultVerb = TerminalPatch.InfoKeyword; } NetworkPrefabs.RegisterNetworkPrefab(val3.enemyPrefab); Enemies.RegisterEnemy(val3, rarity, (LevelTypes)1, SpawnType, val, val2); EnemyList?.Add(new SpawnableEnemyWithRarity { enemyType = val3, rarity = rarity }); Debug.Log((object)("Monster Loaded: " + EnemyName.Remove(EnemyName.Length - 6, 6))); } } internal class MoonPatch { public static string MoonFriendlyName; public static SelectableLevel MyNewMoon; public static Animator OoblFogAnimator; private static readonly AssetBundle LevelBundle = WTOBase.LevelAssetBundle; private static Object LevelPrefab = null; private static readonly string[] ObjectNamesToDestroy = new string[8] { "CompletedVowTerrain", "tree", "Tree", "Rock", "StaticLightingSky", "Sky and Fog Global Volume", "Local Volumetric Fog", "SunTexture" }; private static bool LevelLoaded; private static bool LevelStartHasBeenRun = false; private const string MoonPath = "Assets/CustomMoon/"; [HarmonyPatch(typeof(StartOfRound), "Awake")] [HarmonyPrefix] [HarmonyPriority(0)] private static void FuckThePlanet(StartOfRound __instance) { if (__instance.currentLevel.PlanetName != MoonFriendlyName) { DestroyOoblterraPrefab(); } } [HarmonyPatch(typeof(StartOfRound), "Awake")] [HarmonyPrefix] [HarmonyPriority(0)] private static void AddMoonToList(StartOfRound __instance) { LevelStartHasBeenRun = false; } [HarmonyPatch(typeof(StartOfRound), "SceneManager_OnLoadComplete1")] [HarmonyPostfix] private static void InitCustomLevel(StartOfRound __instance) { NetworkManager val = Object.FindObjectOfType<NetworkManager>(); if (val.IsHost && !GameNetworkManager.Instance.gameHasStarted) { return; } if (__instance.currentLevel.PlanetName != MoonFriendlyName) { DestroyOoblterraPrefab(); LevelStartHasBeenRun = false; return; } WTOBase.LogToConsole("Has level start been run? " + LevelStartHasBeenRun); if (!LevelStartHasBeenRun) { WTOBase.LogToConsole("Loading into level " + MoonFriendlyName); MoveNavNodesToNewPositions(); ManageFootsteps(); LevelStartHasBeenRun = true; } } [HarmonyPatch(typeof(StartOfRound), "ShipHasLeft")] [HarmonyPostfix] public static void DestroyLevel(StartOfRound __instance) { if (__instance.currentLevel.PlanetName == MoonFriendlyName) { DestroyOoblterraPrefab(); LevelStartHasBeenRun = false; } } [HarmonyPatch(typeof(TimeOfDay), "MoveGlobalTime")] [HarmonyPrefix] public static void ChangeGlobalTimeMultiplier(TimeOfDay __instance) { if (__instance.currentLevel.PlanetName == MoonFriendlyName) { __instance.globalTimeSpeedMultiplier = 0.7f; } else { __instance.globalTimeSpeedMultiplier = 1f; } } [HarmonyPatch(typeof(StartOfRound), "PassTimeToNextDay")] [HarmonyPrefix] public static bool SettleTimeIssue(StartOfRound __instance) { WTOBase.LogToConsole("BEGIN PRINT PRE BASE FUNCTION VALUES:"); Debug.Log((object)$"GLOBAL TIME AT END OF DAY: {TimeOfDay.Instance.globalTimeAtEndOfDay}"); Debug.Log((object)$"GLOBAL TIME: {TimeOfDay.Instance.globalTime}"); Debug.Log((object)$"TOTAL TIME: {TimeOfDay.Instance.totalTime}"); Debug.Log((object)$"TIME UNTIL DEADLINE: {TimeOfDay.Instance.timeUntilDeadline}"); Debug.Log((object)$"DAYS: {(int)Mathf.Floor(TimeOfDay.Instance.timeUntilDeadline / TimeOfDay.Instance.totalTime)}"); WTOBase.LogToConsole("END PRINT PRE BASE FUNCTION VALUES:"); if (__instance.currentLevel.PlanetName == MoonFriendlyName) { TimeOfDay instance = TimeOfDay.Instance; instance.globalTimeAtEndOfDay *= 0f; TimeOfDay instance2 = TimeOfDay.Instance; instance2.globalTime *= 0f; WTOBase.LogToConsole("BEGIN PRINT POST MODIFICATION VALUES:"); Debug.Log((object)$"GLOBAL TIME AT END OF DAY: {TimeOfDay.Instance.globalTimeAtEndOfDay}"); Debug.Log((object)$"GLOBAL TIME: {TimeOfDay.Instance.globalTime}"); Debug.Log((object)$"TOTAL TIME: {TimeOfDay.Instance.totalTime}"); Debug.Log((object)$"TIME UNTIL DEADLINE: {TimeOfDay.Instance.timeUntilDeadline}"); Debug.Log((object)$"DAYS: {(int)Mathf.Floor(TimeOfDay.Instance.timeUntilDeadline / TimeOfDay.Instance.totalTime)}"); WTOBase.LogToConsole("END PRINT POST MODIFICATION VALUES:"); return true; } return true; } [HarmonyPatch(typeof(StartOfRound), "PassTimeToNextDay")] [HarmonyPostfix] public static void SettleTimeIssue2(StartOfRound __instance) { WTOBase.LogToConsole("BEGIN PRINT POST BASE FUNCTION VALUES:"); Debug.Log((object)$"GLOBAL TIME AT END OF DAY: {TimeOfDay.Instance.globalTimeAtEndOfDay}"); Debug.Log((object)$"GLOBAL TIME: {TimeOfDay.Instance.globalTime}"); Debug.Log((object)$"TOTAL TIME: {TimeOfDay.Instance.totalTime}"); Debug.Log((object)$"TIME UNTIL DEADLINE: {TimeOfDay.Instance.timeUntilDeadline}"); Debug.Log((object)$"DAYS: {(int)Mathf.Floor(TimeOfDay.Instance.timeUntilDeadline / TimeOfDay.Instance.totalTime)}"); WTOBase.LogToConsole("END PRINT POST BASE FUNCTION VALUES:"); } [HarmonyPatch(typeof(TimeOfDay), "PlayTimeMusicDelayed")] [HarmonyPrefix] private static bool SkipTODMusic() { return false; } [HarmonyPatch(typeof(StartOfRound), "OnShipLandedMiscEvents")] [HarmonyPostfix] private static void SetFogTies(StartOfRound __instance) { if (!(__instance.currentLevel.PlanetName != MoonFriendlyName)) { OoblFogAnimator = GameObject.Find("OoblFog").gameObject.GetComponent<Animator>(); WTOBase.LogToConsole($"Fog animator found : {(Object)(object)OoblFogAnimator != (Object)null}"); if ((Object)(object)TimeOfDay.Instance.sunAnimator == (Object)(object)OoblFogAnimator) { WTOBase.LogToConsole("Sun Animator IS fog animator, supposedly"); return; } TimeOfDay.Instance.sunAnimator = OoblFogAnimator; WTOBase.LogToConsole($"Is Sun Animator Fog Animator? {(Object)(object)TimeOfDay.Instance.sunAnimator == (Object)(object)OoblFogAnimator}"); } } [HarmonyPatch(typeof(TimeOfDay), "SetInsideLightingDimness")] [HarmonyPrefix] private static void SpoofLightValues(TimeOfDay __instance) { if (!(__instance.currentLevel.PlanetName != MoonFriendlyName)) { Light component = GameObject.Find("ActualSun").GetComponent<Light>(); Light component2 = GameObject.Find("ActualIndirect").GetComponent<Light>(); TimeOfDay val = Object.FindObjectOfType<TimeOfDay>(); val.sunIndirect = component2; val.sunDirect = component; } } public static void Start() { MoonFriendlyName = "523 Ooblterra"; } private static void SetMoonVariables(SelectableLevel Moon, StartOfRound Instance) { } public static T[] ResizeArray<T>(T[] oldArray, int newSize) { T[] array = new T[newSize]; oldArray.CopyTo(array, 0); return array; } private static int AddToMoons(SelectableLevel Moon, StartOfRound Instance) { Instance.levels = ResizeArray(Instance.levels, Instance.levels.Length + 1); int num = -1; for (int i = 0; i < Instance.levels.Length; i++) { if ((Object)(object)Instance.levels[i] == (Object)null) { num = i; break; } } if (num == -1) { throw new NullReferenceException("No null value found in StartOfRound.levels"); } Instance.levels[num] = Moon; SelectableLevel[] levels = Instance.levels; foreach (SelectableLevel val in levels) { WTOBase.LogToConsole(((Object)val).name); } return num; } private static void DestroyOoblterraPrefab() { if (LevelLoaded) { Object.Destroy(LevelPrefab); } LevelLoaded = false; } private static void HandleInsideNavigation() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) UnityNavMeshAdapter val = Object.FindObjectOfType<UnityNavMeshAdapter>(); if ((Object)(object)val != (Object)null) { WTOBase.LogToConsole("Found Navmesh adapter! Setting bake mode to FullDungeonBake..."); } val.BakeMode = (RuntimeNavMeshBakeMode)3; val.AddNavMeshLinksBetweenRooms = true; } private static void MoveNavNodesToNewPositions() { //IL_00ba: Unknown result type (might be due to invalid IL or missing references) GameObject[] array = GameObject.FindGameObjectsWithTag("OutsideAINode"); List<GameObject> list = new List<GameObject>(); IEnumerable<GameObject> enumerable = from obj in Object.FindObjectsOfType<GameObject>() where ((Object)obj).name == "OoblOutsideNode" select obj; foreach (GameObject item in enumerable) { list.Add(item); } WTOBase.LogToConsole("Outside nav points: " + enumerable.Count()); for (int i = 0; i < array.Count(); i++) { if (list.Count() > i) { array[i].transform.position = list[i].transform.position; } else { Object.Destroy((Object)(object)array[i]); } } } private static void ManageFootsteps() { FootstepSurface[] footstepSurfaces = StartOfRound.Instance.footstepSurfaces; foreach (FootstepSurface val in footstepSurfaces) { if (val.surfaceTag == "Grass") { val.clips = (AudioClip[])(object)new AudioClip[5] { LevelBundle.LoadAsset<AudioClip>("Assets/CustomMoon/Sound/Footsteps/TENTACLESTEP01.wav"), LevelBundle.LoadAsset<AudioClip>("Assets/CustomMoon/Sound/Footsteps/TENTACLESTEP02.wav"), LevelBundle.LoadAsset<AudioClip>("Assets/CustomMoon/Sound/Footsteps/TENTACLESTEP03.wav"), LevelBundle.LoadAsset<AudioClip>("Assets/CustomMoon/Sound/Footsteps/TENTACLESTEP04.wav"), LevelBundle.LoadAsset<AudioClip>("Assets/CustomMoon/Sound/Footsteps/TENTACLESTEP05.wav") }; val.hitSurfaceSFX = LevelBundle.LoadAsset<AudioClip>("Assets/CustomMoon/Sound/Footsteps/TENTACLE_Fall.wav"); } } } private static void DestroyVowObjects() { IEnumerable<GameObject> enumerable = from obj in Object.FindObjectsOfType<GameObject>() where ObjectNamesToDestroy.Any(((Object)obj).name.Contains) select obj; foreach (GameObject item in enumerable) { Object.Destroy((Object)(object)item); } GameObject val = GameObject.Find("Models2VowFactory"); val.SetActive(false); } private static void MoveDoors() { //IL_0023: 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) GameObject val = GameObject.Find("EntranceTeleportA"); GameObject val2 = GameObject.Find("TeleportSnapLocation"); val.transform.position = val2.transform.position; GameObject val3 = GameObject.Find("EntranceTeleportB"); GameObject val4 = GameObject.Find("FireExitSnapLocation"); val3.transform.position = val4.transform.position; } } internal class SuitPatch { private const string SuitPath = "Assets/CustomSuits/"; private const string PosterGameObject = "HangarShip/Plane.001"; private static string[] SuitMaterialPaths = new string[7] { "Assets/CustomSuits/RedSuit.mat", "Assets/CustomSuits/ProtSuit.mat", "Assets/CustomSuits/YellowSuit.mat", "Assets/CustomSuits/GreenSuit.mat", "Assets/CustomSuits/BlueSuit.mat", "Assets/CustomSuits/IndigoSuit.mat", "Assets/CustomSuits/MackSuit.mat" }; private static bool SuitsLoaded = false; public static Material GhostPlayerSuit; [HarmonyPatch(typeof(StartOfRound), "SceneManager_OnLoadComplete1")] [HarmonyPrefix] private static void StartPatch(ref StartOfRound __instance) { //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Expected O, but got Unknown GhostPlayerSuit = WTOBase.ItemAssetBundle.LoadAsset<Material>("Assets/CustomSuits/GhostPlayerSuit.mat"); if (SuitsLoaded) { return; } for (int i = 0; i < __instance.unlockablesList.unlockables.Count; i++) { UnlockableItem val = __instance.unlockablesList.unlockables[i]; WTOBase.LogToConsole("Processing unlockable {index=" + i + ", name=" + val.unlockableName + "}"); if (!((Object)(object)val.suitMaterial == (Object)null) && val.alreadyUnlocked) { string[] suitMaterialPaths = SuitMaterialPaths; foreach (string text in suitMaterialPaths) { UnlockableItem val2 = JsonUtility.FromJson<UnlockableItem>(JsonUtility.ToJson((object)val)); UnlockableSuit val3 = new UnlockableSuit(); val2.suitMaterial = WTOBase.ItemAssetBundle.LoadAsset<Material>(text); string text2 = text.Substring(0, text.Length - 4); text2 = text2.Substring(19); val2.unlockableName = text2; __instance.unlockablesList.unlockables.Add(val2); } SuitsLoaded = true; break; } } } [HarmonyPatch(typeof(StartOfRound), "Start")] [HarmonyPatch(typeof(RoundManager), "GenerateNewLevelClientRpc")] [HarmonyPostfix] [HarmonyPriority(0)] private static void PatchPosters(StartOfRound __instance) { Material[] materials = ((Renderer)GameObject.Find("HangarShip/Plane.001").GetComponent<MeshRenderer>()).materials; materials[1] = WTOBase.ItemAssetBundle.LoadAsset<Material>("Assets/CustomSuits/Poster.mat"); ((Renderer)GameObject.Find("HangarShip/Plane.001").GetComponent<MeshRenderer>()).materials = materials; } } } namespace Welcome_To_Ooblterra.Security { internal class SpikeTrap : NetworkBehaviour { public GameObject SpikeMesh; public AudioClip SpikesExtend; public AudioClip SpikesRetract; public AudioClip SpikesDisable; public AudioSource SpikeSoundPlayer; public Transform RootRotation; private bool SpikesEnabled = true; private bool SpikesActivated; private bool AllowDamagePlayer; private float SecondsSinceSpikesActivated; private float SecondsUntilCanDamagePlayer; private int PlayerDamageAmount = 80; private float TimeElapsed; private const float MoveTime = 0.2f; private Vector3 SpikeRaisePos = new Vector3(0f, 1.163f, 0f); private Vector3 SpikeFallPos; public void OnTriggerEnter(Collider other) { if (SpikesEnabled && !SpikesActivated && ((Component)other).gameObject.CompareTag("Player")) { WTOBase.LogToConsole("Player entered spike trap, calling Raise RPC!"); RaiseSpikesServerRpc(); } } public void OnTriggerStay(Collider other) { //IL_005f: 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 (AllowDamagePlayer && ((Component)other).gameObject.CompareTag("Player") && SecondsUntilCanDamagePlayer <= 0f) { PlayerDamageAmount = ((StartOfRound.Instance.connectedPlayersAmount <= 0) ? 80 : 100); ((Component)other).GetComponent<PlayerControllerB>().DamagePlayer(PlayerDamageAmount, true, true, (CauseOfDeath)6, 0, false, default(Vector3)); SecondsUntilCanDamagePlayer = 0.75f; } } public void Update() { if (SecondsUntilCanDamagePlayer > 0f) { SecondsUntilCanDamagePlayer -= Time.deltaTime; } if (SecondsSinceSpikesActivated >= 3f) { if (SpikesActivated) { SpikeSoundPlayer.clip = SpikesRetract; SpikeSoundPlayer.Play(); TimeElapsed = 0f; } SpikesActivated = false; WTOBase.LogToConsole("Lowering Spikes!"); ((MonoBehaviour)this).StartCoroutine(LowerSpikes()); } if (SpikesEnabled && SpikesActivated) { WTOBase.LogToConsole("Raising Spikes!"); ((MonoBehaviour)this).StartCoroutine(RaiseSpikes()); SecondsSinceSpikesActivated += Time.deltaTime; } } private IEnumerator RaiseSpikes() { TimeElapsed += Time.deltaTime; SpikeMesh.transform.localPosition = Vector3.Lerp(SpikeFallPos, SpikeRaisePos, TimeElapsed / 0.2f); if (TimeElapsed / 0.2f >= 1f) { AllowDamagePlayer = true; WTOBase.LogToConsole("Finished Raising Spikes"); ((MonoBehaviour)this).StopCoroutine(RaiseSpikes()); } yield return null; } private IEnumerator LowerSpikes() { TimeElapsed += Time.deltaTime; WTOBase.LogToConsole($"Current Lerp Position: {TimeElapsed / 0.2f}"); SpikeMesh.transform.localPosition = Vector3.Lerp(SpikeRaisePos, SpikeFallPos, TimeElapsed / 0.2f); if (TimeElapsed / 0.2f >= 1f) { AllowDamagePlayer = false; WTOBase.LogToConsole("Finished Lowering Spikes"); ((MonoBehaviour)this).StopCoroutine(LowerSpikes()); SecondsSinceSpikesActivated = 0f; ((Renderer)SpikeMesh.GetComponent<MeshRenderer>()).enabled = false; } yield return null; } public void RecieveToggleSpikes(bool enabled) { WTOBase.LogToConsole($"Called toggle spikes with state: {enabled}"); ToggleSpikesServerRpc(enabled); ToggleSpikes(enabled); } [ServerRpc(RequireOwnership = false)] public void ToggleSpikesServerRpc(bool enabled) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1273677579u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref enabled, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1273677579u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { WTOBase.LogToConsole($"Toggling spikes to {enabled} serverRpc"); ToggleSpikesClientRpc(enabled); } } } [ClientRpc] public void ToggleSpikesClientRpc(bool enabled) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1768198554u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref enabled, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1768198554u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { WTOBase.LogToConsole($"Toggling spikes to {enabled} clientRpc"); if (SpikesEnabled != enabled) { ToggleSpikes(enabled); } } } private void ToggleSpikes(bool enabled) { if (!enabled) { SpikeSoundPlayer.clip = SpikesDisable; SpikeSoundPlayer.Play(); } SpikesEnabled = enabled; WTOBase.LogToConsole($"SPIKES STATE: {SpikesEnabled}"); if (SpikesActivated) { SecondsSinceSpikesActivated = 5f; } } [ServerRpc(RequireOwnership = false)] public void RaiseSpikesServerRpc() { //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 != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2638217131u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2638217131u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { RaiseSpikesClientRpc(); } } } [ClientRpc] public void RaiseSpikesClientRpc() { //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(3449189664u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3449189664u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { TimeElapsed = 0f; SpikeSoundPlayer.clip = SpikesExtend; SpikeSoundPlayer.Play(); ((Renderer)SpikeMesh.GetComponent<MeshRenderer>()).enabled = true; SpikesActivated = true; } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_SpikeTrap() { //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(1273677579u, new RpcReceiveHandler(__rpc_handler_1273677579)); NetworkManager.__rpc_func_table.Add(1768198554u, new RpcReceiveHandler(__rpc_handler_1768198554)); NetworkManager.__rpc_func_table.Add(2638217131u, new RpcReceiveHandler(__rpc_handler_2638217131)); NetworkManager.__rpc_func_table.Add(3449189664u, new RpcReceiveHandler(__rpc_handler_3449189664)); } private static void __rpc_handler_1273677579(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool enabled = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref enabled, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((SpikeTrap)(object)target).ToggleSpikesServerRpc(enabled); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1768198554(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool enabled = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref enabled, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)2; ((SpikeTrap)(object)target).ToggleSpikesClientRpc(enabled); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2638217131(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; ((SpikeTrap)(object)target).RaiseSpikesServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3449189664(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; ((SpikeTrap)(object)target).RaiseSpikesClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "SpikeTrap"; } } } namespace Welcome_To_Ooblterra.RoomBehaviors { public class FrankensteinVisuals : MonoBehaviour { [InspectorName("SceneAnim")] public AudioClip ReviveSound; public AudioSource ReviveSoundPlayer; public Animator CoilAnim; public ParticleSystem[] LightningParticles; public LightComponent[] Lights; private bool ShouldAnimate; private bool AnimStarted; private bool AnimStopped; private Random MyRandom; private void Start() { MyRandom = new Random(StartOfRound.Instance.randomMapSeed); } private void Update() { if (ShouldAnimate) { ((MonoBehaviour)this).StartCoroutine(VisualsHandler()); } } public void StartVisuals() { WTOBase.LogToConsole("Visuals script starting coroutine ..."); ShouldAnimate = true; } private IEnumerator VisualsHandler() { if (!AnimStarted) { ReviveSoundPlayer.clip = ReviveSound; ReviveSoundPlayer.Play(); CoilAnim.SetTrigger("HeatCoils"); ParticleSystem[] lightningParticles = LightningParticles; foreach (ParticleSystem LightningBolt2 in lightningParticles) { LightningBolt2.Play(); } AnimStarted = true; } if (!AnimStopped) { LightComponent[] lights = Lights; foreach (LightComponent Light2 in lights) { Light2.SetLightBrightness((MyRandom.Next(0, 10) % 2 == 0) ? 200 : 0); } } yield return (object)new WaitForSeconds(3.4f); if (!AnimStopped) { ParticleSystem[] lightningParticles2 = LightningParticles; foreach (ParticleSystem LightningBolt in lightningParticles2) { LightningBolt.Stop(); } LightComponent[] lights2 = Lights; foreach (LightComponent Light in lights2) { Light.SetLightBrightness(0); } AnimStopped = true; } } } } namespace Welcome_To_Ooblterra.Things { public class BabyLurkerEgg : NetworkBehaviour { private Random enemyRandom; private int TimeUntilBabySpawns; private int TimeInRange; public bool BabySpawned; private void Start() { enemyRandom = new Random(StartOfRound.Instance.randomMapSeed); TimeUntilBabySpawns = enemyRandom.Next(180, 1200); } private void OnTriggerStay(Collider other) { if (!BabySpawned) { if (TimeInRange > TimeUntilBabySpawns) { SpawnBabyLurker(); } TimeInRange++; } } private void SpawnBabyLurker() { BabySpawned = true; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected internal override string __getTypeName() { return "BabyLurkerEgg"; } } public class BatteryRecepticle : NetworkBehaviour { [InspectorName("Defaults")] public NetworkObject parentTo; public InteractTrigger triggerScript; public Transform BatteryTransform; public BoxCollider BatteryHitbox; private WTOBattery InsertedBattery; private bool RecepticleHasBattery; public Animator MachineAnimator; public AudioSource Noisemaker; public AudioClip FacilityPowerUp; public AudioSource Pistons; public AudioSource MachineAmbience; public MeshRenderer[] WallLights; public Material WallLightMat; public Color LightColor; public Light CenterLight; private ScrapShelf scrapShelf; public GameObject BatteryPrefab; public Material FrontConsoleMaterial; public Material SideConsoleMaterial; public MeshRenderer MachineMesh; public void Start() { scrapShelf = Object.FindFirstObjectByType<ScrapShelf>(); WTOBattery[] source = Object.FindObjectsOfType<WTOBattery>(); InsertedBattery = source.First((WTOBattery x) => !x.HasCharge); RecepticleHasBattery = true; CenterLight.intensity = 0f; MeshRenderer[] wallLights = WallLights; foreach (MeshRenderer val in wallLights) { ((Renderer)val).sharedMaterial = WallLightMat; } SpawnBatteryAtFurthestPoint(); } private void Update() { //IL_0037: 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; } WallLightMat.SetColor("_EmissiveColor", LightColor); if (RecepticleHasBattery) { ((Collider)BatteryHitbox).enabled = false; triggerScript.interactable = false; triggerScript.disabledHoverTip = ""; if ((Object)(object)InsertedBattery != (Object)null && ((GrabbableObject)InsertedBattery).isHeld) { InsertedBattery = null; RecepticleHasBattery = false; } } else { ((Collider)BatteryHitbox).enabled = true; ((Behaviour)triggerScript).enabled = true; if (GameNetworkManager.Instance.localPlayerController.currentlyHeldObjectServer is WTOBattery) { triggerScript.interactable = true; triggerScript.hoverTip = "Insert Battery : [E]"; } else { triggerScript.interactable = false; triggerScript.disabledHoverTip = "[Requires Battery]"; } } } private void SpawnBatteryAtFurthestPoint() { //IL_005c: 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_00a6: 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_00b2: 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) if (!((NetworkBehaviour)this).IsServer) { return; } List<RandomMapObject> list = new List<RandomMapObject>(); list.AddRange(Object.FindObjectsOfType<RandomMapObject>()); float num = 0f; RandomMapObject val = null; foreach (RandomMapObject item in list.Where((RandomMapObject x) => x.spawnablePrefabs.Contains(BatteryPrefab))) { float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)item).transform.position); if (num2 > num) { val = item; num = num2; } } Vector3 position = ((Component)val).transform.position; GameObject val2 = Object.Instantiate<GameObject>(BatteryPrefab, position, ((Component)val).transform.rotation, RoundManager.Instance.mapPropsContainer.transform); val2.GetComponent<NetworkObject>().Spawn(true); } public void TryInsertOrRemoveBattery(PlayerControllerB playerWhoTriggered) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_00c3: 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_009c: 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_0101: Unknown result type (might be due to invalid IL or missing references) if (RecepticleHasBattery && !InsertedBattery.HasCharge) { playerWhoTriggered.GrabObjectServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)InsertedBattery).NetworkObject)); RecepticleHasBattery = false; } else if (playerWhoTriggered.isHoldingObject && (Object)(object)playerWhoTriggered.currentlyHeldObjectServer != (Object)null) { Debug.Log((object)"Placing battery in recepticle"); Vector3 val = BatteryTransform.position; if ((Object)(object)parentTo != (Object)null) { val = ((Component)parentTo).transform.InverseTransformPoint(val); } InsertedBattery = (WTOBattery)(object)playerWhoTriggered.currentlyHeldObjectServer; RecepticleHasBattery = true; playerWhoTriggered.DiscardHeldObject(true, parentTo, val, true); WTOBattery wTOBattery = Object.FindObjectsOfType<WTOBattery>().First((WTOBattery x) => x.HasCharge); ((Component)wTOBattery).transform.rotation = BatteryTransform.rotation; InsertBatteryServerRpc(); Debug.Log((object)"discard held object called from placeobject"); if (InsertedBattery.HasCharge) { ((GrabbableObject)InsertedBattery).grabbable = false; TurnOnPowerServerRpc(); } } } [ServerRpc(RequireOwnership = false)] public void InsertBatteryServerRpc() { //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 != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3823732320u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3823732320u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { InsertBatteryClientRpc(); } } } [ClientRpc] public void InsertBatteryClientRpc() { //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(346882053u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 346882053u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { InsertBattery(); } } } public void InsertBattery() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) WTOBattery wTOBattery = Object.FindObjectsOfType<WTOBattery>().First((WTOBattery x) => x.HasCharge); ((Component)wTOBattery).transform.rotation = BatteryTransform.rotation; } [ServerRpc(RequireOwnership = false)] public void TurnOnPowerServerRpc() { //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 != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3606445563u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3606445563u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { TurnOnPowerClientRpc(); } } } [ClientRpc] public void TurnOnPowerClientRpc() { //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(195750096u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 195750096u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { TurnOnPower(); } } } public void TurnOnPower() { Noisemaker.PlayOneShot(FacilityPowerUp); scrapShelf.OpenShelf(); MachineAmbience.Play(); Pistons.Play(); LightComponent[] array = Object.FindObjectsOfType<LightComponent>(); LightComponent[] array2 = array; foreach (LightComponent lightComponent in array2) { lightComponent.SetLightColor(); lightComponent.SetLightBrightness(150); } Material[] materials = ((Renderer)MachineMesh).materials; materials[2] = SideConsoleMaterial; materials[11] = FrontConsoleMaterial; ((Renderer)MachineMesh).materials = materials; MachineAnimator.SetTrigger("PowerOn"); StartRoomLight startRoomLight = Object.FindObjectOfType<StartRoomLight>(); startRoomLight.SetCentralRoomWhite(); WTOBattery wTOBattery = Object.FindObjectsOfType<WTOBattery>().First((WTOBattery x) => x.HasCharge); ((GrabbableObject)wTOBattery).grabbable = false; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_BatteryRecepticle() { //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(3823732320u, new RpcReceiveHandler(__rpc_handler_3823732320)); NetworkManager.__rpc_func_table.Add(346882053u, new RpcReceiveHandler(__rpc_handler_346882053)); NetworkManager.__rpc_func_table.Add(3606445563u, new RpcReceiveHandler(__rpc_handler_3606445563)); NetworkManager.__rpc_func_table.Add(195750096u, new RpcReceiveHandler(__rpc_handler_195750096)); } private static void __rpc_handler_3823732320(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; ((BatteryRecepticle)(object)target).InsertBatteryServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_346882053(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; ((BatteryRecepticle)(object)target).InsertBatteryClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3606445563(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; ((BatteryRecepticle)(object)target).TurnOnPowerServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_195750096(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; ((BatteryRecepticle)(object)target).TurnOnPowerClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "BatteryRecepticle"; } } public class ScrapShelf : NetworkBehaviour { public Transform[] ScrapSpawnPoints; public Animator ShelfOpener; public AudioSource ShelfSFX; private Random ShelfRandom; public void Start() { //IL_0076: 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_0106: Unknown result type (might be due to invalid IL or missing references) List<SpawnableItemWithRarity> spawnableScrap = StartOfRound.Instance.currentLevel.spawnableScrap; ShelfRandom = new Random(StartOfRound.Instance.randomMapSeed); Transform[] scrapSpawnPoints = ScrapSpawnPoints; foreach (Transform val in scrapSpawnPoints) { if (((NetworkBehaviour)this).IsServer) { SpawnableItemWithRarity val2 = spawnableScrap[ShelfRandom.Next(0, spawnableScrap.Count)]; GameObject val3 = Object.Instantiate<GameObject>(val2.spawnableItem.spawnPrefab, ((Component)val).transform.position, ((Component)val).transform.rotation, RoundManager.Instance.mapPropsContainer.transform); GrabbableObject component = val3.GetComponent<GrabbableObject>(); int num = ShelfRandom.Next(component.itemProperties.minValue, component.itemProperties.maxValue); num = (int)Math.Round((double)num * 0.4); NetworkObject component2 = val3.GetComponent<NetworkObject>(); component2.Spawn(true); RoundManager.Instance.spawnedSyncedObjects.Add(val3); SetScrapValueServerRpc(NetworkObjectReference.op_Implicit(component2), num); } } } public void OpenShelf() { ShelfOpener.SetTrigger("Open"); ShelfSFX.Play(); } [ServerRpc] public void SetScrapValueServerRpc(NetworkObjectReference ScrapToSet, int ScrapValue) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Invalid comparison between Unknown and I4 //IL_012b: 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_00c3: 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_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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(1191894747u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref ScrapToSet, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, ScrapValue); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1191894747u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { SetScrapValueClientRpc(ScrapToSet, ScrapValue); } } [ClientRpc] public void SetScrapValueClientRpc(NetworkObjectReference ScrapToSet, int ScrapValue) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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_00a4: 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(3927799021u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref ScrapToSet, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, ScrapValue); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3927799021u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { NetworkObject val3 = default(NetworkObject); ((NetworkObjectReference)(ref ScrapToSet)).TryGet(ref val3, (NetworkManager)null); GrabbableObject component = ((Component)val3).GetComponent<GrabbableObject>(); if ((Object)(object)component != (Object)null) { component.SetScrapValue(ScrapValue); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_ScrapShelf() { //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(1191894747u, new RpcReceiveHandler(__rpc_handler_1191894747)); NetworkManager.__rpc_func_table.Add(3927799021u, new RpcReceiveHandler(__rpc_handler_3927799021)); } private static void __rpc_handler_1191894747(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_007c: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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_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 { NetworkObjectReference scrapToSet = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref scrapToSet, default(ForNetworkSerializable)); int scrapValue = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref scrapValue); target.__rpc_exec_stage = (__RpcExecStage)1; ((ScrapShelf)(object)target).SetScrapValueServerRpc(scrapToSet, scrapValue); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3927799021(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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference scrapToSet = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref scrapToSet, default(ForNetworkSerializable)); int scrapValue = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref scrapValue); target.__rpc_exec_stage = (__RpcExecStage)2; ((ScrapShelf)(object)target).SetScrapValueClientRpc(scrapToSet, scrapValue); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "ScrapShelf"; } } public class AcidWater : MonoBehaviour { public int DamageAmount; private float TimeSincePlayerDamaged = 0f; private void OnTriggerStay(Collider other) { //IL_0073: 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) PlayerControllerB component = ((Component)other).gameObject.GetComponent<PlayerControllerB>(); if (((Component)other).gameObject.CompareTag("Player")) { if (TimeSincePlayerDamaged < 0.5f) { TimeSincePlayerDamaged += Time.deltaTime; } else if ((Object)(object)component != (Object)null) { TimeSincePlayerDamaged = 0f; component.DamagePlayer(DamageAmount, true, true, (CauseOfDeath)9, 0, false, default(Vector3)); WTOBase.LogToConsole("New health amount: " + component.health); } } } } public class EyeSecLaser : MonoBehaviour { public Transform StartPoint; public Transform EndPoint; public LineRenderer Laser; private float timeElapsed; private float LerpDuration = 8f; private Color myColor; public bool IsActive; private void Start() { if ((Object)(object)Laser == (Object)null) { Laser = ((Component)this).GetComponent<LineRenderer>(); } ((Renderer)Laser).enabled = false; Laser.startWidth = 0.5f; Laser.endWidth = 0.5f; } private void Update() { //IL_000e: 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_00af: 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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) Laser.SetPosition(0, StartPoint.position); Laser.SetPosition(1, EndPoint.position); if (timeElapsed < LerpDuration) { myColor = Color.Lerp(Color.green, Color.red, timeElapsed / LerpDuration); Laser.startColor = myColor; Laser.endColor = myColor; timeElapsed += Time.deltaTime; } else { timeElapsed = 0f; Laser.startColor = Color.red; Laser.endColor = Color.red; } } public void SetLaserEnabled(bool NewEnabled, float LaserSpeed) { //IL_001d: 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) ((Renderer)Laser).enabled = NewEnabled; if (!NewEnabled) { Laser.startColor = Color.green; Laser.endColor = Color.green; timeElapsed = 0f; } else { timeElapsed = 0f; LerpDuration = LaserSpeed + 1f; } } } public class FrankensteinChemPoint : NetworkBehaviour { [InspectorName("Defaults")] public NetworkObject parentTo; public Collider placeableBounds; public InteractTrigger triggerScript; private int HeldChemicalColorIndex; private Chemical HeldChemical; public bool hasChemical { get; private set; } private void Update() { if (!((Object)(object)GameNetworkManager.Instance == (Object)null) && !((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null)) { if ((Object)(object)HeldChemical != (Object)null && hasChemical && ((GrabbableObject)HeldChemical).isHeld) { HeldChemical = null; SetChemStateServerRpc(NewState: false, -1); } else if (hasChemical) { triggerScript.interactable = false; triggerScript.disabledHoverTip = "[Chemical Placed]"; } else { triggerScript.interactable = GameNetworkManager.Instance.localPlayerController.currentlyHeldObjectServer is Chemical; triggerScript.disabledHoverTip = "[No Chemicals in Hand]"; } } } public Chemical.ChemColor GetCurrentChemicalColor() { return (Chemical.ChemColor)HeldChemicalColorIndex; } public void ClearChemical() { HeldChemical.EmptyBeaker(); } public void PlaceObject(PlayerControllerB playerWhoTriggered) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_0097: 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_0077: 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) if (!playerWhoTriggered.isHoldingObject || !((Object)(object)playerWhoTriggered.currentlyHeldObjectServer != (Object)null)) { return; } Debug.Log((object)"Placing object in storage"); Vector3 val = itemPlacementPosition(((Component)playerWhoTriggered.gameplayCamera).transform, playerWhoTriggered.currentlyHeldObjectServer); if (!(val == Vector3.zero)) { if ((Object)(object)parentTo != (Object)null) { val = ((Component)parentTo).transform.InverseTransformPoint(val); } HeldChemical = (Chemical)(object)playerWhoTriggered.currentlyHeldObjectServer; playerWhoTriggered.DiscardHeldObject(true, parentTo, val, false); Debug.Log((object)"discard held object called from placeobject"); SetChemStateServerRpc(NewState: true, (int)HeldChemical.GetCurrentColor()); } } private Vector3 itemPlacementPosition(Transform gameplayCamera, GrabbableObject heldObject) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_0031: 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) //IL_0085: 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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_0070: 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_008d: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (!Physics.Raycast(gameplayCamera.position, gameplayCamera.forward, ref val, 7f, StartOfRound.Instance.collidersAndRoomMask, (QueryTriggerInteraction)1)) { return Vector3.zero; } Bounds bounds = placeableBounds.bounds; if (((Bounds)(ref bounds)).Contains(((RaycastHit)(ref val)).point)) { return ((RaycastHit)(ref val)).point + Vector3.up * heldObject.itemProperties.verticalOffset; } return placeableBounds.ClosestPoint(((RaycastHit)(ref val)).point); } [ServerRpc(RequireOwnership = false)] private void SetChemStateServerRpc(bool NewState, int NextChemIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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_00a4: 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 != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2999327842u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref NewState, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, NextChemIndex); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2999327842u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { SetChemStateClientRpc(NewState, NextChemIndex); } } } [ClientRpc] private void SetChemStateClientRpc(bool NewState, int NextChemIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: 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_00a4: 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(3339412649u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref NewState, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, NextChemIndex); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3339412649u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { SetChemState(NewState, NextChemIndex); } } } private void SetChemState(bool NewState, int NextChemIndex) { hasChemical = NewState; HeldChemicalColorIndex = NextChemIndex; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_FrankensteinChemPoint() { //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(2999327842u, new RpcReceiveHandler(__rpc_handler_2999327842)); NetworkManager.__rpc_func_table.Add(3339412649u, new RpcReceiveHandler(__rpc_handler_3339412649)); } private static void __rpc_handler_2999327842(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_0051: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool newState = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref newState, default(ForPrimitives)); int nextChemIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref nextChemIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((FrankensteinChemPoint)(object)target).SetChemStateServerRpc(newState, nextChemIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3339412649(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_0051: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool newState = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref newState, default(ForPrimitives)); int nextChemIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref nextChemIndex); target.__rpc_exec_stage = (__RpcExecStage)2; ((FrankensteinChemPoint)(object)target).SetChemStateClientRpc(newState, nextChemIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "FrankensteinChemPoint"; } } internal class KitchenCrusher : MonoBehaviour { public Vector3 CrusherStartPos; public Vector3 CrusherEndPos; public AudioSource CrusherSound; public AudioClip SoundToPlay; public GameObject Crusher; private PlayerControllerB victim; private Random CrusherRandom; private bool ActivateCrusher; private bool RetractCrusher; private float LerpDuration = 0.3f; private float timeElapsed; private void OnTriggerEnter(Collider other) { if (((Component)other).gameObject.CompareTag("Player")) { victim = ((Component)other).gameObj