Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of TheDoctor v1.0.6
TheDoctor.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.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<TheDoctorNetworkManager>(); } 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<EnemyType>("Assets/DoctorBrainAI/DoctorBrainEnemy.asset"); val.probabilityCurve = ConfigManager.ParseCurveFromString(); NetworkPrefabs.RegisterNetworkPrefab(val.enemyPrefab); var (dictionary, dictionary2) = ConfigManager.GetEnemiesSpawns(); Enemies.RegisterEnemy(val, dictionary, dictionary2, bundle.LoadAsset<TerminalNode>("Assets/DoctorBrainAI/DoctorBrainTN.asset"), bundle.LoadAsset<TerminalKeyword>("Assets/DoctorBrainAI/DoctorBrainTK.asset")); doctorCorpseEnemy = bundle.LoadAsset<EnemyType>("Assets/DoctorCorpseAI/DoctorCorpseEnemy.asset"); NetworkPrefabs.RegisterNetworkPrefab(doctorCorpseEnemy.enemyPrefab); Enemies.RegisterEnemy(doctorCorpseEnemy, 0, (LevelTypes)1, bundle.LoadAsset<TerminalNode>("Assets/DoctorCorpseAI/DoctorCorpseTN.asset"), bundle.LoadAsset<TerminalKeyword>("Assets/DoctorCorpseAI/DoctorCorpseTK.asset")); } public void LoadItems() { doctorHeart = LFCObjectsManager.RegisterObject(typeof(DoctorHeart), bundle.LoadAsset<Item>("Assets/DoctorHeart/DoctorHeartItem.asset")); doctorEye = LFCObjectsManager.RegisterObject(typeof(DoctorEye), bundle.LoadAsset<Item>("Assets/DoctorEye/DoctorEyeItem.asset")); doctorBrain = LFCObjectsManager.RegisterObject(typeof(DoctorBrain), bundle.LoadAsset<Item>("Assets/DoctorBrain/DoctorBrainItem.asset")); } public static void LoadMaterials() { inertScreen = bundle.LoadAsset<Material>("Assets/DoctorCorpseAI/Materials/MI_Doctor_Screen_Inert.mat"); scanningScreen = bundle.LoadAsset<Material>("Assets/DoctorCorpseAI/Materials/MI_Doctor_Screen_Scanning.mat"); foundScreen = bundle.LoadAsset<Material>("Assets/DoctorCorpseAI/Materials/MI_Doctor_Screen_Found.mat"); } public static void LoadNetworkPrefabs() { HashSet<GameObject> hashSet = new HashSet<GameObject> { electroExplosionParticle = bundle.LoadAsset<GameObject>("Assets/Particles/ElectroExplosionParticle.prefab"), doctorClone = bundle.LoadAsset<GameObject>("Assets/DoctorClone/DoctorClone.prefab"), doctorCloneAudio = bundle.LoadAsset<GameObject>("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<GameObject>(TheDoctor.managerPrefab, ((Component)__instance).transform.parent); val.GetComponent<NetworkObject>().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<string> spawnWeights; public static ConfigEntry<string> probabilityCurve; public static ConfigEntry<int> amountCorpses; public static ConfigEntry<float> scanMinCooldown; public static ConfigEntry<float> scanMaxCooldown; public static ConfigEntry<bool> isShipDialogue; public static ConfigEntry<bool> isInsideDialogue; public static ConfigEntry<float> scanDuration; public static ConfigEntry<float> corpseSpeed; public static ConfigEntry<int> heartTrackingDuration; public static ConfigEntry<int> heartMinValue; public static ConfigEntry<int> heartMaxValue; public static ConfigEntry<int> eyeTrackingDuration; public static ConfigEntry<int> eyeMinValue; public static ConfigEntry<int> eyeMaxValue; public static ConfigEntry<bool> brainSpecialAbility; public static ConfigEntry<int> brainMinValue; public static ConfigEntry<int> brainMaxValue; public static ConfigEntry<int> spectralDecoyCooldown; public static ConfigEntry<int> spectralDecoyDamage; public static void Load() { spawnWeights = TheDoctor.configFile.Bind<string>("_Global_", "Spawn weights", "Vanilla:20,Modded:20", "Brain enemy spawn weights"); probabilityCurve = TheDoctor.configFile.Bind<string>("_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<int>("_Global_", "Amount corpses", 8, "Amount of Corpse that spawn at the same time as the Brain"); scanMinCooldown = TheDoctor.configFile.Bind<float>("_Global_", "Scan min", 2f, "Minimum cooldown duration between Corpse scans"); scanMaxCooldown = TheDoctor.configFile.Bind<float>("_Global_", "Scan max", 8f, "Maximum cooldown duration between Corpse scans"); isShipDialogue = TheDoctor.configFile.Bind<bool>("_Global_", "Ship dialogue", true, "Trigger the ship dialogue when the Brain spawns"); isInsideDialogue = TheDoctor.configFile.Bind<bool>("_Global_", "Inside dialogue", true, "Trigger the inside dialogue when the Brain spawns"); scanDuration = TheDoctor.configFile.Bind<float>("Corpse", "Scan duration", 7f, "Scan duration for the Corpse"); corpseSpeed = TheDoctor.configFile.Bind<float>("Corpse", "Corpse speed", 5f, "Corpse speed"); heartTrackingDuration = TheDoctor.configFile.Bind<int>("Heart", "Tracking duration", 45, "Heart tracking duration"); heartMinValue = TheDoctor.configFile.Bind<int>("Heart", "Min value", 15, "Heart min value"); heartMaxValue = TheDoctor.configFile.Bind<int>("Heart", "Max value", 30, "Heart max value"); eyeTrackingDuration = TheDoctor.configFile.Bind<int>("Eye", "Tracking duration", 45, "Eye tracking duration"); eyeMinValue = TheDoctor.configFile.Bind<int>("Eye", "Min value", 15, "Eye min value"); eyeMaxValue = TheDoctor.configFile.Bind<int>("Eye", "Max value", 30, "Eye max value"); brainSpecialAbility = TheDoctor.configFile.Bind<bool>("Brain", "Enable special ability", true, "Enable Brain item's special ability (Spectral Decoy)?"); brainMinValue = TheDoctor.configFile.Bind<int>("Brain", "Min value", 50, "Brain min value"); brainMaxValue = TheDoctor.configFile.Bind<int>("Brain", "Max value", 100, "Brain max value"); spectralDecoyCooldown = TheDoctor.configFile.Bind<int>("Spectral Decoy", "Cooldown", 120, "Cooldown duration of the Spectral Decoy"); spectralDecoyDamage = TheDoctor.configFile.Bind<int>("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<Keyframe> list = new List<Keyframe>(); 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<LevelTypes, int> spawnRateByLevelType, Dictionary<string, int> spawnRateByCustomLevelType) GetEnemiesSpawns() { //IL_0083: Unknown result type (might be due to invalid IL or missing references) Dictionary<LevelTypes, int> dictionary = new Dictionary<LevelTypes, int>(); Dictionary<string, int> dictionary2 = new Dictionary<string, int>(); 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<LevelTypes>(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<PlayerControllerB>(); Object.Instantiate<GameObject>(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 <AttractEnemiesCoroutine>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 <AttractEnemiesCoroutine>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 <AttractEnemiesCoroutine>d__1 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DoctorClone <>4__this; private <>c__DisplayClass1_0 <>8__1; private List<EnemyAI> <enemies>5__2; private float <timePassed>5__3; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <AttractEnemiesCoroutine>d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <enemies>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<GameObject>(TheDoctor.doctorCloneAudio, ((Component)doctorClone).transform.position, Quaternion.identity); AudioSource component = val.GetComponent<AudioSource>(); if (component != null) { component.Play(); } <>8__1.explosionPosition = ((Component)doctorClone).transform.position + ((Component)doctorClone).transform.forward * 1.6f; <enemies>5__2 = new List<EnemyAI>(); 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<EnemyAICollisionDetect>()?.mainScript; if ((Object)(object)val3 != (Object)null) { <enemies>5__2.Add(val3); } } <timePassed>5__3 = 0f; break; } case 1: <>1__state = -1; <timePassed>5__3 += Time.deltaTime; break; } if (<timePassed>5__3 < 5.5f) { <enemies>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) { <enemies>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(<AttractEnemiesCoroutine>d__1))] public IEnumerator AttractEnemiesCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <AttractEnemiesCoroutine>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<Vector2>() * (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 <StartTrackingCoroutine>d__9 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DoctorItem <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <StartTrackingCoroutine>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<NetworkObjectReference>(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<DoctorBrainAI>(); ((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<DoctorCorpseAI> enumerable = Array.Empty<DoctorCorpseAI>(); 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(<StartTrackingCoroutine>d__9))] public IEnumerator StartTrackingCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <StartTrackingCoroutine>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<string>(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<NetworkObjectReference>(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 <ScanningCoroutine>b__2(DoctorCorpseAI c) { return (Object)(object)(foundedPlayer = <>4__this.FoundClosestPlayerInRange(c)) != (Object)null; } } [CompilerGenerated] private sealed class <KillAnimationCoroutine>d__26 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DoctorBrainAI <>4__this; public bool destroy; private float <interval>5__2; private List<DoctorCorpseAI>.Enumerator <>7__wrap2; private DoctorCorpseAI <corpse>5__4; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <KillAnimationCoroutine>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<DoctorCorpseAI>.Enumerator); <corpse>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) { <interval>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)<corpse>5__4).NetworkObject == (Object)null) && ((NetworkBehaviour)<corpse>5__4).NetworkObject.IsSpawned) { ((EnemyAI)<corpse>5__4).KillEnemyOnOwnerClient(false); <corpse>5__4 = null; } goto IL_0102; case 2: { <>1__state = -1; break; } IL_0102: if (<>7__wrap2.MoveNext()) { <corpse>5__4 = <>7__wrap2.Current; <>2__current = (object)new WaitForSecondsRealtime(<interval>5__2); <>1__state = 1; return true; } <>m__Finally1(); <>7__wrap2 = default(List<DoctorCorpseAI>.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 <ScanningCoroutine>d__21 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DoctorBrainAI <>4__this; private <>c__DisplayClass21_0 <>8__1; private List<DoctorCorpseAI> <scanningCorpses>5__2; private float <timePassed>5__3; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ScanningCoroutine>d__21(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <scanningCorpses>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<DoctorCorpseAI>((IList<DoctorCorpseAI>)doctorBrainAI.corpses); <scanningCorpses>5__2 = doctorBrainAI.corpses.Where((DoctorCorpseAI c) => (Object)(object)c != (Object)null).Take(3).ToList(); <scanningCorpses>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; <timePassed>5__3 = 0f; <>8__1.foundedPlayer = null; break; case 2: <>1__state = -1; <timePassed>5__3 += 0.2f; break; } if (<timePassed>5__3 < ConfigManager.scanDuration.Value && !<scanningCorpses>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 <scanningCorpses>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<EntranceTeleport> entrances; public List<DoctorCorpseAI> corpses = new List<DoctorCorpseAI>(); 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<EntranceTeleport>().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<AudioSource>(); 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<NetworkObject> list = new List<NetworkObject>(); Vector3[] array = corpsesPositions; foreach (Vector3 val in array) { GameObject val2 = Object.Instantiate<GameObject>(TheDoctor.doctorCorpseEnemy.enemyPrefab, val, Quaternion.Euler(0f, Random.Range(0f, 360f), 0f)); val2.GetComponentInChildren<NetworkObject>().Spawn(true); DoctorCorpseAI component = val2.GetComponent<DoctorCorpseAI>(); component.InitializeCorpseEveryoneRpc(NetworkObjectReference.op_Implicit(((Component)this).GetComponent<NetworkObject>())); list.Add(((Component)component).GetComponent<NetworkObject>()); } SpawnCorpsesEveryoneRpc(list.Select((NetworkObject obj) => NetworkObjectReference.op_Implicit(obj)).ToArray()); } public Vector3[] GetCorpsesPositions() { int value = ConfigManager.amountCorpses.Value; List<Vector3> 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<Vector3>((IList<Vector3>)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<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val3)).WriteValueSafe<NetworkObjectReference>(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<DoctorCorpseAI>(); if ((Object)(object)componentInChildren != (Object)null && !corpses.Contains(componentInChildren)) { corpses.Add(((Component)val5).gameObject.GetComponentInChildren<DoctorCorpseAI>()); } } } } 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<DoctorCorpseAI> 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(<ScanningCoroutine>d__21))] public IEnumerator ScanningCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <ScanningCoroutine>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<bool>(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(<KillAnimationCoroutine>d__26))] public IEnumerator KillAnimationCoroutine(bool destroy) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <KillAnimationCoroutine>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<GameObject>(TheDoctor.electroExplosionParticle, explosionPosition + ((Component)this).transform.up, Quaternion.identity); ParticleSystem component = val.GetComponent<ParticleSystem>(); 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<bool>(ref flag, default(ForPrimitives)); NetworkObjectReference[] enemiesObj = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(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<bool>(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 <AttackCoroutine>d__34 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DoctorCorpseAI <>4__this; public PlayerControllerB player; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <AttackCoroutine>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 <HitEnemyCoroutine>d__36 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DoctorCorpseAI <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <HitEnemyCoroutine>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 <InitializeAnimatorCoroutine>d__19 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DoctorCorpseAI <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <InitializeAnimatorCoroutine>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<AudioClip>(); public AudioClip[] attackSounds = Array.Empty<AudioClip>(); 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<SkinnedMeshRenderer>(); if ((Object)(object)skinnedMeshRenderer == (Object)null) { TheDoctor.mls.LogError((object)"SkinnedMeshRenderer not found for the DoctorCorpse"); } Transform val = ((IEnumerable<Transform>)skinnedMeshRenderer.bones).FirstOrDefault((Func<Transform, bool>)((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<NetworkObjectReference>(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<DoctorBrainAI>(); } } } [IteratorStateMachine(typeof(<InitializeAnimatorCoroutine>d__19))] public IEnumerator InitializeAnimatorCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <InitializeAnimatorCoroutine>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<PlayerControllerB>())); } } } [IteratorStateMachine(typeof(<AttackCoroutine>d__34))] public IEnumerator AttackCoroutine(PlayerControllerB player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <AttackCoroutine>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<DoctorCorpseAI>((IList<DoctorCorpseAI>)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(<HitEnemyCoroutine>d__36))] public IEnumerator HitEnemyCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <HitEnemyCoroutine>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<GameObject> list = new List<GameObject>(2) { TheDoctor.doctorHeart.spawnPrefab, TheDoctor.doctorEye.spawnPrefab }; GameObject val = Object.Instantiate<GameObject>(list[new Random().Next(list.Count)], ((Component)this).transform.position + Vector3.up * 0.5f, Quaternion.identity, StartOfRound.Instance.propsContainer); DoctorItem component = val.GetComponent<DoctorItem>(); ((GrabbableObject)component).fallTime = 0f; ((GrabbableObject)component).isInFactory = !base.isOutside; val.GetComponent<NetworkObject>().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<NetworkObject>()), 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) {
TheDoctorAddon.dll
Decompiled 2 weeks agousing System; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using AddonFusion; using AddonFusion.Behaviours.AddonComponents; using AddonFusion.Behaviours.AddonProps; using AddonFusion.Behaviours.Scripts; using AddonFusion.Registries; using BepInEx; using HarmonyLib; using LegaFusionCore.Managers; using Microsoft.CodeAnalysis; using TheDoctor.Behaviours.Items; using TheDoctor.Managers; using TheDoctorAddon.Behaviours.AddonComponents; using TheDoctorAddon.Behaviours.AddonProps; using TheDoctorAddon.NetcodePatcher; using TheDoctorAddon.Patches; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("TheDoctorAddon")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("TheDoctorAddon")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("13936937-1fea-445e-b2c8-9742fb77db74")] [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 TheDoctorAddon { [BepInPlugin("Lega.TheDoctorAddon", "The Doctor Addon", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class SnowPlaygroundsAddon : BaseUnityPlugin { public const string modGUID = "Lega.TheDoctorAddon"; public const string modName = "The Doctor Addon"; public const string modVersion = "1.0.0"; private readonly Harmony harmony = new Harmony("Lega.TheDoctorAddon"); private static readonly AssetBundle bundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "thedoctoraddon")); public void Awake() { LoadItems(); harmony.PatchAll(typeof(DoctorBrainPatch)); } public void LoadItems() { RegisterAddon(typeof(SpectralDecoy), "Spectral Decoy", typeof(SpectralDecoyItem), bundle.LoadAsset<Item>("Assets/AddonProps/SpectralDecoyItem.asset")); } public void RegisterAddon(Type addonType, string addonName, Type itemType, Item item) { item = LFCObjectsManager.RegisterObject(itemType, item); AddonObjectRegistry.Add(addonType, addonName, item.spawnPrefab); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "TheDoctorAddon"; public const string PLUGIN_NAME = "TheDoctorAddon"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace TheDoctorAddon.Patches { public class DoctorBrainPatch { [HarmonyPatch(typeof(DoctorBrain), "InitializeEveryoneRpc")] [HarmonyPostfix] public static void InitializeForEveryone(DoctorBrain __instance) { AFUtilities.SetAddonComponent<SpectralDecoy>((GrabbableObject)(object)__instance); } } } namespace TheDoctorAddon.Behaviours.AddonProps { public class SpectralDecoyItem : AddonScroll { public override Type AddonType => typeof(SpectralDecoy); protected override void __initializeVariables() { ((AddonScroll)this).__initializeVariables(); } protected override void __initializeRpcs() { ((AddonScroll)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SpectralDecoyItem"; } } } namespace TheDoctorAddon.Behaviours.AddonComponents { [AddonInfo(/*Could not decode attribute arguments.*/)] public class SpectralDecoy : AddonComponent { public override string AddonName => "Spectral Decoy"; public override bool IsPassive => false; public override void ActivateAddonAbility() { if (!base.onCooldown && StartOfRound.Instance.shipHasLanded && (Object)(object)base.grabbableObject.playerHeldBy != (Object)null) { ((AddonComponent)this).StartCooldown(ConfigManager.spectralDecoyCooldown.Value); TheDoctorNetworkManager.Instance.SpawnSpectralDecoyEveryoneRpc((int)base.grabbableObject.playerHeldBy.playerClientId); } } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace TheDoctorAddon.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }