using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Debugger; using GameNetcodeStuff; using HarmonyLib; using HideAndSeek; using HideAndSeek.AbilityScripts; using HideAndSeek.AudioScripts; using HideAndSeek.Patches; using LCVR; using LCVR.Player; using LethalCompanyInputUtils.Api; using LethalNetworkAPI; using Microsoft.CodeAnalysis; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.XR; using UnityEngine.Networking; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("HideAndSeek")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("My first plugin")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+8e1453d407f7dbab2e4e49ec0ced36870bce4e6a")] [assembly: AssemblyProduct("HideAndSeek")] [assembly: AssemblyTitle("HideAndSeek")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Debugger { public static class Debug { private static bool warned = false; private static readonly string WARNmESSAGE = "DebugEnabled is false! (Make sure to turn this on when trying to read Debug.Log()'s messages)"; public static void Log(object m) { if (Config.debugEnabled.Value) { Plugin._Logger.LogInfo(m); } else if (!warned) { warned = true; Plugin._Logger.LogWarning((object)WARNmESSAGE); } } public static void LogMessage(object m) { if (Config.debugEnabled.Value) { Plugin._Logger.LogMessage(m); } else if (!warned) { warned = true; Plugin._Logger.LogWarning((object)WARNmESSAGE); } } public static void LogWarning(object m) { if (Config.debugEnabled.Value) { Plugin._Logger.LogWarning(m); } else if (!warned) { warned = true; Plugin._Logger.LogWarning((object)WARNmESSAGE); } } public static void LogError(object m) { if (Config.debugEnabled.Value) { Plugin._Logger.LogError(m); } else if (!warned) { warned = true; Plugin._Logger.LogWarning((object)WARNmESSAGE); } } } } namespace HideAndSeek { public class AbilityConfig { public bool syncedWithHost = false; public string abilityName = "genericNull"; public int abilityCost = 10; public bool seekerAbility = true; public bool hiderAbility = true; public bool requiresRoundActive = true; public bool requiresSeekerActive = true; public float abilityDelay = 10f; public bool oneTimeUse = false; public AbilityConfig(string _abilityName = "genericNull", int _abilityCost = 10, float _abilityDelay = 10f, bool _oneTimeUse = false, bool _seekerAbility = true, bool _hiderAbility = true, bool _requriesRoundActive = true, bool _requiresSeekerActive = true) { abilityName = _abilityName; abilityCost = _abilityCost; seekerAbility = _seekerAbility; hiderAbility = _hiderAbility; requiresRoundActive = _requriesRoundActive; requiresSeekerActive = _requiresSeekerActive; abilityDelay = _abilityDelay; oneTimeUse = _oneTimeUse; } } public class ObjectivesManager : MonoBehaviour { public static ObjectivesManager instance; public bool objectiveReleased = false; public Dictionary playersReachedObjective = new Dictionary(); public static void Init() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) instance = new GameObject().AddComponent(); } private void Start() { HideAndSeekGM hideAndSeekGM = HideAndSeekGM.instance; hideAndSeekGM.roundStarted = (Action)Delegate.Combine(hideAndSeekGM.roundStarted, new Action(OnRoundStart)); } private void Update() { //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) if (Config.objective.Value.Equals("Ship", StringComparison.CurrentCultureIgnoreCase)) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (!(TimeOfDay.Instance.currentDayTime >= Config.timeObjectiveAvailable.Value)) { return; } if (!objectiveReleased) { objectiveReleased = true; if (HideAndSeekGM.instance.seekers.Contains(localPlayerController)) { HUDManager.Instance.DisplayTip("Hide And Seek", "The exits have been unlocked, the hiders are escaping!", true, false, "LC_Tip1"); } else if (HideAndSeekGM.instance.zombies.Contains(localPlayerController)) { HUDManager.Instance.DisplayTip("Hide And Seek", "The exits have been unlocked, the hiders are escaping!", true, false, "LC_Tip1"); } else { HUDManager.Instance.DisplayTip("Hide And Seek", "The exits have been unlocked, escape back to the ship now!", false, false, "LC_Tip1"); } } { foreach (PlayerControllerB allConnectedPlayer in HideAndSeekGM.GetAllConnectedPlayers("Update Player Objectives")) { if (!allConnectedPlayer.isPlayerDead && !HideAndSeekGM.instance.seekers.Contains(allConnectedPlayer) && !HideAndSeekGM.instance.zombies.Contains(allConnectedPlayer) && allConnectedPlayer.isInHangarShipRoom && !PlayerReachedObjective(allConnectedPlayer)) { SetPlayerReachedObjective(allConnectedPlayer, b: true); ((Graphic)allConnectedPlayer.usernameBillboardText).color = Config.objectiveNameColor.Value; HideAndSeekGM.instance.UpdateGameState("Player Reached Objective"); if ((Object)(object)localPlayerController == (Object)(object)allConnectedPlayer) { HUDManager.Instance.DisplayTip("Hide And Seek", "You have reached the objective!", false, false, "LC_Tip1"); } else { HUDManager.Instance.DisplayTip("Hide And Seek", "'" + allConnectedPlayer.playerUsername + "' has reached the objective!", true, false, "LC_Tip1"); } if (((NetworkBehaviour)localPlayerController).IsHost) { NetworkHandler.Instance.EventSendRpc(".moneyChanged", new MessageProperties(__bool: false, "silent", 200, 0f, allConnectedPlayer.actualClientId)); } } } return; } } Debug.LogError((object)("[ObjectiveManager] No objective has been set! '" + Config.objective.Value + "' Disabling Objective...")); ((Component)this).gameObject.SetActive(false); } private void OnRoundStart() { objectiveReleased = false; playersReachedObjective.Clear(); } public void SetPlayerReachedObjective(PlayerControllerB player, bool b) { if (!playersReachedObjective.ContainsKey(player)) { playersReachedObjective.Add(player, b); } else { playersReachedObjective[player] = b; } } public bool PlayerReachedObjective(PlayerControllerB player) { if (!playersReachedObjective.ContainsKey(player)) { return false; } return playersReachedObjective[player]; } } public class VRAbilityUI { [CompilerGenerated] private sealed class d__18 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; 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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } Tick(); <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 1; 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(); } } [CompilerGenerated] private sealed class d__17 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__17(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { if (<>1__state != 0) { return false; } <>1__state = -1; try { Tick(); currentTickLoop = ((MonoBehaviour)GameNetworkManager.Instance).StartCoroutine(Loop()); } catch (FileNotFoundException) { Debugger.Debug.LogError("[VRAbilityUI] Could not find LCVR DLL! Using default UI..."); return 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 static GameObject UIObject; private static AbilityUI abilityUI; private static GameObject tutorialUI; private static TrackedPoseDriver leftHand; private static TrackedPoseDriver rightHand; private static TrackedPoseDriver camera; private static Coroutine currentTickLoop = null; private static bool usingVr = false; public static InputAction AbilityMenuInput; public static InputAction ModifierInput; public static InputAction SellInput; public static InputAction NavigateInput; public static InputAction ActivateInput; private static bool menuOpen = false; private static int turnProvider = -1; private static bool modifierInputDown = false; private static bool sellInputDown = false; private static bool leftInput; private static bool rightInput; private static bool upInput; private static bool downInput; public static void StartTicking() { CreateInputActions(); if (currentTickLoop != null) { ((MonoBehaviour)GameNetworkManager.Instance).StopCoroutine(currentTickLoop); camera = null; rightHand = null; leftHand = null; UIObject = null; abilityUI = null; currentTickLoop = null; } currentTickLoop = ((MonoBehaviour)GameNetworkManager.Instance).StartCoroutine(Tryer()); } private static void Tick() { //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_0191: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_010e: 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_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_0124: 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_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: 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) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: 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_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Invalid comparison between Unknown and I4 //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Invalid comparison between Unknown and I4 //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Expected I4, but got Unknown UsingVR(); if (!usingVr) { return; } if ((Object)(object)UIObject == (Object)null) { CreateUIObject(); } if (!Object.op_Implicit((Object)(object)UIObject)) { return; } Vector3 position = Vector3.zero; if (!Object.op_Implicit((Object)(object)leftHand) || !Object.op_Implicit((Object)(object)rightHand) || !Object.op_Implicit((Object)(object)camera)) { GetTrackedDrivers(); } if (Object.op_Implicit((Object)(object)leftHand) && Object.op_Implicit((Object)(object)rightHand)) { Vector3 val = ((Component)leftHand).transform.position - ((Component)rightHand).transform.position; float magnitude = ((Vector3)(ref val)).magnitude; float num = Mathf.Clamp(1f - Mathf.Pow(magnitude, 2f), 0f, 1f); float num2 = num * 0.4f; position = (((Component)leftHand).transform.position + ((Component)rightHand).transform.position) / 2f; position += Vector3.up * 0.9f * num2; Vector3 val2 = position - ((Component)camera).transform.position; Vector3 val3 = position; val = new Vector3(val2.x, 0f, val2.z); position = val3 + ((Vector3)(ref val)).normalized * num2; } ((Transform)UIObject.GetComponent()).position = position; if (Object.op_Implicit((Object)(object)camera)) { ((Transform)UIObject.GetComponent()).LookAt(((Component)camera).transform, Vector3.up); } if ((((Component)abilityUI).gameObject.activeSelf || tutorialUI.gameObject.activeSelf) && !menuOpen) { menuOpen = true; if (Config.disableVRTurningWhileMenuOpen.Value && (int)Plugin.Config.TurnProvider.Value != 2) { turnProvider = (int)Plugin.Config.TurnProvider.Value; Plugin.Config.TurnProvider.Value = (TurnProviderOption)2; } } else if (menuOpen) { menuOpen = false; if (Config.disableVRTurningWhileMenuOpen.Value && (int)Plugin.Config.TurnProvider.Value == 2) { Plugin.Config.TurnProvider.Value = (TurnProviderOption)turnProvider; } } } [IteratorStateMachine(typeof(d__17))] private static IEnumerator Tryer() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__17(0); } [IteratorStateMachine(typeof(d__18))] private static IEnumerator Loop() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__18(0); } private static void CreateInputActions() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Expected O, but got Unknown //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Expected O, but got Unknown //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Expected O, but got Unknown AbilityMenuInput = new InputAction("OpenAbilityMenu", (InputActionType)1, "{LeftHand}/thumbstickClicked", (string)null, (string)null, (string)null); AbilityMenuInput.performed += ProssesAbilityMenuInput; AbilityMenuInput.canceled += ProssesAbilityMenuInput; AbilityMenuInput.Enable(); ModifierInput = new InputAction("InputModifier", (InputActionType)0, "{LeftHand}/gripPressed", (string)null, (string)null, (string)null); ModifierInput.performed += ProssesModifierInput; ModifierInput.canceled += ProssesModifierInput; ModifierInput.Enable(); SellInput = new InputAction("SellItem", (InputActionType)0, "{LeftHand}/trigger", (string)null, (string)null, (string)null); SellInput.performed += ProssesSellInput; SellInput.canceled += ProssesSellInput; SellInput.Enable(); NavigateInput = new InputAction("Navigate", (InputActionType)0, "{RightHand}/joystick", (string)null, (string)null, (string)null); NavigateInput.performed += ProssesNavigateInput; NavigateInput.canceled += ProssesNavigateInput; NavigateInput.Enable(); ActivateInput = new InputAction("Activate", (InputActionType)1, "{RightHand}/primaryButton", (string)null, (string)null, (string)null); ActivateInput.performed += ProssesActivateInput; ActivateInput.canceled += ProssesActivateInput; ActivateInput.Enable(); } private static void ProssesAbilityMenuInput(CallbackContext context) { float num = ((CallbackContext)(ref context)).ReadValue(); if (num > 0f && modifierInputDown) { abilityUI.ToggleAbilityUI(); } } private static void ProssesModifierInput(CallbackContext context) { float num = ((CallbackContext)(ref context)).ReadValue(); if (num > 0.2f && !modifierInputDown) { modifierInputDown = true; } else if (num < 0.2f && modifierInputDown) { modifierInputDown = false; } } private static void ProssesSellInput(CallbackContext context) { //IL_002e: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) float num = ((CallbackContext)(ref context)).ReadValue(); if (num >= 0.5f && !sellInputDown) { sellInputDown = true; AbilityInstance.localInstance.SellInputPressed(); } else if (num < 0.5f && sellInputDown) { sellInputDown = false; AbilityInstance.localInstance.SellInputCanceled(); } } private static void ProssesNavigateInput(CallbackContext context) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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_00ff: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) Vector2 val = ((CallbackContext)(ref context)).ReadValue(); if (val.y > 0.2f && !upInput) { abilityUI.UpInput(); upInput = true; } else if (val.y < 0.2f && upInput) { upInput = false; } if (val.y < -0.2f && !downInput) { abilityUI.DownInput(); downInput = true; } else if (val.y > -0.2f && downInput) { downInput = false; } if (val.x > 0.2f && !rightInput) { abilityUI.RightInput(); rightInput = true; } else if (val.x < 0.2f && rightInput) { rightInput = false; } if (val.x < -0.2f && !leftInput) { abilityUI.LeftInput(); leftInput = true; } else if (val.x > -0.2f && leftInput) { leftInput = false; } } private static void ProssesActivateInput(CallbackContext context) { float num = ((CallbackContext)(ref context)).ReadValue(); if (num > 0f) { abilityUI.ActivateAbility(); } } private static void CreateUIObject() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) UIObject = new GameObject(); ((Object)UIObject).name = "VRUICanvas"; Canvas val = UIObject.GetComponent(); if (!Object.op_Implicit((Object)(object)val)) { val = UIObject.AddComponent(); } val.renderMode = (RenderMode)2; abilityUI = Object.FindAnyObjectByType(); tutorialUI = abilityUI.tutorialMenu; if ((Object)(object)abilityUI == (Object)null) { Object.Destroy((Object)(object)UIObject); Debugger.Debug.LogError("abilityUI is == null!"); return; } ((Component)abilityUI).transform.parent = UIObject.transform; tutorialUI.transform.parent = UIObject.transform; ((Component)abilityUI).transform.Rotate(Vector3.up, 180f, (Space)1); tutorialUI.transform.Rotate(Vector3.up, 180f, (Space)1); tutorialUI.transform.localPosition = Vector3.zero; ((Component)((Component)abilityUI).transform.Find("Background")).gameObject.SetActive(false); ((Component)tutorialUI.transform.Find("Background")).gameObject.SetActive(false); UIObject.transform.localScale = Vector3.one / 6f; } private static void GetTrackedDrivers() { //IL_0016: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) TrackedPoseDriver[] array = Object.FindObjectsByType((FindObjectsSortMode)0); foreach (TrackedPoseDriver val in array) { InputActionProperty trackingStateInput = val.trackingStateInput; if (((InputActionProperty)(ref trackingStateInput)).action.name.ToLower().Contains("left")) { leftHand = val; continue; } trackingStateInput = val.trackingStateInput; if (((InputActionProperty)(ref trackingStateInput)).action.name.ToLower().Contains("right")) { rightHand = val; } else if (((Object)((Component)val).gameObject).name == "MainCamera") { camera = val; } } } private static void Try() { usingVr = VRSession.InVR; } public static void UsingVR() { try { Try(); } catch (Exception) { } } public static void OnApplicationQuit() { if (turnProvider != -1) { Plugin.Config.TurnProvider.Value = (TurnProviderOption)turnProvider; } } } public class Config { public static ConfigEntry debugEnabled; public static ConfigEntry abilitiesEnabled; public static ConfigEntry creditsResetOnNewRound; public static ConfigEntry deadBodySellValue; public static ConfigEntry disableVRTurningWhileMenuOpen; public static ConfigEntry objective; public static ConfigEntry timeObjectiveAvailable; public static ConfigEntry objectiveNameColor; public static ConfigEntry lockShipLever; public static ConfigEntry disableAllEntities; public static ConfigEntry disabledEntities; public static ConfigEntry turretsEnabled; public static ConfigEntry landminesEnabled; public static ConfigEntry spikeTrapEnabled; public static ConfigEntry seekerNameColor; public static ConfigEntry seekerChooseBehavior; public static ConfigEntry numberOfSeekers; public static ConfigEntry extraSeekerChooseBehavior; public static ConfigEntry isSeekerImmune; public static ConfigEntry hostilesIgnoreSeeker; public static ConfigEntry shotgunInfiniteAmmo; public static ConfigEntry shotgunAutoReload; public static ConfigEntry teleportSeekerToEntrance; public static ConfigEntry forceSeekerInside; public static ConfigEntry shipLeaveEarly; public static ConfigEntry timeWhenLastHider; public static ConfigEntry timeSeekerIsReleased; public static ConfigEntry seekerItemSlot1; public static ConfigEntry seekerItemSlot2; public static ConfigEntry seekerItemSlot3; public static ConfigEntry seekerItemSlot4; public static ConfigEntry hiderNameColor; public static ConfigEntry teleportHidersToEntrance; public static ConfigEntry forceHidersInside; public static ConfigEntry lockHidersInside; public static ConfigEntry infiniteFlashlightBattery; public static ConfigEntry hiderItemSlot1; public static ConfigEntry hiderItemSlot2; public static ConfigEntry hiderItemSlot3; public static ConfigEntry hiderItemSlot4; public static ConfigEntry zombieNameColor; public static ConfigEntry deadHidersRespawn; public static ConfigEntry deadZombiesRespawn; public static ConfigEntry zombiesCanUseAbilities; public static ConfigEntry zombieSpawnDelay; public static ConfigEntry zombieSpawnLocation; public static ConfigEntry zombieItemSlot1; public static ConfigEntry zombieItemSlot2; public static ConfigEntry zombieItemSlot3; public static ConfigEntry zombieItemSlot4; public Config(ConfigFile cfg) { //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_04b9: Unknown result type (might be due to invalid IL or missing references) debugEnabled = cfg.Bind("0:Debug/Other", "DebugEnabled", false, "Used for random feature testing and debug logging. (Should be disabled for end user)"); abilitiesEnabled = cfg.Bind("0:Gamemode.Abilities", "Abilities Enabled", true, "Enables Abilities! Hold 'c' to sell scrap and press 't' to open the abilities menu to spend your credits on."); creditsResetOnNewRound = cfg.Bind("0:Gamemode.Abilities", "Credits Reset On New Round", false, "Makes everyone's credits go back to 0 when a new round starts"); deadBodySellValue = cfg.Bind("0:Gamemode.Abilities", "Dead Body Value", 100, "How much a dead body is worth when selling"); disableVRTurningWhileMenuOpen = cfg.Bind("0:Gamemode.Abilities", "Disable VR Turning While Menu Open", false, "(In VR Mode) Disables turning while the ability menu is open to make browsing through the abilities a little less weird. (WARNING: This is a little buggy, as the vr rig rotation gets reset every time the menu opens! Which is probably not any better than with this off)"); objective = cfg.Bind("0:Gamemode.Objective", "Hider Objective", "Ship", "'None' There will be no objective, 'Ship' The interior exits will be unlocked and the hiders have to get back to the ship, (More may come?)"); timeObjectiveAvailable = cfg.Bind("0:Gamemode.Objective", "Time Objective Available", 900f, "The time the clock would be when the objective comes into play. 900 = 9:00 PM, 960 = 10:00 PM, +60 = +1 hour (Can't be lower than when the seeker is released!)"); objectiveNameColor = cfg.Bind("2:Players.Hider", "Objective Reached Name Color", new Color(1f, 0f, 1f), "The color the player's name tag will be when they have successfully reached the objective."); lockShipLever = cfg.Bind("2:Players.Seeker", "Lock Ship Lever", true, "Will not allow the ship lever to be pulled during a round (Does not apply to the host or the seekers)"); disableAllEntities = cfg.Bind("1:Entities", "Disable All Entities", true, "Determines if all entity spawning should be disabled."); disabledEntities = cfg.Bind("1:Entities", "Entity BlackList", "", "Enter an entity's internal name separated by commas to prevent them from spawning. (Entity's names can be found in console upon landing on a moon)"); turretsEnabled = cfg.Bind("1:Traps", "Spawn Turrets", false, "Determines if Turrets should spawn."); landminesEnabled = cfg.Bind("1:Traps", "Spawn Land Mines", false, "Determines if Land Mines should spawn."); spikeTrapEnabled = cfg.Bind("1:Traps", "Spawn Spike Traps", false, "Determines if Spike Traps should spawn."); seekerNameColor = cfg.Bind("2:Players.Seeker", "Seeker Name Color", new Color(1f, 0f, 0f), "The color the player's name tag will be."); seekerChooseBehavior = cfg.Bind("2:Players.Seeker", "Seeker Choose Behavior", "Turns", "'None' (Just a random range generator), 'No Double' (Next Seeker can't be last seeker), 'Turns' (Will not pick someone that was already seeker, resets when everyone got a chance), 'Lever' (The seeker is the lever puller)"); numberOfSeekers = cfg.Bind("2:Players.Seeker", "Number of Seekers", "20%", "'1'-[connected players] (Example '3') OR '1%'-'100%' of connected players will be the seeker. (Example 20%). No matter what this is set to, (Example '0' or '100%') there will ALWAYS be at least 1 hider and 1 seeker (Unless there is only one connected player, then they would just be seeker)"); extraSeekerChooseBehavior = cfg.Bind("2:Players.Seeker", "Extra Seeker Choose Behavior", "Closest", "'None' (Just a random range generator), 'Turns' (Will not pick someone that was already seeker, resets when everyone got a chance), 'Closest' (Players nearest to the first seeker will be seeker)"); isSeekerImmune = cfg.Bind("2:Players.Seeker", "Is Seeker Immune", false, "Determines if the seeker could be harmed or not (not recommended while abilities are enabled)"); shotgunInfiniteAmmo = cfg.Bind("2:Players.Seeker", "Shotgun Infinite Ammo", true, "Disables the need for ammo for the shotgun."); shotgunAutoReload = cfg.Bind("2:Players.Seeker", "Shotgun Auto Reload", false, "(Only works if 'shotgunInfiniteAmmo' is enabled) Disables the need to reload a new shell, and lets you shoot like normal again."); shipLeaveEarly = cfg.Bind("2:Players.Seeker", "Make Ship Leave Early", true, "Skips the time when there is one hider left (Time defined by 'timeWhenLastHider')"); timeWhenLastHider = cfg.Bind("2:Players.Seeker", "Last Hider Time", 900f, "The time the clock is set to when there is one hider left. 900 = 9:00 PM, 960 = 10:00 PM, +60 = +1 hour (Requires makeShipLeaveEarly = true, to be enabled!)"); timeSeekerIsReleased = cfg.Bind("2:Players.Seeker", "Seeking Time", 195f, "The time the seeker is released to wreak havoc in the land. 180 = 9:00 PM, 240 = 10:00 PM, +60 = +1 hour"); teleportSeekerToEntrance = cfg.Bind("2:Players.Seeker", "Teleport Seeker To Entrance", true, "Determines if the seeker should be teleported to the entrance on landing."); forceSeekerInside = cfg.Bind("2:Players.Seeker", "Teleport Seeker Inside", true, "Determines if the seeker should be teleported into the building on landing. (teleportSeekerToEntrance Should Be Enabled!)"); seekerItemSlot1 = cfg.Bind("2:Players.Seeker", "Seeker Item Slot 1", "Shotgun", "The id of the item that will spawn in the first slot of the seeker. 'item1, item2' will randomly choose between the items listed (See README.md for list of Item IDs)"); seekerItemSlot2 = cfg.Bind("2:Players.Seeker", "Seeker Item Slot 2", "Pro-flashlight", "The id of the item that will spawn in the second slot of the seeker. 'item1, item2' will randomly choose between the items listed (See README.md for list of Item IDs)"); seekerItemSlot3 = cfg.Bind("2:Players.Seeker", "Seeker Item Slot 3", "", "The id of the item that will spawn in the third slot of the seeker. 'item1, item2' will randomly choose between the items listed (See README.md for list of Item IDs)"); seekerItemSlot4 = cfg.Bind("2:Players.Seeker", "Seeker Item Slot 4", "", "The id of the item that will spawn in the fourth slot of the seeker. 'item1, item2' will randomly choose between the items listed (See README.md for list of Item IDs)"); hiderNameColor = cfg.Bind("2:Players.Hider", "Hider Name Color", new Color(1f, 1f, 1f), "The color the player's name tag will be."); teleportHidersToEntrance = cfg.Bind("2:Players.Hider", "Teleport Hiders To Entrance", true, "Determines if all the hiders should be teleported to the entrance on landing."); forceHidersInside = cfg.Bind("2:Players.Hider", "Teleport Hiders Inside", true, "Determines if all the hiders should be teleported into the building on landing. (teleportHidersToEntrance Should Be Enabled!)"); lockHidersInside = cfg.Bind("2:Players.Hider", "Lock Hiders Inside", true, "Determines if all the hiders should be locked inside the building. (forceHidersInside Should Be Enabled!)"); infiniteFlashlightBattery = cfg.Bind("2:Players.Hider", "Infinite Flashlight Battery", true, "Makes the flashlight never run out of battery."); hiderItemSlot1 = cfg.Bind("2:Players.Hider", "Hider Item Slot 1", "flashlight", "The id of the item that will spawn in the first slot of the hider. 'item1, item2' will randomly choose between the items listed (See README.md for list of Item IDs)"); hiderItemSlot2 = cfg.Bind("2:Players.Hider", "Hider Item Slot 2", "", "The id of the item that will spawn in the second slot of the hider. 'item1, item2' will randomly choose between the items listed (See README.md for list of Item IDs)"); hiderItemSlot3 = cfg.Bind("2:Players.Hider", "Hider Item Slot 3", "", "The id of the item that will spawn in the third slot of the hider. 'item1, item2' will randomly choose between the items listed (See README.md for list of Item IDs)"); hiderItemSlot4 = cfg.Bind("2:Players.Hider", "Hider Item Slot 4", "", "The id of the item that will spawn in the fourth slot of the hider. 'item1, item2' will randomly choose between the items listed (See README.md for list of Item IDs)"); zombieNameColor = cfg.Bind("2:Players.Zombie", "Zombie Name Color", new Color(0f, 1f, 0f), "The color the player's name tag will be."); deadHidersRespawn = cfg.Bind("2:Players.Zombie", "Dead Hiders Respawn", true, "(If true) : When a hider is killed, they will turn into a zombie, assisting the seeker."); deadZombiesRespawn = cfg.Bind("2:Players.Zombie", "Dead Zombies Respawn", false, "(If true) : When a zombie dies, they will respawn again."); zombiesCanUseAbilities = cfg.Bind("2:Players.Zombie", "Zombies Can Use Abilities", false, "(If true) : The zombies will be able to use seeker abilities."); zombieSpawnDelay = cfg.Bind("2:Players.Zombie", "Zombie Spawn Delay", 8f, "When a player dies, the thread will yield for the specified amount of seconds before attempting to respawn them as a zombie."); zombieSpawnLocation = cfg.Bind("2:Players.Zombie", "Zombie Spawn Location", "Inside", "'Inside' : Teleports Zombies inside when spawning, 'Entrance' : Teleports Zombies to the main entrance when spawning, 'Ship' : Spawns Zombies in the ship"); zombieItemSlot1 = cfg.Bind("2:Players.Zombie", "Zombie Item Slot 1", "Stop sign, Yield sign, Shovel", "The id of the item that will spawn in the first slot of the zombie. 'item1, item2' will randomly choose between the items listed (See README.md for list of Item IDs)"); zombieItemSlot2 = cfg.Bind("2:Players.Zombie", "Zombie Item Slot 2", "", "The id of the item that will spawn in the second slot of the zombie. 'item1, item2' will randomly choose between the items listed (See README.md for list of Item IDs)"); zombieItemSlot3 = cfg.Bind("2:Players.Zombie", "Zombie Item Slot 3", "", "The id of the item that will spawn in the third slot of the zombie. 'item1, item2' will randomly choose between the items listed (See README.md for list of Item IDs)"); zombieItemSlot4 = cfg.Bind("2:Players.Zombie", "Zombie Item Slot 4", "", "The id of the item that will spawn in the fourth slot of the zombie. 'item1, item2' will randomly choose between the items listed (See README.md for list of Item IDs)"); } } public class InputConfigs : LcInputActions { private static InputConfigs instance; [InputAction(/*Could not decode attribute arguments.*/)] public InputAction Escape { get; set; } [InputAction(/*Could not decode attribute arguments.*/)] public InputAction AbilityMenuKey { get; set; } [InputAction(/*Could not decode attribute arguments.*/)] public InputAction SellKey { get; set; } [InputAction(/*Could not decode attribute arguments.*/)] public InputAction ScrollAbilitiesInput { get; set; } [InputAction(/*Could not decode attribute arguments.*/)] public InputAction FavoriteKey { get; set; } [InputAction(/*Could not decode attribute arguments.*/)] public InputAction BackKey { get; set; } [InputAction(/*Could not decode attribute arguments.*/)] public InputAction ForwardKey { get; set; } [InputAction(/*Could not decode attribute arguments.*/)] public InputAction ScrollCategoriesInput { get; set; } [InputAction(/*Could not decode attribute arguments.*/)] public InputAction UpKey { get; set; } [InputAction(/*Could not decode attribute arguments.*/)] public InputAction DownKey { get; set; } [InputAction(/*Could not decode attribute arguments.*/)] public InputAction ActivateKey { get; set; } public static InputConfigs GetInputClass() { if (instance == null) { instance = new InputConfigs(); } return instance; } } public class HideAndSeekGM : MonoBehaviour { [CompilerGenerated] private sealed class d__31 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public HideAndSeekGM <>4__this; private List 5__1; private int 5__2; private List.Enumerator <>s__3; private PlayerControllerB 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__31(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || (uint)(num - 3) <= 7u) { try { } finally { <>m__Finally1(); } } 5__1 = null; <>s__3 = default(List.Enumerator); 5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Expected O, but got Unknown //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Expected O, but got Unknown try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = GetAllConnectedPlayers("GivePlayersItems"); Debugger.Debug.LogMessage("Game Has Started = " + GameNetworkManager.Instance.gameHasStarted); goto IL_00ec; case 1: <>1__state = -1; goto IL_00ec; case 2: <>1__state = -1; 5__2--; goto IL_01bc; case 3: <>1__state = -3; goto IL_02e2; case 4: <>1__state = -3; goto IL_0334; case 5: <>1__state = -3; goto IL_0386; case 6: <>1__state = -3; goto IL_0527; case 7: <>1__state = -3; goto IL_0431; case 8: <>1__state = -3; goto IL_0483; case 9: <>1__state = -3; goto IL_04d6; case 10: { <>1__state = -3; goto IL_0527; } IL_00ec: if (<>4__this.itemSpawnPositions.Count == 0 || <>4__this.playersTeleported == 0 || !StartOfRound.Instance.shipHasLanded) { if (StartOfRound.Instance.shipIsLeaving) { return false; } <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; } 5__2 = 5; goto IL_01bc; IL_0483: if (!string.IsNullOrEmpty(Config.hiderItemSlot3.Value)) { <>2__current = <>4__this.SpawnNewItemCoroutine(Config.hiderItemSlot3.Value, 5__4); <>1__state = 9; return true; } goto IL_04d6; IL_04d6: if (!string.IsNullOrEmpty(Config.hiderItemSlot4.Value)) { <>2__current = <>4__this.SpawnNewItemCoroutine(Config.hiderItemSlot4.Value, 5__4); <>1__state = 10; return true; } goto IL_0527; IL_02e2: if (!string.IsNullOrEmpty(Config.seekerItemSlot2.Value)) { <>2__current = <>4__this.SpawnNewItemCoroutine(Config.seekerItemSlot2.Value, 5__4); <>1__state = 4; return true; } goto IL_0334; IL_01bc: if ((<>4__this.itemSpawnPositions.Count < 5__1.Count || <>4__this.playersTeleported < 5__1.Count || !StartOfRound.Instance.shipHasLanded) && 5__2 > 0) { Debugger.Debug.Log($"[Progress Inter] Not fully there! We have: {5__2} left before ending automatically! {<>4__this.playersTeleported}, {<>4__this.itemSpawnPositions.Count}"); <>2__current = (object)new WaitForSeconds(1f); <>1__state = 2; return true; } Debugger.Debug.Log($"[Final] Players Teleported: {<>4__this.playersTeleported}, item Spawn Positions: {<>4__this.itemSpawnPositions.Count}"); <>s__3 = 5__1.GetEnumerator(); <>1__state = -3; goto IL_052f; IL_0527: 5__4 = null; goto IL_052f; IL_0334: if (!string.IsNullOrEmpty(Config.seekerItemSlot3.Value)) { <>2__current = <>4__this.SpawnNewItemCoroutine(Config.seekerItemSlot3.Value, 5__4); <>1__state = 5; return true; } goto IL_0386; IL_0386: if (!string.IsNullOrEmpty(Config.seekerItemSlot4.Value)) { <>2__current = <>4__this.SpawnNewItemCoroutine(Config.seekerItemSlot4.Value, 5__4); <>1__state = 6; return true; } goto IL_0527; IL_052f: if (<>s__3.MoveNext()) { 5__4 = <>s__3.Current; if (<>4__this.seekers.Contains(5__4)) { if (!string.IsNullOrEmpty(Config.seekerItemSlot1.Value)) { <>2__current = <>4__this.SpawnNewItemCoroutine(Config.seekerItemSlot1.Value, 5__4); <>1__state = 3; return true; } goto IL_02e2; } if (!string.IsNullOrEmpty(Config.hiderItemSlot1.Value)) { <>2__current = <>4__this.SpawnNewItemCoroutine(Config.hiderItemSlot1.Value, 5__4); <>1__state = 7; return true; } goto IL_0431; } <>m__Finally1(); <>s__3 = default(List.Enumerator); return false; IL_0431: if (!string.IsNullOrEmpty(Config.hiderItemSlot2.Value)) { <>2__current = <>4__this.SpawnNewItemCoroutine(Config.hiderItemSlot2.Value, 5__4); <>1__state = 8; return true; } goto IL_0483; } } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>s__3).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__37 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB player; public HideAndSeekGM <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__37(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (!string.IsNullOrEmpty(Config.zombieItemSlot1.Value)) { <>2__current = <>4__this.SpawnNewItemCoroutine(Config.zombieItemSlot1.Value, player); <>1__state = 1; return true; } goto IL_008a; case 1: <>1__state = -1; goto IL_008a; case 2: <>1__state = -1; goto IL_00d4; case 3: <>1__state = -1; goto IL_011e; case 4: { <>1__state = -1; break; } IL_008a: if (!string.IsNullOrEmpty(Config.zombieItemSlot2.Value)) { <>2__current = <>4__this.SpawnNewItemCoroutine(Config.zombieItemSlot2.Value, player); <>1__state = 2; return true; } goto IL_00d4; IL_011e: if (!string.IsNullOrEmpty(Config.zombieItemSlot4.Value)) { <>2__current = <>4__this.SpawnNewItemCoroutine(Config.zombieItemSlot4.Value, player); <>1__state = 4; return true; } break; IL_00d4: if (!string.IsNullOrEmpty(Config.zombieItemSlot3.Value)) { <>2__current = <>4__this.SpawnNewItemCoroutine(Config.zombieItemSlot3.Value, player); <>1__state = 3; return true; } goto IL_011e; } 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__33 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public string itemName; public PlayerControllerB player; public bool forceSamePosition; public HideAndSeekGM <>4__this; private Item[] 5__1; private string 5__2; private int 5__3; private Vector3 5__4; private GrabbableObject 5__5; private int 5__6; private string[] 5__7; private int 5__8; private Item[] <>s__9; private int <>s__10; private Item 5__11; private List<(ulong playerId, Vector3 position)>.Enumerator <>s__12; private (ulong playerId, Vector3 position) 5__13; private GrabbableObject[] <>s__14; private int <>s__15; private GrabbableObject 5__16; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__33(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; 5__5 = null; 5__7 = null; <>s__9 = null; 5__11 = null; <>s__12 = default(List<(ulong, Vector3)>.Enumerator); <>s__14 = null; 5__16 = null; <>1__state = -2; } private bool MoveNext() { //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Expected O, but got Unknown //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: 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_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //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_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Expected O, but got Unknown //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = Resources.FindObjectsOfTypeAll(); 5__2 = itemName; if (itemName.Contains(",")) { 5__7 = itemName.Split(","); 5__8 = Random.Range(0, 5__7.Length); 5__2 = 5__7[5__8]; 5__7 = null; } 5__3 = 0; <>s__9 = 5__1; for (<>s__10 = 0; <>s__10 < <>s__9.Length; <>s__10++) { 5__11 = <>s__9[<>s__10]; if (5__11.itemName.ToLower().Trim() == 5__2.ToLower().Trim()) { break; } 5__3++; 5__11 = null; } <>s__9 = null; if (5__3 == 5__1.Length) { return false; } 5__4 = ((Component)player).transform.position; <>s__12 = <>4__this.itemSpawnPositions.GetEnumerator(); try { while (<>s__12.MoveNext()) { 5__13 = <>s__12.Current; if (5__13.playerId == player.actualClientId) { 5__4 = 5__13.position; } } } finally { ((IDisposable)<>s__12).Dispose(); } <>s__12 = default(List<(ulong, Vector3)>.Enumerator); if (forceSamePosition) { 5__4 = ((Component)player).transform.position; } 5__4 += Vector3.up * 0.3f; 5__5 = Object.Instantiate(5__1[5__3].spawnPrefab, 5__4, Quaternion.identity).GetComponent(); 5__5.fallTime = 0f; ((Component)5__5).GetComponent().Spawn(false); ((NetworkBehaviour)5__5).NetworkObject.ChangeOwnership(player.actualClientId); <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 1; return true; case 1: <>1__state = -1; 5__6 = 0; <>s__14 = player.ItemSlots; for (<>s__15 = 0; <>s__15 < <>s__14.Length; <>s__15++) { 5__16 = <>s__14[<>s__15]; if (Object.op_Implicit((Object)(object)5__16)) { 5__6++; } 5__16 = null; } <>s__14 = null; if (5__6 < 4) { NetworkHandler instance = NetworkHandler.Instance; ulong actualClientId = player.actualClientId; string _extraMessage = ((NetworkBehaviour)5__5).NetworkObjectId.ToString(); instance.EventSendRpc(".grabItem", new MessageProperties(__bool: false, "", 0, 0f, actualClientId, default(Vector3), __null: false, _extraMessage)); } <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 2; return true; case 2: <>1__state = -1; 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 static HideAndSeekGM instance; public RoundManager roundManager; public int playersTeleported; public int playersAlive; public ulong leverLastFlippedBy = 999uL; public ulong lastSeekerId = 10001uL; public List<(ulong playerId, Vector3 position)> itemSpawnPositions = new List<(ulong, Vector3)>(); public List pastSeekers = new List(); public Action playerRevived; public Action roundStarted; public Action backInOrbit; public Action shipLeaving; public List seekers = new List(); public List zombies = new List(); private List rewardedPlayers = new List(); public bool levelLoading = false; public bool gameEndedEarly = false; public SelectableLevel currentLevel; private bool seekersWon = false; public static void Init() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) instance = new GameObject().AddComponent(); ((Object)instance).name = "HideAndSeekGM"; } private void Start() { if (!AudioManager.LoadedAudio) { Debugger.Debug.LogWarning("Loading AudioManager Audio!"); ((MonoBehaviour)this).StartCoroutine(AudioManager.LoadAudioCoroutine()); } Debugger.Debug.Log($"StartPatch, AbilityManager: Enabled = {Config.abilitiesEnabled.Value}"); if (Config.abilitiesEnabled.Value) { ((MonoBehaviour)this).StartCoroutine(AbilityManager.ConnectStart()); backInOrbit = (Action)Delegate.Combine(backInOrbit, new Action(OnReturnToOrbit)); } } private void Update() { if (!Object.op_Implicit((Object)(object)GameNetworkManager.Instance.localPlayerController) || !((NetworkBehaviour)GameNetworkManager.Instance.localPlayerController).IsServer) { return; } int livingPlayers = StartOfRound.Instance.livingPlayers; if (playersAlive < livingPlayers) { Debugger.Debug.LogWarning("Player count reset to: " + livingPlayers); playersAlive = livingPlayers; } else if (playersAlive > livingPlayers) { Debugger.Debug.LogWarning("Player died! New Count: " + livingPlayers); playersAlive = livingPlayers; if (TimeOfDay.Instance.currentDayTime != 0f && !StartOfRound.Instance.shipIsLeaving) { UpdateGameState("Player Died"); } } } private void OnReturnToOrbit() { //IL_00ac: 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0160: 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_0193: Unknown result type (might be due to invalid IL or missing references) if (!GameNetworkManager.Instance.isHostingGame || seekers.Count == 0 || gameEndedEarly) { return; } foreach (PlayerControllerB allConnectedPlayer in GetAllConnectedPlayers("Award On Round End")) { if (!seekers.Contains(allConnectedPlayer) && !seekersWon) { Debugger.Debug.LogMessage("Award Hider " + (object)allConnectedPlayer); NetworkHandler.Instance.EventSendRpc(".moneyChanged", new MessageProperties(__bool: false, "silent", 250, 0f, allConnectedPlayer.actualClientId)); NetworkHandler.Instance.EventSendRpc(".tip", new MessageProperties(__bool: false, "You won, and got a reward!", -1, 0f, allConnectedPlayer.actualClientId)); } else if (seekers.Contains(allConnectedPlayer) && seekersWon) { Debugger.Debug.LogMessage("Award Seeker " + (object)allConnectedPlayer); NetworkHandler.Instance.EventSendRpc(".moneyChanged", new MessageProperties(__bool: false, "silent", 400, 0f, allConnectedPlayer.actualClientId)); NetworkHandler.Instance.EventSendRpc(".tip", new MessageProperties(__bool: false, "You won, and got a reward!", -1, 0f, allConnectedPlayer.actualClientId)); } } } public void OnLevelLoaded(SelectableLevel newLevel) { //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_04b7: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_0475: Unknown result type (might be due to invalid IL or missing references) //IL_047b: Unknown result type (might be due to invalid IL or missing references) levelLoading = true; roundManager = Object.FindFirstObjectByType(); rewardedPlayers.Clear(); seekers.Clear(); zombies.Clear(); gameEndedEarly = false; playersTeleported = 0; NetworkEvents.TeleportPlayer(); seekersWon = false; currentLevel = newLevel; if (!GameNetworkManager.Instance.isHostingGame) { return; } if (!Object.op_Implicit((Object)(object)Abilities.turretPrefab) || !Object.op_Implicit((Object)(object)Abilities.landminePrefab)) { SpawnableMapObject[] spawnableMapObjects = currentLevel.spawnableMapObjects; foreach (SpawnableMapObject val in spawnableMapObjects) { if ((Object)(object)val.prefabToSpawn.GetComponentInChildren() != (Object)null) { Abilities.turretPrefab = val.prefabToSpawn; } if ((Object)(object)val.prefabToSpawn.GetComponentInChildren() != (Object)null) { Abilities.landminePrefab = val.prefabToSpawn; } } } foreach (NetworkObject item in Abilities.objectsToDespawnNextRound) { if (item.IsSpawned) { item.Despawn(true); Object.Destroy((Object)(object)((Component)item).gameObject); } } Abilities.objectsToDespawnNextRound = new List(); NetworkHandler.Instance.EventSendRpc(".levelLoading"); if (Config.abilitiesEnabled.Value && Config.creditsResetOnNewRound.Value) { NetworkHandler.Instance.EventSendRpc(".moneyChanged", new MessageProperties(__bool: true, "", 0, 0f, 0uL, default(Vector3), __null: true)); } List list = Config.disabledEntities.Value.ToLower().Split(',').ToList(); List daytimeEnemies = newLevel.DaytimeEnemies; List outsideEnemies = newLevel.OutsideEnemies; List enemies = newLevel.Enemies; List list2 = new List(daytimeEnemies.Count + outsideEnemies.Count + enemies.Count); list2.AddRange(daytimeEnemies); list2.AddRange(outsideEnemies); list2.AddRange(enemies); List list3 = list2; foreach (SpawnableEnemyWithRarity item2 in list3) { Debugger.Debug.Log("[" + item2.enemyType.enemyName + "] Checking Enemy"); if (Config.disableAllEntities.Value) { Debugger.Debug.Log("[" + item2.enemyType.enemyName + "] DisableAllIndoorEntities is true!"); item2.rarity = 0; } else if (list.Contains(item2.enemyType.enemyName.ToLower())) { Debugger.Debug.Log("[" + item2.enemyType.enemyName + "] Entity found in blacklist! Removing..."); item2.rarity = 0; } else { Debugger.Debug.Log($"{item2.enemyType.enemyName}.Rarity = {item2.rarity}"); } } List allConnectedPlayers = GetAllConnectedPlayers("Round Start"); int num = 1; num = ((!Config.numberOfSeekers.Value.Contains("%")) ? int.Parse(Config.numberOfSeekers.Value) : Mathf.FloorToInt(float.Parse(Config.numberOfSeekers.Value.Replace("%", "")) / 100f * (float)allConnectedPlayers.Count)); if (num >= allConnectedPlayers.Count) { num = allConnectedPlayers.Count - 1; } if (num <= 0) { num = 1; } Debugger.Debug.LogWarning($"Number of seekers this round! = '{num}'"); string text = ""; for (int j = 0; j < num; j++) { PlayerControllerB val2 = PickRandomSeeker(); seekers.Add(val2); if (text != "") { text += ", "; } text += val2.playerUsername; NetworkHandler.Instance.EventSendRpc(".playerChosen", new MessageProperties(__bool: false, "", 0, 0f, ((NetworkBehaviour)val2).NetworkObjectId)); } NetworkHandler.Instance.EventSendRpc(".seekersChosen", new MessageProperties(__bool: false, text, 0, 0f, 0uL)); itemSpawnPositions.Clear(); ((MonoBehaviour)this).StartCoroutine(GivePlayersItems()); levelLoading = false; NetworkHandler.Instance.EventSendRpc(".levelLoaded"); } public PlayerControllerB PickRandomSeeker() { //IL_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) //IL_0418: Unknown result type (might be due to invalid IL or missing references) string text = Config.seekerChooseBehavior.Value.ToLower().Trim().Replace(" ", ""); if (seekers.Count > 0) { text = Config.extraSeekerChooseBehavior.Value.ToLower().Trim().Replace(" ", ""); } ulong num = 10001uL; Debugger.Debug.Log("Random Type ['" + text + "']"); switch (text) { case "nodouble": { List list = new List(); foreach (PlayerControllerB allConnectedPlayer in GetAllConnectedPlayers("Chosing Seeker, (NoDouble)")) { if (allConnectedPlayer.actualClientId != lastSeekerId && !seekers.Contains(allConnectedPlayer)) { Debugger.Debug.Log($"Added {allConnectedPlayer}!"); list.Add(allConnectedPlayer.actualClientId); } } if (list.Count > 0) { int index = Random.Range(0, list.Count); Debugger.Debug.Log("[NoDouble] RandomPlayerNumber = " + index); num = list[index]; } else { num = GameNetworkManager.Instance.localPlayerController.actualClientId; } break; } case "turns": { List list3 = new List(); foreach (PlayerControllerB allConnectedPlayer2 in GetAllConnectedPlayers("Chosing Seeker (Turns)")) { if (!pastSeekers.Contains(allConnectedPlayer2.actualClientId) && !seekers.Contains(allConnectedPlayer2)) { list3.Add(allConnectedPlayer2.actualClientId); } } if (list3.Count <= 0) { pastSeekers.Clear(); foreach (PlayerControllerB allConnectedPlayer3 in GetAllConnectedPlayers("Chosing Seeker (Turns Exausted)")) { if (!seekers.Contains(allConnectedPlayer3)) { list3.Add(allConnectedPlayer3.actualClientId); } } } int num3 = Random.Range(0, list3.Count); Debugger.Debug.Log($"[Turns] RandomPlayerNumber = '{num3}' Number In Current Pool '{list3.Count}'"); num = list3[num3]; if (list3.Contains(num)) { list3.Remove(num); pastSeekers.Add(num); } Debugger.Debug.LogWarning("---- New Pools! ----"); Debugger.Debug.LogWarning("CurrentPool = "); Debugger.Debug.Log(list3.ToArray()); Debugger.Debug.LogWarning("PastSeekers = "); Debugger.Debug.Log(pastSeekers.ToArray()); break; } case "lever": if (leverLastFlippedBy != 999) { Debugger.Debug.Log($"It using new lever thingy hehehe; Player id ({leverLastFlippedBy})"); num = leverLastFlippedBy; break; } goto default; default: { if (text == "closest" && seekers.Count > 0) { float num2 = float.PositiveInfinity; foreach (PlayerControllerB allConnectedPlayer4 in GetAllConnectedPlayers("Chosing Seeker (Closest)")) { if (allConnectedPlayer4.isPlayerControlled && !seekers.Contains(allConnectedPlayer4)) { Vector3 val = ((Component)allConnectedPlayer4).transform.position - ((Component)seekers[0]).transform.position; if (((Vector3)(ref val)).magnitude < num2) { num = allConnectedPlayer4.actualClientId; } } } Debugger.Debug.Log("[Closets] Closest player number = " + num); break; } List list2 = new List(); foreach (PlayerControllerB allConnectedPlayer5 in GetAllConnectedPlayers("Chosing Seeker (Random)")) { if (!seekers.Contains(allConnectedPlayer5)) { list2.Add(allConnectedPlayer5.actualClientId); } } int index2 = Random.Range(0, list2.Count); Debugger.Debug.Log("[Random] RandomPlayerNumber = " + index2); num = list2[index2]; break; } } PlayerControllerB playerWithClientId = GetPlayerWithClientId(num); if ((Object)(object)playerWithClientId == (Object)null) { Debugger.Debug.LogWarning($"Could not find player with id: '{num}' using id: '0' instead"); playerWithClientId = GetPlayerWithClientId(0uL); } lastSeekerId = num; return playerWithClientId; } public PlayerControllerB GetPlayerWithClientId(ulong playerId) { PlayerControllerB val = null; PlayerControllerB[] array = Object.FindObjectsByType((FindObjectsSortMode)0); foreach (PlayerControllerB val2 in array) { if (playerId == 0) { if (GetFRFRId(val2) == playerId) { val = val2; break; } } else if (val2.actualClientId == playerId) { val = val2; break; } } if ((Object)(object)val == (Object)null) { bool flag = false; PlayerControllerB[] array2 = Object.FindObjectsByType((FindObjectsSortMode)0); foreach (PlayerControllerB val3 in array2) { if (((NetworkBehaviour)val3).OwnerClientId != val3.actualClientId) { flag = true; val3.actualClientId = ((NetworkBehaviour)val3).OwnerClientId; Debugger.Debug.LogError("'" + val3.playerUsername + "' found with an incorrect actualClientId! ------------------------"); } } if (flag) { return GetPlayerWithClientId(playerId); } } Debugger.Debug.Log($"GetPlayerWithClientId({playerId}) Got player '{val}' with '{playerId}'"); return val; } public (int aliveHiders, int aliveSeekers, int hidersObjectiveCompleted, int aliveZombies) GetAlivePlayerCount() { int num = 0; int num2 = 0; int num3 = 0; int num4 = 0; foreach (PlayerControllerB allConnectedPlayer in GetAllConnectedPlayers("Get Alive Player Count")) { if (!allConnectedPlayer.isPlayerDead && ((Component)allConnectedPlayer).gameObject.tag != "Decoy") { if (zombies.Contains(allConnectedPlayer)) { num4++; } else if (seekers.Contains(allConnectedPlayer)) { num2++; } else if (ObjectivesManager.instance.PlayerReachedObjective(allConnectedPlayer)) { num3++; } else { num++; } } } return (num, num2, num3, num2); } public void UpdateGameState(string reason) { //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: 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_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0502: Unknown result type (might be due to invalid IL or missing references) //IL_0508: Unknown result type (might be due to invalid IL or missing references) //IL_0551: Unknown result type (might be due to invalid IL or missing references) //IL_0557: Unknown result type (might be due to invalid IL or missing references) bool isHostingGame = GameNetworkManager.Instance.isHostingGame; Debugger.Debug.LogError("UpdateGameState being called because '" + reason + "'"); GameState gameState = GetGameState(); var (num, num2, num3, _) = GetAlivePlayerCount(); switch (gameState) { case GameState.HidersRemain: if (num == 1 && Config.shipLeaveEarly.Value && Config.timeWhenLastHider.Value > TimeOfDay.Instance.currentDayTime) { NetworkHandler.Instance.EventSendRpc(".setDayTime", new MessageProperties(__bool: false, "", 0, Config.timeWhenLastHider.Value, 0uL)); } NetworkHandler.Instance.EventSendRpc(".tip", new MessageProperties(__bool: false, $"{num} Hiders Remain...", 0, 0f, 0uL)); break; case GameState.HidersDied: seekersWon = true; NetworkHandler.Instance.EventSendRpc(".tip", new MessageProperties(__bool: false, "", 0, 0f, 0uL) { _string = "Seeker Won!", _bool = true }); EndRound(); break; case GameState.SeekersDied: NetworkHandler.Instance.EventSendRpc(".tip", new MessageProperties(__bool: false, "", 0, 0f, 0uL) { _string = "Seeker Died; Hiders Win!", _bool = true }); if (!StartOfRound.Instance.shipHasLanded) { break; } EndRound(); if (!isHostingGame) { break; } foreach (PlayerControllerB allConnectedPlayer in GetAllConnectedPlayers("Reward Hiders")) { if (!allConnectedPlayer.isPlayerDead && allConnectedPlayer.isPlayerControlled && !seekers.Contains(allConnectedPlayer) && !zombies.Contains(allConnectedPlayer)) { int _int2 = Mathf.RoundToInt((1080f - Config.timeSeekerIsReleased.Value) * 12f / 60f); NetworkHandler networkHandler2 = NetworkHandler.Instance; ulong actualClientId = allConnectedPlayer.actualClientId; networkHandler2.EventSendRpc(".moneyChanged", new MessageProperties(__bool: false, "silent", _int2, 0f, actualClientId)); } } break; case GameState.HidersReachedObjective: NetworkHandler.Instance.EventSendRpc(".tip", new MessageProperties(__bool: false, "", 0, 0f, 0uL) { _string = "Objective Reached; Hiders Win!", _bool = true }); EndRound(); if (!isHostingGame) { break; } foreach (PlayerControllerB allConnectedPlayer2 in GetAllConnectedPlayers("Reward Objective Reachers")) { if (!allConnectedPlayer2.isPlayerDead && allConnectedPlayer2.isPlayerControlled && !seekers.Contains(allConnectedPlayer2) && !zombies.Contains(allConnectedPlayer2)) { int _int = Mathf.RoundToInt((1080f - Config.timeSeekerIsReleased.Value) * 12f / 60f); NetworkHandler networkHandler = NetworkHandler.Instance; ulong actualClientId = allConnectedPlayer2.actualClientId; networkHandler.EventSendRpc(".moneyChanged", new MessageProperties(__bool: false, "silent", _int, 0f, actualClientId)); } } break; } if (!isHostingGame || !StartOfRound.Instance.shipHasLanded) { return; } foreach (PlayerControllerB allConnectedPlayer3 in GetAllConnectedPlayers("Reward Players Who Just Died")) { if (!allConnectedPlayer3.isPlayerDead || zombies.Contains(allConnectedPlayer3) || seekers.Contains(allConnectedPlayer3) || rewardedPlayers.Contains(allConnectedPlayer3)) { continue; } rewardedPlayers.Add(allConnectedPlayer3); int num4 = Mathf.RoundToInt((TimeOfDay.Instance.currentDayTime - Config.timeSeekerIsReleased.Value) * 12f / 60f); if (num4 < 0) { num4 = 0; } Debugger.Debug.LogError($"Hider {allConnectedPlayer3.playerUsername} recived a reward of {num4}, survived for = {TimeOfDay.Instance.currentDayTime - Config.timeSeekerIsReleased.Value}"); NetworkHandler networkHandler3 = NetworkHandler.Instance; ulong actualClientId = allConnectedPlayer3.actualClientId; networkHandler3.EventSendRpc(".moneyChanged", new MessageProperties(__bool: false, "silent", num4, 0f, actualClientId)); foreach (PlayerControllerB seeker in seekers) { NetworkHandler.Instance.EventSendRpc(".moneyChanged", new MessageProperties(__bool: false, "silent", 50, 0f, seeker.actualClientId)); } if (num > 0 && Config.deadHidersRespawn.Value) { PatchHelper.ReviveAfterWaitAndCallRpc(allConnectedPlayer3, Config.zombieSpawnDelay.Value); } } } public GameState GetGameState() { var (num, num2, num3, num4) = GetAlivePlayerCount(); if (num2 <= 0) { return GameState.SeekersDied; } if (num <= 0) { if (num3 > 0) { return GameState.HidersReachedObjective; } return GameState.HidersDied; } return GameState.HidersRemain; } public bool ShouldGameEndEarly() { if (GetGameState() != 0) { gameEndedEarly = true; EndRound(); return true; } return false; } public void EndRound() { StartMatchLever val = Object.FindAnyObjectByType(); val.EndGame(); val.LeverAnimation(); if (((NetworkBehaviour)GameNetworkManager.Instance.localPlayerController).IsServer) { NetworkHandler.Instance.EventSendRpc(".roundEnded"); } } [IteratorStateMachine(typeof(d__31))] public IEnumerator GivePlayersItems() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__31(0) { <>4__this = this }; } public void SpawnNewItem(string itemName, PlayerControllerB player, bool forceSamePosition = false) { ((MonoBehaviour)RoundManager.Instance).StartCoroutine(SpawnNewItemCoroutine(itemName, player, forceSamePosition)); } [IteratorStateMachine(typeof(d__33))] public IEnumerator SpawnNewItemCoroutine(string itemName, PlayerControllerB player, bool forceSamePosition = false) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__33(0) { <>4__this = this, itemName = itemName, player = player, forceSamePosition = forceSamePosition }; } private static ulong GetFRFRId(PlayerControllerB player) { string text = ((Object)player).name.Replace("Player", "").Replace(" ", "").Replace("(", "") .Replace(")", ""); if (text == "") { return 0uL; } return ulong.Parse(text); } public bool IsRoundActive() { List allConnectedPlayers = GetAllConnectedPlayers("Is Round Active"); return playersTeleported >= allConnectedPlayers.Count && StartOfRound.Instance.shipHasLanded; } public void MakeZombie(PlayerControllerB player) { //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Expected O, but got Unknown //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown if (zombies.Contains(player)) { return; } zombies.Add(player); if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)player) { ((Renderer)player.thisPlayerModelArms).enabled = true; string value = Config.zombieSpawnLocation.Value; string text = value; if (!(text == "Entrance")) { if (text == "Inside") { EntranceTeleport val = (EntranceTeleport)AccessTools.Method(typeof(RoundManager), "FindMainEntranceScript", (Type[])null, (Type[])null).Invoke(null, new object[1] { true }); val.TeleportPlayer(); } } else { EntranceTeleport val2 = (EntranceTeleport)AccessTools.Method(typeof(RoundManager), "FindMainEntranceScript", (Type[])null, (Type[])null).Invoke(null, new object[1] { false }); val2.TeleportPlayer(); } } if (GameNetworkManager.Instance.isHostingGame) { Debugger.Debug.LogError("Giving zombie items!"); ((MonoBehaviour)this).StartCoroutine(GiveZombieItems(player)); } ((Graphic)player.usernameBillboardText).color = Config.zombieNameColor.Value; playerRevived?.Invoke(player.actualClientId); } [IteratorStateMachine(typeof(d__37))] public IEnumerator GiveZombieItems(PlayerControllerB player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__37(0) { <>4__this = this, player = player }; } public static List GetAllConnectedPlayers(string reason) { List list = new List(); PlayerControllerB[] array = Object.FindObjectsByType((FindObjectsSortMode)0); foreach (PlayerControllerB val in array) { if (val.isPlayerControlled || val.isPlayerDead) { list.Add(val); } } return list; } } public enum GameState { HidersRemain, HidersDied, SeekersDied, HidersReachedObjective } public class NetworkHandler : NetworkBehaviour { public LethalClientMessage NetworkMessage = new LethalClientMessage("HASMessage", (Action)null, (Action)null); public static NetworkHandler Instance { get; private set; } public event Action NetworkEvent; public override void OnNetworkSpawn() { this.NetworkEvent = null; NetworkMessage = new LethalClientMessage("HASMessage", (Action)null, (Action)null); if (Object.op_Implicit((Object)(object)Instance) && (NetworkManager.Singleton.IsHost || NetworkManager.Singleton.IsServer)) { NetworkHandler instance = Instance; if (instance != null) { NetworkObject component = ((Component)instance).gameObject.GetComponent(); if (component != null) { component.Despawn(true); } } } Instance = this; ((NetworkBehaviour)this).OnNetworkSpawn(); Debugger.Debug.LogMessage("NetworkHandler OnNetworkSpawn(): Connecting Events...."); NetworkEvent += NetworkEvents.LevelLoading; NetworkEvent += NetworkEvents.LevelLoaded; NetworkEvent += NetworkEvents.PlayerChosen; NetworkEvent += NetworkEvents.SeekersChosen; NetworkEvent += NetworkEvents.LockDoor; NetworkEvent += NetworkEvents.OpenDoor; NetworkEvent += NetworkEvents.PlayerTeleported; NetworkEvent += NetworkEvents.DisplayTip; NetworkEvent += NetworkEvents.LeverFlipped; NetworkEvent += NetworkEvents.SellCurrentItem; NetworkEvent += NetworkEvents.MoneyChanged; NetworkEvent += NetworkEvents.DestroyItem; NetworkEvent += NetworkEvents.BuyAbility; NetworkEvent += NetworkEvents.ActivateAbility; NetworkEvent += NetworkEvents.SetDayTime; NetworkEvent += NetworkEvents.GrabItem; NetworkEvent += NetworkEvents.RequestAbilityConfig; NetworkEvent += NetworkEvents.ReceiveAbilityConfig; NetworkEvent += NetworkEvents.RevivePlayerLocal; NetworkEvent += NetworkEvents.RoundEnded; NetworkMessage.OnReceivedFromClient += EventRecivedRpc; } public override void OnDestroy() { Debugger.Debug.LogMessage("NetworkHandler OnDestroy(): Disconnecting Events...."); NetworkEvent -= NetworkEvents.LevelLoading; NetworkEvent -= NetworkEvents.LevelLoaded; NetworkEvent -= NetworkEvents.PlayerChosen; NetworkEvent -= NetworkEvents.SeekersChosen; NetworkEvent -= NetworkEvents.LockDoor; NetworkEvent -= NetworkEvents.OpenDoor; NetworkEvent -= NetworkEvents.PlayerTeleported; NetworkEvent -= NetworkEvents.DisplayTip; NetworkEvent -= NetworkEvents.LeverFlipped; NetworkEvent -= NetworkEvents.SellCurrentItem; NetworkEvent -= NetworkEvents.MoneyChanged; NetworkEvent -= NetworkEvents.DestroyItem; NetworkEvent -= NetworkEvents.BuyAbility; NetworkEvent -= NetworkEvents.ActivateAbility; NetworkEvent -= NetworkEvents.SetDayTime; NetworkEvent -= NetworkEvents.GrabItem; NetworkEvent -= NetworkEvents.RequestAbilityConfig; NetworkEvent -= NetworkEvents.ReceiveAbilityConfig; NetworkEvent -= NetworkEvents.RevivePlayerLocal; NetworkEvent -= NetworkEvents.RoundEnded; ((NetworkBehaviour)this).OnDestroy(); } public void EventSendRpc(string eventName, MessageProperties message = null) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (message != null) { this.NetworkEvent?.Invoke(eventName, message); } else { this.NetworkEvent?.Invoke(eventName, new MessageProperties(__bool: false, "", 0, 0f, 0uL, default(Vector3), __null: true)); } Debugger.Debug.LogMessage("[NetworkHandler] Sending Event! + " + eventName); string text = eventName + "|" + JsonUtility.ToJson((object)message); NetworkMessage.SendAllClients(text, false, false); } public void EventRecivedRpc(string data, ulong playerID) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) string arg = data.Split("|")[0]; string text = data.Split("|")[1]; MessageProperties messageProperties = (MessageProperties)JsonUtility.FromJson(text, typeof(MessageProperties)); if (messageProperties != null) { this.NetworkEvent?.Invoke(arg, messageProperties); } else { this.NetworkEvent?.Invoke(arg, new MessageProperties(__bool: false, "", 0, 0f, 0uL, default(Vector3), __null: true)); } } } [BepInPlugin("gogozooom.HideAndSeek", "Hide And Seek Nightly", "1.5.0.0")] public class Plugin : BaseUnityPlugin { public const string PLUGIN_GUID = "gogozooom.HideAndSeek"; public const string PLUGIN_NAME = "Hide And Seek Nightly"; public const string PLUGIN_VERSION = "1.5.0.0"; public static ManualLogSource _Logger; public static Plugin instance; public static Config _Config; public static AssetBundle networkHandlerBundle; public static AssetBundle abilityRadialMenuBundle; public static AssetBundle tutorialRadialMenuBundle; private readonly Harmony harmony = new Harmony("gogozooom.HideAndSeek"); private void Awake() { instance = this; _Logger = ((BaseUnityPlugin)this).Logger; _Config = new Config(((BaseUnityPlugin)this).Config); Debugger.Debug.Log("Patching .RoundManagerPatch"); harmony.PatchAll(typeof(RoundManagerPatch)); Debugger.Debug.Log("Patching .TurretPatch"); harmony.PatchAll(typeof(TurretPatch)); Debugger.Debug.Log("Patching .LandminePatch"); harmony.PatchAll(typeof(LandminePatch)); Debugger.Debug.Log("Patching .SpikeRoofTrapPatch"); harmony.PatchAll(typeof(SpikeRoofTrapPatch)); Debugger.Debug.Log("Patching .ShotgunPatch"); harmony.PatchAll(typeof(ShotgunPatch)); Debugger.Debug.Log("Patching .PlayerControllerBPatch"); harmony.PatchAll(typeof(PlayerControllerBPatch)); Debugger.Debug.Log("Patching .EntranceTeleportPatch"); harmony.PatchAll(typeof(EntranceTeleportPatch)); Debugger.Debug.Log("Patching .TerminalPatch"); harmony.PatchAll(typeof(TerminalPatch)); Debugger.Debug.Log("Patching .TimeOfDayPatch"); harmony.PatchAll(typeof(TimeOfDayPatch)); Debugger.Debug.Log("Patching .HUDManagerPatch"); harmony.PatchAll(typeof(HUDManagerPatch)); Debugger.Debug.Log("Patching .GameNetworkManagerPatch"); harmony.PatchAll(typeof(GameNetworkManagerPatch)); Debugger.Debug.Log("Patching .StartOfRoundPatch"); harmony.PatchAll(typeof(StartOfRoundPatch)); Debugger.Debug.Log("Patching .InteractTriggerPatch"); harmony.PatchAll(typeof(InteractTriggerPatch)); Debugger.Debug.Log("Patching .GrabbableObjectPatch"); harmony.PatchAll(typeof(GrabbableObjectPatch)); Debugger.Debug.Log("Patching .DeadBodyInfoPatch"); harmony.PatchAll(typeof(DeadBodyInfoPatch)); Debugger.Debug.Log("Patching .HoarderBugAIPatch"); harmony.PatchAll(typeof(HoarderBugAIPatch)); Debugger.Debug.Log("Patching .CrawlerAIPatch"); harmony.PatchAll(typeof(CrawlerAIPatch)); Debugger.Debug.Log("Patching .FlowermanAIPatch"); harmony.PatchAll(typeof(FlowermanAIPatch)); Debugger.Debug.Log("Patching .MaskedPlayerEnemyPatch"); harmony.PatchAll(typeof(MaskedPlayerEnemyPatch)); Debugger.Debug.Log("Patching .StartMatchLeverPatch"); harmony.PatchAll(typeof(StartMatchLeverPatch)); string directoryName = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location); string text = Path.Combine(directoryName, "networkhandler"); networkHandlerBundle = AssetBundle.LoadFromFile(text); string text2 = Path.Combine(directoryName, "abilityradialmenu"); abilityRadialMenuBundle = AssetBundle.LoadFromFile(text2); string text3 = Path.Combine(directoryName, "tutorialmenu"); tutorialRadialMenuBundle = AssetBundle.LoadFromFile(text3); AbilitySpriteManager.LoadSprites(); ((MonoBehaviour)this).StartCoroutine(AudioManager.LoadAudioCoroutine()); _Logger.LogInfo((object)"Plugin gogozooom.HideAndSeek is loaded!"); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "HideAndSeek"; public const string PLUGIN_NAME = "HideAndSeek"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace HideAndSeek.Patches { public class MessageProperties { public bool _null = true; public bool _bool = false; public string _string = ""; public int _int = 0; public float _float = 0f; public ulong _ulong = 0uL; public Vector3 _Vector3 = default(Vector3); public string _extraMessage; public MessageProperties(bool __bool = false, string __string = "", int __int = 0, float __float = 0f, ulong __ulong = 0uL, Vector3 __Vector3 = default(Vector3), bool __null = false, string __extraMessage = null) { //IL_0039: 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_006f: Unknown result type (might be due to invalid IL or missing references) _bool = __bool; _string = __string; _int = __int; _float = __float; _ulong = __ulong; _Vector3 = __Vector3; _null = __null; _extraMessage = __extraMessage; } } internal class NetworkEvents { [CompilerGenerated] private sealed class d__21 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB __this; public GrabbableObject currentlyGrabbingObject; private Traverse 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__21(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = Traverse.Create((object)__this); <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; case 1: <>1__state = -1; currentlyGrabbingObject.parentObject = __this.localItemHolder; if ((Object)(object)currentlyGrabbingObject.itemProperties.grabSFX != (Object)null) { __this.itemAudio.PlayOneShot(currentlyGrabbingObject.itemProperties.grabSFX, 1f); } 5__1.Field("grabbedObjectValidated").SetValue((object)true); __this.isHoldingObject = true; <>2__current = (object)new WaitForSeconds(__this.grabObjectAnimationTime - 0.2f); <>1__state = 2; return true; case 2: <>1__state = -1; __this.playerBodyAnimator.SetBool("GrabValidated", true); __this.isGrabbingObjectAnimation = 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(); } } [CompilerGenerated] private sealed class d__23 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public bool waitForShipToLand; private PlayerControllerB 5__1; private TimeOfDay 5__2; private bool 5__3; private Vector3 5__4; private EntranceTeleport 5__5; private int 5__6; private List.Enumerator <>s__7; private PlayerControllerB 5__8; private EntranceTeleport 5__9; private int 5__10; private GrabbableObject[] <>s__11; private int <>s__12; private GrabbableObject 5__13; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__23(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; 5__5 = null; <>s__7 = default(List.Enumerator); 5__8 = null; 5__9 = null; <>s__11 = null; 5__13 = null; <>1__state = -2; } private bool MoveNext() { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0279: 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_0283: 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_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Expected O, but got Unknown //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: 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_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_0601: Expected O, but got Unknown //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_051b: Expected O, but got Unknown //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = GameNetworkManager.Instance.localPlayerController; 5__2 = Object.FindObjectOfType(); 5__3 = ((NetworkBehaviour)5__1).IsServer; if (waitForShipToLand) { goto IL_0089; } goto IL_00a3; case 1: <>1__state = -1; goto IL_0089; case 2: { <>1__state = -1; break; } IL_0089: if (5__2.currentDayTime <= 130f) { <>2__current = (object)new WaitForSecondsRealtime(0.5f); <>1__state = 1; return true; } goto IL_00a3; IL_00a3: if (StartOfRound.Instance.shipIsLeaving || HideAndSeekGM.instance.ShouldGameEndEarly()) { Debugger.Debug.LogError("Round Ending Prematurely"); return false; } if (5__3) { NetworkHandler.Instance.EventSendRpc(".lockDoor"); } Debugger.Debug.Log($"TIME TO TELEPORT! Local Player '{5__1}' Seekers '{HideAndSeekGM.instance.seekers}'"); if (HideAndSeekGM.instance.seekers.Contains(5__1)) { Debugger.Debug.LogMessage("[SEEKER] Attempted to teleport " + 5__1.playerUsername + " but they are the seeker!"); if (Object.op_Implicit((Object)(object)Object.FindObjectOfType())) { Object.FindObjectOfType().audioPresets[3].ChangeAudioReverbForPlayer(5__1); } 5__1.isInElevator = true; 5__1.isInHangarShipRoom = true; 5__1.isInsideFactory = false; 5__1.averageVelocity = 0f; 5__1.velocityLastFrame = Vector3.zero; 5__1.TeleportPlayer(StartOfRound.Instance.playerSpawnPositions[0].position, false, 0f, false, true); NetworkHandler.Instance.EventSendRpc(".teleported", new MessageProperties(__bool: false, "", 0, 0f, 0uL) { _null = false, _Vector3 = StartOfRound.Instance.playerSpawnPositions[0].position, _ulong = 5__1.actualClientId }); break; } Debugger.Debug.LogMessage("[HIDER] Teleporting to entrance... inside" + Config.forceHidersInside.Value); 5__1.DropAllHeldItems(true, false, false, false, default(Vector3), default(Vector3), default(Vector3), default(Vector3), default(Vector3)); 5__4 = (Vector3)AccessTools.Method(typeof(RoundManager), "FindMainEntrancePosition", (Type[])null, (Type[])null).Invoke(null, new object[2] { true, !Config.forceHidersInside.Value }); 5__5 = (EntranceTeleport)AccessTools.Method(typeof(RoundManager), "FindMainEntranceScript", (Type[])null, (Type[])null).Invoke(null, new object[1] { Config.forceHidersInside.Value }); if ((Object)(object)5__5 != (Object)null) { if (Config.teleportHidersToEntrance.Value) { 5__5.TeleportPlayer(); Debugger.Debug.LogMessage("Player [" + 5__1.playerUsername + "] teleported to entrance..."); } else { 5__5.TeleportPlayer(); Debugger.Debug.LogError("teleportPlayerOutOfShip NOT IMPLEMENTED! [" + 5__1.playerUsername + "] teleported to entrance..."); } NetworkHandler.Instance.EventSendRpc(".teleported", new MessageProperties(__bool: false, "", 0, 0f, 0uL) { _null = false, _Vector3 = 5__4, _ulong = 5__1.actualClientId }); } else { Debugger.Debug.LogError("Failed to find entrance"); } 5__5 = null; break; } if (5__2.currentDayTime < Config.timeSeekerIsReleased.Value) { 5__6 = 0; <>s__7 = HideAndSeekGM.instance.seekers.GetEnumerator(); try { while (<>s__7.MoveNext()) { 5__8 = <>s__7.Current; if (!5__8.isPlayerDead && ((Component)5__8).gameObject.activeSelf) { 5__6++; } 5__8 = null; } } finally { ((IDisposable)<>s__7).Dispose(); } <>s__7 = default(List.Enumerator); if (5__6 <= 0) { Object.FindAnyObjectByType().EndGame(); Debugger.Debug.LogError("All Seekers Died Before The Round Started!"); return false; } if (!5__2.timeHasStarted) { return false; } <>2__current = (object)new WaitForSeconds(1f); <>1__state = 2; return true; } if (StartOfRound.Instance.shipIsLeaving || HideAndSeekGM.instance.ShouldGameEndEarly()) { Debugger.Debug.LogError("Round Ending Prematurely"); return false; } if (5__3) { NetworkHandler.Instance.EventSendRpc(".openDoor"); } if (HideAndSeekGM.instance.seekers.Contains(5__1)) { Debugger.Debug.LogMessage("Teleporting to entrance..."); 5__9 = (EntranceTeleport)AccessTools.Method(typeof(RoundManager), "FindMainEntranceScript", (Type[])null, (Type[])null).Invoke(null, new object[1] { Config.forceSeekerInside.Value }); 5__10 = 0; <>s__11 = 5__1.ItemSlots; for (<>s__12 = 0; <>s__12 < <>s__11.Length; <>s__12++) { 5__13 = <>s__11[<>s__12]; if ((Object)(object)5__13 != (Object)null) { 5__10++; } 5__13 = null; } <>s__11 = null; if ((Object)(object)5__9 != (Object)null && 5__10 != 0) { if (Config.teleportSeekerToEntrance.Value) { 5__9.TeleportPlayer(); Debugger.Debug.LogMessage("Player [" + 5__1.playerUsername + "] teleported to entrance..."); } } else { Debugger.Debug.LogError("Failed to find entrance / Player did not pick up items"); } 5__9 = 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 static void LevelLoading(string eventName, MessageProperties mProps = null) { if (!(eventName != ".levelLoading")) { Debugger.Debug.LogMessage("Got LevelLoading Broadcast!"); RoundManager.Instance.LoadNewLevel(StartOfRound.Instance.randomMapSeed, StartOfRound.Instance.currentLevel); } } public static void PlayerChosen(string eventName, MessageProperties mProps) { if (eventName != ".playerChosen") { return; } Debugger.Debug.LogMessage("Got PlayerChosen Broadcast!"); foreach (PlayerControllerB allConnectedPlayer in HideAndSeekGM.GetAllConnectedPlayers("Seeker Chosen")) { if (((NetworkBehaviour)allConnectedPlayer).NetworkObjectId == mProps._ulong) { if (!GameNetworkManager.Instance.isHostingGame) { HideAndSeekGM.instance.seekers.Add(allConnectedPlayer); } if (GameNetworkManager.Instance.localPlayerController.actualClientId == allConnectedPlayer.actualClientId) { HUDManager.Instance.DisplayTip("Hide And Seek", "You are the seeker!", true, false, "LC_Tip1"); } break; } } } public static void SeekersChosen(string eventName, MessageProperties mProps) { //IL_00c1: 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) if (eventName != ".seekersChosen") { return; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (!HideAndSeekGM.instance.seekers.Contains(localPlayerController)) { HUDManager.Instance.DisplayTip("Hide And Seek", "Seeker(s) chosen this round [" + mProps._string + "]", false, false, "LC_Tip1"); } foreach (PlayerControllerB allConnectedPlayer in HideAndSeekGM.GetAllConnectedPlayers("Change Bilboard Color")) { if (HideAndSeekGM.instance.seekers.Contains(allConnectedPlayer)) { ((Graphic)allConnectedPlayer.usernameBillboardText).color = Config.seekerNameColor.Value; } else { ((Graphic)allConnectedPlayer.usernameBillboardText).color = Config.hiderNameColor.Value; } } } public static void LockDoor(string eventName, MessageProperties mProps = null) { if (!(eventName != ".lockDoor")) { Debugger.Debug.LogMessage("Got LockDoor Broadcast!"); HangarShipDoor val = Object.FindObjectOfType(); val.SetDoorClosed(); val.PlayDoorAnimation(true); val.buttonsEnabled = false; } } public static void OpenDoor(string eventName, MessageProperties mProps = null) { if (!(eventName != ".openDoor")) { Debugger.Debug.LogMessage("Got OpenDoor Broadcast!"); HangarShipDoor val = Object.FindObjectOfType(); val.buttonsEnabled = true; val.SetDoorOpen(); val.PlayDoorAnimation(false); } } public static void PlayerTeleported(string eventName, MessageProperties mProps) { //IL_0062: Unknown result type (might be due to invalid IL or missing references) if (!(eventName != ".teleported")) { Debugger.Debug.LogMessage("Got Player Teleported Brodcast!"); if (mProps._bool) { HideAndSeekGM.instance.playersTeleported = 0; Debugger.Debug.LogMessage("New Round, Reset Players Teleported!"); } else if (!mProps._null) { HideAndSeekGM.instance.itemSpawnPositions.Add((mProps._ulong, mProps._Vector3)); HideAndSeekGM.instance.playersTeleported++; Debugger.Debug.LogMessage($"Added to teleported players! Number is now '{HideAndSeekGM.instance.playersTeleported}' "); } else { Debugger.Debug.LogError("[Player Teleported] mProps == null! Called dry!"); } } } public static void DisplayTip(string eventName, MessageProperties mProps) { if (!(eventName != ".tip")) { Debugger.Debug.LogMessage("Got Display Tip Brodcast!"); if (mProps._int != -1 || mProps._ulong == GameNetworkManager.Instance.localPlayerController.actualClientId) { HUDManager.Instance.DisplayTip("Hide And Seek", mProps._string, mProps._bool, false, "LC_Tip1"); } } } public static void LevelLoaded(string eventName, MessageProperties mProps) { if (!(eventName != ".levelLoaded")) { Debugger.Debug.LogMessage("Get Level Done Loading Brodcast!"); HideAndSeekGM.instance.roundStarted?.Invoke(); HideAndSeekGM.instance.levelLoading = false; } } public static void RoundEnded(string eventName, MessageProperties mProps) { if (!(eventName != ".roundEnded")) { Debugger.Debug.LogMessage("Got Round Ended Broadcast!"); HideAndSeekGM.instance.shipLeaving?.Invoke(); } } public static void LeverFlipped(string eventName, MessageProperties mProps) { if (!(eventName != ".leverFlipped")) { Debugger.Debug.LogMessage($"Got Lever Flipped Brodcast! New player id ({mProps._ulong})"); HideAndSeekGM.instance.leverLastFlippedBy = mProps._ulong; } } public static void SellCurrentItem(string eventName, MessageProperties mProps) { if (!(eventName != ".sellCurrentItem") && GameNetworkManager.Instance.isHostingGame) { Debugger.Debug.LogMessage($"Got Sell Current Item Brodcast! From player id '{mProps._ulong}'"); AbilityManager.SellCurrentItem(mProps._ulong); } } public static void MoneyChanged(string eventName, MessageProperties mProps) { if (eventName != ".moneyChanged") { return; } Debugger.Debug.LogMessage(string.Format("Got Money Change Brodcast! For player id: '{0}' is silent: '{1}'", mProps._ulong, mProps._string == "silent")); PlayerControllerB playerWithClientId = HideAndSeekGM.instance.GetPlayerWithClientId(mProps._ulong); if (mProps._null) { foreach (PlayerControllerB allConnectedPlayer in HideAndSeekGM.GetAllConnectedPlayers("Money Chaanged")) { ((Component)allConnectedPlayer).GetComponent()?.ServerMoneyUpdated(mProps._int, mProps._bool, mProps._string == "silent"); } return; } if (Object.op_Implicit((Object)(object)playerWithClientId)) { AbilityInstance abilityInstance = ((Component)playerWithClientId).GetComponent(); if ((Object)(object)abilityInstance == (Object)null) { abilityInstance = ((Component)playerWithClientId).gameObject.AddComponent(); } abilityInstance.ServerMoneyUpdated(mProps._int, mProps._bool, mProps._string == "silent"); } } public static void DestroyItem(string eventName, MessageProperties mProps) { if (!(eventName != ".destroyItem") && mProps._ulong == GameNetworkManager.Instance.localPlayerController.actualClientId) { Debugger.Debug.LogMessage($"Got Delete Item Brodcast! For player id '{mProps._ulong}'"); PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; localPlayerController.DestroyItemInSlotAndSync(mProps._int); } } public static void BuyAbility(string eventName, MessageProperties mProps) { if (!(eventName != ".buyAbility") && GameNetworkManager.Instance.isHostingGame) { Debugger.Debug.LogMessage($"Got Buy Ability Brodcast! Ability name '{mProps._string}' From player id '{mProps._ulong}'"); AbilityManager.BuyAbilityServer(mProps._ulong, Abilities.FindAbilityByName(mProps._string)); } } public static void ActivateAbility(string eventName, MessageProperties mProps) { if (!(eventName != ".activateAbility")) { Debugger.Debug.LogMessage($"Got Activate Abilty Brodcast! Ability name '{mProps._string}' From player id '{mProps._ulong}' Extra info '{mProps._extraMessage}'"); AbilityBase abilityBase = Abilities.FindAbilityByName(mProps._string); if (abilityBase != null) { abilityBase.ActivateAbility(mProps._ulong, mProps._extraMessage); } else { Debugger.Debug.LogWarning("[ActivateAbility] Could not find ability by the name of '" + mProps._string + "'!"); } } } public static void SetDayTime(string eventName, MessageProperties mProps) { if (!(eventName != ".setDayTime")) { Debugger.Debug.LogMessage($"Got SetDayTime Brodcast! time to set = '{mProps._float}' current time = '{TimeOfDay.Instance.currentDayTime}' global time = '{TimeOfDay.Instance.globalTime}' "); TimeOfDay.Instance.globalTime = mProps._float; TimeOfDay.Instance.currentDayTime = mProps._float; } } public static void GrabItem(string eventName, MessageProperties mProps) { if (eventName != ".grabItem" || mProps._ulong != GameNetworkManager.Instance.localPlayerController.actualClientId) { return; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (mProps._null) { Debugger.Debug.LogError("Got GrabItem Brodcast but mprops is null!"); } Debugger.Debug.LogMessage("Got GrabItem Brodcast!"); GrabbableObject[] array = Object.FindObjectsOfType(); foreach (GrabbableObject val in array) { if (((NetworkBehaviour)val).NetworkObjectId == ulong.Parse(mProps._extraMessage)) { Debugger.Debug.Log($"SyncingPatch - GrabItem(): Found object to grab! {val}"); if (!((NetworkBehaviour)val).IsOwner) { ((NetworkBehaviour)val).NetworkObject.ChangeOwnership(localPlayerController.actualClientId); } if (!((NetworkBehaviour)val).IsOwner) { Debugger.Debug.LogError("SyncingPatch - GrabItem(): Could not get ownership!"); } else { GrabObject(localPlayerController, val); } break; } } } public static void RequestAbilityConfig(string eventName, MessageProperties mProps) { //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_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) if (eventName != ".requestAbilityConfig" || !GameNetworkManager.Instance.isHostingGame) { return; } Debugger.Debug.Log("Got RequestAbilityConfig()"); if (mProps._string != "") { AbilityConfig abilityConfig = Abilities.FindAbilityConfigByName(mProps._string, check: true); if (abilityConfig != null) { NetworkHandler instance = NetworkHandler.Instance; ulong @ulong = mProps._ulong; string _extraMessage = Abilities.AbilityCfgToData(abilityConfig, format: false); instance.EventSendRpc(".receiveAbilityConfig", new MessageProperties(__bool: false, "", 0, 0f, @ulong, default(Vector3), __null: false, _extraMessage)); } return; } foreach (AbilityConfig abilityConfig2 in Abilities.abilityConfigs) { NetworkHandler instance2 = NetworkHandler.Instance; ulong ulong2 = mProps._ulong; string _extraMessage = Abilities.AbilityCfgToData(abilityConfig2, format: false); instance2.EventSendRpc(".receiveAbilityConfig", new MessageProperties(__bool: false, "", 0, 0f, ulong2, default(Vector3), __null: false, _extraMessage)); } } public static void ReceiveAbilityConfig(string eventName, MessageProperties mProps) { if (!(eventName != ".receiveAbilityConfig") && GameNetworkManager.Instance.localPlayerController.actualClientId == mProps._ulong) { Debugger.Debug.Log("Got ReceiveAbilityConfig()"); Abilities.LoadAbilityConfig(Abilities.ADataToCfg(mProps._extraMessage)); } } public static void RevivePlayerLocal(string eventName, MessageProperties mProps) { if (!(eventName != ".revivePlayerLocal")) { Debugger.Debug.Log($"Got RevivePlayerLocal({mProps._ulong})"); PatchHelper.RevivePlayerLocal(HideAndSeekGM.instance.GetPlayerWithClientId(mProps._ulong)); } } private static void GrabObject(PlayerControllerB __this, GrabbableObject currentlyGrabbingObject) { //IL_0200: Unknown result type (might be due to invalid IL or missing references) Traverse.Create((object)__this).Field("currentlyGrabbingObject").SetValue((object)currentlyGrabbingObject); if (!GameNetworkManager.Instance.gameHasStarted && !currentlyGrabbingObject.itemProperties.canBeGrabbedBeforeGameStart && (Object)(object)StartOfRound.Instance.testRoom == (Object)null) { return; } Traverse.Create((object)__this).Field("grabInvalidated").SetValue((object)false); if ((Object)(object)currentlyGrabbingObject == (Object)null || __this.inSpecialInteractAnimation || currentlyGrabbingObject.isHeld || currentlyGrabbingObject.isPocketed) { return; } NetworkObject networkObject = ((NetworkBehaviour)currentlyGrabbingObject).NetworkObject; if ((Object)(object)networkObject == (Object)null || !networkObject.IsSpawned) { return; } currentlyGrabbingObject.InteractItem(); if (currentlyGrabbingObject.grabbable) { __this.playerBodyAnimator.SetBool("GrabInvalidated", false); __this.playerBodyAnimator.SetBool("GrabValidated", false); __this.playerBodyAnimator.SetBool("cancelHolding", false); __this.playerBodyAnimator.ResetTrigger("Throw"); Traverse.Create((object)__this).Method("SetSpecialGrabAnimationBool", new object[2] { true, currentlyGrabbingObject }); __this.isGrabbingObjectAnimation = true; ((Behaviour)__this.cursorIcon).enabled = false; ((TMP_Text)__this.cursorTip).text = ""; __this.twoHanded = currentlyGrabbingObject.itemProperties.twoHanded; __this.carryWeight = Mathf.Clamp(__this.carryWeight + (currentlyGrabbingObject.itemProperties.weight - 1f), 1f, 10f); if (currentlyGrabbingObject.itemProperties.grabAnimationTime > 0f) { __this.grabObjectAnimationTime = currentlyGrabbingObject.itemProperties.grabAnimationTime; } else { __this.grabObjectAnimationTime = 0.4f; } AccessTools.Method(typeof(PlayerControllerB), "GrabObjectServerRpc", (Type[])null, (Type[])null).Invoke(__this, new object[1] { NetworkObjectReference.op_Implicit(((NetworkBehaviour)currentlyGrabbingObject).NetworkObject) }); ((MonoBehaviour)__this).StartCoroutine(GrabObjectCoroutine(__this, currentlyGrabbingObject)); } } [IteratorStateMachine(typeof(d__21))] private static IEnumerator GrabObjectCoroutine(PlayerControllerB __this, GrabbableObject currentlyGrabbingObject) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__21(0) { __this = __this, currentlyGrabbingObject = currentlyGrabbingObject }; } public static void TeleportPlayer() { Debugger.Debug.LogMessage("Got Teleport Player Brodcast!"); HideAndSeekGM.instance.playersTeleported = 0; ((MonoBehaviour)RoundManager.Instance).StartCoroutine(TeleportSelf(waitForShipToLand: true)); } [IteratorStateMachine(typeof(d__23))] public static IEnumerator TeleportSelf(bool waitForShipToLand) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__23(0) { waitForShipToLand = waitForShipToLand }; } } [HarmonyPatch(typeof(Turret))] public class TurretPatch { [HarmonyPatch("CheckForPlayersInLineOfSight")] [HarmonyPrefix] private static bool CheckForPlayersInLineOfSightPatch(ref Turret __instance, ref PlayerControllerB __result, ref float radius, ref bool angleRangeCheck) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Invalid comparison between Unknown and I4 //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Invalid comparison between Unknown and I4 //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_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: 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_019e: 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_027e: Unknown result type (might be due to invalid IL or missing references) if (Config.abilitiesEnabled.Value) { NetworkObject networkObject = ((NetworkBehaviour)__instance).NetworkObject; SpawnAbilityInfo spawnAbilityInfo = ((networkObject != null) ? ((Component)networkObject).gameObject.GetComponent() : null); if (Object.op_Implicit((Object)(object)spawnAbilityInfo)) { Vector3 val = __instance.aimPoint.forward; val = Quaternion.Euler(0f, (float)(-(int)__instance.rotationRange) / radius, 0f) * val; float num = __instance.rotationRange / radius * 2f; Ray val2 = default(Ray); RaycastHit val3 = default(RaycastHit); for (int i = 0; i <= 6; i++) { ((Ray)(ref val2))..ctor(__instance.centerPoint.position, val); bool flag = (bool)AccessTools.Field(typeof(Turret), "enteringBerserkMode").GetValue(__instance); if (Physics.Raycast(val2, ref val3, 30f, 1051400, (QueryTriggerInteraction)1)) { AccessTools.Field(typeof(Turret), "shootRay").SetValue(__instance, val2); AccessTools.Field(typeof(Turret), "hit").SetValue(__instance, val3); if (((Component)((RaycastHit)(ref val3)).transform).CompareTag("Player")) { PlayerControllerB component = ((Component)((RaycastHit)(ref val3)).transform).GetComponent(); if (!((Object)(object)component == (Object)null)) { if (angleRangeCheck && Vector3.Angle(((Component)component).transform.position + Vector3.up * 1.75f - __instance.centerPoint.position, __instance.forwardFacingPos.forward) > __instance.rotationRange) { __result = null; return false; } if ((Object)(object)component == (Object)(object)spawnAbilityInfo.creatorPlayer || spawnAbilityInfo.otherFriendlies.Contains(component)) { Debugger.Debug.LogError("Turret: Canceled behavior because is friendly!"); __result = null; return false; } __result = component; return false; } continue; } if (((int)__instance.turretMode == 2 || !((int)__instance.turretMode != 3 || flag)) && ((Component)((RaycastHit)(ref val3)).transform).tag.StartsWith("PlayerRagdoll")) { Rigidbody component2 = ((Component)((RaycastHit)(ref val3)).transform).GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.AddForce(((Vector3)(ref val)).normalized * 42f, (ForceMode)1); } } } val = Quaternion.Euler(0f, num / 6f, 0f) * val; } __result = null; return false; } } return true; } [HarmonyPatch("Start")] [HarmonyPrefix] private static void StartPatch(Turret __instance) { if (!Config.turretsEnabled.Value && TimeOfDay.Instance.currentDayTime <= Config.timeSeekerIsReleased.Value) { Debugger.Debug.LogWarning("Turret Found! Deleteing..."); ((NetworkBehaviour)__instance).NetworkObject.Despawn(true); Debugger.Debug.Log("Deleteing..."); } } } [HarmonyPatch(typeof(Landmine))] public class LandminePatch { [HarmonyPatch("OnTriggerEnter")] [HarmonyPrefix] private static bool OnTriggerEnterPatch(ref Landmine __instance, ref Collider other) { if (Config.abilitiesEnabled.Value) { NetworkObject networkObject = ((NetworkBehaviour)__instance).NetworkObject; SpawnAbilityInfo spawnAbilityInfo = ((networkObject != null) ? ((Component)networkObject).gameObject.GetComponent() : null); if (Object.op_Implicit((Object)(object)spawnAbilityInfo)) { float num = (float)AccessTools.Field(typeof(Landmine), "pressMineDebounceTimer").GetValue(__instance); if (__instance.hasExploded) { return false; } if (num > 0f) { return false; } if (((Component)other).CompareTag("Player")) { PlayerControllerB component = ((Component)other).gameObject.GetComponent(); if ((Object)(object)component != (Object)(object)GameNetworkManager.Instance.localPlayerController) { return false; } if ((Object)(object)component != (Object)null && !component.isPlayerDead) { if ((Object)(object)component == (Object)(object)spawnAbilityInfo.creatorPlayer || spawnAbilityInfo.otherFriendlies.Contains(component)) { Debugger.Debug.LogError("Landmine: Canceled behavior because is friendly!"); return false; } AccessTools.Field(typeof(Landmine), "localPlayerOnMine").SetValue(__instance, true); AccessTools.Field(typeof(Landmine), "pressMineDebounceTimer").SetValue(__instance, 0.5f); __instance.PressMineServerRpc(); return false; } } else if (((Component)other).CompareTag("PhysicsProp") || ((Component)other).tag.StartsWith("PlayerRagdoll")) { if (Object.op_Implicit((Object)(object)((Component)other).GetComponent())) { if ((Object)(object)((Component)other).GetComponent().playerScript != (Object)(object)GameNetworkManager.Instance.localPlayerController) { return false; } } else if (Object.op_Implicit((Object)(object)((Component)other).GetComponent()) && !((NetworkBehaviour)((Component)other).GetComponent()).NetworkObject.IsOwner) { return false; } AccessTools.Field(typeof(Landmine), "pressMineDebounceTimer").SetValue(__instance, 0.5f); __instance.PressMineServerRpc(); } } } return true; } [HarmonyPatch("OnTriggerExit")] [HarmonyPrefix] private static bool OnTriggerExitPatch(ref Landmine __instance, ref Collider other) { if (Config.abilitiesEnabled.Value) { NetworkObject networkObject = ((NetworkBehaviour)__instance).NetworkObject; SpawnAbilityInfo spawnAbilityInfo = ((networkObject != null) ? ((Component)networkObject).gameObject.GetComponent() : null); if (Object.op_Implicit((Object)(object)spawnAbilityInfo)) { if (__instance.hasExploded) { return false; } if (!(bool)AccessTools.Field(typeof(Landmine), "mineActivated").GetValue(__instance)) { return false; } if (((Component)other).CompareTag("Player")) { PlayerControllerB component = ((Component)other).gameObject.GetComponent(); if ((Object)(object)component != (Object)null && !component.isPlayerDead) { if ((Object)(object)component != (Object)(object)GameNetworkManager.Instance.localPlayerController) { return false; } if ((Object)(object)component == (Object)(object)spawnAbilityInfo.creatorPlayer || spawnAbilityInfo.otherFriendlies.Contains(component)) { Debugger.Debug.LogError("Landmine: Canceled behavior because is friendly!"); return false; } AccessTools.Field(typeof(Landmine), "localPlayerOnMine").SetValue(__instance, false); AccessTools.Method(typeof(Landmine), "TriggerMineOnLocalClientByExiting", (Type[])null, (Type[])null).Invoke(__instance, null); return false; } } else if (((Component)other).tag.StartsWith("PlayerRagdoll") || ((Component)other).CompareTag("PhysicsProp")) { if (Object.op_Implicit((Object)(object)((Component)other).GetComponent())) { if ((Object)(object)((Component)other).GetComponent().playerScript != (Object)(object)GameNetworkManager.Instance.localPlayerController) { return false; } } else if (Object.op_Implicit((Object)(object)((Component)other).GetComponent()) && !((NetworkBehaviour)((Component)other).GetComponent()).NetworkObject.IsOwner) { return false; } AccessTools.Method(typeof(Landmine), "TriggerMineOnLocalClientByExiting", (Type[])null, (Type[])null).Invoke(__instance, null); } } } return true; } [HarmonyPatch("Start")] [HarmonyPrefix] private static void StartPatch(Landmine __instance) { if (!Config.landminesEnabled.Value && TimeOfDay.Instance.currentDayTime <= Config.timeSeekerIsReleased.Value) { Debugger.Debug.LogWarning("Landmine Found!"); ((NetworkBehaviour)__instance).NetworkObject.Despawn(true); Debugger.Debug.Log("Deleteing..."); } } } public class EnemyAIPatch { public static void UpdatePatch(EnemyAI _this) { //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_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_0146: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: 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_0339: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0439: Unknown result type (might be due to invalid IL or missing references) //IL_0459: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_0414: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_0424: Unknown result type (might be due to invalid IL or missing references) //IL_05dd: Unknown result type (might be due to invalid IL or missing references) //IL_060f: Unknown result type (might be due to invalid IL or missing references) //IL_0635: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: Unknown result type (might be due to invalid IL or missing references) //IL_04cc: Unknown result type (might be due to invalid IL or missing references) //IL_04d7: Unknown result type (might be due to invalid IL or missing references) //IL_04dc: Unknown result type (might be due to invalid IL or missing references) //IL_04e1: Unknown result type (might be due to invalid IL or missing references) //IL_0504: Unknown result type (might be due to invalid IL or missing references) //IL_050f: Unknown result type (might be due to invalid IL or missing references) //IL_051a: Unknown result type (might be due to invalid IL or missing references) //IL_051f: Unknown result type (might be due to invalid IL or missing references) //IL_0529: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0539: Unknown result type (might be due to invalid IL or missing references) //IL_053e: Unknown result type (might be due to invalid IL or missing references) //IL_0543: Unknown result type (might be due to invalid IL or missing references) Traverse val = Traverse.Create((object)_this); if (_this.enemyType.isDaytimeEnemy && !_this.daytimeEnemyLeaving) { AccessTools.Method(typeof(CrawlerAI), "CheckTimeOfDayToLeave", (Type[])null, (Type[])null).Invoke(_this, null); } if (_this.stunnedIndefinitely <= 0) { if (_this.stunNormalizedTimer >= 0f) { _this.stunNormalizedTimer -= Time.deltaTime / _this.enemyType.stunTimeMultiplier; } else { _this.stunnedByPlayer = null; if (_this.postStunInvincibilityTimer >= 0f) { _this.postStunInvincibilityTimer -= Time.deltaTime * 5f; } } } if (!_this.ventAnimationFinished && _this.timeSinceSpawn < _this.exitVentAnimationTime + 0.005f * (float)RoundManager.Instance.numberOfEnemiesInScene) { _this.timeSinceSpawn += Time.deltaTime; if (!((NetworkBehaviour)_this).IsOwner) { Vector3 serverPosition = _this.serverPosition; if (_this.serverPosition != Vector3.zero) { ((Component)_this).transform.position = _this.serverPosition; ((Component)_this).transform.eulerAngles = new Vector3(((Component)_this).transform.eulerAngles.x, (float)val.Field("targetYRotation").GetValue(), ((Component)_this).transform.eulerAngles.z); } return; } float num = (float)val.Field("updateDestinationInterval").GetValue(); if (num >= 0f) { num -= Time.deltaTime; return; } _this.SyncPositionToClients(); num = 0.1f; val.Field("updateDestinationInterval").SetValue((object)num); return; } if (!_this.inSpecialAnimation && !_this.ventAnimationFinished) { _this.ventAnimationFinished = true; if ((Object)(object)_this.creatureAnimator != (Object)null) { _this.creatureAnimator.SetBool("inSpawningAnimation", false); } } if (!((NetworkBehaviour)_this).IsOwner) { if (_this.currentSearch.inProgress) { _this.StopSearch(_this.currentSearch, true); } _this.SetClientCalculatingAI(false); if (!_this.inSpecialAnimation) { Vector3 val2 = (Vector3)val.Field("tempVelocity").GetValue(); ((Component)_this).transform.position = Vector3.SmoothDamp(((Component)_this).transform.position, _this.serverPosition, ref val2, _this.syncMovementSpeed); ((Component)_this).transform.eulerAngles = new Vector3(((Component)_this).transform.eulerAngles.x, Mathf.LerpAngle(((Component)_this).transform.eulerAngles.y, (float)val.Field("targetYRotation").GetValue(), 15f * Time.deltaTime), ((Component)_this).transform.eulerAngles.z); val.Field("tempVelocity").SetValue((object)val2); } _this.timeSinceSpawn += Time.deltaTime; return; } if (_this.isEnemyDead) { _this.SetClientCalculatingAI(false); return; } if (!_this.inSpecialAnimation) { _this.SetClientCalculatingAI(true); } if (_this.movingTowardsTargetPlayer && (Object)(object)_this.targetPlayer != (Object)null) { float num2 = (float)val.Field("setDestinationToPlayerInterval").GetValue(); if (num2 <= 0f) { num2 = 0.25f; _this.destination = RoundManager.Instance.GetNavMeshPosition(((Component)_this.targetPlayer).transform.position, RoundManager.Instance.navHit, 2.7f, -1); } else { _this.destination = new Vector3(((Component)_this.targetPlayer).transform.position.x, _this.destination.y, ((Component)_this.targetPlayer).transform.position.z); num2 -= Time.deltaTime; } if (_this.addPlayerVelocityToDestination > 0f) { if ((Object)(object)_this.targetPlayer == (Object)(object)GameNetworkManager.Instance.localPlayerController) { _this.destination += Vector3.Normalize(_this.targetPlayer.thisController.velocity * 100f) * _this.addPlayerVelocityToDestination; } else if (_this.targetPlayer.timeSincePlayerMoving < 0.25f) { _this.destination += Vector3.Normalize((_this.targetPlayer.serverPlayerPosition - _this.targetPlayer.oldPlayerPosition) * 100f) * _this.addPlayerVelocityToDestination; } } val.Field("setDestinationToPlayerInterval").SetValue((object)num2); } if (_this.inSpecialAnimation) { return; } float num3 = (float)val.Field("updateDestinationInterval").GetValue(); if (num3 >= 0f) { num3 -= Time.deltaTime; } else { _this.DoAIInterval(); num3 = _this.AIIntervalTime; } float num4 = (float)val.Field("previousYRotation").GetValue(); if (Mathf.Abs(num4 - ((Component)_this).transform.eulerAngles.y) > 6f) { val.Field("previousYRotation").SetValue((object)((Component)_this).transform.eulerAngles.y); val.Field("targetYRotation").SetValue((object)((Component)_this).transform.eulerAngles.y); if (((NetworkBehaviour)_this).IsServer) { AccessTools.Method(typeof(CrawlerAI), "UpdateEnemyRotationClientRpc", (Type[])null, (Type[])null).Invoke(_this, new object[1] { (short)num4 }); return; } AccessTools.Method(typeof(CrawlerAI), "UpdateEnemyRotationServerRpc", (Type[])null, (Type[])null).Invoke(_this, new object[1] { (short)num4 }); } val.Field("updateDestinationInterval").SetValue((object)num3); } } [HarmonyPatch(typeof(HoarderBugAI))] public class HoarderBugAIPatch { private static bool GrabTargetItemIfClose(HoarderBugAI _this, SpawnAbilityInfo sInfo) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0061: 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_007c: 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_008d: 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) if ((Object)(object)_this.targetItem != (Object)null && _this.heldItem == null && Vector3.Distance(((Component)_this).transform.position, ((Component)_this.targetItem).transform.position) < 1f) { _this.nestPosition = ((Component)sInfo.creatorPlayer).transform.position; if (!((EnemyAI)_this).SetDestinationToPosition(_this.nestPosition, true)) { _this.nestPosition = ((EnemyAI)_this).ChooseClosestNodeToPosition(((Component)_this).transform.position, false, 0).position; ((EnemyAI)_this).SetDestinationToPosition(_this.nestPosition, false); } Debugger.Debug.LogMessage($"FOUDN ITEM! '{_this.targetItem}' setting nest position to player..."); NetworkObject component = ((Component)_this.targetItem).GetComponent(); ((EnemyAI)_this).SwitchToBehaviourStateOnLocalClient(1); AccessTools.Method(typeof(HoarderBugAI), "GrabItem", (Type[])null, (Type[])null).Invoke(_this, new object[1] { component }); Traverse.Create((object)_this).Field("sendingGrabOrDropRPC").SetValue((object)true); _this.GrabItemServerRpc(NetworkObjectReference.op_Implicit(component)); return true; } return false; } private static bool IsHoarderBugAngry(HoarderBugAI _this) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Invalid comparison between Unknown and I4 //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Invalid comparison between Unknown and I4 if (((EnemyAI)_this).stunNormalizedTimer > 0f) { _this.angryTimer = 4f; if (Object.op_Implicit((Object)(object)((EnemyAI)_this).stunnedByPlayer)) { _this.angryAtPlayer = ((EnemyAI)_this).stunnedByPlayer; } return true; } int num = 0; int num2 = 0; for (int i = 0; i < HoarderBugAI.HoarderBugItems.Count; i++) { if ((int)HoarderBugAI.HoarderBugItems[i].status == 1) { num2++; } else if ((int)HoarderBugAI.HoarderBugItems[i].status == 2) { num++; } } if (_this.angryTimer > 0f || num2 > 0) { } return _this.angryTimer > 0f || num2 > 0; } [HarmonyPatch("IsHoarderBugAngry")] [HarmonyPrefix] private static bool IsHoarderBugAngryPatch(ref HoarderBugAI __instance, ref bool __result) { __result = IsHoarderBugAngry(__instance); return false; } [HarmonyPatch("DoAIInterval")] [HarmonyPrefix] private static bool DoAIIntervalPatch(ref HoarderBugAI __instance) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_06a4: Unknown result type (might be due to invalid IL or missing references) //IL_06b0: Unknown result type (might be due to invalid IL or missing references) //IL_04af: Unknown result type (might be due to invalid IL or missing references) //IL_04bf: Unknown result type (might be due to invalid IL or missing references) //IL_06d2: Unknown result type (might be due to invalid IL or missing references) //IL_06e2: Unknown result type (might be due to invalid IL or missing references) //IL_0859: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_0742: Unknown result type (might be due to invalid IL or missing references) //IL_0747: Unknown result type (might be due to invalid IL or missing references) //IL_0750: Unknown result type (might be due to invalid IL or missing references) //IL_0770: Unknown result type (might be due to invalid IL or missing references) //IL_077c: Unknown result type (might be due to invalid IL or missing references) //IL_0781: Unknown result type (might be due to invalid IL or missing references) //IL_078a: Unknown result type (might be due to invalid IL or missing references) //IL_058f: Unknown result type (might be due to invalid IL or missing references) //IL_059b: Unknown result type (might be due to invalid IL or missing references) if (Config.abilitiesEnabled.Value) { NetworkObject networkObject = ((NetworkBehaviour)__instance).NetworkObject; SpawnAbilityInfo spawnAbilityInfo = ((networkObject != null) ? ((Component)networkObject).gameObject.GetComponent() : null); Traverse val = Traverse.Create((object)__instance); if (Object.op_Implicit((Object)(object)spawnAbilityInfo)) { if (((EnemyAI)__instance).moveTowardsDestination) { ((EnemyAI)__instance).agent.SetDestination(((EnemyAI)__instance).destination); } ((EnemyAI)__instance).SyncPositionToClients(); if (((EnemyAI)__instance).isEnemyDead || StartOfRound.Instance.allPlayersDead) { return false; } if (!(bool)AccessTools.Field(typeof(HoarderBugAI), "choseNestPosition").GetValue(__instance)) { AccessTools.Field(typeof(HoarderBugAI), "choseNestPosition").SetValue(__instance, true); AccessTools.Method(typeof(HoarderBugAI), "ChooseNestPosition", (Type[])null, (Type[])null).Invoke(__instance, Array.Empty()); return false; } if (((EnemyAI)__instance).CheckLineOfSightForPosition(__instance.nestPosition, 60f, 40, 0.5f, (Transform)null)) { for (int i = 0; i < HoarderBugAI.HoarderBugItems.Count; i++) { if (HoarderBugAI.HoarderBugItems[i].itemGrabbableObject.isHeld && HoarderBugAI.HoarderBugItems[i].itemNestPosition == __instance.nestPosition) { HoarderBugAI.HoarderBugItems[i].status = (HoarderBugItemStatus)1; } } } HoarderBugItem val2 = __instance.CheckLineOfSightForItem((HoarderBugItemStatus)1, 60f, 30, 3f); if (val2 != null && !val2.itemGrabbableObject.isHeld) { val2.status = (HoarderBugItemStatus)2; if (!HoarderBugAI.grabbableObjectsInMap.Contains(((Component)val2.itemGrabbableObject).gameObject)) { HoarderBugAI.grabbableObjectsInMap.Add(((Component)val2.itemGrabbableObject).gameObject); } } switch (((EnemyAI)__instance).currentBehaviourStateIndex) { case 0: { val.Field("inReturnToNestMode").SetValue((object)false); AccessTools.Method(typeof(HoarderBugAI), "ExitChaseMode", (Type[])null, (Type[])null).Invoke(__instance, null); if (GrabTargetItemIfClose(__instance, spawnAbilityInfo)) { break; } if ((Object)(object)__instance.targetItem == (Object)null && !__instance.searchForItems.inProgress) { ((EnemyAI)__instance).StartSearch(__instance.nestPosition, __instance.searchForItems); return false; } if ((Object)(object)__instance.targetItem != (Object)null) { Debugger.Debug.Log($"Found target item! {((Component)__instance.targetItem).gameObject}"); AccessTools.Method(typeof(HoarderBugAI), "SetGoTowardsTargetObject", (Type[])null, (Type[])null).Invoke(__instance, new object[1] { ((Component)__instance.targetItem).gameObject }); return false; } GameObject val4 = ((EnemyAI)__instance).CheckLineOfSight(HoarderBugAI.grabbableObjectsInMap, 60f, 40, 5f, (Transform)null, (int[])null); if (Object.op_Implicit((Object)(object)val4)) { GrabbableObject component = val4.GetComponent(); if (Object.op_Implicit((Object)(object)component) && (!component.isHeld || (Random.Range(0, 100) < 4 && !component.isPocketed))) { Debugger.Debug.Log($"Found target item! {val4}"); AccessTools.Method(typeof(HoarderBugAI), "SetGoTowardsTargetObject", (Type[])null, (Type[])null).Invoke(__instance, new object[1] { val4 }); return false; } } break; } case 1: AccessTools.Method(typeof(HoarderBugAI), "ExitChaseMode", (Type[])null, (Type[])null).Invoke(__instance, null); if (!(bool)val.Field("inReturnToNestMode").GetValue()) { val.Field("inReturnToNestMode").SetValue((object)true); AccessTools.Method(typeof(HoarderBugAI), "SetReturningToNest", (Type[])null, (Type[])null).Invoke(__instance, null); Debugger.Debug.Log(((Object)((Component)__instance).gameObject).name + ": Abandoned current search and returning to nest empty-handed"); } GrabTargetItemIfClose(__instance, spawnAbilityInfo); if ((bool)val.Field("waitingAtNest").GetValue()) { if (Vector3.Distance(((Component)__instance).transform.position, ((Component)spawnAbilityInfo.creatorPlayer).transform.position) > 2.2f) { Debugger.Debug.LogMessage("Master running away!"); val.Field("waitingAtNest").SetValue((object)false); ((EnemyAI)__instance).SwitchToBehaviourState(0); return false; } if (__instance.heldItem != null) { AccessTools.Method(typeof(HoarderBugAI), "DropItemAndCallDropRPC", (Type[])null, (Type[])null).Invoke(__instance, new object[2] { ((Component)__instance.heldItem.itemGrabbableObject).GetComponent(), true }); } else { GameObject val3 = ((EnemyAI)__instance).CheckLineOfSight(HoarderBugAI.grabbableObjectsInMap, 60f, 40, 5f, (Transform)null, (int[])null); if (Object.op_Implicit((Object)(object)val3) && Vector3.Distance(((EnemyAI)__instance).eye.position, val3.transform.position) < 6f) { __instance.targetItem = val3.GetComponent(); if ((Object)(object)__instance.targetItem != (Object)null && !__instance.targetItem.isHeld) { val.Field("waitingAtNest").SetValue((object)false); ((EnemyAI)__instance).SwitchToBehaviourState(0); return false; } } } if ((float)val.Field("waitingAtNestTimer").GetValue() <= 0f) { if (!__instance.watchingPlayerNearPosition || (Object)(object)__instance.watchingPlayer == (Object)(object)spawnAbilityInfo.creatorPlayer) { Debugger.Debug.Log("Gave item! Will return to search"); val.Field("waitingAtNest").SetValue((object)false); ((EnemyAI)__instance).SwitchToBehaviourStateOnLocalClient(0); } return false; } return false; } if (Vector3.Distance(((Component)__instance).transform.position, ((EnemyAI)__instance).agent.destination) < 1.25f) { if (Vector3.Distance(((Component)__instance).transform.position, ((Component)spawnAbilityInfo.creatorPlayer).transform.position) < 1.25f) { val.Field("waitingAtNest").SetValue((object)true); val.Field("waitingAtNestTimer").SetValue((object)5f); return false; } __instance.nestPosition = ((Component)spawnAbilityInfo.creatorPlayer).transform.position; if (!((EnemyAI)__instance).SetDestinationToPosition(__instance.nestPosition, true)) { __instance.nestPosition = ((EnemyAI)__instance).ChooseClosestNodeToPosition(((Component)__instance).transform.position, false, 0).position; ((EnemyAI)__instance).SetDestinationToPosition(__instance.nestPosition, false); } } break; case 2: val.Field("inReturnToNestMode").SetValue((object)false); if (__instance.heldItem != null) { AccessTools.Method(typeof(HoarderBugAI), "DropItemAndCallDropRPC", (Type[])null, (Type[])null).Invoke(__instance, new object[2] { ((Component)__instance.heldItem.itemGrabbableObject).GetComponent(), false }); } if ((bool)val.Field("lostPlayerInChase").GetValue()) { if (!__instance.searchForPlayer.inProgress) { __instance.searchForPlayer.searchWidth = 30f; ((EnemyAI)__instance).StartSearch(((Component)((EnemyAI)__instance).targetPlayer).transform.position, __instance.searchForPlayer); Debugger.Debug.Log(((Object)((Component)__instance).gameObject).name + ": Lost player in chase; beginning search where the player was last seen"); return false; } break; } if ((Object)(object)((EnemyAI)__instance).targetPlayer == (Object)null) { Debugger.Debug.LogError("TargetPlayer is null even though bug is in chase; setting targetPlayer to watchingPlayer"); if ((Object)(object)__instance.watchingPlayer != (Object)null) { ((EnemyAI)__instance).targetPlayer = __instance.watchingPlayer; } } if (__instance.searchForPlayer.inProgress) { ((EnemyAI)__instance).StopSearch(__instance.searchForPlayer, true); Debugger.Debug.Log(((Object)((Component)__instance).gameObject).name + ": Found player during chase; stopping search coroutine and moving after target player"); } ((EnemyAI)__instance).movingTowardsTargetPlayer = true; break; default: return false; case 3: break; } return false; } } return true; } [HarmonyPatch("DetectAndLookAtPlayers")] [HarmonyPrefix] private static bool DetectAndLookAtPlayersPatch(ref HoarderBugAI __instance) { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //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_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_0270: 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_04f5: Unknown result type (might be due to invalid IL or missing references) //IL_0503: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04ac: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_0430: Unknown result type (might be due to invalid IL or missing references) if (!Config.abilitiesEnabled.Value) { return true; } NetworkObject networkObject = ((NetworkBehaviour)__instance).NetworkObject; SpawnAbilityInfo spawnAbilityInfo = ((networkObject != null) ? ((Component)networkObject).gameObject.GetComponent() : null); Traverse val = Traverse.Create((object)__instance); if (!Object.op_Implicit((Object)(object)spawnAbilityInfo)) { return true; } Vector3 val2 = ((((EnemyAI)__instance).currentBehaviourStateIndex != 1) ? ((Component)__instance).transform.position : __instance.nestPosition); PlayerControllerB[] allPlayersInLineOfSight = ((EnemyAI)__instance).GetAllPlayersInLineOfSight(70f, 30, ((EnemyAI)__instance).eye, 1.2f, -1); if (allPlayersInLineOfSight != null) { PlayerControllerB watchingPlayer = __instance.watchingPlayer; Traverse.Create((object)__instance).Field("timeSinceSeeingAPlayer").SetValue((object)0f); float num = 500f; bool flag = false; if ((Object)(object)((EnemyAI)__instance).stunnedByPlayer != (Object)null && (Object)(object)((EnemyAI)__instance).stunnedByPlayer != (Object)(object)spawnAbilityInfo.creatorPlayer) { flag = true; __instance.angryAtPlayer = ((EnemyAI)__instance).stunnedByPlayer; } for (int i = 0; i < allPlayersInLineOfSight.Length; i++) { bool flag2 = spawnAbilityInfo.otherFriendlies.Contains(allPlayersInLineOfSight[i]) || (Object)(object)spawnAbilityInfo.creatorPlayer == (Object)(object)allPlayersInLineOfSight[i]; if (!flag && (Object)(object)allPlayersInLineOfSight[i].currentlyHeldObjectServer != (Object)null) { HoarderBugItem[] array = HoarderBugAI.HoarderBugItems.ToArray(); foreach (HoarderBugItem val3 in array) { if ((Object)(object)val3.itemGrabbableObject == (Object)(object)allPlayersInLineOfSight[i].currentlyHeldObjectServer) { if (!flag2) { Debugger.Debug.LogWarning("Bug angy because you stol his stuff!"); val3.status = (HoarderBugItemStatus)1; __instance.angryAtPlayer = allPlayersInLineOfSight[i]; flag = true; } else { ((EnemyAI)__instance).SwitchToBehaviourState(0); HoarderBugAI.HoarderBugItems.Remove(val3); } } } } if (IsHoarderBugAngry(__instance) && (Object)(object)allPlayersInLineOfSight[i] == (Object)(object)__instance.angryAtPlayer) { __instance.watchingPlayer = __instance.angryAtPlayer; } else { float num2 = Vector3.Distance(((Component)allPlayersInLineOfSight[i]).transform.position, val2); if (num2 < num) { num = num2; __instance.watchingPlayer = allPlayersInLineOfSight[i]; } } float num3 = Vector3.Distance(((Component)allPlayersInLineOfSight[i]).transform.position, __instance.nestPosition); if (HoarderBugAI.HoarderBugItems.Count > 0) { if ((num3 < 4f || ((bool)Traverse.Create((object)__instance).Field("inChase").GetValue() && num3 < 8f)) && __instance.angryTimer < 3.25f) { if (!flag2) { Debugger.Debug.LogWarning("Bug angy because you close to nest!"); __instance.angryAtPlayer = allPlayersInLineOfSight[i]; __instance.watchingPlayer = allPlayersInLineOfSight[i]; __instance.angryTimer = 3.25f; break; } if (Vector3.Distance(((Component)__instance).transform.position, ((Component)spawnAbilityInfo.creatorPlayer).transform.position) <= 1.25f && __instance.heldItem != null) { AccessTools.Method(typeof(HoarderBugAI), "DropItemAndCallDropRPC", (Type[])null, (Type[])null).Invoke(__instance, new object[2] { ((Component)__instance.heldItem.itemGrabbableObject).GetComponent(), true }); val.Field("waitingAtNest").SetValue((object)true); val.Field("waitingAtNestTimer").SetValue((object)5f); } float num4 = Vector3.Distance(((Component)HoarderBugAI.HoarderBugItems[0].itemGrabbableObject).transform.position, ((Component)spawnAbilityInfo.creatorPlayer).transform.position); if (__instance.heldItem == null && num4 > 5f) { ((EnemyAI)__instance).SetDestinationToPosition(((Component)HoarderBugAI.HoarderBugItems[0].itemGrabbableObject).transform.position, false); __instance.targetItem = HoarderBugAI.HoarderBugItems[0].itemGrabbableObject; } } if (!(bool)Traverse.Create((object)__instance).Field("isAngry").GetValue() && ((EnemyAI)__instance).currentBehaviourStateIndex == 0 && num3 < 8f && ((Object)(object)__instance.targetItem == (Object)null || Vector3.Distance(((Component)__instance.targetItem).transform.position, ((Component)__instance).transform.position) > 7.5f) && ((NetworkBehaviour)__instance).IsOwner) { Debugger.Debug.Log("Switching state to 1, Guarding Items!"); ((EnemyAI)__instance).SwitchToBehaviourState(1); } } if (((EnemyAI)__instance).currentBehaviourStateIndex != 2 && Vector3.Distance(((Component)__instance).transform.position, ((Component)allPlayersInLineOfSight[i]).transform.position) < 2.5f && !flag2) { Debugger.Debug.LogWarning("Bug angy because you touch him!"); float num5 = (float)Traverse.Create((object)__instance).Field("annoyanceMeter").GetValue(); num5 += 0.2f; if (num5 > 2.5f) { __instance.angryAtPlayer = allPlayersInLineOfSight[i]; __instance.watchingPlayer = allPlayersInLineOfSight[i]; __instance.angryTimer = 3.25f; } Traverse.Create((object)__instance).Field("annoyanceMeter").SetValue((object)num5); } } __instance.watchingPlayerNearPosition = num < 6f; if ((Object)(object)__instance.watchingPlayer != (Object)(object)watchingPlayer) { RoundManager.PlayRandomClip(((EnemyAI)__instance).creatureVoice, __instance.chitterSFX, true, 1f, 0, 1000); } if (!((NetworkBehaviour)__instance).IsOwner) { return false; } bool flag3 = (bool)Traverse.Create((object)__instance).Field("lostPlayerInChase").GetValue(); if (((EnemyAI)__instance).currentBehaviourStateIndex != 2) { if (IsHoarderBugAngry(__instance)) { flag3 = false; ((EnemyAI)__instance).targetPlayer = __instance.watchingPlayer; ((EnemyAI)__instance).SwitchToBehaviourState(2); return false; } } else { ((EnemyAI)__instance).targetPlayer = __instance.watchingPlayer; if (flag3) { flag3 = false; return false; } } Traverse.Create((object)__instance).Field("lostPlayerInChase").SetValue((object)flag3); } else { float num6 = (float)Traverse.Create((object)__instance).Field("timeSinceSeeingAPlayer").GetValue(); num6 += 0.2f; Traverse.Create((object)__instance).Field("timeSinceSeeingAPlayer").SetValue((object)num6); __instance.watchingPlayerNearPosition = false; if (((EnemyAI)__instance).currentBehaviourStateIndex != 2) { if (num6 > 1.5f) { __instance.watchingPlayer = null; return false; } } else { if (num6 > 1.25f) { __instance.watchingPlayer = null; } if (!((NetworkBehaviour)__instance).IsOwner) { return false; } if (num6 > 15f) { ((EnemyAI)__instance).SwitchToBehaviourState(1); return false; } if (num6 > 2.5f) { Traverse.Create((object)__instance).Field("lostPlayerInChase").SetValue((object)true); } } } return false; } [HarmonyPatch("OnCollideWithPlayer")] [HarmonyPrefix] private static bool OnCollideWithPlayerPatch(ref HoarderBugAI __instance, Collider other) { if (!Config.abilitiesEnabled.Value) { return true; } NetworkObject networkObject = ((NetworkBehaviour)__instance).NetworkObject; SpawnAbilityInfo spawnAbilityInfo = ((networkObject != null) ? ((Component)networkObject).gameObject.GetComponent() : null); Traverse val = Traverse.Create((object)__instance); if (!Object.op_Implicit((Object)(object)spawnAbilityInfo)) { return true; } PlayerControllerB val2 = ((EnemyAI)__instance).MeetsStandardPlayerCollisionConditions(other, false, false); if ((Object)(object)spawnAbilityInfo.creatorPlayer == (Object)(object)val2 || spawnAbilityInfo.otherFriendlies.Contains(val2)) { return false; } return true; } } [HarmonyPatch(typeof(CrawlerAI))] public class CrawlerAIPatch { [HarmonyPatch("Update")] [HarmonyPrefix] private static bool UpdatePatch(ref CrawlerAI __instance) { //IL_00eb: 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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_044d: Unknown result type (might be due to invalid IL or missing references) if (!Config.abilitiesEnabled.Value) { return true; } NetworkObject networkObject = ((NetworkBehaviour)__instance).NetworkObject; SpawnAbilityInfo spawnAbilityInfo = ((networkObject != null) ? ((Component)networkObject).gameObject.GetComponent() : null); Traverse val = Traverse.Create((object)__instance); if (!Object.op_Implicit((Object)(object)spawnAbilityInfo)) { return true; } EnemyAIPatch.UpdatePatch((EnemyAI)(object)__instance); if (((EnemyAI)__instance).isEnemyDead) { return false; } if (!((NetworkBehaviour)__instance).IsOwner) { ((EnemyAI)__instance).inSpecialAnimation = false; } AccessTools.Method(typeof(CrawlerAI), "CalculateAgentSpeed", (Type[])null, (Type[])null).Invoke(__instance, null); val.Field("timeSinceHittingPlayer").SetValue((object)((float)val.Field("timeSinceHittingPlayer").GetValue() + Time.deltaTime)); if (GameNetworkManager.Instance.localPlayerController.HasLineOfSightToPosition(((Component)__instance).transform.position + Vector3.up * 0.25f, 80f, 25, 5f, -1) && !((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)spawnAbilityInfo.creatorPlayer) && !spawnAbilityInfo.otherFriendlies.Contains(GameNetworkManager.Instance.localPlayerController)) { if (((EnemyAI)__instance).currentBehaviourStateIndex == 1) { GameNetworkManager.Instance.localPlayerController.IncreaseFearLevelOverTime(0.8f, 1f); } else { GameNetworkManager.Instance.localPlayerController.IncreaseFearLevelOverTime(0.8f, 0.5f); } } switch (((EnemyAI)__instance).currentBehaviourStateIndex) { default: return false; case 1: { if (!(bool)val.Field("hasEnteredChaseMode").GetValue()) { val.Field("hasEnteredChaseMode").SetValue((object)true); val.Field("lostPlayerInChase").SetValue((object)false); val.Field("checkLineOfSightInterval").SetValue((object)0f); __instance.noticePlayerTimer = 0f; val.Field("beginningChasingThisClient").SetValue((object)false); ((EnemyAI)__instance).useSecondaryAudiosOnAnimatedObjects = true; ((EnemyAI)__instance).openDoorSpeedMultiplier = 1.5f; ((EnemyAI)__instance).agent.stoppingDistance = 0.5f; ((EnemyAI)__instance).agent.speed = 0f; } if (!((NetworkBehaviour)__instance).IsOwner) { return false; } if (((EnemyAI)__instance).stunNormalizedTimer > 0f) { return false; } float num2 = (float)val.Field("checkLineOfSightInterval").GetValue(); if (num2 <= 0.075f) { num2 += Time.deltaTime; val.Field("checkLineOfSightInterval").SetValue((object)num2); return false; } num2 = 0f; val.Field("checkLineOfSightInterval").SetValue((object)num2); bool flag2 = (bool)val.Field("lostPlayerInChase").GetValue(); if (flag2) { PlayerControllerB val3 = ((EnemyAI)__instance).CheckLineOfSightForPlayer(55f, 60, -1); if (Object.op_Implicit((Object)(object)val3)) { __instance.noticePlayerTimer = 0f; flag2 = false; __instance.MakeScreechNoiseServerRpc(); if ((Object)(object)val3 != (Object)(object)((EnemyAI)__instance).targetPlayer) { ((EnemyAI)__instance).SetMovingTowardsTargetPlayer(val3); ((EnemyAI)__instance).ChangeOwnershipOfEnemy(val3.actualClientId); return false; } } else { CrawlerAI obj2 = __instance; obj2.noticePlayerTimer -= 0.075f; if (__instance.noticePlayerTimer < -15f) { ((EnemyAI)__instance).SwitchToBehaviourState(0); return false; } } } else { PlayerControllerB val4 = ((EnemyAI)__instance).CheckLineOfSightForPlayer(65f, 80, -1); if ((Object)(object)val4 != (Object)null) { __instance.noticePlayerTimer = 0f; val.Field("lastPositionOfSeenPlayer").SetValue((object)((Component)val4).transform.position); if ((Object)(object)val4 != (Object)(object)((EnemyAI)__instance).targetPlayer) { ((EnemyAI)__instance).targetPlayer = val4; ((EnemyAI)__instance).ChangeOwnershipOfEnemy(((EnemyAI)__instance).targetPlayer.actualClientId); return false; } } else { CrawlerAI obj3 = __instance; obj3.noticePlayerTimer += 0.075f; if (__instance.noticePlayerTimer > 1.8f) { flag2 = true; } } } val.Field("lostPlayerInChase").SetValue((object)flag2); break; } case 0: { if ((bool)val.Field("hasEnteredChaseMode").GetValue()) { val.Field("hasEnteredChaseMode").SetValue((object)false); __instance.searchForPlayers.searchWidth = 25f; val.Field("beginningChasingThisClient").SetValue((object)false); __instance.noticePlayerTimer = 0f; ((EnemyAI)__instance).useSecondaryAudiosOnAnimatedObjects = false; ((EnemyAI)__instance).openDoorSpeedMultiplier = 0.6f; ((EnemyAI)__instance).agent.stoppingDistance = 0f; ((EnemyAI)__instance).agent.speed = 7f; } float num = (float)val.Field("checkLineOfSightInterval").GetValue(); if (num <= 0.05f) { num += Time.deltaTime; val.Field("checkLineOfSightInterval").SetValue((object)num); return false; } num = 0f; val.Field("checkLineOfSightInterval").SetValue((object)num); PlayerControllerB val2; if ((Object)(object)((EnemyAI)__instance).stunnedByPlayer != (Object)null) { val2 = ((EnemyAI)__instance).stunnedByPlayer; __instance.noticePlayerTimer = 1f; } else { val2 = ((EnemyAI)__instance).CheckLineOfSightForPlayer(55f, 60, -1); } if ((Object)(object)val2 == (Object)(object)spawnAbilityInfo.creatorPlayer || spawnAbilityInfo.otherFriendlies.Contains(val2)) { Debugger.Debug.Log("Crawler: Found Friendly, Canceled Chasing!"); val2 = null; } if (!((Object)(object)val2 == (Object)(object)GameNetworkManager.Instance.localPlayerController)) { CrawlerAI obj = __instance; obj.noticePlayerTimer -= Time.deltaTime; return false; } __instance.noticePlayerTimer = Mathf.Clamp(__instance.noticePlayerTimer + 0.05f, 0f, 10f); bool flag = (bool)val.Field("beginningChasingThisClient").GetValue(); if (__instance.noticePlayerTimer > 0.2f && !flag) { flag = true; __instance.BeginChasingPlayerServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId); ((EnemyAI)__instance).ChangeOwnershipOfEnemy(val2.actualClientId); Debugger.Debug.Log("Begin chasing on local client"); return false; } val.Field("beginningChasingThisClient").SetValue((object)flag); break; } } return false; } [HarmonyPatch("OnCollideWithPlayer")] [HarmonyPrefix] private static bool OnCollideWithPlayerPatch(ref CrawlerAI __instance, Collider other) { if (!Config.abilitiesEnabled.Value) { return true; } NetworkObject networkObject = ((NetworkBehaviour)__instance).NetworkObject; SpawnAbilityInfo spawnAbilityInfo = ((networkObject != null) ? ((Component)networkObject).gameObject.GetComponent() : null); if (!Object.op_Implicit((Object)(object)spawnAbilityInfo)) { return true; } PlayerControllerB val = ((EnemyAI)__instance).MeetsStandardPlayerCollisionConditions(other, false, false); if ((Object)(object)spawnAbilityInfo.creatorPlayer == (Object)(object)val || spawnAbilityInfo.otherFriendlies.Contains(val)) { return false; } return true; } } [HarmonyPatch(typeof(FlowermanAI))] public class FlowermanAIPatch { private static bool PathIsIntersectedByLineOfSight(EnemyAI _this, Vector3 targetPos, bool calculatePathDistance = false, bool avoidLineOfSight = true) { //IL_001f: 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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: 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_013e: Unknown result type (might be due to invalid IL or missing references) _this.pathDistance = 0f; if (_this.agent.isOnNavMesh && !_this.agent.CalculatePath(targetPos, _this.path1)) { return true; } if (_this.path1 == null || _this.path1.corners.Length == 0) { return true; } if (Vector3.Distance(_this.path1.corners[_this.path1.corners.Length - 1], RoundManager.Instance.GetNavMeshPosition(targetPos, RoundManager.Instance.navHit, 2.7f, -1)) > 1.5f) { if (_this.DebugEnemy) { Debugger.Debug.Log("Path is not complete; final waypoint of path was too far from target position"); } return true; } if (calculatePathDistance) { for (int i = 1; i < _this.path1.corners.Length; i++) { _this.pathDistance += Vector3.Distance(_this.path1.corners[i - 1], _this.path1.corners[i]); if (avoidLineOfSight && Physics.Linecast(_this.path1.corners[i - 1], _this.path1.corners[i], 262144)) { return true; } } } else if (avoidLineOfSight) { for (int j = 1; j < _this.path1.corners.Length; j++) { Debug.DrawLine(_this.path1.corners[j - 1], _this.path1.corners[j], Color.green); if (Physics.Linecast(_this.path1.corners[j - 1], _this.path1.corners[j], 262144)) { return true; } } } return false; } private static bool TargetClosestPlayer(FlowermanAI _this, float bufferDistance = 1.5f, bool requireLineOfSight = false, float viewWidth = 70f) { //IL_005f: 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_00f8: 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_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) SpawnAbilityInfo component = ((Component)((NetworkBehaviour)_this).NetworkObject).gameObject.GetComponent(); ((EnemyAI)_this).mostOptimalDistance = 2000f; PlayerControllerB targetPlayer = ((EnemyAI)_this).targetPlayer; ((EnemyAI)_this).targetPlayer = null; for (int i = 0; i < StartOfRound.Instance.connectedPlayersAmount + 1; i++) { if (((EnemyAI)_this).PlayerIsTargetable(StartOfRound.Instance.allPlayerScripts[i], false, false, true) && !((EnemyAI)_this).PathIsIntersectedByLineOfSight(((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position, false, false, false) && (!requireLineOfSight || ((EnemyAI)_this).CheckLineOfSightForPosition(((Component)StartOfRound.Instance.allPlayerScripts[i].gameplayCamera).transform.position, viewWidth, 40, -1f, (Transform)null)) && !((Object)(object)StartOfRound.Instance.allPlayerScripts[i] == (Object)(object)component.creatorPlayer) && !component.otherFriendlies.Contains(StartOfRound.Instance.allPlayerScripts[i])) { ((EnemyAI)_this).tempDist = Vector3.Distance(((Component)_this).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position); if (((EnemyAI)_this).tempDist < ((EnemyAI)_this).mostOptimalDistance) { ((EnemyAI)_this).mostOptimalDistance = ((EnemyAI)_this).tempDist; ((EnemyAI)_this).targetPlayer = StartOfRound.Instance.allPlayerScripts[i]; } } } if ((Object)(object)((EnemyAI)_this).targetPlayer != (Object)null && bufferDistance > 0f && (Object)(object)targetPlayer != (Object)null && Mathf.Abs(((EnemyAI)_this).mostOptimalDistance - Vector3.Distance(((Component)_this).transform.position, ((Component)targetPlayer).transform.position)) < bufferDistance) { ((EnemyAI)_this).targetPlayer = targetPlayer; } return (Object)(object)((EnemyAI)_this).targetPlayer != (Object)null; } [HarmonyPatch("DoAIInterval")] [HarmonyPrefix] private static bool DoAIIntervalPatch(ref FlowermanAI __instance) { //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) if (!Config.abilitiesEnabled.Value) { return true; } NetworkObject networkObject = ((NetworkBehaviour)__instance).NetworkObject; SpawnAbilityInfo spawnAbilityInfo = ((networkObject != null) ? ((Component)networkObject).gameObject.GetComponent() : null); Traverse val = Traverse.Create((object)__instance); if (!Object.op_Implicit((Object)(object)spawnAbilityInfo)) { return true; } if (StartOfRound.Instance.livingPlayers == 0) { if (((EnemyAI)__instance).moveTowardsDestination) { ((EnemyAI)__instance).agent.SetDestination(((EnemyAI)__instance).destination); } ((EnemyAI)__instance).SyncPositionToClients(); return false; } if (TargetClosestPlayer(__instance)) { if (((EnemyAI)__instance).currentBehaviourStateIndex == 2) { ((EnemyAI)__instance).SetMovingTowardsTargetPlayer(((EnemyAI)__instance).targetPlayer); if (!__instance.inKillAnimation && (Object)(object)((EnemyAI)__instance).targetPlayer != (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((EnemyAI)__instance).ChangeOwnershipOfEnemy(((EnemyAI)__instance).targetPlayer.actualClientId); } ((EnemyAI)__instance).DoAIInterval(); return false; } if (((EnemyAI)__instance).currentBehaviourStateIndex == 1) { if ((Object)(object)((EnemyAI)__instance).favoriteSpot != (Object)null && __instance.carryingPlayerBody) { if (((EnemyAI)__instance).mostOptimalDistance < 5f || PathIsIntersectedByLineOfSight((EnemyAI)(object)__instance, ((EnemyAI)__instance).favoriteSpot.position)) { __instance.AvoidClosestPlayer(); } else { ((EnemyAI)__instance).targetNode = ((EnemyAI)__instance).favoriteSpot; float num = (float)val.Field("getPathToFavoriteNodeInterval").GetValue(); if (Time.realtimeSinceStartup - num > 1f) { ((EnemyAI)__instance).SetDestinationToPosition(((EnemyAI)__instance).favoriteSpot.position, true); num = Time.realtimeSinceStartup; } val.Field("getPathToFavoriteNodeInterval").SetValue((object)num); } } else { __instance.AvoidClosestPlayer(); } } else { __instance.ChooseClosestNodeToPlayer(); } } else { if (((EnemyAI)__instance).currentBehaviourStateIndex == 2) { ((EnemyAI)__instance).SetDestinationToPosition((Vector3)val.Field("waitAroundEntrancePosition").GetValue(), false); return false; } Transform val2 = ((EnemyAI)__instance).ChooseFarthestNodeFromPosition((Vector3)val.Field("mainEntrancePosition").GetValue(), false, 0, false, 50, -1); if ((Object)(object)((EnemyAI)__instance).favoriteSpot == (Object)null) { ((EnemyAI)__instance).favoriteSpot = val2; } ((EnemyAI)__instance).targetNode = val2; ((EnemyAI)__instance).SetDestinationToPosition(val2.position, true); } if (((EnemyAI)__instance).moveTowardsDestination) { ((EnemyAI)__instance).agent.SetDestination(((EnemyAI)__instance).destination); } ((EnemyAI)__instance).SyncPositionToClients(); return false; } [HarmonyPatch("Update")] [HarmonyPrefix] private static bool Update(ref FlowermanAI __instance) { //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_08f0: 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_0183: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_093e: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0af6: Unknown result type (might be due to invalid IL or missing references) //IL_0afb: Unknown result type (might be due to invalid IL or missing references) //IL_045e: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_0b86: Unknown result type (might be due to invalid IL or missing references) //IL_0b1e: Unknown result type (might be due to invalid IL or missing references) //IL_0bde: Unknown result type (might be due to invalid IL or missing references) //IL_07da: Unknown result type (might be due to invalid IL or missing references) //IL_07df: Unknown result type (might be due to invalid IL or missing references) //IL_07f4: Unknown result type (might be due to invalid IL or missing references) //IL_07f9: Unknown result type (might be due to invalid IL or missing references) //IL_07fb: Unknown result type (might be due to invalid IL or missing references) //IL_0805: Unknown result type (might be due to invalid IL or missing references) //IL_080a: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0831: Unknown result type (might be due to invalid IL or missing references) //IL_083e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_055f: Unknown result type (might be due to invalid IL or missing references) if (!Config.abilitiesEnabled.Value) { return true; } NetworkObject networkObject = ((NetworkBehaviour)__instance).NetworkObject; SpawnAbilityInfo spawnAbilityInfo = ((networkObject != null) ? ((Component)networkObject).gameObject.GetComponent() : null); Traverse val = Traverse.Create((object)__instance); if (!Object.op_Implicit((Object)(object)spawnAbilityInfo)) { return true; } EnemyAIPatch.UpdatePatch((EnemyAI)(object)__instance); if (((EnemyAI)__instance).isEnemyDead) { return false; } if (__instance.inKillAnimation) { return false; } if ((Object)(object)GameNetworkManager.Instance == (Object)null) { return false; } if (GameNetworkManager.Instance.localPlayerController.HasLineOfSightToPosition(((Component)__instance).transform.position + Vector3.up * 0.5f, 30f, 60, -1f, -1) && !((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)spawnAbilityInfo.creatorPlayer) && !spawnAbilityInfo.otherFriendlies.Contains(GameNetworkManager.Instance.localPlayerController)) { if (((EnemyAI)__instance).currentBehaviourStateIndex == 0) { ((EnemyAI)__instance).SwitchToBehaviourState(1); if (!((EnemyAI)__instance).thisNetworkObject.IsOwner) { ((EnemyAI)__instance).ChangeOwnershipOfEnemy(GameNetworkManager.Instance.localPlayerController.actualClientId); } if (Vector3.Distance(((Component)__instance).transform.position, ((Component)GameNetworkManager.Instance.localPlayerController).transform.position) < 5f) { GameNetworkManager.Instance.localPlayerController.JumpToFearLevel(0.6f, true); } else { GameNetworkManager.Instance.localPlayerController.JumpToFearLevel(0.3f, true); } ((EnemyAI)__instance).agent.speed = 0f; __instance.evadeStealthTimer = 0f; } else if (__instance.evadeStealthTimer > 0.5f) { int num = (int)GameNetworkManager.Instance.localPlayerController.playerClientId; __instance.LookAtFlowermanTrigger(num); __instance.ResetFlowermanStealthTimerServerRpc(num); } } Vector3 val3; switch (((EnemyAI)__instance).currentBehaviourStateIndex) { case 0: { if (__instance.isInAngerMode) { __instance.isInAngerMode = false; ((EnemyAI)__instance).creatureAnimator.SetBool("anger", false); } if ((bool)val.Field("wasInEvadeMode").GetValue()) { val.Field("wasInEvadeMode").SetValue((object)false); __instance.evadeStealthTimer = 0f; if (__instance.carryingPlayerBody) { AccessTools.Method(typeof(FlowermanAI), "DropPlayerBody", (Type[])null, (Type[])null).Invoke(__instance, null); ((Behaviour)((EnemyAI)__instance).agent).enabled = true; ((EnemyAI)__instance).favoriteSpot = ((EnemyAI)__instance).ChooseClosestNodeToPosition(((Component)__instance).transform.position, true, 0); if (!((NetworkBehaviour)__instance).IsOwner) { ((Behaviour)((EnemyAI)__instance).agent).enabled = false; } Debugger.Debug.Log("Flowerman: Dropped player body"); } } Vector3 val4 = (Vector3)val.Field("previousPosition").GetValue(); Animator creatureAnimator2 = ((EnemyAI)__instance).creatureAnimator; val3 = Vector3.ClampMagnitude(((Component)__instance).transform.position - val4, 1f); creatureAnimator2.SetFloat("speedMultiplier", ((Vector3)(ref val3)).sqrMagnitude / (Time.deltaTime / 4f)); val4 = ((Component)__instance).transform.position; ((EnemyAI)__instance).agent.speed = 6f; val.Field("previousPosition").SetValue((object)val4); break; } case 1: { if (__instance.isInAngerMode) { __instance.isInAngerMode = false; ((EnemyAI)__instance).creatureAnimator.SetBool("anger", false); } if (!(bool)val.Field("wasInEvadeMode").GetValue()) { val.Field("wasInEvadeMode").SetValue((object)true); ((EnemyAI)__instance).movingTowardsTargetPlayer = false; if ((Object)(object)((EnemyAI)__instance).favoriteSpot != (Object)null && !__instance.carryingPlayerBody && Vector3.Distance(((Component)__instance).transform.position, ((EnemyAI)__instance).favoriteSpot.position) < 7f) { ((EnemyAI)__instance).favoriteSpot = null; } } if (((EnemyAI)__instance).stunNormalizedTimer > 0f) { ((EnemyAI)__instance).creatureAnimator.SetLayerWeight(2, 1f); } else { ((EnemyAI)__instance).creatureAnimator.SetLayerWeight(2, 0f); } FlowermanAI obj2 = __instance; obj2.evadeStealthTimer += Time.deltaTime; if (((EnemyAI)__instance).thisNetworkObject.IsOwner) { float num2 = (((int)val.Field("timesFoundSneaking").GetValue() % 3 != 0) ? 11f : 24f); if ((Object)(object)((EnemyAI)__instance).favoriteSpot != (Object)null && __instance.carryingPlayerBody) { num2 = ((!(Vector3.Distance(((Component)__instance).transform.position, ((EnemyAI)__instance).favoriteSpot.position) > 8f)) ? 3f : 24f); } if (__instance.evadeStealthTimer > num2) { __instance.evadeStealthTimer = 0f; ((EnemyAI)__instance).SwitchToBehaviourState(0); } if (!__instance.carryingPlayerBody && (bool)val.Field("evadeModeStareDown").GetValue() && __instance.evadeStealthTimer < 1.25f) { __instance.AddToAngerMeter(Time.deltaTime * 1.5f); ((EnemyAI)__instance).agent.speed = 0f; } else { val.Field("evadeModeStareDown").SetValue((object)false); if (((EnemyAI)__instance).stunNormalizedTimer > 0f) { AccessTools.Method(typeof(FlowermanAI), "DropPlayerBody", (Type[])null, (Type[])null).Invoke(__instance, null); __instance.AddToAngerMeter(0f); ((EnemyAI)__instance).agent.speed = 0f; } else { if ((bool)val.Field("stunnedByPlayerLastFrame").GetValue()) { val.Field("stunnedByPlayerLastFrame").SetValue((object)false); __instance.AddToAngerMeter(0f); } if (__instance.carryingPlayerBody) { ((EnemyAI)__instance).agent.speed = Mathf.Clamp(((EnemyAI)__instance).agent.speed + Time.deltaTime * 7.25f, 4f, 9f); } else { ((EnemyAI)__instance).agent.speed = Mathf.Clamp(((EnemyAI)__instance).agent.speed + Time.deltaTime * 4.25f, 0f, 6f); } } } if (!__instance.carryingPlayerBody && ((EnemyAI)__instance).ventAnimationFinished) { AccessTools.Method(typeof(FlowermanAI), "LookAtPlayerOfInterest", (Type[])null, (Type[])null).Invoke(__instance, null); } } if (!__instance.carryingPlayerBody) { AccessTools.Method(typeof(FlowermanAI), "CalculateAnimationDirection", (Type[])null, (Type[])null).Invoke(__instance, new object[1] { 1f }); break; } Vector3 val2 = (Vector3)val.Field("previousPosition").GetValue(); Animator creatureAnimator = ((EnemyAI)__instance).creatureAnimator; val3 = Vector3.ClampMagnitude(((Component)__instance).transform.position - val2, 1f); creatureAnimator.SetFloat("speedMultiplier", ((Vector3)(ref val3)).sqrMagnitude / (Time.deltaTime * 2f)); val2 = ((Component)__instance).transform.position; val.Field("previousPosition").SetValue((object)val2); break; } case 2: { bool flag = false; if (!__instance.isInAngerMode) { __instance.isInAngerMode = true; AccessTools.Method(typeof(FlowermanAI), "DropPlayerBody", (Type[])null, (Type[])null).Invoke(__instance, null); __instance.creatureAngerVoice.Play(); __instance.creatureAngerVoice.pitch = Random.Range(0.9f, 1.3f); ((EnemyAI)__instance).creatureAnimator.SetBool("anger", true); ((EnemyAI)__instance).creatureAnimator.SetBool("sneak", false); if (GameNetworkManager.Instance.localPlayerController.HasLineOfSightToPosition(((Component)__instance).transform.position, 60f, 15, 2.5f, -1)) { flag = true; GameNetworkManager.Instance.localPlayerController.JumpToFearLevel(0.5f, true); } } if (!flag && GameNetworkManager.Instance.localPlayerController.HasLineOfSightToPosition(((Component)__instance).transform.position, 60f, 13, 4f, -1)) { GameNetworkManager.Instance.localPlayerController.IncreaseFearLevelOverTime(0.8f, 1f); } AccessTools.Method(typeof(FlowermanAI), "CalculateAnimationDirection", (Type[])null, (Type[])null).Invoke(__instance, new object[1] { 3f }); if (((EnemyAI)__instance).stunNormalizedTimer > 0f) { ((EnemyAI)__instance).creatureAnimator.SetLayerWeight(2, 1f); ((EnemyAI)__instance).agent.speed = 0f; __instance.angerMeter = 6f; } else { ((EnemyAI)__instance).creatureAnimator.SetLayerWeight(2, 0f); ((EnemyAI)__instance).agent.speed = Mathf.Clamp(((EnemyAI)__instance).agent.speed + Time.deltaTime * 1.2f, 3f, 12f); } FlowermanAI obj = __instance; obj.angerMeter -= Time.deltaTime; if (((NetworkBehaviour)__instance).IsOwner && __instance.angerMeter <= 0f) { ((EnemyAI)__instance).SwitchToBehaviourState(1); } break; } } if (__instance.isInAngerMode) { __instance.creatureAngerVoice.volume = Mathf.Lerp(__instance.creatureAngerVoice.volume, 1f, 10f * Time.deltaTime); } else { __instance.creatureAngerVoice.volume = Mathf.Lerp(__instance.creatureAngerVoice.volume, 0f, 2f * Time.deltaTime); } Vector3 localEulerAngles = __instance.animationContainer.localEulerAngles; if (__instance.carryingPlayerBody) { ((EnemyAI)__instance).agent.angularSpeed = 50f; localEulerAngles.z = Mathf.Lerp(localEulerAngles.z, 179f, 10f * Time.deltaTime); ((EnemyAI)__instance).creatureAnimator.SetLayerWeight(1, Mathf.Lerp(((EnemyAI)__instance).creatureAnimator.GetLayerWeight(1), 1f, 10f * Time.deltaTime)); } else { ((EnemyAI)__instance).agent.angularSpeed = 220f; localEulerAngles.z = Mathf.Lerp(localEulerAngles.z, 0f, 10f * Time.deltaTime); ((EnemyAI)__instance).creatureAnimator.SetLayerWeight(1, Mathf.Lerp(((EnemyAI)__instance).creatureAnimator.GetLayerWeight(1), 0f, 10f * Time.deltaTime)); } __instance.animationContainer.localEulerAngles = localEulerAngles; return false; } [HarmonyPatch("OnCollideWithPlayer")] [HarmonyPrefix] private static bool OnCollideWithPlayerPatch(ref FlowermanAI __instance, Collider other) { if (!Config.abilitiesEnabled.Value) { return true; } NetworkObject networkObject = ((NetworkBehaviour)__instance).NetworkObject; SpawnAbilityInfo spawnAbilityInfo = ((networkObject != null) ? ((Component)networkObject).gameObject.GetComponent() : null); if (!Object.op_Implicit((Object)(object)spawnAbilityInfo)) { return true; } PlayerControllerB val = ((EnemyAI)__instance).MeetsStandardPlayerCollisionConditions(other, false, false); if ((Object)(object)spawnAbilityInfo.creatorPlayer == (Object)(object)val || spawnAbilityInfo.otherFriendlies.Contains(val)) { return false; } return true; } } [HarmonyPatch(typeof(MaskedPlayerEnemy))] public class MaskedPlayerEnemyPatch { [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartPatch(ref MaskedPlayerEnemy __instance) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) if (!Config.abilitiesEnabled.Value) { return; } NetworkObject networkObject = ((NetworkBehaviour)__instance).NetworkObject; if ((Object)(object)((networkObject != null) ? ((Component)networkObject).gameObject.GetComponent() : null) != (Object)null) { return; } float num = 10f; MaskedPlayerEnemy val = null; MaskedPlayerEnemy[] array = Object.FindObjectsOfType(); foreach (MaskedPlayerEnemy val2 in array) { float num2 = Vector3.Distance(((Component)__instance).transform.position, ((Component)val2).transform.position); if (num2 < num && (Object)(object)val2 != (Object)(object)__instance) { num = num2; val = val2; } } if (Object.op_Implicit((Object)(object)val)) { NetworkObject networkObject2 = ((NetworkBehaviour)val).NetworkObject; SpawnAbilityInfo spawnAbilityInfo = ((networkObject2 != null) ? ((Component)networkObject2).gameObject.GetComponent() : null); if (Object.op_Implicit((Object)(object)spawnAbilityInfo)) { SpawnAbilityInfo spawnAbilityInfo2 = ((Component)((NetworkBehaviour)__instance).NetworkObject).gameObject.AddComponent(); spawnAbilityInfo2.creatorPlayer = spawnAbilityInfo.creatorPlayer; spawnAbilityInfo2.otherFriendlies = spawnAbilityInfo.otherFriendlies; } } } [HarmonyPatch("DoAIInterval")] [HarmonyPrefix] private static bool DoAIIntervalPatch(ref MaskedPlayerEnemy __instance) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_06e6: Unknown result type (might be due to invalid IL or missing references) //IL_06f7: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_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_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0242: 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_0212: Unknown result type (might be due to invalid IL or missing references) //IL_08ec: Unknown result type (might be due to invalid IL or missing references) //IL_08f1: Unknown result type (might be due to invalid IL or missing references) //IL_090c: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_0920: Unknown result type (might be due to invalid IL or missing references) //IL_0925: Unknown result type (might be due to invalid IL or missing references) //IL_0a4f: Unknown result type (might be due to invalid IL or missing references) //IL_07cc: Unknown result type (might be due to invalid IL or missing references) //IL_07d1: Unknown result type (might be due to invalid IL or missing references) //IL_07db: Unknown result type (might be due to invalid IL or missing references) //IL_07e0: Unknown result type (might be due to invalid IL or missing references) //IL_0969: Unknown result type (might be due to invalid IL or missing references) //IL_096e: Unknown result type (might be due to invalid IL or missing references) if (!Config.abilitiesEnabled.Value) { return true; } NetworkObject networkObject = ((NetworkBehaviour)__instance).NetworkObject; SpawnAbilityInfo spawnAbilityInfo = ((networkObject != null) ? ((Component)networkObject).gameObject.GetComponent() : null); Traverse val = Traverse.Create((object)__instance); if (!Object.op_Implicit((Object)(object)spawnAbilityInfo)) { return true; } if (((EnemyAI)__instance).moveTowardsDestination) { ((EnemyAI)__instance).agent.SetDestination(((EnemyAI)__instance).destination); } ((EnemyAI)__instance).SyncPositionToClients(); if (((EnemyAI)__instance).isEnemyDead) { ((EnemyAI)__instance).agent.speed = 0f; return false; } switch (((EnemyAI)__instance).currentBehaviourStateIndex) { case 0: { AccessTools.Method(typeof(MaskedPlayerEnemy), "LookAndRunRandomly", (Type[])null, (Type[])null).Invoke(__instance, new object[2] { true, false }); if (Time.realtimeSinceStartup - (float)val.Field("timeAtLastUsingEntrance").GetValue() > 3f && !Object.op_Implicit((Object)(object)((EnemyAI)__instance).GetClosestPlayer(false, false, false)) && !((EnemyAI)__instance).PathIsIntersectedByLineOfSight((Vector3)val.Field("mainEntrancePosition").GetValue(), false, false, false)) { Vector3 val4 = (Vector3)val.Field("mainEntrancePosition").GetValue(); if (Vector3.Distance(((Component)__instance).transform.position, val4) < 1f) { AccessTools.Method(typeof(MaskedPlayerEnemy), "TeleportMaskedEnemyAndSync", (Type[])null, (Type[])null).Invoke(__instance, new object[2] { RoundManager.FindMainEntrancePosition(true, !((EnemyAI)__instance).isOutside), !((EnemyAI)__instance).isOutside }); return false; } if (__instance.searchForPlayers.inProgress) { ((EnemyAI)__instance).StopSearch(__instance.searchForPlayers, true); } ((EnemyAI)__instance).SetDestinationToPosition(val4, false); return false; } if (!__instance.searchForPlayers.inProgress) { ((EnemyAI)__instance).StartSearch(((Component)__instance).transform.position, __instance.searchForPlayers); } PlayerControllerB val5 = CheckLineOfSightForClosestPlayer(__instance); if ((Object)(object)val5 != (Object)null) { __instance.LookAtPlayerServerRpc((int)val5.playerClientId); ((EnemyAI)__instance).SetMovingTowardsTargetPlayer(val5); ((EnemyAI)__instance).SwitchToBehaviourState(1); break; } float num2 = (float)val.Field("interestInShipCooldown").GetValue(); num2 += ((EnemyAI)__instance).AIIntervalTime; if (num2 >= 17f && Vector3.Distance(((Component)__instance).transform.position, StartOfRound.Instance.elevatorTransform.position) < 22f) { ((EnemyAI)__instance).SwitchToBehaviourState(2); } val.Field("interestInShipCooldown").SetValue((object)num2); break; } case 1: { AccessTools.Method(typeof(MaskedPlayerEnemy), "LookAndRunRandomly", (Type[])null, (Type[])null).Invoke(__instance, new object[2] { true, true }); PlayerControllerB val6 = CheckLineOfSightForClosestPlayer(__instance, 70f, 50, 1, 3f); bool flag2 = (bool)val.Field("handsOut").GetValue(); bool flag3 = (bool)val.Field("running").GetValue(); if ((Object)(object)val6 != (Object)null) { val.Field("lostPlayerInChase").SetValue((object)false); val.Field("lostLOSTimer").SetValue((object)0f); if ((Object)(object)val6 != (Object)(object)((EnemyAI)__instance).targetPlayer) { ((EnemyAI)__instance).SetMovingTowardsTargetPlayer(val6); __instance.LookAtPlayerServerRpc((int)val6.playerClientId); } if (((EnemyAI)__instance).mostOptimalDistance > 17f) { if (flag2) { flag2 = false; __instance.SetHandsOutServerRpc(false); } if (!flag3) { flag3 = true; ((EnemyAI)__instance).creatureAnimator.SetBool("Running", true); Debugger.Debug.Log(string.Format("Setting running to true 8; {0}", ((EnemyAI)__instance).creatureAnimator.GetBool("Running"))); __instance.SetRunningServerRpc(true); } } else if (((EnemyAI)__instance).mostOptimalDistance < 6f) { if (!flag2) { flag2 = true; __instance.SetHandsOutServerRpc(true); } } else if (((EnemyAI)__instance).mostOptimalDistance < 12f) { if (flag2) { flag2 = false; __instance.SetHandsOutServerRpc(false); } if (flag3 && !(bool)val.Field("runningRandomly").GetValue()) { flag3 = false; ((EnemyAI)__instance).creatureAnimator.SetBool("Running", false); Debugger.Debug.Log(string.Format("Setting running to false 1; {0}", ((EnemyAI)__instance).creatureAnimator.GetBool("Running"))); __instance.SetRunningServerRpc(false); } } } else { float num3 = (float)val.Field("lostLOSTimer").GetValue(); num3 += ((EnemyAI)__instance).AIIntervalTime; val.Field("lostLOSTimer").SetValue((object)num3); if (num3 > 10f) { ((EnemyAI)__instance).SwitchToBehaviourState(0); ((EnemyAI)__instance).targetPlayer = null; } else if (num3 > 3.5f) { val.Field("lostPlayerInChase").SetValue((object)true); __instance.StopLookingAtTransformServerRpc(); ((EnemyAI)__instance).targetPlayer = null; if (flag3) { flag3 = false; ((EnemyAI)__instance).creatureAnimator.SetBool("Running", false); Debugger.Debug.Log(string.Format("Setting running to false 2; {0}", ((EnemyAI)__instance).creatureAnimator.GetBool("Running"))); __instance.SetRunningServerRpc(false); } if (flag2) { flag2 = false; __instance.SetHandsOutServerRpc(false); } } } val.Field("handsOut").SetValue((object)flag2); val.Field("running").SetValue((object)flag3); break; } case 2: { float num = (float)val.Field("interestInShipCooldown").GetValue(); if (!((EnemyAI)__instance).isInsidePlayerShip) { num -= ((EnemyAI)__instance).AIIntervalTime; } if (Vector3.Distance(((Component)__instance).transform.position, StartOfRound.Instance.insideShipPositions[0].position) > 27f || num <= 0f) { ((EnemyAI)__instance).SwitchToBehaviourState(0); } else { PlayerControllerB closestPlayer = ((EnemyAI)__instance).GetClosestPlayer(false, false, false); if ((Object)(object)closestPlayer != (Object)null) { PlayerControllerB val2 = CheckLineOfSightForClosestPlayer(__instance, 70f, 20, 0); if ((Object)(object)val2 != (Object)null) { if ((Object)(object)__instance.stareAtTransform != (Object)(object)((Component)val2.gameplayCamera).transform) { __instance.LookAtPlayerServerRpc((int)val2.playerClientId); } ((EnemyAI)__instance).SetMovingTowardsTargetPlayer(val2); ((EnemyAI)__instance).SwitchToBehaviourState(1); } else if (((EnemyAI)__instance).isInsidePlayerShip && closestPlayer.HasLineOfSightToPosition(((Component)__instance).transform.position + Vector3.up * 0.7f, 4f, 20, -1f, -1)) { if ((Object)(object)__instance.stareAtTransform != (Object)(object)((Component)closestPlayer.gameplayCamera).transform) { __instance.LookAtPlayerServerRpc((int)closestPlayer.playerClientId); } ((EnemyAI)__instance).SetMovingTowardsTargetPlayer(closestPlayer); ((EnemyAI)__instance).SwitchToBehaviourState(1); } else if (((EnemyAI)__instance).mostOptimalDistance < 6f) { if ((Object)(object)__instance.stareAtTransform != (Object)(object)((Component)closestPlayer.gameplayCamera).transform) { __instance.stareAtTransform = ((Component)closestPlayer.gameplayCamera).transform; __instance.LookAtPlayerServerRpc((int)closestPlayer.playerClientId); } } else if (((EnemyAI)__instance).mostOptimalDistance > 12f && (Object)(object)__instance.stareAtTransform != (Object)null) { __instance.stareAtTransform = null; __instance.StopLookingAtTransformServerRpc(); } } Vector3 val3 = (Vector3)val.Field("shipHidingSpot").GetValue(); bool flag = (bool)val.Field("crouching").GetValue(); ((EnemyAI)__instance).SetDestinationToPosition(val3, false); if (!flag && Vector3.Distance(((Component)__instance).transform.position, val3) < 0.4f) { ((EnemyAI)__instance).agent.speed = 0f; flag = true; __instance.SetCrouchingServerRpc(true); } else if (flag && Vector3.Distance(((Component)__instance).transform.position, val3) > 1f) { flag = false; __instance.SetCrouchingServerRpc(false); } val.Field("crouching").SetValue((object)flag); } val.Field("interestInShipCooldown").SetValue((object)num); break; } } if ((Object)(object)((EnemyAI)__instance).targetPlayer != (Object)null && ((EnemyAI)__instance).PlayerIsTargetable(((EnemyAI)__instance).targetPlayer, false, false, true) && (((EnemyAI)__instance).currentBehaviourStateIndex == 1 || ((EnemyAI)__instance).currentBehaviourStateIndex == 2)) { if ((bool)val.Field("lostPlayerInChase").GetValue()) { ((EnemyAI)__instance).movingTowardsTargetPlayer = false; if (!__instance.searchForPlayers.inProgress) { ((EnemyAI)__instance).StartSearch(((Component)__instance).transform.position, __instance.searchForPlayers); return false; } } else { if (__instance.searchForPlayers.inProgress) { ((EnemyAI)__instance).StopSearch(__instance.searchForPlayers, true); } ((EnemyAI)__instance).SetMovingTowardsTargetPlayer(((EnemyAI)__instance).targetPlayer); } } return false; } private static PlayerControllerB CheckLineOfSightForClosestPlayer(MaskedPlayerEnemy _this, float width = 45f, int range = 60, int proximityAwareness = -1, float bufferDistance = 0f) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Invalid comparison between Unknown and I4 //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: 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_00f8: 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_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) NetworkObject networkObject = ((NetworkBehaviour)_this).NetworkObject; SpawnAbilityInfo spawnAbilityInfo = ((networkObject != null) ? ((Component)networkObject).gameObject.GetComponent() : null); if (((EnemyAI)_this).isOutside && !((EnemyAI)_this).enemyType.canSeeThroughFog && (int)TimeOfDay.Instance.currentLevelWeather == 3) { range = Mathf.Clamp(range, 0, 30); } float num = 1000f; int num2 = -1; for (int i = 0; i < StartOfRound.Instance.allPlayerScripts.Length; i++) { Vector3 position = ((Component)StartOfRound.Instance.allPlayerScripts[i].gameplayCamera).transform.position; if (!Physics.Linecast(((EnemyAI)_this).eye.position, position, StartOfRound.Instance.collidersAndRoomMaskAndDefault) && !((Object)(object)StartOfRound.Instance.allPlayerScripts[i] == (Object)(object)spawnAbilityInfo.creatorPlayer) && !spawnAbilityInfo.otherFriendlies.Contains(StartOfRound.Instance.allPlayerScripts[i])) { Vector3 val = position - ((EnemyAI)_this).eye.position; float num3 = Vector3.Distance(((EnemyAI)_this).eye.position, position); if ((Vector3.Angle(((EnemyAI)_this).eye.forward, val) < width || (proximityAwareness != -1 && num3 < (float)proximityAwareness)) && num3 < num) { num = num3; num2 = i; } } } if ((Object)(object)((EnemyAI)_this).targetPlayer != (Object)null && num2 != -1 && (Object)(object)((EnemyAI)_this).targetPlayer != (Object)(object)StartOfRound.Instance.allPlayerScripts[num2] && bufferDistance > 0f && Mathf.Abs(num - Vector3.Distance(((Component)_this).transform.position, ((Component)((EnemyAI)_this).targetPlayer).transform.position)) < bufferDistance) { return null; } if (num2 < 0) { return null; } ((EnemyAI)_this).mostOptimalDistance = num; return StartOfRound.Instance.allPlayerScripts[num2]; } [HarmonyPatch("OnCollideWithPlayer")] [HarmonyPrefix] private static bool OnCollideWithPlayerPatch(ref MaskedPlayerEnemy __instance, Collider other) { if (!Config.abilitiesEnabled.Value) { return true; } NetworkObject networkObject = ((NetworkBehaviour)__instance).NetworkObject; SpawnAbilityInfo spawnAbilityInfo = ((networkObject != null) ? ((Component)networkObject).gameObject.GetComponent() : null); if (!Object.op_Implicit((Object)(object)spawnAbilityInfo)) { return true; } PlayerControllerB val = ((EnemyAI)__instance).MeetsStandardPlayerCollisionConditions(other, false, false); if ((Object)(object)spawnAbilityInfo.creatorPlayer == (Object)(object)val || spawnAbilityInfo.otherFriendlies.Contains(val)) { return false; } return true; } } [HarmonyPatch(typeof(SpikeRoofTrap))] public class SpikeRoofTrapPatch { [HarmonyPatch("Start")] [HarmonyPrefix] private static void StartPatch(SpikeRoofTrap __instance) { Debugger.Debug.LogWarning("Spike Found! Deleteing..."); if (!Config.spikeTrapEnabled.Value) { ((NetworkBehaviour)__instance).NetworkObject.Despawn(true); Debugger.Debug.Log("Deleteing..."); } } } [HarmonyPatch(typeof(RoundManager))] public class RoundManagerPatch { [HarmonyPatch("Awake")] [HarmonyPrefix] private static void AwakePatch() { HideAndSeekGM.Init(); ObjectivesManager.Init(); } [HarmonyPatch("LoadNewLevel")] [HarmonyPrefix] private static bool LoadLevelPatch(ref int randomSeed, ref SelectableLevel newLevel) { if (HideAndSeekGM.instance.levelLoading) { Debugger.Debug.LogError("Level got loaded more than once in a row??? Idk man..."); return false; } HideAndSeekGM.instance.OnLevelLoaded(newLevel); return true; } } [HarmonyPatch(typeof(PlayerControllerB))] public class PlayerControllerBPatch { [HarmonyPatch("DestroyItemInSlotAndSync")] [HarmonyPrefix] private static bool DestroyItemInSlotAndSyncPatch(int itemSlot) { Debugger.Debug.LogMessage("DestroyItemAndSync + " + itemSlot); if (itemSlot < 0) { Debugger.Debug.LogMessage("Item slot out of range!"); return false; } return true; } [HarmonyPatch("DamagePlayer")] [HarmonyPrefix] private static bool DamagePlayerPatch(CauseOfDeath causeOfDeath = 0) { //IL_0006: 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_007e: Invalid comparison between Unknown and I4 //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Invalid comparison between Unknown and I4 Debugger.Debug.LogMessage($"Damaged recived: {causeOfDeath}"); PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (ObjectivesManager.instance.PlayerReachedObjective(localPlayerController)) { Debugger.Debug.LogError("Tried to damage player '" + localPlayerController.playerUsername + "' but he has reached the objective!"); return false; } if (HideAndSeekGM.instance.seekers.Contains(localPlayerController) || HideAndSeekGM.instance.zombies.Contains(localPlayerController)) { if ((int)causeOfDeath == 10) { return false; } if (Config.isSeekerImmune.Value) { return false; } if ((int)causeOfDeath == 7) { return false; } } return true; } [HarmonyPatch("DamagePlayerFromOtherClientClientRpc")] [HarmonyPrefix] private static bool DamagePlayerFromOtherClientClientRpcPatch(ref int damageAmount, ref Vector3 hitDirection, ref int playerWhoHit, ref int newHealthAmount, ref PlayerControllerB __instance) { PlayerControllerB val = __instance; PlayerControllerB playerWithClientId = HideAndSeekGM.instance.GetPlayerWithClientId((ulong)playerWhoHit); Debugger.Debug.LogError($"Hit Damage Recived! local '{HideAndSeekGM.instance.zombies.Contains(val) || HideAndSeekGM.instance.seekers.Contains(val)}' attacker '{HideAndSeekGM.instance.zombies.Contains(playerWithClientId) || HideAndSeekGM.instance.seekers.Contains(playerWithClientId)}'"); if ((HideAndSeekGM.instance.zombies.Contains(val) || HideAndSeekGM.instance.seekers.Contains(val)) && (HideAndSeekGM.instance.zombies.Contains(playerWithClientId) || HideAndSeekGM.instance.seekers.Contains(playerWithClientId))) { return false; } if (HideAndSeekGM.instance.zombies.Contains(playerWithClientId) || HideAndSeekGM.instance.seekers.Contains(playerWithClientId)) { damageAmount = 90; newHealthAmount = val.health - damageAmount; } return true; } [HarmonyPatch("PlayFootstepSound")] [HarmonyPrefix] private static bool PlayFootstepSoundPatch(ref PlayerControllerB __instance) { PlayerControllerB obj = __instance; if (obj != null && (((Component)obj).GetComponent()?.stealthActivated).GetValueOrDefault()) { return false; } return true; } [HarmonyPatch("PlayJumpAudio")] [HarmonyPrefix] private static bool PlayJumpAudioPatch(ref PlayerControllerB __instance) { PlayerControllerB obj = __instance; if (obj != null && (((Component)obj).GetComponent()?.stealthActivated).GetValueOrDefault()) { return false; } return true; } [HarmonyPatch("PlayHitGroundAudio")] [HarmonyPrefix] private static bool PlayHitGroundAudioPatch(ref PlayerControllerB __instance) { AbilityInstance component = ((Component)__instance).GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return true; } if (component.stealthActivated) { return false; } return true; } } [HarmonyPatch(typeof(EntranceTeleport))] public class EntranceTeleportPatch { [HarmonyPatch("TeleportPlayer")] [HarmonyPrefix] public static bool TeleportPlayerPatch() { List allConnectedPlayers = HideAndSeekGM.GetAllConnectedPlayers("Teleport Player Patch"); PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (!HideAndSeekGM.instance.seekers.Contains(localPlayerController) && !HideAndSeekGM.instance.zombies.Contains(localPlayerController) && HideAndSeekGM.instance.playersTeleported >= allConnectedPlayers.Count && Config.lockHidersInside.Value && !ObjectivesManager.instance.objectiveReleased) { HUDManager.Instance.DisplayTip("???", "The entrance appears to be blocked.", false, false, "LC_Tip1"); return false; } return true; } } [HarmonyPatch(typeof(TimeOfDay))] public class TimeOfDayPatch { [HarmonyPatch("SetBuyingRateForDay")] [HarmonyPostfix] public static void SetBuyingRateForDayPatch() { StartOfRound.Instance.companyBuyingRate = 1f; } [HarmonyPatch("UpdateProfitQuotaCurrentTime")] [HarmonyPrefix] public static bool UpdateProfitQuotaCurrentTimePatch() { HideAndSeekGM.instance.backInOrbit?.Invoke(); HUDManagerPatch.UpdateRoundDisplay(); return false; } } [HarmonyPatch(typeof(HUDManager))] public class HUDManagerPatch { public static int CurrentRound = 1; [HarmonyPatch("DisplayDaysLeft")] [HarmonyPostfix] public static void DisplayDaysLeftPatch() { CurrentRound++; UpdateRoundDisplay(); } public static void UpdateRoundDisplay() { ((TMP_Text)HUDManager.Instance.profitQuotaDaysLeftText).text = $"Round {CurrentRound}"; ((TMP_Text)HUDManager.Instance.profitQuotaDaysLeftText2).text = $"Round {CurrentRound}"; ((TMP_Text)StartOfRound.Instance.deadlineMonitorText).text = $"Round:\n {CurrentRound}"; TimeOfDay.Instance.quotaVariables.deadlineDaysAmount = 3; TimeOfDay.Instance.profitQuota = 200; TimeOfDay.Instance.quotaFulfilled = 0; TimeOfDay.Instance.timeUntilDeadline = 3f; TimeOfDay.Instance.daysUntilDeadline = 3; TimeOfDay.Instance.hoursUntilDeadline = 3; } } [HarmonyPatch(typeof(GameNetworkManager))] public class GameNetworkManagerPatch { public static GameObject networkPrefab; [HarmonyPatch("Start")] [HarmonyPostfix] public static void StartPatch() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)networkPrefab)) { NetworkManager.Singleton.RemoveNetworkPrefab(networkPrefab); } networkPrefab = (GameObject)Plugin.networkHandlerBundle.LoadAsset("NetworkHandler"); networkPrefab.AddComponent(); NetworkManager.Singleton.AddNetworkPrefab(networkPrefab); } } [HarmonyPatch(typeof(StartOfRound))] public class StartOfRoundPatch { [HarmonyPatch("Awake")] [HarmonyPostfix] 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(GameNetworkManagerPatch.networkPrefab, Vector3.zero, Quaternion.identity); val.GetComponent().Spawn(false); } } [HarmonyPatch("FirePlayersAfterDeadlineClientRpc")] [HarmonyPrefix] private static bool FirePlayersPatch() { Debugger.Debug.LogError("Tried to fire players! Canceling"); return false; } [HarmonyPatch("SetTimeAndPlanetToSavedSettings")] [HarmonyPrefix] private static bool SetTimeAndPlanetToSavedSettingsPatch(ref StartOfRound __instance) { string currentSaveFileName = GameNetworkManager.Instance.currentSaveFileName; __instance.ChangeLevel(ES3.Load("CurrentPlanetID", currentSaveFileName, __instance.defaultPlanet)); __instance.ChangePlanet(); if (__instance.isChallengeFile) { TimeOfDay.Instance.totalTime = TimeOfDay.Instance.lengthOfHours * (float)TimeOfDay.Instance.numberOfHours; TimeOfDay.Instance.timeUntilDeadline = TimeOfDay.Instance.totalTime; TimeOfDay.Instance.profitQuota = 200; } else { HUDManagerPatch.UpdateRoundDisplay(); } TimeOfDay.Instance.UpdateProfitQuotaCurrentTime(); __instance.LoadPlanetsMoldSpreadData(); __instance.SetPlanetsWeather(0); if (__instance.gameStats.daysSpent != 0 || !__instance.isChallengeFile) { } if (!(TimeOfDay.Instance.timeUntilDeadline > 0f) || TimeOfDay.Instance.daysUntilDeadline > 0 || TimeOfDay.Instance.timesFulfilledQuota <= 0) { } return false; } } [HarmonyPatch(typeof(ShotgunItem))] public class ShotgunPatch { [HarmonyPatch("StartReloadGun")] [HarmonyPrefix] private static bool StartReloadGunPatch(ref int ___ammoSlotToUse, ref Animator ___gunAnimator, ref Coroutine ___gunCoroutine) { ShotgunItem val = null; ShotgunItem[] array = Object.FindObjectsOfType(); foreach (ShotgunItem val2 in array) { if ((Object)(object)val2.gunAnimator == (Object)(object)___gunAnimator) { val = val2; break; } } if (!Traverse.Create((object)val).Method("ReloadedGun", Array.Empty()).GetValue() && !Config.shotgunInfiniteAmmo.Value) { val.gunAudio.PlayOneShot(val.noAmmoSFX); return false; } if (!((NetworkBehaviour)val).IsOwner) { return false; } if (___gunCoroutine != null) { ((MonoBehaviour)val).StopCoroutine(___gunCoroutine); } ___gunCoroutine = ((MonoBehaviour)val).StartCoroutine(Traverse.Create((object)val).Method("reloadGunAnimation", Array.Empty()).GetValue()); return false; } [HarmonyPatch("ItemActivate")] [HarmonyPrefix] private static void ItemActivatePatch(ref int ___shellsLoaded) { if (Config.shotgunAutoReload.Value && Config.shotgunInfiniteAmmo.Value) { ___shellsLoaded = 2; } } } [HarmonyPatch(typeof(StartMatchLever))] public class StartMatchLeverPatch { [HarmonyPatch("LeverAnimation")] [HarmonyPrefix] public static bool LeverAnimationPatch() { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (!HideAndSeekGM.instance.seekers.Contains(localPlayerController) && !((NetworkBehaviour)localPlayerController).IsHost && !StartOfRound.Instance.inShipPhase && !HideAndSeekGM.instance.gameEndedEarly && Config.lockShipLever.Value) { HUDManager.Instance.DisplayTip("Hide And Seek", "You are not allowed to end the round!", true, false, "LC_Tip1"); return false; } return true; } } [HarmonyPatch(typeof(InteractTrigger))] public class InteractTriggerPatch { [HarmonyPatch("Interact")] [HarmonyPrefix] private static void InteractPatch(ref InteractTrigger __instance, ref Transform playerTransform) { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) if (!(((Object)__instance).name != "StartGameLever")) { Debug.Log((object)("LeverFlipped by " + ((Object)((Component)playerTransform).gameObject).name)); PlayerControllerB component = ((Component)playerTransform).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { Debug.Log((object)$"id found: {component.actualClientId}"); HideAndSeekGM.instance.leverLastFlippedBy = component.actualClientId; NetworkHandler.Instance.EventSendRpc(".leverFlipped", new MessageProperties(__bool: false, "", 0, 0f, 0uL) { _ulong = component.actualClientId }); } } } } [HarmonyPatch(typeof(Terminal))] public class TerminalPatch { [HarmonyPatch("RunTerminalEvents")] [HarmonyPostfix] private static void RunTerminalEvents(ref int ___groupCredits) { ___groupCredits = 50000; } } [HarmonyPatch(typeof(GrabbableObject))] public class GrabbableObjectPatch { [HarmonyPatch("Update")] [HarmonyPrefix] private static void UpdatePatch(ref GrabbableObject __instance) { if (Config.infiniteFlashlightBattery.Value && ((Object)__instance).name.Contains("Flashlight")) { __instance.insertedBattery.charge = 1f; } } } [HarmonyPatch(typeof(DeadBodyInfo))] public class DeadBodyInfoPatch { [HarmonyPatch("Update")] [HarmonyPrefix] private static void UpdatePatch(ref DeadBodyInfo __instance) { if (Config.abilitiesEnabled.Value && Object.op_Implicit((Object)(object)__instance.grabBodyObject) && __instance.grabBodyObject.scrapValue != Config.deadBodySellValue.Value) { __instance.grabBodyObject.SetScrapValue(Config.deadBodySellValue.Value); } } } public static class PatchHelper { [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; 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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(2f); <>1__state = 1; return true; case 1: <>1__state = -1; HUDManager.Instance.tipsPanelAnimator.SetTrigger("TriggerHint"); 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__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB player; public float wait; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(wait); <>1__state = 1; return true; case 1: <>1__state = -1; RevivePlayerAndCallRpc(player); 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 static void ReviveAfterWaitAndCallRpc(PlayerControllerB player, float wait = 5f) { if (!StartOfRound.Instance.shipHasLanded) { Debugger.Debug.LogError("Can't revive someone while the ship is leaving!"); } else { ((MonoBehaviour)GameNetworkManager.Instance).StartCoroutine(ReviveAfterWaitAndCallRpcC(player, wait)); } } [IteratorStateMachine(typeof(d__1))] private static IEnumerator ReviveAfterWaitAndCallRpcC(PlayerControllerB player, float wait = 5f) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { player = player, wait = wait }; } public static void RevivePlayerAndCallRpc(PlayerControllerB player) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) NetworkHandler.Instance.EventSendRpc(".revivePlayerLocal", new MessageProperties(__bool: false, "", 0, 0f, player.actualClientId)); } private static void ReviveVRPlayerLocal(PlayerControllerB player) { //IL_0103: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB localPlayerController = StartOfRound.Instance.localPlayerController; if (localPlayerController.isPlayerDead == Object.op_Implicit((Object)(object)player)) { VRSession.Instance.VolumeManager.Saturation = 0f; VRSession.Instance.VolumeManager.VignetteIntensity = 0f; ((Renderer)localPlayerController.thisPlayerModelArms).enabled = true; localPlayerController.isPlayerControlled = false; localPlayerController.takingFallDamage = false; ((Behaviour)VRSession.Instance.LocalPlayer.LeftHandInteractor).enabled = true; ((Behaviour)VRSession.Instance.LocalPlayer.RightHandInteractor).enabled = true; HangarShipDoor val = Object.FindFirstObjectByType(); Transform val2 = ((Component)val).transform.Find("HangarDoorLeft (1)"); Transform val3 = ((Component)val).transform.Find("HangarDoorRight (1)"); Component val4 = (Component)(object)((Component)val).transform.Find("Cube"); ((Collider)((Component)val2).GetComponent()).isTrigger = false; ((Collider)((Component)val3).GetComponent()).isTrigger = false; ((Collider)val4.GetComponent()).isTrigger = false; ((Collider)((Component)localPlayerController).GetComponent()).excludeLayers = LayerMask.op_Implicit(0); VRSession.Instance.HUD.ToggleSpectatorLight((bool?)false); } } [IteratorStateMachine(typeof(d__4))] private static IEnumerator FixTip() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0); } public static void RevivePlayerLocal(PlayerControllerB player) { //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null) { Debugger.Debug.LogError($"RevivePlayer({player}) Tried to revive null player!"); return; } StartOfRound instance = StartOfRound.Instance; if ((Object)(object)instance == (Object)null) { Debugger.Debug.LogError($"RevivePlayer({player}) No start of round instance!"); return; } if (instance.shipIsLeaving) { Debugger.Debug.LogError($"RevivePlayer({player}) Tried to revive, but has already left!"); return; } GameObject val = null; if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)player) { val = GameObject.Find("Systems/UI/Canvas/IngamePlayerHUD"); val.SetActive(false); } Debugger.Debug.Log("Reviving players A"); try { ReviveVRPlayerLocal(player); } catch (Exception) { Debugger.Debug.LogError("ReviveVRPlayerLocal Ran into an error!"); } player.ResetPlayerBloodObjects(player.isPlayerDead); if (player.isPlayerDead || player.isPlayerControlled) { player.isClimbingLadder = false; player.clampLooking = false; player.inVehicleAnimation = false; player.disableMoveInput = false; player.ResetZAndXRotation(); ((Collider)player.thisController).enabled = true; player.health = 100; player.hasBeenCriticallyInjured = false; player.disableLookInput = false; player.disableInteract = false; Debugger.Debug.Log("Reviving players B"); if (player.isPlayerDead) { player.isPlayerDead = false; player.isPlayerControlled = true; player.isInElevator = true; player.isInHangarShipRoom = true; player.isInsideFactory = false; player.parentedToElevatorLastFrame = false; player.overrideGameOverSpectatePivot = null; instance.SetPlayerObjectExtrapolate(false); player.TeleportPlayer(instance.playerSpawnPositions[0].position, false, 0f, false, true); player.setPositionOfDeadPlayer = false; player.DisablePlayerModel(((Component)player).gameObject, true, true); ((Behaviour)player.helmetLight).enabled = false; Debugger.Debug.Log("Reviving players C"); player.Crouch(false); player.criticallyInjured = false; if ((Object)(object)player.playerBodyAnimator != (Object)null) { player.playerBodyAnimator.SetBool("Limp", false); } player.bleedingHeavily = false; player.activatingItem = false; player.twoHanded = false; player.inShockingMinigame = false; player.inSpecialInteractAnimation = false; player.freeRotationInInteractAnimation = false; player.disableSyncInAnimation = false; player.inAnimationWithEnemy = null; player.holdingWalkieTalkie = false; player.speakingToWalkieTalkie = false; Debugger.Debug.Log("Reviving players D"); player.isSinking = false; player.isUnderwater = false; player.sinkingValue = 0f; player.statusEffectAudio.Stop(); player.DisableJetpackControlsLocally(); player.health = 100; Debugger.Debug.Log("Reviving players E"); player.mapRadarDotAnimator.SetBool("dead", false); player.externalForceAutoFade = Vector3.zero; if (((NetworkBehaviour)player).IsOwner) { HUDManager.Instance.gasHelmetAnimator.SetBool("gasEmitting", false); player.hasBegunSpectating = false; HUDManager.Instance.RemoveSpectateUI(); HUDManager.Instance.gameOverAnimator.SetTrigger("revive"); player.hinderedMultiplier = 1f; player.isMovementHindered = 0; player.sourcesCausingSinking = 0; HUDManager.Instance.HideHUD(false); Debugger.Debug.Log("Reviving players E2"); player.reverbPreset = instance.shipReverb; } } Debugger.Debug.Log("Reviving players F"); SoundManager.Instance.earsRingingTimer = 0f; player.voiceMuffledByEnemy = false; SoundManager.Instance.playerVoicePitchTargets[(uint)player.actualClientId] = 1f; SoundManager.Instance.SetPlayerPitch(1f, (int)player.actualClientId); if ((Object)(object)player.currentVoiceChatIngameSettings == (Object)null) { instance.RefreshPlayerVoicePlaybackObjects(); } if ((Object)(object)player.currentVoiceChatIngameSettings != (Object)null) { if ((Object)(object)player.currentVoiceChatIngameSettings.voiceAudio == (Object)null) { player.currentVoiceChatIngameSettings.InitializeComponents(); } if ((Object)(object)player.currentVoiceChatIngameSettings.voiceAudio == (Object)null) { return; } ((Component)player.currentVoiceChatIngameSettings.voiceAudio).GetComponent().overridingLowPass = false; } Debugger.Debug.Log("Reviving players G"); } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; localPlayerController.bleedingHeavily = false; localPlayerController.criticallyInjured = false; localPlayerController.playerBodyAnimator.SetBool("Limp", false); localPlayerController.health = 100; HUDManager.Instance.UpdateHealthUI(100, false); localPlayerController.spectatedPlayerScript = null; ((Behaviour)HUDManager.Instance.audioListenerLowPass).enabled = false; Debugger.Debug.Log($"Reviving players H {player.deadBody}"); instance.SetSpectateCameraToGameOverMode(false, localPlayerController); instance.livingPlayers++; instance.UpdatePlayerVoiceEffects(); if (Object.op_Implicit((Object)(object)val)) { val.SetActive(true); ((MonoBehaviour)instance).StartCoroutine(FixTip()); } if (!HideAndSeekGM.instance.zombies.Contains(player)) { Debugger.Debug.LogMessage($"------------- Adding zombie after reviving {player} -------------------"); HideAndSeekGM.instance.MakeZombie(player); } } } } namespace HideAndSeek.AudioScripts { public static class AudioManager { [CompilerGenerated] private sealed class d__2 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private string 5__1; private string 5__2; private string[] 5__3; private string[] <>s__4; private int <>s__5; private string 5__6; private string 5__7; private UnityWebRequest 5__8; private string[] 5__9; private string 5__10; private string 5__11; private AudioClip 5__12; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__2(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; 5__3 = null; <>s__4 = null; 5__6 = null; 5__7 = null; 5__8 = null; 5__9 = null; 5__10 = null; 5__11 = null; 5__12 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; audioClips = new List(); 5__1 = Path.GetDirectoryName(((BaseUnityPlugin)Plugin.instance).Info.Location); 5__2 = Path.Combine(5__1, "Sounds"); if (!Directory.Exists(5__2)) { Directory.CreateDirectory(5__2); } 5__3 = Directory.GetFiles(5__1, "*.wav", SearchOption.AllDirectories); Debugger.Debug.LogWarning($"Now loading all sounds! Path = '{5__1}', Files found = '{5__3.Length}'"); <>s__4 = 5__3; <>s__5 = 0; break; case 1: <>1__state = -1; if (!5__8.isNetworkError && !5__8.isHttpError) { 5__9 = 5__6.Split("\\"); 5__10 = 5__9[5__9.Length - 1]; 5__11 = 5__10.Replace(".wav", ""); 5__12 = DownloadHandlerAudioClip.GetContent(5__8); if ((Object)(object)5__12 != (Object)null) { ((Object)5__12).name = 5__11; audioClips.Add(5__12); } File.Move(5__6, Path.Combine(5__2, 5__10)); 5__9 = null; 5__10 = null; 5__11 = null; 5__12 = null; } 5__7 = null; 5__8 = null; 5__6 = null; <>s__5++; break; } if (<>s__5 < <>s__4.Length) { 5__6 = <>s__4[<>s__5]; 5__7 = $"file://{5__6}"; 5__8 = UnityWebRequestMultimedia.GetAudioClip(5__7, (AudioType)20); <>2__current = 5__8.SendWebRequest(); <>1__state = 1; return true; } <>s__4 = null; Debugger.Debug.LogWarning("All Audio Loaded!"); LoadedAudio = 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 static bool LoadedAudio; public static List audioClips; [IteratorStateMachine(typeof(d__2))] public static IEnumerator LoadAudioCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__2(0); } public static AudioClip GetSound(string name, bool fullName = false, float random = -1f) { List list = new List(); foreach (AudioClip audioClip in audioClips) { if (fullName) { if (string.Equals(((Object)audioClip).name, name, StringComparison.CurrentCultureIgnoreCase)) { list.Add(audioClip); } } else if (string.Equals(((Object)audioClip).name.Split("-")[0], name, StringComparison.CurrentCultureIgnoreCase)) { list.Add(audioClip); } } if (list.Count == 1) { return list[0]; } if (list.Count > 1) { if (random == -1f) { random = Random.Range(0f, 1f); } random *= (float)list.Count; if (random < 0f) { random = 0f; } int index = Mathf.FloorToInt(random); return list[index]; } Debugger.Debug.LogError("AudioManager; GetSound(" + name + ") Could not find audio clip!"); return null; } public static OneTimeAudio PlaySound(string name, float volume = 1f, float pitch = 1f, Vector3 position = default(Vector3), float spatialBend = 0f, float minDistance = 1f, float maxDistance = 500f, float random = -1f, bool isFullName = false, Transform parent = null) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) AudioClip sound = GetSound(name, isFullName, random); return PlaySound(sound, volume, pitch, position, spatialBend, minDistance, maxDistance, parent); } public static OneTimeAudio PlaySound(AudioClip clip, float volume = 1f, float pitch = 1f, Vector3 position = default(Vector3), float spatialBend = 0f, float minDistance = 1f, float maxDistance = 500f, Transform parent = null) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Playing(" + ((Object)clip).name + ") ONCE"); if ((Object)(object)parent != (Object)null) { val.transform.parent = parent; } OneTimeAudio oneTimeAudio = val.AddComponent(); oneTimeAudio.PlayAudioClip(clip, volume, pitch, position, spatialBend, minDistance, maxDistance); return oneTimeAudio; } } public class OneTimeAudio : MonoBehaviour { public void PlayAudioClip(AudioClip clip, float volume = 1f, float pitch = 1f, Vector3 position = default(Vector3), float spatialBend = 0f, float minDistance = 1f, float maxDistance = 500f) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) AudioSource val = ((Component)this).gameObject.AddComponent(); val.pitch = pitch; val.volume = volume; val.spatialBlend = spatialBend; ((Component)this).transform.position = position; val.minDistance = minDistance; val.maxDistance = maxDistance; val.clip = clip; val.Play(); ((MonoBehaviour)this).Invoke("ClipDone", clip.length / val.pitch + 1f); } private void ClipDone() { Object.Destroy((Object)(object)((Component)this).gameObject); } } } namespace HideAndSeek.AbilityScripts { public static class Abilities { [CompilerGenerated] private sealed class d__7 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public AbilityBase ability; public ulong activatorId; private PlayerControllerB 5__1; private Vector3 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_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_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Expected O, but got Unknown //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Expected O, but got Unknown //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0165: 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_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = GameNetworkManager.Instance.localPlayerController; 5__2 = ((Component)AudioManager.PlaySound("DistantFireAlarm", 1.4f, 1f, ((Component)5__1).transform.position + Vector3.up * 2f, 1f, 20f, 100f)).transform.position; AudioManager.PlaySound("ScaryWarning", 1f, 1f, ((Component)5__1).transform.position + Vector3.up * 2f); <>2__current = (object)new WaitForSecondsRealtime(1f); <>1__state = 1; return true; case 1: <>1__state = -1; HUDManager.Instance.DisplayTip("Warning", "Something is coming... I should probably run.", true, false, "LC_Tip1"); <>2__current = (object)new WaitForSecondsRealtime(Random.Range(5f, 7f)); <>1__state = 2; return true; case 2: { <>1__state = -1; Vector3 val = 5__2 - ((Component)5__1).transform.position; if (((Vector3)(ref val)).magnitude <= 20f) { val = default(Vector3); AudioManager.PlaySound("HeightDamage", 1f, 1f, val); PlayerControllerB obj = 5__1; int num = 5__1.health - 1; val = default(Vector3); obj.DamagePlayer(num, true, true, (CauseOfDeath)0, 0, false, val); } else { HUDManager.Instance.DisplayTip("Unknown", "Sounds like it left..", false, false, "LC_Tip1"); } 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__35 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public AbilityBase ability; public ulong activatorId; private PlayerControllerB 5__1; private List 5__2; private int 5__3; private List.Enumerator <>s__4; private PlayerControllerB 5__5; private SeekerDotVisuals[] <>s__6; private int <>s__7; private SeekerDotVisuals 5__8; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__35(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; <>s__4 = default(List.Enumerator); 5__5 = null; <>s__6 = null; 5__8 = null; <>1__state = -2; } private bool MoveNext() { //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Expected O, but got Unknown int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; } else { <>1__state = -1; 5__1 = HideAndSeekGM.instance.GetPlayerWithClientId(activatorId); 5__2 = new List(); <>s__4 = HideAndSeekGM.GetAllConnectedPlayers("HeatSeeking").GetEnumerator(); try { while (<>s__4.MoveNext()) { 5__5 = <>s__4.Current; if (!5__5.isPlayerDead && HideAndSeekGM.instance.seekers.Contains(5__5) != HideAndSeekGM.instance.seekers.Contains(5__1) && !HideAndSeekGM.instance.zombies.Contains(5__5)) { Debugger.Debug.LogWarning("Adding player: " + ((object)5__5)?.ToString() + " To targets!"); 5__2.Add(5__5); } 5__5 = null; } } finally { ((IDisposable)<>s__4).Dispose(); } <>s__4 = default(List.Enumerator); Debugger.Debug.LogMessage($"[Heat Seeking] Target count = '{5__2.Count}'"); 5__3 = Random.Range(0, 5__2.Count); if (5__2.Count <= 0) { Debugger.Debug.LogWarning("None To Target!"); NetworkHandler.Instance.EventSendRpc(".moneyChanged", new MessageProperties(__bool: false, "silent", ability.abilityCost, 0f, activatorId)); goto IL_033a; } Debugger.Debug.LogWarning("Player id chosen: " + (object)5__2[5__3]); } if (StartOfRound.Instance.shipHasLanded) { ability.ActivateClient(activatorId, "TG:" + 5__2[5__3].actualClientId); <>s__6 = dots.ToArray(); for (<>s__7 = 0; <>s__7 < <>s__6.Length; <>s__7++) { 5__8 = <>s__6[<>s__7]; if (5__8.targetedPlayer.isPlayerDead) { dots.Remove(5__8); Object.Destroy((Object)(object)((Component)5__8).gameObject); } 5__8 = null; } <>s__6 = null; if (dots.Count > 0) { <>2__current = (object)new WaitForSecondsRealtime(12f); <>1__state = 1; return true; } } ability.ActivateClient(activatorId, "CLEAN"); goto IL_033a; IL_033a: ability.usedThisRound = 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(); } } [CompilerGenerated] private sealed class d__43 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public AbilityBase ability; public ulong activatorId; private PlayerControllerB 5__1; private int 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__43(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; ability.ActivateClient(activatorId, true.ToString()); 5__1 = HideAndSeekGM.instance.GetPlayerWithClientId(activatorId); 5__2 = 30; break; case 1: <>1__state = -1; 5__2--; if (5__2 == 5) { ability.ActivateClient(activatorId, "Warn"); } break; } if (5__2 > 0 && !StartOfRound.Instance.inShipPhase) { <>2__current = (object)new WaitForSecondsRealtime(1f); <>1__state = 1; return true; } ability.ActivateClient(activatorId, false.ToString()); 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__40 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public AbilityBase ability; public ulong activatorId; public bool forever; private PlayerControllerB 5__1; private int 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__40(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; ability.ActivateClient(activatorId, true.ToString()); 5__1 = HideAndSeekGM.instance.GetPlayerWithClientId(activatorId); if (forever) { goto IL_008f; } 5__2 = 30; goto IL_011e; case 1: <>1__state = -1; goto IL_008f; case 2: { <>1__state = -1; 5__2--; if (5__2 == 5) { ability.ActivateClient(activatorId, "Warn"); } goto IL_011e; } IL_008f: if (!5__1.isPlayerDead && !StartOfRound.Instance.inShipPhase) { <>2__current = (object)new WaitForSecondsRealtime(1f); <>1__state = 1; return true; } break; IL_011e: if (5__2 > 0 && !5__1.isPlayerDead && !StartOfRound.Instance.inShipPhase) { <>2__current = (object)new WaitForSecondsRealtime(1f); <>1__state = 2; return true; } break; } ability.ActivateClient(activatorId, false.ToString()); 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__33 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public AbilityBase ability; public ulong activatorId; public string extraMessage; private ulong 5__1; private PlayerControllerB 5__2; private PlayerControllerB 5__3; private PlayerControllerB 5__4; private Vector3 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__33(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; 5__3 = null; 5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Expected O, but got Unknown //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_0426: Unknown result type (might be due to invalid IL or missing references) //IL_0461: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; Debugger.Debug.Log($"[Client] --- Ability Fired by id '{activatorId}' with '{extraMessage}'! ---"); 5__1 = ulong.Parse(extraMessage); 5__2 = GameNetworkManager.Instance.localPlayerController; 5__3 = HideAndSeekGM.instance.GetPlayerWithClientId(activatorId); 5__4 = HideAndSeekGM.instance.GetPlayerWithClientId(5__1); 5__4.beamOutBuildupParticle.Play(); 5__3.beamOutBuildupParticle.Play(); AudioManager.PlaySound("BeamCharging", 1f, 1f, ((Component)5__3).transform.position, 1f, 1f, 50f, -1f, isFullName: false, ((Component)5__3).transform); AudioManager.PlaySound("Spark", 1f, 1f, ((Component)5__3).transform.position, 1f, 1f, 50f, -1f, isFullName: false, ((Component)5__3).transform); AudioManager.PlaySound("BeamCharging", 1f, 1f, ((Component)5__4).transform.position, 1f, 1f, 50f, -1f, isFullName: false, ((Component)5__4).transform); AudioManager.PlaySound("Spark", 1f, 1f, ((Component)5__4).transform.position, 1f, 1f, 50f, -1f, isFullName: false, ((Component)5__4).transform); 5__5 = ((Component)5__3).transform.position; if (5__1 != activatorId) { if (5__2.actualClientId == activatorId) { 5__5 = ((Component)5__4).transform.position; ((Component)5__2).GetComponent().DisplayTip("Switching places with '" + 5__4.playerUsername + "'"); } else if (5__2.actualClientId == 5__1) { 5__5 = ((Component)5__3).transform.position; ((Component)5__2).GetComponent().DisplayTip("'" + 5__3.playerUsername + "' is switching places with you!", warn: true); } } <>2__current = (object)new WaitForSeconds(3f); <>1__state = 1; return true; case 1: <>1__state = -1; if (5__3.isPlayerDead || 5__4.isPlayerDead) { if (5__2.actualClientId == activatorId) { ((Component)5__2).GetComponent().DisplayTip("Failed to switch places with '" + HideAndSeekGM.instance.GetPlayerWithClientId(5__1).playerUsername + "'"); } return false; } if (5__2.actualClientId == activatorId || 5__2.actualClientId == 5__1) { 5__2.TeleportPlayer(5__5, false, 0f, false, true); } 5__3.beamOutParticle.Play(); 5__4.beamOutParticle.Play(); if (5__1 == activatorId) { if (5__2.actualClientId == activatorId) { ability.lastUsed = 0f; ((Component)5__2).GetComponent().DisplayTip("Not enough targets!", warn: true); } } else { AudioManager.PlaySound("Teleported", 1f, 1f, ((Component)5__3).transform.position, 1f, 1f, 20f); AudioManager.PlaySound("Teleported", 1f, 1f, ((Component)5__4).transform.position, 1f, 1f, 20f); } 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__30 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public AbilityBase ability; public ulong activatorId; public string extraMessage; private PlayerControllerB 5__1; private PlayerControllerB 5__2; private Vector3 5__3; private Vector3 5__4; 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() { 5__1 = null; 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Expected O, but got Unknown //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = GameNetworkManager.Instance.localPlayerController; 5__2 = HideAndSeekGM.instance.GetPlayerWithClientId(activatorId); 5__3 = JsonUtility.FromJson(extraMessage.Split("W")[0]); 5__4 = JsonUtility.FromJson(extraMessage.Split("W")[1]); 5__2.beamUpParticle.Play(); AudioManager.PlaySound("BeamCharging", 1f, 1f, 5__3, 1f, 1f, 50f, -1f, isFullName: false, ((Component)5__2).transform); AudioManager.PlaySound("Spark", 1f, 1f, 5__3, 1f, 1f, 50f, -1f, isFullName: false, ((Component)5__2).transform); <>2__current = (object)new WaitForSeconds(3f); <>1__state = 1; return true; case 1: <>1__state = -1; if (5__2.isPlayerDead) { return false; } if (activatorId == 5__1.actualClientId) { 5__1.TeleportPlayer(5__4, false, 0f, false, true); } AudioManager.PlaySound("Teleporting", 1f, 1f, ((Component)5__2).transform.position, 1f, 1f, 50f); AudioManager.PlaySound("Teleported", 1f, 1f, 5__4, 1f, 1f, 50f); 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 static List abilities = new List { new AbilityBase("Money", "Give everyone 9999 money!", "HIDDEN", 0, 0f, _oneTimeUse: false, _seekerAbility: true, _hiderAbility: true, _requriesRoundActive: false, _requiresSeekerActive: false, GiveMoneyServerEvent), new AbilityBase("Remote", "Gives you a remote! Not usefull unless you have you have a mod for it. (External Mod Recommended)", "HIDDEN", 200, 10f, _oneTimeUse: true, _seekerAbility: true, _hiderAbility: true, _requriesRoundActive: true, _requiresSeekerActive: false, SpawnRemoteServerEvent), new AbilityBase("Taunt", "Let out a little somthin!... You might even get a reward!", "Misc", 0, 25f, _oneTimeUse: false, _seekerAbility: false, _hiderAbility: true, _requriesRoundActive: true, _requiresSeekerActive: true, TauntServerEvent, TauntClientEvent), new AbilityBase("Key", "Gives you a key! Usefull for opening doors, or even, locking them... (External Mod Recommended)", "Item", 245, 60f, _oneTimeUse: false, _seekerAbility: true, _hiderAbility: true, _requriesRoundActive: true, _requiresSeekerActive: false, SpawnKeyServerEvent), new AbilityBase("TZP-Inhalant", "Gives you TZP Inhalant! Usefull for gaining some speed and sounding funny.", "Item", 205, 60f, _oneTimeUse: false, _seekerAbility: true, _hiderAbility: true, _requriesRoundActive: true, _requiresSeekerActive: false, SpawnTZPServerEvent), new AbilityBase("Shovel", "Gives you a Shovel! Usefull for possibly killing the seeker! Or just trolling your team mates...", "Item", 495, 10f, _oneTimeUse: true, _seekerAbility: false, _hiderAbility: true, _requriesRoundActive: true, _requiresSeekerActive: false, SpawnShovelServerEvent), new AbilityBase("Stun Grenade", "Gives you a Stun Grenade! Usefull for blinding the seeker for an escape!", "Item", 205, 120f, _oneTimeUse: false, _seekerAbility: false, _hiderAbility: true, _requriesRoundActive: true, _requiresSeekerActive: false, SpawnStunGServerEvent), new AbilityBase("Flashlight", "Lost your flashlight? No worries, have a free flashlight once per round!", "Item", 0, 10f, _oneTimeUse: true, _seekerAbility: true, _hiderAbility: true, _requriesRoundActive: true, _requiresSeekerActive: false, SpawnFlashlightServerEvent), new AbilityBase("Walkie-talkie", "Wanna talk to your teammates? Have a free walkie-talkie once per round!", "Item", 0, 10f, _oneTimeUse: true, _seekerAbility: false, _hiderAbility: true, _requriesRoundActive: true, _requiresSeekerActive: false, SpawnWalkieServerEvent), new AbilityBase("Critical Injury", "Haunts your nearest enemy, and if they don't react in time, their hp will be set to 1! Making them easily susceptible to death.", "Offensive", 200, 120f, _oneTimeUse: false, _seekerAbility: true, _hiderAbility: true, _requriesRoundActive: true, _requiresSeekerActive: true, CriticalInjuryServerEvent, CriticalInjuryClientEvent), new AbilityBase("Teleport", "Teleport yourself to a random location! Good for getting out of sticky situations! WARNING: This ability has a 3 second startup! This means it will take 3 seconds after using the ability for you to get teleported!", "Defensive", 400, 60f, _oneTimeUse: false, _seekerAbility: false, _hiderAbility: true, _requriesRoundActive: true, _requiresSeekerActive: false, TeleportServerEvent, TeleportClientEvent), new AbilityBase("Swap", "Swap locations with a random player! Good for getting a free hiding spot! I think... WARNING: This ability has a 3 second startup! This means it will take 3 seconds after using the ability for you to get teleported!", "Defensive", 450, 60f, _oneTimeUse: false, _seekerAbility: false, _hiderAbility: true, _requriesRoundActive: true, _requiresSeekerActive: true, SwapServerEvent, SwapClientEvent), new AbilityBase("Decoy", "Idk yet...", "HIDDEN", 0, 0f, _oneTimeUse: false, _seekerAbility: true, _hiderAbility: true, _requriesRoundActive: true, _requiresSeekerActive: true, DecoyServerEvent, DecoyClientEvent), new AbilityBase("Stealth", "Sneak past your enemies completely silently for 30 seconds!", "Stealth", 30, 45f, _oneTimeUse: false, _seekerAbility: true, _hiderAbility: true, _requriesRoundActive: true, _requiresSeekerActive: true, StealthServerEvent, StealthClientEvent), new AbilityBase("Long Stealth", "Sneak past your enemies completely silently!", "Stealth", 259, 10f, _oneTimeUse: true, _seekerAbility: true, _hiderAbility: true, _requriesRoundActive: true, _requiresSeekerActive: true, LongStealthServerEvent, StealthClientEvent), new AbilityBase("Invisibility", "Get the ultimate hiding spot in plain sight! Easly trick and sneek around the seeker! Lasts 30 seconds.", "Stealth", 500, 45f, _oneTimeUse: false, _seekerAbility: true, _hiderAbility: true, _requriesRoundActive: true, _requiresSeekerActive: true, InvisibilityServerEvent, InvisibilityClientEvent), new AbilityBase("Spawn Loot Bug", "Spawns a little yippee fren! he will find items and put them right at your feet! What a good boi!", "Spawn", 99, 80f, _oneTimeUse: false, _seekerAbility: true, _hiderAbility: false, _requriesRoundActive: true, _requiresSeekerActive: true, SpawnLootBugServerEvent, SpawnClientEvent), new AbilityBase("Spawn Mimic", "Spawns a mimic to help seek out those pesky hiders and multiply for effectiveness! Don't worry, he won't barf on you though!", "Spawn", 200, 120f, _oneTimeUse: false, _seekerAbility: true, _hiderAbility: false, _requriesRoundActive: true, _requiresSeekerActive: true, SpawnMimicServerEvent, SpawnClientEvent), new AbilityBase("Spawn Thumper", "Spawns a flipin' fast boi to quickly search the building and scare off the hiders! Don't worry, he doesn't bite you!", "Spawn", 500, 120f, _oneTimeUse: false, _seekerAbility: true, _hiderAbility: false, _requriesRoundActive: true, _requiresSeekerActive: true, SpawnThumperServerEvent, SpawnClientEvent), new AbilityBase("Spawn Bracken", "Spawns a bracken to help track those terrible hiders! Don't worry, he won't snap your neck~", "Spawn", 750, 120f, _oneTimeUse: false, _seekerAbility: true, _hiderAbility: false, _requriesRoundActive: true, _requiresSeekerActive: true, SpawnBrackenServerEvent, SpawnClientEvent), new AbilityBase("Spawn Turret", "Catch the hiders off guard with perfect turret placement! for only for two-ninety-nine! Don't worry, it wont shoot you!", "Spawn", 299, 30f, _oneTimeUse: false, _seekerAbility: true, _hiderAbility: false, _requriesRoundActive: true, _requiresSeekerActive: true, SpawnTurretServerEvent, SpawnClientEvent), new AbilityBase("Spawn LandMine", "Make the hiders go off with a BOOM! for only one-oh-nine! Don't worry, it wont detonate from your feet!", "Spawn", 109, 5f, _oneTimeUse: false, _seekerAbility: true, _hiderAbility: false, _requriesRoundActive: true, _requiresSeekerActive: true, SpawnLandmineServerEvent, SpawnClientEvent), new AbilityBase("Heat Seeking", "The ultimate hider seeking device! For only nine-ninety-nine you can pinpoint the location of a random enemy, and get revenge for something they never did! NOTE: Your location will also be revealed to the target!", "Offensive", 999, 10f, _oneTimeUse: true, _seekerAbility: true, _hiderAbility: false, _requriesRoundActive: true, _requiresSeekerActive: true, HeatSeekingServerEvent, HeatSeekingClientEvent) }; public static List abilityConfigs = new List(); public static List objectsToDespawnNextRound = new List(); public static GameObject turretPrefab; public static GameObject landminePrefab; private static List dots = new List(); public const string CFGfNAME = "Abilities.Cfg"; internal static void TemplateServerEvent(AbilityBase ability, ulong activatorId) { Debugger.Debug.Log($"[Server] ------------------ Ability Fired by id '{activatorId}' ------------------"); ability.ActivateClient(activatorId, "Extra Info!!!"); } internal static void TemplateClientEvent(AbilityBase ability, ulong activatorId, string extraMessage = null) { Debugger.Debug.Log($"[Client] --- Ability Fired by id '{activatorId}' with '{extraMessage}'! ---"); } private static void GiveMoneyServerEvent(AbilityBase ability, ulong activatorId) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) foreach (PlayerControllerB allConnectedPlayer in HideAndSeekGM.GetAllConnectedPlayers("GiveMoneyServerEvent")) { NetworkHandler.Instance.EventSendRpc(".moneyChanged", new MessageProperties(__bool: false, "", 9999, 0f, allConnectedPlayer.actualClientId)); } } private static void CriticalInjuryServerEvent(AbilityBase ability, ulong activatorId) { //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_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) PlayerControllerB playerWithClientId = HideAndSeekGM.instance.GetPlayerWithClientId(activatorId); ulong num = 10001uL; float num2 = 10000f; foreach (PlayerControllerB allConnectedPlayer in HideAndSeekGM.GetAllConnectedPlayers("CriticalInguryServerEvent")) { if (!allConnectedPlayer.isPlayerDead && HideAndSeekGM.instance.seekers.Contains(allConnectedPlayer) != HideAndSeekGM.instance.seekers.Contains(playerWithClientId) && (!HideAndSeekGM.instance.seekers.Contains(playerWithClientId) || !HideAndSeekGM.instance.zombies.Contains(allConnectedPlayer))) { Vector3 val = ((Component)allConnectedPlayer).transform.position - ((Component)playerWithClientId).transform.position; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude < num2) { num = allConnectedPlayer.actualClientId; num2 = magnitude; } } } if (num == 10001) { num = HideAndSeekGM.instance.GetPlayerWithClientId(activatorId).actualClientId; Debugger.Debug.LogError("CriticalInjuryServerEvent(): Could not find player target!"); } ability.ActivateClient(activatorId, num.ToString()); } private static void CriticalInjuryClientEvent(AbilityBase ability, ulong activatorId, string extraMessage) { if (GameNetworkManager.Instance.localPlayerController.actualClientId == ulong.Parse(extraMessage)) { ((MonoBehaviour)GameNetworkManager.Instance).StartCoroutine(CriticalInjuryClientEventC(ability, activatorId)); } } [IteratorStateMachine(typeof(d__7))] private static IEnumerator CriticalInjuryClientEventC(AbilityBase ability, ulong activatorId) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(0) { ability = ability, activatorId = activatorId }; } private static void TauntServerEvent(AbilityBase ability, ulong activatorId) { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_0139: 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) PlayerControllerB playerWithClientId = HideAndSeekGM.instance.GetPlayerWithClientId(activatorId); AbilityInstance component = ((Component)playerWithClientId).GetComponent(); int num = Random.Range(1, 100); float random = Random.Range(0f, 1f); AudioClip sound; if (num < 5) { sound = AudioManager.GetSound("MegaBoi", fullName: false, random); Debugger.Debug.LogMessage($"Got a total of {Mathf.RoundToInt(25f * sound.length)}$ from using taunt {((Object)sound).name}"); NetworkHandler instance = NetworkHandler.Instance; ulong _ulong = activatorId; instance.EventSendRpc(".moneyChanged", new MessageProperties(__bool: false, "silent", Mathf.RoundToInt(25f * sound.length), 0f, _ulong)); } else if (num < 12) { sound = AudioManager.GetSound("BigBoi", fullName: false, random); Debugger.Debug.LogMessage($"Got a total of {Mathf.RoundToInt(12f * sound.length)}$ from using taunt {((Object)sound).name}"); NetworkHandler instance2 = NetworkHandler.Instance; ulong _ulong = activatorId; instance2.EventSendRpc(".moneyChanged", new MessageProperties(__bool: false, "silent", Mathf.RoundToInt(12f * sound.length), 0f, _ulong)); } else { sound = AudioManager.GetSound("Taunt", fullName: false, random); Debugger.Debug.LogMessage($"Got a total of {Mathf.RoundToInt(5f * sound.length)}$ from using taunt {((Object)sound).name}"); NetworkHandler instance3 = NetworkHandler.Instance; ulong _ulong = activatorId; instance3.EventSendRpc(".moneyChanged", new MessageProperties(__bool: false, "silent", Mathf.RoundToInt(5f * sound.length), 0f, _ulong)); } ability.ActivateClient(activatorId, ((Object)sound).name); } private static void TauntClientEvent(AbilityBase ability, ulong activatorId, string extraMessage = null) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) bool flag = activatorId == GameNetworkManager.Instance.localPlayerController.actualClientId; AbilityInstance component = ((Component)GameNetworkManager.Instance.localPlayerController).GetComponent(); Vector3 position = ((Component)HideAndSeekGM.instance.GetPlayerWithClientId(activatorId)).transform.position; if (extraMessage.Contains("MegaBoi")) { AudioManager.PlaySound(extraMessage, 1f, 1f, position, 1f, 20f, 800f, -1f, isFullName: true); if (flag) { component.DisplayTip("You let out a massiv boi!", warn: true); } } else if (extraMessage.Contains("BigBoi")) { AudioManager.PlaySound(extraMessage, 1f, 1f, position, 1f, 12f, 400f, -1f, isFullName: true); if (flag) { component.DisplayTip("You let out a big boi!"); } } else { AudioManager.PlaySound(extraMessage, 1f, 1f, position, 1f, 5f, 200f, -1f, isFullName: true); if (flag) { component.DisplayTip("You let out a lil boi."); } } } private static void SpawnKeyServerEvent(AbilityBase ability, ulong activatorId) { HideAndSeekGM.instance.SpawnNewItem("Key", HideAndSeekGM.instance.GetPlayerWithClientId(activatorId), forceSamePosition: true); } private static void SpawnTZPServerEvent(AbilityBase ability, ulong activatorId) { HideAndSeekGM.instance.SpawnNewItem("TZP-Inhalant", HideAndSeekGM.instance.GetPlayerWithClientId(activatorId), forceSamePosition: true); } private static void SpawnFlashlightServerEvent(AbilityBase ability, ulong activatorId) { HideAndSeekGM.instance.SpawnNewItem("Flashlight", HideAndSeekGM.instance.GetPlayerWithClientId(activatorId), forceSamePosition: true); } private static void SpawnWalkieServerEvent(AbilityBase ability, ulong activatorId) { HideAndSeekGM.instance.SpawnNewItem("Walkie-talkie", HideAndSeekGM.instance.GetPlayerWithClientId(activatorId), forceSamePosition: true); } private static void SpawnShovelServerEvent(AbilityBase ability, ulong activatorId) { HideAndSeekGM.instance.SpawnNewItem("Shovel", HideAndSeekGM.instance.GetPlayerWithClientId(activatorId), forceSamePosition: true); } private static void SpawnStunGServerEvent(AbilityBase ability, ulong activatorId) { HideAndSeekGM.instance.SpawnNewItem("Stun grenade", HideAndSeekGM.instance.GetPlayerWithClientId(activatorId), forceSamePosition: true); } private static void SpawnRemoteServerEvent(AbilityBase ability, ulong activatorId) { HideAndSeekGM.instance.SpawnNewItem("Remote", HideAndSeekGM.instance.GetPlayerWithClientId(activatorId), forceSamePosition: true); } private static void SpawnLootBugServerEvent(AbilityBase ability, ulong activatorId) { SpawnInsideMonster(ability, activatorId, "Hoarding bug"); } private static void SpawnMimicServerEvent(AbilityBase ability, ulong activatorId) { SpawnInsideMonster(ability, activatorId, "Masked"); } private static void SpawnBrackenServerEvent(AbilityBase ability, ulong activatorId) { SpawnInsideMonster(ability, activatorId, "Flowerman"); } private static void SpawnThumperServerEvent(AbilityBase ability, ulong activatorId) { SpawnInsideMonster(ability, activatorId, "Crawler"); } private static void SpawnTurretServerEvent(AbilityBase ability, ulong activatorId) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //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) Transform transform = ((Component)HideAndSeekGM.instance.GetPlayerWithClientId(activatorId)).transform; Vector3 val = transform.position + transform.forward * 1.3f; if (!Object.op_Implicit((Object)(object)turretPrefab)) { if (!Object.op_Implicit((Object)(object)HideAndSeekGM.instance.currentLevel)) { Debugger.Debug.LogError("No current level loaded!"); return; } SpawnableMapObject[] spawnableMapObjects = HideAndSeekGM.instance.currentLevel.spawnableMapObjects; foreach (SpawnableMapObject val2 in spawnableMapObjects) { if ((Object)(object)val2.prefabToSpawn.GetComponentInChildren() != (Object)null) { turretPrefab = val2.prefabToSpawn; } } } if (!Object.op_Implicit((Object)(object)turretPrefab)) { Debugger.Debug.LogError("Could not get turret prefab!"); NetworkHandler.Instance.EventSendRpc(".moneyChanged", new MessageProperties(__bool: false, "silent", ability.abilityCost, 0f, 0uL)); NetworkHandler.Instance.EventSendRpc(".tip", new MessageProperties(__bool: true, "Could not get turret prefab! Play a map with a turret first!", -1, 0f, activatorId)); } else { GameObject val3 = Object.Instantiate(turretPrefab, val, transform.rotation); NetworkObject component = val3.GetComponent(); component.Spawn(true); objectsToDespawnNextRound.Add(component); ability.ActivateClient(activatorId, $"Turret~{JsonUtility.ToJson((object)val)}~{component.NetworkObjectId}"); } } private static void SpawnLandmineServerEvent(AbilityBase ability, ulong activatorId) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //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) Transform transform = ((Component)HideAndSeekGM.instance.GetPlayerWithClientId(activatorId)).transform; Vector3 val = transform.position + transform.forward * 1.3f; if (!Object.op_Implicit((Object)(object)landminePrefab)) { if (!Object.op_Implicit((Object)(object)HideAndSeekGM.instance.currentLevel)) { Debugger.Debug.LogError("No current level loaded!"); return; } SpawnableMapObject[] spawnableMapObjects = HideAndSeekGM.instance.currentLevel.spawnableMapObjects; foreach (SpawnableMapObject val2 in spawnableMapObjects) { if ((Object)(object)val2.prefabToSpawn.GetComponentInChildren() != (Object)null) { landminePrefab = val2.prefabToSpawn; } } } if (!Object.op_Implicit((Object)(object)landminePrefab)) { Debugger.Debug.LogError("Could not get landmine prefab!"); NetworkHandler.Instance.EventSendRpc(".moneyChanged", new MessageProperties(__bool: false, "silent", ability.abilityCost, 0f, 0uL)); NetworkHandler.Instance.EventSendRpc(".tip", new MessageProperties(__bool: true, "Could not get landmine prefab! Play a map with a landmine first!", -1, 0f, activatorId)); } else { GameObject val3 = Object.Instantiate(landminePrefab, val, transform.rotation); NetworkObject component = val3.GetComponent(); component.Spawn(true); objectsToDespawnNextRound.Add(component); ability.ActivateClient(activatorId, $"Landmine~{JsonUtility.ToJson((object)val)}~{component.NetworkObjectId}"); } } private static void SpawnInsideMonster(AbilityBase ability, ulong activatorId, string monsterName) { //IL_000f: 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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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) PlayerControllerB playerWithClientId = HideAndSeekGM.instance.GetPlayerWithClientId(activatorId); Vector3 val = default(Vector3); int num = Random.RandomRangeInt(0, RoundManager.Instance.insideAINodes.Length - 1); val = RoundManager.Instance.insideAINodes[num].transform.position; EnemyType val2 = null; EnemyType[] array = Resources.FindObjectsOfTypeAll(); foreach (EnemyType val3 in array) { if (val3.enemyName == monsterName) { val2 = val3; break; } } if ((Object)(object)val2 == (Object)null) { Debugger.Debug.LogError("Could not find " + monsterName + " for some reason? Enemy list = '" + JsonUtility.ToJson((object)Resources.FindObjectsOfTypeAll()) + "'"); } val = ((Component)playerWithClientId).transform.position + ((Component)playerWithClientId).transform.forward * 3f; NetworkObject val4 = NetworkObjectReference.op_Implicit(RoundManager.Instance.SpawnEnemyGameObject(val, 0f, -1, val2)); RoundManager.Instance.SpawnMapObjects(); ability.ActivateClient(activatorId, $"{monsterName}~{JsonUtility.ToJson((object)val)}~{val4.NetworkObjectId}"); } private static void SpawnClientEvent(AbilityBase ability, ulong activatorId, string extraMessage = null) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) AudioManager.PlaySound("Teleported", 1f, 1f, JsonUtility.FromJson(extraMessage.Split("~")[1]), 1f, 1f, 50f); PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; PlayerControllerB playerWithClientId = HideAndSeekGM.instance.GetPlayerWithClientId(activatorId); bool flag = HideAndSeekGM.instance.seekers.Contains(playerWithClientId); if (localPlayerController.actualClientId == activatorId) { ((Component)localPlayerController).GetComponent().DisplayTip("A " + extraMessage.Split("~")[0] + " has been spawned!"); } bool flag2 = false; if (extraMessage.Split("~").Length < 3) { Debugger.Debug.LogError("SpawnClientEvent(): '" + extraMessage.Split('~')[0] + "' Did not send network object id!"); return; } NetworkObject[] array = Object.FindObjectsOfType(); foreach (NetworkObject val in array) { if (val.NetworkObjectId != ulong.Parse(extraMessage.Split("~")[2])) { continue; } SpawnAbilityInfo spawnAbilityInfo = ((Component)val).gameObject.AddComponent(); spawnAbilityInfo.creatorPlayer = playerWithClientId; if (flag) { spawnAbilityInfo.otherFriendlies = HideAndSeekGM.instance.seekers; foreach (PlayerControllerB zombie in HideAndSeekGM.instance.zombies) { spawnAbilityInfo.otherFriendlies.Add(zombie); } } else { spawnAbilityInfo.otherFriendlies = new List(); foreach (PlayerControllerB allConnectedPlayer in HideAndSeekGM.GetAllConnectedPlayers("Get Other Friendlies")) { if (!HideAndSeekGM.instance.seekers.Contains(allConnectedPlayer) && !HideAndSeekGM.instance.zombies.Contains(allConnectedPlayer)) { spawnAbilityInfo.otherFriendlies.Add(allConnectedPlayer); } } } flag2 = true; break; } if (flag2) { Debugger.Debug.LogMessage("SpawnClientEvent(): '" + extraMessage.Split('~')[0] + "' Got Spawn Info!"); } else { Debugger.Debug.LogError("SpawnClientEvent(): '" + extraMessage.Split('~')[0] + "' Could not find network object! id = " + extraMessage.Split('~')[2]); } } private static void TeleportServerEvent(AbilityBase ability, ulong activatorId) { //IL_000f: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB playerWithClientId = HideAndSeekGM.instance.GetPlayerWithClientId(activatorId); Vector3 val = default(Vector3); int num = Random.RandomRangeInt(0, RoundManager.Instance.insideAINodes.Length - 1); val = RoundManager.Instance.insideAINodes[num].transform.position; ability.ActivateClient(activatorId, JsonUtility.ToJson((object)((Component)playerWithClientId).transform.position) + "W" + JsonUtility.ToJson((object)val)); } private static void TeleportClientEvent(AbilityBase ability, ulong activatorId, string extraMessage = null) { ((MonoBehaviour)GameNetworkManager.Instance).StartCoroutine(TeleportClientEventC(ability, activatorId, extraMessage)); } [IteratorStateMachine(typeof(d__30))] private static IEnumerator TeleportClientEventC(AbilityBase ability, ulong activatorId, string extraMessage = null) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__30(0) { ability = ability, activatorId = activatorId, extraMessage = extraMessage }; } private static void SwapServerEvent(AbilityBase ability, ulong activatorId) { //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) Debugger.Debug.Log($"[Server] ------------------ Ability Fired by id '{activatorId}' ------------------"); ulong num = 10001uL; List list = new List(); foreach (PlayerControllerB allConnectedPlayer in HideAndSeekGM.GetAllConnectedPlayers("SwapServerEvent")) { if (!allConnectedPlayer.isPlayerDead && allConnectedPlayer.actualClientId != activatorId) { list.Add(allConnectedPlayer.actualClientId); } } if (list.Count > 0) { int index = Random.RandomRangeInt(0, list.Count); num = list[index]; } Debugger.Debug.LogError($"Possible Players = {JsonUtility.ToJson((object)list)}; player chosen = {num}"); if (num == 10001 || num == activatorId) { Debugger.Debug.LogError("Not enough players to teleport! Teleporting to self..."); num = activatorId; if (ability.abilityCost != 0) { NetworkHandler.Instance.EventSendRpc(".moneyChanged", new MessageProperties(__bool: false, "silent", ability.abilityCost, 0f, activatorId)); } } ability.ActivateClient(activatorId, num.ToString()); } private static void SwapClientEvent(AbilityBase ability, ulong activatorId, string extraMessage = null) { ((MonoBehaviour)GameNetworkManager.Instance).StartCoroutine(SwapClientEventC(ability, activatorId, extraMessage)); } [IteratorStateMachine(typeof(d__33))] private static IEnumerator SwapClientEventC(AbilityBase ability, ulong activatorId, string extraMessage = null) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__33(0) { ability = ability, activatorId = activatorId, extraMessage = extraMessage }; } private static void HeatSeekingServerEvent(AbilityBase ability, ulong activatorId) { ((MonoBehaviour)GameNetworkManager.Instance).StartCoroutine(HeatSeekingServerEventCoroutine(ability, activatorId)); } [IteratorStateMachine(typeof(d__35))] private static IEnumerator HeatSeekingServerEventCoroutine(AbilityBase ability, ulong activatorId) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__35(0) { ability = ability, activatorId = activatorId }; } private static void HeatSeekingClientEvent(AbilityBase ability, ulong activatorId, string extraMessage = null) { //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_019d: 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_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; PlayerControllerB playerWithClientId = HideAndSeekGM.instance.GetPlayerWithClientId(activatorId); AbilityInstance component = ((Component)localPlayerController).GetComponent(); if (extraMessage == "CLEAN" || localPlayerController.isPlayerDead) { foreach (SeekerDotVisuals dot in dots) { Object.Destroy((Object)(object)((Component)dot).gameObject); } dots.Clear(); if (localPlayerController.actualClientId == activatorId) { component.DisplayTip("Target(s) eliminated! Disengaging...", warn: true); } return; } if (dots.Count == 0 && extraMessage.Split(":")[0] == "TG") { ulong num = ulong.Parse(extraMessage.Split(":")[1]); if (localPlayerController.actualClientId == activatorId) { SeekerDotVisuals seekerDotVisuals = new GameObject().AddComponent(); foreach (PlayerControllerB allConnectedPlayer in HideAndSeekGM.GetAllConnectedPlayers("Find Heat Seeking Dots")) { if (allConnectedPlayer.actualClientId == num) { ((Object)((Component)seekerDotVisuals).gameObject).name = allConnectedPlayer.playerUsername; seekerDotVisuals.targetedPlayer = allConnectedPlayer; } } dots.Add(seekerDotVisuals); } else if (localPlayerController.actualClientId == num) { dots.Add(new GameObject().AddComponent()); ((Object)((Component)dots[0]).gameObject).name = playerWithClientId.playerUsername; dots[0].targetedPlayer = playerWithClientId; component.DisplayTip("You're getting tracked by '" + playerWithClientId.playerUsername + "'", warn: true); } } SeekerDotVisuals[] array = dots.ToArray(); foreach (SeekerDotVisuals seekerDotVisuals2 in array) { if (seekerDotVisuals2.targetedPlayer.isPlayerDead) { dots.Remove(seekerDotVisuals2); Object.Destroy((Object)(object)((Component)seekerDotVisuals2).gameObject); } else { seekerDotVisuals2.targetPosition = ((Component)seekerDotVisuals2.targetedPlayer).transform.position + Vector3.up * 1.5f; } } if (localPlayerController.actualClientId == activatorId && dots.Count > 0) { component.DisplayTip("Updating Tracking..."); } } private static void LongStealthServerEvent(AbilityBase ability, ulong activatorId) { //IL_003d: 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) PlayerControllerB playerWithClientId = HideAndSeekGM.instance.GetPlayerWithClientId(activatorId); AbilityInstance component = ((Component)playerWithClientId).GetComponent(); if (component.stealthActivated) { NetworkHandler.Instance.EventSendRpc(".moneyChanged", new MessageProperties(__bool: false, "silent", ability.abilityCost, 0f, activatorId)); ability.ActivateClient(activatorId, "Cancel"); } else { ((MonoBehaviour)GameNetworkManager.Instance).StartCoroutine(StealthServerEventCoroutine(ability, activatorId, forever: true)); } } private static void StealthServerEvent(AbilityBase ability, ulong activatorId) { //IL_003d: 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) PlayerControllerB playerWithClientId = HideAndSeekGM.instance.GetPlayerWithClientId(activatorId); AbilityInstance component = ((Component)playerWithClientId).GetComponent(); if (component.stealthActivated) { NetworkHandler.Instance.EventSendRpc(".moneyChanged", new MessageProperties(__bool: false, "silent", ability.abilityCost, 0f, activatorId)); ability.ActivateClient(activatorId, "Cancel"); } else { ((MonoBehaviour)GameNetworkManager.Instance).StartCoroutine(StealthServerEventCoroutine(ability, activatorId)); } } [IteratorStateMachine(typeof(d__40))] private static IEnumerator StealthServerEventCoroutine(AbilityBase ability, ulong activatorId, bool forever = false) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__40(0) { ability = ability, activatorId = activatorId, forever = forever }; } private static void StealthClientEvent(AbilityBase ability, ulong activatorId, string extraMessage = null) { PlayerControllerB playerWithClientId = HideAndSeekGM.instance.GetPlayerWithClientId(activatorId); AbilityInstance abilityInstance = ((Component)playerWithClientId).GetComponent(); if ((Object)(object)abilityInstance == (Object)null) { abilityInstance = ((Component)playerWithClientId).gameObject.AddComponent(); } bool flag = (Object)(object)playerWithClientId == (Object)(object)GameNetworkManager.Instance.localPlayerController; if (extraMessage == "Cancel") { if (flag) { FindAbilityByName(ability.abilityName).usedThisRound = false; } return; } if (extraMessage == "Warn") { if (flag) { abilityInstance.DisplayTip("Stealth: 5 Seconds left!", warn: true); } return; } abilityInstance.stealthActivated = bool.Parse(extraMessage); if (flag) { if (bool.Parse(extraMessage)) { abilityInstance.DisplayTip("Stealth: Activated stelth!"); } else { abilityInstance.DisplayTip("Stealth: Ability expired!"); } } } private static void InvisibilityServerEvent(AbilityBase ability, ulong activatorId) { ((MonoBehaviour)GameNetworkManager.Instance).StartCoroutine(InvisibilityServerEventCoroutine(ability, activatorId)); } [IteratorStateMachine(typeof(d__43))] private static IEnumerator InvisibilityServerEventCoroutine(AbilityBase ability, ulong activatorId) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__43(0) { ability = ability, activatorId = activatorId }; } private static void InvisibilityClientEvent(AbilityBase ability, ulong activatorId, string extraMessage = null) { PlayerControllerB playerWithClientId = HideAndSeekGM.instance.GetPlayerWithClientId(activatorId); AbilityInstance abilityInstance = ((Component)playerWithClientId).GetComponent(); if ((Object)(object)abilityInstance == (Object)null) { abilityInstance = ((Component)playerWithClientId).gameObject.AddComponent(); } bool flag = (Object)(object)playerWithClientId == (Object)(object)GameNetworkManager.Instance.localPlayerController; if (extraMessage == "Warn") { if (flag) { abilityInstance.DisplayTip("Invisibility: 5 Seconds left!", warn: true); } return; } if (bool.Parse(extraMessage)) { abilityInstance.invisibilityActivated = true; GrabbableObject[] array = Object.FindObjectsOfType(); foreach (GrabbableObject val in array) { if (((NetworkBehaviour)val).OwnerClientId == activatorId && Object.op_Implicit((Object)(object)val.mainObjectRenderer)) { ((Component)val.mainObjectRenderer).gameObject.SetActive(false); } } Canvas componentInChildren = ((Component)playerWithClientId).gameObject.GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren)) { ((Behaviour)componentInChildren).enabled = false; } if (flag) { ((Renderer)playerWithClientId.thisPlayerModelArms).enabled = false; abilityInstance.DisplayTip("Invisibility: Activated Invisibility!"); return; } SkinnedMeshRenderer[] componentsInChildren = ((Component)playerWithClientId).gameObject.GetComponentsInChildren(); foreach (SkinnedMeshRenderer val2 in componentsInChildren) { ((Renderer)val2).enabled = false; } MeshRenderer[] componentsInChildren2 = ((Component)playerWithClientId).gameObject.GetComponentsInChildren(); foreach (MeshRenderer val3 in componentsInChildren2) { ((Renderer)val3).enabled = false; } return; } abilityInstance.invisibilityActivated = false; GrabbableObject[] array2 = Object.FindObjectsOfType(); foreach (GrabbableObject val4 in array2) { if (((NetworkBehaviour)val4).OwnerClientId == activatorId && Object.op_Implicit((Object)(object)val4.mainObjectRenderer)) { ((Component)val4.mainObjectRenderer).gameObject.SetActive(true); } } Canvas componentInChildren2 = ((Component)playerWithClientId).gameObject.GetComponentInChildren(); if (Object.op_Implicit((Object)(object)componentInChildren2)) { ((Behaviour)componentInChildren2).enabled = true; } if (flag) { ((Renderer)playerWithClientId.thisPlayerModelArms).enabled = true; abilityInstance.DisplayTip("Invisibility: Ability expired!"); return; } SkinnedMeshRenderer[] componentsInChildren3 = ((Component)playerWithClientId).gameObject.GetComponentsInChildren(); foreach (SkinnedMeshRenderer val5 in componentsInChildren3) { ((Renderer)val5).enabled = true; } MeshRenderer[] componentsInChildren4 = ((Component)playerWithClientId).gameObject.GetComponentsInChildren(); foreach (MeshRenderer val6 in componentsInChildren4) { if (!(((Object)((Component)val6).gameObject).name == "PlayerPhysicsBox")) { ((Renderer)val6).enabled = true; } } ((Renderer)playerWithClientId.thisPlayerModelArms).enabled = false; } private static void DecoyServerEvent(AbilityBase ability, ulong activatorId) { ability.ActivateClient(activatorId); } private static void DecoyClientEvent(AbilityBase ability, ulong activatorId, string extraMessage = null) { PlayerControllerB playerWithClientId = HideAndSeekGM.instance.GetPlayerWithClientId(activatorId); GameObject val = Object.Instantiate(((Component)playerWithClientId).gameObject); PlayerControllerB component = val.GetComponent(); val.tag = "Decoy"; ((Renderer)component.thisPlayerModel).enabled = true; Transform obj = val.transform.Find("EmoteCameraPivot"); if (obj != null) { ((Component)obj).gameObject.SetActive(false); } ((Behaviour)val.GetComponent()).enabled = false; if ((Object)(object)val.GetComponent() != (Object)null) { Object.Destroy((Object)(object)val.GetComponent()); } Debugger.Debug.LogError("Clone Spawned!"); } public static AbilityBase FindAbilityByName(string name, bool raw = false) { AbilityBase abilityBase = null; foreach (AbilityBase ability in abilities) { if (ability.abilityName.Equals(name, StringComparison.CurrentCultureIgnoreCase)) { abilityBase = ability; break; } } if (abilityBase == null) { Debugger.Debug.LogWarning("FindAbilityByName:'" + name + "' Could not find ability!"); } else if (!raw) { AbilityConfig abilityConfig = FindAbilityConfigByName(name); if (abilityConfig != null && (abilityConfig.syncedWithHost || GameNetworkManager.Instance.isHostingGame)) { abilityBase = ApplyCfgToAbility(abilityBase, abilityConfig); } } return abilityBase; } public static AbilityConfig FindAbilityConfigByName(string name, bool check = false) { //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) AbilityConfig abilityConfig = null; AbilityBase abilityBase = FindAbilityByName(name, raw: true); if (abilityBase == null) { return null; } foreach (AbilityConfig abilityConfig2 in abilityConfigs) { if (abilityConfig2.abilityName.Equals(name.Trim(), StringComparison.CurrentCultureIgnoreCase)) { abilityConfig = abilityConfig2; break; } } if (abilityConfig == null) { Debugger.Debug.LogWarning("FindAbilityConfigByName:'" + name + "' Could not find ability config!!"); if (GameNetworkManager.Instance.isHostingGame && !check) { abilityConfigs.Add(AbilityToCfg(abilityBase)); } if (!GameNetworkManager.Instance.isHostingGame && (Object)(object)GameNetworkManager.Instance?.localPlayerController != (Object)null && !check) { Debugger.Debug.LogMessage("Attempting request..."); NetworkHandler instance = NetworkHandler.Instance; ulong actualClientId = GameNetworkManager.Instance.localPlayerController.actualClientId; instance.EventSendRpc(".requestAbilityConfig", new MessageProperties(__bool: false, name, 0, 0f, actualClientId)); } } return abilityConfig; } public static bool AbilityExists(string name) { foreach (AbilityBase ability in abilities) { if (ability.abilityName.Equals(name, StringComparison.CurrentCultureIgnoreCase)) { return true; } } return false; } public static bool AbilityConfigExists(string name) { foreach (AbilityConfig abilityConfig in abilityConfigs) { if (abilityConfig.abilityName.Equals(name, StringComparison.CurrentCultureIgnoreCase)) { return true; } } return false; } public static void LoadAbilityConfig(AbilityConfig cfg) { if (cfg == null) { return; } AbilityConfig[] array = abilityConfigs.ToArray(); foreach (AbilityConfig abilityConfig in array) { if (abilityConfig.abilityName.Equals(cfg.abilityName, StringComparison.CurrentCultureIgnoreCase)) { abilityConfigs.Remove(abilityConfig); } } cfg.syncedWithHost = true; abilityConfigs.Add(cfg); } public static void AbilitiesToCfg() { abilityConfigs = new List(); foreach (AbilityBase ability in abilities) { if (ability.abilityCategory != "HIDDEN") { abilityConfigs.Add(AbilityToCfg(ability)); } } } public static AbilityConfig AbilityToCfg(AbilityBase ability) { return new AbilityConfig(ability.abilityName, ability.abilityCost, ability.abilityDelay, ability.oneTimeUse, ability.seekerAbility, ability.hiderAbility, ability.requiresRoundActive, ability.requiresSeekerActive); } public static AbilityBase ApplyCfgToAbility(AbilityBase ability, AbilityConfig cfg) { ability.abilityCost = cfg.abilityCost; ability.abilityDelay = cfg.abilityDelay; ability.oneTimeUse = cfg.oneTimeUse; ability.seekerAbility = cfg.seekerAbility; ability.hiderAbility = cfg.hiderAbility; ability.requiresRoundActive = cfg.requiresRoundActive; ability.requiresSeekerActive = cfg.requiresSeekerActive; return ability; } public static string AbilityCfgToData(AbilityConfig aCfg, bool format = true) { string empty = string.Empty; if (format) { return empty + aCfg.abilityName + " {\r\n" + string.Format("\t{0} = {1};\r\n", "abilityCost", aCfg.abilityCost) + string.Format("\t{0} = {1};\r\n", "seekerAbility", aCfg.seekerAbility) + string.Format("\t{0} = {1};\r\n", "hiderAbility", aCfg.hiderAbility) + string.Format("\t{0} = {1};\r\n", "requiresRoundActive", aCfg.requiresRoundActive) + string.Format("\t{0} = {1};\r\n", "requiresSeekerActive", aCfg.requiresSeekerActive) + string.Format("\t{0} = {1};\r\n", "abilityDelay", aCfg.abilityDelay) + string.Format("\t{0} = {1};\r\n", "oneTimeUse", aCfg.oneTimeUse) + "}"; } return empty + aCfg.abilityName + "{" + string.Format("{0}={1};", "abilityCost", aCfg.abilityCost) + string.Format("{0}={1};", "seekerAbility", aCfg.seekerAbility) + string.Format("{0}={1};", "hiderAbility", aCfg.hiderAbility) + string.Format("{0}={1};", "requiresRoundActive", aCfg.requiresRoundActive) + string.Format("{0}={1};", "requiresSeekerActive", aCfg.requiresSeekerActive) + string.Format("{0}={1};", "abilityDelay", aCfg.abilityDelay) + string.Format("{0}={1};", "oneTimeUse", aCfg.oneTimeUse) + "}"; } public static string AbilityCfgsToData(bool format = true) { if (abilityConfigs.Count <= 0) { Debugger.Debug.LogError("Tried to ACfgToData but there is no ability config data!"); return null; } string text = string.Empty; foreach (AbilityConfig abilityConfig in abilityConfigs) { if (text != string.Empty && format) { text += "\r\n"; } text += AbilityCfgToData(abilityConfig, format); } return text; } public static AbilityConfig ADataToCfg(string d) { string[] array = d.Split("{"); string name = array[0].Trim(); string text = array[1]; AbilityConfig abilityConfig = AbilityToCfg(FindAbilityByName(name, raw: true)); string[] array2 = text.Replace("}", "").Split(";"); foreach (string text2 in array2) { if (!string.IsNullOrEmpty(text2)) { string text3 = text2.Split("=")[0].Trim(); string text4 = text2.Split("=")[1].Trim(); switch (text3) { case "abilityCost": abilityConfig.abilityCost = int.Parse(text4); break; case "seekerAbility": abilityConfig.seekerAbility = bool.Parse(text4); break; case "hiderAbility": abilityConfig.hiderAbility = bool.Parse(text4); break; case "requiresRoundActive": abilityConfig.requiresRoundActive = bool.Parse(text4); break; case "requiresSeekerActive": abilityConfig.requiresSeekerActive = bool.Parse(text4); break; case "abilityDelay": abilityConfig.abilityDelay = float.Parse(text4); break; case "oneTimeUse": abilityConfig.oneTimeUse = bool.Parse(text4); break; default: Debugger.Debug.LogError("Could not read " + text3 + "!"); break; } } } return abilityConfig; } public static List ADataToCfgs(string data) { List list = new List(); string[] array = data.Replace("\t", "").Replace("\r\n", "").Split('}'); foreach (string text in array) { if (!string.IsNullOrEmpty(text)) { AbilityConfig item = ADataToCfg(text); list.Add(item); } } return list; } public static void ReadConfigFile() { //IL_013b: 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) if (GameNetworkManager.Instance.isHostingGame) { string directoryName = Path.GetDirectoryName(((BaseUnityPlugin)Plugin.instance).Info.Location); string text = Path.Combine(directoryName, "Abilities.Cfg"); if (File.Exists(text)) { string text2 = File.ReadAllText(text); string text3 = text2.Split("]")[0].Replace("[v", ""); Debugger.Debug.LogMessage("Found File! " + text3); if (text3 != "1.5.0.0") { Debugger.Debug.LogError("Config file version does not match the current version! cfg = 'v" + text3 + "' plugin = 'v1.5.0.0' Making backup..."); File.Move(text, Path.Combine(directoryName, "v" + text3 + " - Abilities.Cfg")); ReadConfigFile(); } else { abilityConfigs = ADataToCfgs(text2.Split("]")[1]); } } else { AbilitiesToCfg(); string contents = "[v1.5.0.0]\r\n" + AbilityCfgsToData(); File.WriteAllText(text, contents); } } else { NetworkHandler.Instance.EventSendRpc(".requestAbilityConfig", new MessageProperties(__bool: false, "", 0, 0f, GameNetworkManager.Instance.localPlayerController.actualClientId)); } } public static void WriteConfigFile() { if (GameNetworkManager.Instance.isHostingGame) { string directoryName = Path.GetDirectoryName(((BaseUnityPlugin)Plugin.instance).Info.Location); string path = Path.Combine(directoryName, "Abilities.Cfg"); File.WriteAllText(path, AbilityCfgsToData()); } else { Debugger.Debug.LogWarning("Canceled writing config file because is not host!"); } } } public class AbilityBase { public string abilityName = "genericNull"; public string abilityDescription = "genericNullDescription"; public int abilityCost = 10; public string abilityCategory = "Misc"; public bool seekerAbility = true; public bool hiderAbility = true; public bool requiresRoundActive = true; public bool requiresSeekerActive = true; public float abilityDelay = 10f; public bool oneTimeUse = false; public int timesUsed = 0; public bool usedThisRound = false; public Action serverEvent = null; public Action clientEvent = null; public float lastUsed = -9999f; public AbilityBase(string _abilityName = "genericNull", string _abilityDescription = "genericNullDescription", string _abilityCategory = "Misc", int _abilityCost = 10, float _abilityDelay = 10f, bool _oneTimeUse = false, bool _seekerAbility = true, bool _hiderAbility = true, bool _requriesRoundActive = true, bool _requiresSeekerActive = true, Action _serverEvent = null, Action _clientEvent = null) { abilityName = _abilityName; abilityDescription = _abilityDescription; abilityCost = _abilityCost; abilityCategory = _abilityCategory; seekerAbility = _seekerAbility; hiderAbility = _hiderAbility; requiresRoundActive = _requriesRoundActive; requiresSeekerActive = _requiresSeekerActive; abilityDelay = _abilityDelay; oneTimeUse = _oneTimeUse; if (_serverEvent != null) { serverEvent = _serverEvent; } else { serverEvent = Abilities.TemplateServerEvent; } if (_clientEvent != null) { clientEvent = _clientEvent; } else { clientEvent = Abilities.TemplateClientEvent; } } public void ActivateServer(ulong activatorId) { if (GameNetworkManager.Instance.isHostingGame) { serverEvent?.Invoke(this, activatorId); } } public void ActivateClient(ulong activatorId, string extraMessage = null, AbilityBase ability = null) { //IL_0036: 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) if (ability == null) { ability = this; Debug.LogWarning((object)"ActivateClient(): Called without ability reference! This could cause problems"); } NetworkHandler.Instance.EventSendRpc(".activateAbility", new MessageProperties(__bool: false, ability.abilityName, 0, 0f, activatorId, default(Vector3), __null: false, extraMessage)); } public void ActivateAbility(ulong activatorId, string extraMessage) { clientEvent?.Invoke(this, activatorId, extraMessage); } } public class AbilityInstance : MonoBehaviour { [CompilerGenerated] private sealed class d__22 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public int valueChange; public AbilityInstance <>4__this; private int 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__22(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_00e3: 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_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = 10; break; case 1: <>1__state = -1; break; } if ((Object)(object)<>4__this.attachedPlayer == (Object)null && 5__1 > 0) { 5__1--; <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 1; return true; } if (GameNetworkManager.Instance.isHostingGame) { if (valueChange > 0) { NetworkHandler.Instance.EventSendRpc(".tip", new MessageProperties(__bool: false, $"Sold item for '{valueChange}', Current Credit Balance: '{<>4__this.money}'", -1, 0f, <>4__this.attachedPlayer.actualClientId)); } else if (valueChange < 0) { NetworkHandler.Instance.EventSendRpc(".tip", new MessageProperties(__bool: false, $"Bought item for '{MathF.Abs(valueChange)}', Current Credit Balance: '{<>4__this.money}'", -1, 0f, <>4__this.attachedPlayer.actualClientId)); } } 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 static AbilityInstance localInstance; public int money = 0; public PlayerControllerB attachedPlayer; public AbilityUI abilityRadialMenu; public GameObject tutorialMenu; public Action moneyUpdatedAction; public bool stealthActivated; public bool invisibilityActivated; private InputAction sellAction = new InputAction("SellScrap", (InputActionType)0, (string)null, (string)null, (string)null, (string)null); private static GameObject abilityRadialMenuPrefab; private static GameObject tutorialMenuPrefab; private bool emoteModExists; private bool isOwner = false; private bool sellingScrap = false; private void Start() { //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) HideAndSeekGM instance = HideAndSeekGM.instance; instance.shipLeaving = (Action)Delegate.Combine(instance.shipLeaving, new Action(ResetAbilityUse)); attachedPlayer = ((Component)this).gameObject.GetComponent(); isOwner = (Object)(object)attachedPlayer == (Object)(object)GameNetworkManager.Instance.localPlayerController; Debugger.Debug.LogWarning("New AbilityInstance Start(): Player = '" + ((Object)((Component)this).gameObject).name + "' " + $"AttachedPlayer = '{attachedPlayer}' " + $"Local player id = '{GameNetworkManager.Instance.localPlayerController.actualClientId}' " + $"AttachedPlayer id = '{attachedPlayer.actualClientId}' " + $"Is owner = '{isOwner}'"); if (isOwner) { Debugger.Debug.LogWarning("Action Binding..."); sellAction = InputConfigs.GetInputClass().SellKey; sellAction.performed += SellInputPressed; sellAction.canceled += SellInputCanceled; sellAction.Enable(); if ((Object)(object)tutorialMenuPrefab == (Object)null) { tutorialMenuPrefab = Plugin.tutorialRadialMenuBundle.LoadAsset("TutorialMenu"); } if ((Object)(object)abilityRadialMenuPrefab == (Object)null) { abilityRadialMenuPrefab = Plugin.abilityRadialMenuBundle.LoadAsset("AbilityRadialMenu"); abilityRadialMenuPrefab.AddComponent(); } GameObject val = GameObject.Find("/Systems/UI/Canvas"); if (!Object.op_Implicit((Object)(object)val)) { Debugger.Debug.LogError("Could not find canvas at path '/Systems/UI/Canvas'! Cannot create abilty ui!"); } else { tutorialMenu = Object.Instantiate(tutorialMenuPrefab, val.transform); tutorialMenu.transform.localPosition = Vector3.zero; ((Object)tutorialMenu.gameObject).name = "[Hide and Seek] TutorialMenu"; tutorialMenu.gameObject.SetActive(false); Debugger.Debug.LogMessage("[Ability Instance] Created Tutorial UI!"); abilityRadialMenu = Object.Instantiate(abilityRadialMenuPrefab, val.transform).GetComponent(); ((Component)abilityRadialMenu).transform.localPosition = Vector3.zero; ((Object)((Component)abilityRadialMenu).gameObject).name = "AbilityRadialMenu"; ((Component)abilityRadialMenu).gameObject.SetActive(false); Debugger.Debug.LogMessage("[Ability Instance] Created Ability UI!"); } Transform obj = val.transform.FindChild("EmotesRadialMenu"); emoteModExists = (Object)(object)((obj != null) ? ((Component)obj).gameObject : null) != (Object)null; localInstance = this; } } private void Update() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) Vector2 val = IngamePlayerSettings.Instance.playerInput.actions.FindAction("Move", false).ReadValue(); if (((Vector2)(ref val)).magnitude > 0.2f && sellingScrap) { SellMoveCanceled(); } } public void SellInputPressed(CallbackContext context = default(CallbackContext)) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) Vector2 val = IngamePlayerSettings.Instance.playerInput.actions.FindAction("Move", false).ReadValue(); GrabbableObject val2 = attachedPlayer.ItemSlots[attachedPlayer.currentItemSlot]; if (Object.op_Implicit((Object)(object)val2) && val2.scrapValue != 0) { if (((Vector2)(ref val)).magnitude > 0.2f) { SellMoveCanceled(); return; } sellingScrap = true; ((MonoBehaviour)this).Invoke("SellSelectedScrap", 3f); DisplayTip("Selling Scrap..."); } } public void SellInputCanceled(CallbackContext context = default(CallbackContext)) { if (sellingScrap) { GrabbableObject val = attachedPlayer.ItemSlots[attachedPlayer.currentItemSlot]; if (Object.op_Implicit((Object)(object)val) && val.scrapValue != 0) { sellingScrap = false; ((MonoBehaviour)this).CancelInvoke("SellSelectedScrap"); DisplayTip("Keep holding to sell scrap!", warn: true); } } } private void SellMoveCanceled() { sellingScrap = false; ((MonoBehaviour)this).CancelInvoke("SellSelectedScrap"); DisplayTip("Can't move and sell at the same time!", warn: true); } public void ResetAbilityUse() { foreach (AbilityBase ability in Abilities.abilities) { ability.lastUsed = 0f; ability.usedThisRound = false; } } public void SellSelectedScrap() { //IL_0110: 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) if (!Config.abilitiesEnabled.Value) { return; } sellingScrap = false; if (attachedPlayer.isPlayerDead) { Debugger.Debug.LogWarning($"Ur ded bruh, ca't du dat. Dead:{attachedPlayer.isPlayerDead}"); return; } GrabbableObject val = attachedPlayer.ItemSlots[attachedPlayer.currentItemSlot]; Debugger.Debug.Log($"[Client] Attempting to sell selected object... '{val}'"); if (Object.op_Implicit((Object)(object)val)) { int scrapValue = val.scrapValue; if (scrapValue > 0) { Debugger.Debug.Log($"[Client] Passed local checks! scrapvalue: '{val.scrapValue}'"); ((TMP_Text)abilityRadialMenu.sellControlTip).alpha = Mathf.Max(((TMP_Text)abilityRadialMenu.sellControlTip).alpha - 0.25f, 0f); NetworkHandler.Instance.EventSendRpc(".sellCurrentItem", new MessageProperties(__bool: false, "", 0, 0f, attachedPlayer.actualClientId)); } else { Debugger.Debug.Log($"[Client] Could not pass value check! scrapvalue: '{val.scrapValue}'"); } } } public void ServerMoneyUpdated(int valueChange, bool set = false, bool silent = false) { if (Config.abilitiesEnabled.Value) { money += valueChange; if (set) { money = valueChange; } moneyUpdatedAction?.Invoke(money); if (!silent) { ((MonoBehaviour)this).StartCoroutine(SendInfoMessage(valueChange)); } } } [IteratorStateMachine(typeof(d__22))] public IEnumerator SendInfoMessage(int valueChange) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__22(0) { <>4__this = this, valueChange = valueChange }; } public void DisplayTip(string s, bool warn = false) { HUDManager.Instance.DisplayTip("Hide And Seek", s, warn, false, "LC_Tip1"); } public void BuyAbility(AbilityBase ability) { //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) if (!Config.abilitiesEnabled.Value) { return; } Debugger.Debug.Log("[Client] Attempting to buy seleted ability... '" + ability.abilityName + "'"); if (ability != null) { bool flag = HideAndSeekGM.instance.seekers.Contains(attachedPlayer); if (ability.abilityCost > money) { Debugger.Debug.Log($"[Client] Could not pass value check! AbilityCost: '{ability.abilityCost}'"); DisplayTip($"Cannot afford this ability! You need '{ability.abilityCost - money}' more credits.", warn: true); } else if (ability.usedThisRound && ability.oneTimeUse) { Debugger.Debug.Log($"[Client] Ability already used! AbilityName: '{ability.abilityName}' TimeLeft: '{ability.abilityDelay - (Time.time - ability.lastUsed)}'"); DisplayTip("You can only use " + ability.abilityName + " once a round!", warn: true); } else if (Time.time - ability.lastUsed <= ability.abilityDelay) { Debugger.Debug.Log($"[Client] Ability on cooldown! AbilityName: '{ability.abilityName}' TimeLeft: '{ability.abilityDelay - (Time.time - ability.lastUsed)}'"); DisplayTip($"Ability on cooldown! Seconds left: '{(int)(ability.abilityDelay - (Time.time - ability.lastUsed)) + 1}'", warn: true); } else if (ability.requiresRoundActive && !StartOfRound.Instance.shipHasLanded) { Debugger.Debug.Log("[Client] Could not pass requiersRoundActive check! AbilityName: '" + ability.abilityName + "'"); DisplayTip("Round has not started yet! Can't use this ability.", warn: true); } else if (ability.requiresSeekerActive && TimeOfDay.Instance.currentDayTime <= Config.timeSeekerIsReleased.Value) { Debugger.Debug.Log("[Client] Could not pass requiersRoundActive check! AbilityName: '" + ability.abilityName + "'"); DisplayTip("Seeker not active yet! Can't use this ability.", warn: true); } else if (!(ability.seekerAbility && flag) && (!ability.hiderAbility || flag)) { Debugger.Debug.Log("[Client] Could not pass proper ability user check! AbilityName: '" + ability.abilityName + "'"); if (flag) { DisplayTip("This ability is only for hiders!!"); } else { DisplayTip("This ability is only for seekers!!"); } } else { Debugger.Debug.Log($"[Client] Passed local checks! AbilityCost: '{ability.abilityCost}'"); ability.lastUsed = Time.time; ability.usedThisRound = true; ability.timesUsed++; NetworkHandler.Instance.EventSendRpc(".buyAbility", new MessageProperties(__bool: false, ability.abilityName, 0, 0f, attachedPlayer.actualClientId)); } } else { Debugger.Debug.LogWarning("[Client] Tried to buy a null ability!"); } } } public static class AbilityManager { [CompilerGenerated] private sealed class d__0 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private List.Enumerator <>s__1; private PlayerControllerB 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__0(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>s__1 = default(List.Enumerator); 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; Debugger.Debug.Log($"Step Two; localPlayer Exits?: {(Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null}"); break; case 1: <>1__state = -1; break; } if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)null) { <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 1; return true; } Debugger.Debug.Log($"We are done! localPlayer Exits?: {(Object)(object)GameNetworkManager.Instance.localPlayerController != (Object)null}"); <>s__1 = HideAndSeekGM.GetAllConnectedPlayers("Ability Manager Start").GetEnumerator(); try { while (<>s__1.MoveNext()) { 5__2 = <>s__1.Current; PlayerJoined(5__2.actualClientId); 5__2 = null; } } finally { ((IDisposable)<>s__1).Dispose(); } <>s__1 = default(List.Enumerator); 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(); } } [IteratorStateMachine(typeof(d__0))] public static IEnumerator ConnectStart() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__0(0); } public static void PlayerJoined(ulong playerId) { PlayerControllerB playerWithClientId = HideAndSeekGM.instance.GetPlayerWithClientId(playerId); if (!Object.op_Implicit((Object)(object)playerWithClientId)) { Debugger.Debug.LogWarning($"AbilityManager: Could not find player id {playerId}"); return; } if (Object.op_Implicit((Object)(object)((Component)playerWithClientId).GetComponent())) { Object.Destroy((Object)(object)((Component)playerWithClientId).GetComponent()); } Debugger.Debug.LogMessage("AbilityManager: " + playerWithClientId.playerUsername + " got AbilityInstance script!"); ((Component)playerWithClientId).gameObject.AddComponent(); } public static void SellCurrentItem(ulong playerId) { //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB playerWithClientId = HideAndSeekGM.instance.GetPlayerWithClientId(playerId); AbilityInstance component = ((Component)playerWithClientId).GetComponent(); if ((Object)(object)component == (Object)null) { Debugger.Debug.LogWarning("Tried to sell items for a player that does not posses a 'AbilityInstance' script! Adding one..."); component = ((Component)playerWithClientId).gameObject.AddComponent(); } GrabbableObject val = playerWithClientId.ItemSlots[playerWithClientId.currentItemSlot]; Debugger.Debug.Log($"[Server] Attempting to sell selected object... '{val}'"); if (Object.op_Implicit((Object)(object)val)) { int scrapValue = val.scrapValue; if (scrapValue > 0) { Debugger.Debug.Log($"[Server] Passed local checks! scrapvalue: '{scrapValue}'"); NetworkHandler.Instance.EventSendRpc(".destroyItem", new MessageProperties(__bool: false, "", playerWithClientId.currentItemSlot, 0f, playerId)); NetworkHandler.Instance.EventSendRpc(".moneyChanged", new MessageProperties(__bool: false, "", scrapValue, 0f, playerId)); } else { Debugger.Debug.Log($"[Server] Could not pass value check! scrapvalue: '{scrapValue}'"); } } } public static void BuyAbilityServer(ulong playerId, AbilityBase ability) { //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB playerWithClientId = HideAndSeekGM.instance.GetPlayerWithClientId(playerId); AbilityInstance abilityInstance = ((Component)playerWithClientId).GetComponent(); if ((Object)(object)abilityInstance == (Object)null) { Debugger.Debug.LogWarning("Tried to buy ability for a player that does not posses a 'AbilityInstance' script! Adding one..."); abilityInstance = ((Component)playerWithClientId).gameObject.AddComponent(); } Debugger.Debug.Log("[Server] Attempting to buy seleted ability... '" + ability.abilityName + "'"); if (ability != null) { bool flag = HideAndSeekGM.instance.seekers.Contains(playerWithClientId); if (ability.abilityCost > abilityInstance.money) { Debugger.Debug.Log($"[Server] Could not pass value check! AbilityCost: '{ability.abilityCost}'"); return; } if (!(ability.seekerAbility && flag) && (!ability.hiderAbility || flag)) { Debugger.Debug.Log("[Server] Could not pass proper ability user check! AbilityName: '" + ability.abilityName + "'"); return; } if (ability.requiresRoundActive && !StartOfRound.Instance.shipHasLanded) { Debugger.Debug.Log("[Server] Could not pass requiersRoundActive check! AbilityName: '" + ability.abilityName + "'"); return; } if (ability.requiresSeekerActive && TimeOfDay.Instance.currentDayTime <= Config.timeSeekerIsReleased.Value) { Debugger.Debug.Log("[Server] Could not pass requiersRoundActive check! AbilityName: '" + ability.abilityName + "'"); return; } Debugger.Debug.Log($"[Server] Passed local checks! AbilityCost: '{ability.abilityCost}'"); NetworkHandler.Instance.EventSendRpc(".moneyChanged", new MessageProperties(__bool: false, "", -ability.abilityCost, 0f, playerId)); ability.ActivateServer(playerId); } else { Debugger.Debug.LogWarning("[Server] Tried to buy a null ability!"); } } } public static class AbilitySpriteManager { public static List abilityUISprites; public static Sprite nullSprite; public static void LoadSprites() { //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Expected O, but got Unknown //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) abilityUISprites = new List(); nullSprite = null; string directoryName = Path.GetDirectoryName(((BaseUnityPlugin)Plugin.instance).Info.Location); string text = Path.Combine(directoryName, "Abilities"); if (!Directory.Exists(text)) { Directory.CreateDirectory(text); } string[] files = Directory.GetFiles(directoryName, "*.png", SearchOption.AllDirectories); Debugger.Debug.LogWarning($"Now loading all ability sprites! Path = '{directoryName}', Files found = '{files.Length}'"); string[] array = files; foreach (string text2 in array) { byte[] array2 = File.ReadAllBytes(text2); string text3 = text2.Split("\\")[^1]; string text4 = text3.Replace("Ability - ", "").Replace("Sprite - ", "").Replace(".png", ""); if (array2 != null) { Texture2D val = new Texture2D(1200, 1200, (TextureFormat)3, false); if (ImageConversion.LoadImage(val, array2)) { Sprite val2 = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f)); ((Object)val2).name = text4; if (((Object)val2).name == "[Null]") { ((Texture)val).filterMode = (FilterMode)0; nullSprite = val2; } else { abilityUISprites.Add(val2); } } } if (!(text4 == "icon") && !(text4 == "old-icon")) { File.Move(text2, Path.Combine(text, text3)); } } Debugger.Debug.LogWarning("All Sprites Loaded!"); } public static Sprite GetSprite(string name) { Sprite val = null; foreach (Sprite abilityUISprite in abilityUISprites) { if (string.Equals(((Object)abilityUISprite).name, name, StringComparison.CurrentCultureIgnoreCase)) { val = abilityUISprite; } } if ((Object)(object)val == (Object)null) { if (!Object.op_Implicit((Object)(object)nullSprite)) { Debugger.Debug.LogError("GetSpite(); No null sprite!"); } val = nullSprite; } return val; } } public class AbilityUI : MonoBehaviour { [CompilerGenerated] private sealed class <>c__DisplayClass44_0 { public Button newGroupButton; public AbilityUI <>4__this; internal void b__0() { <>4__this.SwitchCategory(((Object)newGroupButton).name); } } [CompilerGenerated] private sealed class d__44 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public AbilityUI <>4__this; private bool 5__1; private TextMeshProUGUI 5__2; private TextMeshProUGUI 5__3; private InputAction 5__4; private InputAction 5__5; private InputAction 5__6; private InputAction 5__7; private InputAction 5__8; private InputAction 5__9; private InputAction 5__10; private InputAction 5__11; private InputAction 5__12; private InputAction 5__13; private Button 5__14; private TextMeshProUGUI 5__15; private TextMeshProUGUI 5__16; private List 5__17; private List.Enumerator <>s__18; private AbilityBase 5__19; private Dictionary>.KeyCollection.Enumerator <>s__20; private string 5__21; private <>c__DisplayClass44_0 <>8__22; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__44(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; 5__3 = null; 5__4 = null; 5__5 = null; 5__6 = null; 5__7 = null; 5__8 = null; 5__9 = null; 5__10 = null; 5__11 = null; 5__12 = null; 5__13 = null; 5__14 = null; 5__15 = null; 5__16 = null; 5__17 = null; <>s__18 = default(List.Enumerator); 5__19 = null; <>s__20 = default(Dictionary>.KeyCollection.Enumerator); 5__21 = null; <>8__22 = null; <>1__state = -2; } private bool MoveNext() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Expected O, but got Unknown //IL_053d: Unknown result type (might be due to invalid IL or missing references) //IL_0563: Unknown result type (might be due to invalid IL or missing references) //IL_0568: Unknown result type (might be due to invalid IL or missing references) //IL_0578: Unknown result type (might be due to invalid IL or missing references) //IL_058d: Unknown result type (might be due to invalid IL or missing references) //IL_0598: Unknown result type (might be due to invalid IL or missing references) //IL_05a2: Unknown result type (might be due to invalid IL or missing references) //IL_05a7: Unknown result type (might be due to invalid IL or missing references) //IL_062f: Unknown result type (might be due to invalid IL or missing references) //IL_0655: Unknown result type (might be due to invalid IL or missing references) //IL_065a: Unknown result type (might be due to invalid IL or missing references) //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_067f: Unknown result type (might be due to invalid IL or missing references) //IL_068a: Unknown result type (might be due to invalid IL or missing references) //IL_0694: Unknown result type (might be due to invalid IL or missing references) //IL_0699: Unknown result type (might be due to invalid IL or missing references) //IL_0a1b: Unknown result type (might be due to invalid IL or missing references) //IL_0a25: Expected O, but got Unknown //IL_0aa2: Unknown result type (might be due to invalid IL or missing references) //IL_0aac: Expected O, but got Unknown //IL_0e90: Unknown result type (might be due to invalid IL or missing references) //IL_0e9a: Expected O, but got Unknown //IL_11d2: Unknown result type (might be due to invalid IL or missing references) //IL_11dc: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = false; break; case 1: <>1__state = -1; break; } if ((Object)(object)GameNetworkManager.Instance?.localPlayerController == (Object)null) { <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 1; return true; } <>4__this.attachedPlayer = GameNetworkManager.Instance.localPlayerController; <>4__this.attachedAbilityInstance = ((Component)<>4__this.attachedPlayer).GetComponent(); AbilityUI abilityUI = <>4__this; GameObject obj = GameObject.Find("MoneyText"); abilityUI.creditUI = ((obj != null) ? obj.GetComponent() : null); if ((Object)(object)<>4__this.creditUI == (Object)null) { Debugger.Debug.LogError("Could not find creditUI!"); 5__1 = true; } AbilityUI abilityUI2 = <>4__this; GameObject obj2 = GameObject.Find("RadialUI/Title"); abilityUI2.titleUI = ((obj2 != null) ? obj2.GetComponent() : null); if ((Object)(object)<>4__this.titleUI == (Object)null) { Debugger.Debug.LogError("Could not find titleUI!"); 5__1 = true; } AbilityUI abilityUI3 = <>4__this; GameObject obj3 = GameObject.Find("Info/Title"); abilityUI3.titleDescriptionUI = ((obj3 != null) ? obj3.GetComponent() : null); if ((Object)(object)<>4__this.titleDescriptionUI == (Object)null) { Debugger.Debug.LogError("Could not find titleDescriptionUI!"); 5__1 = true; } AbilityUI abilityUI4 = <>4__this; GameObject obj4 = GameObject.Find("Info/Description"); abilityUI4.descriptionUI = ((obj4 != null) ? obj4.GetComponent() : null); if ((Object)(object)<>4__this.descriptionUI == (Object)null) { Debugger.Debug.LogError("Could not find descriptionUI!"); 5__1 = true; } AbilityUI abilityUI5 = <>4__this; GameObject obj5 = GameObject.Find("Info/Version"); abilityUI5.versionUI = ((obj5 != null) ? obj5.GetComponent() : null); if ((Object)(object)<>4__this.versionUI == (Object)null) { Debugger.Debug.LogError("Could not find versionUI!"); 5__1 = true; } AbilityUI abilityUI6 = <>4__this; GameObject obj6 = GameObject.Find("Info/HelpButton"); abilityUI6.helpButton = ((obj6 != null) ? obj6.GetComponent