using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using GoodItemScan; using HarmonyLib; using LethalLevelLoader; using LethalLib.Modules; using LethalModDataLib.Attributes; using LethalModDataLib.Features; using LobbyCompatibility.Enums; using LobbyCompatibility.Features; using Microsoft.CodeAnalysis; using ScienceBird.Wither.NetcodePatcher; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; using UnityEngine.Rendering.HighDefinition; using UnityEngine.UI; using WeatherRegistry; using Wither.Events; using Wither.Inside; using Wither.Mechanics; using Wither.Patches; using Wither.Scripts; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("ScienceBird.Wither")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("2.0.3.0")] [assembly: AssemblyInformationalVersion("2.0.3+1e0e145e4013fc319e9c8e9ce0ee3203dd32e069")] [assembly: AssemblyProduct("Wither")] [assembly: AssemblyTitle("ScienceBird.Wither")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.0.3.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Wither { public class LobbyCompatibility { public static void RegisterCompatibility() { PluginHelper.RegisterPlugin("ScienceBird.Wither", Version.Parse("2.0.3"), (CompatibilityLevel)2, (VersionStrictness)0); } } public class NetworkHandler : NetworkBehaviour { public static NetworkHandler Instance { get; private set; } public static event Action LevelEvent; public override void OnNetworkSpawn() { NetworkHandler.LevelEvent = null; if ((NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer) && (Object)(object)Instance != (Object)null) { GameObject gameObject = ((Component)Instance).gameObject; if (gameObject != null) { NetworkObject component = gameObject.GetComponent(); if (component != null) { component.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_00ff: 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 != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1849323834u, val, (RpcDelivery)0); bool flag = eventName != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(eventName, false); } ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1849323834u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkHandler.LevelEvent?.Invoke(eventName); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1849323834u, new RpcReceiveHandler(__rpc_handler_1849323834), "EventClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1849323834(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(ref flag, default(ForPrimitives)); string eventName = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref eventName, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((NetworkHandler)(object)target).EventClientRpc(eventName); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "NetworkHandler"; } } [HarmonyPatch] public class NetworkObjectManager { private static GameObject networkPrefab; [HarmonyPostfix] [HarmonyPatch(typeof(GameNetworkManager), "Start")] public static void Init() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown if (!((Object)(object)networkPrefab != (Object)null)) { networkPrefab = (GameObject)Wither.ExtraAssets.LoadAsset("WitherNetworkHandler"); networkPrefab.AddComponent(); NetworkManager.Singleton.AddNetworkPrefab(networkPrefab); } } [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "Awake")] private static void SpawnNetworkHandler() { //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) if (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer) { GameObject val = Object.Instantiate(networkPrefab, Vector3.zero, Quaternion.identity); val.GetComponent().Spawn(false); } } } [BepInPlugin("ScienceBird.Wither", "Wither", "2.0.3")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Wither : BaseUnityPlugin { public static AssetBundle ExtraAssets; public static ConfigEntry VanillaPlusMode; public static ConfigEntry DyingApparatusOnly; public static ConfigEntry QuotaFraction; public static ConfigEntry MinValue; public static ConfigEntry MaxValue; public static ConfigEntry ScaleWithApparatus; public static ConfigEntry ScalingBase; public static ConfigEntry ExtraMultiplier; public static ConfigEntry MysteriousScrap; public static ConfigEntry MysteriousScrapRarity; public static ConfigEntry MaxCatwalkTriggers; public static ConfigEntry GarageStartOpen; public static bool doLobbyCompat; public static bool mrovWeatherPresent; public static bool mrovTerminalPresent; public static bool testPresent; public static bool evaisaPresent; public static bool zaggyPresent; public static Wither Instance { get; private set; } internal static ManualLogSource Logger { get; private set; } internal static Harmony? Harmony { get; set; } private void Awake() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Expected O, but got Unknown //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Expected O, but got Unknown //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Expected O, but got Unknown Logger = ((BaseUnityPlugin)this).Logger; Instance = this; VanillaPlusMode = ((BaseUnityPlugin)this).Config.Bind("Event", "Vanilla Plus Mode", false, "Removes everything from the map related to the special event (dying apparatus is not removed)."); QuotaFraction = ((BaseUnityPlugin)this).Config.Bind("Event", "Quota Fraction", 0.3f, new ConfigDescription("The fraction of the quota that the average total reward value should be (the average value of all 3 items combined). Ex. 0.3 means 30% of the quota, so if your quota is 1000 the total value will add up to 300 (which is 30% of 1000). This means each individual scrap would be worth 100.", (AcceptableValueBase)(object)new AcceptableValueRange(0.05f, 3f), Array.Empty())); MinValue = ((BaseUnityPlugin)this).Config.Bind("Event", "Minimum Individual Value", 50, new ConfigDescription("The minimum value an individual scrap will be worth (no other variance or modifiers will bring it below this value). Ex. at 50 the minimum for all items combined is 150.", (AcceptableValueBase)(object)new AcceptableValueRange(10, 1000), Array.Empty())); MaxValue = ((BaseUnityPlugin)this).Config.Bind("Event", "Maximum Individual Value", 600, new ConfigDescription("The maximum value an individual scrap will be worth (no other variance or modifiers will bring it above this value). Ex. at 600 the maximum for all items combined is 1800", (AcceptableValueBase)(object)new AcceptableValueRange(100, 5000), Array.Empty())); ScaleWithApparatus = ((BaseUnityPlugin)this).Config.Bind("Event", "Scale With Apparatus", true, "Scale the value of the reward items based on the apparatus inserted."); ScalingBase = ((BaseUnityPlugin)this).Config.Bind("Event", "Scaling Base", 50, new ConfigDescription("If 'Scale With Apparatus' is enabled, this is the 'neutral' value. So, value calculations are unchanged if the apparatus is worth exactly this much (if it's worth more, value is adjusted by how many times bigger it is, vice versa for smaller).", (AcceptableValueBase)(object)new AcceptableValueRange(1, 200), Array.Empty())); ExtraMultiplier = ((BaseUnityPlugin)this).Config.Bind("Event", "4th Item Multiplier", 2.5f, new ConfigDescription("The scaling factor applied exclusively to the value of the 4th harder to reach item. It otherwise has the same base value calculations and variations as the other items, but is ignored for the quota fraction (quota fraction still acts as if there are only 3 items).", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 5f), Array.Empty())); DyingApparatusOnly = ((BaseUnityPlugin)this).Config.Bind("Event", "Dying Apparatus Only", false, "Only allow the secret dying apparatus to be inserted."); MysteriousScrap = ((BaseUnityPlugin)this).Config.Bind("Mysterious Scrap", "Spawn Mysterious Scrap", false, "A strange new object appears on Wither (silly joke item not intended for serious play, no need to enable unless you're curious)."); MysteriousScrapRarity = ((BaseUnityPlugin)this).Config.Bind("Mysterious Scrap", "Mysterious Scrap Rarity", 20, new ConfigDescription("Rarity for an average scrap item is ~30 (will only ever spawn on Wither under normal circumstances).", (AcceptableValueBase)(object)new AcceptableValueRange(1, 250), Array.Empty())); MaxCatwalkTriggers = ((BaseUnityPlugin)this).Config.Bind("Other Map Features", "Max Catwalk Triggers", 4, "Maximum amount of times the fragile catwalk can potentially be walked on before it breaks (will vary randomly between 2 and this number)"); GarageStartOpen = ((BaseUnityPlugin)this).Config.Bind("Other Map Features", "Garage Door Starts Open", false, "If enabled, the garage door in the desert area of the map will start open (instead of needing to be opened from the other side)."); Patch(); ModDataHandler.RegisterInstance((object)typeof(TerminalEntryPatches), (string)null); Logger.LogInfo((object)"ScienceBird.Wither v2.0.3 has loaded!"); string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); ExtraAssets = AssetBundle.LoadFromFile(Path.Combine(directoryName, "extrawitherassets")); if (!((Object)(object)ExtraAssets == (Object)null)) { FootstepsPatch.LoadAssets(); GreenDogPatch.LoadAssets(); TerminalEntryPatches.LoadAssets(); NetcodePatcher(); } } internal static void Patch() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown if (Harmony == null) { Harmony = new Harmony("ScienceBird.Wither"); } bool flag = Chainloader.PluginInfos.ContainsKey("BMX.LobbyCompatibility"); evaisaPresent = Chainloader.PluginInfos.ContainsKey("LethalLib"); mrovWeatherPresent = Chainloader.PluginInfos.ContainsKey("mrov.WeatherRegistry"); mrovTerminalPresent = Chainloader.PluginInfos.ContainsKey("TerminalFormatter"); testPresent = Chainloader.PluginInfos.ContainsKey("TestAccount666.GoodItemScan"); zaggyPresent = Chainloader.PluginInfos.ContainsKey("Zaggy1024.TwoRadarMaps"); if (flag) { LobbyCompatibility.RegisterCompatibility(); } Logger.LogDebug((object)"Patching..."); Harmony.PatchAll(); if (testPresent) { GoodItemScanPatch.DoPatching(); } Logger.LogDebug((object)"Finished patching!"); } internal static void Unpatch() { Logger.LogDebug((object)"Unpatching..."); Harmony? harmony = Harmony; if (harmony != null) { harmony.UnpatchSelf(); } Logger.LogDebug((object)"Finished unpatching!"); } private static void NetcodePatcher() { 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 class MyPluginInfo { public const string PLUGIN_GUID = "ScienceBird.Wither"; public const string PLUGIN_NAME = "Wither"; public const string PLUGIN_VERSION = "2.0.3"; } } namespace Wither.Scripts { public class DataSync : NetworkBehaviour { public static DataSync Instance { get; private set; } private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; return; } Object.Destroy((Object)(object)((Component)Instance).gameObject); Instance = this; } [ClientRpc] public void UpdateTerminalPatchClientRpc(bool unlocked, bool unread) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_0098: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2318981889u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref unlocked, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref unread, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2318981889u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { TerminalEntryPatches.unlocked = unlocked; TerminalEntryPatches.unread = unread; } } } [ClientRpc] public void SetVanillaPlusModeClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1414889917u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1414889917u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { ScenePatches.DisableEventObjects(); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2318981889u, new RpcReceiveHandler(__rpc_handler_2318981889), "UpdateTerminalPatchClientRpc"); ((NetworkBehaviour)this).__registerRpc(1414889917u, new RpcReceiveHandler(__rpc_handler_1414889917), "SetVanillaPlusModeClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2318981889(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_004a: 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) //IL_005f: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool unlocked = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref unlocked, default(ForPrimitives)); bool unread = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref unread, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((DataSync)(object)target).UpdateTerminalPatchClientRpc(unlocked, unread); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1414889917(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; ((DataSync)(object)target).SetVanillaPlusModeClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "DataSync"; } } public class LethalLibApparatusCheck { public static void AddApparatuses() { foreach (ScrapItem scrapItem in Items.scrapItems) { if (InsertApparatus.IsApparatus(scrapItem.item.itemName)) { ModdedApparatusConfig.apparatusDict.TryAdd(scrapItem.item, (ModdedApparatusConfig.FilterSpecialCharacters(scrapItem.modName), ModdedApparatusConfig.FilterSpecialCharacters(scrapItem.item.itemName))); } } } } public class MrovBlackoutCheck : NetworkBehaviour { public static string CheckCurrentWeather() { Weather currentWeather = WeatherManager.GetCurrentWeather(StartOfRound.Instance.currentLevel); if (currentWeather != null) { return currentWeather.Name; } return ""; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "MrovBlackoutCheck"; } } public class MysteriousScrap : NetworkBehaviour { private void OnEnable() { SetRarity(); } public void SetRarity() { if ((Object)(object)RoundManager.Instance.currentLevel != (Object)null) { int num = 0; for (int i = 0; i < RoundManager.Instance.currentLevel.spawnableScrap.Count; i++) { if (RoundManager.Instance.currentLevel.spawnableScrap[i].spawnableItem.itemName == "Ricardorb") { num = i; break; } } Wither.Logger.LogDebug((object)$"Setting spawning to {Wither.MysteriousScrap.Value} for strange scrap (rarity {Wither.MysteriousScrapRarity.Value}, index {num})."); if (Wither.MysteriousScrap.Value) { RoundManager.Instance.currentLevel.spawnableScrap[num].rarity = Wither.MysteriousScrapRarity.Value; } else { RoundManager.Instance.currentLevel.spawnableScrap[num].rarity = 0; } } else { Wither.Logger.LogWarning((object)"No selectable level found, skipping scrap config check."); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "MysteriousScrap"; } } } namespace Wither.Patches { [HarmonyPatch] public class ApparatusRotationPatch { public static bool initialSet = true; public static Vector3 rotLastFrame = Vector3.zero; public static Vector3 targetRotation; public static Vector3 targetPosition; public static Vector3 positionOffset; public static bool posSet = true; private static bool tempInitial = true; [HarmonyPatch(typeof(GrabbableObject), "LateUpdate")] [HarmonyPostfix] [HarmonyAfter(new string[] { "me.loaforc.facilitymeltdown" })] private static void UpdateRotation(GrabbableObject __instance) { //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020e: 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_0088: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) if ((!InsertApparatus.doingInsertion && !InsertApparatus.isInserted) || !((Object)(object)__instance == (Object)(object)InsertApparatus.insertedApparatus)) { return; } __instance.grabbable = false; if (initialSet) { if (ModdedApparatusConfig.configDict.TryGetValue(__instance.itemProperties, out (ConfigEntry, ConfigEntry) value)) { string[] array = value.Item1.Value.Split(","); string[] array2 = value.Item2.Value.Split(","); Vector3 zero = Vector3.zero; if (array.Length == 3 && float.TryParse(array[0], NumberStyles.Float, CultureInfo.InvariantCulture, out var result) && float.TryParse(array[1], NumberStyles.Float, CultureInfo.InvariantCulture, out var result2) && float.TryParse(array[2], NumberStyles.Float, CultureInfo.InvariantCulture, out var result3)) { ((Vector3)(ref zero))..ctor(result, result2, result3); } Vector3 zero2 = Vector3.zero; if (array2.Length == 3 && float.TryParse(array2[0], NumberStyles.Float, CultureInfo.InvariantCulture, out var result4) && float.TryParse(array2[1], NumberStyles.Float, CultureInfo.InvariantCulture, out var result5) && float.TryParse(array2[2], NumberStyles.Float, CultureInfo.InvariantCulture, out var result6)) { ((Vector3)(ref zero2))..ctor(result4, result5, result6); } targetRotation = zero + new Vector3(0f, 193f, 0f); Wither.Logger.LogDebug((object)$"Setting target to: {targetRotation}"); positionOffset = zero2; Wither.Logger.LogDebug((object)$"Setting offset to: {positionOffset}"); } else { Wither.Logger.LogDebug((object)"Couldn't find apparatus in dictionary!"); targetRotation = new Vector3(0f, 193f, 0f); positionOffset = Vector3.zero; } initialSet = false; } if (positionOffset == Vector3.zero) { targetPosition = ((Component)__instance).gameObject.transform.position; } if (!(Mathf.Abs(Quaternion.Dot(((Component)__instance).gameObject.transform.rotation, Quaternion.Euler(targetRotation))) < 0.999f)) { Vector3 val = ((Component)__instance).gameObject.transform.position - targetPosition; if (!(Mathf.Abs(((Vector3)(ref val)).magnitude) > 0.005f)) { goto IL_034d; } } if (((Component)__instance).gameObject.transform.eulerAngles == rotLastFrame) { if (posSet && positionOffset != Vector3.zero) { posSet = false; targetPosition = ((Component)__instance).transform.position + positionOffset; } ((Component)__instance).transform.eulerAngles = targetRotation; if (!posSet) { ((Component)__instance).transform.position = targetPosition; __instance.targetFloorPosition = ((Component)__instance).transform.localPosition; } } goto IL_034d; IL_034d: rotLastFrame = ((Component)__instance).gameObject.transform.eulerAngles; } } [HarmonyPatch] public class BetterDustClouds { private static bool initialSet = true; private static bool enableBuffer = true; private static bool transitionBuffer = false; private static bool transitionOverride = true; [HarmonyPatch(typeof(TimeOfDay), "Update")] [HarmonyPostfix] private static void ReEnable(TimeOfDay __instance) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 if (ScenePatches.onWither && (int)__instance.currentLevelWeather == 0) { GameObject effectObject = __instance.effects[0].effectObject; if ((Object)(object)effectObject != (Object)null && (!effectObject.activeInHierarchy || !__instance.effects[0].effectEnabled) && (Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null && !GameNetworkManager.Instance.localPlayerController.isInsideFactory) { effectObject.SetActive(true); __instance.effects[0].effectEnabled = true; } } } [HarmonyPatch(typeof(TimeOfDay), "Start")] [HarmonyPostfix] private static void SetInitial(TimeOfDay __instance) { initialSet = true; } [HarmonyPatch(typeof(TimeOfDay), "SetWeatherEffects")] [HarmonyPrefix] private static void CheckBefore(TimeOfDay __instance) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) if (ScenePatches.onWither) { GameObject effectObject = TimeOfDay.Instance.effects[0].effectObject; if ((int)__instance.currentLevelWeather == 0 && (Object)(object)effectObject != (Object)null) { enableBuffer = __instance.effects[0].effectEnabled; transitionBuffer = __instance.effects[0].transitioning; __instance.effects[0].effectEnabled = false; __instance.effects[0].transitioning = transitionOverride; } } } [HarmonyPatch(typeof(TimeOfDay), "SetWeatherEffects")] [HarmonyPostfix] private static void ChangeEffectObject(TimeOfDay __instance) { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Expected O, but got Unknown //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) GameObject effectObject = TimeOfDay.Instance.effects[0].effectObject; if (!ScenePatches.onWither) { if (initialSet && (Object)(object)effectObject != (Object)null && effectObject.activeInHierarchy) { AudioSource componentInChildren = effectObject.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.Stop(); } LocalVolumetricFog component = effectObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.parameters.meanFreePath = 17f; } __instance.effects[0].lerpPosition = true; initialSet = false; } } else { if ((int)__instance.currentLevelWeather != 0 || !((Object)(object)effectObject != (Object)null)) { return; } __instance.effects[0].effectEnabled = enableBuffer; __instance.effects[0].transitioning = transitionBuffer; transitionOverride = true; if (initialSet) { enableBuffer = true; __instance.effects[0].lerpPosition = false; GameObject val = (GameObject)Wither.ExtraAssets.LoadAsset("WitherDustCloudsAmbience"); if ((Object)(object)val != (Object)null) { LocalVolumetricFog component2 = effectObject.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.parameters.meanFreePath = 8f; } if (!Object.op_Implicit((Object)(object)effectObject.GetComponentInChildren())) { GameObject val2 = Object.Instantiate(val, Vector3.zero, Quaternion.identity); val2.transform.SetParent(effectObject.transform, false); } AudioSource componentInChildren2 = effectObject.GetComponentInChildren(); if ((Object)(object)componentInChildren2 != (Object)null) { componentInChildren2.Play(); } else { Wither.Logger.LogError((object)"Null dust clouds audio!"); } } initialSet = false; } if (__instance.effects[0].effectEnabled && (Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null && !GameNetworkManager.Instance.localPlayerController.isInsideFactory) { __instance.effects[0].transitioning = false; if ((Object)(object)__instance.effects[0].effectObject != (Object)null) { Vector3 val3 = ((!GameNetworkManager.Instance.localPlayerController.isPlayerDead) ? ((Component)StartOfRound.Instance.localPlayerController).transform.position : ((Component)StartOfRound.Instance.spectateCamera).transform.position); val3 += Vector3.up * 4f; effectObject.transform.position = val3; } } else if (!__instance.effects[0].transitioning) { transitionOverride = false; } } } } [HarmonyPatch] public class DustSpaceClouds { [HarmonyPatch(typeof(StartOfRound), "SetMapScreenInfoToCurrentLevel")] [HarmonyPostfix] [HarmonyPriority(0)] private static void AddSpaceToMapScreen(StartOfRound __instance) { string text = ((TMP_Text)__instance.screenLevelDescription).text; if (text.Contains("115 Wither") && text.Contains("DustClouds")) { text = text.Replace("DustClouds", "Dust Clouds"); ((TMP_Text)__instance.screenLevelDescription).text = text; } } [HarmonyPatch(typeof(Terminal), "LoadNewNode")] [HarmonyPostfix] [HarmonyPriority(0)] [HarmonyAfter(new string[] { "mrov.terminalformatter" })] private static void AddSpaceToTerminal(Terminal __instance) { if (__instance.currentText.Contains("DustClouds")) { __instance.currentText = __instance.currentText.Replace("DustClouds", "Dust Clouds"); __instance.screenText.text = __instance.currentText; } } } [HarmonyPatch] public class FallDamagePatch { [HarmonyPatch(typeof(PlayerControllerB), "DamagePlayer")] [HarmonyPrefix] private static void OnPlayerDamaged(PlayerControllerB __instance, ref int damageNumber, CauseOfDeath causeOfDeath, bool fallDamage, out bool __state) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Invalid comparison between Unknown and I4 __state = false; if (ScenePatches.onWither && (int)causeOfDeath == 2 && FallDamageTrigger.fallImmune) { damageNumber = 0; __state = true; } } [HarmonyPatch(typeof(PlayerControllerB), "DamagePlayer")] [HarmonyPostfix] private static void AfterPlayerDamaged(PlayerControllerB __instance, ref int damageNumber, CauseOfDeath causeOfDeath, bool fallDamage, bool __state) { if (ScenePatches.onWither && __state) { __instance.playerBodyAnimator.ResetTrigger("Damage"); } } } [HarmonyPatch] public class FalseInteriorPatches { public static ManualCameraRenderer twoRadarCam; private static bool TargetPlayerOutsideTrueInterior(ManualCameraRenderer radarCam) { int targetTransformIndex = radarCam.targetTransformIndex; int num = (((Object)(object)radarCam.targetedPlayer != (Object)null) ? ((int)radarCam.targetedPlayer.playerClientId) : (-1)); return (Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null && ((num != -1 && (!radarCam.targetedPlayer.isInsideFactory || TargetPlayerInFalseInterior(radarCam))) || (radarCam.radarTargets[targetTransformIndex].isNonPlayer && Object.op_Implicit((Object)(object)((Component)radarCam.radarTargets[targetTransformIndex].transform).GetComponent()) && !((GrabbableObject)((Component)radarCam.radarTargets[targetTransformIndex].transform).GetComponent()).isInFactory)); } private static bool TargetPlayerInFalseInterior(ManualCameraRenderer radarCam) { int targetTransformIndex = radarCam.targetTransformIndex; int num = (((Object)(object)radarCam.targetedPlayer != (Object)null) ? ((int)radarCam.targetedPlayer.playerClientId) : (-1)); return num != -1 && InFactoryTrigger.playersInFalseInterior != null && !radarCam.radarTargets[targetTransformIndex].isNonPlayer && ((InFactoryTrigger.isInFalseInterior && (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)radarCam.targetedPlayer) || InFactoryTrigger.playersInFalseInterior.Contains(num)); } private static bool ValidCam(ManualCameraRenderer radarCam) { return ScenePatches.onWither && (Object)(object)radarCam.cam == (Object)(object)radarCam.mapCamera && !radarCam.overrideCameraForOtherUse; } [HarmonyPatch(typeof(ManualCameraRenderer), "SetLineToExitFromRadarTarget")] [HarmonyPrefix] public static bool ExitLinePatch(ManualCameraRenderer __instance) { if (ValidCam(__instance) && TargetPlayerInFalseInterior(__instance)) { ((Renderer)__instance.lineFromRadarTargetToExit).enabled = false; return false; } return true; } [HarmonyPatch(typeof(ManualCameraRenderer), "MapCameraFocusOnPosition")] [HarmonyPostfix] private static void ClippingPatch(ManualCameraRenderer __instance) { if (ValidCam(__instance) && TargetPlayerOutsideTrueInterior(__instance)) { Camera mapCamera = __instance.mapCamera; mapCamera.farClipPlane += 5f; } } [HarmonyPatch(typeof(StartOfRound), "SwitchMapMonitorPurpose")] [HarmonyPostfix] private static void OnRadarEnable(StartOfRound __instance, bool displayInfo) { if (Wither.zaggyPresent && (Object)(object)twoRadarCam == (Object)null) { twoRadarCam = ((Component)Object.FindObjectOfType()).GetComponent(); } if (!displayInfo) { FieldInfo fieldInfo = AccessTools.Field(typeof(ManualCameraRenderer), "checkedForContourMap"); if (fieldInfo != null) { fieldInfo.SetValue(__instance.mapScreen, false); } } if (ScenePatches.onWither) { ToggleShipIcon(__instance.mapScreen, displayInfo); if ((Object)(object)twoRadarCam != (Object)null) { ToggleShipIcon(twoRadarCam, displayInfo); } } } private static void ToggleShipIcon(ManualCameraRenderer radarCam, bool show) { if (!((Object)(object)radarCam.shipArrowUI != (Object)null)) { return; } Transform val = radarCam.shipArrowUI.transform.Find("ShipIcon"); if ((Object)(object)val != (Object)null) { if (!show) { ((Component)val).gameObject.SetActive(false); } else { ((Component)val).gameObject.SetActive(true); } } } [HarmonyPatch(typeof(ManualCameraRenderer), "Update")] [HarmonyPostfix] private static void ContourPosShipArrowUpdatePatch(ManualCameraRenderer __instance) { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) if (ValidCam(__instance)) { ManualCameraRenderer mapScreen = StartOfRound.Instance.mapScreen; if ((Object)(object)mapScreen.contourMap != (Object)null && (((Object)(object)__instance.targetedPlayer != (Object)null && !__instance.targetedPlayer.isInsideFactory) || ((Object)(object)__instance.targetedPlayer == (Object)null && ((Component)__instance.headMountedCamTarget).transform.position.y > -80f))) { mapScreen.contourMap.transform.position = new Vector3(mapScreen.contourMap.transform.position.x, ((Component)__instance.headMountedCamTarget).transform.position.y - 4f, mapScreen.contourMap.transform.position.z); } if (TargetPlayerInFalseInterior(__instance)) { __instance.shipArrowUI.SetActive(false); } } } [HarmonyPatch(typeof(PlayerControllerB), "SetNightVisionEnabled")] [HarmonyPostfix] private static void NightVisionUpdate(PlayerControllerB __instance) { if (InFactoryTrigger.isInFalseInterior) { ((Behaviour)__instance.nightVision).enabled = false; } } [HarmonyPatch(typeof(PlayerControllerB), "TeleportPlayer")] [HarmonyPostfix] private static void OnTeleport(PlayerControllerB __instance) { if (!ScenePatches.onWither || (Object)(object)StartOfRound.Instance == (Object)null || InFactoryTrigger.playersInFalseInterior == null || StartOfRound.Instance.inShipPhase) { return; } if ((Object)(object)__instance == (Object)(object)GameNetworkManager.Instance.localPlayerController) { InFactoryTrigger.isInFalseInterior = false; return; } int num = (int)__instance.playerClientId; if (num >= 0 && InFactoryTrigger.playersInFalseInterior.Contains(num)) { InFactoryTrigger.playersInFalseInterior.Remove(num); } } } [HarmonyPatch] public class FootstepsPatch { public static bool swappedSurface; public static AudioClip[] sandClips; public static AudioClip sandHitClip; public static AudioClip[] gravelClips; public static AudioClip gravelHitClip; public static bool doStepChange; public static bool goingOutside; public static bool spectated; public static void LoadAssets() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown AudioClip val = (AudioClip)Wither.ExtraAssets.LoadAsset("sand1"); AudioClip val2 = (AudioClip)Wither.ExtraAssets.LoadAsset("sand2"); AudioClip val3 = (AudioClip)Wither.ExtraAssets.LoadAsset("sand3"); AudioClip val4 = (AudioClip)Wither.ExtraAssets.LoadAsset("sand4"); sandHitClip = (AudioClip)Wither.ExtraAssets.LoadAsset("HitSand"); sandClips = (AudioClip[])(object)new AudioClip[4] { val, val2, val3, val4 }; } private static void ChangeSandySteps(bool sand) { if (sand && ScenePatches.onWither && !swappedSurface) { for (int i = 0; i < StartOfRound.Instance.footstepSurfaces.Length; i++) { if (StartOfRound.Instance.footstepSurfaces[i].surfaceTag == "Gravel") { if ((Object)(object)gravelHitClip == (Object)null) { gravelClips = StartOfRound.Instance.footstepSurfaces[i].clips; gravelHitClip = StartOfRound.Instance.footstepSurfaces[i].hitSurfaceSFX; } StartOfRound.Instance.footstepSurfaces[i].clips = sandClips; StartOfRound.Instance.footstepSurfaces[i].hitSurfaceSFX = sandHitClip; swappedSurface = true; } } } else { if (sand || !swappedSurface) { return; } for (int j = 0; j < StartOfRound.Instance.footstepSurfaces.Length; j++) { if (StartOfRound.Instance.footstepSurfaces[j].surfaceTag == "Gravel") { StartOfRound.Instance.footstepSurfaces[j].clips = gravelClips; StartOfRound.Instance.footstepSurfaces[j].hitSurfaceSFX = gravelHitClip; swappedSurface = false; } } } } [HarmonyPatch(typeof(RoundManager), "SyncScrapValuesClientRpc")] [HarmonyPostfix] private static void OnSync(RoundManager __instance) { ChangeSandySteps(sand: true); } [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] [HarmonyPrefix] private static void OnLeave(StartOfRound __instance) { ChangeSandySteps(sand: false); } [HarmonyPatch(typeof(EntranceTeleport), "TeleportPlayer")] [HarmonyPrefix] private static void InteriorTP(EntranceTeleport __instance) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (ScenePatches.onWither && !localPlayerController.isPlayerDead) { doStepChange = true; goingOutside = !__instance.isEntranceToBuilding; spectated = false; } } [HarmonyPatch(typeof(EntranceTeleport), "TeleportPlayerClientRpc")] [HarmonyPrefix] private static void InteriorTPClients(EntranceTeleport __instance, int playerObj) { PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerObj]; if ((Object)(object)val != (Object)(object)GameNetworkManager.Instance.localPlayerController && PlayerSelfOrSpectated(val) && ScenePatches.onWither && !val.isPlayerDead) { doStepChange = true; goingOutside = !__instance.isEntranceToBuilding; spectated = true; } } [HarmonyPatch(typeof(ShipTeleporter), "TeleportPlayerOutWithInverseTeleporter")] [HarmonyPrefix] private static void InverseTP(ShipTeleporter __instance, int playerObj) { PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[playerObj]; if (PlayerSelfOrSpectated(val) && ScenePatches.onWither && !val.isPlayerDead) { doStepChange = true; goingOutside = false; spectated = (Object)(object)val != (Object)(object)GameNetworkManager.Instance.localPlayerController; } } private static bool PlayerSelfOrSpectated(PlayerControllerB targetPlayer) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; return (Object)(object)targetPlayer == (Object)(object)localPlayerController || ((Object)(object)localPlayerController != (Object)null && localPlayerController.isPlayerDead && (Object)(object)localPlayerController.spectatedPlayerScript != (Object)null && (Object)(object)localPlayerController.spectatedPlayerScript == (Object)(object)targetPlayer); } [HarmonyPatch(typeof(PlayerControllerB), "TeleportPlayer")] [HarmonyPostfix] private static void OnTP(PlayerControllerB __instance) { if (ScenePatches.onWither && !__instance.isPlayerDead && (spectated || PlayerSelfOrSpectated(__instance))) { if (doStepChange) { ChangeSandySteps(goingOutside); } else { ChangeSandySteps(sand: true); } doStepChange = false; spectated = false; } } [HarmonyPatch(typeof(PlayerControllerB), "SpectateNextPlayer")] [HarmonyPostfix] private static void OnSpecSwitch(PlayerControllerB __instance) { if (((NetworkBehaviour)__instance).IsOwner && ScenePatches.onWither && __instance.isPlayerDead && (Object)(object)__instance.spectatedPlayerScript != (Object)null) { ChangeSandySteps(!__instance.spectatedPlayerScript.isInsideFactory); } } } public class GoodItemScanPatch { public static void DoPatching() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown Harmony? harmony = Wither.Harmony; if (harmony != null) { harmony.Patch((MethodBase)AccessTools.Method(typeof(Scanner), "AssignNodeToUIElement", (Type[])null, (Type[])null), new HarmonyMethod(typeof(ScanElementPatch).GetMethod("AssignNodePatch")), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } Harmony? harmony2 = Wither.Harmony; if (harmony2 != null) { harmony2.Patch((MethodBase)AccessTools.Method(typeof(StartOfRound), "Start", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(typeof(ScanElementPatch).GetMethod("OnStart")), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } } public class ScanElementPatch { public static bool scanDone; public static void OnStart(StartOfRound __instance) { scanDone = false; } public static void AssignNodePatch(Scanner __instance, ScanNodeProperties node) { if (!TerminalEntryPatches.unlocked && ScenePatches.onWither && node.headerText == "Withered lasher") { scanDone = true; LasherManager.Instance.LasherEnemyScanLocal(); } } } [HarmonyPatch] public class GreenDogPatch { public static Material greenMat; public static bool checking = false; public static Vector3 spawnLocation = new Vector3(-120.4989f, 65.56802f, -44.3673f); public static void LoadAssets() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown greenMat = (Material)Wither.ExtraAssets.LoadAsset("MouthDogTexGreen"); } [HarmonyPatch(typeof(EnemyAI), "Start")] [HarmonyPostfix] private static void OnDogSpawn(EnemyAI __instance) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (!checking) { return; } MouthDogAI val = (MouthDogAI)(object)((__instance is MouthDogAI) ? __instance : null); if (val != null && Vector3.Distance(((Component)val).transform.position, spawnLocation) < 15f) { SkinnedMeshRenderer[] skinnedMeshRenderers = ((EnemyAI)val).skinnedMeshRenderers; foreach (SkinnedMeshRenderer val2 in skinnedMeshRenderers) { ((Renderer)val2).material = greenMat; } } } } [HarmonyPatch] public class InteriorPowerPatches { [HarmonyPatch(typeof(RoundManager), "TurnOnAllLights")] [HarmonyPostfix] private static void OnPowerChange(RoundManager __instance, bool on) { if (ScenePatches.onWither) { if (on) { AnimatedLightsManager.Instance.PowerOn(); } else { AnimatedLightsManager.Instance.PowerOff(); } } } } [HarmonyPatch] public class LasherHitPatches { [HarmonyPatch(typeof(SprayPaintItem), "TrySprayingWeedKillerBottle")] [HarmonyPrefix] private static bool SprayLasherPatch(SprayPaintItem __instance) { //IL_0034: 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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) if (!ScenePatches.onWither) { return true; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; List list = new List(); Vector3 val = ((Component)localPlayerController.gameplayCamera).transform.position - ((Component)localPlayerController.gameplayCamera).transform.forward * 0.7f; RaycastHit[] source = Physics.SphereCastAll(val, 0.8f, ((Component)localPlayerController.gameplayCamera).transform.forward, 4.5f, 524288, (QueryTriggerInteraction)2); list = source.OrderBy((RaycastHit x) => ((RaycastHit)(ref x)).distance).ToList(); for (int i = 0; i < list.Count; i++) { RaycastHit val2 = list[i]; if (Object.op_Implicit((Object)(object)((Component)((RaycastHit)(ref val2)).collider).gameObject.GetComponent())) { val2 = list[i]; ((Component)((RaycastHit)(ref val2)).collider).gameObject.GetComponent().lasherScript.KillLasherLocal(); return false; } } return true; } [HarmonyPatch(typeof(ShotgunItem), "ShootGun")] [HarmonyPostfix] private static void ShootLasherPatch(ShotgunItem __instance, Vector3 shotgunPosition, Vector3 shotgunForward) { //IL_002b: 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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: 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_00fa: Unknown result type (might be due to invalid IL or missing references) if (!ScenePatches.onWither || (Object)(object)__instance.heldByEnemy != (Object)null) { return; } RaycastHit[] array = (RaycastHit[])(object)new RaycastHit[10]; Ray val = default(Ray); ((Ray)(ref val))..ctor(shotgunPosition - shotgunForward * 10f, shotgunForward); int num = Physics.SphereCastNonAlloc(val, 5f, array, 15f, 524288, (QueryTriggerInteraction)2); RaycastHit val2 = default(RaycastHit); IHittable val3 = default(IHittable); for (int i = 0; i < num; i++) { if (Object.op_Implicit((Object)(object)((Component)((RaycastHit)(ref array[i])).transform).GetComponent())) { if (((RaycastHit)(ref array[i])).distance == 0f) { Wither.Logger.LogDebug((object)"Spherecast started inside lasher collider."); } else if (!Physics.Linecast(shotgunPosition, ((RaycastHit)(ref array[i])).point, ref val2, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1) && ((Component)((RaycastHit)(ref array[i])).transform).TryGetComponent(ref val3) && !val3.Hit(1, shotgunForward, ((GrabbableObject)__instance).playerHeldBy, true, -1)) { } } } } } [HarmonyPatch] public class ModdedApparatusConfig { public static Dictionary apparatusDict = new Dictionary(); public static Dictionary, ConfigEntry)> configDict = new Dictionary, ConfigEntry)>(); [HarmonyPrefix] [HarmonyAfter(new string[] { "imabatby.lethallevelloader" })] [HarmonyPatch(typeof(StartOfRound), "Start")] private static void OnStart(StartOfRound __instance) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Invalid comparison between Unknown and I4 if (Wither.evaisaPresent) { LethalLibApparatusCheck.AddApparatuses(); } foreach (ExtendedItem extendedItem in PatchedContent.ExtendedItems) { if ((int)((ExtendedContent)extendedItem).ContentType != 0 && InsertApparatus.IsApparatus(extendedItem.Item.itemName)) { apparatusDict.TryAdd(extendedItem.Item, (FilterSpecialCharacters(((ExtendedContent)extendedItem).ModName), FilterSpecialCharacters(extendedItem.Item.itemName))); } } ConfigLoader(); } private static void ConfigLoader() { foreach (KeyValuePair item in apparatusDict) { string text = "0,0,0"; string text2 = "0,0,0"; Wither.Logger.LogDebug((object)("Found apparatus: " + item.Value.Item2)); if (item.Value.Item2.ToLower().Contains("egyptapparatus")) { text = "-90,0,0"; text2 = "0,-0.1,0"; } if (!item.Value.Item2.ToLower().Contains("egyptlapparatus")) { if (item.Value.Item2.ToLower().Contains("dull apparatus") || item.Value.Item2.ToLower().Contains("mech apparatus")) { text2 = "0.07,0,0"; } configDict.TryAdd(item.Key, (((BaseUnityPlugin)Wither.Instance).Config.Bind("Rotation Offsets", item.Value.Item2 + " - " + item.Value.Item1, text, "If this apparatus is appearing incorrectly in the socket, adjust its rotation here (should be a comma-separated string of x,y,z rotation angles)."), ((BaseUnityPlugin)Wither.Instance).Config.Bind("Position Offsets", item.Value.Item2 + " - " + item.Value.Item1, text2, "If this apparatus is appearing incorrectly in the socket, adjust its position here (should be a comma-separated string of x,y,z displacement)."))); } } } public static string FilterSpecialCharacters(string input) { return input.Replace("\n", "").Replace("\t", "").Replace("\\", "") .Replace("\"", "") .Replace("'", "") .Replace("[", "") .Replace("]", ""); } } [HarmonyPatch] public class SaveDataSyncPatches { public static GameObject saveSyncPrefab; public static DataSync saveSyncScript; [HarmonyPatch(typeof(GameNetworkManager), "Start")] [HarmonyPostfix] public static void InitializeAssets() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown saveSyncPrefab = (GameObject)Wither.ExtraAssets.LoadAsset("SaveDataSync"); NetworkManager.Singleton.AddNetworkPrefab(saveSyncPrefab); } [HarmonyPatch(typeof(StartOfRound), "Start")] [HarmonyPostfix] private static void SpawnSyncScript(StartOfRound __instance) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) Wither.Logger.LogDebug((object)$"Wither entry unlocked: {TerminalEntryPatches.unlocked}, Wither entry unread: {TerminalEntryPatches.unread}"); if ((Object)(object)saveSyncScript == (Object)null && ((NetworkBehaviour)__instance).IsServer) { GameObject val = Object.Instantiate(saveSyncPrefab, Vector3.zero, Quaternion.identity); val.GetComponent().Spawn(false); saveSyncScript = val.GetComponent(); } } [HarmonyPatch(typeof(StartOfRound), "OnClientConnect")] [HarmonyPostfix] private static void OnConnectionServer(StartOfRound __instance) { if (!((NetworkBehaviour)__instance).IsServer) { return; } Wither.Logger.LogDebug((object)$"Wither entry unlocked: {TerminalEntryPatches.unlocked}, Wither entry unread: {TerminalEntryPatches.unread}"); if ((Object)(object)saveSyncScript == (Object)null) { if ((Object)(object)DataSync.Instance != (Object)null) { saveSyncScript = DataSync.Instance; } else { saveSyncScript = Object.FindObjectOfType(); } } if ((Object)(object)saveSyncScript != (Object)null) { saveSyncScript.UpdateTerminalPatchClientRpc(TerminalEntryPatches.unlocked, TerminalEntryPatches.unread); } else { Wither.Logger.LogWarning((object)"Host unable to find save sync script and sync saved values to clients."); } } } [HarmonyPatch] public class ScenePatches { public static bool onWither; private static bool done; private static bool waitingForLoad; [HarmonyPatch(typeof(StartOfRound), "SceneManager_OnLoadComplete1")] [HarmonyPostfix] private static void OnLoad(StartOfRound __instance, string sceneName) { InFactoryTrigger.isInFalseInterior = false; if (InFactoryTrigger.playersInFalseInterior != null) { InFactoryTrigger.playersInFalseInterior.Clear(); } if (sceneName == "WitherScene") { onWither = true; if (Wither.mrovWeatherPresent && MrovBlackoutCheck.CheckCurrentWeather() == "Blackout" && (Object)(object)AnimatedLightsManager.Instance != (Object)null) { AnimatedLightsManager.Instance.PowerOff(ignoreCheck: true); AnimatedLightsManager.Instance.EndAlarmSequence(); } } else { onWither = false; } } [HarmonyPatch(typeof(GiantKiwiAI), "SpawnBirdNest")] [HarmonyPrefix] private static bool OnKiwiSpawn(GiantKiwiAI __instance) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) if (!onWither) { return true; } GameObject[] array = (from x in GameObject.FindGameObjectsWithTag("OutsideAINode") orderby NestDistanceCheck(x.transform.position, ((Component)StartOfRound.Instance.shipLandingPosition).transform.position) descending select x).ToArray(); Vector3 val = array[0].transform.position; Random random = new Random(StartOfRound.Instance.randomMapSeed + 288); int num = random.Next(0, array.Length / 3); bool flag = false; Vector3 val2 = Vector3.zero; for (int i = 0; i < array.Length; i++) { val = array[num].transform.position; val = RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(val, 15f, default(NavMeshHit), random, RoundManager.Instance.GetLayermaskForEnemySizeLimit(((EnemyAI)__instance).enemyType, false, -1), 1f); val = RoundManager.Instance.PositionWithDenialPointsChecked(val, array, ((EnemyAI)__instance).enemyType, ((EnemyAI)__instance).enemyType.nestDistanceFromShip, (Random)null); flag = __instance.CheckPathFromNodeToShip(array[num].transform); if (flag) { val2 = RoundManager.Instance.PositionEdgeCheck(val, ((EnemyAI)__instance).enemyType.nestSpawnPrefabWidth, -1, default(Vector3)); } if (val2 == Vector3.zero || !flag) { num++; if (num > array.Length - 1) { val = RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(array[0].transform.position, 15f, default(NavMeshHit), random, RoundManager.Instance.GetLayermaskForEnemySizeLimit(((EnemyAI)__instance).enemyType, false, -1), 1f); break; } continue; } val = val2; break; } GameObject val3 = Object.Instantiate(__instance.birdNestPrefab, val, Quaternion.Euler(Vector3.zero), RoundManager.Instance.mapPropsContainer.transform); val3.transform.Rotate(Vector3.up, (float)random.Next(-180, 180), (Space)0); if (!Object.op_Implicit((Object)(object)val3.gameObject.GetComponentInChildren())) { Wither.Logger.LogError((object)("Error: No NetworkObject found in enemy nest spawn prefab that was just spawned on the host: '" + ((Object)val3).name + "'")); } else { val3.gameObject.GetComponentInChildren().Spawn(true); } __instance.birdNestAmbience = val3.GetComponent(); __instance.birdNest = val3; ((Behaviour)((EnemyAI)__instance).agent).enabled = false; ((Component)__instance).transform.position = __instance.birdNest.transform.position; ((Component)__instance).transform.rotation = __instance.birdNest.transform.rotation; ((Behaviour)((EnemyAI)__instance).agent).enabled = true; return false; } private static float NestDistanceCheck(Vector3 position, Vector3 shipPosition) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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) if (position.z > 50f || (position.y > 40f && position.x > -155f) || (position.y < 40f && position.x < -75f)) { return 0f; } return Vector3.Distance(position, shipPosition); } [HarmonyPatch(typeof(StartOfRound), "Update")] [HarmonyPostfix] [HarmonyAfter(new string[] { "voxx.LethalElementsPlugin" })] private static void OnLatestLoad(StartOfRound __instance) { if (onWither && waitingForLoad && !__instance.shipDoorsAnimator.GetBool("Closed")) { waitingForLoad = false; GameObject val = GameObject.Find("Terrain/TerrainMain/Terrain/GrassTerrain"); GameObject val2 = GameObject.Find("Terrain/TerrainMain/Terrain/RockTerrain"); GameObject val3 = GameObject.Find("Terrain/TerrainMain/Terrain/SandTerrain"); ((Renderer)val.GetComponent()).enabled = false; ((Renderer)val2.GetComponent()).enabled = false; ((Renderer)val3.GetComponent()).enabled = false; } } [HarmonyPatch(typeof(StartOfRound), "SwitchMapMonitorPurpose")] [HarmonyPostfix] private static void InitialSetup(StartOfRound __instance, bool displayInfo) { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Expected O, but got Unknown if (!onWither || __instance.inShipPhase || displayInfo || done) { return; } done = true; waitingForLoad = true; GameObject val = GameObject.Find("CatwalksMesa/IndustrialEntranceR/GarageDoor"); if ((Object)(object)val != (Object)null) { Transform val2 = val.transform.Find("Door"); if ((Object)(object)val2 != (Object)null) { ((Component)val2).gameObject.SetActive(true); } } GrabbableObject[] array = (from x in Object.FindObjectsOfType() where x is LungProp && (Object)(object)x.itemProperties != (Object)null && x.itemProperties.itemName == "Dying apparatus" && !x.isInShipRoom && !x.scrapPersistedThroughRounds select x).ToArray(); if (array.Length != 0) { LungProp val3 = (LungProp)array.First(); val3.isLungPowered = true; val3.isLungDocked = true; AudioSource componentInChildren = ((Component)val3).gameObject.GetComponentInChildren(); componentInChildren.loop = true; componentInChildren.Play(); } if ((Object)(object)LasherManager.Instance != (Object)null) { LasherManager.Instance.InitialDeactivate(); } if ((Object)(object)SpecialEventHandler.Instance != (Object)null && ((NetworkBehaviour)__instance).IsServer) { if (Wither.GarageStartOpen.Value) { SpecialEventHandler.Instance.garageLeverAnimTrigger.TriggerAnimation(GameNetworkManager.Instance.localPlayerController); SpecialEventHandler.Instance.garageDoorAnimTrigger.TriggerAnimation(GameNetworkManager.Instance.localPlayerController); } if (Wither.VanillaPlusMode.Value && (Object)(object)DataSync.Instance != (Object)null) { DisableEventObjects(); DataSync.Instance.SetVanillaPlusModeClientRpc(); } } } [HarmonyPatch(typeof(StartOfRound), "OnShipLandedMiscEvents")] [HarmonyPostfix] private static void OnLand(StartOfRound __instance) { if (!onWither) { return; } List list = new List(); list.Add(GameObject.Find("Spotlight1/Spotlight_big_v4_Holder/Spotlight_big_v4_Spotlight/OutsideSpotlight1")); list.Add(GameObject.Find("Spotlight2/Spotlight_big_v4_Holder/Spotlight_big_v4_Spotlight/OutsideSpotlight1")); list.Add(GameObject.Find("Lights/WallLight2/Light")); list.Add(GameObject.Find("Lights/WallLight4/Light")); list.Add(GameObject.Find("Lights/PitBroadIllum")); list.Add(GameObject.Find("ExtraFanPitLights/BroadPitIllum")); list.Add(GameObject.Find("PitLightE/Point Light")); list.Add(GameObject.Find("PitLightS/Point Light")); list.Add(GameObject.Find("PitLightW/Point Light")); list.Add(GameObject.Find("Bar Lights/Neon Bars/Point Light (3)")); list.Add(GameObject.Find("Bar Lights/Neon Bars/Point Light (4)")); list.Add(GameObject.Find("Bar Lights/Neon Bars (1)/Point Light (3)")); list.Add(GameObject.Find("Bar Lights/Neon Bars (2)/Point Light (3)")); list.Add(GameObject.Find("Bar Lights/Neon Bars (2)/Point Light (4)")); list.Add(GameObject.Find("Bar Lights/Neon Bars (3)/Point Light (3)")); list.Add(GameObject.Find("Bar Lights/Neon Bars (3)/Point Light (4)")); list.Add(GameObject.Find("2short (3)/HangingLight (40)/Light (1)")); list.Add(GameObject.Find("IndustrialEntranceL/HangingLight/Light")); foreach (GameObject item in list) { if ((Object)(object)item != (Object)null) { AnimatedLightsManager.RestartLight(item); } } } [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] [HarmonyPostfix] private static void OnLeave(StartOfRound __instance) { onWither = false; done = false; } public static void DisableEventObjects() { SpecialEventHandler.Instance.topFloorObjects.SetActive(false); SpecialEventHandler.Instance.interiorScrapDrop.SetActive(false); SpecialEventHandler.Instance.interiorBreakerBox.SetActive(false); SpecialEventHandler.Instance.exteriorBreakerBox.SetActive(false); } } [HarmonyPatch] public class TerminalEntryPatches { [ModData(/*Could not decode attribute arguments.*/)] public static bool unlocked = false; [ModData(/*Could not decode attribute arguments.*/)] public static bool unread = true; public static TerminalNode lasherFile; public static void LoadAssets() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown lasherFile = (TerminalNode)Wither.ExtraAssets.LoadAsset("LasherFile"); } [HarmonyPatch(typeof(Terminal), "OnSubmit")] [HarmonyPrefix] private static bool TerminalSubmit(Terminal __instance) { if (!__instance.terminalInUse || ((Object)(object)__instance.currentNode != (Object)null && __instance.currentNode.acceptAnything)) { return true; } if (unlocked) { string text = __instance.screenText.text.Substring(__instance.screenText.text.Length - __instance.textAdded); text = __instance.RemovePunctuation(text); string separator = text.Trim(); string[] array = text.Split(separator); text = text.ToLower(); if (text == "lasher" || text == "lashers" || (text.Length >= 8 && "withered lashers".Contains(text))) { __instance.screenText.ActivateInputField(); ((Selectable)__instance.screenText).Select(); __instance.LoadNewNode(lasherFile); unread = false; return false; } } return true; } [HarmonyPatch(typeof(Terminal), "LoadNewNode")] [HarmonyPrefix] [HarmonyBefore(new string[] { "mrov.terminalformatter" })] private static void TerminalTextCheck(Terminal __instance, TerminalNode node, out bool __state) { if (unlocked && node.displayText.Contains("[currentScannedEnemiesList]")) { __state = true; } else { __state = false; } } [HarmonyPatch(typeof(Terminal), "LoadNewNode")] [HarmonyPostfix] [HarmonyPriority(0)] [HarmonyAfter(new string[] { "mrov.terminalformatter" })] private static void TerminalLogsTextOverride(Terminal __instance, bool __state) { if (!__state || !unlocked) { return; } string text = (unread ? " (NEW)" : ""); Match match = Regex.Match(__instance.currentText, "(? list = text4.Split("\n").ToList(); list.RemoveAll((string x) => x.Contains("No data collected on wildlife. Scans are required.") || x.Contains("NO DATA COLLECTED") || x.Contains("Scan creatures to unlock their data.")); text4 = string.Join("\n", list); } __instance.currentText = text4; __instance.screenText.text = __instance.currentText; } else { Wither.Logger.LogError((object)"Failed to trim terminal text!"); } } [HarmonyPatch(typeof(HUDManager), "AssignNewNodes")] [HarmonyPostfix] private static void DetectLasherScan(HUDManager __instance) { if (unlocked || !ScenePatches.onWither || Wither.testPresent) { return; } for (int i = 0; i < __instance.scanElements.Length; i++) { if (__instance.scanNodes.Count <= 0 || !__instance.scanNodes.TryGetValue(__instance.scanElements[i], out var value) || !((Object)(object)value != (Object)null)) { continue; } try { if (__instance.NodeIsNotVisible(value, i) || ((Component)__instance.scanElements[i]).gameObject.activeSelf || !(value.headerText == "Withered lasher")) { continue; } LasherManager.Instance.LasherEnemyScanLocal(); break; } catch (Exception arg) { Wither.Logger.LogError((object)$"Error in scan node patch: {arg}"); } } } } [HarmonyPatch] public class TooltipPatch { private RaycastHit hit; private static bool flag; [HarmonyPatch(typeof(PlayerControllerB), "SetHoverTipAndCurrentInteractTrigger")] [HarmonyPrefix] private static void TooltipDetectApparatus(PlayerControllerB __instance) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) if ((!InsertApparatus.isInserted && !InsertApparatus.doingInsertion) || __instance.isGrabbingObjectAnimation || __instance.inSpecialMenu || __instance.quickMenuManager.isMenuOpen) { return; } Ray val = default(Ray); ((Ray)(ref val))..ctor(((Component)__instance.gameplayCamera).transform.position, ((Component)__instance.gameplayCamera).transform.forward); RaycastHit val2 = default(RaycastHit); if (!Physics.Raycast(val, ref val2, __instance.grabDistance, __instance.interactableObjectsMask) || ((Component)((RaycastHit)(ref val2)).collider).gameObject.layer == 8 || ((Component)((RaycastHit)(ref val2)).collider).gameObject.layer == 30) { return; } string tag = ((Component)((RaycastHit)(ref val2)).collider).tag; if (tag == "PhysicsProp") { GrabbableObject component = ((Component)((RaycastHit)(ref val2)).collider).gameObject.GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component == (Object)(object)InsertApparatus.insertedApparatus) { flag = true; } } } [HarmonyPatch(typeof(PlayerControllerB), "SetHoverTipAndCurrentInteractTrigger")] [HarmonyPostfix] [HarmonyAfter(new string[] { "me.loaforc.facilitymeltdown" })] private static void DisableTooltip(PlayerControllerB __instance) { if ((InsertApparatus.isInserted || InsertApparatus.doingInsertion) && flag) { flag = false; ((Behaviour)__instance.cursorIcon).enabled = false; ((TMP_Text)__instance.cursorTip).text = ""; } } } } namespace Wither.Mechanics { public class CatwalkTrigger : NetworkBehaviour { [CompilerGenerated] private sealed class d__11 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CatwalkTrigger <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.onCooldown = true; <>2__current = (object)new WaitForSeconds(0.6f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.onCooldown = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private int timesTriggered = 0; private int triggerThreshold; public AnimatedObjectTrigger animatedObjectTriggerShake; public AnimatedObjectTrigger animatedObjectTriggerFall; private bool initialSet = true; private bool bridgeFell; private bool onCooldown = false; private void Update() { if (initialSet) { if (((NetworkBehaviour)this).IsServer) { triggerThreshold = Random.Range(2, Wither.MaxCatwalkTriggers.Value + 1); Wither.Logger.LogDebug((object)$"Catwalk triggers: {triggerThreshold}"); SetThresholdClientRpc(triggerThreshold); } initialSet = false; } } [ClientRpc] public void SetThresholdClientRpc(int threshold) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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 != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2189927576u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, threshold); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2189927576u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { triggerThreshold = threshold; } } } private void OnTriggerEnter(Collider other) { if (!bridgeFell) { PlayerControllerB component = ((Component)other).gameObject.GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)component) { AddToBridgeInstabilityServerRpc(); } } } [ServerRpc(RequireOwnership = false)] public void AddToBridgeInstabilityServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3568143984u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3568143984u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (!onCooldown) { timesTriggered++; if (timesTriggered < triggerThreshold) { animatedObjectTriggerShake.TriggerAnimation(GameNetworkManager.Instance.localPlayerController); } if (timesTriggered >= triggerThreshold) { bridgeFell = true; animatedObjectTriggerFall.TriggerAnimation(GameNetworkManager.Instance.localPlayerController); } ((MonoBehaviour)this).StartCoroutine(TriggerCooldown()); } } [IteratorStateMachine(typeof(d__11))] private IEnumerator TriggerCooldown() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__11(0) { <>4__this = this }; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2189927576u, new RpcReceiveHandler(__rpc_handler_2189927576), "SetThresholdClientRpc"); ((NetworkBehaviour)this).__registerRpc(3568143984u, new RpcReceiveHandler(__rpc_handler_3568143984), "AddToBridgeInstabilityServerRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2189927576(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int thresholdClientRpc = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref thresholdClientRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((CatwalkTrigger)(object)target).SetThresholdClientRpc(thresholdClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3568143984(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; ((CatwalkTrigger)(object)target).AddToBridgeInstabilityServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "CatwalkTrigger"; } } public class CustomElevatorController : NetworkBehaviour { public Animator elevatorAnimator; public Transform elevatorPoint; public float elevatorFinishTimer; public float callCooldown; public bool elevatorFinishedMoving; public bool elevatorIsAtBottom; public bool elevatorCalled; public bool elevatorMovingDown; private bool movingDownLastFrame = true; public bool calledDown; public AudioSource elevatorAudio; public AudioSource elevatorAudioTop; public AudioSource elevatorJingleMusic; public AudioClip elevatorStartUpSFX; public AudioClip elevatorStartDownSFX; public AudioClip elevatorTravelSFX; public AudioClip elevatorFinishUpSFX; public AudioClip elevatorFinishDownSFX; public AudioClip elevatorCrashSFX; public AudioClip elevatorSmashSFX; public AudioClip[] elevatorJingleClips; public AudioClip[] elevatorJingleClipsLong; public Transform elevatorTopPoint; public Transform elevatorBottomPoint; public Transform elevatorInsidePoint; public Collider crashDamageTrigger; public Vector3 previousElevatorPosition; public bool elevatorDoorOpen; private bool playMusic; private bool startedMusic; private float stopPlayingMusicTimer; private int selectedTrack = 0; public static bool permanentlyDisabled; public void Start() { permanentlyDisabled = false; } [ServerRpc] public void SetElevatorMusicServerRpc(bool setOn, int track) { //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_012f: 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(1040526011u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setOn, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, track); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1040526011u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetElevatorMusicClientRpc(setOn, track); } } [ClientRpc] public void SetElevatorMusicClientRpc(bool setOn, int track) { //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) //IL_00e9: 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 != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4066554235u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setOn, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, track); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4066554235u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { selectedTrack = track; playMusic = setOn; } } } public void LateUpdate() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) previousElevatorPosition = elevatorInsidePoint.position; } public void Update() { if (!playMusic) { if (stopPlayingMusicTimer <= 0f) { if (elevatorJingleMusic.isPlaying) { if (elevatorJingleMusic.pitch < 0.5f) { AudioSource obj = elevatorJingleMusic; obj.volume -= Time.deltaTime * 3f; if (elevatorJingleMusic.volume <= 0.01f) { elevatorJingleMusic.Stop(); } } else { AudioSource obj2 = elevatorJingleMusic; obj2.pitch -= Time.deltaTime; elevatorJingleMusic.volume = Mathf.Max(elevatorJingleMusic.volume - Time.deltaTime * 2f, 0.4f); } } } else { stopPlayingMusicTimer -= Time.deltaTime; } } else { stopPlayingMusicTimer = 1.5f; if (!elevatorJingleMusic.isPlaying) { if (elevatorMovingDown) { elevatorJingleMusic.clip = elevatorJingleClips[selectedTrack]; elevatorJingleMusic.Play(); elevatorJingleMusic.volume = 1f; } else { elevatorJingleMusic.clip = elevatorJingleClipsLong[selectedTrack]; elevatorJingleMusic.Play(); elevatorJingleMusic.volume = 1f; } } AudioSource obj3 = elevatorJingleMusic; AudioSource obj4 = elevatorJingleMusic; float num2 = (obj4.pitch += Time.deltaTime * 2f); obj3.pitch = Mathf.Clamp(num2, 0.3f, 1f); } elevatorAnimator.SetBool("ElevatorGoingUp", !elevatorMovingDown); if (elevatorMovingDown != movingDownLastFrame) { movingDownLastFrame = elevatorMovingDown; if (elevatorMovingDown) { elevatorAudio.PlayOneShot(elevatorStartDownSFX); } else { elevatorAudio.PlayOneShot(elevatorStartUpSFX); } if (((NetworkBehaviour)this).IsServer) { SetElevatorMovingServerRpc(elevatorMovingDown); } } if (!((NetworkBehaviour)this).IsServer) { return; } if (elevatorFinishedMoving) { if (((NetworkBehaviour)this).IsServer && startedMusic) { playMusic = false; startedMusic = false; SetElevatorMusicServerRpc(setOn: false, selectedTrack); } } else if (((NetworkBehaviour)this).IsServer && !startedMusic) { startedMusic = true; playMusic = true; selectedTrack = Random.Range(0, elevatorJingleClips.Length); SetElevatorMusicServerRpc(setOn: true, selectedTrack); } if (elevatorFinishedMoving) { if (elevatorCalled) { if (callCooldown <= 0f) { SwitchElevatorDirection(); SetElevatorCalledClientRpc(setCalled: false, elevatorMovingDown); } else { callCooldown -= Time.deltaTime; } } } else if (elevatorFinishTimer <= 0f) { elevatorFinishedMoving = true; PlayFinishAudio(!elevatorMovingDown); ElevatorFinishServerRpc(!elevatorMovingDown); } else { elevatorFinishTimer -= Time.deltaTime; } } private void SwitchElevatorDirection() { if (!permanentlyDisabled) { elevatorMovingDown = !elevatorMovingDown; elevatorFinishedMoving = false; elevatorFinishTimer = 14f; elevatorCalled = false; SetElevatorFinishedMovingClientRpc(finished: false); } } [ClientRpc] public void SetElevatorFinishedMovingClientRpc(bool finished) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(529070910u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref finished, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 529070910u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { elevatorFinishedMoving = finished; } } } public void AnimationEvent_ElevatorFinishTop() { if (!elevatorMovingDown && !elevatorFinishedMoving) { elevatorFinishedMoving = true; if (((NetworkBehaviour)this).IsServer) { PlayFinishAudio(!elevatorMovingDown); ElevatorFinishServerRpc(!elevatorMovingDown); } } } public void AnimationEvent_ElevatorStartFromBottom() { ShakePlayerCamera(shakeHard: false); } public void AnimationEvent_ElevatorHitBottom() { ShakePlayerCamera(shakeHard: true); } public void AnimationEvent_ElevatorTravel() { elevatorAudio.PlayOneShot(elevatorTravelSFX); } public void AnimationEvent_ElevatorFinishBottom() { if (elevatorMovingDown && !elevatorFinishedMoving) { elevatorFinishedMoving = true; if (((NetworkBehaviour)this).IsServer) { PlayFinishAudio(!elevatorMovingDown); ElevatorFinishServerRpc(!elevatorMovingDown); } } } private void ShakePlayerCamera(bool shakeHard) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (Vector3.Distance(((Component)StartOfRound.Instance.audioListener).transform.position, elevatorPoint.position) < 4f) { if (shakeHard) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); } else { HUDManager.Instance.ShakeCamera((ScreenShakeType)2); } } } [ServerRpc] public void ElevatorFinishServerRpc(bool atTop) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: 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_00dd: 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(3790258295u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref atTop, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3790258295u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; ElevatorFinishClientRpc(atTop); } } [ClientRpc] public void ElevatorFinishClientRpc(bool atTop) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1937480629u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref atTop, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1937480629u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { PlayFinishAudio(atTop); elevatorFinishedMoving = true; } } } private void PlayFinishAudio(bool atTop) { if (atTop) { elevatorAudio.PlayOneShot(elevatorFinishUpSFX); } else { elevatorAudio.PlayOneShot(elevatorFinishDownSFX); } } public void PlayCrashClip() { HUDManager.Instance.ShakeCamera((ScreenShakeType)3); elevatorAudio.PlayOneShot(elevatorCrashSFX); permanentlyDisabled = true; } public void PlaySmashClip() { HUDManager.Instance.ShakeCamera((ScreenShakeType)3); elevatorAudioTop.PlayOneShot(elevatorSmashSFX); permanentlyDisabled = true; } public void AnimationEvent_DoCrashDamage() { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) if (((Component)crashDamageTrigger).CompareTag("Player") && Object.op_Implicit((Object)(object)((Component)crashDamageTrigger).gameObject.GetComponent()) && ((NetworkBehaviour)((Component)crashDamageTrigger).gameObject.GetComponent()).IsOwner && !((Component)crashDamageTrigger).gameObject.GetComponent().isPlayerDead) { ((Component)crashDamageTrigger).gameObject.GetComponent().DamagePlayer(30, true, true, (CauseOfDeath)16, 0, false, default(Vector3)); return; } Bounds bounds = crashDamageTrigger.bounds; if (((Bounds)(ref bounds)).Contains(((Component)GameNetworkManager.Instance.localPlayerController).transform.position)) { GameNetworkManager.Instance.localPlayerController.DamagePlayer(30, true, true, (CauseOfDeath)16, 0, false, default(Vector3)); } } [ServerRpc] public void SetElevatorMovingServerRpc(bool movingDown) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Invalid comparison between Unknown and I4 //IL_0122: 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_00dd: 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(4177772202u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref movingDown, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4177772202u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetElevatorMovingClientRpc(movingDown); } } [ClientRpc] public void SetElevatorMovingClientRpc(bool movingDown) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2992794047u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref movingDown, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2992794047u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { elevatorMovingDown = movingDown; } } } [ServerRpc(RequireOwnership = false)] public void CallElevatorServerRpc(bool callDown) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3708986968u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref callDown, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3708986968u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; CallElevatorOnServer(callDown); } } } public void CallElevatorOnServer(bool callDown) { if (elevatorMovingDown != callDown) { elevatorCalled = true; callCooldown = 4f; SetElevatorCalledClientRpc(elevatorCalled, elevatorMovingDown); } } public void SetElevatorDoorOpen() { elevatorDoorOpen = true; } public void SetElevatorDoorClosed() { elevatorDoorOpen = false; } [ClientRpc] public void SetElevatorCalledClientRpc(bool setCalled, bool elevatorDown) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_0098: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3225999829u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref setCalled, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref elevatorDown, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3225999829u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer) { elevatorCalled = setCalled; elevatorMovingDown = elevatorDown; } } } public void CallElevator(bool callDown) { if (!permanentlyDisabled) { CallElevatorServerRpc(callDown); } } [ServerRpc(RequireOwnership = false)] public void PressElevatorButtonServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2289072103u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2289072103u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; PressElevatorButtonOnServer(); } } } public void PressElevatorButtonOnServer(bool requireFinishedMoving = false) { if ((elevatorFinishedMoving || (elevatorFinishTimer < 0.16f && !requireFinishedMoving)) && !elevatorJingleMusic.isPlaying) { SwitchElevatorDirection(); } } public void PressElevatorButton() { if (!permanentlyDisabled) { PressElevatorButtonServerRpc(); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1040526011u, new RpcReceiveHandler(__rpc_handler_1040526011), "SetElevatorMusicServerRpc"); ((NetworkBehaviour)this).__registerRpc(4066554235u, new RpcReceiveHandler(__rpc_handler_4066554235), "SetElevatorMusicClientRpc"); ((NetworkBehaviour)this).__registerRpc(529070910u, new RpcReceiveHandler(__rpc_handler_529070910), "SetElevatorFinishedMovingClientRpc"); ((NetworkBehaviour)this).__registerRpc(3790258295u, new RpcReceiveHandler(__rpc_handler_3790258295), "ElevatorFinishServerRpc"); ((NetworkBehaviour)this).__registerRpc(1937480629u, new RpcReceiveHandler(__rpc_handler_1937480629), "ElevatorFinishClientRpc"); ((NetworkBehaviour)this).__registerRpc(4177772202u, new RpcReceiveHandler(__rpc_handler_4177772202), "SetElevatorMovingServerRpc"); ((NetworkBehaviour)this).__registerRpc(2992794047u, new RpcReceiveHandler(__rpc_handler_2992794047), "SetElevatorMovingClientRpc"); ((NetworkBehaviour)this).__registerRpc(3708986968u, new RpcReceiveHandler(__rpc_handler_3708986968), "CallElevatorServerRpc"); ((NetworkBehaviour)this).__registerRpc(3225999829u, new RpcReceiveHandler(__rpc_handler_3225999829), "SetElevatorCalledClientRpc"); ((NetworkBehaviour)this).__registerRpc(2289072103u, new RpcReceiveHandler(__rpc_handler_2289072103), "PressElevatorButtonServerRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1040526011(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_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 { bool setOn = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setOn, default(ForPrimitives)); int track = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref track); target.__rpc_exec_stage = (__RpcExecStage)1; ((CustomElevatorController)(object)target).SetElevatorMusicServerRpc(setOn, track); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4066554235(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 setOn = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setOn, default(ForPrimitives)); int track = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref track); target.__rpc_exec_stage = (__RpcExecStage)1; ((CustomElevatorController)(object)target).SetElevatorMusicClientRpc(setOn, track); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_529070910(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 elevatorFinishedMovingClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref elevatorFinishedMovingClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CustomElevatorController)(object)target).SetElevatorFinishedMovingClientRpc(elevatorFinishedMovingClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3790258295(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_0091: 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_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 { bool atTop = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref atTop, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CustomElevatorController)(object)target).ElevatorFinishServerRpc(atTop); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1937480629(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 atTop = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref atTop, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CustomElevatorController)(object)target).ElevatorFinishClientRpc(atTop); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4177772202(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_0091: 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_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 { bool elevatorMovingServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref elevatorMovingServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CustomElevatorController)(object)target).SetElevatorMovingServerRpc(elevatorMovingServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2992794047(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 elevatorMovingClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref elevatorMovingClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CustomElevatorController)(object)target).SetElevatorMovingClientRpc(elevatorMovingClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3708986968(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 callDown = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref callDown, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CustomElevatorController)(object)target).CallElevatorServerRpc(callDown); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3225999829(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_004a: 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) //IL_005f: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool setCalled = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setCalled, default(ForPrimitives)); bool elevatorDown = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref elevatorDown, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CustomElevatorController)(object)target).SetElevatorCalledClientRpc(setCalled, elevatorDown); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2289072103(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; ((CustomElevatorController)(object)target).PressElevatorButtonServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "CustomElevatorController"; } } public class DamageAtPosition : MonoBehaviour { public Transform damagePoint; public int damage = -1; public float range; public bool useAxis; public Transform axisMarker; public void DamagePlayerByPosition() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (!((Object)(object)localPlayerController != (Object)null) || localPlayerController.isPlayerDead) { return; } Vector3 position = damagePoint.position; Vector3 val = Vector3.zero; Vector3 val2 = Vector3.zero; if (useAxis) { val = ((Component)localPlayerController).transform.position - position; val2 = axisMarker.position - position; } if (Vector3.Distance(((Component)localPlayerController).transform.position, position) < range && ((useAxis && (double)Mathf.Abs(Vector3.Dot(Vector3.Normalize(val2), Vector3.Normalize(val))) > 0.985) || !useAxis)) { if (damage > 0) { localPlayerController.DamagePlayer(damage, true, true, (CauseOfDeath)8, 0, false, default(Vector3)); } else { localPlayerController.KillPlayer(Vector3.zero, true, (CauseOfDeath)8, 0, default(Vector3), false); } } } } public class FallDamageTrigger : MonoBehaviour { public static bool fallImmune; private bool inTrigger = false; private int frameCounter = 0; private void Update() { if (fallImmune && !inTrigger) { frameCounter++; if (frameCounter > 5) { fallImmune = false; frameCounter = 0; } } if (inTrigger) { inTrigger = false; } } private void OnTriggerStay(Collider other) { if (((Component)other).CompareTag("Player") && Object.op_Implicit((Object)(object)((Component)other).gameObject.GetComponent()) && ((NetworkBehaviour)((Component)other).gameObject.GetComponent()).IsOwner && !((Component)other).gameObject.GetComponent().isPlayerDead) { frameCounter = 0; inTrigger = true; fallImmune = true; } } private void OnTriggerExit(Collider other) { if (((Component)other).CompareTag("Player") && Object.op_Implicit((Object)(object)((Component)other).gameObject.GetComponent()) && ((NetworkBehaviour)((Component)other).gameObject.GetComponent()).IsOwner) { inTrigger = false; fallImmune = false; frameCounter = 0; } } } public class InsertApparatus : NetworkBehaviour { public StartOfRound playersManager; public InteractTrigger insertTrigger; public AnimatedObjectTrigger insertionAnimator; public static bool isInserted; public static bool doingInsertion; public NetworkObject apparatusContainer; private NetworkObject networkedApp; private bool initialSet = true; public static GrabbableObject? insertedApparatus; private void Update() { if (initialSet) { ApparatusRotationPatch.posSet = true; ApparatusRotationPatch.initialSet = true; playersManager = Object.FindObjectOfType(); insertedApparatus = null; doingInsertion = false; isInserted = false; initialSet = false; } if (!isInserted) { if ((Object)(object)GameNetworkManager.Instance.localPlayerController.currentlyHeldObjectServer != (Object)null && (Object)(object)GameNetworkManager.Instance.localPlayerController.currentlyHeldObjectServer.itemProperties != (Object)null && IsApparatus(GameNetworkManager.Instance.localPlayerController.currentlyHeldObjectServer.itemProperties.itemName)) { if (StartOfRound.Instance.localPlayerUsingController) { insertTrigger.hoverTip = "Insert apparatus: [D-pad up]"; } else { insertTrigger.hoverTip = "Insert apparatus: [ E ]"; } } else { insertTrigger.hoverTip = "Nothing to insert"; } } else { if (!((Object)(object)insertedApparatus == (Object)null)) { return; } GameObject val = GameObject.Find("WitherLungPosition"); if ((Object)(object)val != (Object)null) { GrabbableObject componentInChildren = val.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { insertedApparatus = componentInChildren; } } } } public static bool IsApparatus(string name, bool onlyDying = false) { return ((name.Contains("Apparatus") || name.Contains("apparatus")) && !name.Contains("concept") && !onlyDying) || name == "Dying apparatus"; } public void InsertItem() { //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (!((Object)(object)localPlayerController.currentlyHeldObjectServer != (Object)null) || !IsApparatus(localPlayerController.currentlyHeldObjectServer.itemProperties.itemName, Wither.DyingApparatusOnly.Value) || localPlayerController.isGrabbingObjectAnimation) { return; } insertionAnimator.TriggerAnimation(localPlayerController); AnimatedLightsManager.Instance.PowerOn(ignoreCheck: true); if ((Object)(object)localPlayerController.currentlyHeldObjectServer.radarIcon != (Object)null) { Object.Destroy((Object)(object)((Component)localPlayerController.currentlyHeldObjectServer.radarIcon).gameObject); } if ((Object)(object)((Component)localPlayerController.currentlyHeldObjectServer).gameObject.GetComponentInChildren() != (Object)null) { Object.Destroy((Object)(object)((Component)((Component)localPlayerController.currentlyHeldObjectServer).gameObject.GetComponentInChildren()).gameObject); } AudioSource[] componentsInChildren = ((Component)localPlayerController.currentlyHeldObjectServer).GetComponentsInChildren(); if (componentsInChildren != null) { AudioSource[] array = componentsInChildren; foreach (AudioSource val in array) { val.Stop(); } } DestroyChildObjectsServerRpc((int)localPlayerController.playerClientId); ParentObjectToSlotServerRpc(NetworkObjectReference.op_Implicit(((Component)localPlayerController.currentlyHeldObjectServer).gameObject.GetComponent())); localPlayerController.DiscardHeldObject(true, apparatusContainer, new Vector3(0f, 0f, 0f), false); AudioSource component = ((Component)apparatusContainer).GetComponent(); if ((Object)(object)component != (Object)null) { component.Play(); } else { Wither.Logger.LogError((object)"Null audio player!"); } } [ServerRpc(RequireOwnership = false)] public void DestroyChildObjectsServerRpc(int playerObj) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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(3246329587u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerObj); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3246329587u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; DestroyChildObjectsClientRpc(playerObj); } } } [ClientRpc] public void DestroyChildObjectsClientRpc(int playerObj) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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 != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4108723283u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerObj); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4108723283u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; doingInsertion = true; if ((Object)(object)playersManager.allPlayerScripts[playerObj] == (Object)(object)GameNetworkManager.Instance.localPlayerController) { return; } if ((Object)(object)playersManager.allPlayerScripts[playerObj].currentlyHeldObjectServer.radarIcon != (Object)null) { Object.Destroy((Object)(object)((Component)playersManager.allPlayerScripts[playerObj].currentlyHeldObjectServer.radarIcon).gameObject); } if ((Object)(object)((Component)((Component)playersManager.allPlayerScripts[playerObj].currentlyHeldObjectServer).gameObject.GetComponentInChildren()).gameObject != (Object)null) { Object.Destroy((Object)(object)((Component)((Component)playersManager.allPlayerScripts[playerObj].currentlyHeldObjectServer).gameObject.GetComponentInChildren()).gameObject); } AudioSource[] componentsInChildren = ((Component)playersManager.allPlayerScripts[playerObj].currentlyHeldObjectServer).GetComponentsInChildren(); if (componentsInChildren != null) { AudioSource[] array = componentsInChildren; foreach (AudioSource val3 in array) { val3.Stop(); } } AudioSource component = ((Component)apparatusContainer).GetComponent(); if ((Object)(object)component != (Object)null) { component.Play(); } else { Wither.Logger.LogError((object)"Null audio player!"); } } [ServerRpc(RequireOwnership = false)] public void ParentObjectToSlotServerRpc(NetworkObjectReference grabbableObjectNetObject) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_013f: 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 != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3403964814u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref grabbableObjectNetObject, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3403964814u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (((NetworkObjectReference)(ref grabbableObjectNetObject)).TryGet(ref networkedApp, (NetworkManager)null)) { Wither.Logger.LogDebug((object)$"Setting apparatus value to {((Component)networkedApp).gameObject.GetComponentInChildren().scrapValue}"); ItemDispenser.apparatusValue = ((Component)networkedApp).gameObject.GetComponentInChildren().scrapValue; ParentObjectToSlotClientRpc(grabbableObjectNetObject); } else { Wither.Logger.LogError((object)"ServerRpc: Could not find networked apparatus."); } } } [ClientRpc] public void ParentObjectToSlotClientRpc(NetworkObjectReference grabbableObjectNetObject) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1637632712u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref grabbableObjectNetObject, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1637632712u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (((NetworkObjectReference)(ref grabbableObjectNetObject)).TryGet(ref networkedApp, (NetworkManager)null)) { isInserted = true; ((Component)networkedApp).gameObject.GetComponentInChildren().EnablePhysics(false); ((Component)networkedApp).gameObject.GetComponentInChildren().grabbable = false; } else { Wither.Logger.LogError((object)"ClientRpc: Could not find networked apparatus."); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3246329587u, new RpcReceiveHandler(__rpc_handler_3246329587), "DestroyChildObjectsServerRpc"); ((NetworkBehaviour)this).__registerRpc(4108723283u, new RpcReceiveHandler(__rpc_handler_4108723283), "DestroyChildObjectsClientRpc"); ((NetworkBehaviour)this).__registerRpc(3403964814u, new RpcReceiveHandler(__rpc_handler_3403964814), "ParentObjectToSlotServerRpc"); ((NetworkBehaviour)this).__registerRpc(1637632712u, new RpcReceiveHandler(__rpc_handler_1637632712), "ParentObjectToSlotClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3246329587(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerObj = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerObj); target.__rpc_exec_stage = (__RpcExecStage)1; ((InsertApparatus)(object)target).DestroyChildObjectsServerRpc(playerObj); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4108723283(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerObj = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerObj); target.__rpc_exec_stage = (__RpcExecStage)1; ((InsertApparatus)(object)target).DestroyChildObjectsClientRpc(playerObj); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3403964814(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference grabbableObjectNetObject = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref grabbableObjectNetObject, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((InsertApparatus)(object)target).ParentObjectToSlotServerRpc(grabbableObjectNetObject); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1637632712(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference grabbableObjectNetObject = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref grabbableObjectNetObject, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((InsertApparatus)(object)target).ParentObjectToSlotClientRpc(grabbableObjectNetObject); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "InsertApparatus"; } } public class ItemDispenser : NetworkBehaviour { [CompilerGenerated] private sealed class d__11 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GrabbableObject gObject; public ItemDispenser <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 1; return true; case 1: <>1__state = -1; gObject.reachedFloorTarget = false; gObject.hasHitGround = false; gObject.fallTime = 0f; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__10 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public List witheredPrefabs; public ItemDispenser <>4__this; private int 5__1; private float 5__2; private float 5__3; private int 5__4; private GameObject 5__5; private GrabbableObject 5__6; private int 5__7; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__10(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__5 = null; 5__6 = null; <>1__state = -2; } private bool MoveNext() { //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = 0; break; case 1: <>1__state = -1; 5__5 = null; 5__6 = null; 5__1++; break; } if (5__1 < witheredPrefabs.Count) { 5__2 = (float)TimeOfDay.Instance.profitQuota * Wither.QuotaFraction.Value / 3f; if (5__2 < (float)minVal) { 5__2 = minVal; } 5__3 = <>4__this.randomWeights[5__1]; 5__2 *= 5__3; if (apparatusValue > 0) { 5__2 *= (float)apparatusValue / (float)Wither.ScalingBase.Value; } 5__4 = Mathf.RoundToInt(5__2); if (5__4 < minVal) { 5__4 = minVal; } else if (5__4 > maxVal) { 5__4 = maxVal; } if (5__1 == 3) { 5__4 = Mathf.RoundToInt((float)5__4 * Wither.ExtraMultiplier.Value); } 5__5 = Object.Instantiate(witheredPrefabs[5__1], <>4__this.targetPositions[5__1].position, Quaternion.identity, RoundManager.Instance.spawnedScrapContainer); 5__6 = 5__5.GetComponent(); 5__6.startFallingPosition = <>4__this.targetPositions[5__1].position; ((MonoBehaviour)<>4__this).StartCoroutine(<>4__this.SetObjectToHitGroundSFX(5__6)); 5__6.targetFloorPosition = 5__6.GetItemFloorPosition(((Component)5__6).transform.position); 5__6.SetScrapValue(5__4); 5__7 = Random.RandomRangeInt(0, 360); 5__6.floorYRot = 5__7; ((NetworkBehaviour)5__6).NetworkObject.Spawn(false); <>4__this.StartSpawningItemClientRpc(NetworkObjectReference.op_Implicit(5__5.GetComponent()), 5__4, <>4__this.targetPositions[5__1].position, 5__7, 5__1); <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__13 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public NetworkObjectReference netObjectRef; public int scrapValue; public Vector3 startFallingPos; public int randomYRot; public int index; public ItemDispenser <>4__this; private NetworkObject 5__1; private float 5__2; private GrabbableObject 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: 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_0053: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = null; 5__2 = Time.realtimeSinceStartup; goto IL_0064; case 1: <>1__state = -1; goto IL_0064; case 2: { <>1__state = -1; 5__3 = ((Component)5__1).GetComponent(); RoundManager instance = RoundManager.Instance; instance.totalScrapValueInLevel += (float)5__3.scrapValue; 5__3.SetScrapValue(scrapValue); 5__3.floorYRot = randomYRot; 5__3.startFallingPosition = startFallingPos; 5__3.fallTime = 0f; 5__3.hasHitGround = false; 5__3.reachedFloorTarget = false; return false; } IL_0064: if (Time.realtimeSinceStartup - 5__2 < 8f && !((NetworkObjectReference)(ref netObjectRef)).TryGet(ref 5__1, (NetworkManager)null)) { <>2__current = (object)new WaitForSeconds(0.03f); <>1__state = 1; return true; } if ((Object)(object)5__1 == (Object)null) { Wither.Logger.LogError((object)"No network object found for spawned scrap!"); return false; } <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public Transform[] targetPositions; public Animator[] lightAnimators; private float[] randomWeights = new float[4]; public AudioSource tentaclePreAudio; public AudioClip tentacleWarning; private static int minVal; private static int maxVal; public static int apparatusValue; public void Start() { if (((NetworkBehaviour)this).IsServer) { for (int i = 0; i < randomWeights.Length; i++) { randomWeights[i] = Random.Range(0.5f, 2.5f); } if (Wither.MinValue.Value > Wither.MaxValue.Value) { minVal = 50; maxVal = 300; } else { minVal = Wither.MinValue.Value; maxVal = Wither.MaxValue.Value; } } } public void SpawnItemsServer() { List list = (from x in PatchedContent.ExtendedItems.FindAll((ExtendedItem x) => ((ExtendedContent)x).ModName == "Wither" && x.Item.itemName != "Dying apparatus" && x.Item.itemName != "Ricardorb") orderby x.Item.itemName == "Withered clock" select x).ToList(); List witheredPrefabs = new List(); list.ForEach(delegate(ExtendedItem x) { witheredPrefabs.Add(x.Item.spawnPrefab); }); ((MonoBehaviour)this).StartCoroutine(SpawningRoutine(witheredPrefabs)); } [IteratorStateMachine(typeof(d__10))] public IEnumerator SpawningRoutine(List witheredPrefabs) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__10(0) { <>4__this = this, witheredPrefabs = witheredPrefabs }; } [IteratorStateMachine(typeof(d__11))] private IEnumerator SetObjectToHitGroundSFX(GrabbableObject gObject) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__11(0) { <>4__this = this, gObject = gObject }; } [ClientRpc] public void StartSpawningItemClientRpc(NetworkObjectReference netObjectRef, int scrapValue, Vector3 startFallingPos, int randomYRot, int index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: 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_00a6: 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_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0186: 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 != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(242696409u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref netObjectRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, scrapValue); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref startFallingPos); BytePacker.WriteValueBitPacked(val2, randomYRot); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 242696409u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; lightAnimators[index].SetTrigger("switchOn"); if (index == randomWeights.Length - 1) { HUDManager.Instance.ShakeCamera((ScreenShakeType)1); tentaclePreAudio.PlayOneShot(tentacleWarning); WalkieTalkie.TransmitOneShotAudio(tentaclePreAudio, tentacleWarning, 1f); } if (!((NetworkBehaviour)this).IsServer) { ((MonoBehaviour)this).StartCoroutine(WaitForItemToSpawn(netObjectRef, scrapValue, startFallingPos, randomYRot, index)); } } } [IteratorStateMachine(typeof(d__13))] private IEnumerator WaitForItemToSpawn(NetworkObjectReference netObjectRef, int scrapValue, Vector3 startFallingPos, int randomYRot, int index) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__13(0) { <>4__this = this, netObjectRef = netObjectRef, scrapValue = scrapValue, startFallingPos = startFallingPos, randomYRot = randomYRot, index = index }; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(242696409u, new RpcReceiveHandler(__rpc_handler_242696409), "StartSpawningItemClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_242696409(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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference netObjectRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref netObjectRef, default(ForNetworkSerializable)); int scrapValue = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref scrapValue); Vector3 startFallingPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref startFallingPos); int randomYRot = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref randomYRot); int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((ItemDispenser)(object)target).StartSpawningItemClientRpc(netObjectRef, scrapValue, startFallingPos, randomYRot, index); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "ItemDispenser"; } } public class LasherCollision : MonoBehaviour, IHittable { [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public LasherCollision <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.lasherScript.ignoreLocalPlayer = true; <>2__current = (object)new WaitForSeconds(0.7f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.lasherScript.ignoreLocalPlayer = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public WitheredLasher lasherScript; public int tentacleIndex = -1; bool IHittable.Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit, bool playHitSFX, int hitID) { if (lasherScript.doingCollisions) { lasherScript.KillLasherLocal(); return true; } return false; } private void OnTriggerEnter(Collider other) { //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) if (!lasherScript.doingCollisions || !((Component)other).CompareTag("Player") || !Object.op_Implicit((Object)(object)((Component)other).gameObject.GetComponent())) { return; } PlayerControllerB component = ((Component)other).gameObject.GetComponent(); if (!((NetworkBehaviour)component).IsOwner || component.isPlayerDead || lasherScript.ignoreLocalPlayer) { return; } if (component.health > 30) { lasherScript.tentacleSFX.PlayOneShot(lasherScript.hitPlayerClip); float num = Vector3.Distance(((Component)component).transform.position, ((Component)this).transform.position); Vector3 val = Vector3.Normalize(((Component)component).transform.position + Vector3.up * num - ((Component)this).transform.position); Vector3 val2 = val * 15f + (1f - Vector3.Dot(val, Vector3.up)) * Vector3.up * 30f; component.DamagePlayer(30, true, true, (CauseOfDeath)4, 0, false, default(Vector3)); component.externalForceAutoFade += val2; ((MonoBehaviour)this).StartCoroutine(InvulnerabilityFrames()); } else { component.KillPlayer(Vector3.zero, true, (CauseOfDeath)4, 0, default(Vector3), false); if (lasherScript.grabber) { lasherScript.GrabPlayerCorpseLocal((int)GameNetworkManager.Instance.localPlayerController.playerClientId, tentacleIndex); } } } [IteratorStateMachine(typeof(d__4))] private IEnumerator InvulnerabilityFrames() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { <>4__this = this }; } } public class PulleyScript : NetworkBehaviour { public Animator pulleyAnimator; public AudioClip wheelSound; public AudioSource wheelAudio; private bool sendingRPC = false; public void TurnWheel() { SetAnimBool(set: true); sendingRPC = true; SetAnimBoolServerRpc(set: true); } public void StartPulling() { SetAnimBool(set: true); } public void StopPulling() { SetAnimBool(); } public void OffGround() { pulleyAnimator.SetBool("grounded", false); } public void OnGround() { pulleyAnimator.SetBool("grounded", true); } [ServerRpc(RequireOwnership = false)] private void SetAnimBoolServerRpc(bool set = false) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3093242825u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref set, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3093242825u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; SetAnimBoolClientRpc(set); } } } [ClientRpc] private void SetAnimBoolClientRpc(bool set) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1829127847u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref set, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1829127847u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (sendingRPC) { sendingRPC = false; } else { SetAnimBool(set); } } } private void SetAnimBool(bool set = false) { pulleyAnimator.SetBool("pulling", set); if (set) { wheelAudio.PlayOneShot(wheelSound); WalkieTalkie.TransmitOneShotAudio(wheelAudio, wheelSound, 1f); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3093242825u, new RpcReceiveHandler(__rpc_handler_3093242825), "SetAnimBoolServerRpc"); ((NetworkBehaviour)this).__registerRpc(1829127847u, new RpcReceiveHandler(__rpc_handler_1829127847), "SetAnimBoolClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_3093242825(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 animBoolServerRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref animBoolServerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PulleyScript)(object)target).SetAnimBoolServerRpc(animBoolServerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1829127847(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 animBoolClientRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref animBoolClientRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((PulleyScript)(object)target).SetAnimBoolClientRpc(animBoolClientRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "PulleyScript"; } } public class WitheredClockProp : GrabbableObject { public Transform hourHand; public Transform minuteHand; public Transform secondHand; private float timeOfLastSecond; private float timeOfLastInterval; private float intervalLength = 10f; private int secondsPassed; private int minutesPassed; public AudioSource tickAudio; public AudioSource gearAudio; public AudioClip tickSFX; public AudioClip tockSFX; public float targetTimeMultiplier = 1f; private float timeMultiplier = 1f; private float trueMultiplier = 1f; private bool tickOrTock; private int timesPlayedInOneSpot; private Vector3 lastPosition; private bool fastMode = false; public override void Update() { ((GrabbableObject)this).Update(); if (!base.isHeld && !base.isPocketed) { return; } if (((NetworkBehaviour)this).IsOwner && Time.realtimeSinceStartup - timeOfLastInterval > intervalLength) { if (Random.Range(0, 2) == 0) { targetTimeMultiplier = Random.Range(1f, 41f); } else { targetTimeMultiplier = Random.Range(-1f, -3f); } intervalLength = Random.Range(5, 11); fastMode = false; timeOfLastSecond = Time.realtimeSinceStartup; timeOfLastInterval = Time.realtimeSinceStartup; ChangeMultServerRpc(targetTimeMultiplier, intervalLength); } if (timeMultiplier > targetTimeMultiplier) { timeMultiplier -= 0.05f; } else { timeMultiplier += 0.05f; } if (Mathf.Abs(timeMultiplier - targetTimeMultiplier) > 0.1f) { timeOfLastInterval = Time.realtimeSinceStartup; } trueMultiplier = ((timeMultiplier > 0f) ? (1f / timeMultiplier) : (0f - timeMultiplier)); if (timeMultiplier > 21f || (fastMode && !((NetworkBehaviour)this).IsOwner)) { secondHand.Rotate(-6f, 0f, 0f, (Space)1); secondsPassed++; if (minutesPassed >= 60) { minutesPassed = 0; } if (secondsPassed >= 60) { secondsPassed = 0; minutesPassed++; minuteHand.Rotate(-6f, 0f, 0f, (Space)1); if (minutesPassed % 6 == 0) { hourHand.Rotate(-3f, 0f, 0f, (Space)1); } } if (!fastMode && ((NetworkBehaviour)this).IsOwner) { fastMode = true; ToggleFastServerRpc(on: true); } } else if (Time.realtimeSinceStartup - timeOfLastSecond > trueMultiplier) { if (((NetworkBehaviour)this).IsOwner && gearAudio.isPlaying) { ToggleFastServerRpc(on: false); } secondHand.Rotate(-6f, 0f, 0f, (Space)1); secondsPassed++; if (minutesPassed >= 60) { minutesPassed = 0; } if (secondsPassed >= 60) { secondsPassed = 0; minutesPassed++; minuteHand.Rotate(-6f, 0f, 0f, (Space)1); if (minutesPassed % 6 == 0) { hourHand.Rotate(-3f, 0f, 0f, (Space)1); } } timeOfLastSecond = Time.realtimeSinceStartup; tickOrTock = !tickOrTock; if (tickOrTock) { tickAudio.PlayOneShot(tickSFX); } else { tickAudio.PlayOneShot(tockSFX); } } else { gearAudio.Stop(); } } [ServerRpc(RequireOwnership = false)] public void ChangeMultServerRpc(float mult, float length) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_0098: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1795084848u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref mult, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref length, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1795084848u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ChangeMultClientRpc(mult, length); } } } [ClientRpc] public void ChangeMultClientRpc(float mult, float length) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_0098: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3184187498u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref mult, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref length, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3184187498u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsOwner) { targetTimeMultiplier = mult; intervalLength = length; timeOfLastSecond = Time.realtimeSinceStartup; timeOfLastInterval = Time.realtimeSinceStartup; } } } [ServerRpc(RequireOwnership = false)] public void ToggleFastServerRpc(bool on) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(432877201u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref on, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 432877201u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ToggleFastClientRpc(on); } } } [ClientRpc] public void ToggleFastClientRpc(bool on) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3078789178u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref on, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3078789178u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (on) { if (!gearAudio.isPlaying) { gearAudio.Play(); } fastMode = true; if (Vector3.Distance(lastPosition, ((Component)this).transform.position) < 4f) { timesPlayedInOneSpot++; } else { timesPlayedInOneSpot = 0; } RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 17f, 0.55f, timesPlayedInOneSpot, base.isInElevator && StartOfRound.Instance.hangarDoorsClosed, 0); lastPosition = ((Component)this).transform.position; } else { gearAudio.Stop(); fastMode = false; } } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); gearAudio.Stop(); fastMode = false; } protected override void __initializeVariables() { ((GrabbableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1795084848u, new RpcReceiveHandler(__rpc_handler_1795084848), "ChangeMultServerRpc"); ((NetworkBehaviour)this).__registerRpc(3184187498u, new RpcReceiveHandler(__rpc_handler_3184187498), "ChangeMultClientRpc"); ((NetworkBehaviour)this).__registerRpc(432877201u, new RpcReceiveHandler(__rpc_handler_432877201), "ToggleFastServerRpc"); ((NetworkBehaviour)this).__registerRpc(3078789178u, new RpcReceiveHandler(__rpc_handler_3078789178), "ToggleFastClientRpc"); ((GrabbableObject)this).__initializeRpcs(); } private static void __rpc_handler_1795084848(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_004a: 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) //IL_005f: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float mult = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref mult, default(ForPrimitives)); float length = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref length, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((WitheredClockProp)(object)target).ChangeMultServerRpc(mult, length); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3184187498(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_004a: 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) //IL_005f: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { float mult = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref mult, default(ForPrimitives)); float length = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref length, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((WitheredClockProp)(object)target).ChangeMultClientRpc(mult, length); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_432877201(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 on = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref on, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((WitheredClockProp)(object)target).ToggleFastServerRpc(on); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3078789178(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 on = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref on, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((WitheredClockProp)(object)target).ToggleFastClientRpc(on); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "WitheredClockProp"; } } public class WitheredLasher : NetworkBehaviour { [CompilerGenerated] private sealed class <>c__DisplayClass30_0 { public PlayerControllerB playerDying; public float startTime; internal bool b__0() { return (Object)(object)playerDying.deadBody != (Object)null || Time.timeSinceLevelLoad - startTime > 4f; } } [CompilerGenerated] private sealed class d__30 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public int playerID; public int index; public WitheredLasher <>4__this; private <>c__DisplayClass30_0 <>8__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__30(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass30_0(); <>8__1.playerDying = StartOfRound.Instance.allPlayerScripts[playerID]; <>8__1.startTime = Time.timeSinceLevelLoad; <>2__current = (object)new WaitUntil((Func)(() => (Object)(object)<>8__1.playerDying.deadBody != (Object)null || Time.timeSinceLevelLoad - <>8__1.startTime > 4f)); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)<>8__1.playerDying.deadBody != (Object)null) { if (<>4__this.groupAnimation && index != -1) { <>8__1.playerDying.deadBody.attachedTo = <>4__this.tentacleGrabPointArray[index]; } else { <>8__1.playerDying.deadBody.attachedTo = <>4__this.tentacleGrabPoint; } <>8__1.playerDying.deadBody.attachedLimb = <>8__1.playerDying.deadBody.bodyParts[6]; <>8__1.playerDying.deadBody.matchPositionExactly = true; <>4__this.currentlyHeldBody = <>8__1.playerDying.deadBody; if (<>4__this.groupAnimation) { <>4__this.KillLasher(); } } else { Wither.Logger.LogInfo((object)"Player body was not spawned in time for animation."); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public Animator mainAnimator; public Animator[] groupAnimators; public bool groupAnimation = false; public bool linkedAnimation = false; public bool grabber = true; public AudioSource tentacleSFX; public AudioSource slitherSFX; public AudioClip[] damagedClips; public AudioClip hitGroundClip; public AudioClip spawnRoarClip; public AudioClip hitPlayerClip; private bool sendingRPC1 = false; private bool sendingRPC2 = false; public Transform tentacleGrabPoint; public Transform[] tentacleGrabPointArray; private DeadBodyInfo currentlyHeldBody; public float speedOverride = -1f; public bool doingCollisions = false; private bool stopCollisions = false; public bool ignoreLocalPlayer = false; public void SpawnLasher() { if (!((Component)this).gameObject.GetComponent().IsSpawned && ((NetworkBehaviour)this).IsServer) { ((Component)this).GetComponent().Spawn(false); } slitherSFX.Play(); if (groupAnimation || linkedAnimation) { if (groupAnimation) { doingCollisions = true; } Animator[] array = groupAnimators; foreach (Animator val in array) { val.SetTrigger("start"); if (speedOverride > 0f) { val.speed = speedOverride; } } } else { mainAnimator.SetTrigger("start"); if (speedOverride > 0f) { mainAnimator.speed = speedOverride; } } } public void KillLasher() { if (!doingCollisions || stopCollisions) { return; } doingCollisions = false; stopCollisions = true; int num = Random.Range(0, damagedClips.Length); tentacleSFX.PlayOneShot(damagedClips[num]); WalkieTalkie.TransmitOneShotAudio(tentacleSFX, damagedClips[num], 1f); slitherSFX.Stop(); if (groupAnimation || linkedAnimation) { if (groupAnimation) { doingCollisions = false; } Animator[] array = groupAnimators; foreach (Animator val in array) { val.SetTrigger("kill"); if (speedOverride > 0f) { val.speed = 1f; } } } else { mainAnimator.SetTrigger("kill"); if (speedOverride > 0f) { mainAnimator.speed = 1f; } } ScanNodeProperties[] componentsInChildren = ((Component)this).gameObject.GetComponentsInChildren(); ScanNodeProperties[] array2 = componentsInChildren; foreach (ScanNodeProperties val2 in array2) { ((Component)val2).gameObject.SetActive(false); } } public void KillLasherLocal() { KillLasher(); sendingRPC1 = true; KillLasherServerRpc(); } [ServerRpc(RequireOwnership = false)] public void KillLasherServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(327888058u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 327888058u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; KillLasherClientRpc(); } } } [ClientRpc] public void KillLasherClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2301435677u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2301435677u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (sendingRPC1) { sendingRPC1 = false; } else { KillLasher(); } } } public void DeathFlopAudio() { tentacleSFX.PlayOneShot(hitGroundClip); WalkieTalkie.TransmitOneShotAudio(tentacleSFX, hitGroundClip, 1f); } public void SpawnAudio() { tentacleSFX.PlayOneShot(spawnRoarClip); WalkieTalkie.TransmitOneShotAudio(tentacleSFX, spawnRoarClip, 1f); } public void GrabPlayerCorpseLocal(int playerID, int index) { sendingRPC2 = true; ((MonoBehaviour)this).StartCoroutine(GrabPlayerCorpse(playerID, index)); GrabPlayerCorpseServerRpc(playerID, index); } [ServerRpc(RequireOwnership = false)] public void GrabPlayerCorpseServerRpc(int playerID, int index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1098312867u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1098312867u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; GrabPlayerCorpseClientRpc(playerID, index); } } } [ClientRpc] public void GrabPlayerCorpseClientRpc(int playerID, int index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3286647897u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerID); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3286647897u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (sendingRPC2) { sendingRPC2 = false; } else { ((MonoBehaviour)this).StartCoroutine(GrabPlayerCorpse(playerID, index)); } } } [IteratorStateMachine(typeof(d__30))] private IEnumerator GrabPlayerCorpse(int playerID, int index) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__30(0) { <>4__this = this, playerID = playerID, index = index }; } public void AnimationEvent_ReleaseCorpse() { if ((Object)(object)currentlyHeldBody != (Object)null) { currentlyHeldBody.attachedTo = null; currentlyHeldBody.attachedLimb = null; currentlyHeldBody.matchPositionExactly = false; } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(327888058u, new RpcReceiveHandler(__rpc_handler_327888058), "KillLasherServerRpc"); ((NetworkBehaviour)this).__registerRpc(2301435677u, new RpcReceiveHandler(__rpc_handler_2301435677), "KillLasherClientRpc"); ((NetworkBehaviour)this).__registerRpc(1098312867u, new RpcReceiveHandler(__rpc_handler_1098312867), "GrabPlayerCorpseServerRpc"); ((NetworkBehaviour)this).__registerRpc(3286647897u, new RpcReceiveHandler(__rpc_handler_3286647897), "GrabPlayerCorpseClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_327888058(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; ((WitheredLasher)(object)target).KillLasherServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2301435677(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; ((WitheredLasher)(object)target).KillLasherClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1098312867(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((WitheredLasher)(object)target).GrabPlayerCorpseServerRpc(playerID, index); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3286647897(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerID); int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((WitheredLasher)(object)target).GrabPlayerCorpseClientRpc(playerID, index); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "WitheredLasher"; } } } namespace Wither.Inside { public class InFactoryTrigger : NetworkBehaviour { public static List playersInFalseInterior = new List(); public static bool isInFalseInterior = false; private void Awake() { isInFalseInterior = false; playersInFalseInterior.Clear(); } private void OnTriggerEnter(Collider other) { PlayerControllerB component = ((Component)other).gameObject.GetComponent(); if ((Object)(object)component == (Object)null) { return; } component.isInElevator = false; component.isInHangarShipRoom = false; for (int i = 0; i < component.ItemSlots.Length; i++) { if ((Object)(object)component.ItemSlots[i] != (Object)null) { component.ItemSlots[i].isInFactory = true; } } if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)component) { isInFalseInterior = true; } else { int num = (int)component.playerClientId; if (num >= 0 && !playersInFalseInterior.Contains(num)) { playersInFalseInterior.Add(num); } } component.isInsideFactory = true; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "InFactoryTrigger"; } } public class SetWeatherMrov : NetworkBehaviour { public static void EnableWeather() { WeatherEffectController.EnableCurrentWeatherEffects(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SetWeatherMrov"; } } public class TeleportDirect : NetworkBehaviour { public Transform destPoint; public static StartOfRound playersManager; public int audioReverbPreset = -1; public AudioSource entrancePointAudio; public AudioSource destPointAudio; public AudioClip[] doorAudios; private InteractTrigger triggerScript; public bool isEntrance = false; private void Awake() { playersManager = Object.FindObjectOfType(); triggerScript = ((Component)this).gameObject.GetComponent(); } public void TeleportPlayer() { //IL_0021: 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_007b: 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) Transform thisPlayerBody = GameNetworkManager.Instance.localPlayerController.thisPlayerBody; GameNetworkManager.Instance.localPlayerController.TeleportPlayer(destPoint.position, false, 0f, false, true); GameNetworkManager.Instance.localPlayerController.isInElevator = false; GameNetworkManager.Instance.localPlayerController.isInHangarShipRoom = false; thisPlayerBody.eulerAngles = new Vector3(destPoint.eulerAngles.x, destPoint.eulerAngles.y, destPoint.eulerAngles.z); SetAudioPreset((int)GameNetworkManager.Instance.localPlayerController.playerClientId); for (int i = 0; i < GameNetworkManager.Instance.localPlayerController.ItemSlots.Length; i++) { if ((Object)(object)GameNetworkManager.Instance.localPlayerController.ItemSlots[i] != (Object)null) { GameNetworkManager.Instance.localPlayerController.ItemSlots[i].isInFactory = isEntrance; } } InFactoryTrigger.isInFalseInterior = isEntrance; TeleportDirectPlayerServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId); GameNetworkManager.Instance.localPlayerController.isInsideFactory = isEntrance; if (Wither.mrovWeatherPresent) { SetWeatherMrov.EnableWeather(); } } [ServerRpc(RequireOwnership = false)] public void TeleportDirectPlayerServerRpc(int playerObj) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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(2069091040u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerObj); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2069091040u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; TeleportDirectPlayerClientRpc(playerObj); } } } [ClientRpc] public void TeleportDirectPlayerClientRpc(int playerObj) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0117: 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 != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1166191918u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerObj); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1166191918u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)playersManager.allPlayerScripts[playerObj] == (Object)(object)GameNetworkManager.Instance.localPlayerController) { return; } playersManager.allPlayerScripts[playerObj].TeleportPlayer(destPoint.position, true, destPoint.eulerAngles.y, false, true); playersManager.allPlayerScripts[playerObj].isInElevator = false; playersManager.allPlayerScripts[playerObj].isInHangarShipRoom = false; PlayAudioAtTeleportPositions(); playersManager.allPlayerScripts[playerObj].isInsideFactory = isEntrance; if (isEntrance && !InFactoryTrigger.playersInFalseInterior.Contains(playerObj)) { InFactoryTrigger.playersInFalseInterior.Add(playerObj); } for (int i = 0; i < playersManager.allPlayerScripts[playerObj].ItemSlots.Length; i++) { if ((Object)(object)playersManager.allPlayerScripts[playerObj].ItemSlots[i] != (Object)null) { playersManager.allPlayerScripts[playerObj].ItemSlots[i].isInFactory = isEntrance; } } if (GameNetworkManager.Instance.localPlayerController.isPlayerDead && (Object)(object)playersManager.allPlayerScripts[playerObj] == (Object)(object)GameNetworkManager.Instance.localPlayerController.spectatedPlayerScript) { SetAudioPreset(playerObj); } } private void SetAudioPreset(int playerObj) { if (audioReverbPreset != -1) { Object.FindObjectOfType().audioPresets[audioReverbPreset].ChangeAudioReverbForPlayer(StartOfRound.Instance.allPlayerScripts[playerObj]); if ((Object)(object)entrancePointAudio != (Object)null) { PlayAudioAtTeleportPositions(); } } } public void PlayAudioAtTeleportPositions() { if (doorAudios.Length != 0) { entrancePointAudio.PlayOneShot(doorAudios[Random.Range(0, doorAudios.Length)]); destPointAudio.PlayOneShot(doorAudios[Random.Range(0, doorAudios.Length)]); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2069091040u, new RpcReceiveHandler(__rpc_handler_2069091040), "TeleportDirectPlayerServerRpc"); ((NetworkBehaviour)this).__registerRpc(1166191918u, new RpcReceiveHandler(__rpc_handler_1166191918), "TeleportDirectPlayerClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2069091040(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerObj = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerObj); target.__rpc_exec_stage = (__RpcExecStage)1; ((TeleportDirect)(object)target).TeleportDirectPlayerServerRpc(playerObj); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1166191918(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerObj = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerObj); target.__rpc_exec_stage = (__RpcExecStage)1; ((TeleportDirect)(object)target).TeleportDirectPlayerClientRpc(playerObj); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "TeleportDirect"; } } } namespace Wither.Events { public class AnimatedLightsManager : NetworkBehaviour { [CompilerGenerated] private sealed class d__18 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GameObject light; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__18(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; light.SetActive(false); <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; case 1: <>1__state = -1; light.SetActive(true); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public Animator[] powerShutdownLinked; public Animator[] alarmLinked; public AudioSource interiorPower; public AudioClip powerOnClip; public AudioClip powerOffClip; public bool permanentlyOff = false; public static AnimatedLightsManager Instance { get; private set; } private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; return; } Object.Destroy((Object)(object)((Component)Instance).gameObject); Instance = this; } public void BeginAlarmSequence() { Animator[] array = alarmLinked; foreach (Animator val in array) { val.ResetTrigger("on"); val.ResetTrigger("off"); val.SetTrigger("alarm"); } } public void PulseAlarmOn() { Animator[] array = alarmLinked; foreach (Animator val in array) { val.SetBool("pulsing", true); } } public void PulseAlarmOff() { Animator[] array = alarmLinked; foreach (Animator val in array) { val.SetBool("pulsing", false); } } public void EndAlarmSequence() { Animator[] array = alarmLinked; foreach (Animator val in array) { val.ResetTrigger("on"); val.ResetTrigger("alarm"); val.SetTrigger("off"); } permanentlyOff = true; } public void PowerOn(bool ignoreCheck = false) { if (ignoreCheck || (!permanentlyOff && StartOfRound.Instance.shipHasLanded)) { interiorPower.PlayOneShot(powerOnClip); Animator[] array = powerShutdownLinked; foreach (Animator val in array) { val.ResetTrigger("off"); val.SetTrigger("on"); } } } public void PowerOff(bool ignoreCheck = false) { if (ignoreCheck || StartOfRound.Instance.shipHasLanded) { if (!permanentlyOff) { interiorPower.PlayOneShot(powerOffClip); } Animator[] array = powerShutdownLinked; foreach (Animator val in array) { val.ResetTrigger("on"); val.SetTrigger("off"); } } } public static void RestartLight(GameObject light) { if ((Object)(object)Instance != (Object)null) { ((MonoBehaviour)Instance).StartCoroutine(LightSwitcher(light)); } } [IteratorStateMachine(typeof(d__18))] private static IEnumerator LightSwitcher(GameObject light) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__18(0) { light = light }; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "AnimatedLightsManager"; } } public class AudioAnimationEventMultiple : MonoBehaviour { public AudioSource audioSource1; public AudioSource audioSource2; public AudioSource audioSource3; public AudioClip audioClip1; public AudioClip audioClip2; public AudioClip audioClip3; public float volume1 = 1f; public float volume2 = 1f; public float volume3 = 1f; public bool playAudibleNoise; public UnityEvent onAnimationEventCalled; public void PlayAudio1() { //IL_006a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)audioSource1 == (Object)null) && !((Object)(object)audioClip1 == (Object)null)) { audioSource1.PlayOneShot(audioClip1, volume1); WalkieTalkie.TransmitOneShotAudio(audioSource1, audioClip1, 1f); if (playAudibleNoise) { RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 10f, 0.65f, 0, false, 546); } } } public void PlayAudio2() { //IL_006a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)audioSource2 == (Object)null) && !((Object)(object)audioClip2 == (Object)null)) { audioSource2.PlayOneShot(audioClip2, volume2); WalkieTalkie.TransmitOneShotAudio(audioSource2, audioClip2, 1f); if (playAudibleNoise) { RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 10f, 0.65f, 0, false, 546); } } } public void PlayAudio3() { //IL_006a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)audioSource3 == (Object)null) && !((Object)(object)audioClip3 == (Object)null)) { audioSource3.PlayOneShot(audioClip3, volume3); WalkieTalkie.TransmitOneShotAudio(audioSource3, audioClip3, 1f); if (playAudibleNoise) { RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, 10f, 0.65f, 0, false, 546); } } } public void OnAnimationEvent() { onAnimationEventCalled.Invoke(); } } public class LasherManager : NetworkBehaviour { [CompilerGenerated] private sealed class d__11 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public LasherManager <>4__this; private WitheredLasher[] <>s__1; private int <>s__2; private WitheredLasher 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>s__1 = null; 5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>s__1 = <>4__this.lashers; <>s__2 = 0; break; case 1: <>1__state = -1; 5__3.SpawnLasher(); 5__3 = null; <>s__2++; break; } if (<>s__2 < <>s__1.Length) { 5__3 = <>s__1[<>s__2]; <>2__current = (object)new WaitForSeconds(0.4f); <>1__state = 1; return true; } <>s__1 = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public WitheredLasher[] lashers; public bool sendingRPC; public GameObject tentacleContainer; private bool deactivated = false; public static LasherManager Instance { get; private set; } private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; return; } Object.Destroy((Object)(object)((Component)Instance).gameObject); Instance = this; } public void InitialDeactivate() { if (!deactivated) { deactivated = true; tentacleContainer.SetActive(false); } } public void SpawnLashers() { deactivated = false; ((MonoBehaviour)this).StartCoroutine(LasherSpawningCycle()); } [IteratorStateMachine(typeof(d__11))] private IEnumerator LasherSpawningCycle() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__11(0) { <>4__this = this }; } public void KillLashers() { WitheredLasher[] array = lashers; foreach (WitheredLasher witheredLasher in array) { witheredLasher.KillLasher(); } } public void LasherEnemyScanLocal() { sendingRPC = true; LasherEnemyScan(); LasherEnemyScanServerRpc(); } [ServerRpc(RequireOwnership = false)] public void LasherEnemyScanServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2583260281u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2583260281u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; LasherEnemyScanClientRpc(); } } } [ClientRpc] public void LasherEnemyScanClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3563206484u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3563206484u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (sendingRPC) { sendingRPC = false; } else { LasherEnemyScan(); } } } public void LasherEnemyScan() { TerminalEntryPatches.unlocked = true; HUDManager.Instance.DisplayGlobalNotification("New creature data sent to terminal!"); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2583260281u, new RpcReceiveHandler(__rpc_handler_2583260281), "LasherEnemyScanServerRpc"); ((NetworkBehaviour)this).__registerRpc(3563206484u, new RpcReceiveHandler(__rpc_handler_3563206484), "LasherEnemyScanClientRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2583260281(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; ((LasherManager)(object)target).LasherEnemyScanServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3563206484(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; ((LasherManager)(object)target).LasherEnemyScanClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "LasherManager"; } } public class SpecialEventHandler : NetworkBehaviour { [CompilerGenerated] private sealed class d__55 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SpecialEventHandler <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__55(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.lightsManager.PulseAlarmOn(); <>2__current = (object)new WaitForSeconds(2.5f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.lightsManager.PulseAlarmOff(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__54 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SpecialEventHandler <>4__this; private InteractTrigger[] <>s__1; private int <>s__2; private InteractTrigger 5__3; private Animator[] <>s__4; private int <>s__5; private Animator 5__6; private ScanNodeProperties[] <>s__7; private int <>s__8; private ScanNodeProperties 5__9; private InteractTrigger[] <>s__10; private int <>s__11; private InteractTrigger 5__12; private AnimatedObjectTrigger 5__13; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__54(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>s__1 = null; 5__3 = null; <>s__4 = null; 5__6 = null; <>s__7 = null; 5__9 = null; <>s__10 = null; 5__12 = null; 5__13 = null; <>1__state = -2; } private bool MoveNext() { //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>s__1 = <>4__this.breakerTriggers; for (<>s__2 = 0; <>s__2 < <>s__1.Length; <>s__2++) { 5__3 = <>s__1[<>s__2]; 5__3.interactable = false; 5__3.disabledHoverTip = ""; 5__3 = null; } <>s__1 = null; <>s__4 = <>4__this.breakerAnimators; for (<>s__5 = 0; <>s__5 < <>s__4.Length; <>s__5++) { 5__6 = <>s__4[<>s__5]; 5__6.SetBool("on", false); 5__6 = null; } <>s__4 = null; <>s__7 = <>4__this.breakerScanNodes; for (<>s__8 = 0; <>s__8 < <>s__7.Length; <>s__8++) { 5__9 = <>s__7[<>s__8]; 5__9.subText = "Inoperable"; 5__9 = null; } <>s__7 = null; <>2__current = (object)new WaitForSeconds(1.7f); <>1__state = 1; return true; case 1: <>1__state = -1; <>s__10 = <>4__this.breakerTriggers; for (<>s__11 = 0; <>s__11 < <>s__10.Length; <>s__11++) { 5__12 = <>s__10[<>s__11]; if (((NetworkBehaviour)<>4__this).IsServer && Object.op_Implicit((Object)(object)((Component)5__12).GetComponent())) { 5__13 = ((Component)5__12).GetComponent(); if (5__13.boolValue) { 5__13.TriggerAnimation(GameNetworkManager.Instance.localPlayerController); } 5__13 = null; } 5__12 = null; } <>s__10 = null; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__49 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public SpecialEventHandler <>4__this; private MainModule
5__1; private Animator[] <>s__2; private int <>s__3; private Animator 5__4; private ScanNodeProperties[] <>s__5; private int <>s__6; private ScanNodeProperties 5__7; private InteractTrigger[] <>s__8; private int <>s__9; private InteractTrigger 5__10; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__49(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { //IL_0006: Unknown result type (might be due to invalid IL or missing references)
5__1 = default(MainModule); <>s__2 = null; 5__4 = null; <>s__5 = null; 5__7 = null; <>s__8 = null; 5__10 = null; <>1__state = -2; } private bool MoveNext() { //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected O, but got Unknown //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Expected O, but got Unknown //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Expected O, but got Unknown //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_04b5: Unknown result type (might be due to invalid IL or missing references) //IL_04bf: Expected O, but got Unknown //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Expected O, but got Unknown //IL_047f: Unknown result type (might be due to invalid IL or missing references) //IL_0489: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.buttonAnimator.SetTrigger("press"); <>4__this.buttonAudio.PlayOneShot(<>4__this.buttonSFX); WalkieTalkie.TransmitOneShotAudio(<>4__this.buttonAudio, <>4__this.buttonSFX, 1f); CustomElevatorController.permanentlyDisabled = true; <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.hatchAnimator.SetTrigger("openSmallHatch"); <>4__this.machinePlayer.PlayOneShot(<>4__this.dispenseClip); WalkieTalkie.TransmitOneShotAudio(<>4__this.machinePlayer, <>4__this.dispenseClip, 1f); <>2__current = (object)new WaitForSeconds(3f); <>1__state = 2; return true; case 2: <>1__state = -1; if (((NetworkBehaviour)<>4__this).IsServer) { <>4__this.dispenserScript.SpawnItemsServer(); } <>2__current = (object)new WaitForSeconds(7f); <>1__state = 3; return true; case 3: <>1__state = -1; <>4__this.lasherManager.tentacleContainer.SetActive(true); <>4__this.tentacleCutsceneAnimator.SetTrigger("start"); <>4__this.elevatorAnimator.SetTrigger("crash"); <>2__current = (object)new WaitForSeconds(2f); <>1__state = 4; return true; case 4: <>1__state = -1; <>4__this.lasherManager.SpawnLashers(); <>4__this.lightsManager.PulseAlarmOn(); <>4__this.lightsManager.BeginAlarmSequence(); <>4__this.waterDripParticles.Stop(); <>4__this.waterSFX.Stop();
5__1 = <>4__this.steamLeakParticles.main; ((MainModule)(ref
5__1)).loop = true; <>4__this.steamLeakParticles.Play(); <>4__this.steamSFX.Play(); <>4__this.steamFogAnimator.SetTrigger("enableFog"); ((Renderer)<>4__this.thinVentMesh).material = <>4__this.patchyGrateMat; <>s__2 = <>4__this.breakerAnimators; for (<>s__3 = 0; <>s__3 < <>s__2.Length; <>s__3++) { 5__4 = <>s__2[<>s__3]; 5__4.SetBool("on", true); 5__4 = null; } <>s__2 = null; <>s__5 = <>4__this.breakerScanNodes; for (<>s__6 = 0; <>s__6 < <>s__5.Length; <>s__6++) { 5__7 = <>s__5[<>s__6]; 5__7.subText = "Armed"; 5__7 = null; } <>s__5 = null; <>s__8 = <>4__this.breakerTriggers; for (<>s__9 = 0; <>s__9 < <>s__8.Length; <>s__9++) { 5__10 = <>s__8[<>s__9]; 5__10.interactable = true; 5__10 = null; } <>s__8 = null; if (<>4__this.garageDoorAnimator.GetBool("open") && ((NetworkBehaviour)<>4__this).IsServer) { <>4__this.garageLeverAnimTrigger.TriggerAnimation(GameNetworkManager.Instance.localPlayerController); <>4__this.garageDoorAnimTrigger.TriggerAnimation(GameNetworkManager.Instance.localPlayerController); } GreenDogPatch.checking = true; <>4__this.JLLSpawner.SetActive(true); <>4__this.alarmActive = true; <>2__current = (object)new WaitForSeconds(1.5f); <>1__state = 5; return true; case 5: <>1__state = -1; <>4__this.spikesAnimator.SetTrigger("emerge"); <>2__current = (object)new WaitForSeconds(3f); <>1__state = 6; return true; case 6: <>1__state = -1; GreenDogPatch.checking = false; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public Transform noisePosition; public bool alarmActive = false; public int loopCounter = 16; public AudioSource hornPlayer; public AudioSource machinePlayer; public AudioSource buttonAudio; public AudioClip rumbleClip; public AudioClip dispenseClip; public AudioClip buttonSFX; [Space(10f)] public GameObject JLLSpawner; public Animator tentacleCutsceneAnimator; public Animator elevatorAnimator; public Animator buttonAnimator; public Animator hatchAnimator; [Space(10f)] public Animator spikesAnimator; public Animator steamFogAnimator; public ParticleSystem steamLeakParticles; public AudioSource steamSFX; public ParticleSystem waterDripParticles; public AudioSource waterSFX; public MeshRenderer thinVentMesh; public Material patchyGrateMat; [Space(10f)] public Animator[] breakerAnimators; public InteractTrigger[] breakerTriggers; public ScanNodeProperties[] breakerScanNodes; [Space(10f)] public Animator garageDoorAnimator; public AnimatedObjectTrigger garageDoorAnimTrigger; public AnimatedObjectTrigger garageLeverAnimTrigger; [Space(10f)] public AnimatedLightsManager lightsManager; public ItemDispenser dispenserScript; public LasherManager lasherManager; [Space(10f)] public GameObject topFloorObjects; public GameObject interiorScrapDrop; public GameObject interiorBreakerBox; public GameObject exteriorBreakerBox; private float loopTimer = 2f; private bool sendingRPC1 = false; private bool sendingRPC2 = false; public static SpecialEventHandler Instance { get; private set; } private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; return; } Object.Destroy((Object)(object)((Component)Instance).gameObject); Instance = this; } private void Update() { if (alarmActive) { LoopAudio(); } } public void LoopAudio() { //IL_008f: Unknown result type (might be due to invalid IL or missing references) if (!hornPlayer.isPlaying) { hornPlayer.Play(); if (!GameNetworkManager.Instance.localPlayerController.isInsideFactory || InFactoryTrigger.isInFalseInterior) { ((MonoBehaviour)this).StartCoroutine(AlarmPulse()); HUDManager.Instance.ShakeCamera((ScreenShakeType)1); SoundManager.Instance.PlaySoundAroundLocalPlayer(rumbleClip, 0.65f); } } if (loopTimer <= 0f) { RoundManager.Instance.PlayAudibleNoise(noisePosition.position, 20f, 0.6f, 0, false, 0); loopTimer = 2f; } else { loopTimer -= Time.deltaTime; } } [ClientRpc] public void InitializeEventClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2852613662u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2852613662u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (sendingRPC1) { sendingRPC1 = false; } else { InitializeEvent(); } } } [ServerRpc(RequireOwnership = false)] public void InitializeEventServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(57409360u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 57409360u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; InitializeEventClientRpc(); } } } public void InitializeEventLocal() { InitializeEvent(); sendingRPC1 = true; InitializeEventServerRpc(); } public void InitializeEvent() { ((MonoBehaviour)this).StartCoroutine(EventStartRoutine()); } [IteratorStateMachine(typeof(d__49))] public IEnumerator EventStartRoutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__49(0) { <>4__this = this }; } [ClientRpc] public void AlarmShutdownClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2146566296u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2146566296u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; if (sendingRPC2) { sendingRPC2 = false; } else { AlarmShutdown(); } } } [ServerRpc(RequireOwnership = false)] public void AlarmShutdownServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(4164838585u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4164838585u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { base.__rpc_exec_stage = (__RpcExecStage)0; AlarmShutdownClientRpc(); } } } public void AlarmShutdownLocal() { AlarmShutdown(); sendingRPC2 = true; AlarmShutdownServerRpc(); } public void AlarmShutdown() { lightsManager.EndAlarmSequence(); alarmActive = false; steamLeakParticles.Stop(); steamSFX.Stop(); lasherManager.KillLashers(); ((MonoBehaviour)this).StartCoroutine(DisableBreakers()); } [IteratorStateMachine(typeof(d__54))] public IEnumerator DisableBreakers() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__54(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__55))] private IEnumerator AlarmPulse() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__55(0) { <>4__this = this }; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2852613662u, new RpcReceiveHandler(__rpc_handler_2852613662), "InitializeEventClientRpc"); ((NetworkBehaviour)this).__registerRpc(57409360u, new RpcReceiveHandler(__rpc_handler_57409360), "InitializeEventServerRpc"); ((NetworkBehaviour)this).__registerRpc(2146566296u, new RpcReceiveHandler(__rpc_handler_2146566296), "AlarmShutdownClientRpc"); ((NetworkBehaviour)this).__registerRpc(4164838585u, new RpcReceiveHandler(__rpc_handler_4164838585), "AlarmShutdownServerRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2852613662(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; ((SpecialEventHandler)(object)target).InitializeEventClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_57409360(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; ((SpecialEventHandler)(object)target).InitializeEventServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2146566296(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; ((SpecialEventHandler)(object)target).AlarmShutdownClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4164838585(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; ((SpecialEventHandler)(object)target).AlarmShutdownServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SpecialEventHandler"; } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace ScienceBird.Wither.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }