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 GameNetcodeStuff; using HarmonyLib; using LethalLib.Modules; using Microsoft.CodeAnalysis; using TMPro; using Unity.Collections; using Unity.Jobs; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; using UnityEngine.Rendering; using Vecna; using Vecna.Configuration; using Vecna.NetcodePatcher; [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("Vecna")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+96333644e71631b4debc3c77c922610790d32889")] [assembly: AssemblyProduct("Vecna")] [assembly: AssemblyTitle("Vecna")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Vecna { [BepInPlugin("Reiko88.Vecna", "Vecna", "1.1.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { [HarmonyPatch(typeof(Terminal))] public class TerminalKeywordPatch { [HarmonyPatch("Awake")] [HarmonyPostfix] public static void AddExtraKeywords(Terminal __instance) { TerminalKeyword val = ModAssets.LoadAsset("HenryTK"); TerminalKeyword val2 = ModAssets.LoadAsset("CreelTK"); if (!((Object)(object)val == (Object)null) && !((Object)(object)val2 == (Object)null)) { List list = __instance.terminalNodes.allKeywords.ToList(); if (!list.Contains(val)) { list.Add(val); } if (!list.Contains(val2)) { list.Add(val2); } __instance.terminalNodes.allKeywords = list.ToArray(); Logger.LogInfo((object)"Successfully injected extra Vecna keywords into the Terminal!"); } } } internal static ManualLogSource Logger; public static AssetBundle? ModAssets; public static GameObject? ClockPrefab; public static GameObject? ClonePrefab; internal static PluginConfig BoundConfig { get; private set; } private void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown Harmony val = new Harmony("Reiko88.Vecna"); val.PatchAll(typeof(TerminalKeywordPatch)); val.PatchAll(typeof(VecnaEnemyAIPatch)); val.PatchAll(typeof(VecnaVoiceMutePatch)); val.PatchAll(typeof(VecnaEventManager)); val.PatchAll(typeof(VecnaTeleportInterceptPatch)); Logger = ((BaseUnityPlugin)this).Logger; BoundConfig = new PluginConfig(((BaseUnityPlugin)this).Config); InitializeNetworkBehaviours(); string text = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "vecnabundle"); ModAssets = AssetBundle.LoadFromFile(text); if ((Object)(object)ModAssets == (Object)null) { Logger.LogError((object)"Failed to load vecnabundle bundle."); return; } ClockPrefab = ModAssets.LoadAsset("GrandfatherClock"); Logger.LogInfo((object)"Vecna Clock Prefab loaded successfully!"); ClonePrefab = ModAssets.LoadAsset("Scavenger"); Logger.LogInfo((object)"player clone Prefab loaded successfully!"); EnemyType val2 = ModAssets.LoadAsset("vecnaEnemy"); TerminalNode val3 = ModAssets.LoadAsset("VecnaTN"); TerminalKeyword val4 = ModAssets.LoadAsset("VecnaTK"); if ((Object)(object)val2 == (Object)null) { Logger.LogError((object)"Failed to load Vecna EnemyType from Asset Bundle!"); return; } NetworkPrefabs.RegisterNetworkPrefab(val2.enemyPrefab); Dictionary dictionary = new Dictionary { { (LevelTypes)512, 50 }, { (LevelTypes)128, 75 }, { (LevelTypes)256, 55 }, { (LevelTypes)32, 30 }, { (LevelTypes)64, 30 }, { (LevelTypes)4, 10 }, { (LevelTypes)8, 20 }, { (LevelTypes)16, 20 }, { (LevelTypes)4096, 65 }, { (LevelTypes)8192, 100 }, { (LevelTypes)2048, 55 }, { (LevelTypes)1024, 45 } }; Dictionary dictionary2 = new Dictionary(); Enemies.RegisterEnemy(val2, dictionary, dictionary2, val3, val4); Logger.LogInfo((object)"Plugin Vecna is loaded and assets are registered!"); } private static void InitializeNetworkBehaviours() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } } } public class VecnaAI : EnemyAI { public enum VecnaPhase { Cooldown, ClockStalking, ClockSpotted, Chasing, VehicleCinematic, WaitingForVehicleExit, ExecutingKill } [CompilerGenerated] private sealed class d__119 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public VehicleController car; public VecnaAI <>4__this; private float 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__119(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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 = car.mainRigidbody.drag; car.mainRigidbody.drag = 5f; break; case 1: <>1__state = -1; break; } Vector3 velocity = car.mainRigidbody.velocity; if (((Vector3)(ref velocity)).magnitude > 0.1f) { <>2__current = null; <>1__state = 1; return true; } car.mainRigidbody.velocity = Vector3.zero; car.mainRigidbody.drag = 5__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(); } } [CompilerGenerated] private sealed class d__130 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public VecnaAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__130(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.canKill = false; <>2__current = (object)new WaitForSeconds(4.5f); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.canKill = true; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__140 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB dyingPlayer; public VecnaAI <>4__this; private float 5__1; private float 5__2; private float 5__3; private float 5__4; private float 5__5; private float[] 5__6; private Transform 5__7; private Transform 5__8; private Transform 5__9; private Transform 5__10; private Transform 5__11; private Transform[] 5__12; private AudioSource 5__13; private Transform[] <>s__14; private int <>s__15; private Transform 5__16; private string 5__17; private int 5__18; private float 5__19; private Vector3 5__20; private AudioSource 5__21; private Vector3 5__22; private Vector3 5__23; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__140(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__6 = null; 5__7 = null; 5__8 = null; 5__9 = null; 5__10 = null; 5__11 = null; 5__12 = null; 5__13 = null; <>s__14 = null; 5__16 = null; 5__17 = null; 5__21 = null; <>1__state = -2; } private bool MoveNext() { //IL_0488: Unknown result type (might be due to invalid IL or missing references) //IL_0471: Unknown result type (might be due to invalid IL or missing references) //IL_048d: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_054e: 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_0559: Unknown result type (might be due to invalid IL or missing references) //IL_0526: Unknown result type (might be due to invalid IL or missing references) //IL_052b: Unknown result type (might be due to invalid IL or missing references) //IL_0535: Unknown result type (might be due to invalid IL or missing references) //IL_053a: 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_05f3: Unknown result type (might be due to invalid IL or missing references) //IL_05f8: Unknown result type (might be due to invalid IL or missing references) //IL_05fe: Unknown result type (might be due to invalid IL or missing references) //IL_05d2: Unknown result type (might be due to invalid IL or missing references) //IL_05d7: Unknown result type (might be due to invalid IL or missing references) //IL_05e1: Unknown result type (might be due to invalid IL or missing references) //IL_05e6: 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_05ac: Unknown result type (might be due to invalid IL or missing references) //IL_05b6: Unknown result type (might be due to invalid IL or missing references) //IL_05bb: 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 = 0f; goto IL_007d; case 1: <>1__state = -1; goto IL_007d; case 2: { <>1__state = -1; goto IL_0437; } IL_007d: if (5__1 < 1f) { if (<>4__this.currentLocalPhase != VecnaPhase.ExecutingKill) { return false; } 5__1 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } if ((Object)(object)<>4__this.activeCloneAnim != (Object)null) { ((Behaviour)<>4__this.activeCloneAnim).enabled = true; <>4__this.activeCloneAnim.SetTrigger(AnimHasDied); if (!<>4__this.cursingLocalPlayer && (Object)(object)<>4__this.liftTelekinesisClip != (Object)null) { 5__13 = <>4__this.activeClone.GetComponent(); if ((Object)(object)5__13 != (Object)null) { 5__13.PlayOneShot(<>4__this.liftTelekinesisClip, 1f); } else { AudioSource.PlayClipAtPoint(<>4__this.liftTelekinesisClip, <>4__this.activeClone.transform.position, 1f); } 5__13 = null; } } 5__2 = 3.2f; 5__3 = 0.3f; 5__4 = 1f; 5__5 = 0.2f; 5__6 = new float[4] { 5__2, 5__3, 5__4, 5__5 }; 5__7 = null; 5__8 = null; 5__9 = null; 5__10 = null; 5__11 = null; if ((Object)(object)<>4__this.activeClone != (Object)null) { <>s__14 = <>4__this.activeClone.GetComponentsInChildren(); for (<>s__15 = 0; <>s__15 < <>s__14.Length; <>s__15++) { 5__16 = <>s__14[<>s__15]; 5__17 = ((Object)5__16).name.ToLower().Replace(".", "").Replace("_", ""); if (5__17.Contains("armrlower")) { 5__7 = 5__16; } else if (5__17.Contains("armllower")) { 5__8 = 5__16; } else if (5__17.Contains("shinl") || 5__17.Contains("calfl")) { 5__9 = 5__16; } else if (5__17.Contains("shinr") || 5__17.Contains("calfr")) { 5__10 = 5__16; } else if (5__17.Contains("spine004") || 5__17.Contains("head")) { 5__11 = 5__16; } 5__17 = null; 5__16 = null; } <>s__14 = null; } 5__12 = (Transform[])(object)new Transform[4] { 5__8, 5__7, 5__10, 5__9 }; 5__18 = 0; goto IL_0624; IL_0437: if (5__19 < 5__6[5__18]) { if (<>4__this.currentLocalPhase != VecnaPhase.ExecutingKill) { return false; } 5__19 += Time.deltaTime; <>2__current = null; <>1__state = 2; return true; } 5__20 = (((Object)(object)<>4__this.activeClone != (Object)null) ? <>4__this.activeClone.transform.position : ((Component)dyingPlayer).transform.position); 5__21 = (((Object)(object)<>4__this.activeClone != (Object)null) ? <>4__this.activeClone.GetComponent() : null); <>4__this.audioTools.PlayBoneSnap(5__20, 5__21); 5__22 = (((Object)(object)5__12[5__18] != (Object)null) ? 5__12[5__18].position : (((Object)(object)<>4__this.activeClone != (Object)null) ? (<>4__this.activeClone.transform.position + Vector3.up * 1.5f) : ((Component)dyingPlayer).transform.position)); VecnaVFXHelper.CreateSmallBloodSplash(5__22); if (5__18 >= 2) { 5__23 = (((Object)(object)5__11 != (Object)null) ? 5__11.position : (((Object)(object)<>4__this.activeClone != (Object)null) ? (<>4__this.activeClone.transform.position + Vector3.up * 1.6f) : (((Component)dyingPlayer).transform.position + Vector3.up * 1.6f))); VecnaVFXHelper.CreateSmallBloodSplash(5__23); } 5__21 = null; 5__18++; goto IL_0624; IL_0624: if (5__18 < 4) { 5__19 = 0f; goto IL_0437; } 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__133 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public VecnaAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__133(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 ((Object)(object)((EnemyAI)<>4__this).creatureAnimator != (Object)null) { ((EnemyAI)<>4__this).creatureAnimator.SetTrigger(AnimBlastDoor); } <>2__current = <>4__this.wait1Point5Seconds; <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)((EnemyAI)<>4__this).creatureAnimator != (Object)null) { ((EnemyAI)<>4__this).creatureAnimator.SetTrigger(AnimBlastDoorDone); } 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__111 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GameObject fakeBody; public PlayerControllerB victim; public Vector3 dirToPlayer; public bool isLocalPlayer; public VehicleController car; public VecnaAI <>4__this; private ScanNodeProperties 5__1; private Exception 5__2; private Rigidbody[] <>s__3; private int <>s__4; private Rigidbody 5__5; private Renderer[] 5__6; private Canvas[] 5__7; private Renderer[] <>s__8; private int <>s__9; private Renderer 5__10; private Canvas[] <>s__11; private int <>s__12; private Canvas 5__13; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__111(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; <>s__3 = null; 5__5 = null; 5__6 = null; 5__7 = null; <>s__8 = null; 5__10 = null; <>s__11 = null; 5__13 = null; <>1__state = -2; } private bool MoveNext() { //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: 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_015a: 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_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = <>4__this.waitEndOfFrame; <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)fakeBody == (Object)null || (Object)(object)victim == (Object)null) { return false; } 5__1 = fakeBody.GetComponentInChildren(); if ((Object)(object)5__1 != (Object)null) { 5__1.headerText = "Body of " + victim.playerUsername; 5__1.subText = "Cause of death: Unknown"; } try { VecnaVFXHelper.DressCloneLikePlayer(fakeBody, victim); } catch (Exception ex) { 5__2 = ex; Debug.LogWarning((object)("VECNA: Safely caught cosmetic error: " + 5__2.Message)); } <>s__3 = fakeBody.GetComponentsInChildren(); for (<>s__4 = 0; <>s__4 < <>s__3.Length; <>s__4++) { 5__5 = <>s__3[<>s__4]; if ((Object)(object)car != (Object)null) { 5__5.AddForce(-((Component)car).transform.forward * 9f + ((Component)car).transform.up * 3.5f, (ForceMode)1); } else { 5__5.AddForce(dirToPlayer * 5f + Vector3.down * 4f, (ForceMode)1); } 5__5 = null; } <>s__3 = null; if (!isLocalPlayer) { 5__6 = fakeBody.GetComponentsInChildren(true); <>s__8 = 5__6; for (<>s__9 = 0; <>s__9 < <>s__8.Length; <>s__9++) { 5__10 = <>s__8[<>s__9]; 5__10.enabled = false; 5__10 = null; } <>s__8 = null; 5__7 = fakeBody.GetComponentsInChildren(true); <>s__11 = 5__7; for (<>s__12 = 0; <>s__12 < <>s__11.Length; <>s__12++) { 5__13 = <>s__11[<>s__12]; ((Behaviour)5__13).enabled = false; 5__13 = null; } <>s__11 = null; 5__6 = null; 5__7 = null; } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__141 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB victim; public VecnaAI <>4__this; private float 5__1; private float 5__2; private Vector3 5__3; private Vector3 5__4; private RaycastHit 5__5; private Vector3 5__6; private Quaternion 5__7; private Quaternion 5__8; private Quaternion 5__9; private Vector3 5__10; private float 5__11; private float 5__12; private Vector3 5__13; private Vector3 5__14; private float 5__15; private Vector3 5__16; private Vector3 5__17; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__141(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //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_00ea: 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) //IL_04be: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0166: 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_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_0110: 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_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Unknown result type (might be due to invalid IL or missing references) //IL_059c: Expected O, but got Unknown //IL_04ef: Unknown result type (might be due to invalid IL or missing references) //IL_04f4: Unknown result type (might be due to invalid IL or missing references) //IL_04fe: 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_0508: 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) //IL_055c: Unknown result type (might be due to invalid IL or missing references) //IL_0566: Expected O, but got Unknown //IL_05de: Unknown result type (might be due to invalid IL or missing references) //IL_05fa: Unknown result type (might be due to invalid IL or missing references) //IL_060b: Unknown result type (might be due to invalid IL or missing references) //IL_0615: Unknown result type (might be due to invalid IL or missing references) //IL_061b: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_0445: Unknown result type (might be due to invalid IL or missing references) //IL_0481: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0296: 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_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: 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_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; victim.inAnimationWithEnemy = (EnemyAI)(object)<>4__this; victim.disableLookInput = true; victim.disableMoveInput = true; victim.disableInteract = true; ((Collider)victim.thisController).enabled = false; 5__1 = 3f; 5__2 = 0f; 5__3 = ((Component)victim).transform.position; 5__4 = 5__3 + new Vector3(0f, 1.5f, 0f); if (Physics.Raycast(5__3, Vector3.up, ref 5__5, 2.6f, StartOfRound.Instance.collidersAndRoomMask)) { 5__4 = 5__3 + new Vector3(0f, Mathf.Max(0f, ((RaycastHit)(ref 5__5)).distance - 0.5f), 0f); } 5__6 = ((Component)<>4__this).transform.position - ((Component)victim).transform.position; 5__6.y = 0f; ((Vector3)(ref 5__6)).Normalize(); 5__7 = ((Component)victim).transform.rotation; 5__8 = Quaternion.LookRotation(5__6); 5__9 = ((Component)victim.gameplayCamera).transform.rotation; 5__10 = ((Component)victim.gameplayCamera).transform.localEulerAngles; goto IL_035b; case 1: <>1__state = -1; goto IL_035b; case 2: <>1__state = -1; goto IL_0418; case 3: <>1__state = -1; 5__14 = ((Component)victim).transform.position; if ((Object)(object)<>4__this.activeClone != (Object)null) { 5__14 = <>4__this.activeClone.transform.position + Vector3.up * 0.1f; ((Collider)victim.thisController).enabled = true; Object.Destroy((Object)(object)<>4__this.activeClone); <>4__this.activeClone = null; victim.TeleportPlayer(5__14, false, 0f, false, true); <>2__current = (object)new WaitForSeconds(0.8f); <>1__state = 4; return true; } ((Collider)victim.thisController).enabled = true; <>2__current = (object)new WaitForSeconds(0.4f); <>1__state = 5; return true; case 4: <>1__state = -1; break; case 5: { <>1__state = -1; break; } IL_035b: if (5__2 < 5__1) { 5__2 += Time.deltaTime; 5__15 = Mathf.SmoothStep(0f, 1f, 5__2 / 5__1); if (!victim.playerCollider.enabled) { victim.playerCollider.enabled = true; } ((Component)victim).transform.position = Vector3.Lerp(5__3, 5__4, 5__15); ((Component)victim).transform.rotation = Quaternion.Slerp(5__7, 5__8, 5__15); 5__16 = ((Component)<>4__this).transform.position + Vector3.up * 2.4f; 5__17 = 5__16 - ((Component)victim.gameplayCamera).transform.position; ((Component)victim.gameplayCamera).transform.rotation = Quaternion.Slerp(5__9, Quaternion.LookRotation(5__17), 5__15); victim.fallValue = 0f; victim.fallValueUncapped = 0f; <>2__current = null; <>1__state = 1; return true; } 5__11 = 2.7f; 5__12 = 0f; goto IL_0418; IL_0418: if (5__12 < 5__11) { if (!victim.playerCollider.enabled) { victim.playerCollider.enabled = true; } victim.fallValue = 0f; victim.fallValueUncapped = 0f; ((Component)victim).transform.position = 5__4; 5__12 += Time.deltaTime; <>2__current = null; <>1__state = 2; return true; } 5__13 = ((Component)victim.gameplayCamera).transform.localEulerAngles; ((Component)victim.gameplayCamera).transform.localEulerAngles = new Vector3(5__13.x - 45f, 5__13.y + 60f, 70f); <>2__current = <>4__this.wait0Point21Seconds; <>1__state = 3; return true; } VecnaVFXHelper.TogglePlayerThirdPersonModel(<>4__this, victim, isVisible: true); ((Collider)victim.thisController).enabled = false; ((Component)victim).transform.position = 5__14; ((Component)victim.gameplayCamera).transform.localEulerAngles = 5__10; victim.KillPlayer(Vector3.zero, true, (CauseOfDeath)4, 0, default(Vector3), false); victim.inAnimationWithEnemy = null; victim.disableLookInput = false; victim.disableMoveInput = false; victim.disableInteract = false; if (!victim.isPlayerDead) { ((Collider)victim.thisController).enabled = true; victim.fallValue = 0f; victim.fallValueUncapped = 0f; } if (<>4__this.cursingLocalPlayer) { VecnaVFXHelper.ToggleTeammatesForVictim(<>4__this, isVisible: true); } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__99 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB victim; public VecnaAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__99(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0095: 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_0166: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = <>4__this.wait5Seconds; <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)victim != (Object)null && !victim.isPlayerDead) { victim.bloodDropTimer = -1f; victim.DropBlood(Vector3.down, true, false); <>2__current = <>4__this.wait1Point5Seconds; <>1__state = 2; return true; } break; case 2: <>1__state = -1; if ((Object)(object)victim != (Object)null && !victim.isPlayerDead) { victim.bloodDropTimer = -1f; victim.DropBlood(Vector3.down, true, false); } <>2__current = <>4__this.wait2Seconds; <>1__state = 3; return true; case 3: <>1__state = -1; if ((Object)(object)victim != (Object)null && !victim.isPlayerDead) { victim.bloodDropTimer = -1f; victim.DropBlood(Vector3.down, true, false); } break; } 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__138 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB victim; public AudioClip snapClip; public float delayTime; public VecnaAI <>4__this; private GameObject 5__1; private AudioSource 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__138(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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown //IL_0091: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(delayTime); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)snapClip != (Object)null && (Object)(object)victim != (Object)null) { 5__1 = new GameObject("VecnaSnapAudio"); 5__1.transform.position = ((Component)victim.gameplayCamera).transform.position; 5__2 = 5__1.AddComponent(); 5__2.clip = snapClip; 5__2.spatialBlend = 0f; 5__2.volume = 1f; if ((Object)(object)SoundManager.Instance != (Object)null && (Object)(object)SoundManager.Instance.diageticMixer != (Object)null) { 5__2.outputAudioMixerGroup = SoundManager.Instance.diageticMixer.FindMatchingGroups("Master")[0]; } 5__2.Play(); Object.Destroy((Object)(object)5__1, snapClip.length + 0.5f); 5__1 = null; 5__2 = null; } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__103 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public VecnaAI <>4__this; private string 5__1; private float 5__2; private int 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__103(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Expected O, but got Unknown //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Expected O, but got Unknown //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(10f); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)<>4__this.cursingPlayer != (Object)null && <>4__this.cursingPlayer.isInHangarShipRoom && <>4__this.currentLocalPhase != VecnaPhase.ExecutingKill && (Object)(object)HUDManager.Instance != (Object)null && (Object)(object)HUDManager.Instance.signalTranslatorText != (Object)null) { if ((Object)(object)HUDManager.Instance.signalTranslatorAnimator != (Object)null) { HUDManager.Instance.signalTranslatorAnimator.SetBool("transmitting", true); } ((TMP_Text)HUDManager.Instance.signalTranslatorText).text = ""; <>2__current = (object)new WaitForSeconds(1.2f); <>1__state = 2; return true; } break; case 2: <>1__state = -1; 5__1 = "YOU CANT HIDE"; 5__2 = 2.5f / (float)5__1.Length; 5__3 = 0; goto IL_01be; case 3: <>1__state = -1; 5__3++; goto IL_01be; case 4: { <>1__state = -1; if ((Object)(object)HUDManager.Instance.signalTranslatorAnimator != (Object)null) { HUDManager.Instance.signalTranslatorAnimator.SetBool("transmitting", false); } 5__1 = null; break; } IL_01be: if (5__3 < 5__1.Length) { TextMeshProUGUI signalTranslatorText = HUDManager.Instance.signalTranslatorText; ((TMP_Text)signalTranslatorText).text = ((TMP_Text)signalTranslatorText).text + 5__1[5__3]; <>2__current = (object)new WaitForSeconds(5__2); <>1__state = 3; return true; } <>2__current = (object)new WaitForSeconds(3f); <>1__state = 4; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__117 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public VehicleController car; public VecnaAI <>4__this; private Vector3 5__1; private Vector3 5__2; private Vector3 5__3; private Vector3 5__4; private Vector3 5__5; private RaycastHit 5__6; private float 5__7; private Vector3 5__8; private RaycastHit 5__9; private RaycastHit 5__10; private float 5__11; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__117(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00f3: 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_0109: 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_0124: 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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Expected O, but got Unknown //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0163: 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_0172: 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_017e: 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_018e: 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) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020b: 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_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) Vector3 velocity; switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>4__this.ForceVehicleStopClientRpc(((NetworkBehaviour)car).NetworkObjectId); if ((Object)(object)car.mainRigidbody != (Object)null) { 5__11 = 4f; goto IL_0093; } goto IL_00c7; case 1: <>1__state = -1; goto IL_0093; case 2: { <>1__state = -1; 5__1 = ((Component)car).transform.position; 5__2 = ((Component)car).transform.forward; 5__2.y = 0f; if (5__2 == Vector3.zero) { 5__2 = ((Component)car).transform.up; } ((Vector3)(ref 5__2)).Normalize(); 5__3 = 5__1 + 5__2 * 4.5f; 5__4 = 5__3 + 5__2 * 4.5f; 5__5 = 5__4; if (Physics.Raycast(5__3 + Vector3.up * 0.5f, 5__2, ref 5__6, 5.5f, StartOfRound.Instance.collidersAndRoomMask)) { 5__5 = ((RaycastHit)(ref 5__6)).point - 5__2 * 1.5f; } 5__7 = 5__1.y; 5__8 = 5__5 + Vector3.up * 15f; if (Physics.Raycast(5__8, Vector3.down, ref 5__9, 30f, StartOfRound.Instance.collidersAndRoomMask)) { if (((RaycastHit)(ref 5__9)).point.y > 5__7) { 5__5.y = ((RaycastHit)(ref 5__9)).point.y; } else { 5__5.y = 5__7; } } else { 5__5.y = 5__7; } if (Physics.Raycast(5__5 + Vector3.up * 0.5f, Vector3.up, ref 5__10, 2.5f, StartOfRound.Instance.collidersAndRoomMask)) { 5__5.y -= 2.5f - ((RaycastHit)(ref 5__10)).distance; } <>4__this.StartVehicleCinematicServerRpc(((NetworkBehaviour)car).NetworkObjectId, 5__5); return false; } IL_00c7: <>2__current = (object)new WaitForSeconds(1f); <>1__state = 2; return true; IL_0093: velocity = car.mainRigidbody.velocity; if (((Vector3)(ref velocity)).magnitude > 0.5f && 5__11 > 0f) { 5__11 -= Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } goto IL_00c7; } } 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__139 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB victim; public VecnaAI <>4__this; private float 5__1; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__139(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; 5__1 = 0f; break; case 1: <>1__state = -1; break; } if (5__1 < 6.35f && <>4__this.currentLocalPhase == VecnaPhase.ExecutingKill) { 5__1 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } if ((Object)(object)victim != (Object)null) { VecnaVFXHelper.TogglePlayerThirdPersonModel(<>4__this, victim, isVisible: 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(); } } private static readonly int AnimStartWalk = Animator.StringToHash("startWalk"); private static readonly int AnimBlastDoor = Animator.StringToHash("blastDoor"); private static readonly int AnimBlastDoorDone = Animator.StringToHash("blastDoorDone"); private static readonly int AnimSwingAttack = Animator.StringToHash("swingAttack"); private static readonly int AnimHasDied = Animator.StringToHash("hasDied"); private readonly WaitForSeconds wait5Seconds = new WaitForSeconds(5f); private readonly WaitForSeconds wait1Point5Seconds = new WaitForSeconds(1.5f); private readonly WaitForSeconds wait2Seconds = new WaitForSeconds(2f); private readonly WaitForSeconds wait0Point21Seconds = new WaitForSeconds(0.21f); private readonly WaitForSeconds wait0Point15Seconds = new WaitForSeconds(0.15f); private readonly WaitForEndOfFrame waitEndOfFrame = new WaitForEndOfFrame(); public VehicleController cinematicVehicle; public float cinematicTimer = 0f; public Vector3 vehicleStartPos; public Vector3 vehicleTargetPos; public bool vehicleReachedApex = false; public Vector3 cinematicHoverPos; public Quaternion cinematicHoverRot; public static List ActiveInstances = new List(); public VecnaEnvironmentManipulator environmentTools; public VecnaAudioManager audioTools; public VecnaStats stats; public AudioSource vecnaSnapAudioSource; public AudioClip playerSnapClip; public AudioSource breathingAudioSource; public AudioClip[] breathingClips; public AudioClip[] executionVoiceLines; public AudioClip[] clockSpotTaunts; public AudioClip[] escapeVoiceLines; public AudioClip finalChimeClip; public AudioClip doorTelekinesisClip; public AudioClip liftTelekinesisClip; public AudioClip vecnafpexecution; public AudioClip vehicleLiftVoiceLine; public bool canKill = false; public float SFXVolumeLerpTo = 1f; public AudioSource chimechase; public float maxChaseMusicVolume = 1f; public float musicFadeRadius = 25f; public float fadeSpeed = 2f; private bool hasPlayedShipTaunt = false; private Coroutine shipTauntCoroutine; public float spawnTimer = 0f; public float unspottedTimer = 0f; public BoomboxItem[] cachedBoomboxes; private Light[] cachedLights; private DoorLock[] cachedDoors; private float slowScanTimer = 0f; private const float SLOW_SCAN_INTERVAL = 2f; public GameObject activeClone = null; public Animator activeCloneAnim = null; public float boomboxRescueTimer = 0f; public bool isPortalOpen = false; public bool spectatorInUpsideDown = false; public GameObject currentClock; public float stareTimer = 0f; public PlayerControllerB cursingPlayer; public bool cursingLocalPlayer; public HashSet hiddenCosmetics = new HashSet(); public Dictionary hiddenLights = new Dictionary(); public Dictionary hiddenTeammateLayers = new Dictionary(); private bool isVecnaVisible = true; public int storedCameraMask = -1; public Camera storedCamera = null; public const int PORTAL_ONLY_LAYER = 23; public const int UPSIDE_DOWN_LAYER = 31; private int timesChoosingAPlayer; private Random vecnaCurseRandom; private bool initializedRandomSeed; public float hauntCooldownTimer = 0f; public VecnaPortalManager portalManager; public GameObject[] outsideNodes; public GameObject[] insideNodes; public float chaseTimer = 0f; public int clocksSpawned = 0; public VecnaCinematicDirector cinematicDirector; [HideInInspector] public NetworkVariable currentPhase = new NetworkVariable(VecnaPhase.Cooldown, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); public VecnaPhase currentLocalPhase = VecnaPhase.Cooldown; private IVecnaState currentState; public bool isCinematicLiftStarted = false; public static List UpsideDownPlayers = new List(); [ServerRpc(RequireOwnership = false)] public void RequestChaseStartServerRpc(int victimId, Vector3 spawnPos, float timerOverride = -1f, bool fromVehicle = false) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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_00cc: 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_0119: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1908950497u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, victimId); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref spawnPos); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref timerOverride, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref fromVehicle, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1908950497u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SyncChaseStartClientRpc(victimId, spawnPos, timerOverride, fromVehicle); } } } [ServerRpc(RequireOwnership = false)] public void RequestHauntEndServerRpc(bool repelledByMusic, bool playerKilled) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2643355442u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref repelledByMusic, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref playerKilled, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2643355442u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SyncHauntEndClientRpc(repelledByMusic, playerKilled); } } } [ServerRpc(RequireOwnership = false)] public void RequestCinematicKillServerRpc(int victimId, Vector3 stopPos, Vector3 lookDir) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: 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_00f1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(525788326u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, victimId); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref stopPos); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref lookDir); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 525788326u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SyncCinematicKillClientRpc(victimId, stopPos, lookDir); } } } [ServerRpc(RequireOwnership = false)] public void StartVehicleCinematicServerRpc(ulong vehicleId, Vector3 spawnPos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(4156460258u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, vehicleId); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref spawnPos); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 4156460258u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; StartVehicleCinematicClientRpc(vehicleId, spawnPos); } } } [ServerRpc(RequireOwnership = false)] public void DropVehicleServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3686382895u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3686382895u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; DropVehicleClientRpc(); } } } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); NetworkVariable obj = currentPhase; obj.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Combine((Delegate?)(object)obj.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(OnPhaseChanged)); } public override void OnNetworkDespawn() { ((NetworkBehaviour)this).OnNetworkDespawn(); NetworkVariable obj = currentPhase; obj.OnValueChanged = (OnValueChangedDelegate)(object)Delegate.Remove((Delegate?)(object)obj.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate(OnPhaseChanged)); } private void OnPhaseChanged(VecnaPhase oldPhase, VecnaPhase newPhase) { if (currentState != null) { currentState.Exit(); } switch (newPhase) { case VecnaPhase.Cooldown: currentState = new VecnaCooldownState(this); break; case VecnaPhase.ClockStalking: currentState = new VecnaClockStalkingState(this); break; case VecnaPhase.ClockSpotted: currentState = new VecnaClockSpottedState(this); break; case VecnaPhase.Chasing: currentState = new VecnaChaseState(this); break; case VecnaPhase.WaitingForVehicleExit: currentState = new VecnaWaitingForExitState(this); break; case VecnaPhase.ExecutingKill: currentState = new VecnaExecutingKillState(this); break; case VecnaPhase.VehicleCinematic: currentState = new VecnaVehicleCinematicState(this); break; } if (currentState != null) { currentState.Enter(); } } private void Awake() { environmentTools = new VecnaEnvironmentManipulator(this); audioTools = new VecnaAudioManager(this); cinematicDirector = new VecnaCinematicDirector(this); portalManager = new VecnaPortalManager(this); } public override void Start() { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Invalid comparison between Unknown and I4 ((EnemyAI)this).Start(); if (currentState == null) { currentState = new VecnaCooldownState(this); currentState.Enter(); } if ((Object)(object)Plugin.ClockPrefab != (Object)null) { AudioSource[] componentsInChildren = Plugin.ClockPrefab.GetComponentsInChildren(true); foreach (AudioSource val in componentsInChildren) { if ((Object)(object)val != (Object)null && (Object)(object)val.clip != (Object)null && (int)val.clip.loadState != 2) { val.clip.LoadAudioData(); } } } if ((Object)(object)stats == (Object)null) { Debug.LogWarning((object)"VECNA: Stats ScriptableObject not assigned! Creating a fallback instance."); stats = ScriptableObject.CreateInstance(); } Plugin.BoundConfig.ApplyTo(stats); for (int j = 0; j < 32; j++) { Physics.IgnoreLayerCollision(23, j, true); Physics.IgnoreLayerCollision(31, j, true); } if (ActiveInstances.Count > 0 && (Object)(object)ActiveInstances[0] != (Object)(object)this) { if (!((Object)(object)ActiveInstances[0] == (Object)null) && !((EnemyAI)ActiveInstances[0]).isEnemyDead && ((Component)ActiveInstances[0]).gameObject.activeInHierarchy) { Debug.LogWarning((object)"VECNA: A duplicate Vecna tried to spawn!."); ToggleGhostVisuals(isVisible: false); if (((NetworkBehaviour)this).IsServer) { ((Component)this).GetComponent().Despawn(true); } return; } ActiveInstances[0] = this; } else if (!ActiveInstances.Contains(this)) { ActiveInstances.Add(this); } if (!RoundManager.Instance.hasInitializedLevelRandomSeed) { RoundManager.Instance.InitializeRandomNumberGenerators(); } outsideNodes = GameObject.FindGameObjectsWithTag("OutsideAINode"); insideNodes = GameObject.FindGameObjectsWithTag("AINode"); if (((NetworkBehaviour)this).IsServer) { ChoosePlayerToCurse(); } ToggleGhostVisuals(isVisible: false); Debug.Log((object)"!!!VECNA CURSE TAKEN HOLD!!!"); ScanNodeProperties componentInChildren = ((Component)this).GetComponentInChildren(true); Terminal val2 = Object.FindObjectOfType(); if (!((Object)(object)componentInChildren != (Object)null) || !((Object)(object)val2 != (Object)null)) { return; } foreach (TerminalNode enemyFile in val2.enemyFiles) { if ((Object)(object)enemyFile != (Object)null && enemyFile.creatureName == "Vecna") { componentInChildren.creatureScanID = enemyFile.creatureFileID; break; } } } private void OnEnable() { VecnaEventManager.OnShipLeft += OnShipLeft; VecnaEventManager.OnPlayerDied += OnVictimDied; VecnaEventManager.OnPlayerDisconnect += OnVictimDisconnected; } private void OnDisable() { VecnaEventManager.OnShipLeft -= OnShipLeft; VecnaEventManager.OnPlayerDied -= OnVictimDied; VecnaEventManager.OnPlayerDisconnect -= OnVictimDisconnected; } private void OnShipLeft() { if (currentPhase.Value == VecnaPhase.Chasing || currentPhase.Value == VecnaPhase.ClockStalking) { ResetHaunt(repelledByMusic: true); } } private void OnVictimDied(PlayerControllerB deadPlayer) { if (((NetworkBehaviour)this).IsServer && !((Object)(object)cursingPlayer != (Object)(object)deadPlayer)) { if (currentPhase.Value != VecnaPhase.ExecutingKill && currentPhase.Value != 0) { ResetHaunt(repelledByMusic: false); } else if (currentPhase.Value == VecnaPhase.Cooldown && hauntCooldownTimer <= 0f) { Debug.Log((object)"VECNA: Target missing/dead. Choosing new victim!"); ChoosePlayerToCurse(); currentPhase.Value = VecnaPhase.ClockStalking; } } } private void OnVictimDisconnected(PlayerControllerB disconnectedPlayer) { OnVictimDied(disconnectedPlayer); } private void PerformSlowEnvironmentScan() { slowScanTimer += Time.deltaTime; if (slowScanTimer >= 2f) { slowScanTimer = 0f; cachedBoomboxes = Object.FindObjectsOfType(); } } public override void OnDestroy() { ((EnemyAI)this).OnDestroy(); if ((Object)(object)currentClock != (Object)null) { Object.Destroy((Object)(object)currentClock); } if ((Object)(object)activeClone != (Object)null) { Object.Destroy((Object)(object)activeClone); activeClone = null; } if ((Object)(object)cinematicDirector.activeFakeBody != (Object)null) { Object.Destroy((Object)(object)cinematicDirector.activeFakeBody); cinematicDirector.activeFakeBody = null; } environmentTools?.RestoreLights(); audioTools?.StopChaseMusic(); UpsideDownPlayers.Clear(); if (ActiveInstances.Contains(this)) { ActiveInstances.Remove(this); } Debug.Log((object)"VECNA: Destroyed. Round wiped and memory cleared."); } public void ChoosePlayerToCurse() { timesChoosingAPlayer++; SFXVolumeLerpTo = 0f; if (timesChoosingAPlayer <= 1) { spawnTimer = stats.spawnInterval - 10f; Debug.Log((object)"VECNA: Level started. First clock spawning in 10 seconds..."); } else { spawnTimer = stats.spawnInterval - 5f; Debug.Log((object)"VECNA: Target eliminated. Acquiring new target in 5 seconds..."); } clocksSpawned = 0; hasPlayedShipTaunt = false; if ((Object)(object)base.creatureVoice != (Object)null) { base.creatureVoice.Stop(); } if (!initializedRandomSeed) { vecnaCurseRandom = new Random(StartOfRound.Instance.randomMapSeed + 158); initializedRandomSeed = true; } float num = 0f; float num2 = 0f; int num3 = 0; int num4 = 0; for (int i = 0; i < 4; i++) { PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[i]; if (!((Object)(object)val == (Object)null)) { if (StartOfRound.Instance.gameStats != null && StartOfRound.Instance.gameStats.allPlayerStats != null && i < StartOfRound.Instance.gameStats.allPlayerStats.Length && StartOfRound.Instance.gameStats.allPlayerStats[i].turnAmount > num3) { num3 = StartOfRound.Instance.gameStats.allPlayerStats[i].turnAmount; num4 = i; } if (val.insanityLevel > num) { num = val.insanityLevel; num2 = i; } } } int[] array = new int[4]; for (int j = 0; j < 4; j++) { PlayerControllerB val2 = StartOfRound.Instance.allPlayerScripts[j]; if ((Object)(object)val2 == (Object)null || !val2.isPlayerControlled || val2.isPlayerDead) { array[j] = 0; continue; } array[j] += 80; if (num2 == (float)j && num > 1f) { array[j] += 50; } if (num4 == j) { array[j] += 30; } if (!val2.hasBeenCriticallyInjured) { array[j] += 10; } if ((Object)(object)val2.currentlyHeldObjectServer != (Object)null && val2.currentlyHeldObjectServer.scrapValue > 150) { array[j] += 30; } } int randomWeightedIndex = RoundManager.Instance.GetRandomWeightedIndex(array, vecnaCurseRandom); cursingPlayer = StartOfRound.Instance.allPlayerScripts[randomWeightedIndex]; if ((Object)(object)cursingPlayer == (Object)null) { cursingPlayer = GameNetworkManager.Instance.localPlayerController; } if (((NetworkBehaviour)this).IsServer && (Object)(object)cursingPlayer != (Object)null) { SyncVictimClientRpc((int)cursingPlayer.playerClientId); } if ((Object)(object)cursingPlayer != (Object)null) { ((EnemyAI)this).ChangeOwnershipOfEnemy(cursingPlayer.actualClientId); cursingLocalPlayer = (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)cursingPlayer; } } [IteratorStateMachine(typeof(d__99))] private IEnumerator NosebleedRoutine(PlayerControllerB victim) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__99(0) { <>4__this = this, victim = victim }; } [ClientRpc] public void SyncVictimClientRpc(int victimPlayerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1430063458u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, victimPlayerId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1430063458u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; cursingPlayer = StartOfRound.Instance.allPlayerScripts[victimPlayerId]; cursingLocalPlayer = (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)cursingPlayer; ((MonoBehaviour)this).StartCoroutine(NosebleedRoutine(cursingPlayer)); Debug.Log((object)$"VECNA: Network synced! The victim is {cursingPlayer.playerUsername}. Local: {cursingLocalPlayer}"); } } } public override void Update() { ((EnemyAI)this).Update(); if (!base.isEnemyDead && !StartOfRound.Instance.allPlayersDead) { environmentTools.UpdateScanner(Time.deltaTime); PerformSlowEnvironmentScan(); UpdateGlobalVisuals(); currentState?.Update(); } } private void UpdateGlobalVisuals() { bool flag = (currentLocalPhase == VecnaPhase.Chasing || currentLocalPhase == VecnaPhase.ExecutingKill || (currentLocalPhase == VecnaPhase.VehicleCinematic && !isCinematicLiftStarted)) && IsVictimOrSpectatingVictim(); bool flag2 = base.skinnedMeshRenderers != null && base.skinnedMeshRenderers.Length != 0 && ((Renderer)base.skinnedMeshRenderers[0]).enabled == flag; if (isVecnaVisible != flag || !flag2) { ToggleGhostVisuals(flag); } if (GameNetworkManager.Instance.localPlayerController.isPlayerDead) { bool flag3 = IsVictimOrSpectatingVictim(); if ((Object)(object)currentClock != (Object)null) { Renderer[] componentsInChildren = currentClock.GetComponentsInChildren(true); if (componentsInChildren.Length != 0 && componentsInChildren[0].enabled != flag3) { Renderer[] array = componentsInChildren; foreach (Renderer val in array) { val.enabled = flag3; } AudioSource[] componentsInChildren2 = currentClock.GetComponentsInChildren(true); AudioSource[] array2 = componentsInChildren2; foreach (AudioSource val2 in array2) { val2.volume = (flag3 ? 1f : 0f); } } } if ((Object)(object)activeClone != (Object)null) { Renderer[] componentsInChildren3 = activeClone.GetComponentsInChildren(true); if (componentsInChildren3.Length != 0 && componentsInChildren3[0].enabled == flag3) { Renderer[] array3 = componentsInChildren3; foreach (Renderer val3 in array3) { val3.enabled = !flag3; } Canvas[] componentsInChildren4 = activeClone.GetComponentsInChildren(true); Canvas[] array4 = componentsInChildren4; foreach (Canvas val4 in array4) { ((Behaviour)val4).enabled = !flag3; } } } if ((Object)(object)cinematicDirector.activeFakeBody != (Object)null) { Renderer[] componentsInChildren5 = cinematicDirector.activeFakeBody.GetComponentsInChildren(true); if (componentsInChildren5.Length != 0 && componentsInChildren5[0].enabled != flag3) { Renderer[] array5 = componentsInChildren5; foreach (Renderer val5 in array5) { val5.enabled = flag3; } Canvas[] componentsInChildren6 = cinematicDirector.activeFakeBody.GetComponentsInChildren(true); Canvas[] array6 = componentsInChildren6; foreach (Canvas val6 in array6) { ((Behaviour)val6).enabled = flag3; } } } if (!cursingLocalPlayer) { if (flag && !spectatorInUpsideDown) { spectatorInUpsideDown = true; if (currentLocalPhase == VecnaPhase.Chasing) { audioTools.StartChaseMusic(); } VecnaVFXHelper.ToggleTeammatesForVictim(this, isVisible: false); foreach (EnemyAI spawnedEnemy in RoundManager.Instance.SpawnedEnemies) { if (!((Object)(object)spawnedEnemy != (Object)null) || !((Object)(object)spawnedEnemy != (Object)(object)this)) { continue; } AudioSource[] componentsInChildren7 = ((Component)spawnedEnemy).GetComponentsInChildren(true); foreach (AudioSource val7 in componentsInChildren7) { if ((Object)(object)val7 != (Object)null) { val7.mute = true; } } } BoomboxItem[] array7 = Object.FindObjectsOfType(); foreach (BoomboxItem val8 in array7) { if ((Object)(object)val8 != (Object)null && (Object)(object)val8.boomboxAudio != (Object)null) { val8.boomboxAudio.mute = true; } } } else if (!flag && spectatorInUpsideDown) { spectatorInUpsideDown = false; audioTools.StopChaseMusic(); VecnaVFXHelper.ToggleTeammatesForVictim(this, isVisible: true); foreach (EnemyAI spawnedEnemy2 in RoundManager.Instance.SpawnedEnemies) { if (!((Object)(object)spawnedEnemy2 != (Object)null) || !((Object)(object)spawnedEnemy2 != (Object)(object)this) || spawnedEnemy2.isEnemyDead) { continue; } AudioSource[] componentsInChildren8 = ((Component)spawnedEnemy2).GetComponentsInChildren(true); foreach (AudioSource val9 in componentsInChildren8) { if ((Object)(object)val9 != (Object)null) { val9.mute = false; } } } BoomboxItem[] array8 = Object.FindObjectsOfType(); foreach (BoomboxItem val10 in array8) { if ((Object)(object)val10 != (Object)null && (Object)(object)val10.boomboxAudio != (Object)null) { val10.boomboxAudio.mute = false; } } } } } if ((currentLocalPhase == VecnaPhase.Chasing || currentLocalPhase == VecnaPhase.ExecutingKill) && (Object)(object)cursingPlayer != (Object)null) { VecnaVFXHelper.TogglePlayerThirdPersonModel(this, cursingPlayer, isVisible: false); cursingPlayer.timeSinceMakingLoudNoise = 100f; if ((cursingLocalPlayer || (GameNetworkManager.Instance.localPlayerController.isPlayerDead && flag)) && currentPhase.Value == VecnaPhase.Chasing) { audioTools.HandleBreathing(); VecnaVFXHelper.EnforceTeammateHeldItems(this); } } if (cursingLocalPlayer && (Object)(object)cursingPlayer != (Object)null && cursingPlayer.isInHangarShipRoom && !hasPlayedShipTaunt) { hasPlayedShipTaunt = true; if (shipTauntCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(shipTauntCoroutine); } shipTauntCoroutine = ((MonoBehaviour)this).StartCoroutine(ShipTransmissionRoutine()); } } [IteratorStateMachine(typeof(d__103))] private IEnumerator ShipTransmissionRoutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__103(0) { <>4__this = this }; } private void LateUpdate() { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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_00a0: 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) portalManager?.UpdatePortalRotation(); if (currentLocalPhase == VecnaPhase.VehicleCinematic) { if ((Object)(object)base.creatureAnimator != (Object)null) { ((Component)base.creatureAnimator).transform.position = cinematicHoverPos; ((Component)base.creatureAnimator).transform.rotation = cinematicHoverRot; } } else if ((Object)(object)base.creatureAnimator != (Object)null && ((Component)base.creatureAnimator).transform.localPosition != Vector3.zero) { ((Component)base.creatureAnimator).transform.localPosition = Vector3.zero; ((Component)base.creatureAnimator).transform.localRotation = Quaternion.identity; } if (IsVictimOrSpectatingVictim() && (currentLocalPhase == VecnaPhase.Chasing || currentLocalPhase == VecnaPhase.ExecutingKill || currentLocalPhase == VecnaPhase.VehicleCinematic)) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; Camera val = localPlayerController.gameplayCamera; if (localPlayerController.isPlayerDead && (Object)(object)StartOfRound.Instance.spectateCamera != (Object)null) { val = StartOfRound.Instance.spectateCamera; } if ((Object)(object)val != (Object)null) { Camera obj = val; obj.cullingMask &= -8388609; Camera obj2 = val; obj2.cullingMask |= int.MinValue; } } } [ClientRpc] public void TogglePortalClientRpc(bool open, NetworkObjectReference boomboxRef, Vector3 position) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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_019e: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1111366090u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref open, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref boomboxRef, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1111366090u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!IsVictimOrSpectatingVictim()) { return; } if (open) { BoomboxItem val3 = null; NetworkObject val4 = default(NetworkObject); if (((NetworkObjectReference)(ref boomboxRef)).TryGet(ref val4, (NetworkManager)null)) { val3 = ((Component)val4).GetComponent(); } if ((Object)(object)val3 == (Object)null) { BoomboxItem[] array = Object.FindObjectsOfType(); foreach (BoomboxItem val5 in array) { if (val5.isPlayingMusic) { val3 = val5; break; } } } portalManager.TogglePortal(open: true, val3, position); } else { portalManager.TogglePortal(open: false, null, position); } } public bool IsVictimOrSpectatingVictim() { if ((Object)(object)cursingPlayer == (Object)null) { return false; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController == (Object)null) { return false; } if ((Object)(object)localPlayerController == (Object)(object)cursingPlayer) { return true; } if (localPlayerController.isPlayerDead && (Object)(object)localPlayerController.spectatedPlayerScript == (Object)(object)cursingPlayer) { return true; } return false; } public bool JobifiedClockLineOfSightCheck() { //IL_0052: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011b: 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_011e: 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_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_012e: 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_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: 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_0141: 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_0152: 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_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: 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) //IL_01b6: 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_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: 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_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: 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_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0213: 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_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)cursingPlayer == (Object)null || (Object)(object)currentClock == (Object)null) { return false; } VehicleController playerVehicle = GetPlayerVehicle(cursingPlayer); Vector3 val; if ((Object)(object)playerVehicle != (Object)null) { val = currentClock.transform.position - ((Component)cursingPlayer.gameplayCamera).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; float num = Vector3.Angle(((Component)cursingPlayer.gameplayCamera).transform.forward, normalized); return num < 50f; } Camera gameplayCamera = cursingPlayer.gameplayCamera; if ((Object)(object)gameplayCamera == (Object)null) { return false; } Vector3 position = ((Component)gameplayCamera).transform.position; Vector3 forward = ((Component)gameplayCamera).transform.forward; Vector3 position2 = currentClock.transform.position; Vector3 val2 = currentClock.transform.position + Vector3.up * 1.5f; val = position2 - position; Vector3 normalized2 = ((Vector3)(ref val)).normalized; val = val2 - position; Vector3 normalized3 = ((Vector3)(ref val)).normalized; bool flag = Vector3.Dot(forward, normalized2) > 0.5f; bool flag2 = Vector3.Dot(forward, normalized3) > 0.5f; if (!flag && !flag2) { return false; } int collidersAndRoomMask = StartOfRound.Instance.collidersAndRoomMask; QueryParameters val3 = default(QueryParameters); ((QueryParameters)(ref val3))..ctor(collidersAndRoomMask, false, (QueryTriggerInteraction)1, false); NativeArray val4 = default(NativeArray); val4..ctor(2, (Allocator)3, (NativeArrayOptions)1); NativeArray val5 = default(NativeArray); val5..ctor(2, (Allocator)3, (NativeArrayOptions)1); val4[0] = new RaycastCommand(position, normalized2, val3, Mathf.Max(0f, Vector3.Distance(position, position2) - 0.1f)); val4[1] = new RaycastCommand(position, normalized3, val3, Mathf.Max(0f, Vector3.Distance(position, val2) - 0.1f)); JobHandle val6 = RaycastCommand.ScheduleBatch(val4, val5, 1, default(JobHandle)); ((JobHandle)(ref val6)).Complete(); RaycastHit val7 = val5[0]; bool flag3 = (Object)(object)((RaycastHit)(ref val7)).collider != (Object)null; val7 = val5[1]; bool flag4 = (Object)(object)((RaycastHit)(ref val7)).collider != (Object)null; val4.Dispose(); val5.Dispose(); return (flag && !flag3) || (flag2 && !flag4); } public bool TrySpawningClock() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_014d: 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_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_018e: 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_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)cursingPlayer == (Object)null) { return false; } VehicleController playerVehicle = GetPlayerVehicle(cursingPlayer); if ((Object)(object)playerVehicle != (Object)null) { Vector3 val = ((Component)playerVehicle).transform.position + ((Component)playerVehicle).transform.forward * 3.8f + ((Component)playerVehicle).transform.up * -1.5f; if (((NetworkBehaviour)this).IsServer) { SpawnClockClientRpc(val, clocksSpawned, ((NetworkBehaviour)playerVehicle).NetworkObjectId); if (clocksSpawned == 1) { SpawnFakeBodyClientRpc(val, ((NetworkBehaviour)playerVehicle).NetworkObjectId); } } stareTimer = 0f; unspottedTimer = 0f; return true; } if (insideNodes == null || outsideNodes == null) { return false; } GameObject[] array = (cursingPlayer.isInsideFactory ? insideNodes : outsideNodes); List list = new List(); GameObject[] array2 = array; foreach (GameObject val2 in array2) { if ((Object)(object)val2 == (Object)null) { continue; } float num = Vector3.Distance(((Component)cursingPlayer).transform.position, val2.transform.position); if (num > 3f && num < 15f && !cursingPlayer.HasLineOfSightToPosition(val2.transform.position, 80f, 100, -1f, -1)) { Vector3 val3 = val2.transform.position + Vector3.up * 1f; if (!Physics.CheckSphere(val3, 0.5f, StartOfRound.Instance.collidersAndRoomMask)) { list.Add(val2); } } } if (list.Count > 0) { int index = vecnaCurseRandom.Next(list.Count); Vector3 position = list[index].transform.position; Vector3 val4 = position; NavMeshHit val5 = default(NavMeshHit); if (NavMesh.SamplePosition(position, ref val5, 5f, -1)) { val4 = ((NavMeshHit)(ref val5)).position; } if (((NetworkBehaviour)this).IsServer) { SpawnClockClientRpc(val4, clocksSpawned, 0uL); if (clocksSpawned == 1) { SpawnFakeBodyClientRpc(val4, 0uL); } } stareTimer = 0f; unspottedTimer = 0f; return true; } return false; } public bool IsMusicPlayingNearVictim() { //IL_0074: 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_008e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)cursingPlayer == (Object)null || cachedBoomboxes == null) { return false; } float num = stats.boomboxRescueRadius * stats.boomboxRescueRadius; BoomboxItem[] array = cachedBoomboxes; foreach (BoomboxItem val in array) { if ((Object)(object)val != (Object)null && val.isPlayingMusic) { Vector3 val2 = ((Component)val).transform.position - ((Component)cursingPlayer).transform.position; float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude; if (sqrMagnitude <= num) { return true; } } } return false; } [ClientRpc] public void SpawnFakeBodyClientRpc(Vector3 clockPos, ulong vehicleId = 0uL) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: 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_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: 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_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: 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_0172: 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_017c: 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_017e: 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_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: 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) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_0296: 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_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: 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_0258: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0267: 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_026d: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(926685957u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref clockPos); BytePacker.WriteValueBitPacked(val2, vehicleId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 926685957u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Vector3 val3 = clockPos; Quaternion identity = Quaternion.identity; Vector3 val4 = Vector3.forward; VehicleController val5 = null; if (vehicleId != 0L && NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(vehicleId, out var value)) { val5 = ((Component)value).GetComponent(); } if ((Object)(object)val5 != (Object)null) { val3 = ((Component)val5).transform.position + ((Component)val5).transform.forward * 3.2f + ((Component)val5).transform.up * 1f; val4 = -((Component)val5).transform.forward; identity = Quaternion.LookRotation(val4); } else { if ((Object)(object)cursingPlayer != (Object)null) { val4 = ((Component)cursingPlayer).transform.position - clockPos; val4.y = 0f; if (val4 != Vector3.zero) { ((Vector3)(ref val4)).Normalize(); } } val3 = clockPos + val4 * 2.5f; RaycastHit val6 = default(RaycastHit); if (Physics.Raycast(clockPos + Vector3.up * 0.5f, val4, ref val6, 2.5f, StartOfRound.Instance.collidersAndRoomMask)) { val3 = ((RaycastHit)(ref val6)).point - val4 * 0.5f; } NavMeshHit val7 = default(NavMeshHit); if (NavMesh.SamplePosition(val3, ref val7, 3f, -1)) { val3 = ((NavMeshHit)(ref val7)).position; } val3 += Vector3.up * 1.5f; identity = Quaternion.LookRotation(val4); } GameObject val8 = cursingPlayer.playersManager.playerRagdolls[0]; cinematicDirector.activeFakeBody = Object.Instantiate(val8, val3, identity); List list = new List(); PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val9 in allPlayerScripts) { if ((Object)(object)val9 != (Object)null && val9.isPlayerControlled && !val9.isPlayerDead) { list.Add(val9); } } PlayerControllerB val10 = cursingPlayer; if (list.Count > 0) { val10 = list[Random.Range(0, list.Count)]; } DeadBodyInfo component = cinematicDirector.activeFakeBody.GetComponent(); if ((Object)(object)component != (Object)null) { component.playerObjectId = (int)val10.playerClientId; component.overrideSpawnPosition = true; component.setMaterialToPlayerSuit = true; if ((Object)(object)component.grabBodyObject != (Object)null) { component.grabBodyObject.grabbable = false; component.grabBodyObject.grabbableToEnemies = false; } } ((MonoBehaviour)this).StartCoroutine(FinalizeFakeBodyRoutine(cinematicDirector.activeFakeBody, val10, val4, cursingLocalPlayer, val5)); } [IteratorStateMachine(typeof(d__111))] private IEnumerator FinalizeFakeBodyRoutine(GameObject fakeBody, PlayerControllerB victim, Vector3 dirToPlayer, bool isLocalPlayer, VehicleController car = null) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__111(0) { <>4__this = this, fakeBody = fakeBody, victim = victim, dirToPlayer = dirToPlayer, isLocalPlayer = isLocalPlayer, car = car }; } [ClientRpc] public void SpawnClockClientRpc(Vector3 spawnPos, int currentClockCount, ulong parentVehicleId = 0uL) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_0460: 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) //IL_0480: Unknown result type (might be due to invalid IL or missing references) //IL_0481: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_05d5: Unknown result type (might be due to invalid IL or missing references) //IL_05dc: Expected O, but got Unknown //IL_05ee: Unknown result type (might be due to invalid IL or missing references) //IL_05f3: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_0602: Unknown result type (might be due to invalid IL or missing references) //IL_0607: Unknown result type (might be due to invalid IL or missing references) //IL_060d: Unknown result type (might be due to invalid IL or missing references) //IL_0612: Unknown result type (might be due to invalid IL or missing references) //IL_065e: Unknown result type (might be due to invalid IL or missing references) //IL_04c3: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Expected O, but got Unknown //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_04eb: Unknown result type (might be due to invalid IL or missing references) //IL_04f0: 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_04fb: Unknown result type (might be due to invalid IL or missing references) //IL_0500: Unknown result type (might be due to invalid IL or missing references) //IL_0566: Unknown result type (might be due to invalid IL or missing references) //IL_059f: Unknown result type (might be due to invalid IL or missing references) //IL_05a4: Unknown result type (might be due to invalid IL or missing references) //IL_05ae: Unknown result type (might be due to invalid IL or missing references) //IL_05b3: Unknown result type (might be due to invalid IL or missing references) //IL_05b8: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_034d: 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_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_03c7: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03e8: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_03f5: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_0437: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4125868582u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref spawnPos); BytePacker.WriteValueBitPacked(val2, currentClockCount); BytePacker.WriteValueBitPacked(val2, parentVehicleId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4125868582u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; try { if ((Object)(object)Plugin.ClockPrefab == (Object)null) { return; } currentClock = Object.Instantiate(Plugin.ClockPrefab, spawnPos, Quaternion.identity); if ((Object)(object)currentClock == (Object)null) { return; } VehicleController val3 = null; if (parentVehicleId != 0L && NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(parentVehicleId, out var value)) { val3 = ((Component)value).GetComponent(); if ((Object)(object)val3 != (Object)null) { currentClock.transform.SetParent(((Component)val3).transform, true); } } AudioSource[] componentsInChildren = currentClock.GetComponentsInChildren(true); AudioSource[] array = componentsInChildren; foreach (AudioSource val4 in array) { if ((Object)(object)val4 != (Object)null) { val4.dopplerLevel = 0f; } if ((Object)(object)SoundManager.Instance != (Object)null && (Object)(object)SoundManager.Instance.diageticMixer != (Object)null) { val4.outputAudioMixerGroup = SoundManager.Instance.diageticMixer.FindMatchingGroups("Master")[0]; } } Vector3 val5 = Vector3.forward; Vector3 val6 = Vector3.forward; if ((Object)(object)cursingPlayer != (Object)null) { val6 = ((Component)cursingPlayer).transform.position - currentClock.transform.position; val6.y = 0f; if (val6 != Vector3.zero) { ((Vector3)(ref val6)).Normalize(); } else { val6 = Vector3.forward; } } if ((Object)(object)val3 != (Object)null) { val5 = val6; } else if ((Object)(object)cursingPlayer != (Object)null && !cursingPlayer.isInsideFactory) { val5 = val6; } else { float num = -1f; int collidersAndRoomMask = StartOfRound.Instance.collidersAndRoomMask; int num2 = 8; NativeArray val7 = default(NativeArray); val7..ctor(num2, (Allocator)3, (NativeArrayOptions)1); NativeArray val8 = default(NativeArray); val8..ctor(num2, (Allocator)3, (NativeArrayOptions)1); Vector3 val9 = spawnPos + Vector3.up * 0.5f; QueryParameters val10 = default(QueryParameters); ((QueryParameters)(ref val10))..ctor(collidersAndRoomMask, false, (QueryTriggerInteraction)1, false); for (int j = 0; j < num2; j++) { Vector3 val11 = Quaternion.Euler(0f, (float)(j * 45), 0f) * Vector3.forward; val7[j] = new RaycastCommand(val9, val11, val10, 20f); } JobHandle val12 = RaycastCommand.ScheduleBatch(val7, val8, 1, default(JobHandle)); ((JobHandle)(ref val12)).Complete(); for (int k = 0; k < num2; k++) { Vector3 val13 = Quaternion.Euler(0f, (float)(k * 45), 0f) * Vector3.forward; RaycastHit val14 = val8[k]; float num3; if (!((Object)(object)((RaycastHit)(ref val14)).collider != (Object)null)) { num3 = 20f; } else { val14 = val8[k]; num3 = ((RaycastHit)(ref val14)).distance; } float num4 = num3; float num5 = Vector3.Dot(val13, val6); float num6 = num4 * (num5 + 1.5f); if (num4 < 1.5f) { num6 *= 0.1f; } if (num6 > num) { num = num6; val5 = val13; } } val7.Dispose(); val8.Dispose(); } if (val5 != Vector3.zero) { currentClock.transform.rotation = Quaternion.LookRotation(val5); currentClock.transform.Rotate(0f, 90f, 0f, (Space)1); if ((Object)(object)val3 == (Object)null) { GameObject val15 = new GameObject("VecnaClockLight"); val15.transform.position = currentClock.transform.position + Vector3.up * 0.1f + val5 * 0.8f; val15.transform.SetParent(currentClock.transform, true); Light val16 = val15.AddComponent(); val16.type = (LightType)0; val16.spotAngle = 110f; val16.innerSpotAngle = 40f; val16.color = new Color(0.1f, 0.9f, 0.8f, 1f); val16.intensity = 20f; val16.range = 12f; val16.shadows = (LightShadows)2; Vector3 val17 = currentClock.transform.position + Vector3.up * 2.2f; val15.transform.LookAt(val17); } else { GameObject val18 = new GameObject("VecnaCarClockLight"); val18.transform.position = currentClock.transform.position + Vector3.up * 1.25f + val5 * 0.4f; val18.transform.SetParent(currentClock.transform, true); Light val19 = val18.AddComponent(); val19.type = (LightType)2; val19.color = new Color(0.8f, 0.8f, 0.8f, 1f); val19.intensity = 1.5f; val19.range = 2.5f; } } if (!cursingLocalPlayer) { Renderer[] componentsInChildren2 = currentClock.GetComponentsInChildren(true); Renderer[] array2 = componentsInChildren2; foreach (Renderer val20 in array2) { val20.enabled = false; } AudioSource[] array3 = componentsInChildren; foreach (AudioSource val21 in array3) { val21.volume = 0f; } Light[] componentsInChildren3 = currentClock.GetComponentsInChildren(true); Light[] array4 = componentsInChildren3; foreach (Light val22 in array4) { ((Behaviour)val22).enabled = false; } } } catch (Exception ex) { Debug.LogWarning((object)("VECNA: Safely caught visual setup error in Clock Spawn: " + ex.Message)); } } [ClientRpc] public void SpotClockClientRpc(int victimId, int currentClockCount) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(353266178u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, victimId); BytePacker.WriteValueBitPacked(val2, currentClockCount); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 353266178u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[victimId]; if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)val3) { val3.JumpToFearLevel(0.8f, true); ((MonoBehaviour)this).CancelInvoke("PlayDelayedChime"); if (currentClockCount == 0 && (Object)(object)finalChimeClip != (Object)null) { ((MonoBehaviour)this).Invoke("PlayDelayedChime", 10f); } if (currentClockCount == 1) { audioTools.PlayClockSpotTaunt(); } } } private void PlayDelayedChime() { audioTools.PlayClockChime(); } [ClientRpc] public void MissedClockWarningClientRpc(int victimId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1057247812u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, victimId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1057247812u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[victimId]; if ((Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)val3 && (Object)(object)HUDManager.Instance != (Object)null) { HUDManager.Instance.DisplayTip("???", "A clock tolled in the distance... your end is near.", true, false, "LC_Tip1"); } } } public void DisappearClock() { if (!((NetworkBehaviour)this).IsServer || (Object)(object)currentClock == (Object)null) { return; } currentPhase.Value = VecnaPhase.ClockStalking; stareTimer = 0f; spawnTimer = 0f; unspottedTimer = 0f; clocksSpawned++; Debug.Log((object)$"Vecna: Clock vanished. Count is now {clocksSpawned}/{stats.clocksBeforeChase}"); bool flag = clocksSpawned >= stats.clocksBeforeChase; DespawnClockClientRpc(flag); if (!flag) { return; } VehicleController val = GetPlayerVehicle(cursingPlayer); if ((Object)(object)cursingPlayer != (Object)null && (Object)(object)val == (Object)null) { VehicleController[] array = Object.FindObjectsOfType(); VehicleController[] array2 = array; foreach (VehicleController val2 in array2) { if ((Object)(object)val2.currentDriver == (Object)(object)cursingPlayer || (Object)(object)val2.currentPassenger == (Object)(object)cursingPlayer) { val = val2; break; } } } if ((Object)(object)val != (Object)null) { cinematicVehicle = val; currentPhase.Value = VecnaPhase.VehicleCinematic; cinematicTimer = -999f; ((MonoBehaviour)this).StartCoroutine(StopVehicleAndSpawnVecnaRoutine(val)); } else { StartChase(); } } [IteratorStateMachine(typeof(d__117))] private IEnumerator StopVehicleAndSpawnVecnaRoutine(VehicleController car) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__117(0) { <>4__this = this, car = car }; } [ClientRpc] public void ForceVehicleStopClientRpc(ulong vehicleId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3780686138u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, vehicleId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3780686138u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(vehicleId, out var value)) { return; } VehicleController component = ((Component)value).GetComponent(); if ((Object)(object)component != (Object)null) { component.SetIgnition(false); if ((Object)(object)component.mainRigidbody != (Object)null) { ((MonoBehaviour)this).StartCoroutine(ApplyBrakesRoutine(component)); } } } [IteratorStateMachine(typeof(d__119))] private IEnumerator ApplyBrakesRoutine(VehicleController car) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__119(0) { <>4__this = this, car = car }; } [ClientRpc] public void StartVehicleCinematicClientRpc(ulong vehicleId, Vector3 spawnPos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //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_0168: 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_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0181: 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_0195: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: 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_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_049d: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3831585480u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, vehicleId); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref spawnPos); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3831585480u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; currentLocalPhase = VecnaPhase.VehicleCinematic; isCinematicLiftStarted = false; base.inSpecialAnimation = true; base.enemyType.disableAnimatorWhenFar = false; if (!NetworkManager.Singleton.SpawnManager.SpawnedObjects.TryGetValue(vehicleId, out var value)) { return; } cinematicVehicle = ((Component)value).GetComponent(); if (!((Object)(object)cinematicVehicle != (Object)null)) { return; } currentLocalPhase = VecnaPhase.VehicleCinematic; canKill = false; base.isOutside = true; cinematicHoverPos = spawnPos; Vector3 val3 = ((Component)cinematicVehicle).transform.position - spawnPos; val3.y = 0f; cinematicHoverRot = ((val3 != Vector3.zero) ? Quaternion.LookRotation(val3) : Quaternion.identity); if ((Object)(object)base.agent != (Object)null && ((Behaviour)base.agent).isActiveAndEnabled) { base.agent.speed = 0f; RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(spawnPos, Vector3.down, ref val4, 50f, StartOfRound.Instance.collidersAndRoomMask)) { NavMeshHit val5 = default(NavMeshHit); if (NavMesh.SamplePosition(((RaycastHit)(ref val4)).point, ref val5, 10f, -1)) { base.agent.Warp(((NavMeshHit)(ref val5)).position); } else { base.agent.Warp(((RaycastHit)(ref val4)).point); } } } if (cursingLocalPlayer) { if (!UpsideDownPlayers.Contains(cursingPlayer)) { UpsideDownPlayers.Add(cursingPlayer); } Camera gameplayCamera = GameNetworkManager.Instance.localPlayerController.gameplayCamera; if ((Object)(object)gameplayCamera != (Object)null) { gameplayCamera.cullingMask &= -8388609; gameplayCamera.cullingMask |= int.MinValue; } ToggleGhostVisuals(isVisible: true); cursingPlayer.JumpToFearLevel(1f, true); VecnaVFXHelper.ToggleTeammatesForVictim(this, isVisible: false); foreach (EnemyAI spawnedEnemy in RoundManager.Instance.SpawnedEnemies) { if (!((Object)(object)spawnedEnemy != (Object)null) || !((Object)(object)spawnedEnemy != (Object)(object)this)) { continue; } AudioSource[] componentsInChildren = ((Component)spawnedEnemy).GetComponentsInChildren(true); foreach (AudioSource val6 in componentsInChildren) { if ((Object)(object)val6 != (Object)null) { val6.mute = true; } } } BoomboxItem[] array = Object.FindObjectsOfType(); foreach (BoomboxItem val7 in array) { if ((Object)(object)val7 != (Object)null && (Object)(object)val7.boomboxAudio != (Object)null) { val7.boomboxAudio.mute = true; } } if ((Object)(object)vehicleLiftVoiceLine != (Object)null && (Object)(object)base.creatureVoice != (Object)null) { base.creatureVoice.PlayOneShot(vehicleLiftVoiceLine, 1f); } else { audioTools.PlayClockSpotTaunt(); } } else { ToggleGhostVisuals(isVisible: false); } if ((Object)(object)base.creatureAnimator != (Object)null) { base.creatureAnimator.cullingMode = (AnimatorCullingMode)0; base.creatureAnimator.ResetTrigger(AnimBlastDoor); base.creatureAnimator.ResetTrigger(AnimBlastDoorDone); base.creatureAnimator.Update(0f); } cinematicTimer = -4f; vehicleReachedApex = false; vehicleStartPos = ((Component)cinematicVehicle).transform.position; vehicleTargetPos = vehicleStartPos + new Vector3(0f, 14f, 0f); if ((Object)(object)cinematicVehicle.mainRigidbody != (Object)null) { cinematicVehicle.mainRigidbody.isKinematic = false; cinematicVehicle.mainRigidbody.useGravity = false; } cinematicVehicle.SetIgnition(false); } public void EndCinematicAndWaitForExit() { if (((NetworkBehaviour)this).IsServer) { DropVehicleServerRpc(); if ((Object)(object)cursingPlayer != (Object)null && !cursingPlayer.isPlayerDead) { currentPhase.Value = VecnaPhase.WaitingForVehicleExit; } else { ResetHaunt(repelledByMusic: false); } } } [ClientRpc] public void DropVehicleClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_0208: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3830277317u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3830277317u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; currentLocalPhase = VecnaPhase.WaitingForVehicleExit; try { if ((Object)(object)cinematicVehicle.driverSideDoor != (Object)null && !cinematicVehicle.driverSideDoor.boolValue) { cinematicVehicle.driverSideDoor.SetBoolOnClientOnly(true); } if ((Object)(object)cinematicVehicle.passengerSideDoor != (Object)null && !cinematicVehicle.passengerSideDoor.boolValue) { cinematicVehicle.passengerSideDoor.SetBoolOnClientOnly(true); } cinematicVehicle.SetBackDoorOpen(true); } catch (Exception ex) { Debug.LogWarning((object)("VECNA: Safely caught door animation error during drop: " + ex.Message)); } if ((Object)(object)base.creatureAnimator != (Object)null) { base.creatureAnimator.ResetTrigger("blastDoor"); base.creatureAnimator.SetTrigger("blastDoorDone"); } if ((Object)(object)cinematicVehicle != (Object)null && (Object)(object)cinematicVehicle.mainRigidbody != (Object)null) { cinematicVehicle.mainRigidbody.isKinematic = false; cinematicVehicle.mainRigidbody.useGravity = true; cinematicVehicle.mainRigidbody.AddForce(Vector3.down * 40f, (ForceMode)2); } cinematicVehicle = null; } public VehicleController GetPlayerVehicle(PlayerControllerB player) { if ((Object)(object)player == (Object)null) { return null; } VehicleController[] array = Object.FindObjectsOfType(); VehicleController[] array2 = array; foreach (VehicleController val in array2) { if ((Object)(object)val.currentDriver == (Object)(object)player || (Object)(object)val.currentPassenger == (Object)(object)player) { return val; } } VehicleController componentInParent = ((Component)player).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null) { return componentInParent; } return null; } [ClientRpc] public void DespawnClockClientRpc(bool isFinalClock) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(908085663u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isFinalClock, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 908085663u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)currentClock != (Object)null) { ((MonoBehaviour)this).StartCoroutine(cinematicDirector.CinematicClockDespawnRoutine(currentClock, isFinalClock)); currentClock = null; } } } public static bool IsPlayerInUpsideDown(PlayerControllerB playerToCheck) { return (Object)(object)playerToCheck != (Object)null && UpsideDownPlayers.Contains(playerToCheck); } public void StartChase() { //IL_014c: 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_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: 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_01da: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)cursingPlayer == (Object)null) { return; } if ((Object)(object)base.agent != (Object)null) { ((Behaviour)base.agent).enabled = true; } base.targetPlayer = cursingPlayer; GameObject[] array = (cursingPlayer.isInsideFactory ? insideNodes : outsideNodes); List list = new List(); if (array != null) { GameObject[] array2 = array; foreach (GameObject val in array2) { float num = Vector3.Distance(((Component)cursingPlayer).transform.position, val.transform.position); if (num > 15f && num < 40f && !cursingPlayer.HasLineOfSightToPosition(val.transform.position, 80f, 100, -1f, -1)) { list.Add(val); } } } Transform val2 = null; if (list.Count > 0) { val2 = list[Random.Range(0, list.Count)].transform; } else { val2 = ((EnemyAI)this).ChooseFarthestNodeFromPosition(((Component)cursingPlayer).transform.position, true, 0, false, 50, -1); if ((Object)(object)val2 == (Object)null && base.allAINodes != null && base.allAINodes.Length != 0) { val2 = base.allAINodes[Random.Range(0, base.allAINodes.Length)].transform; } } Vector3 spawnPos = ((Component)this).transform.position; if ((Object)(object)val2 != (Object)null) { NavMeshHit val3 = default(NavMeshHit); spawnPos = ((!NavMesh.SamplePosition(val2.position, ref val3, 5f, -1)) ? val2.position : ((NavMeshHit)(ref val3)).position); } int victimId = (int)cursingPlayer.playerClientId; if (((NetworkBehaviour)this).IsServer) { SyncChaseStartClientRpc(victimId, spawnPos); } else { RequestChaseStartServerRpc(victimId, spawnPos); } Debug.Log((object)"Vecna: PHASE 2 INITIATED. The chase begins."); } public override void OnCollideWithPlayer(Collider other) { if (canKill) { ((EnemyAI)this).OnCollideWithPlayer(other); TriggerCinematicKill(cursingPlayer); } } [ClientRpc] public void SyncChaseStartClientRpc(int victimId, Vector3 spawnPos, float timerOverride = -1f, bool fromVehicle = false) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Invalid comparison between Unknown and I4 //IL_0718: Unknown result type (might be due to invalid IL or missing references) //IL_0725: Unknown result type (might be due to invalid IL or missing references) //IL_073f: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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_00cc: 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_01a9: 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_0859: Unknown result type (might be due to invalid IL or missing references) //IL_085e: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_088b: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_09a8: Unknown result type (might be due to invalid IL or missing references) //IL_09ad: Unknown result type (might be due to invalid IL or missing references) //IL_09b1: Unknown result type (might be due to invalid IL or missing references) //IL_09b6: Unknown result type (might be due to invalid IL or missing references) //IL_09bf: Unknown result type (might be due to invalid IL or missing references) //IL_09d4: Unknown result type (might be due to invalid IL or missing references) //IL_09db: Unknown result type (might be due to invalid IL or missing references) //IL_09e3: Unknown result type (might be due to invalid IL or missing references) //IL_09f8: Unknown result type (might be due to invalid IL or missing references) //IL_09ff: Unknown result type (might be due to invalid IL or missing references) //IL_0a07: Unknown result type (might be due to invalid IL or missing references) //IL_0a1c: Unknown result type (might be due to invalid IL or missing references) //IL_0a23: Unknown result type (might be due to invalid IL or missing references) //IL_0a2b: Unknown result type (might be due to invalid IL or missing references) //IL_0a3f: Unknown result type (might be due to invalid IL or missing references) //IL_0a53: Unknown result type (might be due to invalid IL or missing references) //IL_0a58: Unknown result type (might be due to invalid IL or missing references) //IL_0a75: Unknown result type (might be due to invalid IL or missing references) //IL_04a9: Unknown result type (might be due to invalid IL or missing references) //IL_04ae: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Unknown result type (might be due to invalid IL or missing references) //IL_04c0: Unknown result type (might be due to invalid IL or missing references) //IL_051b: Unknown result type (might be due to invalid IL or missing references) //IL_0520: Unknown result type (might be due to invalid IL or missing references) //IL_050d: Unknown result type (might be due to invalid IL or missing references) //IL_0525: 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_0533: Unknown result type (might be due to invalid IL or missing references) //IL_053a: Unknown result type (might be due to invalid IL or missing references) //IL_053f: Unknown result type (might be due to invalid IL or missing references) //IL_0544: Unknown result type (might be due to invalid IL or missing references) //IL_0546: Unknown result type (might be due to invalid IL or missing references) //IL_0548: Unknown result type (might be due to invalid IL or missing references) //IL_0552: 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) //IL_055c: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Unknown result type (might be due to invalid IL or missing references) //IL_0560: 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_0591: 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) //IL_05a0: Unknown result type (might be due to invalid IL or missing references) //IL_05a5: Unknown result type (might be due to invalid IL or missing references) //IL_0584: Unknown result type (might be due to invalid IL or missing references) //IL_0589: Unknown result type (might be due to invalid IL or missing references) //IL_05a8: Unknown result type (might be due to invalid IL or missing references) //IL_05aa: Unknown result type (might be due to invalid IL or missing references) //IL_05af: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3486782502u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, victimId); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref spawnPos); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref timerOverride, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref fromVehicle, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3486782502u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB item = StartOfRound.Instance.allPlayerScripts[victimId]; if (!UpsideDownPlayers.Contains(item)) { UpsideDownPlayers.Add(item); } if (((NetworkBehaviour)this).IsServer) { currentPhase.Value = VecnaPhase.Chasing; } if (timerOverride > 0f) { ((MonoBehaviour)this).StartCoroutine(DelayKillSwitchRoutine()); } else { canKill = true; } currentLocalPhase = VecnaPhase.Chasing; base.inSpecialAnimation = false; if ((Object)(object)base.creatureAnimator != (Object)null) { ((Component)base.creatureAnimator).transform.localPosition = Vector3.zero; ((Component)base.creatureAnimator).transform.localRotation = Quaternion.identity; } cursingPlayer = StartOfRound.Instance.allPlayerScripts[victimId]; cursingLocalPlayer = (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)cursingPlayer; float num = audioTools.GetChaseMusicLength(); if (timerOverride > 0f) { num = timerOverride; } if (cursingLocalPlayer) { audioTools.StartChaseMusic(); } chaseTimer = num; boomboxRescueTimer = 0f; isPortalOpen = false; base.serverPosition = spawnPos; ((Component)this).transform.position = spawnPos; base.isOutside = !cursingPlayer.isInsideFactory; if ((Object)(object)base.agent != (Object)null) { ((Behaviour)base.agent).enabled = true; if (((Behaviour)base.agent).isActiveAndEnabled) { base.agent.Warp(spawnPos); } base.agent.speed = stats.chaseSpeed; } if (cursingLocalPlayer) { ToggleGhostVisuals(isVisible: true); cursingPlayer.JumpToFearLevel(1f, true); if (hiddenTeammateLayers.Count == 0) { VecnaVFXHelper.ToggleTeammatesForVictim(this, isVisible: false); } foreach (EnemyAI spawnedEnemy in RoundManager.Instance.SpawnedEnemies) { if (!((Object)(object)spawnedEnemy != (Object)null) || !((Object)(object)spawnedEnemy != (Object)(object)this)) { continue; } AudioSource[] componentsInChildren = ((Component)spawnedEnemy).GetComponentsInChildren(true); foreach (AudioSource val3 in componentsInChildren) { if ((Object)(object)val3 != (Object)null) { val3.mute = true; } } } BoomboxItem[] array = Object.FindObjectsOfType(); foreach (BoomboxItem val4 in array) { if ((Object)(object)val4 != (Object)null && (Object)(object)val4.boomboxAudio != (Object)null) { val4.boomboxAudio.mute = true; } } } else { ToggleGhostVisuals(isVisible: false); } if ((Object)(object)base.creatureAnimator != (Object)null) { base.creatureAnimator.SetTrigger(AnimStartWalk); } if ((Object)(object)HUDManager.Instance != (Object)null && cursingLocalPlayer) { HUDManager.Instance.DisplayTip("VECNA", "He is here... Outrun time", true, false, "LC_Tip1"); } if ((Object)(object)activeClone != (Object)null) { Object.Destroy((Object)(object)activeClone); activeClone = null; } if ((Object)(object)Plugin.ClonePrefab != (Object)null) { Vector3 val5 = ((Component)cursingPlayer).transform.position; Quaternion rotation = ((Component)cursingPlayer).transform.rotation; if (fromVehicle) { VehicleController playerVehicle = GetPlayerVehicle(cursingPlayer); if ((Object)(object)playerVehicle != (Object)null) { bool flag = (Object)(object)playerVehicle.currentDriver == (Object)(object)cursingPlayer; Vector3 val6 = (flag ? (-((Component)playerVehicle).transform.right) : ((Component)playerVehicle).transform.right); Vector3 val7 = ((Component)playerVehicle).transform.position + val6 * 3.5f; Vector3 val8 = val7 + Vector3.up * 2f; RaycastHit val9 = default(RaycastHit); val5 = ((!Physics.Raycast(val8, Vector3.down, ref val9, 40f, StartOfRound.Instance.collidersAndRoomMask)) ? (val7 - Vector3.up * 14f) : ((RaycastHit)(ref val9)).point); rotation = Quaternion.LookRotation(val6); try { InteractTrigger[] componentsInChildren2 = ((Component)playerVehicle).GetComponentsInChildren(true); InteractTrigger[] array2 = componentsInChildren2; foreach (InteractTrigger val10 in array2) { string text = ((Object)((Component)val10).gameObject).name.ToLower(); Transform parent = ((Component)val10).transform.parent; string text2 = (((Object)(object)parent != (Object)null) ? ((Object)parent).name.ToLower() : ""); if (flag && (text.Contains("left") || text.Contains("driver") || text2.Contains("left") || text2.Contains("driver"))) { ((UnityEvent)(object)val10.onInteract)?.Invoke(cursingPlayer); break; } if (!flag && (text.Contains("right") || text.Contains("passenger") || text2.Contains("right") || text2.Contains("passenger"))) { ((UnityEvent)(object)val10.onInteract)?.Invoke(cursingPlayer); break; } } playerVehicle.SetBackDoorOpen(true); } catch (Exception ex) { Debug.LogWarning((object)("VECNA: Safely caught door animation error: " + ex.Message)); } } } activeClone = Object.Instantiate(Plugin.ClonePrefab, val5, ((Component)cursingPlayer).transform.rotation); activeClone.transform.localScale = Vector3.one; Collider[] componentsInChildren3 = activeClone.GetComponentsInChildren(true); foreach (Collider val11 in componentsInChildren3) { Object.Destroy((Object)(object)val11); } CharacterController[] componentsInChildren4 = activeClone.GetComponentsInChildren(true); foreach (CharacterController val12 in componentsInChildren4) { Object.Destroy((Object)(object)val12); } activeCloneAnim = activeClone.GetComponentInChildren(); if ((Object)(object)activeCloneAnim != (Object)null) { activeCloneAnim.cullingMode = (AnimatorCullingMode)0; ((Behaviour)activeCloneAnim).enabled = true; if ((Object)(object)Plugin.ModAssets != (Object)null) { activeCloneAnim.runtimeAnimatorController = Plugin.ModAssets.LoadAsset("TranceSnap"); } } MeshRenderer[] componentsInChildren5 = activeClone.GetComponentsInChildren(); foreach (MeshRenderer val13 in componentsInChildren5) { if (!((Object)((Component)val13).gameObject).name.Contains("CloneNametag")) { Vector3 localScale = ((Component)val13).transform.localScale; if (((Vector3)(ref localScale)).sqrMagnitude > 10f) { ((Component)val13).transform.localScale = new Vector3(1f, 1f, 1f); } } } VecnaVFXHelper.DressCloneLikePlayer(activeClone, cursingPlayer); if ((Object)(object)cursingPlayer.usernameCanvas != (Object)null) { Transform val14 = null; Transform[] componentsInChildren6 = activeClone.GetComponentsInChildren(); foreach (Transform val15 in componentsInChildren6) { string text3 = ((Object)val15).name.ToLower().Replace("_", "."); if (text3.Contains("spine.004") && !text3.Contains("end")) { val14 = val15; break; } } if ((Object)(object)val14 == (Object)null) { val14 = activeClone.transform; } GameObject val16 = Object.Instantiate(((Component)cursingPlayer.usernameCanvas).gameObject); ((Object)val16).name = "CloneNametag"; val16.transform.SetParent(val14); Vector3 lossyScale = ((Component)cursingPlayer.usernameCanvas).transform.lossyScale; Vector3 lossyScale2 = val14.lossyScale; val16.transform.localScale = new Vector3((lossyScale2.x > 0f) ? (lossyScale.x / lossyScale2.x) : 0f, (lossyScale2.y > 0f) ? (lossyScale.y / lossyScale2.y) : 0f, (lossyScale2.z > 0f) ? (lossyScale.z / lossyScale2.z) : 0f); val16.transform.position = val14.position + new Vector3(0f, 0.6f, 0f); val16.transform.rotation = activeClone.transform.rotation; Canvas component = val16.GetComponent(); if ((Object)(object)component != (Object)null) { ((Behaviour)component).enabled = true; } CanvasGroup component2 = val16.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.alpha = 1f; } MonoBehaviour[] componentsInChildren7 = val16.GetComponentsInChildren(); foreach (MonoBehaviour val17 in componentsInChildren7) { if (!(val17 is TextMeshProUGUI) && ((object)val17).GetType().Name != "PlayerNameBillboard") { Object.DestroyImmediate((Object)(object)val17); } } TextMeshProUGUI componentInChildren = val16.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { ((TMP_Text)componentInChildren).text = cursingPlayer.playerUsername; ((Behaviour)componentInChildren).enabled = true; } val16.SetActive(true); } } if (cursingLocalPlayer && (Object)(object)cursingPlayer != (Object)null) { if ((Object)(object)activeClone != (Object)null) { Renderer[] componentsInChildren8 = activeClone.GetComponentsInChildren(true); Renderer[] array3 = componentsInChildren8; foreach (Renderer val18 in array3) { val18.enabled = false; } Canvas[] componentsInChildren9 = activeClone.GetComponentsInChildren(true); Canvas[] array4 = componentsInChildren9; foreach (Canvas val19 in array4) { ((Behaviour)val19).enabled = false; } } EntranceTeleport[] array5 = Object.FindObjectsOfType(); EntranceTeleport[] array6 = array5; foreach (EntranceTeleport val20 in array6) { InteractTrigger component3 = ((Component)val20).GetComponent(); if ((Object)(object)component3 != (Object)null) { component3.interactable = false; } } } if ((Object)(object)cursingPlayer != (Object)null) { VecnaVFXHelper.TogglePlayerThirdPersonModel(this, cursingPlayer, isVisible: false); } } [IteratorStateMachine(typeof(d__130))] private IEnumerator DelayKillSwitchRoutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__130(0) { <>4__this = this }; } public void ToggleGhostVisuals(bool isVisible) { isVecnaVisible = isVisible; ((EnemyAI)this).EnableEnemyMesh(isVisible, true, false); ScanNodeProperties componentInChildren = ((Component)this).gameObject.GetComponentInChildren(true); if ((Object)(object)componentInChildren != (Object)null) { ((Component)componentInChildren).gameObject.SetActive(isVisible); } int layer = (isVisible ? 31 : 23); ((Component)this).gameObject.layer = layer; Transform[] componentsInChildren = ((Component)this).gameObject.GetComponentsInChildren(true); foreach (Transform val in componentsInChildren) { if (((Object)val).name.Contains("MapDot")) { ((Component)val).gameObject.SetActive(isVisible); } } } [ClientRpc] public void PlayDoorAnimationClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(258004118u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 258004118u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(DoorAnimationRoutine()); } } } [IteratorStateMachine(typeof(d__133))] private IEnumerator DoorAnimationRoutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__133(0) { <>4__this = this }; } public void ResetHaunt(bool repelledByMusic, bool playerKilled = false) { portalManager?.DestroyEscapePortal(); if (playerKilled) { Debug.Log((object)"VECNA: Player killed successfully. Sequence complete."); } else if (repelledByMusic) { Debug.Log((object)"VECNA: Haunt broken by Boombox/Stun!"); } else { Debug.Log((object)"VECNA: Chase timer expired naturally. Haunt ending."); } if (((NetworkBehaviour)this).IsServer) { SyncHauntEndClientRpc(repelledByMusic, playerKilled); } else { RequestHauntEndServerRpc(repelledByMusic, playerKilled); } } [ClientRpc] public void SyncHauntEndClientRpc(bool repelledByMusic, bool playerKilled) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_048b: Unknown result type (might be due to invalid IL or missing references) //IL_0490: Unknown result type (might be due to invalid IL or missing references) //IL_049a: Unknown result type (might be due to invalid IL or missing references) //IL_049f: Unknown result type (might be due to invalid IL or missing references) //IL_04a4: Unknown result type (might be due to invalid IL or missing references) //IL_04f1: Unknown result type (might be due to invalid IL or missing references) //IL_03fa: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3898342388u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref repelledByMusic, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref playerKilled, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3898342388u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (((NetworkBehaviour)this).IsServer) { currentPhase.Value = VecnaPhase.Cooldown; } currentLocalPhase = VecnaPhase.Cooldown; if ((Object)(object)base.creatureAnimator != (Object)null) { ((Component)base.creatureAnimator).transform.localPosition = Vector3.zero; ((Component)base.creatureAnimator).transform.localRotation = Quaternion.identity; } canKill = false; base.inSpecialAnimation = false; boomboxRescueTimer = 0f; isPortalOpen = false; portalManager?.DestroyEscapePortal(); Camera val3 = GameNetworkManager.Instance.localPlayerController.gameplayCamera; if (GameNetworkManager.Instance.localPlayerController.isPlayerDead && (Object)(object)StartOfRound.Instance.spectateCamera != (Object)null) { val3 = StartOfRound.Instance.spectateCamera; } if ((Object)(object)val3 != (Object)null) { Camera obj = val3; obj.cullingMask &= -8388609; Camera obj2 = val3; obj2.cullingMask &= 0x7FFFFFFF; } if (!cursingLocalPlayer && spectatorInUpsideDown) { spectatorInUpsideDown = false; audioTools.StopChaseMusic(); VecnaVFXHelper.ToggleTeammatesForVictim(this, isVisible: true); hiddenTeammateLayers.Clear(); } if ((Object)(object)cursingPlayer != (Object)null) { cursingPlayer.inAnimationWithEnemy = null; cursingPlayer.inSpecialInteractAnimation = false; if (!cursingPlayer.isPlayerDead) { cursingPlayer.disableLookInput = false; cursingPlayer.disableMoveInput = false; cursingPlayer.disableInteract = false; Rigidbody component = ((Component)cursingPlayer).GetComponent(); if ((Object)(object)component != (Object)null) { component.isKinematic = true; } ((Collider)cursingPlayer.thisController).enabled = true; } if (UpsideDownPlayers.Contains(cursingPlayer)) { UpsideDownPlayers.Remove(cursingPlayer); } } if (!playerKilled && cursingLocalPlayer) { audioTools.PlayEscapeVoiceLine(); } if (base.allAINodes != null && base.allAINodes.Length != 0) { Transform val4 = base.allAINodes[0].transform; if ((Object)(object)cursingPlayer != (Object)null) { Transform val5 = ((EnemyAI)this).ChooseFarthestNodeFromPosition(((Component)cursingPlayer).transform.position, false, 0, false, 50, -1); if ((Object)(object)val5 != (Object)null) { val4 = val5; } } if ((Object)(object)base.agent != (Object)null) { ((Behaviour)base.agent).enabled = true; } if ((Object)(object)base.agent != (Object)null && ((Behaviour)base.agent).isActiveAndEnabled) { base.agent.speed = 0f; base.agent.Warp(val4.position); } } ToggleGhostVisuals(isVisible: false); audioTools.StopChaseMusic(); clocksSpawned = 0; if ((Object)(object)currentClock != (Object)null) { Object.Destroy((Object)(object)currentClock); currentClock = null; } if (cursingLocalPlayer && (Object)(object)cursingPlayer != (Object)null) { if ((Object)(object)activeClone != (Object)null) { Vector3 val6 = activeClone.transform.position + Vector3.up * 1.5f; Object.Destroy((Object)(object)activeClone); activeClone = null; cursingPlayer.fallValue = 0f; cursingPlayer.fallValueUncapped = 0f; ((Collider)cursingPlayer.thisController).enabled = false; cursingPlayer.TeleportPlayer(val6, false, 0f, false, true); if (!cursingPlayer.isPlayerDead) { ((Collider)cursingPlayer.thisController).enabled = true; } if (!playerKilled && (Object)(object)HUDManager.Instance != (Object)null) { HUDManager.Instance.DisplayTip("SURVIVED", "You have regained control of your body.", false, false, "LC_Tip1"); } } VecnaVFXHelper.ToggleTeammatesForVictim(this, isVisible: true); hiddenTeammateLayers.Clear(); } if ((Object)(object)activeClone != (Object)null) { Object.Destroy((Object)(object)activeClone); activeClone = null; } if ((Object)(object)cinematicDirector.activeFakeBody != (Object)null) { Object.Destroy((Object)(object)cinematicDirector.activeFakeBody); cinematicDirector.activeFakeBody = null; } environmentTools.RestoreLights(); if ((Object)(object)cursingPlayer != (Object)null) { VecnaVFXHelper.TogglePlayerThirdPersonModel(this, cursingPlayer, isVisible: true); if (cursingLocalPlayer) { EntranceTeleport[] array = Object.FindObjectsOfType(); EntranceTeleport[] array2 = array; foreach (EntranceTeleport val7 in array2) { InteractTrigger component2 = ((Component)val7).GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.interactable = true; } } cursingPlayer.voiceMuffledByEnemy = false; foreach (EnemyAI spawnedEnemy in RoundManager.Instance.SpawnedEnemies) { if ((Object)(object)spawnedEnemy != (Object)(object)this && !spawnedEnemy.isEnemyDead) { AudioSource[] componentsInChildren = ((Component)spawnedEnemy).GetComponentsInChildren(true); foreach (AudioSource val8 in componentsInChildren) { val8.mute = false; } } } } } if (((NetworkBehaviour)this).IsServer) { hauntCooldownTimer = (repelledByMusic ? 60f : 15f); } if (repelledByMusic || playerKilled) { cursingPlayer = null; } if (!cursingLocalPlayer) { return; } BoomboxItem[] array3 = Object.FindObjectsOfType(); foreach (BoomboxItem val9 in array3) { if ((Object)(object)val9.boomboxAudio != (Object)null) { val9.boomboxAudio.mute = false; } } } [ClientRpc] public void SyncCinematicKillClientRpc(int victimPlayerId, Vector3 stopPos, Vector3 lookDir) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0229: 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) //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_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0248: 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_0219: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4085935493u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, victimPlayerId); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref stopPos); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref lookDir); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4085935493u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (((NetworkBehaviour)this).IsServer) { currentPhase.Value = VecnaPhase.ExecutingKill; } currentLocalPhase = VecnaPhase.ExecutingKill; PlayerControllerB val3 = StartOfRound.Instance.allPlayerScripts[victimPlayerId]; bool flag = (Object)(object)GameNetworkManager.Instance.localPlayerController == (Object)(object)val3; VehicleController playerVehicle = GetPlayerVehicle(val3); if ((Object)(object)playerVehicle != (Object)null) { if ((Object)(object)StartOfRound.Instance != (Object)null && (Object)(object)StartOfRound.Instance.playersContainer != (Object)null) { ((Component)val3).transform.SetParent(StartOfRound.Instance.playersContainer, true); } val3.inSpecialInteractAnimation = false; val3.inAnimationWithEnemy = null; playerVehicle.SetIgnition(false); if ((Object)(object)playerVehicle.currentDriver == (Object)(object)val3) { playerVehicle.currentDriver = null; } if ((Object)(object)playerVehicle.currentPassenger == (Object)(object)val3) { playerVehicle.currentPassenger = null; } } if (flag) { Vector3 val4 = ((Component)this).transform.position - ((Component)val3).transform.position; val4.y = 0f; if (val4 == Vector3.zero) { val4 = ((Component)this).transform.forward; } ((Vector3)(ref val4)).Normalize(); stopPos = ((Component)val3).transform.position + val4 * 2.5f; lookDir = -val4; } if ((Object)(object)base.agent != (Object)null && ((Behaviour)base.agent).isActiveAndEnabled && base.agent.isOnNavMesh) { base.moveTowardsDestination = false; base.agent.speed = 0f; base.agent.velocity = Vector3.zero; base.agent.ResetPath(); base.agent.Warp(stopPos); } ((Component)this).transform.position = stopPos; base.serverPosition = stopPos; ((Component)this).transform.rotation = Quaternion.LookRotation(lookDir); if (flag) { audioTools.StopBreathing(); audioTools.StopChaseMusic(); if ((Object)(object)vecnafpexecution != (Object)null) { ((MonoBehaviour)this).StartCoroutine(PlayDelayedDeathProofSnap(val3, vecnafpexecution, 4f)); } audioTools.PlayExecutionVoiceLine(); audioTools.PlayClockChime(); audioTools.PlayTelekinesisSound(); } if ((flag || ((NetworkBehaviour)this).IsServer) && (Object)(object)base.creatureAnimator != (Object)null) { base.creatureAnimator.SetTrigger(AnimSwingAttack); } if ((Object)(object)val3 != (Object)null) { val3.voiceMuffledByEnemy = false; } if ((Object)(object)val3 != (Object)null && !flag) { VecnaVFXHelper.TogglePlayerThirdPersonModel(this, val3, isVisible: false); ((MonoBehaviour)this).StartCoroutine(TeammateLevitationWatchRoutine(val3)); } if (flag) { ((MonoBehaviour)this).StartCoroutine(LocalLevitationKillRoutine(val3)); } if ((Object)(object)val3 != (Object)null && !flag) { ((MonoBehaviour)this).StartCoroutine(DelayedCloneSnapRoutine(val3)); } } public void TriggerCinematicKill(PlayerControllerB targetPlayer) { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //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_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) if (currentPhase.Value != VecnaPhase.ExecutingKill) { if ((Object)(object)base.agent != (Object)null && ((Behaviour)base.agent).isActiveAndEnabled && base.agent.isOnNavMesh) { base.agent.speed = 0f; base.agent.ResetPath(); } currentLocalPhase = VecnaPhase.ExecutingKill; if (((NetworkBehaviour)this).IsServer) { currentPhase.Value = VecnaPhase.ExecutingKill; } Vector3 val = ((Component)this).transform.position - ((Component)targetPlayer).transform.position; val.y = 0f; if (val == Vector3.zero) { val = ((Component)this).transform.forward; } ((Vector3)(ref val)).Normalize(); Vector3 stopPos = ((Component)targetPlayer).transform.position + val * 2.5f; Vector3 lookDir = -val; int num = (int)targetPlayer.playerClientId; ((MonoBehaviour)this).StartCoroutine(cinematicDirector.ExecuteCinematicKill()); if (((NetworkBehaviour)this).IsServer) { SyncCinematicKillClientRpc(num, stopPos, lookDir); } else { RequestCinematicKillServerRpc(num, stopPos, lookDir); } } } [IteratorStateMachine(typeof(d__138))] private IEnumerator PlayDelayedDeathProofSnap(PlayerControllerB victim, AudioClip snapClip, float delayTime) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__138(0) { <>4__this = this, victim = victim, snapClip = snapClip, delayTime = delayTime }; } [IteratorStateMachine(typeof(d__139))] private IEnumerator TeammateLevitationWatchRoutine(PlayerControllerB victim) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__139(0) { <>4__this = this, victim = victim }; } [IteratorStateMachine(typeof(d__140))] private IEnumerator DelayedCloneSnapRoutine(PlayerControllerB dyingPlayer) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__140(0) { <>4__this = this, dyingPlayer = dyingPlayer }; } [IteratorStateMachine(typeof(d__141))] private IEnumerator LocalLevitationKillRoutine(PlayerControllerB victim) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__141(0) { <>4__this = this, victim = victim }; } protected override void __initializeVariables() { if (currentPhase == null) { throw new Exception("VecnaAI.currentPhase cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)currentPhase).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)currentPhase, "currentPhase"); ((NetworkBehaviour)this).NetworkVariableFields.Add((NetworkVariableBase)(object)currentPhase); ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Expected O, but got Unknown //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Expected O, but got Unknown //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Expected O, but got Unknown //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1908950497u, new RpcReceiveHandler(__rpc_handler_1908950497), "RequestChaseStartServerRpc"); ((NetworkBehaviour)this).__registerRpc(2643355442u, new RpcReceiveHandler(__rpc_handler_2643355442), "RequestHauntEndServerRpc"); ((NetworkBehaviour)this).__registerRpc(525788326u, new RpcReceiveHandler(__rpc_handler_525788326), "RequestCinematicKillServerRpc"); ((NetworkBehaviour)this).__registerRpc(4156460258u, new RpcReceiveHandler(__rpc_handler_4156460258), "StartVehicleCinematicServerRpc"); ((NetworkBehaviour)this).__registerRpc(3686382895u, new RpcReceiveHandler(__rpc_handler_3686382895), "DropVehicleServerRpc"); ((NetworkBehaviour)this).__registerRpc(1430063458u, new RpcReceiveHandler(__rpc_handler_1430063458), "SyncVictimClientRpc"); ((NetworkBehaviour)this).__registerRpc(1111366090u, new RpcReceiveHandler(__rpc_handler_1111366090), "TogglePortalClientRpc"); ((NetworkBehaviour)this).__registerRpc(926685957u, new RpcReceiveHandler(__rpc_handler_926685957), "SpawnFakeBodyClientRpc"); ((NetworkBehaviour)this).__registerRpc(4125868582u, new RpcReceiveHandler(__rpc_handler_4125868582), "SpawnClockClientRpc"); ((NetworkBehaviour)this).__registerRpc(353266178u, new RpcReceiveHandler(__rpc_handler_353266178), "SpotClockClientRpc"); ((NetworkBehaviour)this).__registerRpc(1057247812u, new RpcReceiveHandler(__rpc_handler_1057247812), "MissedClockWarningClientRpc"); ((NetworkBehaviour)this).__registerRpc(3780686138u, new RpcReceiveHandler(__rpc_handler_3780686138), "ForceVehicleStopClientRpc"); ((NetworkBehaviour)this).__registerRpc(3831585480u, new RpcReceiveHandler(__rpc_handler_3831585480), "StartVehicleCinematicClientRpc"); ((NetworkBehaviour)this).__registerRpc(3830277317u, new RpcReceiveHandler(__rpc_handler_3830277317), "DropVehicleClientRpc"); ((NetworkBehaviour)this).__registerRpc(908085663u, new RpcReceiveHandler(__rpc_handler_908085663), "DespawnClockClientRpc"); ((NetworkBehaviour)this).__registerRpc(3486782502u, new RpcReceiveHandler(__rpc_handler_3486782502), "SyncChaseStartClientRpc"); ((NetworkBehaviour)this).__registerRpc(258004118u, new RpcReceiveHandler(__rpc_handler_258004118), "PlayDoorAnimationClientRpc"); ((NetworkBehaviour)this).__registerRpc(3898342388u, new RpcReceiveHandler(__rpc_handler_3898342388), "SyncHauntEndClientRpc"); ((NetworkBehaviour)this).__registerRpc(4085935493u, new RpcReceiveHandler(__rpc_handler_4085935493), "SyncCinematicKillClientRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_1908950497(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_004f: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int victimId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref victimId); Vector3 spawnPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref spawnPos); float timerOverride = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref timerOverride, default(ForPrimitives)); bool fromVehicle = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref fromVehicle, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((VecnaAI)(object)target).RequestChaseStartServerRpc(victimId, spawnPos, timerOverride, fromVehicle); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2643355442(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool repelledByMusic = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref repelledByMusic, default(ForPrimitives)); bool playerKilled = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerKilled, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((VecnaAI)(object)target).RequestHauntEndServerRpc(repelledByMusic, playerKilled); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_525788326(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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_0072: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int victimId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref victimId); Vector3 stopPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref stopPos); Vector3 lookDir = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref lookDir); target.__rpc_exec_stage = (__RpcExecStage)1; ((VecnaAI)(object)target).RequestCinematicKillServerRpc(victimId, stopPos, lookDir); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4156460258(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong vehicleId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref vehicleId); Vector3 spawnPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref spawnPos); target.__rpc_exec_stage = (__RpcExecStage)1; ((VecnaAI)(object)target).StartVehicleCinematicServerRpc(vehicleId, spawnPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3686382895(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((VecnaAI)(object)target).DropVehicleServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1430063458(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int victimPlayerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref victimPlayerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((VecnaAI)(object)target).SyncVictimClientRpc(victimPlayerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1111366090(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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_007f: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool open = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref open, default(ForPrimitives)); NetworkObjectReference boomboxRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref boomboxRef, default(ForNetworkSerializable)); Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); target.__rpc_exec_stage = (__RpcExecStage)1; ((VecnaAI)(object)target).TogglePortalClientRpc(open, boomboxRef, position); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_926685957(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 clockPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref clockPos); ulong vehicleId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref vehicleId); target.__rpc_exec_stage = (__RpcExecStage)1; ((VecnaAI)(object)target).SpawnFakeBodyClientRpc(clockPos, vehicleId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4125868582(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 spawnPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref spawnPos); int currentClockCount = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref currentClockCount); ulong parentVehicleId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref parentVehicleId); target.__rpc_exec_stage = (__RpcExecStage)1; ((VecnaAI)(object)target).SpawnClockClientRpc(spawnPos, currentClockCount, parentVehicleId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_353266178(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int victimId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref victimId); int currentClockCount = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref currentClockCount); target.__rpc_exec_stage = (__RpcExecStage)1; ((VecnaAI)(object)target).SpotClockClientRpc(victimId, currentClockCount); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1057247812(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int victimId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref victimId); target.__rpc_exec_stage = (__RpcExecStage)1; ((VecnaAI)(object)target).MissedClockWarningClientRpc(victimId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3780686138(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong vehicleId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref vehicleId); target.__rpc_exec_stage = (__RpcExecStage)1; ((VecnaAI)(object)target).ForceVehicleStopClientRpc(vehicleId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3831585480(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong vehicleId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref vehicleId); Vector3 spawnPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref spawnPos); target.__rpc_exec_stage = (__RpcExecStage)1; ((VecnaAI)(object)target).StartVehicleCinematicClientRpc(vehicleId, spawnPos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3830277317(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((VecnaAI)(object)target).DropVehicleClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_908085663(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool isFinalClock = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isFinalClock, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((VecnaAI)(object)target).DespawnClockClientRpc(isFinalClock); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3486782502(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_004f: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int victimId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref victimId); Vector3 spawnPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref spawnPos); float timerOverride = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref timerOverride, default(ForPrimitives)); bool fromVehicle = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref fromVehicle, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((VecnaAI)(object)target).SyncChaseStartClientRpc(victimId, spawnPos, timerOverride, fromVehicle); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_258004118(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((VecnaAI)(object)target).PlayDoorAnimationClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3898342388(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool repelledByMusic = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref repelledByMusic, default(ForPrimitives)); bool playerKilled = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref playerKilled, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((VecnaAI)(object)target).SyncHauntEndClientRpc(repelledByMusic, playerKilled); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4085935493(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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_0072: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int victimPlayerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref victimPlayerId); Vector3 stopPos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref stopPos); Vector3 lookDir = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref lookDir); target.__rpc_exec_stage = (__RpcExecStage)1; ((VecnaAI)(object)target).SyncCinematicKillClientRpc(victimPlayerId, stopPos, lookDir); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "VecnaAI"; } } [Serializable] public class VecnaAudioManager { private VecnaAI vecnaBrain; public VecnaAudioManager(VecnaAI brain) { Initialize(brain); } public void Initialize(VecnaAI brain) { vecnaBrain = brain; } public void HandleBreathing() { if ((Object)(object)vecnaBrain.breathingAudioSource == (Object)null) { Debug.LogWarning((object)"VECNA AUDIO ERROR: Breathing AudioSource is NULL!"); return; } if ((Object)(object)vecnaBrain.breathingAudioSource.outputAudioMixerGroup == (Object)null) { Debug.LogWarning((object)"VECNA AUDIO WARNING: Breathing AudioSource is missing an outputAudioMixerGroup! Reassigning..."); if ((Object)(object)SoundManager.Instance != (Object)null && (Object)(object)SoundManager.Instance.diageticMixer != (Object)null) { vecnaBrain.breathingAudioSource.outputAudioMixerGroup = SoundManager.Instance.diageticMixer.FindMatchingGroups("Master")[0]; } } if (vecnaBrain.breathingClips != null && vecnaBrain.breathingClips.Length != 0 && !vecnaBrain.breathingAudioSource.isPlaying) { int num = Random.Range(0, vecnaBrain.breathingClips.Length); vecnaBrain.breathingAudioSource.clip = vecnaBrain.breathingClips[num]; Debug.Log((object)"VECNA: Attempting to play breathing audio."); vecnaBrain.breathingAudioSource.Play(); } } public void StopBreathing() { if ((Object)(object)vecnaBrain.breathingAudioSource != (Object)null) { vecnaBrain.breathingAudioSource.Stop(); } } public void PlayClockChime() { if ((Object)(object)vecnaBrain.finalChimeClip != (Object)null && (Object)(object)HUDManager.Instance != (Object)null && (Object)(object)HUDManager.Instance.UIAudio != (Object)null) { HUDManager.Instance.UIAudio.PlayOneShot(vecnaBrain.finalChimeClip, 1f); } } public void PlayTelekinesisSound() { if ((Object)(object)vecnaBrain.vecnaSnapAudioSource != (Object)null && (Object)(object)vecnaBrain.liftTelekinesisClip != (Object)null) { vecnaBrain.vecnaSnapAudioSource.PlayOneShot(vecnaBrain.liftTelekinesisClip, 0.5f); } } public void PlayClockSpotTaunt() { if (vecnaBrain.clockSpotTaunts != null && vecnaBrain.clockSpotTaunts.Length != 0 && (Object)(object)HUDManager.Instance != (Object)null && (Object)(object)HUDManager.Instance.UIAudio != (Object)null) { AudioClip val = vecnaBrain.clockSpotTaunts[Random.Range(0, vecnaBrain.clockSpotTaunts.Length)]; HUDManager.Instance.UIAudio.PlayOneShot(val, 1f); } } public void PlayExecutionVoiceLine() { if ((Object)(object)vecnaBrain != (Object)null && (Object)(object)((EnemyAI)vecnaBrain).creatureVoice != (Object)null && vecnaBrain.executionVoiceLines != null && vecnaBrain.executionVoiceLines.Length != 0) { int num = Random.Range(0, vecnaBrain.executionVoiceLines.Length); ((EnemyAI)vecnaBrain).creatureVoice.clip = vecnaBrain.executionVoiceLines[num]; ((EnemyAI)vecnaBrain).creatureVoice.Play(); } } public void PlayEscapeVoiceLine() { if ((Object)(object)vecnaBrain != (Object)null && (Object)(object)((EnemyAI)vecnaBrain).creatureVoice != (Object)null && vecnaBrain.escapeVoiceLines != null && vecnaBrain.escapeVoiceLines.Length != 0) { AudioClip val = vecnaBrain.escapeVoiceLines[Random.Range(0, vecnaBrain.escapeVoiceLines.Length)]; if ((Object)(object)HUDManager.Instance != (Object)null && (Object)(object)HUDManager.Instance.UIAudio != (Object)null) { HUDManager.Instance.UIAudio.PlayOneShot(val, 1f); } else if ((Object)(object)((EnemyAI)vecnaBrain).creatureVoice != (Object)null) { ((EnemyAI)vecnaBrain).creatureVoice.PlayOneShot(val); } } } public void StartChaseMusic(float volume = 0.6f) { if ((Object)(object)vecnaBrain.chimechase == (Object)null) { Debug.LogWarning((object)"VECNA AUDIO ERROR: Chimechase AudioSource is NULL!"); return; } if ((Object)(object)vecnaBrain.chimechase.outputAudioMixerGroup == (Object)null) { Debug.LogWarning((object)"VECNA AUDIO WARNING: Chimechase AudioSource is missing an outputAudioMixerGroup! Reassigning..."); if ((Object)(object)SoundManager.Instance != (Object)null && (Object)(object)SoundManager.Instance.diageticMixer != (Object)null) { vecnaBrain.chimechase.outputAudioMixerGroup = SoundManager.Instance.diageticMixer.FindMatchingGroups("Master")[0]; } } vecnaBrain.chimechase.volume = volume; Debug.Log((object)"VECNA: Attempting to play chase music."); vecnaBrain.chimechase.Play(); } public void StopChaseMusic() { if ((Object)(object)vecnaBrain.chimechase != (Object)null) { vecnaBrain.chimechase.Stop(); } } public float GetChaseMusicLength() { if ((Object)(object)vecnaBrain.chimechase != (Object)null && (Object)(object)vecnaBrain.chimechase.clip != (Object)null) { return vecnaBrain.chimechase.clip.length; } return 60f; } public void PlayBoneSnap(Vector3 position, AudioSource optionalSource = null) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)vecnaBrain.playerSnapClip != (Object)null) { if ((Object)(object)optionalSource != (Object)null) { optionalSource.PlayOneShot(vecnaBrain.playerSnapClip, 1f); } else { AudioSource.PlayClipAtPoint(vecnaBrain.playerSnapClip, position, 1f); } } } } [Serializable] public class VecnaCinematicDirector { [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GameObject clockToDestroy; public bool isFinalClock; public VecnaCinematicDirector <>4__this; private bool 5__1; 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_0087: 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) if (<>1__state != 0) { return false; } <>1__state = -1; if ((Object)(object)clockToDestroy == (Object)null) { return false; } 5__1 = <>4__this.vecnaBrain.IsVictimOrSpectatingVictim(); if (isFinalClock) { if (5__1) { VecnaVFXHelper.CreateMassiveBloodSplash(clockToDestroy.transform.position); } } else if (5__1) { VecnaVFXHelper.CreateMindFlayerDust(clockToDestroy.transform.position); } if ((Object)(object)<>4__this.activeFakeBody != (Object)null) { Object.Destroy((Object)(object)<>4__this.activeFakeBody); <>4__this.activeFakeBody = null; } Object.Destroy((Object)(object)clockToDestroy); 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__3 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public VecnaCinematicDirector <>4__this; private float 5__1; private float 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(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 (((NetworkBehaviour)<>4__this.vecnaBrain).IsServer) { <>4__this.vecnaBrain.currentPhase.Value = VecnaAI.VecnaPhase.ExecutingKill; } 5__1 = 6.8f; 5__2 = 0f; break; case 1: <>1__state = -1; break; } if (5__2 < 5__1 && !((Object)(object)<>4__this.vecnaBrain.cursingPlayer == (Object)null) && !<>4__this.vecnaBrain.cursingPlayer.isPlayerDead) { 5__2 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } <>4__this.vecnaBrain.ResetHaunt(repelledByMusic: false, playerKilled: true); <>4__this.vecnaBrain.cursingPlayer = 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(); } } private VecnaAI vecnaBrain; public GameObject activeFakeBody = null; public VecnaCinematicDirector(VecnaAI brain) { vecnaBrain = brain; VecnaVFXHelper.PrewarmPools(); } [IteratorStateMachine(typeof(d__3))] public IEnumerator ExecuteCinematicKill() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__4))] public IEnumerator CinematicClockDespawnRoutine(GameObject clockToDestroy, bool isFinalClock) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { <>4__this = this, clockToDestroy = clockToDestroy, isFinalClock = isFinalClock }; } } [HarmonyPatch(typeof(EnemyAI))] public class VecnaEnemyAIPatch { [HarmonyPatch("PlayerIsTargetable")] [HarmonyPostfix] private static void PreventTargeting(EnemyAI __instance, ref bool __result, PlayerControllerB playerScript) { if (!(__instance is VecnaAI) && __result && VecnaAI.IsPlayerInUpsideDown(playerScript)) { __result = false; } } [HarmonyPatch("CheckLineOfSightForClosestPlayer")] [HarmonyPostfix] private static void PreventLineOfSight(EnemyAI __instance, ref PlayerControllerB __result) { if (!(__instance is VecnaAI) && (Object)(object)__result != (Object)null && VecnaAI.IsPlayerInUpsideDown(__result)) { __result = null; } } [HarmonyPatch("CheckLineOfSightForPlayer")] [HarmonyPostfix] private static void PreventSpecificLineOfSight(EnemyAI __instance, ref PlayerControllerB __result) { if (!(__instance is VecnaAI) && (Object)(object)__result != (Object)null && VecnaAI.IsPlayerInUpsideDown(__result)) { __result = null; } } [HarmonyPatch("GetClosestPlayer")] [HarmonyPostfix] private static void PreventProximity(EnemyAI __instance, ref PlayerControllerB __result) { if (!(__instance is VecnaAI) && (Object)(object)__result != (Object)null && VecnaAI.IsPlayerInUpsideDown(__result)) { __result = null; } } [HarmonyPatch("Start")] [HarmonyPostfix] private static void HideNewSpawns(EnemyAI __instance) { if (__instance is VecnaAI) { return; } foreach (VecnaAI activeInstance in VecnaAI.ActiveInstances) { if (!((Object)(object)activeInstance != (Object)null) || !activeInstance.IsVictimOrSpectatingVictim() || (activeInstance.currentLocalPhase != VecnaAI.VecnaPhase.Chasing && activeInstance.currentLocalPhase != VecnaAI.VecnaPhase.ExecutingKill && !activeInstance.spectatorInUpsideDown)) { continue; } Renderer[] componentsInChildren = ((Component)__instance).GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { if ((Object)(object)((Component)val).GetComponent() != (Object)null) { continue; } if (((Object)((Component)val).gameObject).name.ToLower().Contains("mapdot")) { val.enabled = false; continue; } int num = ((Component)val).gameObject.layer; if (num == 23 || num == 23) { num = 19; } if (!activeInstance.hiddenTeammateLayers.ContainsKey(val)) { activeInstance.hiddenTeammateLayers[val] = num; } ((Component)val).gameObject.layer = 23; } AudioSource[] componentsInChildren2 = ((Component)__instance).GetComponentsInChildren(true); foreach (AudioSource val2 in componentsInChildren2) { if ((Object)(object)val2 != (Object)null) { val2.mute = true; } } break; } } [HarmonyPatch("EnableEnemyMesh")] [HarmonyPrefix] private static void PreventEnemyVisibility(EnemyAI __instance, ref bool enable) { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (!((Object)(object)localPlayerController == (Object)null) && __instance is VecnaAI vecnaAI) { bool flag = (vecnaAI.currentLocalPhase == VecnaAI.VecnaPhase.Chasing || vecnaAI.currentLocalPhase == VecnaAI.VecnaPhase.ExecutingKill || (vecnaAI.currentLocalPhase == VecnaAI.VecnaPhase.VehicleCinematic && !vecnaAI.isCinematicLiftStarted)) && vecnaAI.IsVictimOrSpectatingVictim(); enable = flag; } } } [HarmonyPatch(typeof(PlayerControllerB), "Update")] public class VecnaVoiceMutePatch { private static HashSet mutedByVecna = new HashSet(); [HarmonyPostfix] public static void MuteUpsideDownVoices(PlayerControllerB __instance) { if ((Object)(object)__instance == (Object)null || !__instance.isPlayerControlled || __instance.isPlayerDead) { if (mutedByVecna.Contains(__instance)) { if ((Object)(object)__instance != (Object)null && (Object)(object)__instance.currentVoiceChatAudioSource != (Object)null) { __instance.currentVoiceChatAudioSource.volume = 1f; } mutedByVecna.Remove(__instance); } } else { if ((Object)(object)__instance.currentVoiceChatAudioSource == (Object)null) { return; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if ((Object)(object)localPlayerController == (Object)null || (Object)(object)localPlayerController == (Object)(object)__instance || localPlayerController.isPlayerDead) { if (mutedByVecna.Contains(__instance)) { __instance.currentVoiceChatAudioSource.volume = 1f; mutedByVecna.Remove(__instance); } return; } bool flag = VecnaAI.IsPlayerInUpsideDown(localPlayerController); bool flag2 = VecnaAI.IsPlayerInUpsideDown(__instance); if (flag != flag2) { __instance.currentVoiceChatAudioSource.volume = 0f; mutedByVecna.Add(__instance); } else if (mutedByVecna.Contains(__instance)) { __instance.currentVoiceChatAudioSource.volume = 1f; mutedByVecna.Remove(__instance); } } } } [HarmonyPatch(typeof(PlayerControllerB), "TeleportPlayer")] public class VecnaTeleportInterceptPatch { [HarmonyPrefix] public static bool Prefix(PlayerControllerB __instance, Vector3 pos) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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_00a6: Unknown result type (might be due to invalid IL or missing references) if (Vector3.Distance(((Component)__instance).transform.position, pos) < 15f) { return true; } foreach (VecnaAI activeInstance in VecnaAI.ActiveInstances) { if ((Object)(object)activeInstance != (Object)null && (Object)(object)activeInstance.cursingPlayer == (Object)(object)__instance && (activeInstance.currentLocalPhase == VecnaAI.VecnaPhase.Chasing || activeInstance.currentLocalPhase == VecnaAI.VecnaPhase.ExecutingKill) && (Object)(object)activeInstance.activeClone != (Object)null) { activeInstance.activeClone.transform.position = pos; Debug.Log((object)$"VECNA: Teleporter intercepted. Clone moved to {pos}, Victim stayed in Upside Down."); return false; } } return true; } } [HarmonyPatch(typeof(RoundManager), "PlayAudibleNoise")] public class VecnaNoiseSuppressionPatch { [HarmonyPrefix] public static bool Prefix(Vector3 noisePosition) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) try { foreach (VecnaAI activeInstance in VecnaAI.ActiveInstances) { if ((Object)(object)activeInstance != (Object)null && (Object)(object)activeInstance.cursingPlayer != (Object)null && (activeInstance.currentPhase.Value == VecnaAI.VecnaPhase.Chasing || activeInstance.currentPhase.Value == VecnaAI.VecnaPhase.ExecutingKill)) { float num = Vector3.Distance(noisePosition, ((Component)activeInstance.cursingPlayer).transform.position); if (num < 2f) { return false; } } } } catch (Exception ex) { Debug.LogWarning((object)("VECNA: Safely caught an error in the noise patch: " + ex.Message)); } return true; } } public class VecnaEnvironmentManipulator { private VecnaAI vecnaBrain; private Light[] cachedLights; private DoorLock[] cachedDoors; private float slowScanTimer = 0f; private const float SLOW_SCAN_INTERVAL = 2f; private float flickerTimer = 0f; private float currentFlickerRand = 0f; private Dictionary originalLightIntensities = new Dictionary(); private Dictionary telekinesisCooldowns = new Dictionary(); public VecnaEnvironmentManipulator(VecnaAI brain) { vecnaBrain = brain; } public void UpdateScanner(float deltaTime) { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Invalid comparison between Unknown and I4 slowScanTimer += deltaTime; if (!(slowScanTimer >= 2f)) { return; } slowScanTimer = 0f; cachedDoors = Object.FindObjectsOfType(); Light[] array = Object.FindObjectsOfType(); List list = new List(); Light[] array2 = array; foreach (Light val in array2) { if ((Object)(object)val == (Object)null || (int)val.type == 1) { continue; } string text = ((Object)((Component)val).gameObject).name.ToLower(); if (!text.Contains("helmet") && !text.Contains("visor") && !text.Contains("sun")) { list.Add(val); if (!originalLightIntensities.ContainsKey(val)) { originalLightIntensities[val] = val.intensity; } } } cachedLights = list.ToArray(); } public void FlickerNearbyLights(float deltaTime, PlayerControllerB victim) { //IL_0118: 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_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) if (cachedLights == null || (Object)(object)victim == (Object)null) { return; } flickerTimer += deltaTime; if (flickerTimer > 0.15f) { flickerTimer = 0f; currentFlickerRand = Random.value; } float num = vecnaBrain.stats.lightFlickerRadius * vecnaBrain.stats.lightFlickerRadius; bool flag = vecnaBrain.currentLocalPhase == VecnaAI.VecnaPhase.Chasing || vecnaBrain.currentLocalPhase == VecnaAI.VecnaPhase.ExecutingKill; bool flag2 = (vecnaBrain.currentLocalPhase == VecnaAI.VecnaPhase.ClockStalking || vecnaBrain.currentLocalPhase == VecnaAI.VecnaPhase.ClockSpotted) && (Object)(object)vecnaBrain.currentClock != (Object)null; Light[] array = cachedLights; foreach (Light val in array) { if ((Object)(object)val == (Object)null || !originalLightIntensities.TryGetValue(val, out var value)) { continue; } Vector3 val2 = ((Component)val).transform.position - ((Component)victim).transform.position; float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude; if (sqrMagnitude <= num) { if (flag) { if (currentFlickerRand > 0.8f) { val.intensity = value * 2.5f; } else { val.intensity = value; } } else if (flag2) { if (currentFlickerRand > 0.9f) { val.intensity = value * 1.3f; } else if (currentFlickerRand > 0.7f) { val.intensity = value * 0.3f; } else { val.intensity = value; } } else { val.intensity = value; } } else { val.intensity = value; } } } public void RestoreLights() { foreach (KeyValuePair originalLightIntensity in originalLightIntensities) { if ((Object)(object)originalLightIntensity.Key != (Object)null) { originalLightIntensity.Key.intensity = originalLightIntensity.Value; } } originalLightIntensities.Clear(); } public void BlastDoorsOpen() { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)vecnaBrain).IsServer || cachedDoors == null || cachedDoors.Length == 0) { return; } float num = 49f; DoorLock[] array = cachedDoors; foreach (DoorLock val in array) { if ((Object)(object)val == (Object)null) { continue; } Vector3 val2 = ((Component)vecnaBrain).transform.position - ((Component)val).transform.position; if (((Vector3)(ref val2)).sqrMagnitude < num && (!telekinesisCooldowns.ContainsKey(val) || !(Time.time - telekinesisCooldowns[val] < 5f)) && !val.isDoorOpened) { if (val.isLocked) { val.UnlockDoorServerRpc(); } AnimatedObjectTrigger component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { component.TriggerAnimationNonPlayer(true, true, false); } vecnaBrain.PlayDoorAnimationClientRpc(); val.OpenDoorAsEnemyServerRpc(); telekinesisCooldowns[val] = Time.time; } } } } [HarmonyPatch] public static class VecnaEventManager { public static event Action OnShipLeft; public static event Action OnPlayerDied; public static event Action OnPlayerDisconnect; [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] [HarmonyPostfix] private static void TriggerShipLeave() { VecnaEventManager.OnShipLeft?.Invoke(); } [HarmonyPatch(typeof(PlayerControllerB), "KillPlayer")] [HarmonyPostfix] private static void TriggerPlayerDied(PlayerControllerB __instance) { VecnaEventManager.OnPlayerDied?.Invoke(__instance); } [HarmonyPatch(typeof(StartOfRound), "OnPlayerDC")] [HarmonyPostfix] private static void TriggerPlayerDisconnect(int playerObjectNumber) { if ((Object)(object)StartOfRound.Instance != (Object)null && playerObjectNumber >= 0 && playerObjectNumber < StartOfRound.Instance.allPlayerScripts.Length) { VecnaEventManager.OnPlayerDisconnect?.Invoke(StartOfRound.Instance.allPlayerScripts[playerObjectNumber]); } } } [Serializable] public class VecnaPortalManager { private VecnaAI vecnaBrain; public GameObject activeEscapePortal; private Camera portalCamera; private RenderTexture portalRenderTexture; private AudioSource portalAudioSource; public VecnaPortalManager(VecnaAI brain) { vecnaBrain = brain; } public void UpdatePortalRotation() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) if (vecnaBrain.cursingLocalPlayer && (Object)(object)activeEscapePortal != (Object)null && (Object)(object)vecnaBrain.cursingPlayer != (Object)null) { Vector3 position = ((Component)vecnaBrain.cursingPlayer.gameplayCamera).transform.position; activeEscapePortal.transform.rotation = Quaternion.LookRotation(activeEscapePortal.transform.position - position); } } public void SpawnEscapePortalAtPosition(BoomboxItem rescuingBoombox, Vector3 position) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown //IL_0078: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: 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_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)vecnaBrain.activeClone == (Object)null || (Object)(object)vecnaBrain.cursingPlayer == (Object)null) { return; } portalRenderTexture = new RenderTexture(1024, 1024, 24, (RenderTextureFormat)9); portalRenderTexture.antiAliasing = 8; GameObject val = new GameObject("VecnaPortalCamera"); val.transform.position = vecnaBrain.activeClone.transform.position + vecnaBrain.activeClone.transform.forward * 3f + Vector3.up * 1.5f; val.transform.LookAt(vecnaBrain.activeClone.transform.position + Vector3.up * 1f); portalCamera = val.AddComponent(); portalCamera.targetTexture = portalRenderTexture; portalCamera.cullingMask = 2147467231; portalCamera.nearClipPlane = 0.1f; GameObject val2 = Plugin.ModAssets.LoadAsset("VecnaPortalScreen"); activeEscapePortal = Object.Instantiate(val2, position, Quaternion.identity); ((Object)activeEscapePortal).name = "VecnaEscapePortal"; MeshRenderer componentInChildren = activeEscapePortal.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && (Object)(object)((Renderer)componentInChildren).material != (Object)null) { ((Renderer)componentInChildren).material.EnableKeyword("_EMISSION"); ((Renderer)componentInChildren).material.EnableKeyword("_EMISSION_WITH_TEXTURE"); if (((Renderer)componentInChildren).material.HasProperty("_EmissiveColorMap")) { ((Renderer)componentInChildren).material.SetTexture("_EmissiveColorMap", (Texture)(object)portalRenderTexture); } if (((Renderer)componentInChildren).material.HasProperty("_EmissiveColor")) { ((Renderer)componentInChildren).material.SetColor("_EmissiveColor", Color.white * 7f); } ((Renderer)componentInChildren).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)componentInChildren).receiveShadows = false; ((Renderer)componentInChildren).lightProbeUsage = (LightProbeUsage)0; ((Renderer)componentInChildren).reflectionProbeUsage = (ReflectionProbeUsage)0; ((Renderer)componentInChildren).allowOcclusionWhenDynamic = false; } portalAudioSource = activeEscapePortal.AddComponent(); portalAudioSource.spatialBlend = 1f; portalAudioSource.minDistance = 15f; portalAudioSource.maxDistance = 50f; portalAudioSource.rolloffMode = (AudioRolloffMode)1; portalAudioSource.loop = true; portalAudioSource.volume = 1f; if ((Object)(object)SoundManager.Instance != (Object)null && (Object)(object)SoundManager.Instance.diageticMixer != (Object)null) { portalAudioSource.outputAudioMixerGroup = SoundManager.Instance.diageticMixer.FindMatchingGroups("Master")[0]; } if ((Object)(object)rescuingBoombox != (Object)null && (Object)(object)rescuingBoombox.boomboxAudio != (Object)null) { portalAudioSource.clip = rescuingBoombox.boomboxAudio.clip; portalAudioSource.time = rescuingBoombox.boomboxAudio.time; portalAudioSource.Play(); } Vector3 val3 = position; Debug.Log((object)("VECNA: Escape Portal Opened at " + ((object)(Vector3)(ref val3)).ToString())); } public void TogglePortal(bool open, BoomboxItem boombox, Vector3 position) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (open) { if ((Object)(object)activeEscapePortal == (Object)null) { SpawnEscapePortalAtPosition(boombox, position); } } else { DestroyEscapePortal(); } } public void DestroyEscapePortal() { if ((Object)(object)portalCamera != (Object)null) { Object.Destroy((Object)(object)((Component)portalCamera).gameObject); } if ((Object)(object)activeEscapePortal != (Object)null) { Object.Destroy((Object)(object)activeEscapePortal); } if ((Object)(object)portalRenderTexture != (Object)null) { portalRenderTexture.Release(); Object.Destroy((Object)(object)portalRenderTexture); } portalCamera = null; activeEscapePortal = null; } } public interface IVecnaState { void Enter(); void Update(); void Exit(); } public class VecnaCooldownState : IVecnaState { private VecnaAI brain; public VecnaCooldownState(VecnaAI brain) { this.brain = brain; } public void Enter() { } public void Exit() { } public void Update() { if (!((NetworkBehaviour)brain).IsServer) { return; } if (brain.hauntCooldownTimer > 0f) { brain.hauntCooldownTimer -= Time.deltaTime; } if (brain.hauntCooldownTimer <= 0f) { if ((Object)(object)brain.cursingPlayer == (Object)null || brain.cursingPlayer.isPlayerDead || !brain.cursingPlayer.isPlayerControlled) { Debug.Log((object)"VECNA: Target missing/dead. Choosing new victim!"); brain.ChoosePlayerToCurse(); } brain.currentPhase.Value = VecnaAI.VecnaPhase.ClockStalking; } } } public class VecnaClockStalkingState : IVecnaState { private VecnaAI brain; public VecnaClockStalkingState(VecnaAI brain) { this.brain = brain; } public void Enter() { } public void Exit() { } public void Update() { if (!((NetworkBehaviour)brain).IsServer || (Object)(object)brain.cursingPlayer == (Object)null) { return; } brain.environmentTools.FlickerNearbyLights(Time.deltaTime, brain.cursingPlayer); if ((Object)(object)brain.currentClock == (Object)null) { if (brain.clocksSpawned >= brain.stats.clocksBeforeChase - 1 && brain.IsMusicPlayingNearVictim()) { if (brain.spawnTimer >= brain.stats.spawnInterval - 0.5f && Time.frameCount % 60 == 0) { Debug.Log((object)"VECNA: Final clock spawn is currently being suppressed by Boombox music!"); } brain.spawnTimer = Mathf.Min(brain.spawnTimer, brain.stats.spawnInterval - 0.5f); } if (brain.spawnTimer > brain.stats.spawnInterval) { bool flag = brain.TrySpawningClock(); brain.spawnTimer = (flag ? 0f : (brain.stats.spawnInterval - 1f)); } else { brain.spawnTimer += Time.deltaTime; } return; } brain.unspottedTimer += Time.deltaTime; if (brain.unspottedTimer >= brain.stats.maxUnspottedTime) { Debug.Log((object)"Vecna: Clock expired without being seen. Vanishing."); brain.MissedClockWarningClientRpc((int)brain.cursingPlayer.playerClientId); brain.DisappearClock(); } else if (brain.JobifiedClockLineOfSightCheck()) { brain.currentPhase.Value = VecnaAI.VecnaPhase.ClockSpotted; brain.unspottedTimer = 0f; brain.SpotClockClientRpc((int)brain.cursingPlayer.playerClientId, brain.clocksSpawned); Debug.Log((object)"VECNA: Victim has spotted the clock."); } } } public class VecnaClockSpottedState : IVecnaState { private VecnaAI brain; public VecnaClockSpottedState(VecnaAI brain) { this.brain = brain; } public void Enter() { } public void Exit() { } public void Update() { if (((NetworkBehaviour)brain).IsServer && !((Object)(object)brain.cursingPlayer == (Object)null) && !((Object)(object)brain.currentClock == (Object)null)) { brain.environmentTools.FlickerNearbyLights(Time.deltaTime, brain.cursingPlayer); brain.stareTimer += Time.deltaTime; float num = ((brain.clocksSpawned == 2) ? 4f : brain.stats.maxStareTime); if (brain.stareTimer > num) { Debug.Log((object)$"Vecna: {num} seconds passed since spotting. Vanishing."); brain.DisappearClock(); } } } } public class VecnaVehicleCinematicState : IVecnaState { private VecnaAI brain; private bool hasTriggeredLiftAnim = false; public VecnaVehicleCinematicState(VecnaAI brain) { this.brain = brain; } public void Enter() { hasTriggeredLiftAnim = false; } public void Exit() { } public void Update() { //IL_02b5: 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_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: 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_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)brain.cinematicVehicle == (Object)null) { if (((NetworkBehaviour)brain).IsServer) { brain.EndCinematicAndWaitForExit(); } return; } if (((NetworkBehaviour)brain).IsServer) { bool flag = (Object)(object)brain.cinematicVehicle.currentDriver == (Object)(object)brain.cursingPlayer || (Object)(object)brain.cinematicVehicle.currentPassenger == (Object)(object)brain.cursingPlayer || (Object)(object)((Component)brain.cursingPlayer).GetComponentInParent() == (Object)(object)brain.cinematicVehicle; if ((Object)(object)brain.cursingPlayer == (Object)null || !flag || brain.cursingPlayer.isPlayerDead) { brain.EndCinematicAndWaitForExit(); return; } } if (brain.cinematicTimer <= -10f) { return; } if (!brain.vehicleReachedApex) { if (brain.cinematicTimer < 0f) { brain.cinematicTimer += Time.deltaTime; if (brain.cinematicTimer >= -0.5f && !hasTriggeredLiftAnim) { hasTriggeredLiftAnim = true; if ((Object)(object)((EnemyAI)brain).creatureAnimator != (Object)null) { ((EnemyAI)brain).creatureAnimator.SetTrigger("blastDoor"); } if ((Object)(object)brain.liftTelekinesisClip != (Object)null && (Object)(object)brain.cinematicVehicle.vehicleEngineAudio != (Object)null) { brain.cinematicVehicle.vehicleEngineAudio.PlayOneShot(brain.liftTelekinesisClip, 1f); } } return; } brain.cinematicTimer += Time.deltaTime * 0.8f; if (brain.cinematicTimer >= 0.5f && !brain.isCinematicLiftStarted) { brain.isCinematicLiftStarted = true; if (brain.cursingLocalPlayer) { brain.ToggleGhostVisuals(isVisible: false); } } if ((Object)(object)brain.cinematicVehicle.mainRigidbody != (Object)null) { Vector3 val = Vector3.Lerp(brain.vehicleStartPos, brain.vehicleTargetPos, brain.cinematicTimer); brain.cinematicVehicle.mainRigidbody.MovePosition(val); Quaternion val2 = Quaternion.Euler(Vector3.up * (Time.deltaTime * 15f)); brain.cinematicVehicle.mainRigidbody.MoveRotation(brain.cinematicVehicle.mainRigidbody.rotation * val2); } if (brain.cinematicTimer >= 1f) { brain.vehicleReachedApex = true; brain.cinematicTimer = 0f; } } else { brain.cinematicTimer += Time.deltaTime; if (brain.cinematicTimer > 2.5f && ((NetworkBehaviour)brain).IsServer) { brain.EndCinematicAndWaitForExit(); } } } } public class VecnaWaitingForExitState : IVecnaState { private VecnaAI brain; public VecnaWaitingForExitState(VecnaAI brain) { this.brain = brain; } public void Enter() { } public void Exit() { } public void Update() { if (!((NetworkBehaviour)brain).IsServer) { return; } if ((Object)(object)brain.cursingPlayer == (Object)null || brain.cursingPlayer.isPlayerDead) { brain.ResetHaunt(repelledByMusic: false); return; } VehicleController playerVehicle = brain.GetPlayerVehicle(brain.cursingPlayer); if ((Object)(object)playerVehicle == (Object)null) { Debug.Log((object)"VECNA: Victim left the vehicle wreckage. Initiating Phase 2."); brain.StartChase(); } } } public class VecnaChaseState : IVecnaState { private VecnaAI brain; private Vector3 serverPortalPos; private bool portalIsOpenOnServer = false; public VecnaChaseState(VecnaAI brain) { this.brain = brain; } public void Enter() { brain.boomboxRescueTimer = 0f; brain.isPortalOpen = false; portalIsOpenOnServer = false; } public void Exit() { } public void Update() { //IL_00f7: 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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03be: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_0323: 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_032b: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_028e: 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_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0223: 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_022d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)brain.cursingPlayer == (Object)null || brain.currentLocalPhase != VecnaAI.VecnaPhase.Chasing) { return; } brain.environmentTools.FlickerNearbyLights(Time.deltaTime, brain.cursingPlayer); if (((NetworkBehaviour)brain).IsOwner && ((Behaviour)((EnemyAI)brain).agent).isActiveAndEnabled && ((EnemyAI)brain).agent.isOnNavMesh) { ((EnemyAI)brain).agent.speed = brain.stats.chaseSpeed; VehicleController playerVehicle = brain.GetPlayerVehicle(brain.cursingPlayer); Vector3 val = (((Object)(object)playerVehicle != (Object)null) ? ((Component)playerVehicle).transform.position : ((Component)brain.cursingPlayer).transform.position); ((EnemyAI)brain).SetDestinationToPosition(((Component)brain.cursingPlayer).transform.position, true); } if (!((NetworkBehaviour)brain).IsServer) { return; } brain.chaseTimer -= Time.deltaTime; if (brain.chaseTimer <= 0f) { brain.ResetHaunt(repelledByMusic: false); return; } Vector3 val4; if (brain.cachedBoomboxes != null && (Object)(object)brain.activeClone != (Object)null) { float num = brain.stats.boomboxRescueRadius * brain.stats.boomboxRescueRadius; BoomboxItem val2 = null; BoomboxItem[] cachedBoomboxes = brain.cachedBoomboxes; foreach (BoomboxItem val3 in cachedBoomboxes) { if ((Object)(object)val3 != (Object)null && val3.isPlayingMusic) { val4 = ((Component)val3).transform.position - brain.activeClone.transform.position; float sqrMagnitude = ((Vector3)(ref val4)).sqrMagnitude; if (sqrMagnitude <= num) { val2 = val3; break; } } } if ((Object)(object)val2 != (Object)null) { if (!portalIsOpenOnServer) { portalIsOpenOnServer = true; serverPortalPos = CalculatePortalPosition(); brain.TogglePortalClientRpc(open: true, NetworkObjectReference.op_Implicit(((NetworkBehaviour)val2).NetworkObject), serverPortalPos); } float num2 = Vector3.Distance(((Component)brain.cursingPlayer).transform.position, serverPortalPos); if (num2 < 3f) { Debug.Log((object)"VECNA: Victim reached the portal! Escape successful."); brain.ResetHaunt(repelledByMusic: true); return; } } else if (portalIsOpenOnServer) { portalIsOpenOnServer = false; brain.TogglePortalClientRpc(open: false, default(NetworkObjectReference), Vector3.zero); } } brain.environmentTools.BlastDoorsOpen(); VehicleController playerVehicle2 = brain.GetPlayerVehicle(brain.cursingPlayer); float num3 = (((Object)(object)playerVehicle2 != (Object)null) ? 100f : brain.stats.killRangeSquared); Vector3 val5 = (((Object)(object)playerVehicle2 != (Object)null) ? ((Component)playerVehicle2).transform.position : ((Component)brain.cursingPlayer).transform.position); val4 = ((Component)brain).transform.position - val5; float sqrMagnitude2 = ((Vector3)(ref val4)).sqrMagnitude; if (brain.canKill && sqrMagnitude2 <= num3) { brain.TriggerCinematicKill(brain.cursingPlayer); } } private Vector3 CalculatePortalPosition() { //IL_00df: 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: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: 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_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) GameObject[] array = (brain.cursingPlayer.isInsideFactory ? brain.insideNodes : brain.outsideNodes); if (array != null) { GameObject[] array2 = array; foreach (GameObject val in array2) { if (!((Object)(object)val == (Object)null)) { float num = Vector3.Distance(((Component)brain.cursingPlayer).transform.position, val.transform.position); if (num > 10f && num < 35f) { return val.transform.position + Vector3.up * 1.5f; } } } } return ((Component)brain.cursingPlayer).transform.position + ((Component)brain.cursingPlayer).transform.forward * 15f + Vector3.up * 1.5f; } } public class VecnaExecutingKillState : IVecnaState { private VecnaAI brain; public VecnaExecutingKillState(VecnaAI brain) { this.brain = brain; } public void Enter() { } public void Exit() { } public void Update() { if (((NetworkBehaviour)brain).IsServer) { } } } [CreateAssetMenu(menuName = "Vecna/Vecna Stats", fileName = "VecnaStats")] public class VecnaStats : ScriptableObject { [Header("Phase 1: Clock Stalking")] public float spawnInterval = 40f; public float maxUnspottedTime = 20f; public float maxStareTime = 10f; public int clocksBeforeChase = 3; [Header("Phase 2: Chasing")] public float chaseSpeed = 6.5f; public float killRange = 2.5f; public float killRangeSquared = 6.25f; public float maxChaseTime = 60f; [Header("Environment & Mechanics")] public float lightFlickerRadius = 25f; public float boomboxRescueRadius = 15f; } public static class VecnaVFXHelper { private class PooledParticle : MonoBehaviour { [CompilerGenerated] private sealed class d__3 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PooledParticle <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(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; <>2__current = <>4__this.waitInstruction; <>1__state = 1; return true; case 1: <>1__state = -1; ((Component)<>4__this).gameObject.SetActive(false); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public float lifeTime = 2f; private WaitForSeconds waitInstruction; private void OnEnable() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown if (waitInstruction == null) { waitInstruction = new WaitForSeconds(lifeTime); } ((MonoBehaviour)this).StartCoroutine(DisableAfterTime()); } [IteratorStateMachine(typeof(d__3))] private IEnumerator DisableAfterTime() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(0) { <>4__this = this }; } } private static List mindFlayerDustPool = new List(); private static List massiveBloodSplashPool = new List(); private static List smallBloodSplashPool = new List(); public static void PrewarmPools() { mindFlayerDustPool.RemoveAll((ParticleSystem p) => (Object)(object)p == (Object)null); massiveBloodSplashPool.RemoveAll((ParticleSystem p) => (Object)(object)p == (Object)null); smallBloodSplashPool.RemoveAll((ParticleSystem p) => (Object)(object)p == (Object)null); if (mindFlayerDustPool.Count == 0) { for (int i = 0; i < 2; i++) { mindFlayerDustPool.Add(SetupMindFlayerDust()); } for (int j = 0; j < 3; j++) { massiveBloodSplashPool.Add(SetupMassiveBloodSplash()); } for (int k = 0; k < 8; k++) { smallBloodSplashPool.Add(SetupSmallBloodSplash()); } } } private static ParticleSystem GetFromPool(List pool, Func factoryMethod) { pool.RemoveAll((ParticleSystem p) => (Object)(object)p == (Object)null); foreach (ParticleSystem item in pool) { if (!((Component)item).gameObject.activeInHierarchy) { return item; } } ParticleSystem val = factoryMethod(); pool.Add(val); return val; } public static void CreateMindFlayerDust(Vector3 pos) { //IL_0032: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) ParticleSystem fromPool = GetFromPool(mindFlayerDustPool, SetupMindFlayerDust); ((Component)fromPool).gameObject.transform.position = pos + Vector3.up * 2f; ((Component)fromPool).gameObject.SetActive(true); fromPool.Play(); } private static ParticleSystem SetupMindFlayerDust() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: 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_01ab: 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_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Expected O, but got Unknown //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: 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_0219: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("MindFlayerDust_Pooled"); val.SetActive(false); val.AddComponent().lifeTime = 6f; ParticleSystem val2 = val.AddComponent(); ParticleSystemRenderer component = val.GetComponent(); ((Renderer)component).material = new Material(Shader.Find("Sprites/Default")); MainModule main = val2.main; ((MainModule)(ref main)).duration = 2f; ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; ((MainModule)(ref main)).startColor = new MinMaxGradient(new Color(0.01f, 0.01f, 0.02f, 0.9f), new Color(0.05f, 0.05f, 0.08f, 0.7f)); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.05f, 0.15f); ((MainModule)(ref main)).startLifetime = new MinMaxCurve(2.5f, 5f); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(0.1f, 0.5f); ((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(-0.05f); ((MainModule)(ref main)).loop = false; EmissionModule emission = val2.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(0f); ((EmissionModule)(ref emission)).SetBursts((Burst[])(object)new Burst[1] { new Burst(0f, (short)400, (short)600) }); ShapeModule shape = val2.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)5; ((ShapeModule)(ref shape)).scale = new Vector3(1.5f, 4f, 1.5f); NoiseModule noise = val2.noise; ((NoiseModule)(ref noise)).enabled = true; ((NoiseModule)(ref noise)).strength = MinMaxCurve.op_Implicit(1.2f); ((NoiseModule)(ref noise)).frequency = 1.5f; ((NoiseModule)(ref noise)).scrollSpeed = MinMaxCurve.op_Implicit(2f); ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val3 = new Gradient(); val3.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(Color.white, 0f), new GradientColorKey(Color.white, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[2] { new GradientAlphaKey(1f, 0f), new GradientAlphaKey(0f, 0.8f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val3); SizeOverLifetimeModule sizeOverLifetime = val2.sizeOverLifetime; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).enabled = true; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).size = new MinMaxCurve(1f, 0f); return val2; } public static void CreateMassiveBloodSplash(Vector3 pos, bool isBody = false) { //IL_0032: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) ParticleSystem fromPool = GetFromPool(massiveBloodSplashPool, SetupMassiveBloodSplash); ((Component)fromPool).gameObject.transform.position = pos + (isBody ? (Vector3.up * 0.5f) : (Vector3.up * 1.5f)); ShapeModule shape = fromPool.shape; if (isBody) { ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)2; ((ShapeModule)(ref shape)).radius = 0.8f; } else { ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)4; ((ShapeModule)(ref shape)).radius = 0.5f; ((ShapeModule)(ref shape)).angle = 30f; } ((Component)fromPool).gameObject.SetActive(true); fromPool.Play(); } private static ParticleSystem SetupMassiveBloodSplash() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0149: 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) //IL_015a: 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) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Expected O, but got Unknown //IL_017b: 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_018a: 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_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_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_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: 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_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0208: 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_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("VecnaMassiveBloodSplash_Pooled"); val.SetActive(false); val.AddComponent().lifeTime = 4f; ParticleSystem val2 = val.AddComponent(); ParticleSystemRenderer component = val.GetComponent(); ((Renderer)component).material = new Material(Shader.Find("Sprites/Default")); component.renderMode = (ParticleSystemRenderMode)1; component.cameraVelocityScale = 0f; component.velocityScale = 0.08f; component.lengthScale = 2f; MainModule main = val2.main; ((MainModule)(ref main)).duration = 2f; ((MainModule)(ref main)).loop = false; ((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(1.8f); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; ((MainModule)(ref main)).startColor = new MinMaxGradient(new Color(0.4f, 0f, 0f, 1f), new Color(0.08f, 0f, 0f, 1f)); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.05f, 0.35f); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(3f, 16f); EmissionModule emission = val2.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(0f); ((EmissionModule)(ref emission)).SetBursts((Burst[])(object)new Burst[1] { new Burst(0f, (short)120, (short)150) }); ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val3 = new Gradient(); val3.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(Color.white, 0f), new GradientColorKey(Color.white, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(1f, 0f), new GradientAlphaKey(1f, 0.6f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val3); SizeOverLifetimeModule sizeOverLifetime = val2.sizeOverLifetime; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).enabled = true; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).size = new MinMaxCurve(1f, 0f); CollisionModule collision = val2.collision; ((CollisionModule)(ref collision)).enabled = true; ((CollisionModule)(ref collision)).type = (ParticleSystemCollisionType)1; ((CollisionModule)(ref collision)).mode = (ParticleSystemCollisionMode)0; ((CollisionModule)(ref collision)).bounceMultiplier = 0.1f; ((CollisionModule)(ref collision)).dampenMultiplier = 0.8f; ((CollisionModule)(ref collision)).quality = (ParticleSystemCollisionQuality)0; return val2; } public static void CreateSmallBloodSplash(Vector3 pos) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) ParticleSystem fromPool = GetFromPool(smallBloodSplashPool, SetupSmallBloodSplash); ((Component)fromPool).gameObject.transform.position = pos; ((Component)fromPool).gameObject.SetActive(true); fromPool.Play(); } private static ParticleSystem SetupSmallBloodSplash() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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_0109: 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_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Expected O, but got Unknown //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0152: 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_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0168: 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_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: 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_01ec: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("VecnaBloodSplash_Pooled"); val.SetActive(false); val.AddComponent().lifeTime = 2f; ParticleSystem val2 = val.AddComponent(); ParticleSystemRenderer component = val.GetComponent(); ((Renderer)component).material = new Material(Shader.Find("Sprites/Default")); MainModule main = val2.main; ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(new Color(0.4f, 0f, 0f, 1f)); ((MainModule)(ref main)).duration = 1f; ((MainModule)(ref main)).startSize = new MinMaxCurve(0.08f, 0.25f); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(2f, 5f); ((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(1.5f); ((MainModule)(ref main)).loop = false; EmissionModule emission = val2.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(0f); ((EmissionModule)(ref emission)).SetBursts((Burst[])(object)new Burst[1] { new Burst(0f, (short)20, (short)40) }); ShapeModule shape = val2.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)0; ((ShapeModule)(ref shape)).radius = 0.1f; ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val3 = new Gradient(); val3.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(Color.white, 0f), new GradientColorKey(Color.white, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(1f, 0f), new GradientAlphaKey(1f, 0.6f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val3); SizeOverLifetimeModule sizeOverLifetime = val2.sizeOverLifetime; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).enabled = true; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).size = new MinMaxCurve(0.08f, 0.25f); return val2; } public static void DressCloneLikePlayer(GameObject clone, PlayerControllerB victim) { //IL_0466: Unknown result type (might be due to invalid IL or missing references) //IL_047a: Unknown result type (might be due to invalid IL or missing references) //IL_0487: Unknown result type (might be due to invalid IL or missing references) //IL_048c: Unknown result type (might be due to invalid IL or missing references) //IL_0490: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04b3: Unknown result type (might be due to invalid IL or missing references) //IL_04ba: Unknown result type (might be due to invalid IL or missing references) //IL_04c2: 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_04de: Unknown result type (might be due to invalid IL or missing references) //IL_04e6: Unknown result type (might be due to invalid IL or missing references) //IL_04fb: 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_050a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)clone == (Object)null || (Object)(object)victim == (Object)null) { return; } SkinnedMeshRenderer componentInChildren = clone.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && (Object)(object)victim.thisPlayerModel != (Object)null) { ((Renderer)componentInChildren).material = ((Renderer)victim.thisPlayerModel).material; } Dictionary dictionary = new Dictionary(); Transform[] componentsInChildren = clone.GetComponentsInChildren(); foreach (Transform val in componentsInChildren) { string text = ((Object)val).name.ToLower().Replace(".", "").Replace("_", ""); if (text.EndsWith("end")) { text = text.Replace("end", ""); } if (!dictionary.ContainsKey(text)) { dictionary[text] = val; } } HashSet hashSet = new HashSet(); Renderer[] componentsInChildren2 = ((Component)victim).gameObject.GetComponentsInChildren(true); Renderer[] array = componentsInChildren2; foreach (Renderer val2 in array) { if ((Object)(object)val2 == (Object)(object)victim.thisPlayerModel || (Object)(object)val2 == (Object)(object)victim.thisPlayerModelLOD1 || (Object)(object)val2 == (Object)(object)victim.thisPlayerModelLOD2 || (Object)(object)val2 == (Object)(object)victim.thisPlayerModelArms) { continue; } bool flag = false; for (int k = 0; k < victim.ItemSlots.Length; k++) { if ((Object)(object)victim.ItemSlots[k] != (Object)null && ((Component)val2).transform.IsChildOf(((Component)victim.ItemSlots[k]).transform)) { flag = true; break; } } if (!flag && (Object)(object)victim.ItemOnlySlot != (Object)null && ((Component)val2).transform.IsChildOf(((Component)victim.ItemOnlySlot).transform)) { flag = true; } if (flag) { continue; } string text2 = ((Object)((Component)val2).gameObject).name.ToLower(); if (text2.Contains("map") || text2.Contains("radar") || text2.Contains("arrow") || text2.Contains("cube") || text2.Contains("screen") || text2.Contains("sticker") || text2.Contains("badge") || text2.Contains("shadow") || text2.Contains("canvas") || text2.Contains("speak") || ((Component)val2).gameObject.layer == 5 || ((Component)val2).gameObject.layer == 14) { continue; } Transform val3 = ((Component)val2).transform; Transform val4 = null; while ((Object)(object)val3.parent != (Object)null) { string key = ((Object)val3.parent).name.ToLower().Replace(".", "").Replace("_", ""); if (dictionary.TryGetValue(key, out var value)) { val4 = value; break; } val3 = val3.parent; } if (!((Object)(object)val4 != (Object)null) || hashSet.Contains(val3)) { continue; } string text3 = ((Object)val3).name.ToLower(); if (!text3.Contains("scavengermodel") && !text3.Contains("metarig") && !text3.Contains("player")) { hashSet.Add(val3); GameObject val5 = Object.Instantiate(((Component)val3).gameObject, val4); NetworkObject[] componentsInChildren3 = val5.GetComponentsInChildren(); foreach (NetworkObject val6 in componentsInChildren3) { Object.DestroyImmediate((Object)(object)val6); } MonoBehaviour[] componentsInChildren4 = val5.GetComponentsInChildren(); foreach (MonoBehaviour val7 in componentsInChildren4) { Object.DestroyImmediate((Object)(object)val7); } Collider[] componentsInChildren5 = val5.GetComponentsInChildren(); foreach (Collider val8 in componentsInChildren5) { Object.DestroyImmediate((Object)(object)val8); } val5.SetActive(true); val5.transform.localPosition = val3.localPosition; val5.transform.localRotation = val3.localRotation; Vector3 lossyScale = val3.lossyScale; Vector3 lossyScale2 = val4.lossyScale; val5.transform.localScale = new Vector3((lossyScale2.x > 0f) ? (lossyScale.x / lossyScale2.x) : 0f, (lossyScale2.y > 0f) ? (lossyScale.y / lossyScale2.y) : 0f, (lossyScale2.z > 0f) ? (lossyScale.z / lossyScale2.z) : 0f); Renderer[] componentsInChildren6 = val5.GetComponentsInChildren(); foreach (Renderer val9 in componentsInChildren6) { val9.enabled = true; val9.forceRenderingOff = false; ((Component)val9).gameObject.layer = 0; } } } } public static void TogglePlayerThirdPersonModel(VecnaAI vecnaAI, PlayerControllerB player, bool isVisible) { if ((Object)(object)player == (Object)null) { return; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; bool flag = (Object)(object)localPlayerController == (Object)(object)player || (localPlayerController.isPlayerDead && (Object)(object)localPlayerController.spectatedPlayerScript == (Object)(object)player); if (isVisible) { ((Renderer)player.thisPlayerModel).enabled = true; if (!flag) { ((Renderer)player.thisPlayerModelLOD1).enabled = true; ((Renderer)player.thisPlayerModelLOD2).enabled = true; AudioSource[] componentsInChildren = ((Component)player).gameObject.GetComponentsInChildren(true); foreach (AudioSource val in componentsInChildren) { val.mute = false; } } if ((Object)(object)player.usernameCanvas != (Object)null) { ((Component)player.usernameCanvas).gameObject.SetActive(!flag); } if ((Object)(object)player.usernameBillboardText != (Object)null) { ((Behaviour)player.usernameBillboardText).enabled = !flag; } if ((Object)(object)player.usernameAlpha != (Object)null) { player.usernameAlpha.alpha = ((!flag) ? 1f : 0f); } } else { if (!flag) { ((Renderer)player.thisPlayerModel).enabled = false; ((Renderer)player.thisPlayerModelLOD1).enabled = false; ((Renderer)player.thisPlayerModelLOD2).enabled = false; AudioSource[] componentsInChildren2 = ((Component)player).gameObject.GetComponentsInChildren(true); foreach (AudioSource val2 in componentsInChildren2) { if (!((Object)(object)val2 == (Object)(object)player.currentVoiceChatAudioSource)) { val2.mute = true; } } } if ((Object)(object)player.usernameCanvas != (Object)null) { ((Component)player.usernameCanvas).gameObject.SetActive(false); } if ((Object)(object)player.usernameBillboardText != (Object)null) { ((Behaviour)player.usernameBillboardText).enabled = false; } if ((Object)(object)player.usernameAlpha != (Object)null) { player.usernameAlpha.alpha = 0f; } } for (int k = 0; k < player.ItemSlots.Length; k++) { GrabbableObject val3 = player.ItemSlots[k]; if (!((Object)(object)val3 != (Object)null)) { continue; } val3.EnableItemMeshes(isVisible); if (flag || isVisible) { continue; } Renderer[] componentsInChildren3 = ((Component)val3).GetComponentsInChildren(); foreach (Renderer val4 in componentsInChildren3) { if (val4.enabled) { vecnaAI.hiddenCosmetics.Add(val4); val4.enabled = false; val4.forceRenderingOff = true; } } Light[] componentsInChildren4 = ((Component)val3).GetComponentsInChildren(); foreach (Light val5 in componentsInChildren4) { if (((Behaviour)val5).enabled && val5.intensity > 0f) { if (!vecnaAI.hiddenLights.ContainsKey(val5)) { vecnaAI.hiddenLights.Add(val5, val5.intensity); } ((Behaviour)val5).enabled = false; val5.intensity = 0f; } } } if ((Object)(object)player.ItemOnlySlot != (Object)null) { GrabbableObject itemOnlySlot = player.ItemOnlySlot; itemOnlySlot.EnableItemMeshes(isVisible); if (!flag && !isVisible) { Renderer[] componentsInChildren5 = ((Component)itemOnlySlot).GetComponentsInChildren(); foreach (Renderer val6 in componentsInChildren5) { if (val6.enabled) { vecnaAI.hiddenCosmetics.Add(val6); val6.enabled = false; val6.forceRenderingOff = true; } } Light[] componentsInChildren6 = ((Component)itemOnlySlot).GetComponentsInChildren(); foreach (Light val7 in componentsInChildren6) { if (((Behaviour)val7).enabled && val7.intensity > 0f) { if (!vecnaAI.hiddenLights.ContainsKey(val7)) { vecnaAI.hiddenLights.Add(val7, val7.intensity); } ((Behaviour)val7).enabled = false; val7.intensity = 0f; } } } } if (!isVisible) { if (flag) { return; } Renderer[] componentsInChildren7 = ((Component)player).gameObject.GetComponentsInChildren(); foreach (Renderer val8 in componentsInChildren7) { if ((Object)(object)val8 == (Object)(object)player.thisPlayerModel || (Object)(object)val8 == (Object)(object)player.thisPlayerModelLOD1 || (Object)(object)val8 == (Object)(object)player.thisPlayerModelLOD2 || ((Object)(object)player.thisPlayerModelArms != (Object)null && (Object)(object)((Component)val8).gameObject == (Object)(object)((Component)player.thisPlayerModelArms).gameObject) || ((Object)((Component)val8).gameObject).name.ToLower().Contains("mapdot")) { continue; } bool flag2 = false; for (int num3 = 0; num3 < player.ItemSlots.Length; num3++) { if ((Object)(object)player.ItemSlots[num3] != (Object)null && ((Component)val8).transform.IsChildOf(((Component)player.ItemSlots[num3]).transform)) { flag2 = true; break; } } if (!flag2 && val8.enabled) { vecnaAI.hiddenCosmetics.Add(val8); val8.enabled = false; val8.forceRenderingOff = true; } } Light[] componentsInChildren8 = ((Component)player).gameObject.GetComponentsInChildren(); foreach (Light val9 in componentsInChildren8) { if (!((Object)((Component)val9).gameObject).name.ToLower().Contains("map") && !((Object)((Component)val9).gameObject).name.ToLower().Contains("nightvision") && ((Behaviour)val9).enabled && val9.intensity > 0f) { if (!vecnaAI.hiddenLights.ContainsKey(val9)) { vecnaAI.hiddenLights.Add(val9, val9.intensity); } ((Behaviour)val9).enabled = false; val9.intensity = 0f; } } return; } foreach (Renderer hiddenCosmetic in vecnaAI.hiddenCosmetics) { if ((Object)(object)hiddenCosmetic != (Object)null) { hiddenCosmetic.enabled = true; hiddenCosmetic.forceRenderingOff = false; } } vecnaAI.hiddenCosmetics.Clear(); foreach (KeyValuePair hiddenLight in vecnaAI.hiddenLights) { if ((Object)(object)hiddenLight.Key != (Object)null) { ((Behaviour)hiddenLight.Key).enabled = true; hiddenLight.Key.intensity = hiddenLight.Value; } } vecnaAI.hiddenLights.Clear(); } public static void ToggleTeammatesForVictim(VecnaAI vecnaAI, bool isVisible) { if ((Object)(object)vecnaAI.cursingPlayer == (Object)null) { return; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; Camera val = localPlayerController.gameplayCamera; if (localPlayerController.isPlayerDead && (Object)(object)StartOfRound.Instance.spectateCamera != (Object)null) { val = StartOfRound.Instance.spectateCamera; } if (!isVisible) { if (vecnaAI.storedCameraMask == -1) { vecnaAI.storedCameraMask = val.cullingMask; vecnaAI.storedCamera = val; vecnaAI.hiddenTeammateLayers.Clear(); } Camera obj = val; obj.cullingMask &= -8388609; Camera obj2 = val; obj2.cullingMask |= int.MinValue; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val2 in allPlayerScripts) { if (!((Object)(object)val2 != (Object)null) || !((Object)(object)val2 != (Object)(object)vecnaAI.cursingPlayer) || !val2.isPlayerControlled) { continue; } AudioSource[] componentsInChildren = ((Component)val2).gameObject.GetComponentsInChildren(true); foreach (AudioSource val3 in componentsInChildren) { if (!((Object)(object)val3 == (Object)(object)val2.currentVoiceChatAudioSource)) { val3.mute = true; } } if ((Object)(object)val2.usernameCanvas != (Object)null) { ((Component)val2.usernameCanvas).gameObject.SetActive(false); } if ((Object)(object)val2.usernameBillboardText != (Object)null) { ((Behaviour)val2.usernameBillboardText).enabled = false; } if ((Object)(object)vecnaAI.cursingPlayer.thisController != (Object)null && (Object)(object)val2.thisController != (Object)null) { Physics.IgnoreCollision((Collider)(object)vecnaAI.cursingPlayer.thisController, (Collider)(object)val2.thisController, true); Physics.IgnoreCollision(vecnaAI.cursingPlayer.playerCollider, val2.playerCollider, true); } Renderer[] componentsInChildren2 = ((Component)val2).GetComponentsInChildren(true); foreach (Renderer val4 in componentsInChildren2) { if ((Object)(object)((Component)val4).GetComponent() != (Object)null) { continue; } string text = ((Object)((Component)val4).gameObject).name.ToLower(); if (text.Contains("map") || text.Contains("radar") || text.Contains("arrow")) { val4.enabled = false; continue; } if (!vecnaAI.hiddenTeammateLayers.ContainsKey(val4)) { vecnaAI.hiddenTeammateLayers[val4] = ((Component)val4).gameObject.layer; } ((Component)val4).gameObject.layer = 23; } } EnemyAI[] array = Object.FindObjectsOfType(); foreach (EnemyAI val5 in array) { if (!((Object)(object)val5 != (Object)null) || !((Object)(object)val5 != (Object)(object)vecnaAI) || val5.isEnemyDead) { continue; } Renderer[] componentsInChildren3 = ((Component)val5).GetComponentsInChildren(true); foreach (Renderer val6 in componentsInChildren3) { if ((Object)(object)((Component)val6).GetComponent() != (Object)null) { continue; } if (((Object)((Component)val6).gameObject).name.ToLower().Contains("mapdot")) { val6.enabled = false; continue; } int num = ((Component)val6).gameObject.layer; if (num == 23 || num == 23) { num = 19; } if (!vecnaAI.hiddenTeammateLayers.ContainsKey(val6)) { vecnaAI.hiddenTeammateLayers[val6] = num; } ((Component)val6).gameObject.layer = 23; } } Renderer[] componentsInChildren4 = ((Component)vecnaAI.cursingPlayer).GetComponentsInChildren(true); foreach (Renderer val7 in componentsInChildren4) { if ((Object)(object)((Component)val7).GetComponent() != (Object)null || ((Object)(object)vecnaAI.cursingPlayer.thisPlayerModelArms != (Object)null && (Object)(object)((Component)val7).gameObject == (Object)(object)((Component)vecnaAI.cursingPlayer.thisPlayerModelArms).gameObject)) { continue; } string text2 = ((Object)((Component)val7).gameObject).name.ToLower(); if (text2.Contains("map") || text2.Contains("radar") || text2.Contains("arrow")) { val7.enabled = false; } else if (!((Object)(object)localPlayerController == (Object)(object)vecnaAI.cursingPlayer) || (((Component)val7).gameObject.layer != 23 && !((Object)(object)val7 == (Object)(object)vecnaAI.cursingPlayer.thisPlayerModel) && !((Object)(object)val7 == (Object)(object)vecnaAI.cursingPlayer.thisPlayerModelLOD1) && !((Object)(object)val7 == (Object)(object)vecnaAI.cursingPlayer.thisPlayerModelLOD2))) { if (!vecnaAI.hiddenTeammateLayers.ContainsKey(val7)) { vecnaAI.hiddenTeammateLayers[val7] = ((Component)val7).gameObject.layer; } ((Component)val7).gameObject.layer = 31; } } Renderer[] componentsInChildren5 = ((Component)vecnaAI).GetComponentsInChildren(true); foreach (Renderer val8 in componentsInChildren5) { if (!((Object)(object)((Component)val8).GetComponent() != (Object)null) && !((Object)((Component)val8).gameObject).name.ToLower().Contains("mapdot")) { if (!vecnaAI.hiddenTeammateLayers.ContainsKey(val8)) { vecnaAI.hiddenTeammateLayers[val8] = ((Component)val8).gameObject.layer; } ((Component)val8).gameObject.layer = 31; } } return; } Renderer[] componentsInChildren6 = ((Component)vecnaAI.cursingPlayer).GetComponentsInChildren(true); foreach (Renderer val9 in componentsInChildren6) { string text3 = ((Object)((Component)val9).gameObject).name.ToLower(); if (text3.Contains("map") || text3.Contains("radar") || text3.Contains("arrow")) { val9.enabled = true; } } if (vecnaAI.storedCameraMask != -1) { Camera val10 = (Camera)(((Object)(object)vecnaAI.storedCamera != (Object)null) ? ((object)vecnaAI.storedCamera) : ((object)val)); val10.cullingMask = vecnaAI.storedCameraMask; vecnaAI.storedCameraMask = -1; vecnaAI.storedCamera = null; } foreach (KeyValuePair hiddenTeammateLayer in vecnaAI.hiddenTeammateLayers) { if ((Object)(object)hiddenTeammateLayer.Key != (Object)null) { ((Component)hiddenTeammateLayer.Key).gameObject.layer = hiddenTeammateLayer.Value; } } vecnaAI.hiddenTeammateLayers.Clear(); PlayerControllerB[] allPlayerScripts2 = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val11 in allPlayerScripts2) { if (!((Object)(object)val11 != (Object)null) || !((Object)(object)val11 != (Object)(object)vecnaAI.cursingPlayer) || !val11.isPlayerControlled) { continue; } AudioSource[] componentsInChildren7 = ((Component)val11).gameObject.GetComponentsInChildren(true); foreach (AudioSource val12 in componentsInChildren7) { if (!((Object)(object)val12 == (Object)(object)val11.currentVoiceChatAudioSource)) { val12.mute = false; } } if ((Object)(object)val11.usernameCanvas != (Object)null) { ((Component)val11.usernameCanvas).gameObject.SetActive(true); } if ((Object)(object)val11.usernameBillboardText != (Object)null) { ((Behaviour)val11.usernameBillboardText).enabled = true; } if ((Object)(object)vecnaAI.cursingPlayer.thisController != (Object)null && (Object)(object)val11.thisController != (Object)null) { Physics.IgnoreCollision((Collider)(object)vecnaAI.cursingPlayer.thisController, (Collider)(object)val11.thisController, false); Physics.IgnoreCollision(vecnaAI.cursingPlayer.playerCollider, val11.playerCollider, false); } Renderer[] componentsInChildren8 = ((Component)val11).GetComponentsInChildren(true); foreach (Renderer val13 in componentsInChildren8) { string text4 = ((Object)((Component)val13).gameObject).name.ToLower(); if (text4.Contains("map") || text4.Contains("radar") || text4.Contains("arrow")) { val13.enabled = true; } } } EnemyAI[] array2 = Object.FindObjectsOfType(); foreach (EnemyAI val14 in array2) { if (!((Object)(object)val14 != (Object)null) || !((Object)(object)val14 != (Object)(object)vecnaAI) || val14.isEnemyDead) { continue; } Renderer[] componentsInChildren9 = ((Component)val14).GetComponentsInChildren(true); foreach (Renderer val15 in componentsInChildren9) { if (((Object)((Component)val15).gameObject).name.ToLower().Contains("mapdot")) { val15.enabled = true; } } } } public static void EnforceTeammateHeldItems(VecnaAI vecnaBrain) { PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if ((Object)(object)val != (Object)null && (Object)(object)val != (Object)(object)vecnaBrain.cursingPlayer && val.isPlayerControlled && !val.isPlayerDead) { for (int j = 0; j < val.ItemSlots.Length; j++) { if (!((Object)(object)val.ItemSlots[j] != (Object)null)) { continue; } Renderer[] componentsInChildren = ((Component)val.ItemSlots[j]).GetComponentsInChildren(true); foreach (Renderer val2 in componentsInChildren) { if (!((Object)(object)((Component)val2).GetComponent() != (Object)null) && ((Component)val2).gameObject.layer != 23) { if (!vecnaBrain.hiddenTeammateLayers.ContainsKey(val2)) { vecnaBrain.hiddenTeammateLayers[val2] = ((Component)val2).gameObject.layer; } ((Component)val2).gameObject.layer = 23; } } } } if (!((Object)(object)val.ItemOnlySlot != (Object)null)) { continue; } Renderer[] componentsInChildren2 = ((Component)val.ItemOnlySlot).GetComponentsInChildren(true); foreach (Renderer val3 in componentsInChildren2) { if (((Component)val3).gameObject.layer != 23) { if (!vecnaBrain.hiddenTeammateLayers.ContainsKey(val3)) { vecnaBrain.hiddenTeammateLayers[val3] = ((Component)val3).gameObject.layer; } ((Component)val3).gameObject.layer = 23; } } } } } public static class PluginInfo { public const string PLUGIN_GUID = "Vecna"; public const string PLUGIN_NAME = "Vecna"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace Vecna.Configuration { public class PluginConfig { public ConfigEntry SpawnWeightTitan; public ConfigEntry SpawnWeightRend; public ConfigEntry SpawnWeightDine; public ConfigEntry SpawnWeightOffense; public ConfigEntry SpawnWeightMarch; public ConfigEntry SpawnWeightExperimentation; public ConfigEntry SpawnWeightAssurance; public ConfigEntry SpawnWeightVow; public ConfigEntry SpawnWeightArtifice; public ConfigEntry SpawnWeightEmbrion; public ConfigEntry SpawnWeightAdamance; public ConfigEntry SpawnWeightModded; public ConfigEntry SpawnInterval; public ConfigEntry MaxUnspottedTime; public ConfigEntry MaxStareTime; public ConfigEntry ClocksBeforeChase; public ConfigEntry ChaseSpeed; public ConfigEntry KillRange; public ConfigEntry MaxChaseTime; public ConfigEntry LightFlickerRadius; public ConfigEntry BoomboxRescueRadius; public PluginConfig(ConfigFile cfg) { SpawnWeightTitan = cfg.Bind("0. Spawn Weights", "Titan", 50, "Spawn weight of Vecna on Titan."); SpawnWeightRend = cfg.Bind("0. Spawn Weights", "Rend", 75, "Spawn weight of Vecna on Rend."); SpawnWeightDine = cfg.Bind("0. Spawn Weights", "Dine", 55, "Spawn weight of Vecna on Dine."); SpawnWeightOffense = cfg.Bind("0. Spawn Weights", "Offense", 30, "Spawn weight of Vecna on Offense."); SpawnWeightMarch = cfg.Bind("0. Spawn Weights", "March", 30, "Spawn weight of Vecna on March."); SpawnWeightExperimentation = cfg.Bind("0. Spawn Weights", "Experimentation", 10, "Spawn weight of Vecna on Experimentation."); SpawnWeightAssurance = cfg.Bind("0. Spawn Weights", "Assurance", 20, "Spawn weight of Vecna on Assurance."); SpawnWeightVow = cfg.Bind("0. Spawn Weights", "Vow", 20, "Spawn weight of Vecna on Vow."); SpawnWeightArtifice = cfg.Bind("0. Spawn Weights", "Artifice", 65, "Spawn weight of Vecna on Artifice."); SpawnWeightEmbrion = cfg.Bind("0. Spawn Weights", "Embrion", 100, "Spawn weight of Vecna on Embrion."); SpawnWeightAdamance = cfg.Bind("0. Spawn Weights", "Adamance", 55, "Spawn weight of Vecna on Adamance."); SpawnWeightModded = cfg.Bind("0. Spawn Weights", "Modded Moons", 45, "Base spawn weight of Vecna on custom modded moons."); SpawnInterval = cfg.Bind("1. Phase 1 (Stalking)", "Clock Spawn Interval", 40f, "Time in seconds between clock spawns."); MaxUnspottedTime = cfg.Bind("1. Phase 1 (Stalking)", "Max Unspotted Time", 20f, "Time before an unseen clock vanishes."); MaxStareTime = cfg.Bind("1. Phase 1 (Stalking)", "Max Stare Time", 10f, "Time before a spotted clock vanishes (first 2 clocks)."); ClocksBeforeChase = cfg.Bind("1. Phase 1 (Stalking)", "Clocks Before Chase", 3, "Number of clocks that must spawn before the chase begins."); ChaseSpeed = cfg.Bind("2. Phase 2 (Chasing)", "Chase Speed", 6.5f, "Vecna's movement speed while chasing."); KillRange = cfg.Bind("2. Phase 2 (Chasing)", "Kill Range", 2.5f, "Distance required to initiate the execution."); MaxChaseTime = cfg.Bind("2. Phase 2 (Chasing)", "Max Chase Time", 60f, "How long the chase lasts before the victim survives."); LightFlickerRadius = cfg.Bind("3. Mechanics", "Light Flicker Radius", 25f, "Radius around the victim where lights will flicker."); BoomboxRescueRadius = cfg.Bind("3. Mechanics", "Boombox Rescue Radius", 15f, "Distance a boombox must be from the real-world body to open a portal."); ClearUnusedEntries(cfg); } public void ApplyTo(VecnaStats stats) { if (!((Object)(object)stats == (Object)null)) { stats.spawnInterval = SpawnInterval.Value; stats.maxUnspottedTime = MaxUnspottedTime.Value; stats.maxStareTime = MaxStareTime.Value; stats.clocksBeforeChase = ClocksBeforeChase.Value; stats.chaseSpeed = ChaseSpeed.Value; stats.killRange = KillRange.Value; stats.killRangeSquared = KillRange.Value * KillRange.Value; stats.maxChaseTime = MaxChaseTime.Value; stats.lightFlickerRadius = LightFlickerRadius.Value; stats.boomboxRescueRadius = BoomboxRescueRadius.Value; } } private void ClearUnusedEntries(ConfigFile cfg) { PropertyInfo property = ((object)cfg).GetType().GetProperty("OrphanedEntries", BindingFlags.Instance | BindingFlags.NonPublic); Dictionary dictionary = (Dictionary)property.GetValue(cfg, null); dictionary.Clear(); cfg.Save(); } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { NetworkVariableSerializationTypes.InitializeSerializer_UnmanagedByMemcpy(); NetworkVariableSerializationTypes.InitializeEqualityChecker_UnmanagedValueEquals(); } } } namespace Vecna.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }