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 SCP999 v2.4.0
plugins/ProjectSCP.SCP999.dll
Decompiled a month ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using Dawn; using Dawn.Utils; using Dusk; using GameNetcodeStuff; using HarmonyLib; using ItemSCPs; using Microsoft.CodeAnalysis; using PSCPLibrary; using ProjectSCP.SCP999.NetcodePatcher; using SnowyLib; using Unity.Netcode; using UnityEngine; using UnityEngine.InputSystem.Utilities; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: 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: AssemblyCompany("ProjectSCP.SCP999")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("2.4.0.0")] [assembly: AssemblyInformationalVersion("2.4.0+8a27920cc5140bd7f46e823235b0f982ca4ee8c0")] [assembly: AssemblyProduct("SCP999")] [assembly: AssemblyTitle("ProjectSCP.SCP999")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.4.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [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 ItemSCPs { public class SCP999ContentHandler : ContentHandler<SCP999ContentHandler> { public class SCP999Assets : AssetBundleLoader<SCP999Assets> { [LoadFromBundle("SCP999Info.asset")] public SCPInfo SCP999Info { get; private set; } = null; public SCP999Assets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class ContainmentJarAssets : AssetBundleLoader<ContainmentJarAssets> { public ContainmentJarAssets(DuskMod mod, string filePath) : base(mod, filePath) { } } public SCP999Assets? SCP999; public ContainmentJarAssets? ContainmentJar; public SCP999ContentHandler(DuskMod mod) : base(mod) { ((ContentHandler)this).RegisterContent<SCP999Assets>("scp999", ref SCP999, false); ((ContentHandler)this).RegisterContent<ContainmentJarAssets>("containment_jar", ref ContainmentJar, false); } } public static class SCP999Keys { public static readonly NamespacedKey<DawnEnemyInfo> SCP999 = NamespacedKey<DawnEnemyInfo>.From("scpnineninenine", "scpnineninenine"); public static readonly NamespacedKey<DawnItemInfo> ContainmentJar = NamespacedKey<DawnItemInfo>.From("scpnineninenine", "jar"); } } namespace SCP999 { internal class ContainmentJarBehavior : PhysicsProp { internal enum Contents { Empty, SCP999, Blob } public Sprite[] icons = null; public Material[] materials = null; public ScanNodeProperties scanNode = null; public MeshRenderer renderer = null; public Contents JarContents = Contents.Empty; public PlayerControllerB? lastPlayerHeldBy; public static int jar999Value { get; private set; } public static int jarSlimeValue { get; private set; } [InitConfig] public static void InitConfigs() { jar999Value = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<int>("Containment Jar Options", "ContainmentJar | SCP-999 Value", 1, "Value of a Containment Jar with SCP-999 inside it").Value; jarSlimeValue = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<int>("Containment Jar Options", "ContainmentJar | Slime Value", 50, "Value of a Containment Jar with slime inside it").Value; } public override void Update() { ((GrabbableObject)this).Update(); if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { lastPlayerHeldBy = ((GrabbableObject)this).playerHeldBy; if ((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)Plugin.localPlayer) { int num = MiscHelpers.IndexOf<GrabbableObject>((IEnumerable<GrabbableObject>)Plugin.localPlayer.ItemSlots, (GrabbableObject)(object)this); HUDManager.Instance.itemSlotIcons[num].sprite = icons[(int)JarContents]; } } } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (buttonDown && JarContents != Contents.Empty && !StartOfRound.Instance.inShipPhase) { OpenJarServerRpc(); } } public override int GetItemDataToSave() { Plugin.logger.LogDebug((object)("GetItemDataToSave: " + JarContents)); return (int)JarContents; } public override void LoadItemSaveData(int saveData) { ManualLogSource logger = Plugin.logger; Contents contents = (Contents)saveData; logger.LogDebug((object)("LoadItemSaveData: " + contents)); ((GrabbableObject)this).fallTime = 0f; ChangeJarContentsOnLocalClient((Contents)saveData); } public void ChangeJarContentsOnLocalClient(Contents contents) { Plugin.logger.LogDebug((object)("ChangeJarContentsOnLocalClient: " + contents)); ((Renderer)renderer).material = materials[(int)contents]; JarContents = contents; switch (JarContents) { case Contents.Empty: ((GrabbableObject)this).SetScrapValue(0); break; case Contents.SCP999: ((GrabbableObject)this).SetScrapValue(jar999Value); break; case Contents.Blob: ((GrabbableObject)this).SetScrapValue(jarSlimeValue); break; } scanNode.subText = "Contents: " + contents; } public override void SetControlTipsForItem() { string[] array = ((JarContents == Contents.Empty) ? Array.Empty<string>() : new string[1] { "Release " + JarContents.ToString() + " [LMB]" }); HUDManager.Instance.ChangeControlTipMultiple(array, true, ((GrabbableObject)this).itemProperties); } [ServerRpc(RequireOwnership = false)] private void OpenJarServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val2 = default(ServerRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendServerRpc(3572622651u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val, 3572622651u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 || (!networkManager.IsServer && !networkManager.IsHost)) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (((NetworkBehaviour)this).IsServer) { if (JarContents == Contents.SCP999) { SCP999AI sCP999AI = (SCP999AI)(object)Utils.SpawnEnemy(SCP999Keys.SCP999, ((Component)((GrabbableObject)this).playerHeldBy).transform.position + ((Component)((GrabbableObject)this).playerHeldBy).transform.forward * 2f, default(Quaternion), (Transform)null, true); sCP999AI.SetTamedRpc(((GrabbableObject)this).playerHeldBy.actualClientId); } else if (JarContents == Contents.Blob) { Utils.SpawnEnemy(EnemyKeys.Blob, ((Component)((GrabbableObject)this).playerHeldBy).transform.position + ((Component)((GrabbableObject)this).playerHeldBy).transform.forward * 2f, default(Quaternion), (Transform)null, true); } ChangeJarContentsClientRpc(Contents.Empty); } } [ClientRpc] public void ChangeJarContentsClientRpc(Contents contents) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(3420106347u, val2, (RpcDelivery)0); ((FastBufferWriter)(ref val)).WriteValueSafe<Contents>(ref contents, default(ForEnums)); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 3420106347u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Plugin.logger.LogDebug((object)("ChangeJarContentsClientRpc: " + contents)); ChangeJarContentsOnLocalClient(contents); } } } [ClientRpc] public void NotifyPlayerClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val2 = default(ClientRpcParams); FastBufferWriter val = ((NetworkBehaviour)this).__beginSendClientRpc(1688014456u, val2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val, 1688014456u, val2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsClient || networkManager.IsHost)) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)lastPlayerHeldBy != (Object)null && (Object)(object)lastPlayerHeldBy == (Object)(object)Plugin.localPlayer) { HUDManager.Instance.DisplayTip("You monster!", "You are a horrible person", true, false, "LC_Tip1"); } } } 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 //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3572622651u, new RpcReceiveHandler(__rpc_handler_3572622651), "OpenJarServerRpc"); ((NetworkBehaviour)this).__registerRpc(3420106347u, new RpcReceiveHandler(__rpc_handler_3420106347), "ChangeJarContentsClientRpc"); ((NetworkBehaviour)this).__registerRpc(1688014456u, new RpcReceiveHandler(__rpc_handler_1688014456), "NotifyPlayerClientRpc"); ((PhysicsProp)this).__initializeRpcs(); } private static void __rpc_handler_3572622651(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; ((ContainmentJarBehavior)(object)target).OpenJarServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3420106347(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) { Contents contents = default(Contents); ((FastBufferReader)(ref reader)).ReadValueSafe<Contents>(ref contents, default(ForEnums)); target.__rpc_exec_stage = (__RpcExecStage)1; ((ContainmentJarBehavior)(object)target).ChangeJarContentsClientRpc(contents); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1688014456(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; ((ContainmentJarBehavior)(object)target).NotifyPlayerClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "ContainmentJarBehavior"; } } [HarmonyPatch(typeof(DepositItemsDesk))] internal class DepositItemsDeskPatch { private static ManualLogSource logger = Plugin.logger; [HarmonyPostfix] [HarmonyPatch("delayedAcceptanceOfItems")] public static void delayedAcceptanceOfItemsPostFix(GrabbableObject[] objectsOnDesk) { if (!Plugin.IsServerOrHost) { return; } foreach (GrabbableObject val in objectsOnDesk) { if ((Object)(object)((Component)val).GetComponent<ContainmentJarBehavior>() != (Object)null) { ContainmentJarBehavior component = ((Component)val).GetComponent<ContainmentJarBehavior>(); if (component.JarContents == ContainmentJarBehavior.Contents.SCP999) { component.NotifyPlayerClientRpc(); } } } } } [BepInPlugin("ProjectSCP.SCP999", "SCP999", "2.4.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { private readonly Harmony harmony = new Harmony("ProjectSCP.SCP999"); public static List<string> Sweets = new List<string> { "Blue Candy", "Green Candy", "Pink Candy", "Purple Candy", "Rainbow Candy", "Red Candy", "Yellow Candy", "Black Candy", "Candy", "Cake", "SCP-559" }; public static Plugin Instance { get; private set; } = null; public static ManualLogSource logger { get; private set; } = null; public static DuskMod Mod { get; private set; } = null; public static PlayerControllerB localPlayer => StartOfRound.Instance.localPlayerController; public static bool IsServerOrHost => NetworkManager.Singleton.IsServer || NetworkManager.Singleton.IsHost; public static SCPInfo SCP999Info { get; private set; } = null; public static PlayerControllerB? PlayerFromId(ulong id) { return StartOfRound.Instance.allPlayerScripts.Where((PlayerControllerB x) => x.actualClientId == id).FirstOrDefault(); } private void Awake() { if ((Object)(object)Instance == (Object)null) { Instance = this; } logger = ((BaseUnityPlugin)Instance).Logger; harmony.PatchAll(); AssetBundle val = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "scp999_mainassets")); Mod = DuskMod.RegisterMod((BaseUnityPlugin)(object)this, val); Mod.RegisterContentHandlers(); SCP999Info = ContentHandler<SCP999ContentHandler>.Instance.SCP999.SCP999Info; SCPAPI.Register(SCP999Info); InitializeNetworkBehaviours(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"ProjectSCP.SCP999 v2.4.0 has loaded!"); } private static void InitializeNetworkBehaviours() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } logger.LogDebug((object)"Finished initializing network behaviours"); } } public class SCP999AI : EnemyAI { public enum State { Roaming, Following, Blocking, Healing, Hyper } public SmartAgentNavigator nav = null; public Transform turnCompass = null; public ScanNodeProperties scanNode = null; public AudioClip[] hitSFX = null; public AudioClip[] hugSFX = null; public AudioClip[] hurtSFX = null; public AudioClip[] roamSFX = null; public InteractTrigger jarTrigger = null; public InteractTrigger feedTrigger = null; private static readonly int hashHug = Animator.StringToHash("hugging"); private static readonly int hashStretch = Animator.StringToHash("stretching"); private static readonly int hashHyperDancing = Animator.StringToHash("hyperDancing"); private static readonly int hashDancing = Animator.StringToHash("dancing"); private static readonly int hashSpeed = Animator.StringToHash("speed"); private static readonly int hashEmoteNumber = Animator.StringToHash("emoteNumber"); private static readonly int hashExhausted = Animator.StringToHash("exhausted"); private Turret? blockedTurret; private float candyCooldownTime; private float exhaustionCooldownTime; private float timeSinceBlockSFX; private float timeSinceLastHugSFX; private float timeSinceLastRoamSFX; private float timeSinceLastCollision; private int amountHealedSinceLastExhausted; private int candyEaten; private bool gettingInJar; private EnemyAI? targetEnemy; private PlayerControllerB? tamedByPlayer; private bool dancing; private bool searching; private float currentSpeed; private Vector3 lastPosition; private float currentSearchRadius; private bool IsExhausted => exhaustionCooldownTime > 0f; private bool IsTamed => (Object)(object)tamedByPlayer != (Object)null; public static float Size { get; private set; } public static int PlayerHealAmount { get; private set; } public static int EnemyHealAmount { get; private set; } public static float PlayerDetectionRange { get; private set; } public static float EnemyDetectionRange { get; private set; } public static float FollowRange { get; private set; } public static float HuggingRange { get; private set; } public static int MaxCandy { get; private set; } public static float InsanityDecreaseRate { get; private set; } public static string[] EdibleCandyItemNames { get; private set; } = Array.Empty<string>(); public static string[] EdibleCandyItemTags { get; private set; } = Array.Empty<string>(); public static float CandyCooldown { get; private set; } public static bool TamingEnabled { get; private set; } public static bool ExhaustionEnabled { get; private set; } public static int MaxHealingUntilExhausted { get; private set; } public static int EnemyHPToPlayerHPConversion { get; private set; } public static float ExhaustionCooldown { get; private set; } [InitConfig] public static void InitConfigs() { Size = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<float>("SCP-999 Options", "SCP-999 | Size", 1f, "How big SCP-999 is").Value; PlayerHealAmount = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<int>("SCP-999 Options", "SCP-999 | Player Heal Amount", 2, "How much SCP-999 heals the player per second").Value; EnemyHealAmount = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<int>("SCP-999 Options", "SCP-999 | Enemy Heal Amount", 1, "How much SCP-999 heals an enemy per second").Value; PlayerDetectionRange = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<float>("SCP-999 Options", "SCP-999 | Player Detection Range", 20f, "How far SCP-999 can detect a player when they are hurt").Value; EnemyDetectionRange = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<float>("SCP-999 Options", "SCP-999 | Enemy Detection Range", 15f, "How far SCP-999 can detect an enemy when they get hurt").Value; FollowRange = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<float>("SCP-999 Options", "SCP-999 | Follow Range", 5f, "The distance in which SCP-999 will follow a player or enemy when following them").Value; HuggingRange = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<float>("SCP-999 Options", "SCP-999 | Hugging Range", 2f, "The distance in which SCP-999 will begin hugging and healing a player or enemy").Value; MaxCandy = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<int>("SCP-999 Options", "SCP-999 | Max Candy", 3, "Maximum amount of candy SCP-999 can eat before becoming hyper").Value; InsanityDecreaseRate = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<float>("SCP-999 Options", "SCP-999 | Insanity Decrease Rate", 2f, "How much insanity the player loses per second while SCP-999 is hugging/healing them").Value; EdibleCandyItemNames = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<string>("SCP-999 Options", "SCP-999 | Edible Candy Item Names", "melaniemeliciouscooked:piezero,melaniemeliciouscooked:grapezero,melaniemeliciouscooked:juicezero,melaniemeliciouscooked:grapeone,melaniemeliciouscooked:juiceone,melaniemeliciouscooked:juicetwo,melaniemeliciouscooked:juicethree,melaniemeliciouscooked:burstberryzero,melaniemeliciouscooked:burstberryone,melaniemeliciouscooked:pieone,melaniemeliciouscooked:pietwo,melaniemeliciouscooked:cookiezero,melaniemeliciouscooked:popsiclezero,melaniemeliciouscooked:popsicleone,melaniemeliciouscooked:popsicletwo,lethal_company:candy", "Dawnlib NamespaceKeys for candy SCP-999 can eat (can be used for taming)").Value.Replace(" ", "").ToLower().Split(","); EdibleCandyItemTags = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<string>("SCP-999 Options", "SCP-999 | Edible Candy Item Tags", "candy,sweets,sweet,candies,sugar", "Dawnlib tags for candy SCP-999 can eat (can be used for taming)").Value.Replace(" ", "").ToLower().Split(","); CandyCooldown = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<float>("SCP-999 Options", "SCP-999 | Candy Cooldown", 60f, "When feeding SCP-999 candy, his candy counter (which is used to determine how much candy is eaten for Max Candy config) will go up by one. This is how long it should take for that counter to go down by one.").Value; TamingEnabled = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<bool>("SCP-999 Options", "SCP-999 | Taming", true, "When enabled, you can tame SCP-999 by feeding it candy. Once tamed, it will become bound to the player who fed it candy and it will follow that player.").Value; ExhaustionEnabled = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<bool>("SCP-999 Options", "SCP-999 | Exhaustion", true, "When enabled, once SCP-999 heals above a certain threshold, it can get exhausted and wont be able to heal again until it finishes resting.").Value; MaxHealingUntilExhausted = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<int>("SCP-999 Options", "SCP-999 | Max Healing Until Exhausted", 100, "How much health SCP-999 can heal until it gets exhausted. This resets in orbit.").Value; EnemyHPToPlayerHPConversion = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<int>("SCP-999 Options", "SCP-999 | Enemy HP to Player HP Conversion", 5, "How much health towards 'Max Healing Until Exhausted' should be considered healed for each point of enemy health.").Value; ExhaustionCooldown = ((BaseUnityPlugin)Plugin.Instance).Config.Bind<int>("SCP-999 Options", "SCP-999 | Exhaustion Cooldown", 30, "How long in seconds SCP-999 will be exhausted for before it can start healing again.").Value; } public override void Start() { //IL_0061: 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) ((EnemyAI)this).Start(); Plugin.logger.LogDebug((object)"SCP-999 Spawned"); base.ventAnimationFinished = true; base.currentBehaviourStateIndex = 0; if (!RoundManager.Instance.SpawnedEnemies.Contains((EnemyAI)(object)this)) { RoundManager.Instance.SpawnedEnemies.Add((EnemyAI)(object)this); } if (((NetworkBehaviour)this).IsServer) { if (((Component)this).transform.localScale.y != Size) { ChangeSizeRpc(Size); } nav.SetAllValues(((Component)this).transform.position.y > -80f); candyCooldownTime = CandyCooldown; } } public override void Update() { //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) GameUpdate(); timeSinceBlockSFX += Time.deltaTime; timeSinceLastHugSFX += Time.deltaTime; timeSinceLastCollision += Time.deltaTime; timeSinceLastRoamSFX += Time.deltaTime; if (exhaustionCooldownTime > 0f) { exhaustionCooldownTime -= Time.deltaTime; } candyCooldownTime -= Time.deltaTime; if (candyCooldownTime <= 0f) { candyCooldownTime = CandyCooldown; if (candyEaten > 0) { candyEaten--; } } base.creatureAnimator.SetBool(hashExhausted, IsExhausted); bool flag = (base.currentBehaviourStateIndex == 1 || base.currentBehaviourStateIndex == 3) && timeSinceLastCollision < 3f && !IsExhausted; base.creatureAnimator.SetBool(hashHug, flag); if (flag && timeSinceLastHugSFX > 5f) { timeSinceLastHugSFX = 0f; RoundManager.PlayRandomClip(base.creatureVoice, hugSFX, true, 1f, 0, 1000); } else if (base.currentBehaviourStateIndex == 0 && timeSinceLastRoamSFX > 10f) { timeSinceLastRoamSFX = 0f; RoundManager.PlayRandomClip(base.creatureVoice, roamSFX, true, 1f, 0, 1000); } 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)), 10f * Time.deltaTime); } bool flag2 = (Object)(object)Plugin.localPlayer.currentlyHeldObjectServer != (Object)null && Plugin.localPlayer.currentlyHeldObjectServer is ContainmentJarBehavior && ((ContainmentJarBehavior)(object)Plugin.localPlayer.currentlyHeldObjectServer).JarContents == ContainmentJarBehavior.Contents.Empty; jarTrigger.interactable = IsTamed && !IsExhausted && (Object)(object)Plugin.localPlayer == (Object)(object)tamedByPlayer && flag2; jarTrigger.disabledHoverTip = (flag2 ? "Must be tamed first" : ""); SetFeedTrigger(); } private void SetFeedTrigger() { if ((Object)(object)Plugin.localPlayer.currentlyHeldObjectServer == (Object)null) { feedTrigger.interactable = false; return; } DawnItemInfo info = ItemExtensions.GetDawnInfo(Plugin.localPlayer.currentlyHeldObjectServer.itemProperties); feedTrigger.interactable = ((DawnBaseInfo<DawnItemInfo>)(object)info).AllTags().Any((NamespacedKey x) => EdibleCandyItemTags.Contains<string>(((object)x).ToString()) || EdibleCandyItemNames.Contains<string>(((object)((DawnBaseInfo<DawnItemInfo>)(object)info).TypedKey).ToString())); } public void GameUpdate() { if (!base.ventAnimationFinished && base.timeSinceSpawn < base.exitVentAnimationTime + 0.005f * (float)RoundManager.Instance.numberOfEnemiesInScene) { base.timeSinceSpawn += Time.deltaTime; return; } if (!base.inSpecialAnimation && !base.ventAnimationFinished) { base.ventAnimationFinished = true; } ((EnemyAI)this).DisableAnimatorWhenNotVisible(); if (!((NetworkBehaviour)this).IsOwner) { base.timeSinceSpawn += Time.deltaTime; } else if (!base.isEnemyDead && !base.inSpecialAnimation) { if (base.updateDestinationInterval >= 0f) { base.updateDestinationInterval -= Time.deltaTime; return; } ((EnemyAI)this).DoAIInterval(); base.updateDestinationInterval = base.AIIntervalTime + Random.Range(-0.015f, 0.015f); } } public void LateUpdate() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)this).transform.position - lastPosition; currentSpeed = Mathf.Clamp(((Vector3)(ref val)).magnitude / Time.deltaTime / 2f, 0f, 1.5f); lastPosition = ((Component)this).transform.position; base.creatureAnimator.SetFloat(hashSpeed, currentSpeed); } public override void DoAIInterval() { if (gettingInJar) { return; } if ((Object)(object)tamedByPlayer != (Object)null) { base.targetPlayer = tamedByPlayer; } if (ExhaustionEnabled && !IsExhausted && amountHealedSinceLastExhausted > MaxHealingUntilExhausted) { exhaustionCooldownTime = ExhaustionCooldown; amountHealedSinceLastExhausted = 0; SetExhaustedTimerRpc(ExhaustionCooldown); } switch (base.currentBehaviourStateIndex) { case 0: base.agent.speed = 5f; base.agent.stoppingDistance = 0f; base.agent.acceleration = 8f; if (((EnemyAI)this).TargetClosestPlayer(1.5f, true, 70f, false, true, true) || EnemyAIExtensions.TargetClosestEnemy((EnemyAI)(object)this, ref targetEnemy, targetEnemy, (Func<EnemyAI, bool>)((EnemyAI e) => !e.isEnemyDead && !Object.op_Implicit((Object)(object)e.inSpecialAnimationWithPlayer) && !(e is SCP999AI)), 1.5f, true, 70f, false, false, true)) { Plugin.logger.LogDebug((object)"Start Following"); StopSearch(); SwitchToBehaviourClientRpc(1); } else { StartSearch(2000f); } break; case 1: { base.agent.speed = 5f; base.agent.stoppingDistance = FollowRange; base.agent.acceleration = 10f; if ((Object)(object)tamedByPlayer == (Object)null && (Object)(object)base.targetPlayer == (Object)null && (Object)(object)targetEnemy == (Object)null) { Plugin.logger.LogDebug((object)"Stop Targeting"); SwitchToBehaviourClientRpc(0); break; } bool flag = IsNearbyPlayerDancing(FollowRange); if (dancing != flag) { DoAnimationRpc(hashDancing, flag); dancing = flag; } FollowTarget(); break; } case 2: base.agent.speed = 20f; base.agent.stoppingDistance = 0f; base.agent.acceleration = 15f; if (!MoveInFrontOfTurret()) { Plugin.logger.LogDebug((object)"Stop Blocking"); StopSearch(); SwitchToBehaviourClientRpc(1); blockedTurret = null; } break; case 3: base.agent.speed = 10f; base.agent.stoppingDistance = HuggingRange; base.agent.acceleration = 50f; MoveToHealTarget(); break; case 4: base.agent.speed = 20f; base.agent.stoppingDistance = 0f; base.agent.acceleration = 25f; base.targetPlayer = null; targetEnemy = null; StartSearch(15f); if (candyEaten < MaxCandy) { SwitchToBehaviourClientRpc(0); } break; default: Plugin.logger.LogWarning((object)("Invalid state: " + base.currentBehaviourStateIndex)); break; } } public override void EnableEnemyMesh(bool enable, bool overrideDoNotSet = false, bool tamperWithMeshes = false) { } public bool SetDestinationToPosition(Vector3 position, bool checkForPath = false) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Invalid comparison between Unknown and I4 if (checkForPath && !Utils.SmartCanPathToPoint(((Component)this).transform.position, position, nav.IsAgentOutside())) { return false; } GoToDestinationResult val = default(GoToDestinationResult); nav.TryDoPathingToDestination(position, ref val); bool flag = (int)val == 0 || (int)val == 1; if (flag) { StopSearch(); } return flag; } public void StartSearch(float radius) { if (!searching || radius != currentSearchRadius) { nav.StopSearchRoutine(); nav.StartSearchRoutine(radius); currentSearchRadius = radius; searching = true; } } public void StopSearch() { if (searching) { nav.StopSearchRoutine(); searching = false; } } public void SetTamed(PlayerControllerB playerTamedTo) { if (TamingEnabled) { tamedByPlayer = playerTamedTo; base.targetPlayer = playerTamedTo; if (playerTamedTo.playerSteamId == 76561198253760639L) { SetScanNode("Following my creator"); } else if (playerTamedTo.playerSteamId == 76561199094139351L) { SetScanNode("Following my best friend lizzie <3"); } else { SetScanNode("Following " + playerTamedTo.playerUsername); } if (((NetworkBehaviour)this).IsServer) { StopSearch(); } SwitchToBehaviourStateOnLocalClient(1); } } public void GetInJar() { Plugin.logger.LogDebug((object)"GetInJar"); GetInJarRpc(Plugin.localPlayer.actualClientId); } public void EatFood() { Plugin.logger.LogDebug((object)"EatFood"); FeedCandyRpc(Plugin.localPlayer.actualClientId); } private void FollowTarget() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) Vector3 position; if ((Object)(object)tamedByPlayer != (Object)null) { position = ((Component)tamedByPlayer).transform.position; } else if ((Object)(object)base.targetPlayer != (Object)null) { position = ((Component)base.targetPlayer).transform.position; } else { if (!((Object)(object)targetEnemy != (Object)null)) { return; } position = ((Component)targetEnemy).transform.position; } SetDestinationToPosition(position); } private void MoveToHealTarget() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)base.targetPlayer != (Object)null) { if (base.targetPlayer.health >= 100 || base.targetPlayer.isPlayerDead) { StopSearch(); SwitchToBehaviourClientRpc(1); } else { SetDestinationToPosition(((Component)base.targetPlayer).transform.position); } } else if ((Object)(object)targetEnemy != (Object)null) { int enemyHP = targetEnemy.enemyType.enemyPrefab.GetComponent<EnemyAI>().enemyHP; if (targetEnemy.enemyHP >= enemyHP || targetEnemy.isEnemyDead) { StopSearch(); SwitchToBehaviourClientRpc(1); } else { SetDestinationToPosition(((Component)targetEnemy).transform.position); } } } private bool MoveInFrontOfTurret() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Invalid comparison between Unknown and I4 //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Invalid comparison between Unknown and I4 //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)blockedTurret != (Object)null && ((int)blockedTurret.turretMode == 2 || (int)blockedTurret.turretMode == 1)) { Vector3 val = Vector3.Lerp(((Component)base.targetPlayer).transform.position, ((Component)blockedTurret).transform.position, 0.5f); SetDestinationToPosition(val); if (Vector3.Distance(((Component)this).transform.position, val) < 1f && timeSinceBlockSFX > 0.5f) { RoundManager.PlayRandomClip(base.creatureVoice, hitSFX, true, 1f, 0, 1000); timeSinceBlockSFX = 0f; } return true; } return false; } public override void DetectNoise(Vector3 noisePosition, float noiseLoudness, int timesPlayedInOneSpot = 0, int noiseID = 0) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).DetectNoise(noisePosition, noiseLoudness, timesPlayedInOneSpot, noiseID); } public override void HitEnemy(int force = 0, PlayerControllerB playerWhoHit = null, bool playHitSFX = true, int hitID = -1) { RoundManager.PlayRandomClip(base.creatureVoice, hurtSFX, true, 1f, 0, 1000); } public override void OnCollideWithPlayer(Collider other) { ((EnemyAI)this).OnCollideWithPlayer(other); if (timeSinceLastCollision < 1f) { return; } PlayerControllerB component = ((Component)other).gameObject.GetComponent<PlayerControllerB>(); if (!((Object)(object)component == (Object)null) && PlayerControllerBExtensions.IsLocalPlayer(component)) { if (CanHeal() && component.health < 100) { int health = component.health; component.health = Mathf.Clamp(component.health + PlayerHealAmount, 0, 100); int num = component.health - health; amountHealedSinceLastExhausted += num; HUDManager.Instance.UpdateHealthUI(component.health, false); timeSinceLastCollision = 0f; HealPlayerRpc(component.actualClientId, component.health, num); } component.insanityLevel -= InsanityDecreaseRate; component.JumpToFearLevel(0f, false); } } public override void OnCollideWithEnemy(Collider other, EnemyAI? collidedEnemy = null) { //IL_00b3: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).OnCollideWithEnemy(other, collidedEnemy); if (((NetworkBehaviour)this).IsServer && CanHeal() && !((Object)(object)collidedEnemy == (Object)null) && !(collidedEnemy is SCP999AI) && EnemyHealAmount > 0) { int maxHealth = EnemyAIExtensions.GetMaxHealth(collidedEnemy); if (collidedEnemy.enemyHP < EnemyAIExtensions.GetMaxHealth(collidedEnemy)) { timeSinceLastCollision = 0f; int enemyHP = collidedEnemy.enemyHP; collidedEnemy.enemyHP = Mathf.Clamp(base.enemyHP + EnemyHealAmount, 0, maxHealth); int num = (collidedEnemy.enemyHP - enemyHP) * EnemyHPToPlayerHPConversion; amountHealedSinceLastExhausted += num; HealEnemyRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)collidedEnemy).NetworkObject), collidedEnemy.enemyHP, num); } } } public bool IsNearbyPlayerDancing(float distance) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (val.performingEmote && val.playerBodyAnimator.GetInteger(hashEmoteNumber) == 1) { Vector3 val2 = ((Component)this).transform.position - ((Component)val).transform.position; if (((Vector3)(ref val2)).sqrMagnitude < distance * distance) { return true; } } } return false; } public void SetScanNode(string subText) { scanNode.subText = subText; } public bool CanHeal() { return base.currentBehaviourStateIndex != 4 && !IsExhausted; } public void EnemyTookDamage(EnemyAI enemy) { if (!((Object)(object)tamedByPlayer != (Object)null) && CanHeal()) { targetEnemy = enemy; StopSearch(); SwitchToBehaviourClientRpc(3); } } public void SwitchToBehaviourStateOnLocalClient(int stateIndex) { ManualLogSource logger = Plugin.logger; State state = (State)stateIndex; logger.LogDebug((object)("Switching to behavior state: " + state)); if (base.currentBehaviourStateIndex != stateIndex) { base.previousBehaviourStateIndex = base.currentBehaviourStateIndex; base.currentBehaviourStateIndex = stateIndex; base.currentBehaviourState = base.enemyBehaviourStates[stateIndex]; } base.creatureAnimator.SetBool(hashHyperDancing, base.currentBehaviourStateIndex == 4); base.creatureAnimator.SetBool(hashStretch, base.currentBehaviourStateIndex == 2); } [Rpc(/*Could not decode attribute arguments.*/)] public void SwitchToBehaviourServerRpc(int stateIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_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_0051: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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 = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1233942615u, val3, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, stateIndex); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1233942615u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (((NetworkBehaviour)this).IsServer) { SwitchToBehaviourClientRpc(stateIndex); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SwitchToBehaviourClientRpc(int stateIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_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_0051: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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 = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1575350427u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, stateIndex); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1575350427u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SwitchToBehaviourStateOnLocalClient(stateIndex); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetScanNodeRpc(string subText) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_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_0051: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(498050936u, val3, val, (SendTo)6, (RpcDelivery)0); bool flag = subText != null; ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(subText, false); } ((NetworkBehaviour)this).__endSendRpc(ref val2, 498050936u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; SetScanNode(subText); } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetTamedRpc(ulong clientId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_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_0051: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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 = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2754852578u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, clientId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2754852578u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val4 = Plugin.PlayerFromId(clientId); if (!((Object)(object)val4 == (Object)null)) { SetTamed(val4); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void DoAnimationRpc(int id, bool value) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_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_0051: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: 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 = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2134544234u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, id); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref value, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2134544234u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.creatureAnimator.SetBool(id, value); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void GetInJarRpc(ulong clientId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_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_0051: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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 = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(595965857u, val3, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, clientId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 595965857u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (((NetworkBehaviour)this).IsServer) { PlayerControllerB val4 = Plugin.PlayerFromId(clientId); if (!((Object)(object)val4 == (Object)null) && val4.currentlyHeldObjectServer is ContainmentJarBehavior) { ((Component)val4.currentlyHeldObjectServer).GetComponent<ContainmentJarBehavior>().ChangeJarContentsClientRpc(ContainmentJarBehavior.Contents.SCP999); RoundManager.Instance.DespawnEnemyOnServer(((NetworkBehaviour)this).NetworkObject); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void PlayerTookDamageRpc(ulong clientId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_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_0051: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3724466018u, val3, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, clientId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3724466018u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (!((NetworkBehaviour)this).IsServer || !CanHeal()) { return; } PlayerControllerB val4 = Plugin.PlayerFromId(clientId); if (!((Object)(object)val4 == (Object)null) && (!((Object)(object)tamedByPlayer != (Object)null) || !((Object)(object)val4 != (Object)(object)base.targetPlayer))) { float num = 2f - (float)val4.health / 100f; float num2 = PlayerDetectionRange * num; if (Vector3.Distance(((Component)this).transform.position, ((Component)val4).transform.position) <= num2) { base.targetPlayer = val4; targetEnemy = null; StopSearch(); SwitchToBehaviourClientRpc(3); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void ChangeSizeRpc(float size) { //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_0051: 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_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_007a: 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_00eb: 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 = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1826903197u, val3, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref size, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1826903197u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Plugin.logger.LogDebug((object)("Changing size to " + size)); ((Component)this).transform.localScale = new Vector3(size, size, size); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void BlockTurretFireRpc(NetworkObjectReference netObjRef) { //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_0051: 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_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_007a: 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 = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1823352457u, val3, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref netObjRef, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1823352457u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); if (((NetworkBehaviour)this).IsServer && ((NetworkObjectReference)(ref netObjRef)).TryGet(ref val4, (NetworkManager)null)) { blockedTurret = ((Component)val4).GetComponentInChildren<Turret>(); StopSearch(); SwitchToBehaviourClientRpc(2); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void FeedCandyRpc(ulong clientId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_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_0051: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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 = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(4294780032u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, clientId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 4294780032u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val4 = Plugin.PlayerFromId(clientId); if (!((Object)(object)val4 == (Object)null)) { if (!IsTamed) { SetTamed(val4); } if (((NetworkBehaviour)val4).IsOwner) { val4.DespawnHeldObject(); } candyCooldownTime = CandyCooldown; candyEaten++; exhaustionCooldownTime = 0f; if (((NetworkBehaviour)this).IsServer && candyEaten >= MaxCandy) { SwitchToBehaviourClientRpc(4); } RoundManager.PlayRandomClip(base.creatureVoice, hugSFX, true, 1f, 0, 1000); } } [Rpc(/*Could not decode attribute arguments.*/)] public void HealPlayerRpc(ulong clientId, int newHealth, int healAmount) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Invalid comparison between Unknown and I4 //IL_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_0051: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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 = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1754923597u, val3, val, (SendTo)5, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, clientId); BytePacker.WriteValueBitPacked(val2, newHealth); BytePacker.WriteValueBitPacked(val2, healAmount); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1754923597u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Plugin.logger.LogDebug((object)"Heal player rpc"); PlayerControllerB val4 = Plugin.PlayerFromId(clientId); if (!((Object)(object)val4 == (Object)null)) { val4.health = newHealth; amountHealedSinceLastExhausted += healAmount; timeSinceLastCollision = 0f; } } } [Rpc(/*Could not decode attribute arguments.*/)] public void HealEnemyRpc(NetworkObjectReference netRef, int newHealth, int healAmount) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_0051: 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_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_007a: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2037852192u, val3, val, (SendTo)5, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref netRef, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, newHealth); BytePacker.WriteValueBitPacked(val2, healAmount); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2037852192u, val3, val, (SendTo)5, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); EnemyAI val5 = default(EnemyAI); if (((NetworkObjectReference)(ref netRef)).TryGet(ref val4, (NetworkManager)null) && ((Component)val4).TryGetComponent<EnemyAI>(ref val5)) { val5.enemyHP = newHealth; amountHealedSinceLastExhausted += healAmount; timeSinceLastCollision = 0f; } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetExhaustedTimerRpc(float 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_0051: 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_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_007a: 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 = default(RpcAttributeParams); RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3364258346u, val3, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref value, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3364258346u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; exhaustionCooldownTime = value; amountHealedSinceLastExhausted = 0; if (IsExhausted) { RoundManager.PlayRandomClip(base.creatureVoice, hurtSFX, true, 1f, 0, 1000); } } } protected override void __initializeVariables() { ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1233942615u, new RpcReceiveHandler(__rpc_handler_1233942615), "SwitchToBehaviourServerRpc"); ((NetworkBehaviour)this).__registerRpc(1575350427u, new RpcReceiveHandler(__rpc_handler_1575350427), "SwitchToBehaviourClientRpc"); ((NetworkBehaviour)this).__registerRpc(498050936u, new RpcReceiveHandler(__rpc_handler_498050936), "SetScanNodeRpc"); ((NetworkBehaviour)this).__registerRpc(2754852578u, new RpcReceiveHandler(__rpc_handler_2754852578), "SetTamedRpc"); ((NetworkBehaviour)this).__registerRpc(2134544234u, new RpcReceiveHandler(__rpc_handler_2134544234), "DoAnimationRpc"); ((NetworkBehaviour)this).__registerRpc(595965857u, new RpcReceiveHandler(__rpc_handler_595965857), "GetInJarRpc"); ((NetworkBehaviour)this).__registerRpc(3724466018u, new RpcReceiveHandler(__rpc_handler_3724466018), "PlayerTookDamageRpc"); ((NetworkBehaviour)this).__registerRpc(1826903197u, new RpcReceiveHandler(__rpc_handler_1826903197), "ChangeSizeRpc"); ((NetworkBehaviour)this).__registerRpc(1823352457u, new RpcReceiveHandler(__rpc_handler_1823352457), "BlockTurretFireRpc"); ((NetworkBehaviour)this).__registerRpc(4294780032u, new RpcReceiveHandler(__rpc_handler_4294780032), "FeedCandyRpc"); ((NetworkBehaviour)this).__registerRpc(1754923597u, new RpcReceiveHandler(__rpc_handler_1754923597), "HealPlayerRpc"); ((NetworkBehaviour)this).__registerRpc(2037852192u, new RpcReceiveHandler(__rpc_handler_2037852192), "HealEnemyRpc"); ((NetworkBehaviour)this).__registerRpc(3364258346u, new RpcReceiveHandler(__rpc_handler_3364258346), "SetExhaustedTimerRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_1233942615(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 stateIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref stateIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP999AI)(object)target).SwitchToBehaviourServerRpc(stateIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1575350427(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 stateIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref stateIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP999AI)(object)target).SwitchToBehaviourClientRpc(stateIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_498050936(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives)); string scanNodeRpc = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref scanNodeRpc, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP999AI)(object)target).SetScanNodeRpc(scanNodeRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2754852578(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong tamedRpc = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref tamedRpc); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP999AI)(object)target).SetTamedRpc(tamedRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2134544234(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int id = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref id); bool value = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref value, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP999AI)(object)target).DoAnimationRpc(id, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_595965857(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong clientId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref clientId); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP999AI)(object)target).GetInJarRpc(clientId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3724466018(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong clientId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref clientId); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP999AI)(object)target).PlayerTookDamageRpc(clientId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1826903197(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) { float size = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref size, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP999AI)(object)target).ChangeSizeRpc(size); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1823352457(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference netObjRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref netObjRef, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP999AI)(object)target).BlockTurretFireRpc(netObjRef); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4294780032(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong clientId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref clientId); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP999AI)(object)target).FeedCandyRpc(clientId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1754923597(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong clientId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref clientId); int newHealth = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref newHealth); int healAmount = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref healAmount); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP999AI)(object)target).HealPlayerRpc(clientId, newHealth, healAmount); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2037852192(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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference netRef = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref netRef, default(ForNetworkSerializable)); int newHealth = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref newHealth); int healAmount = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref healAmount); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP999AI)(object)target).HealEnemyRpc(netRef, newHealth, healAmount); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3364258346(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) { float exhaustedTimerRpc = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref exhaustedTimerRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP999AI)(object)target).SetExhaustedTimerRpc(exhaustedTimerRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SCP999AI"; } } [HarmonyPatch] public static class TESTING { [HarmonyPostfix] [HarmonyPatch(typeof(HUDManager), "PingScan_performed")] public static void PingScan_performedPostFix() { if (Utils.testing) { } } [StaticUpdate] public static void Update() { if (Utils.testing) { } } [HarmonyPrefix] [HarmonyPatch(typeof(HUDManager), "SubmitChat_performed")] public static void SubmitChat_performedPrefix(HUDManager __instance) { try { if (Utils.testing && ((NetworkBehaviour)__instance).IsServer) { string text = __instance.chatTextField.text; string[] array = text.Split(" "); string text2 = array[0]; string text3 = text2; } } catch (Exception ex) { Plugin.logger.LogError((object)ex); } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "ProjectSCP.SCP999"; public const string PLUGIN_NAME = "SCP999"; public const string PLUGIN_VERSION = "2.4.0"; } } namespace SCP999.Patches { [HarmonyPatch(typeof(BlobAI))] internal class BlobAIPatch { private static ManualLogSource logger = Plugin.logger; [HarmonyPostfix] [HarmonyPatch("DoAIInterval")] public static void DoAIIntervalPostfix(BlobAI __instance) { //IL_002d: 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) try { if (!Plugin.IsServerOrHost) { return; } foreach (ContainmentJarBehavior item in HoarderBugAI.grabbableObjectsInMap.OfType<ContainmentJarBehavior>()) { if (Vector3.Distance(((Component)__instance).transform.position, ((Component)item).transform.position) < 2f) { item.ChangeJarContentsClientRpc(ContainmentJarBehavior.Contents.Blob); RoundManager.Instance.DespawnEnemyOnServer(((NetworkBehaviour)__instance).NetworkObject); break; } } } catch { } } } [HarmonyPatch(typeof(EnemyAI))] internal class EnemyAIPatch { private static ManualLogSource logger = Plugin.logger; [HarmonyPostfix] [HarmonyPatch("HitEnemy")] private static void HitEnemyPostfix(EnemyAI __instance) { //IL_00c3: 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) try { if (!Plugin.IsServerOrHost || ((Object)__instance.enemyType).name == "SCP999Enemy") { return; } int enemyHP = __instance.enemyType.enemyPrefab.GetComponent<EnemyAI>().enemyHP; if (enemyHP <= 0 || __instance.isEnemyDead) { return; } logger.LogDebug((object)$"Max health of {((Object)__instance.enemyType).name} is {enemyHP}"); float num = 2 - __instance.enemyHP / enemyHP; float num2 = SCP999AI.EnemyDetectionRange * num; foreach (SCP999AI item in RoundManager.Instance.SpawnedEnemies.OfType<SCP999AI>()) { if (Vector3.Distance(((Component)item).transform.position, ((Component)__instance).transform.position) <= num2) { logger.LogDebug((object)(__instance.enemyType.enemyName + " took damage")); item.EnemyTookDamage(__instance); break; } } } catch (Exception ex) { logger.LogError((object)ex); } } } [HarmonyPatch(typeof(PlayerControllerB))] internal class PlayerControllerBPatch { private static ManualLogSource logger = Plugin.logger; [HarmonyPostfix] [HarmonyPatch("DamagePlayer")] private static void DamagePlayerPostfix(PlayerControllerB __instance) { try { if (StartOfRound.Instance.inShipPhase) { return; } foreach (SCP999AI item in RoundManager.Instance.SpawnedEnemies.OfType<SCP999AI>()) { if (((EnemyAI)item).currentBehaviourStateIndex == 2) { continue; } item.PlayerTookDamageRpc(__instance.actualClientId); break; } } catch (Exception ex) { logger.LogError((object)ex); } } [HarmonyPrefix] [HarmonyPatch("DamagePlayer")] private static bool DamagePlayerPrefix(PlayerControllerB __instance, CauseOfDeath causeOfDeath) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Invalid comparison between Unknown and I4 try { if ((int)causeOfDeath == 7) { foreach (SCP999AI item in RoundManager.Instance.SpawnedEnemies.OfType<SCP999AI>()) { if ((Object)(object)((EnemyAI)item).targetPlayer != (Object)null && (Object)(object)__instance == (Object)(object)((EnemyAI)item).targetPlayer && ((EnemyAI)item).currentBehaviourStateIndex == 2) { return false; } } } return true; } catch (Exception ex) { logger.LogError((object)ex); return true; } } } [HarmonyPatch(typeof(Turret))] internal class TurretPatch { private static ManualLogSource logger = Plugin.logger; [HarmonyPostfix] [HarmonyPatch("SwitchTurretMode")] private static void SwitchTurretModePostfix(Turret __instance) { //IL_0024: Unknown result type (might be due to inva