using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LegaFusionCore; using LegaFusionCore.Managers; using LegaFusionCore.Utilities; using LethalLib.Modules; using Microsoft.CodeAnalysis; using TheDoctor.Behaviours.Enemies; using TheDoctor.Behaviours.Items; using TheDoctor.Managers; using TheDoctor.NetcodePatcher; using TheDoctor.Patches; using Unity.Netcode; using UnityEngine; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("TheDoctor")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("TheDoctor")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("7cd86020-c68a-4a12-9d59-36e91e964aa1")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("ClientNetworkTransform")] [assembly: IgnoresAccessChecksTo("com.olegknyazev.softmask")] [assembly: IgnoresAccessChecksTo("DissonanceVoip")] [assembly: IgnoresAccessChecksTo("DunGen")] [assembly: IgnoresAccessChecksTo("DunGen.Integration.ASPP")] [assembly: IgnoresAccessChecksTo("DunGen.Integration.UnityNav")] [assembly: IgnoresAccessChecksTo("EasyTextEffects")] [assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")] [assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")] [assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")] [assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging")] [assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging.DocCodeExamples")] [assembly: IgnoresAccessChecksTo("Unity.Burst")] [assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")] [assembly: IgnoresAccessChecksTo("Unity.Collections")] [assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")] [assembly: IgnoresAccessChecksTo("Unity.Jobs")] [assembly: IgnoresAccessChecksTo("Unity.Mathematics")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.Common")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.MetricTypes")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStats")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Component")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Configuration")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Implementation")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsReporting")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkProfiler.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkSolutionInterface")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Components")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Networking.Transport")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Csg")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.KdTree")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Poly2Tri")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Stl")] [assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Config.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")] [assembly: IgnoresAccessChecksTo("Unity.Services.Authentication")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Analytics")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Components")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Configuration")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Device")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments.Internal")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Internal")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Networking")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Registration")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Scheduler")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Telemetry")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Threading")] [assembly: IgnoresAccessChecksTo("Unity.Services.QoS")] [assembly: IgnoresAccessChecksTo("Unity.Services.Relay")] [assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")] [assembly: IgnoresAccessChecksTo("Unity.Timeline")] [assembly: IgnoresAccessChecksTo("Unity.VisualEffectGraph.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.XR.CoreUtils")] [assembly: IgnoresAccessChecksTo("Unity.XR.Management")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.ConformanceAutomation")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.MetaQuestSupport")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.MockRuntime")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.OculusQuestSupport")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.RuntimeDebugger")] [assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.SpatialTracking")] [assembly: IgnoresAccessChecksTo("UnityEngine.UI")] [assembly: IgnoresAccessChecksTo("UnityEngine.XR.LegacyInputHelpers")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [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.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace TheDoctor { public class Constants { public const string GLOBAL = "_Global_"; public const string BRAIN = "Brain"; public const string CORPSE = "Corpse"; public const string HEART = "Heart"; public const string EYE = "Eye"; public const string SPECTRAL_DECOY = "Spectral Decoy"; public const string SCREEN_MATERIALS_PREFIX = "MI_Doctor_Screen"; public const string MSG_INFORMATION = "Information"; public const string MSG_DOCTOR_ITEM_TIP = "This item will help you find the Doctor's brain."; } [BepInPlugin("Lega.TheDoctor", "The Doctor", "1.0.6")] public class TheDoctor : BaseUnityPlugin { internal const string modGUID = "Lega.TheDoctor"; internal const string modName = "The Doctor"; internal const string modVersion = "1.0.6"; private readonly Harmony harmony = new Harmony("Lega.TheDoctor"); private static readonly AssetBundle bundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "thedoctor")); internal static ManualLogSource mls; public static ConfigFile configFile; public static GameObject managerPrefab = NetworkPrefabs.CreateNetworkPrefab("TheDoctorNetworkManager"); public static EnemyType doctorCorpseEnemy; public static Item doctorHeart; public static Item doctorEye; public static Item doctorBrain; public static GameObject doctorClone; public static GameObject electroExplosionParticle; public static GameObject doctorCloneAudio; public static Material inertScreen; public static Material scanningScreen; public static Material foundScreen; public void Awake() { mls = Logger.CreateLogSource("TheDoctor"); configFile = ((BaseUnityPlugin)this).Config; ConfigManager.Load(); LoadManager(); NetcodePatcher(); LoadEnemies(); LoadItems(); LoadMaterials(); LoadNetworkPrefabs(); harmony.PatchAll(typeof(StartOfRoundPatch)); } public static void LoadManager() { Utilities.FixMixerGroups(managerPrefab); managerPrefab.AddComponent(); } private static void NetcodePatcher() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } } public static void LoadEnemies() { EnemyType val = bundle.LoadAsset("Assets/DoctorBrainAI/DoctorBrainEnemy.asset"); val.probabilityCurve = ConfigManager.ParseCurveFromString(); NetworkPrefabs.RegisterNetworkPrefab(val.enemyPrefab); var (dictionary, dictionary2) = ConfigManager.GetEnemiesSpawns(); Enemies.RegisterEnemy(val, dictionary, dictionary2, bundle.LoadAsset("Assets/DoctorBrainAI/DoctorBrainTN.asset"), bundle.LoadAsset("Assets/DoctorBrainAI/DoctorBrainTK.asset")); doctorCorpseEnemy = bundle.LoadAsset("Assets/DoctorCorpseAI/DoctorCorpseEnemy.asset"); NetworkPrefabs.RegisterNetworkPrefab(doctorCorpseEnemy.enemyPrefab); Enemies.RegisterEnemy(doctorCorpseEnemy, 0, (LevelTypes)1, bundle.LoadAsset("Assets/DoctorCorpseAI/DoctorCorpseTN.asset"), bundle.LoadAsset("Assets/DoctorCorpseAI/DoctorCorpseTK.asset")); } public void LoadItems() { doctorHeart = LFCObjectsManager.RegisterObject(typeof(DoctorHeart), bundle.LoadAsset("Assets/DoctorHeart/DoctorHeartItem.asset")); doctorEye = LFCObjectsManager.RegisterObject(typeof(DoctorEye), bundle.LoadAsset("Assets/DoctorEye/DoctorEyeItem.asset")); doctorBrain = LFCObjectsManager.RegisterObject(typeof(DoctorBrain), bundle.LoadAsset("Assets/DoctorBrain/DoctorBrainItem.asset")); } public static void LoadMaterials() { inertScreen = bundle.LoadAsset("Assets/DoctorCorpseAI/Materials/MI_Doctor_Screen_Inert.mat"); scanningScreen = bundle.LoadAsset("Assets/DoctorCorpseAI/Materials/MI_Doctor_Screen_Scanning.mat"); foundScreen = bundle.LoadAsset("Assets/DoctorCorpseAI/Materials/MI_Doctor_Screen_Found.mat"); } public static void LoadNetworkPrefabs() { HashSet hashSet = new HashSet { electroExplosionParticle = bundle.LoadAsset("Assets/Particles/ElectroExplosionParticle.prefab"), doctorClone = bundle.LoadAsset("Assets/DoctorClone/DoctorClone.prefab"), doctorCloneAudio = bundle.LoadAsset("Assets/Audios/Assets/DoctorCloneAudio.prefab") }; foreach (GameObject item in hashSet) { NetworkPrefabs.RegisterNetworkPrefab(item); Utilities.FixMixerGroups(item); } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "TheDoctor"; public const string PLUGIN_NAME = "TheDoctor"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace TheDoctor.Patches { public class StartOfRoundPatch { [HarmonyPatch(typeof(StartOfRound), "Start")] [HarmonyBefore(new string[] { "evaisa.lethallib" })] [HarmonyPostfix] public static void StartRound(ref StartOfRound __instance) { if (NetworkManager.Singleton.IsHost && (Object)(object)TheDoctorNetworkManager.Instance == (Object)null) { GameObject val = Object.Instantiate(TheDoctor.managerPrefab, ((Component)__instance).transform.parent); val.GetComponent().Spawn(false); TheDoctor.mls.LogInfo((object)"Spawning TheDoctorNetworkManager"); } } [HarmonyPatch(typeof(StartOfRound), "OnDisable")] [HarmonyPostfix] public static void OnDisable() { TheDoctorNetworkManager.Instance = null; } } } namespace TheDoctor.Managers { public class ConfigManager { public static ConfigEntry spawnWeights; public static ConfigEntry probabilityCurve; public static ConfigEntry amountCorpses; public static ConfigEntry scanMinCooldown; public static ConfigEntry scanMaxCooldown; public static ConfigEntry isShipDialogue; public static ConfigEntry isInsideDialogue; public static ConfigEntry scanDuration; public static ConfigEntry corpseSpeed; public static ConfigEntry heartTrackingDuration; public static ConfigEntry heartMinValue; public static ConfigEntry heartMaxValue; public static ConfigEntry eyeTrackingDuration; public static ConfigEntry eyeMinValue; public static ConfigEntry eyeMaxValue; public static ConfigEntry brainSpecialAbility; public static ConfigEntry brainMinValue; public static ConfigEntry brainMaxValue; public static ConfigEntry spectralDecoyCooldown; public static ConfigEntry spectralDecoyDamage; public static void Load() { spawnWeights = TheDoctor.configFile.Bind("_Global_", "Spawn weights", "Vanilla:20,Modded:20", "Brain enemy spawn weights"); probabilityCurve = TheDoctor.configFile.Bind("_Global_", "Probability curve", "0,1;0.25,1;0.3,0;1,0", "Brain probability curve (format : time,value;time,value;...)"); amountCorpses = TheDoctor.configFile.Bind("_Global_", "Amount corpses", 8, "Amount of Corpse that spawn at the same time as the Brain"); scanMinCooldown = TheDoctor.configFile.Bind("_Global_", "Scan min", 2f, "Minimum cooldown duration between Corpse scans"); scanMaxCooldown = TheDoctor.configFile.Bind("_Global_", "Scan max", 8f, "Maximum cooldown duration between Corpse scans"); isShipDialogue = TheDoctor.configFile.Bind("_Global_", "Ship dialogue", true, "Trigger the ship dialogue when the Brain spawns"); isInsideDialogue = TheDoctor.configFile.Bind("_Global_", "Inside dialogue", true, "Trigger the inside dialogue when the Brain spawns"); scanDuration = TheDoctor.configFile.Bind("Corpse", "Scan duration", 7f, "Scan duration for the Corpse"); corpseSpeed = TheDoctor.configFile.Bind("Corpse", "Corpse speed", 5f, "Corpse speed"); heartTrackingDuration = TheDoctor.configFile.Bind("Heart", "Tracking duration", 45, "Heart tracking duration"); heartMinValue = TheDoctor.configFile.Bind("Heart", "Min value", 15, "Heart min value"); heartMaxValue = TheDoctor.configFile.Bind("Heart", "Max value", 30, "Heart max value"); eyeTrackingDuration = TheDoctor.configFile.Bind("Eye", "Tracking duration", 45, "Eye tracking duration"); eyeMinValue = TheDoctor.configFile.Bind("Eye", "Min value", 15, "Eye min value"); eyeMaxValue = TheDoctor.configFile.Bind("Eye", "Max value", 30, "Eye max value"); brainSpecialAbility = TheDoctor.configFile.Bind("Brain", "Enable special ability", true, "Enable Brain item's special ability (Spectral Decoy)?"); brainMinValue = TheDoctor.configFile.Bind("Brain", "Min value", 50, "Brain min value"); brainMaxValue = TheDoctor.configFile.Bind("Brain", "Max value", 100, "Brain max value"); spectralDecoyCooldown = TheDoctor.configFile.Bind("Spectral Decoy", "Cooldown", 120, "Cooldown duration of the Spectral Decoy"); spectralDecoyDamage = TheDoctor.configFile.Bind("Spectral Decoy", "Damage", 2, "Damages inflicted by the Spectral Decoy"); } public static AnimationCurve ParseCurveFromString() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_00ed: 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_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_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Expected O, but got Unknown //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) if (!string.IsNullOrWhiteSpace(probabilityCurve.Value)) { string[] array = probabilityCurve.Value.Split(';'); List list = new List(); string[] array2 = array; foreach (string text in array2) { string[] array3 = text.Split(','); if (array3.Length == 2 && float.TryParse(array3[0], NumberStyles.Float, CultureInfo.InvariantCulture, out var result) && float.TryParse(array3[1], NumberStyles.Float, CultureInfo.InvariantCulture, out var result2)) { list.Add(new Keyframe(result, result2)); } } if (list.Count == 0) { return new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, 1f), new Keyframe(1f, 1f) }); } return new AnimationCurve(list.ToArray()); } return new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, 1f), new Keyframe(1f, 1f) }); } public static (Dictionary spawnRateByLevelType, Dictionary spawnRateByCustomLevelType) GetEnemiesSpawns() { //IL_0083: Unknown result type (might be due to invalid IL or missing references) Dictionary dictionary = new Dictionary(); Dictionary dictionary2 = new Dictionary(); foreach (string item in from s in spawnWeights.Value.Split(',') select s.Trim()) { string[] array = item.Split(':'); if (array.Length != 2) { continue; } string text = array[0]; if (int.TryParse(array[1], out var result)) { if (Enum.TryParse(text, ignoreCase: true, out LevelTypes result2)) { dictionary[result2] = result; } else { dictionary2[text] = result; } } } return (dictionary, dictionary2); } } public class TheDoctorNetworkManager : NetworkBehaviour { public static TheDoctorNetworkManager Instance; public void Awake() { Instance = this; } [Rpc(/*Could not decode attribute arguments.*/)] public void SpawnSpectralDecoyEveryoneRpc(int playerId) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1781084080u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1781084080u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB component = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent(); Object.Instantiate(TheDoctor.doctorClone, ((Component)component).transform.position + ((Component)component).transform.forward * 1.5f, ((Component)component).transform.rotation); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1781084080u, new RpcReceiveHandler(__rpc_handler_1781084080), "SpawnSpectralDecoyEveryoneRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1781084080(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 playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((TheDoctorNetworkManager)(object)target).SpawnSpectralDecoyEveryoneRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "TheDoctorNetworkManager"; } } } namespace TheDoctor.Behaviours.MapObjects { public class DoctorClone : NetworkBehaviour { [CompilerGenerated] private sealed class <>c__DisplayClass1_0 { public Vector3 explosionPosition; internal void b__0(EnemyAI e) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) e.SetDestinationToPosition(explosionPosition, false); e.moveTowardsDestination = true; } internal bool b__1(EnemyAI e) { //IL_0006: 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) return Vector3.Distance(((Component)e).transform.position, explosionPosition) <= 5f; } } [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DoctorClone <>4__this; private <>c__DisplayClass1_0 <>8__1; private List 5__2; private float 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: 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_0083: 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_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: 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) int num = <>1__state; DoctorClone doctorClone = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; <>8__1 = new <>c__DisplayClass1_0(); GameObject val = Object.Instantiate(TheDoctor.doctorCloneAudio, ((Component)doctorClone).transform.position, Quaternion.identity); AudioSource component = val.GetComponent(); if (component != null) { component.Play(); } <>8__1.explosionPosition = ((Component)doctorClone).transform.position + ((Component)doctorClone).transform.forward * 1.6f; 5__2 = new List(); Collider[] array = Physics.OverlapSphere(((Component)doctorClone).transform.position, 10f, 524288, (QueryTriggerInteraction)2); Collider[] array2 = array; foreach (Collider val2 in array2) { EnemyAI val3 = ((Component)val2).GetComponent()?.mainScript; if ((Object)(object)val3 != (Object)null) { 5__2.Add(val3); } } 5__3 = 0f; break; } case 1: <>1__state = -1; 5__3 += Time.deltaTime; break; } if (5__3 < 5.5f) { 5__2.ForEach(delegate(EnemyAI e) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) e.SetDestinationToPosition(<>8__1.explosionPosition, false); e.moveTowardsDestination = true; }); <>2__current = null; <>1__state = 1; return true; } if (LFCUtilities.IsServer) { 5__2.Where((EnemyAI e) => Vector3.Distance(((Component)e).transform.position, <>8__1.explosionPosition) <= 5f).ToList().ForEach(delegate(EnemyAI e) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) e.HitEnemyOnLocalClient(ConfigManager.spectralDecoyDamage.Value, default(Vector3), (PlayerControllerB)null, false, -1); }); } LFCGlobalManager.PlayParticle("Lega Fusion Core" + ((Object)LegaFusionCore.darkExplosionParticle).name, <>8__1.explosionPosition + ((Component)doctorClone).transform.up, Quaternion.identity, true, 1f, true); Object.Destroy((Object)(object)((Component)doctorClone).gameObject); 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 void Start() { ((MonoBehaviour)this).StartCoroutine(AttractEnemiesCoroutine()); } [IteratorStateMachine(typeof(d__1))] public IEnumerator AttractEnemiesCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { <>4__this = this }; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "DoctorClone"; } } } namespace TheDoctor.Behaviours.Items { public class DoctorBrain : PhysicsProp { public void InitializeForServer() { int value = Random.Range(ConfigManager.brainMinValue.Value, ConfigManager.brainMaxValue.Value); InitializeEveryoneRpc(value); } [Rpc(/*Could not decode attribute arguments.*/)] public void InitializeEveryoneRpc(int value) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1845176497u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, value); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1845176497u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((GrabbableObject)this).SetScrapValue(value); } } } protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1845176497u, new RpcReceiveHandler(__rpc_handler_1845176497), "InitializeEveryoneRpc"); ((PhysicsProp)this).__initializeRpcs(); } private static void __rpc_handler_1845176497(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 value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((DoctorBrain)(object)target).InitializeEveryoneRpc(value); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "DoctorBrain"; } } public class DoctorEye : DoctorItem { public Animator animator; public override void Start() { ((GrabbableObject)this).Start(); currentTimeLeft = ConfigManager.eyeTrackingDuration.Value; } public override void Update() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: 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_010f: 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) ((GrabbableObject)this).Update(); if (isTracking && !((Object)(object)doctorBrain == (Object)null) && !((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null) && !((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)(object)GameNetworkManager.Instance.localPlayerController) && !((GrabbableObject)this).playerHeldBy.quickMenuManager.isMenuOpen) { MovementActions movement = ((GrabbableObject)this).playerHeldBy.playerActions.Movement; Vector2 val = ((MovementActions)(ref movement)).Look.ReadValue() * (float)IngamePlayerSettings.Instance.settings.lookSensitivity * 0.008f; doctorBrain.cameraPivot.Rotate(new Vector3(0f, val.x, 0f)); float num = doctorBrain.cameraPivot.localEulerAngles.x - val.y; num = ((num > 180f) ? (num - 360f) : num); num = Mathf.Clamp(num, -45f, 45f); doctorBrain.cameraPivot.localEulerAngles = new Vector3(num, doctorBrain.cameraPivot.localEulerAngles.y, 0f); } } public override void ItemActivate(bool used, bool buttonDown = true) { base.ItemActivate(used, buttonDown); if (!hasBeenUsed && isTracking && !((Object)(object)doctorBrain == (Object)null)) { doctorBrain.SwitchCamera((Object)(object)doctorBrain.camera == (Object)(object)GameNetworkManager.Instance.localPlayerController.gameplayCamera); } } public override void StartTrackingForClients() { base.StartTrackingForClients(); ((GrabbableObject)this).itemProperties.toolTips[0] = "Switch camera : [LMB]"; } public override void ItemDeactivate() { base.ItemDeactivate(); doctorBrain?.SwitchCamera(switchingBack: true); } public override void PocketItem() { doctorBrain?.SwitchCamera(switchingBack: true); ((GrabbableObject)this).PocketItem(); } public override void DiscardItem() { doctorBrain?.SwitchCamera(switchingBack: true); ((GrabbableObject)this).DiscardItem(); } public override void OnDestroy() { doctorBrain?.SwitchCamera(switchingBack: true); ((GrabbableObject)this).OnDestroy(); } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "DoctorEye"; } } public class DoctorHeart : DoctorItem { public AudioSource audioSource; public Animator animator; public override void Start() { ((GrabbableObject)this).Start(); currentTimeLeft = ConfigManager.heartTrackingDuration.Value; } public override void Update() { //IL_0039: 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) ((GrabbableObject)this).Update(); if (!hasBeenUsed && isTracking && !((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null) && !((Object)(object)doctorBrain == (Object)null)) { float num = Vector3.Distance(((Component)this).transform.position, ((Component)doctorBrain).transform.position); float num2 = Mathf.Pow(Mathf.Clamp01(1f - num / 100f), 2f); audioSource.pitch = Mathf.Lerp(0.75f, 2.5f, num2); animator.speed = Mathf.Lerp(1.2f, 4f, num2); } } public override void ItemActivate(bool used, bool buttonDown = true) { if (!audioSource.isPlaying) { base.ItemActivate(used, buttonDown); } } public override void StartTrackingForClients() { base.StartTrackingForClients(); audioSource.Play(); animator.Play("heartbeat", 0, 0f); } public override void ItemDeactivate() { base.ItemDeactivate(); if (audioSource.isPlaying) { audioSource.Stop(); } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "DoctorHeart"; } } public class DoctorItem : PhysicsProp { [CompilerGenerated] private sealed class d__9 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DoctorItem <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__9(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown int num = <>1__state; DoctorItem doctorItem = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; doctorItem.currentTimeLeft--; ((GrabbableObject)doctorItem).SetControlTipsForItem(); break; } if (doctorItem.currentTimeLeft > 0) { <>2__current = (object)new WaitForSecondsRealtime(1f); <>1__state = 1; return true; } doctorItem.ItemDeactivate(); 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 bool hasBeenUsed; public bool isTracking; public int currentTimeLeft; public DoctorBrainAI doctorBrain; [Rpc(/*Could not decode attribute arguments.*/)] public void InitializeDoctorItemEveryoneRpc(NetworkObjectReference obj, int value) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: 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) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(894187736u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref obj, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val3, value); ((NetworkBehaviour)this).__endSendRpc(ref val3, 894187736u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); if (((NetworkObjectReference)(ref obj)).TryGet(ref val4, (NetworkManager)null)) { doctorBrain = ((Component)val4).gameObject.GetComponentInChildren(); ((GrabbableObject)this).SetScrapValue(value); } } } public override void GrabItem() { ((GrabbableObject)this).GrabItem(); if (!((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null) && !((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)(object)GameNetworkManager.Instance.localPlayerController)) { HUDManager.Instance.DisplayTip("Information", "This item will help you find the Doctor's brain.", false, false, "LC_Tip1"); } } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (!hasBeenUsed && !isTracking) { StartTrackingEveryoneRpc(); } } [Rpc(/*Could not decode attribute arguments.*/)] public void StartTrackingEveryoneRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3520928820u, val2, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3520928820u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)doctorBrain == (Object)null) { TheDoctor.mls.LogError((object)"Doctor's Brain not found for the Doctor's item"); return; } isTracking = true; StartTrackingForClients(); } } public virtual void StartTrackingForClients() { ((MonoBehaviour)this).StartCoroutine(StartTrackingCoroutine()); doctorBrain.canLoseChase = false; IEnumerable enumerable = Array.Empty(); if (!doctorBrain.corpses.Any((DoctorCorpseAI c) => (Object)(object)c != (Object)null && ((EnemyAI)c).currentBehaviourStateIndex == 2)) { enumerable = doctorBrain.corpses.Where((DoctorCorpseAI c) => (Object)(object)c != (Object)null && ((EnemyAI)c).currentBehaviourStateIndex != 2).Take(3); } foreach (DoctorCorpseAI item in enumerable) { ((EnemyAI)item).targetPlayer = ((GrabbableObject)this).playerHeldBy; ((EnemyAI)item).SwitchToBehaviourStateOnLocalClient(2); } } [IteratorStateMachine(typeof(d__9))] public IEnumerator StartTrackingCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__9(0) { <>4__this = this }; } public override void SetControlTipsForItem() { if (!((GrabbableObject)this).isPocketed && !((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null) && !((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)(object)GameNetworkManager.Instance.localPlayerController)) { string item = (isTracking ? $"[Time Left : {currentTimeLeft}]" : ""); HUDManager.Instance.ChangeControlTipMultiple(((GrabbableObject)this).itemProperties.toolTips.Concat(new <>z__ReadOnlySingleElementList(item)).ToArray(), true, ((GrabbableObject)this).itemProperties); } } public virtual void ItemDeactivate() { hasBeenUsed = true; isTracking = false; if ((Object)(object)doctorBrain != (Object)null) { doctorBrain.canLoseChase = true; } ((GrabbableObject)this).SetControlTipsForItem(); } protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(894187736u, new RpcReceiveHandler(__rpc_handler_894187736), "InitializeDoctorItemEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(3520928820u, new RpcReceiveHandler(__rpc_handler_3520928820), "StartTrackingEveryoneRpc"); ((PhysicsProp)this).__initializeRpcs(); } private static void __rpc_handler_894187736(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference obj = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref obj, default(ForNetworkSerializable)); int value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((DoctorItem)(object)target).InitializeDoctorItemEveryoneRpc(obj, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3520928820(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; ((DoctorItem)(object)target).StartTrackingEveryoneRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "DoctorItem"; } } } namespace TheDoctor.Behaviours.Enemies { public class DoctorBrainAI : EnemyAI { public enum State { MANAGING } [CompilerGenerated] private sealed class <>c__DisplayClass21_0 { public PlayerControllerB foundedPlayer; public DoctorBrainAI <>4__this; internal bool b__2(DoctorCorpseAI c) { return (Object)(object)(foundedPlayer = <>4__this.FoundClosestPlayerInRange(c)) != (Object)null; } } [CompilerGenerated] private sealed class d__26 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DoctorBrainAI <>4__this; public bool destroy; private float 5__2; private List.Enumerator <>7__wrap2; private DoctorCorpseAI 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__26(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 1) { try { } finally { <>m__Finally1(); } } <>7__wrap2 = default(List.Enumerator); 5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Expected O, but got Unknown //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //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_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) try { int num = <>1__state; DoctorBrainAI doctorBrainAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; ((EnemyAI)doctorBrainAI).creatureSFX.PlayOneShot(doctorBrainAI.deathSound); doctorBrainAI.auraParticle.Play(); if (LFCUtilities.IsServer) { 5__2 = doctorBrainAI.deathSound.length / (float)doctorBrainAI.corpses.Count; <>7__wrap2 = doctorBrainAI.corpses.ToList().GetEnumerator(); <>1__state = -3; goto IL_0102; } <>2__current = (object)new WaitForSecondsRealtime(doctorBrainAI.deathSound.length); <>1__state = 2; return true; case 1: <>1__state = -3; if (!((Object)(object)((NetworkBehaviour)5__4).NetworkObject == (Object)null) && ((NetworkBehaviour)5__4).NetworkObject.IsSpawned) { ((EnemyAI)5__4).KillEnemyOnOwnerClient(false); 5__4 = null; } goto IL_0102; case 2: { <>1__state = -1; break; } IL_0102: if (<>7__wrap2.MoveNext()) { 5__4 = <>7__wrap2.Current; <>2__current = (object)new WaitForSecondsRealtime(5__2); <>1__state = 1; return true; } <>m__Finally1(); <>7__wrap2 = default(List.Enumerator); break; } doctorBrainAI.SwitchCamera(switchingBack: true); doctorBrainAI.SpawnParticle(((Component)doctorBrainAI).transform.position); Landmine.SpawnExplosion(((Component)doctorBrainAI).transform.position + Vector3.up, true, 6f, 6.3f, 50, 0f, (GameObject)null, false); if (LFCUtilities.IsServer) { doctorBrainAI.<>n__0(destroy); DoctorBrain doctorBrain = LFCObjectsManager.SpawnObjectForServer(TheDoctor.doctorBrain.spawnPrefab, ((Component)doctorBrainAI).transform.position + Vector3.up * 0.5f) as DoctorBrain; doctorBrain.InitializeForServer(); } return false; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>7__wrap2).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__21 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DoctorBrainAI <>4__this; private <>c__DisplayClass21_0 <>8__1; private List 5__2; private float 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__21(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Expected O, but got Unknown //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Expected O, but got Unknown int num = <>1__state; DoctorBrainAI doctorBrainAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass21_0(); <>8__1.<>4__this = <>4__this; LFCUtilities.Shuffle((IList)doctorBrainAI.corpses); 5__2 = doctorBrainAI.corpses.Where((DoctorCorpseAI c) => (Object)(object)c != (Object)null).Take(3).ToList(); 5__2.ForEach(delegate(DoctorCorpseAI c) { ((EnemyAI)c).SwitchToBehaviourClientRpc(1); }); <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; case 1: <>1__state = -1; 5__3 = 0f; <>8__1.foundedPlayer = null; break; case 2: <>1__state = -1; 5__3 += 0.2f; break; } if (5__3 < ConfigManager.scanDuration.Value && !5__2.Any((DoctorCorpseAI c) => (Object)(object)(<>8__1.foundedPlayer = <>8__1.<>4__this.FoundClosestPlayerInRange(c)) != (Object)null)) { <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 2; return true; } foreach (DoctorCorpseAI item in 5__2) { ((EnemyAI)item).creatureSFX.Stop(); if ((Object)(object)<>8__1.foundedPlayer != (Object)null) { ((EnemyAI)item).targetPlayer = <>8__1.foundedPlayer; ((EnemyAI)item).SwitchToBehaviourClientRpc(2); } else { ((EnemyAI)item).SwitchToBehaviourClientRpc(0); } } doctorBrainAI.scanCoroutine = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public List entrances; public List corpses = new List(); public Camera camera; public Transform cameraPivot; public Camera playerCamera; public float scanTimer; public float scanCooldown = 5f; public bool canLoseChase = true; public Coroutine scanCoroutine; public Coroutine killCoroutine; public AudioClip speakerHackedSound; public AudioClip deathSound; public ParticleSystem auraParticle; public override void Start() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Start(); PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; playerCamera = localPlayerController.gameplayCamera; base.currentBehaviourStateIndex = 0; entrances = Object.FindObjectsOfType().ToList(); if (LFCUtilities.IsServer) { SpawnCorpsesForServer(); } if (localPlayerController.isInsideFactory && ConfigManager.isInsideDialogue.Value) { GameObject val = new GameObject("HackedSpeakerAudio"); val.transform.parent = ((Component)localPlayerController).transform; val.transform.localPosition = Vector3.forward * 50f; AudioSource val2 = val.AddComponent(); val2.clip = speakerHackedSound; val2.spatialBlend = 1f; val2.minDistance = 10f; val2.maxDistance = 200f; val2.rolloffMode = (AudioRolloffMode)1; val2.Play(); Object.Destroy((Object)(object)val, speakerHackedSound.length); } else if (!localPlayerController.isInsideFactory && ConfigManager.isShipDialogue.Value) { StartOfRound.Instance.speakerAudioSource.PlayOneShot(speakerHackedSound); } } private void SpawnCorpsesForServer() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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) Vector3[] corpsesPositions = GetCorpsesPositions(); List list = new List(); Vector3[] array = corpsesPositions; foreach (Vector3 val in array) { GameObject val2 = Object.Instantiate(TheDoctor.doctorCorpseEnemy.enemyPrefab, val, Quaternion.Euler(0f, Random.Range(0f, 360f), 0f)); val2.GetComponentInChildren().Spawn(true); DoctorCorpseAI component = val2.GetComponent(); component.InitializeCorpseEveryoneRpc(NetworkObjectReference.op_Implicit(((Component)this).GetComponent())); list.Add(((Component)component).GetComponent()); } SpawnCorpsesEveryoneRpc(list.Select((NetworkObject obj) => NetworkObjectReference.op_Implicit(obj)).ToArray()); } public Vector3[] GetCorpsesPositions() { int value = ConfigManager.amountCorpses.Value; List list = (from n in base.allAINodes select n.transform.position into p where Vector3.Distance(p, ((Component)this).transform.position) > 30f select p).ToList(); if (list.Count < value) { list = (from n in base.allAINodes select n.transform.position into p where Vector3.Distance(p, ((Component)this).transform.position) > 30f select p).ToList(); } LFCUtilities.Shuffle((IList)list); return list.Take(value).ToArray(); } [Rpc(/*Could not decode attribute arguments.*/)] public void SpawnCorpsesEveryoneRpc(NetworkObjectReference[] enemiesObj) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: 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_00d0: 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_00b7: 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_0110: 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) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2611349699u, val2, val, (SendTo)6, (RpcDelivery)0); bool flag = enemiesObj != null; ((FastBufferWriter)(ref val3)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val3)).WriteValueSafe(enemiesObj, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendRpc(ref val3, 2611349699u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val5 = default(NetworkObject); for (int i = 0; i < enemiesObj.Length; i++) { NetworkObjectReference val4 = enemiesObj[i]; if (((NetworkObjectReference)(ref val4)).TryGet(ref val5, (NetworkManager)null)) { DoctorCorpseAI componentInChildren = ((Component)val5).gameObject.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && !corpses.Contains(componentInChildren)) { corpses.Add(((Component)val5).gameObject.GetComponentInChildren()); } } } } public override void Update() { ((EnemyAI)this).Update(); if (!base.isEnemyDead && !StartOfRound.Instance.allPlayersDead) { if (scanCoroutine != null) { scanTimer = 0f; } scanTimer += Time.deltaTime; } } public override void DoAIInterval() { ((EnemyAI)this).DoAIInterval(); if (!base.isEnemyDead && !StartOfRound.Instance.allPlayersDead && killCoroutine == null && base.currentBehaviourStateIndex == 0) { DoManaging(); } } public void DoManaging() { //IL_0079: 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_00a0: 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) if (killCoroutine != null) { return; } List list = corpses.Where((DoctorCorpseAI c) => (Object)(object)c != (Object)null && ((EnemyAI)c).currentBehaviourStateIndex == 2).ToList(); if (list.Any()) { bool flag = true; foreach (DoctorCorpseAI item in list) { if ((Object)(object)((EnemyAI)(item?)).targetPlayer != (Object)null && (!canLoseChase || Vector3.Distance(((Component)item).transform.position, ((Component)((EnemyAI)item).targetPlayer).transform.position) <= 20f || Vector3.Distance(((Component)this).transform.position, ((Component)((EnemyAI)item).targetPlayer).transform.position) <= 5f)) { flag = false; break; } } if (flag) { list.ForEach(delegate(DoctorCorpseAI c) { ((EnemyAI)c).SwitchToBehaviourClientRpc(0); }); } } if (corpses.Any((DoctorCorpseAI c) => (Object)(object)c != (Object)null && (((EnemyAI)c).currentBehaviourStateIndex == 2 || c.hitEnemyCoroutine != null))) { return; } if (scanTimer > scanCooldown) { scanTimer = 0f; scanCooldown = Random.Range(ConfigManager.scanMinCooldown.Value, ConfigManager.scanMaxCooldown.Value); scanCoroutine = ((MonoBehaviour)this).StartCoroutine(ScanningCoroutine()); } else if (scanCoroutine == null) { corpses.Where((DoctorCorpseAI c) => (Object)(object)c != (Object)null && ((EnemyAI)c).currentBehaviourStateIndex == 1).ToList().ForEach(delegate(DoctorCorpseAI c) { ((EnemyAI)c).SwitchToBehaviourClientRpc(0); }); } } [IteratorStateMachine(typeof(d__21))] public IEnumerator ScanningCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__21(0) { <>4__this = this }; } public PlayerControllerB FoundClosestPlayerInRange(DoctorCorpseAI corpse) { PlayerControllerB val = ((EnemyAI)corpse).CheckLineOfSightForPlayer(65f, 20, 3); if (!((Object)(object)val != (Object)null) || !((EnemyAI)corpse).PlayerIsTargetable(val, false, false, true)) { return null; } return val; } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { if (base.isEnemyDead || (Object)(object)playerWhoHit == (Object)null) { return; } ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID); base.enemyHP -= force; if (!LFCUtilities.IsServer) { return; } corpses.ForEach(delegate(DoctorCorpseAI c) { if ((Object)(object)c != (Object)null && ((EnemyAI)c).currentBehaviourStateIndex != 2) { ((EnemyAI)c).targetPlayer = playerWhoHit; ((EnemyAI)c).SwitchToBehaviourClientRpc(2); } }); if (base.enemyHP <= 0) { ((EnemyAI)this).KillEnemyOnOwnerClient(false); } } public override void KillEnemy(bool destroy = false) { if (LFCUtilities.IsServer) { if (scanCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(scanCoroutine); scanCoroutine = null; } KillAnimationEveryoneRpc(destroy); } } [Rpc(/*Could not decode attribute arguments.*/)] public void KillAnimationEveryoneRpc(bool destroy) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_009c: 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_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) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(12872973u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref destroy, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 12872973u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (killCoroutine == null) { killCoroutine = ((MonoBehaviour)this).StartCoroutine(KillAnimationCoroutine(destroy)); } } } [IteratorStateMachine(typeof(d__26))] public IEnumerator KillAnimationCoroutine(bool destroy) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__26(0) { <>4__this = this, destroy = destroy }; } public void SwitchCamera(bool switchingBack) { //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) if (base.isEnemyDead || (Object)(object)camera == (Object)null || (Object)(object)playerCamera == (Object)null) { return; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; ((Behaviour)camera).enabled = !switchingBack; localPlayerController.gameplayCamera = (switchingBack ? playerCamera : camera); ((Renderer)localPlayerController.thisPlayerModel).shadowCastingMode = (ShadowCastingMode)((!switchingBack) ? 1 : 3); if (!switchingBack) { ((Component)cameraPivot).transform.LookAt(((Component)localPlayerController).transform.position); LFCCustomPassManager.SetupAuraForObjects((GameObject[])(object)new GameObject[1] { ((Component)localPlayerController).gameObject }, LegaFusionCore.wallhackShader, "The Doctor", Color.yellow); LFCCustomPassManager.SetupAuraForObjects(corpses.Select((DoctorCorpseAI c) => ((Component)c).gameObject).ToArray(), LegaFusionCore.wallhackShader, "The Doctor", Color.red); } else { LFCCustomPassManager.RemoveAuraByTag("The Doctor"); } } public void SpawnParticle(Vector3 explosionPosition) { //IL_0005: 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_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(TheDoctor.electroExplosionParticle, explosionPosition + ((Component)this).transform.up, Quaternion.identity); ParticleSystem component = val.GetComponent(); MainModule main = component.main; float duration = ((MainModule)(ref main)).duration; main = component.main; MinMaxCurve startLifetime = ((MainModule)(ref main)).startLifetime; Object.Destroy((Object)(object)val, duration + ((MinMaxCurve)(ref startLifetime)).constantMax); } [CompilerGenerated] [DebuggerHidden] private void <>n__0(bool destroy = false) { ((EnemyAI)this).KillEnemy(destroy); } protected override void __initializeVariables() { ((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 ((NetworkBehaviour)this).__registerRpc(2611349699u, new RpcReceiveHandler(__rpc_handler_2611349699), "SpawnCorpsesEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(12872973u, new RpcReceiveHandler(__rpc_handler_12872973), "KillAnimationEveryoneRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_2611349699(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_006e: 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_0058: 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 flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] enemiesObj = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemiesObj, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((DoctorBrainAI)(object)target).SpawnCorpsesEveryoneRpc(enemiesObj); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_12872973(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 destroy = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref destroy, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((DoctorBrainAI)(object)target).KillAnimationEveryoneRpc(destroy); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "DoctorBrainAI"; } } public class DoctorCorpseAI : EnemyAI { public enum State { FREEZING, SCANNING, CHASING } [CompilerGenerated] private sealed class d__34 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DoctorCorpseAI <>4__this; public PlayerControllerB player; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__34(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; DoctorCorpseAI doctorCorpseAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; ((EnemyAI)doctorCorpseAI).creatureAnimator.SetTrigger("startAttack"); ((EnemyAI)doctorCorpseAI).creatureSFX.PlayOneShot(doctorCorpseAI.attackSounds[Random.Range(0, doctorCorpseAI.attackSounds.Length)]); ((EnemyAI)doctorCorpseAI).agent.speed = 0f; ((EnemyAI)doctorCorpseAI).moveTowardsDestination = false; <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; case 1: <>1__state = -1; player.DamagePlayer(20, true, true, (CauseOfDeath)8, 0, false, default(Vector3)); ((EnemyAI)doctorCorpseAI).creatureAnimator.SetTrigger("startRun"); doctorCorpseAI.attackCoroutine = 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__36 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DoctorCorpseAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__36(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown int num = <>1__state; DoctorCorpseAI doctorCorpseAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; doctorCorpseAI.amountHit = 0; doctorCorpseAI.explosionParticle.Play(); ((EnemyAI)doctorCorpseAI).SwitchToBehaviourStateOnLocalClient(0); if (LFCUtilities.IsServer) { doctorCorpseAI.SpawnDoctorItem(); } doctorCorpseAI.hasDroppedItem = true; <>2__current = (object)new WaitForSeconds(4f); <>1__state = 1; return true; case 1: <>1__state = -1; doctorCorpseAI.explosionParticle.Stop(); ((EnemyAI)doctorCorpseAI).SwitchToBehaviourStateOnLocalClient(2); doctorCorpseAI.hitEnemyCoroutine = 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__19 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DoctorCorpseAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__19(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; DoctorCorpseAI doctorCorpseAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; ((EnemyAI)doctorCorpseAI).creatureAnimator.SetTrigger("startRun"); <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; ((EnemyAI)doctorCorpseAI).creatureAnimator.Play("run", 0, Random.value); ((EnemyAI)doctorCorpseAI).creatureAnimator.speed = 0f; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public DoctorBrainAI doctorBrain; public Transform TurnCompass; public SkinnedMeshRenderer skinnedMeshRenderer; public Collider corpseCollider; public Light scanLight; public Light chaseLight; public int oldBehaviourStateIndex; public int amountHit; public float moveTimer; public bool hasDroppedItem; public Coroutine attackCoroutine; public Coroutine hitEnemyCoroutine; public AudioClip chaseSound; public AudioClip[] moveSounds = Array.Empty(); public AudioClip[] attackSounds = Array.Empty(); public ParticleSystem explosionParticle; public override void Start() { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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) ((EnemyAI)this).Start(); base.currentBehaviourStateIndex = 0; ((MonoBehaviour)this).StartCoroutine(InitializeAnimatorCoroutine()); skinnedMeshRenderer = ((Component)this).GetComponentInChildren(); if ((Object)(object)skinnedMeshRenderer == (Object)null) { TheDoctor.mls.LogError((object)"SkinnedMeshRenderer not found for the DoctorCorpse"); } Transform val = ((IEnumerable)skinnedMeshRenderer.bones).FirstOrDefault((Func)((Transform b) => ((Object)b).name.Equals("PHYSICS_Head"))); if ((Object)(object)val != (Object)null) { ((Component)scanLight).transform.SetParent(val, false); ((Component)scanLight).transform.localPosition = Vector3.zero; ((Component)scanLight).transform.localRotation = Quaternion.Euler(-5f, 0f, 0f); ((Component)scanLight).gameObject.SetActive(false); ((Component)chaseLight).transform.SetParent(val, false); ((Component)chaseLight).transform.localPosition = Vector3.zero; ((Component)chaseLight).transform.localRotation = Quaternion.Euler(-5f, 0f, 0f); ((Component)chaseLight).gameObject.SetActive(false); } } [Rpc(/*Could not decode attribute arguments.*/)] public void InitializeCorpseEveryoneRpc(NetworkObjectReference obj) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_009c: 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_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) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3882977255u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref obj, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3882977255u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); if (((NetworkObjectReference)(ref obj)).TryGet(ref val4, (NetworkManager)null)) { doctorBrain = ((Component)val4).gameObject.GetComponentInChildren(); } } } [IteratorStateMachine(typeof(d__19))] public IEnumerator InitializeAnimatorCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__19(0) { <>4__this = this }; } public override void Update() { //IL_004e: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); if (!base.isEnemyDead && !StartOfRound.Instance.allPlayersDead) { PlayMoveSound(); if ((Object)(object)base.targetPlayer != (Object)null && base.currentBehaviourStateIndex == 2) { TurnCompass.LookAt(((Component)base.targetPlayer.gameplayCamera).transform.position); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(new Vector3(0f, TurnCompass.eulerAngles.y, 0f)), 4f * Time.deltaTime); } } } public void PlayMoveSound() { if (base.currentBehaviourStateIndex == 2) { moveTimer -= Time.deltaTime; if (moveSounds.Length != 0 && moveTimer <= 0f) { base.creatureSFX.PlayOneShot(moveSounds[Random.Range(0, moveSounds.Length)]); moveTimer = 0.4f; } } } public override void DoAIInterval() { ((EnemyAI)this).DoAIInterval(); if (!base.isEnemyDead && !StartOfRound.Instance.allPlayersDead) { switch (base.currentBehaviourStateIndex) { case 0: DoFreezing(); break; case 1: DoScanning(); break; case 2: DoChasing(); break; } } } public void DoFreezing() { base.agent.speed = 0f; UpdateStateEveryoneRpc(); } public void DoScanning() { base.agent.speed = 0f; UpdateStateEveryoneRpc(); } public void DoChasing() { base.agent.speed = ((attackCoroutine == null) ? ConfigManager.corpseSpeed.Value : 0f); UpdateStateEveryoneRpc(); ((EnemyAI)this).SetMovingTowardsTargetPlayer(base.targetPlayer); base.moveTowardsDestination = attackCoroutine == null; } [Rpc(/*Could not decode attribute arguments.*/)] public void UpdateStateEveryoneRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(526680257u, val2, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 526680257u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (base.currentBehaviourStateIndex != oldBehaviourStateIndex) { oldBehaviourStateIndex = base.currentBehaviourStateIndex; switch (base.currentBehaviourStateIndex) { case 0: DoFreezingForClients(); break; case 1: DoScanningForClients(); break; case 2: DoChasingForClients(); break; } } } public void DoFreezingForClients() { ConfigureClientState(TheDoctor.inertScreen, 0f, isTrigger: false, isScanLightActive: false, isChaseLightActive: false); } public void DoScanningForClients() { ConfigureClientState(TheDoctor.scanningScreen, 0f, isTrigger: false, isScanLightActive: true, isChaseLightActive: false); } public void DoChasingForClients() { ConfigureClientState(TheDoctor.foundScreen, 1f, isTrigger: true, isScanLightActive: false, isChaseLightActive: true); } private void ConfigureClientState(Material screenMaterial, float animationSpeed, bool isTrigger, bool isScanLightActive, bool isChaseLightActive) { SetScreenMaterial(screenMaterial); base.creatureAnimator.speed = animationSpeed; corpseCollider.isTrigger = isTrigger; ((Component)scanLight).gameObject.SetActive(isScanLightActive); ((Component)chaseLight).gameObject.SetActive(isChaseLightActive); } public void SetScreenMaterial(Material screenMaterial) { if ((Object)(object)screenMaterial == (Object)null) { return; } Material[] materials = ((Renderer)skinnedMeshRenderer).materials; for (int i = 0; i < materials.Length; i++) { if (((Object)materials[i]).name.StartsWith("MI_Doctor_Screen")) { materials[i] = screenMaterial; break; } } ((Renderer)skinnedMeshRenderer).materials = materials; } public override void OnCollideWithPlayer(Collider other) { ((EnemyAI)this).OnCollideWithPlayer(other); if (base.currentBehaviourStateIndex == 2 && attackCoroutine == null) { PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false); if (!((Object)(object)val == (Object)null) && !((Object)(object)val != (Object)(object)GameNetworkManager.Instance.localPlayerController)) { AttackEveryoneRpc((int)val.playerClientId); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void AttackEveryoneRpc(int playerId) { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2693399625u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2693399625u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (attackCoroutine == null) { attackCoroutine = ((MonoBehaviour)this).StartCoroutine(AttackCoroutine(StartOfRound.Instance.allPlayerObjects[playerId].GetComponent())); } } } [IteratorStateMachine(typeof(d__34))] public IEnumerator AttackCoroutine(PlayerControllerB player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__34(0) { <>4__this = this, player = player }; } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { if (base.isEnemyDead || (Object)(object)playerWhoHit == (Object)null) { return; } ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID); if (hitEnemyCoroutine == null && base.currentBehaviourStateIndex == 2) { amountHit++; if (amountHit >= 2) { hitEnemyCoroutine = ((MonoBehaviour)this).StartCoroutine(HitEnemyCoroutine()); } } else { if (hitEnemyCoroutine != null || (base.currentBehaviourStateIndex != 0 && base.currentBehaviourStateIndex != 1)) { return; } if (doctorBrain.scanCoroutine != null) { ((MonoBehaviour)doctorBrain).StopCoroutine(doctorBrain.scanCoroutine); doctorBrain.scanCoroutine = null; } foreach (DoctorCorpseAI item in doctorBrain.corpses.Where((DoctorCorpseAI c) => (Object)(object)c != (Object)null && ((EnemyAI)c).currentBehaviourStateIndex == 1)) { ((EnemyAI)item).creatureSFX.Stop(); ((EnemyAI)item).SwitchToBehaviourStateOnLocalClient(0); } if (!doctorBrain.corpses.Any((DoctorCorpseAI c) => (Object)(object)c != (Object)null && ((EnemyAI)c).currentBehaviourStateIndex == 2)) { LFCUtilities.Shuffle((IList)doctorBrain.corpses); doctorBrain.corpses.Where((DoctorCorpseAI c) => (Object)(object)c != (Object)null && (Object)(object)c != (Object)(object)this).Take(2).ToList() .ForEach(delegate(DoctorCorpseAI c) { ((EnemyAI)c).targetPlayer = playerWhoHit; ((EnemyAI)c).SwitchToBehaviourStateOnLocalClient(2); }); } base.targetPlayer = playerWhoHit; ((EnemyAI)this).SwitchToBehaviourStateOnLocalClient(2); } } [IteratorStateMachine(typeof(d__36))] public IEnumerator HitEnemyCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__36(0) { <>4__this = this }; } public void SpawnDoctorItem() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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) if (!hasDroppedItem) { List list = new List(2) { TheDoctor.doctorHeart.spawnPrefab, TheDoctor.doctorEye.spawnPrefab }; GameObject val = Object.Instantiate(list[new Random().Next(list.Count)], ((Component)this).transform.position + Vector3.up * 0.5f, Quaternion.identity, StartOfRound.Instance.propsContainer); DoctorItem component = val.GetComponent(); ((GrabbableObject)component).fallTime = 0f; ((GrabbableObject)component).isInFactory = !base.isOutside; val.GetComponent().Spawn(false); int value = ((component is DoctorEye) ? Random.Range(ConfigManager.eyeMinValue.Value, ConfigManager.eyeMaxValue.Value) : Random.Range(ConfigManager.heartMinValue.Value, ConfigManager.heartMaxValue.Value)); component.InitializeDoctorItemEveryoneRpc(NetworkObjectReference.op_Implicit(((Component)doctorBrain).GetComponent()), value); } } public override void KillEnemy(bool destroy = false) { if (LFCUtilities.IsServer) { KillExplosionEveryoneRpc(destroy); } } [Rpc(/*Could not decode attribute arguments.*/)] public void KillExplosionEveryoneRpc(bool destroy) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_009c: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_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) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1766598522u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref destroy, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1766598522u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Landmine.SpawnExplosion(((Component)this).transform.position + Vector3.up, true, 0f, 4f, 20, 0f, (GameObject)null, false); ((EnemyAI)this).KillEnemy(destroy); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void DoAnimationEveryoneRpc(string animationState) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: 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_00c3: 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) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1066493190u, val2, val, (SendTo)6, (RpcDelivery)0); bool flag = animationState != null; ((FastBufferWriter)(ref val3)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val3)).WriteValueSafe(animationState, false); } ((NetworkBehaviour)this).__endSendRpc(ref val3, 1066493190u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.creatureAnimator.SetTrigger(animationState); } } protected override void __initializeVariables() { ((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 ((NetworkBehaviour)this).__registerRpc(3882977255u, new RpcReceiveHandler(__rpc_handler_3882977255), "InitializeCorpseEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(526680257u, new RpcReceiveHandler(__rpc_handler_526680257), "UpdateStateEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(2693399625u, new RpcReceiveHandler(__rpc_handler_2693399625), "AttackEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(1766598522u, new RpcReceiveHandler(__rpc_handler_1766598522), "KillExplosionEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(1066493190u, new RpcReceiveHandler(__rpc_handler_1066493190), "DoAnimationEveryoneRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_3882977255(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference obj = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref obj, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((DoctorCorpseAI)(object)target).InitializeCorpseEveryoneRpc(obj); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_526680257(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; ((DoctorCorpseAI)(object)target).UpdateStateEveryoneRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2693399625(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 playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((DoctorCorpseAI)(object)target).AttackEveryoneRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1766598522(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 destroy = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref destroy, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((DoctorCorpseAI)(object)target).KillExplosionEveryoneRpc(destroy); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1066493190(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string animationState = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref animationState, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((DoctorCorpseAI)(object)target).DoAnimationEveryoneRpc(animationState); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "DoctorCorpseAI"; } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } } [CompilerGenerated] internal sealed class <>z__ReadOnlySingleElementList : IEnumerable, ICollection, IList, IEnumerable, IReadOnlyCollection, IReadOnlyList, ICollection, IList { private sealed class Enumerator : IDisposable, IEnumerator, IEnumerator { object IEnumerator.Current => _item; T IEnumerator.Current => _item; public Enumerator(T item) { _item = item; } bool IEnumerator.MoveNext() { if (!_moveNextCalled) { return _moveNextCalled = true; } return false; } void IEnumerator.Reset() { _moveNextCalled = false; } void IDisposable.Dispose() { } } int ICollection.Count => 1; bool ICollection.IsSynchronized => false; object ICollection.SyncRoot => this; object IList.this[int index] { get { if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } set { throw new NotSupportedException(); } } bool IList.IsFixedSize => true; bool IList.IsReadOnly => true; int IReadOnlyCollection.Count => 1; T IReadOnlyList.this[int index] { get { if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } } int ICollection.Count => 1; bool ICollection.IsReadOnly => true; T IList.this[int index] { get { if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } set { throw new NotSupportedException(); } } public <>z__ReadOnlySingleElementList(T item) { _item = item; } IEnumerator IEnumerable.GetEnumerator() { return new Enumerator(_item); } void ICollection.CopyTo(Array array, int index) { array.SetValue(_item, index); } int IList.Add(object value) { throw new NotSupportedException(); } void IList.Clear() { throw new NotSupportedException(); } bool IList.Contains(object value) { return EqualityComparer.Default.Equals(_item, (T)value); } int IList.IndexOf(object value) { if (!EqualityComparer.Default.Equals(_item, (T)value)) { return -1; } return 0; } void IList.Insert(int index, object value) { throw new NotSupportedException(); } void IList.Remove(object value) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return new Enumerator(_item); } void ICollection.Add(T item) { throw new NotSupportedException(); } void ICollection.Clear() { throw new NotSupportedException(); } bool ICollection.Contains(T item) { return EqualityComparer.Default.Equals(_item, item); } void ICollection.CopyTo(T[] array, int arrayIndex) { array[arrayIndex] = _item; } bool ICollection.Remove(T item) { throw new NotSupportedException(); } int IList.IndexOf(T item) { if (!EqualityComparer.Default.Equals(_item, item)) { return -1; } return 0; } void IList.Insert(int index, T item) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace TheDoctor.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }