using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Logging; using Dawn; using Dawn.Utils; using Dusk; using GameNetcodeStuff; using HarmonyLib; using ItemSCPs.SCP; using LethalDiseases; using Microsoft.CodeAnalysis; using PSCPLibrary; using PSCPLibrary.Interfaces; using ProjectSCP.ItemSCPs.NetcodePatcher; using SnowyLib; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.Events; using UnityEngine.Rendering.HighDefinition; using WearableItemsAPI; [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.ItemSCPs")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("0.1.0.0")] [assembly: AssemblyInformationalVersion("0.1.0+619e763883d8af16c1005cf03e92ba4d8b37ea3c")] [assembly: AssemblyProduct("ItemSCPs")] [assembly: AssemblyTitle("ProjectSCP.ItemSCPs")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.1.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 static class Configs { public static void Init() { SCP3482Behavior.InitConfigs(); SCP420JBehavior.InitConfigs(); SCP498Behavior.InitConfigs(); SCP500Behavior.InitConfigs(); SCP689Behavior.InitConfigs(); SCP735Behavior.InitConfigs(); SCP983Behavior.InitConfigs(); } } public class ItemSCPsContentHandler : ContentHandler { public class ItemSCPsAssetsAssets : AssetBundleLoader { [LoadFromBundle("ItemSCPsNetworkHandler.prefab")] public GameObject NetworkHandlerPrefab { get; private set; } = null; [LoadFromBundle("SCPDatabase.asset")] public SCPDatabase SCPDatabase { get; private set; } = null; public ItemSCPsAssetsAssets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class SCP005Assets : AssetBundleLoader { public SCP005Assets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class SCP012Assets : AssetBundleLoader { public SCP012Assets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class SCP018Assets : AssetBundleLoader { public SCP018Assets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class SCP1025Assets : AssetBundleLoader { public SCP1025Assets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class SCP1079Assets : AssetBundleLoader { [LoadFromBundle("PinkBloodDecalProjector.prefab")] public GameObject PinkBloodDecalProjector { get; private set; } = null; [LoadFromBundle("PinkBloodDecal.mat")] public Material PinkBloodDecal { get; private set; } = null; public SCP1079Assets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class SCP207Assets : AssetBundleLoader { public SCP207Assets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class SCP268Assets : AssetBundleLoader { public SCP268Assets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class SCP3482Assets : AssetBundleLoader { [LoadFromBundle("SCP3482Overlay.prefab")] public GameObject Overlay { get; private set; } = null; public SCP3482Assets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class SCP420JAssets : AssetBundleLoader { public SCP420JAssets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class SCP498Assets : AssetBundleLoader { public SCP498Assets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class SCP500Assets : AssetBundleLoader { public SCP500Assets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class SCP689Assets : AssetBundleLoader { public SCP689Assets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class SCP714Assets : AssetBundleLoader { public SCP714Assets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class SCP735Assets : AssetBundleLoader { public SCP735Assets(DuskMod mod, string filePath) : base(mod, filePath) { } } public class SCP983Assets : AssetBundleLoader { [LoadFromBundle("LightFlash.prefab")] public GameObject LightFlashPrefab { get; private set; } = null; public SCP983Assets(DuskMod mod, string filePath) : base(mod, filePath) { } } public ItemSCPsAssetsAssets? ItemSCPsAssets; public SCP005Assets? SCP005; public SCP012Assets? SCP012; public SCP018Assets? SCP018; public SCP1025Assets? SCP1025; public SCP1079Assets? SCP1079; public SCP207Assets? SCP207; public SCP268Assets? SCP268; public SCP3482Assets? SCP3482; public SCP420JAssets? SCP420J; public SCP498Assets? SCP498; public SCP500Assets? SCP500; public SCP689Assets? SCP689; public SCP714Assets? SCP714; public SCP735Assets? SCP735; public SCP983Assets? SCP983; public ItemSCPsContentHandler(DuskMod mod) : base(mod) { ((ContentHandler)this).RegisterContent("itemscps_assets", ref ItemSCPsAssets, false); ((ContentHandler)this).RegisterContent("scp005", ref SCP005, false); ((ContentHandler)this).RegisterContent("scp012", ref SCP012, false); ((ContentHandler)this).RegisterContent("scp1025", ref SCP1025, false); ((ContentHandler)this).RegisterContent("scp1079", ref SCP1079, false); ((ContentHandler)this).RegisterContent("scp207", ref SCP207, false); ((ContentHandler)this).RegisterContent("scp268", ref SCP268, false); ((ContentHandler)this).RegisterContent("scp3482", ref SCP3482, false); ((ContentHandler)this).RegisterContent("scp420j", ref SCP420J, false); ((ContentHandler)this).RegisterContent("scp498", ref SCP498, false); ((ContentHandler)this).RegisterContent("scp500", ref SCP500, false); ((ContentHandler)this).RegisterContent("scp689", ref SCP689, false); ((ContentHandler)this).RegisterContent("scp714", ref SCP714, false); ((ContentHandler)this).RegisterContent("scp735", ref SCP735, false); ((ContentHandler)this).RegisterContent("scp983", ref SCP983, false); } } public static class ItemSCPsKeys { public static readonly NamespacedKey SCP005 = NamespacedKey.From("itemscps", "scpzerozerofive"); public static readonly NamespacedKey SCP012 = NamespacedKey.From("itemscps", "scpzeroonetwo"); public static readonly NamespacedKey SCP2071 = NamespacedKey.From("itemscps", "scptwozerosevenone"); public static readonly NamespacedKey SCP268 = NamespacedKey.From("itemscps", "scptwosixeight"); public static readonly NamespacedKey SCP420J = NamespacedKey.From("itemscps", "scpfourtwozeroj"); public static readonly NamespacedKey SCP498 = NamespacedKey.From("itemscps", "scpfournineeight"); public static readonly NamespacedKey SCP500 = NamespacedKey.From("itemscps", "scpfivezerozero"); public static readonly NamespacedKey SCP689 = NamespacedKey.From("itemscps", "scpsixeightnine"); public static readonly NamespacedKey SCP714 = NamespacedKey.From("itemscps", "scpsevenonefour"); public static readonly NamespacedKey SCP735 = NamespacedKey.From("itemscps", "scpseventhreefive"); public static readonly NamespacedKey SCP983 = NamespacedKey.From("itemscps", "scpnineeightthree"); public static readonly NamespacedKey SCP9831 = NamespacedKey.From("itemscps", "scpnineeightthreeone"); public static readonly NamespacedKey SCP1025 = NamespacedKey.From("itemscps", "scponezerotwofive"); public static readonly NamespacedKey SCP1079 = NamespacedKey.From("itemscps", "scponezerosevennine"); public static readonly NamespacedKey SCP3482 = NamespacedKey.From("itemscps", "scpthreefoureighttwo"); } internal class LethalDiseasesCompatibility { private static bool? _enabled; internal static bool enabled { get { if (!_enabled.HasValue) { _enabled = Chainloader.PluginInfos.ContainsKey("Snowlance.LethalDiseases"); } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static void InfectPlayer(PlayerControllerB player) { DiseaseAPI.Infect(player); } } internal class NetworkHandler : NetworkBehaviour { public enum SoundEffect { Sneeze, Cough, CoughHeavy } public AudioClip[] sneezeSFX = null; public AudioClip[] coughSFX = null; public AudioClip[] coughHeavySFX = null; public AudioClip[] heartbeatSlowSFX = null; public AudioClip[] heartbeatFastSFX = null; public static NetworkHandler Instance { get; private set; } public void Update() { SCP689Behavior.StaticUpdate(); SCP3482Behavior.StaticUpdate(); SCP207Behavior.StaticUpdate(); TESTING.Update(); } public override void OnNetworkSpawn() { if (((NetworkBehaviour)this).IsServer && (Object)(object)Instance != (Object)null) { ((Component)Instance).gameObject.GetComponent().Despawn(true); } Instance = this; Plugin.logger.LogDebug((object)"NetworkHandler spawned"); ((NetworkBehaviour)this).OnNetworkSpawn(); } [Rpc(/*Could not decode attribute arguments.*/)] public void PlayPlayerSoundEffectRpc(ulong clientId, SoundEffect soundEffect, int bodyPartIndex = 5, float volume = 1f, float min3DDistance = 1f, float max3DDistance = 10f, float cutoffFrequency = 22000f, int audibleNoiseID = 0) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: 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_010e: 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_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0161: 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)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(204303977u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, clientId); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref soundEffect, default(ForEnums)); BytePacker.WriteValueBitPacked(val2, bodyPartIndex); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref volume, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref min3DDistance, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref max3DDistance, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref cutoffFrequency, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val2, audibleNoiseID); ((NetworkBehaviour)this).__endSendRpc(ref val2, 204303977u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val4 = Plugin.PlayerFromId(clientId); if (!((Object)(object)val4 == (Object)null)) { Transform val5 = val4.bodyParts[bodyPartIndex]; AudioClip[] array; switch (soundEffect) { default: return; case SoundEffect.Sneeze: array = sneezeSFX; break; case SoundEffect.Cough: array = coughSFX; break; case SoundEffect.CoughHeavy: array = coughHeavySFX; break; } Utils.PlaySoundAtPosition(val5, array, volume, true, true, min3DDistance, max3DDistance, cutoffFrequency, audibleNoiseID); } } [Rpc(/*Could not decode attribute arguments.*/)] public void DropPinkBloodRpc(Vector3 pos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_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_00c6: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2577543608u, val3, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref pos); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2577543608u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; SCP1079Behavior.DropPinkBloodOnLocalClient(pos); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void AddPinkBloodToBodyRpc(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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2700347560u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, clientId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2700347560u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val4 = Plugin.PlayerFromId(clientId); if (!((Object)(object)val4 == (Object)null)) { SCP1079Behavior.AddPinkBloodToBodyOnLocalClient(val4); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void CreateLightFlashRpc(Vector3 position) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_010e: 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)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1843239011u, val3, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1843239011u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; GameObject val4 = ContentHandler.Instance.SCP983?.LightFlashPrefab; if ((Object)(object)val4 == (Object)null) { Plugin.logger.LogError((object)"Unable to get LightFlashPrefab in CreateLightFlash"); return; } Object.Instantiate(val4, position, Quaternion.identity); StunGrenadeItem.StunExplosion(((Component)this).transform.position, true, 1f, 10f, 1f, false, (PlayerControllerB)null, (PlayerControllerB)null, 0f); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //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 ((NetworkBehaviour)this).__registerRpc(204303977u, new RpcReceiveHandler(__rpc_handler_204303977), "PlayPlayerSoundEffectRpc"); ((NetworkBehaviour)this).__registerRpc(2577543608u, new RpcReceiveHandler(__rpc_handler_2577543608), "DropPinkBloodRpc"); ((NetworkBehaviour)this).__registerRpc(2700347560u, new RpcReceiveHandler(__rpc_handler_2700347560), "AddPinkBloodToBodyRpc"); ((NetworkBehaviour)this).__registerRpc(1843239011u, new RpcReceiveHandler(__rpc_handler_1843239011), "CreateLightFlashRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_204303977(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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong clientId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref clientId); SoundEffect soundEffect = default(SoundEffect); ((FastBufferReader)(ref reader)).ReadValueSafe(ref soundEffect, default(ForEnums)); int bodyPartIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref bodyPartIndex); float volume = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref volume, default(ForPrimitives)); float min3DDistance = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref min3DDistance, default(ForPrimitives)); float max3DDistance = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref max3DDistance, default(ForPrimitives)); float cutoffFrequency = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref cutoffFrequency, default(ForPrimitives)); int audibleNoiseID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref audibleNoiseID); target.__rpc_exec_stage = (__RpcExecStage)1; ((NetworkHandler)(object)target).PlayPlayerSoundEffectRpc(clientId, soundEffect, bodyPartIndex, volume, min3DDistance, max3DDistance, cutoffFrequency, audibleNoiseID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2577543608(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: 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_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 pos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pos); target.__rpc_exec_stage = (__RpcExecStage)1; ((NetworkHandler)(object)target).DropPinkBloodRpc(pos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2700347560(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; ((NetworkHandler)(object)target).AddPinkBloodToBodyRpc(clientId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1843239011(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: 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_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); target.__rpc_exec_stage = (__RpcExecStage)1; ((NetworkHandler)(object)target).CreateLightFlashRpc(position); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "NetworkHandler"; } } [HarmonyPatch] public class NetworkHandlerPatches { [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "Awake")] private static void AwakePostFix() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) if (Plugin.IsServerOrHost) { GameObject val = Object.Instantiate(ContentHandler.Instance.ItemSCPsAssets?.NetworkHandlerPrefab, Vector3.zero, Quaternion.identity); if (val != null) { val.GetComponent().Spawn(false); } } } } [BepInPlugin("ProjectSCP.ItemSCPs", "ItemSCPs", "0.1.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [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.ItemSCPs"); public static Plugin PluginInstance { get; private set; } public static ManualLogSource logger { get; private set; } public static DuskMod Mod { get; private set; } public static SCPDatabase SCPDatabase { get; private set; } public static PlayerControllerB localPlayer => StartOfRound.Instance.localPlayerController; public static bool IsServerOrHost => NetworkManager.Singleton.IsServer || NetworkManager.Singleton.IsHost; public static PlayerControllerB? PlayerFromId(ulong id) { return StartOfRound.Instance.allPlayerScripts.Where((PlayerControllerB x) => x.actualClientId == id).FirstOrDefault(); } private void Awake() { if ((Object)(object)PluginInstance == (Object)null) { PluginInstance = this; } logger = ((BaseUnityPlugin)PluginInstance).Logger; harmony.PatchAll(); AssetBundle val = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "itemscps_mainassets")); Mod = DuskMod.RegisterMod((BaseUnityPlugin)(object)this, val); Mod.RegisterContentHandlers(); SCPDatabase = ContentHandler.Instance.ItemSCPsAssets.SCPDatabase; SCPAPI.Register(SCPDatabase); Configs.Init(); InitializeNetworkBehaviours(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"ProjectSCP.ItemSCPs v0.1.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"); } } [HarmonyPatch] public class TESTING : MonoBehaviour { public static bool immunity { get; private set; } [HarmonyPostfix] [HarmonyPatch(typeof(HUDManager), "PingScan_performed")] public static void PingScan_performedPostFix() { } public static void Update() { } [HarmonyPrefix] [HarmonyPatch(typeof(HUDManager), "SubmitChat_performed")] public static void SubmitChat_performedPrefix(HUDManager __instance) { //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) try { if (!Utils.testing || !Plugin.IsServerOrHost) { return; } string text = __instance.chatTextField.text; string[] array = text.Split(" "); switch (array[0]) { case "/immunity": immunity = !immunity; HUDManager.Instance.DisplayTip("ItemSCPs", "Immunity: " + immunity, false, false, "LC_Tip1"); break; case "/immune": immunity = !immunity; HUDManager.Instance.DisplayTip("ItemSCPs", "Immunity: " + immunity, false, false, "LC_Tip1"); break; case "/testlight": { Vector3 position = ((Component)Plugin.localPlayer.bodyParts[5]).transform.position; NetworkHandler.Instance.CreateLightFlashRpc(position); break; } case "/disease": { if (array.Length != 1 && int.TryParse(array[1], out var result) && result <= 5 && result >= 0) { SCP1025Behavior.diseases[result](); } break; } case "/3482": SCP3482Behavior.localPlayerAffected = false; break; } } catch (Exception ex) { Plugin.logger.LogError((object)ex); } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "ProjectSCP.ItemSCPs"; public const string PLUGIN_NAME = "ItemSCPs"; public const string PLUGIN_VERSION = "0.1.0"; } } namespace ItemSCPs.SCP { internal class SCP005Behavior : PhysicsProp, ISCP, ISingletonItem { [SerializeField] private SCPInfo info = null; private const float unlockDistance = 1f; public SCPInfo SCPInfo => info; public void Awake() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).itemProperties.positionOffset = new Vector3(0f, 0.1f, 0f); ((GrabbableObject)this).itemProperties.rotationOffset = new Vector3(-90f, 0f, 0f); ((GrabbableObject)this).itemProperties.floorYOffset = 90; ((GrabbableObject)this).itemProperties.toolTips = new string[1] { "Use Key [LMB]" }; } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Expected O, but got Unknown //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemActivate(used, buttonDown); if (!buttonDown) { return; } RaycastHit[] array = Physics.SphereCastAll(new Ray(((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.position, ((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.forward), 1f); RaycastHit[] array2 = array; for (int i = 0; i < array2.Length; i++) { RaycastHit val = array2[i]; if (((Component)((RaycastHit)(ref val)).collider).CompareTag("PoweredObject")) { TerminalAccessibleObject component = ((Component)((RaycastHit)(ref val)).collider).gameObject.GetComponent(); if ((Object)(object)component != (Object)null && component.isBigDoor && !component.isDoorOpen) { component.SetDoorOpenServerRpc(true); } } DoorLock component2 = ((Component)((RaycastHit)(ref val)).transform).GetComponent(); if ((Object)(object)component2 != (Object)null && component2.isLocked && !component2.isPickingLock) { component2.UnlockDoorSyncWithServer(); } } foreach (MonoBehaviour item in Object.FindObjectsOfType().OfType()) { MonoBehaviour val2 = item; Vector3 val3 = ((Component)val2).gameObject.transform.position - ((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.position; if (((Vector3)(ref val3)).sqrMagnitude < 1f) { ((ISCP005Unlockable)val2).Unlock(); } } } protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } protected override void __initializeRpcs() { ((PhysicsProp)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SCP005Behavior"; } } internal class SCP012Behavior : PhysicsProp, ISCP, ISingletonItem { [SerializeField] private SCPInfo info = null; public AudioSource audioSource = null; public AudioSource audioSource2D = null; public AudioClip[] speechSFX = null; public AudioClip finalSpeechSFX = null; public AudioClip[] stabSFX = null; public Camera lightCamera = null; private int localPlayerStabAmount; private bool localPlayerPlayingFinalSpeech; private float timeSinceStartFinalSpeech; private float timeSinceSpeech; private float timeSinceIntervalUpdate; private float nextSpeechTime; private float distance; private float maxRange; private float minRange; private bool isOutside; private bool localPlayerAffected; private readonly BoundedRange speechInterval = new BoundedRange(10f, 15f); private readonly BoundedRange activationRange = new BoundedRange(3f, 10f); private const int speechDamage = 10; public SCPInfo SCPInfo => info; private bool isLit => IsLit(); private bool heldByLocalPlayer => (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)Plugin.localPlayer && !((GrabbableObject)this).isPocketed; public void Awake() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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) ((GrabbableObject)this).itemProperties.positionOffset = new Vector3(0f, 0.1f, -0.19f); ((GrabbableObject)this).itemProperties.rotationOffset = new Vector3(170f, 90f, 0f); ((GrabbableObject)this).itemProperties.floorYOffset = 90; ((GrabbableObject)this).itemProperties.canBeGrabbedBeforeGameStart = true; ((GrabbableObject)this).itemProperties.canBeInspected = true; ((GrabbableObject)this).itemProperties.twoHanded = false; lightCamera.clearFlags = (CameraClearFlags)2; lightCamera.backgroundColor = Color.black; lightCamera.cullingMask = 1 << LayerMask.NameToLayer("Props"); } public override void Update() { ((GrabbableObject)this).Update(); timeSinceStartFinalSpeech += Time.deltaTime; timeSinceSpeech += Time.deltaTime; timeSinceIntervalUpdate += Time.deltaTime; if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { isOutside = !((GrabbableObject)this).playerHeldBy.isInsideFactory; } if (timeSinceIntervalUpdate > 0.2f) { timeSinceIntervalUpdate = 0f; IntervalUpdate(); } if (localPlayerAffected && (Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null) { ForcePlayerMovementUpdate(); } } private void IntervalUpdate() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Invalid comparison between Unknown and I4 //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) distance = Vector3.Distance(((Component)this).transform.position, ((Component)Plugin.localPlayer).transform.position); if (!Plugin.localPlayer.criticallyInjured) { localPlayerStabAmount = 0; } bool flag = isOutside && (int)TimeOfDay.Instance.currentLevelWeather == 3; maxRange = (flag ? (activationRange.Max / 2f) : activationRange.Max); minRange = (flag ? (activationRange.Min / 2f) : activationRange.Min); localPlayerAffected = CanAffectPlayer(); audioSource.volume = (localPlayerAffected ? 1 : 0); audioSource.maxDistance = maxRange; if (!localPlayerAffected) { ResetVariables(); return; } if (!heldByLocalPlayer) { if (distance <= 1f && !Plugin.localPlayer.isGrabbingObjectAnimation && !Plugin.localPlayer.isTypingChat && !Plugin.localPlayer.inTerminalMenu && !Plugin.localPlayer.throwingObject && !Plugin.localPlayer.IsInspectingItem && !((Object)(object)Plugin.localPlayer.inAnimationWithEnemy != (Object)null) && !Plugin.localPlayer.jetpackControls && !Plugin.localPlayer.disablingJetpackControls && !StartOfRound.Instance.suckingPlayersOutOfShip && !Plugin.localPlayer.activatingItem && !Plugin.localPlayer.waitingToDropItem) { if (IsInventoryFull(Plugin.localPlayer)) { Plugin.localPlayer.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true); } Plugin.localPlayer.BeginGrabObject(); } return; } Plugin.localPlayer.activatingItem = true; Plugin.localPlayer.sprintMeter = 0f; Plugin.localPlayer.isExhausted = true; if (Plugin.localPlayer.health > 0) { VignetteOverlay.SetIntensity((float)(1 - Plugin.localPlayer.health / 100), 0.01f); } if (localPlayerPlayingFinalSpeech) { if (timeSinceStartFinalSpeech > finalSpeechSFX.length) { RoundManager.PlayRandomClip(audioSource, stabSFX, true, 1f, 0, 1000); Plugin.localPlayer.KillPlayer(Vector3.zero, true, (CauseOfDeath)14, 0, default(Vector3), false); Plugin.localPlayer.activatingItem = false; timeSinceStartFinalSpeech = 0f; localPlayerPlayingFinalSpeech = false; } } else if (timeSinceSpeech > nextSpeechTime) { timeSinceSpeech = 0f; nextSpeechTime = speechInterval.GetRandomInRange(Utils.randomLocal); DamageSelf(); } } private bool IsInventoryFull(PlayerControllerB player) { GrabbableObject[] itemSlots = player.ItemSlots; foreach (GrabbableObject val in itemSlots) { if ((Object)(object)val == (Object)null) { return false; } } return true; } public override void EquipItem() { ((PhysicsProp)this).EquipItem(); if (((NetworkBehaviour)this).IsOwner) { timeSinceSpeech = 0f; nextSpeechTime = 3f; Plugin.localPlayer.activatingItem = CanAffectPlayer(); } } public override void DiscardItem() { ResetVariables(); ((GrabbableObject)this).DiscardItem(); } private void DamageSelf() { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) localPlayerStabAmount++; int num = localPlayerStabAmount * 10; if (Plugin.localPlayer.health - num <= 0) { PlayFinalSpeech(); return; } RoundManager.PlayRandomClip(audioSource, stabSFX, true, 1f, 0, 1000); Plugin.localPlayer.inSpecialInteractAnimation = true; Plugin.localPlayer.DamagePlayer(num, true, true, (CauseOfDeath)14, 0, false, default(Vector3)); Plugin.localPlayer.inSpecialInteractAnimation = false; HUDManager.Instance.ShakeCamera((ScreenShakeType)1); if (!Plugin.localPlayer.criticallyInjured) { Plugin.localPlayer.MakeCriticallyInjured(true); } Plugin.localPlayer.drunkness = 0.3f; RoundManager.PlayRandomClip(audioSource2D, speechSFX, true, 1f, 0, 1000); } private void ForcePlayerMovementUpdate() { //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.InverseLerp(maxRange, minRange, distance); float num2 = num * num; VignetteOverlay.SetIntensity(num / 2f, 0.01f); Vector3 val; if (distance > 1f) { val = ((Component)this).transform.position - ((Component)Plugin.localPlayer.playerCollider).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; float num3 = num * Time.fixedDeltaTime; if (Vector3.Distance(((Component)Plugin.localPlayer.playerCollider).transform.position, ((Component)this).transform.position) > num3) { Transform transform = ((Component)Plugin.localPlayer.playerCollider).transform; transform.position += normalized * num3; } else { ((Component)Plugin.localPlayer.playerCollider).transform.position = ((Component)this).transform.position; } } float num4 = Mathf.Clamp(Time.deltaTime, 0f, 0.1f); Vector3 val2 = ((Component)this).transform.position - Plugin.localPlayer.thisPlayerBody.position; val2.y = 0f; if (((Vector3)(ref val2)).sqrMagnitude > 0.001f) { Quaternion val3 = Quaternion.LookRotation(((Vector3)(ref val2)).normalized); Plugin.localPlayer.thisPlayerBody.rotation = Quaternion.Slerp(Plugin.localPlayer.thisPlayerBody.rotation, val3, num2 * num4); } val = ((Component)this).transform.position - ((Component)Plugin.localPlayer.gameplayCamera).transform.position; Vector3 normalized2 = ((Vector3)(ref val)).normalized; float num5 = (0f - Mathf.Asin(normalized2.y)) * 57.29578f; Plugin.localPlayer.cameraUp = Mathf.Lerp(Plugin.localPlayer.cameraUp, num5, num2 * num4); Plugin.localPlayer.cameraUp = Mathf.Clamp(Plugin.localPlayer.cameraUp, -89f, 89f); ((Component)Plugin.localPlayer.gameplayCamera).transform.localEulerAngles = new Vector3(Plugin.localPlayer.cameraUp, ((Component)Plugin.localPlayer.gameplayCamera).transform.localEulerAngles.y, 0f); } private bool CanAffectPlayer() { //IL_00e8: Unknown result type (might be due to invalid IL or missing references) if (SCP714Behavior.localPlayerAffected) { return false; } if (TESTING.immunity) { return false; } if (localPlayerPlayingFinalSpeech) { return true; } if (StartOfRound.Instance.inShipPhase && !Utils.inTestRoom) { return false; } if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)Plugin.localPlayer != (Object)(object)((GrabbableObject)this).playerHeldBy) { return false; } if (((GrabbableObject)this).isPocketed) { return false; } if (heldByLocalPlayer) { return isLit; } if (distance > maxRange) { return false; } if (!isLit) { return false; } if (!Plugin.localPlayer.HasLineOfSightToPosition(((Component)this).transform.position, 45f, 60, -1f, -1)) { return false; } return true; } private void PlayFinalSpeech() { localPlayerPlayingFinalSpeech = true; timeSinceStartFinalSpeech = 0f; audioSource2D.pitch = Random.Range(0.94f, 1.06f); audioSource2D.PlayOneShot(finalSpeechSFX); } private void ResetVariables() { if (heldByLocalPlayer && Plugin.localPlayer.activatingItem) { Plugin.localPlayer.activatingItem = false; } timeSinceSpeech = 0f; localPlayerPlayingFinalSpeech = false; timeSinceStartFinalSpeech = 0f; localPlayerStabAmount = 0; } public bool IsLit() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) lightCamera.Render(); RenderTexture.active = lightCamera.targetTexture; Texture2D val = new Texture2D(32, 32, (TextureFormat)3, false); val.ReadPixels(new Rect(0f, 0f, 32f, 32f), 0, 0); val.Apply(); Color[] pixels = val.GetPixels(); float num = 0f; Color[] array = pixels; for (int i = 0; i < array.Length; i++) { Color val2 = array[i]; num += ((Color)(ref val2)).grayscale; } float num2 = num / (float)pixels.Length; Plugin.logger.LogDebug((object)num2); return num2 > 0.015f; } protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } protected override void __initializeRpcs() { ((PhysicsProp)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SCP012Behavior"; } } internal class SCP1025Behavior : PhysicsProp, ISCP, ISingletonItem { [SerializeField] private SCPInfo info = null; public Animator animator = null; public Material[] diseasePageMaterials = null; public SkinnedMeshRenderer renderer = null; public static readonly Action[] diseases = new Action[6] { delegate { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Expected O, but got Unknown //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Expected O, but got Unknown float num = Random.Range(1200, 1800); Utils.DisplayStatusEffect("Minor respiratory infection detected"); PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new RandomIntervalActionEffect(new BoundedRange(60f, 200f), (Action)delegate { NetworkHandler.Instance.PlayPlayerSoundEffectRpc(Plugin.localPlayer.actualClientId, NetworkHandler.SoundEffect.Sneeze, 0, 0.5f, 1f, 10f, 1500f); Plugin.localPlayer.playQuickSpecialAnimation(1f); Plugin.localPlayer.playerBodyAnimator.SetTrigger("SA_PushLeverBack"); }, "scp1025", "sneeze", num, (Func)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)((incoming.duration > existing.timeLeft) ? 1 : 2)), (Action)null, true, true, true)); PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new LerpValueEffect((Action)delegate(float x) { Plugin.localPlayer.sprintMultiplier = Mathf.Clamp(Plugin.localPlayer.sprintMultiplier, 0f, x); }, 1.7f, 2.5f, num, "scp1025", "sprintMultiplier", (Func)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)((incoming.duration > existing.timeLeft) ? 1 : 2)), (Action)null, true, true, true)); PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new LerpValueEffect((Action)delegate(float x) { Plugin.localPlayer.sprintMeter = Mathf.Clamp(Plugin.localPlayer.sprintMeter, 0f, x); }, 0.7f, 1f, num, "scp1025", "sprintMeter", (Func)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)((incoming.duration > existing.timeLeft) ? 1 : 2)), (Action)null, true, true, true)); }, delegate { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Expected O, but got Unknown //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Expected O, but got Unknown //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Expected O, but got Unknown float num = Random.Range(1800, 3000); PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new LerpValueEffect((Action)delegate(float x) { Plugin.localPlayer.sprintMeter = Mathf.Clamp(Plugin.localPlayer.sprintMeter, 0f, x); }, 0.7f, 1f, num, "scp1025", "sprintMeter", (Func)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)((incoming.duration > existing.timeLeft) ? 1 : 2)), (Action)null, true, true, true)); PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new RandomIntervalActionEffect(new BoundedRange(30f, 120f), (Action)delegate { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) Utils.DisplayStatusEffect("Localized skin inflammation detected"); Plugin.localPlayer.DamagePlayer(1, false, true, (CauseOfDeath)0, 0, false, default(Vector3)); }, "scp1025", "chickenpox itch", num, (Func)null, (Action)null, true, true, true)); PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new TickActionEffect((Action)delegate { Plugin.localPlayer.healthRegenerateTimer = 1f; }, "scp1025", "healthRegenerateTimer", num, (Func)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)((incoming.duration > existing.timeLeft) ? 1 : 2)), (Action)null, true, true, true)); }, delegate { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Expected O, but got Unknown //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Expected O, but got Unknown PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new RandomIntervalActionEffect(new BoundedRange(30f, 120f), (Action)delegate { //IL_008c: 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) Plugin.localPlayer.playQuickSpecialAnimation(1.5f); Plugin.localPlayer.playerBodyAnimator.SetTrigger("SA_Typing"); NetworkHandler.Instance.PlayPlayerSoundEffectRpc(Plugin.localPlayer.actualClientId, NetworkHandler.SoundEffect.CoughHeavy, 0, 0.5f, 1f, 10f, 1500f); VignetteOverlay.SetIntensity(0.2f, 0.01f); if (Plugin.localPlayer.health > 1) { Plugin.localPlayer.inSpecialInteractAnimation = true; Plugin.localPlayer.DamagePlayer(1, false, true, (CauseOfDeath)0, 0, false, default(Vector3)); Plugin.localPlayer.inSpecialInteractAnimation = false; } }, "scp1025", "lung cancer coughHeavy", 0f, (Func)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)((incoming.duration > existing.timeLeft) ? 1 : 2)), (Action)null, true, true, true)); PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new RandomIntervalActionEffect(new BoundedRange(15f, 40f), (Action)delegate { NetworkHandler.Instance.PlayPlayerSoundEffectRpc(Plugin.localPlayer.actualClientId, NetworkHandler.SoundEffect.Cough, 0, 0.5f, 1f, 10f, 1500f); VignetteOverlay.SetIntensity(0.05f, 0.01f); }, "scp1025", "lung cancer cough", 0f, (Func)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)((incoming.duration > existing.timeLeft) ? 1 : 2)), (Action)null, true, true, true)); }, delegate { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown float num = Random.Range(600, 1200); PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new RandomIntervalActionEffect(new BoundedRange(30f, 200f), (Action)delegate { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) Plugin.localPlayer.DamagePlayer(1, true, true, (CauseOfDeath)0, 0, false, default(Vector3)); }, "scp1025", "appendicitis pain", num, (Func)null, (Action)null, true, true, true)); PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new LerpValueEffect((Action)delegate(float x) { Plugin.localPlayer.sprintMultiplier = Mathf.Clamp(Plugin.localPlayer.sprintMultiplier, 0f, x); }, 1f, 2.5f, num, "scp1025", "sprintMultiplier", (Func)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)((incoming.duration > existing.timeLeft) ? 1 : 2)), (Action)null, true, true, true)); }, delegate { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Expected O, but got Unknown PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new TickActionEffect((Action)delegate { float num = Mathf.Lerp(1f, 2.5f, Plugin.localPlayer.sprintMeter); Plugin.localPlayer.sprintMultiplier = Mathf.Clamp(Plugin.localPlayer.sprintMultiplier, 0f, num); }, "scp1025", "sprintMultiplier", 0f, (Func)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)((incoming.duration > existing.timeLeft && incoming.source == existing.source) ? 1 : 2)), (Action)null, true, true, true)); PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new ConditionalActionEffect((Func)(() => Plugin.localPlayer.sprintMeter < 0.5f), (Action)delegate { if (Random.Range(0, 2) != 0) { NetworkHandler.Instance.PlayPlayerSoundEffectRpc(Plugin.localPlayer.actualClientId, NetworkHandler.SoundEffect.Cough, 0, 0.5f, 1f, 10f, 1500f); VignetteOverlay.SetIntensity(0.05f, 0.01f); } }, false, "scp1025", 5f, 0, "asthmaCough", 0f, (Func)null, (Action)null, true, true, true)); }, delegate { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new RandomIntervalActionEffect(new BoundedRange(10f, 20f), (Action)delegate { Utils.DisplayStatusEffect("WARNING: Heart rate unstable"); VignetteOverlay.SetIntensity(0.4f, 0.01f); Utils.PlaySoundAtPosition(Plugin.localPlayer.bodyParts[0], NetworkHandler.Instance.heartbeatSlowSFX, 0.7f, true, true, 1f, 10f, 22000f, -1); }, "scp1025", "heartbeatSlow", 0f, (Func)null, (Action)null, true, true, true)); PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new OnRemoveActionEffect((Action)delegate(StatusEffect effect) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown if (effect.timeExpired) { Utils.DisplayStatusEffect("WARNING: HEART RATE CRITICALLY UNSTABLE. CIRCULATORY FAILURE IMMINENT."); PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new OnRemoveActionEffect((Action)delegate(StatusEffect val) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) if (val.timeExpired && !Plugin.localPlayer.isPlayerDead) { Plugin.localPlayer.KillPlayer(Vector3.zero, true, (CauseOfDeath)0, 0, default(Vector3), false); } }, "scp1025", "heart attack", 6f, (Func)null, true, true, true)); PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new LerpValueEffect((Action)delegate(float x) { VignetteOverlay.SetIntensity(x, 0.01f); }, 0.1f, 1f, 5f, "scp1025", "vignette", (Func)null, (Action)null, true, true, true)); Utils.PlaySoundAtPosition(Plugin.localPlayer.bodyParts[0], NetworkHandler.Instance.heartbeatFastSFX, 1f, true, true, 1f, 10f, 22000f, -1); Plugin.localPlayer.MakeCriticallyInjured(true); Plugin.localPlayer.bleedingHeavily = false; Plugin.localPlayer.sprintMeter = 0f; } }, "scp1025", "incoming heart attack", 60f, (Func)null, true, true, true)); } }; public SCPInfo SCPInfo => info; public void Awake() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).itemProperties.positionOffset = new Vector3(0.1f, 0.13f, -0.19f); ((GrabbableObject)this).itemProperties.rotationOffset = new Vector3(180f, 90f, 0f); ((GrabbableObject)this).itemProperties.floorYOffset = 90; ((GrabbableObject)this).itemProperties.canBeInspected = true; ((GrabbableObject)this).itemProperties.canBeGrabbedBeforeGameStart = true; ((GrabbableObject)this).itemProperties.toolTips = new string[1] { "Open Book [LMB]" }; } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (buttonDown) { OpenBook(); } } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); CloseBookRpc(); } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); CloseBookRpc(); } private void OpenBook() { int num = Random.Range(0, diseases.Length); OpenBookRpc(num); if (!TESTING.immunity && !SCP714Behavior.localPlayerAffected) { if (LethalDiseasesCompatibility.enabled) { LethalDiseasesCompatibility.InfectPlayer(Plugin.localPlayer); } else { diseases[num](); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void CloseBookRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3622137458u, val3, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3622137458u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; animator.SetBool("open", false); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void OpenBookRpc(int pageIndex) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(4082232844u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, pageIndex); ((NetworkBehaviour)this).__endSendRpc(ref val2, 4082232844u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Material[] materials = ((Renderer)renderer).materials; materials[2] = diseasePageMaterials[pageIndex]; ((Renderer)renderer).materials = materials; animator.SetBool("open", true); } } } protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3622137458u, new RpcReceiveHandler(__rpc_handler_3622137458), "CloseBookRpc"); ((NetworkBehaviour)this).__registerRpc(4082232844u, new RpcReceiveHandler(__rpc_handler_4082232844), "OpenBookRpc"); ((PhysicsProp)this).__initializeRpcs(); } private static void __rpc_handler_3622137458(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; ((SCP1025Behavior)(object)target).CloseBookRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4082232844(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 pageIndex = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref pageIndex); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP1025Behavior)(object)target).OpenBookRpc(pageIndex); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SCP1025Behavior"; } } internal class SCP1079Behavior : PhysicsProp, ISCP, ISingletonItem { [SerializeField] private SCPInfo info = null; public AudioClip[] chewingSounds = null; public GameObject pinkBloodSplatterProjectorPrefab = null; public AudioClip sizzleSFX = null; public static Dictionary> PlayerPinkBodyBloodDecals = new Dictionary>(); private static int candiesEatenByLocalPlayer = 0; private float timeSinceCandyDecrement; public SCPInfo SCPInfo => info; public void Awake() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).itemProperties.positionOffset = new Vector3(0.05f, 0.11f, -0.05f); ((GrabbableObject)this).itemProperties.rotationOffset = new Vector3(180f, 90f, -15f); ((GrabbableObject)this).itemProperties.floorYOffset = 90; ((GrabbableObject)this).itemProperties.canBeGrabbedBeforeGameStart = true; ((GrabbableObject)this).itemProperties.canBeInspected = true; ((GrabbableObject)this).itemProperties.toolTips = new string[1] { "Eat Candy [LMB]" }; } public override void Update() { ((GrabbableObject)this).Update(); if (candiesEatenByLocalPlayer > 0) { timeSinceCandyDecrement += Time.deltaTime; if (timeSinceCandyDecrement > 60f) { timeSinceCandyDecrement = 0f; candiesEatenByLocalPlayer--; } } } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Expected O, but got Unknown ((GrabbableObject)this).ItemActivate(used, buttonDown); if (!buttonDown) { return; } RoundManager.PlayRandomClip(((GrabbableObject)this).playerHeldBy.itemAudio, chewingSounds, true, 1f, 0, 1000); candiesEatenByLocalPlayer++; if (TESTING.immunity) { return; } int bloodDropAmount = 2 * candiesEatenByLocalPlayer; AudioClip val = sizzleSFX; PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new OnRemoveActionEffect((Action)delegate(StatusEffect effect) { //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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got Unknown //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Expected O, but got Unknown //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Expected O, but got Unknown //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Expected O, but got Unknown if (effect.timeExpired) { float num = Mathf.Clamp01(0.5f + (float)candiesEatenByLocalPlayer * 0.15f); Plugin.logger.LogDebug((object)$"Peak sizzle: {num}"); AnimationCurve val2 = new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, 0f), new Keyframe(1f, num), new Keyframe(0f, 0f) }); Plugin.localPlayer.itemAudio.clip = sizzleSFX; Plugin.localPlayer.itemAudio.volume = 0.5f; Plugin.localPlayer.itemAudio.Play(); PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new CurveValueEffect((Action)delegate(float value) { Plugin.localPlayer.itemAudio.volume = value; }, val2, 10f, "SCP-1079", "Blood Boiling", (Func)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)1), (Action)delegate { Plugin.localPlayer.itemAudio.volume = 1f; }, true, true, true)); PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new DistributedActionEffect((Action)delegate { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) Plugin.logger.LogDebug((object)"Dropping blood"); Vector3 floorPosition = Vector3Extensions.GetFloorPosition(((Component)Plugin.localPlayer.gameplayCamera).transform.position, 0f); NetworkHandler.Instance.DropPinkBloodRpc(floorPosition); }, bloodDropAmount, "SCP-1079", "Dropping Pink Blood", 10f, (Func)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)1), (Action)null, true, true, true)); NetworkHandler.Instance.AddPinkBloodToBodyRpc(Plugin.localPlayer.actualClientId); int damagePerSecond = Mathf.RoundToInt(Mathf.Pow(2.5f, (float)candiesEatenByLocalPlayer) / 10f); if (damagePerSecond != 0) { Plugin.logger.LogDebug((object)$"Doing {damagePerSecond} damage per second"); PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new IntervalActionEffect(1f, (Action)delegate { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) Plugin.localPlayer.inSpecialInteractAnimation = true; Plugin.localPlayer.DamagePlayer(damagePerSecond, false, true, (CauseOfDeath)0, 0, false, default(Vector3)); Plugin.localPlayer.inSpecialInteractAnimation = false; Plugin.localPlayer.bleedingHeavily = false; }, "SCP-1079", "Blood Loss Damage", 10f, (Func)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)1), (Action)null, true, true, true)); } } }, "SCP-1079", "Pink Blood Secretion", Random.Range(10f, 15f), (Func)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)1), true, true, true)); } public static void DropPinkBloodOnLocalClient(Vector3 pos) { //IL_0037: 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) GameObject val = ContentHandler.Instance.SCP1079?.PinkBloodDecalProjector; if ((Object)(object)val == (Object)null) { Plugin.logger.LogError((object)"PinkBloodSplatterProjector is null"); return; } GameObject val2 = Object.Instantiate(val, pos, val.transform.rotation); DecalProjector component = val2.GetComponent(); ((Behaviour)component).enabled = true; Object.Destroy((Object)(object)val2, 300f); } public static void AddPinkBloodToBodyOnLocalClient(PlayerControllerB player) { Material val = ContentHandler.Instance.SCP1079?.PinkBloodDecal; if ((Object)(object)val == (Object)null) { Plugin.logger.LogError((object)"Couldnt get pinkBloodDecal in content container"); return; } if (!PlayerPinkBodyBloodDecals.ContainsKey(player)) { Plugin.logger.LogDebug((object)"No pink blood decals in dictionary, adding them"); PlayerPinkBodyBloodDecals.Add(player, new List()); GameObject[] bodyBloodDecals = player.bodyBloodDecals; foreach (GameObject val2 in bodyBloodDecals) { GameObject val3 = Object.Instantiate(val2, val2.transform.parent); ((Object)val3).name = "Pink" + ((Object)val2).name; val3.GetComponent().material = val; PlayerPinkBodyBloodDecals[player].Add(val3); } } foreach (GameObject item in PlayerPinkBodyBloodDecals[player]) { if (!item.activeSelf) { item.SetActive(true); } } } protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } protected override void __initializeRpcs() { ((PhysicsProp)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SCP1079Behavior"; } } [HarmonyPatch] internal class SCP1079Patches { [HarmonyPostfix] [HarmonyPatch(typeof(PlayerControllerB), "ResetPlayerBloodObjects")] private static void PlayerControllerB_ResetPlayerBloodObjects_Postfix(PlayerControllerB __instance, bool resetBodyBlood) { try { if (!resetBodyBlood || !SCP1079Behavior.PlayerPinkBodyBloodDecals.ContainsKey(__instance)) { return; } foreach (GameObject item in SCP1079Behavior.PlayerPinkBodyBloodDecals[__instance]) { item.SetActive(false); } } catch (Exception ex) { Plugin.logger.LogError((object)ex); } } [HarmonyPostfix] [HarmonyPatch(typeof(PlayerControllerB), "RemoveBloodFromBody")] private static void PlayerControllerB_RemoveBloodFromBody_Postfix(PlayerControllerB __instance) { try { if (!SCP1079Behavior.PlayerPinkBodyBloodDecals.ContainsKey(__instance)) { return; } foreach (GameObject item in SCP1079Behavior.PlayerPinkBodyBloodDecals[__instance]) { item.SetActive(false); } } catch (Exception ex) { Plugin.logger.LogError((object)ex); } } } internal class SCP207Behavior : PhysicsProp, ISCP { [SerializeField] private SCPInfo info = null; public AudioSource audioSource = null; public GameObject capObject = null; public AnimationCurve intensityOverTime = null; public MeshRenderer liquidRenderer = null; public static Dictionary contributions = new Dictionary(); public static int previousContributionsID = 0; public static bool heartAttackLocalPlayer = false; private PlayerControllerB previousPlayerHeldBy = null; private bool drinking; private float drinkAmountLeft; private float drinkingTime; private Coroutine? drinkingRoutine; private static float totalContributions; private Vector3 drinkingPositionOffset = new Vector3(0f, 0.1f, 0.1f); private Vector3 drinkingRotationOffset = new Vector3(50f, 170f, 0f); private Vector3 currentPositionOffset; private Vector3 currentRotationOffset; private const float effectDuration = 1200f; private const float drinkTimePerBottle = 10f; private const float maxSprintIncreaseBeforeHeartAttack = 9f; public SCPInfo SCPInfo => info; public void Awake() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).itemProperties.positionOffset = new Vector3(-0.07f, 0.1f, -0.01f); ((GrabbableObject)this).itemProperties.rotationOffset = new Vector3(80f, 90f, 0f); ((GrabbableObject)this).itemProperties.floorYOffset = 90; currentPositionOffset = ((GrabbableObject)this).itemProperties.positionOffset; currentRotationOffset = ((GrabbableObject)this).itemProperties.rotationOffset; ((GrabbableObject)this).itemProperties.grabAnim = "HoldPatcherTool"; ((GrabbableObject)this).itemProperties.syncUseFunction = true; ((GrabbableObject)this).itemProperties.toolTips = new string[1] { "Drink [Hold LMB]" }; } public override void Start() { ((GrabbableObject)this).Start(); drinkAmountLeft = 10f; } public static void StaticUpdate() { //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Expected O, but got Unknown totalContributions = GetTotalContributions(); if (totalContributions <= 0f) { return; } float num = Mathf.Clamp01(totalContributions / 9f); Plugin.localPlayer.sprintTime = Mathf.Max(11f + totalContributions, Plugin.localPlayer.sprintTime); Plugin.localPlayer.sprintMeter = Mathf.Clamp01(Plugin.localPlayer.sprintMeter + Time.deltaTime / (Plugin.localPlayer.sprintTime + Mathf.Lerp(15f, 5f, num))); Plugin.localPlayer.sprintMultiplier = Mathf.Max(Plugin.localPlayer.sprintMultiplier, Mathf.Lerp(1f, 3f, num)); if (!(totalContributions > 9f) || heartAttackLocalPlayer) { return; } Plugin.logger.LogDebug((object)$"Total contributions {totalContributions} > {9f}, heart attack time"); heartAttackLocalPlayer = true; Utils.PlaySoundAtPosition(Plugin.localPlayer.bodyParts[0], NetworkHandler.Instance.heartbeatFastSFX, 1f, true, true, 1f, 10f, 22000f, -1); PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new OnRemoveActionEffect((Action)delegate(StatusEffect effect) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) heartAttackLocalPlayer = false; if (effect.timeExpired && !Plugin.localPlayer.isPlayerDead && Plugin.localPlayer.isPlayerControlled) { Plugin.localPlayer.KillPlayer(Vector3.zero, true, (CauseOfDeath)0, 0, default(Vector3), false); } }, "scp207", "heart attack", 6f, (Func)null, true, true, true)); } public override void Update() { ((GrabbableObject)this).Update(); if (!drinking) { return; } drinkAmountLeft -= Time.deltaTime; drinkingTime += Time.deltaTime; if (!(drinkAmountLeft <= 0f)) { return; } StopDrinkRoutine(); if (((NetworkBehaviour)this).IsOwner) { if (drinkingTime > 0f && !TESTING.immunity) { ApplyEffect(drinkingTime); } previousPlayerHeldBy.activatingItem = false; previousPlayerHeldBy.playerBodyAnimator.SetBool("useTZPItem", false); } } public override void LateUpdate() { //IL_001e: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((GrabbableObject)this).parentObject != (Object)null) { ((Component)this).transform.rotation = ((GrabbableObject)this).parentObject.rotation; ((Component)this).transform.Rotate(currentRotationOffset); ((Component)this).transform.position = ((GrabbableObject)this).parentObject.position; Vector3 val = currentPositionOffset; val = ((GrabbableObject)this).parentObject.rotation * val; Transform transform = ((Component)this).transform; transform.position += val; } if (((GrabbableObject)this).rotateObject) { ((Component)this).transform.Rotate(new Vector3(0f, Time.deltaTime * 60f, 0f), (Space)0); } if ((Object)(object)((GrabbableObject)this).radarIcon != (Object)null) { ((GrabbableObject)this).radarIcon.position = ((Component)this).transform.position; } } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); previousPlayerHeldBy.activatingItem = false; previousPlayerHeldBy.playerBodyAnimator.SetBool("useTZPItem", false); StopDrinkRoutine(); } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); capObject.SetActive(false); if (buttonDown) { previousPlayerHeldBy = ((GrabbableObject)this).playerHeldBy; drinkingTime = 0f; if (drinkAmountLeft <= 0f) { if (((NetworkBehaviour)this).IsOwner) { previousPlayerHeldBy.playerBodyAnimator.SetTrigger("shakeItem"); } return; } StopDrinkRoutine(); drinkingRoutine = ((MonoBehaviour)this).StartCoroutine(DrinkRoutine()); } else { StopDrinkRoutine(); if (((NetworkBehaviour)this).IsOwner && drinkingTime > 0f && !TESTING.immunity) { ApplyEffect(drinkingTime); } } if (((NetworkBehaviour)this).IsOwner) { previousPlayerHeldBy.activatingItem = buttonDown; previousPlayerHeldBy.playerBodyAnimator.SetBool("useTZPItem", buttonDown); } } private void StopDrinkRoutine() { //IL_002b: 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_003c: 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) if (drinkingRoutine != null) { ((MonoBehaviour)this).StopCoroutine(drinkingRoutine); drinkingRoutine = null; } currentRotationOffset = ((GrabbableObject)this).itemProperties.rotationOffset; currentPositionOffset = ((GrabbableObject)this).itemProperties.positionOffset; drinking = false; audioSource.Stop(); ((Renderer)liquidRenderer).enabled = drinkAmountLeft > 0f; } private IEnumerator DrinkRoutine() { float elapsedTime = 0f; while (elapsedTime < 1f) { elapsedTime += Time.deltaTime; float t = Mathf.Clamp01(elapsedTime / 0.5f); currentPositionOffset = Vector3.Lerp(((GrabbableObject)this).itemProperties.positionOffset, drinkingPositionOffset, t); currentRotationOffset = Vector3.Lerp(((GrabbableObject)this).itemProperties.rotationOffset, drinkingRotationOffset, t); yield return null; } drinking = true; if (((NetworkBehaviour)this).IsOwner) { audioSource.Play(); } drinkingRoutine = null; } private void ApplyEffect(float amount) { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Expected O, but got Unknown int id = previousContributionsID; previousContributionsID++; contributions[id] = 0f; PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new CurveValueEffect((Action)delegate(float value) { contributions[id] = Mathf.Lerp(0f, amount, value); }, intensityOverTime, 1200f, "scp207", $"scp207_{id}", (Func)null, (Action)delegate { contributions.Remove(id); }, true, true, true)); PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new ConditionalActionEffect((Func)(() => GetTotalContributions() > 4.5f), (Action)delegate { Utils.PlaySoundAtPosition(Plugin.localPlayer.bodyParts[0], NetworkHandler.Instance.heartbeatSlowSFX, 1f, true, true, 1f, 10f, 22000f, -1); }, false, "scp207", 30f, 0, "scp207_heartbeatSlow", 1200f, (Func)null, (Action)null, true, true, true)); } private static float GetTotalContributions() { float num = 0f; foreach (float value in contributions.Values) { num += value; } return num; } protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } protected override void __initializeRpcs() { ((PhysicsProp)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SCP207Behavior"; } } public class SCP268Behavior : WearableObject, ISCP, ISingletonItem { [SerializeField] private SCPInfo info = null; public AudioSource audioSource = null; public AudioClip activateSFX = null; public AudioClip deactivateSFX = null; public GameObject mesh = null; private bool playerWearingInvisible; public SCPInfo SCPInfo => info; public static SCP268Behavior? Instance { get; private set; } public void Awake() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_0080: 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) ((GrabbableObject)this).itemProperties.positionOffset = new Vector3(0f, 0.15f, -0.17f); ((GrabbableObject)this).itemProperties.rotationOffset = new Vector3(90f, 0f, -105f); ((GrabbableObject)this).itemProperties.floorYOffset = 90; base.wearableItemProperties.wornPositionOffset = new Vector3(0f, 0.27f, 0.07f); base.wearableItemProperties.wornRotationOffset = new Vector3(-30f, 0f, 0f); } public override void OnNetworkPostSpawn() { ((NetworkBehaviour)this).OnNetworkPostSpawn(); if (Instance == null) { Instance = this; } } public override void OnNetworkDespawn() { if ((Object)(object)Instance == (Object)(object)this) { Instance = null; } ((NetworkBehaviour)this).OnNetworkDespawn(); } public override void Update() { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) ((WearableObject)this).Update(); if (!((Object)(object)((WearableObject)this).playerWornBy != (Object)null)) { return; } PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (!((Object)(object)val != (Object)(object)Plugin.localPlayer) && !((Object)(object)val == (Object)(object)((WearableObject)this).playerWornBy) && !TESTING.immunity && !SCP714Behavior.localPlayerAffected) { bool playerInvisible = !TESTING.immunity && !SCP714Behavior.localPlayerAffected && (!PlayerSpeaking() || !((WearableObject)this).playerWornBy.HasLineOfSightToPosition(Plugin.localPlayer.bodyParts[0].position, 35f, 60, -1f, -1)); SetPlayerInvisible(playerInvisible); } } } private bool PlayerSpeaking() { return (Object)(object)((WearableObject)this).playerWornBy != (Object)null && PlayerControllerBExtensions.IsPlayerSpeaking(((WearableObject)this).playerWornBy, 0.005f, true); } private void SetPlayerInvisible(bool value) { if (playerWearingInvisible != value && !((Object)(object)((WearableObject)this).playerWornBy == (Object)null)) { PlayerControllerBExtensions.MakePlayerInvisible(((WearableObject)this).playerWornBy, value); mesh.SetActive(value); playerWearingInvisible = value; } } public override void OnWear() { ((WearableObject)this).OnWear(); if ((Object)(object)Plugin.localPlayer == (Object)(object)((WearableObject)this).playerWornBy) { audioSource.PlayOneShot(activateSFX); } } public override void OnUnWear() { if ((Object)(object)Plugin.localPlayer == (Object)(object)((WearableObject)this).playerWornBy) { audioSource.PlayOneShot(deactivateSFX); } SetPlayerInvisible(value: false); ((WearableObject)this).OnUnWear(); } protected override void __initializeVariables() { ((WearableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((WearableObject)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SCP268Behavior"; } } [HarmonyPatch] internal static class SCP268Patches { [HarmonyPostfix] [HarmonyPatch(typeof(EnemyAI), "GetAllPlayersInLineOfSight")] private static void EnemyAI_GetAllPlayersInLineOfSight_Postfix(EnemyAI __instance, ref PlayerControllerB[] __result) { try { if (!((Object)(object)SCP268Behavior.Instance == (Object)null) && !((Object)(object)((WearableObject)SCP268Behavior.Instance).playerWornBy == (Object)null) && __result != null) { __result = __result.Where((PlayerControllerB x) => (Object)(object)x != (Object)(object)((WearableObject)SCP268Behavior.Instance).playerWornBy).ToArray(); } } catch (Exception ex) { Plugin.logger.LogError((object)ex); } } [HarmonyPostfix] [HarmonyPatch(typeof(EnemyAI), "CheckLineOfSightForPlayer")] private static void EnemyAI_CheckLineOfSightForPlayer_Postfix(EnemyAI __instance, ref PlayerControllerB __result) { try { if (!((Object)(object)SCP268Behavior.Instance == (Object)null) && !((Object)(object)((WearableObject)SCP268Behavior.Instance).playerWornBy == (Object)null) && (Object)(object)((WearableObject)SCP268Behavior.Instance).playerWornBy == (Object)(object)__result) { __result = null; } } catch (Exception ex) { Plugin.logger.LogError((object)ex); } } [HarmonyPostfix] [HarmonyPatch(typeof(EnemyAI), "CheckLineOfSightForClosestPlayer")] private static void EnemyAI_CheckLineOfSightForClosestPlayer_Postfix(EnemyAI __instance, ref PlayerControllerB __result) { try { if (!((Object)(object)SCP268Behavior.Instance == (Object)null) && !((Object)(object)((WearableObject)SCP268Behavior.Instance).playerWornBy == (Object)null) && (Object)(object)((WearableObject)SCP268Behavior.Instance).playerWornBy == (Object)(object)__result) { __result = null; } } catch (Exception ex) { Plugin.logger.LogError((object)ex); } } [HarmonyPostfix] [HarmonyPatch(typeof(EnemyAI), "CheckLineOfSightForPosition")] private static void EnemyAI_CheckLineOfSightForPosition_Postfix(EnemyAI __instance, Vector3 objectPosition, ref bool __result) { //IL_0029: 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) try { if (!((Object)(object)SCP268Behavior.Instance == (Object)null) && !((Object)(object)((WearableObject)SCP268Behavior.Instance).playerWornBy == (Object)null) && objectPosition == ((Component)((WearableObject)SCP268Behavior.Instance).playerWornBy.gameplayCamera).transform.position) { __result = false; } } catch (Exception ex) { Plugin.logger.LogError((object)ex); } } [HarmonyPostfix] [HarmonyPatch(typeof(EnemyAI), "PlayerIsTargetable")] private static void EnemyAI_PlayerIsTargetable_Postfix(EnemyAI __instance, PlayerControllerB playerScript, ref bool __result) { try { if (!((Object)(object)SCP268Behavior.Instance == (Object)null) && !((Object)(object)((WearableObject)SCP268Behavior.Instance).playerWornBy == (Object)null) && (Object)(object)((WearableObject)SCP268Behavior.Instance).playerWornBy == (Object)(object)playerScript) { __result = false; } } catch (Exception ex) { Plugin.logger.LogError((object)ex); } } [HarmonyPostfix] [HarmonyPatch(typeof(Turret), "CheckForPlayersInLineOfSight")] private static void Turret_CheckForPlayersInLineOfSight_Postfix(Turret __instance, ref PlayerControllerB __result) { try { if (!((Object)(object)SCP268Behavior.Instance == (Object)null) && !((Object)(object)((WearableObject)SCP268Behavior.Instance).playerWornBy == (Object)null) && !((Object)(object)((WearableObject)SCP268Behavior.Instance).playerWornBy != (Object)(object)__result)) { __result = null; } } catch (Exception ex) { Plugin.logger.LogError((object)ex); } } } internal class SCP3482Behavior : PhysicsProp, ISCP, ISingletonItem { [SerializeField] private SCPInfo info = null; private static GameObject? _overlay; public static bool localPlayerAffected; public static bool isActive; private static bool enableOverlay = true; private static bool endEffectIfDestroyed = false; public SCPInfo SCPInfo => info; public static GameObject overlay => _overlay ?? (_overlay = Object.Instantiate(ContentHandler.Instance.SCP3482.Overlay)); public static void InitConfigs() { enableOverlay = ((BaseUnityPlugin)Plugin.PluginInstance).Config.Bind("SCP-3482 Options", "SCP-3482 | Enable Overlay", true, "Set to false to disable the black overlay on the left side of the screen when the effect is active.").Value; endEffectIfDestroyed = ((BaseUnityPlugin)Plugin.PluginInstance).Config.Bind("SCP-3482 Options", "SCP-3482 | End Effect If Destroyed", false, "If set to true, when SCP-3482 is destroyed (left behind or sold), the effect will end.").Value; } public void Awake() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).itemProperties.positionOffset = new Vector3(0.21f, 0.08f, -0.25f); ((GrabbableObject)this).itemProperties.rotationOffset = new Vector3(0f, -80f, 0f); ((GrabbableObject)this).itemProperties.floorYOffset = 0; } public override void OnDestroy() { ((GrabbableObject)this).OnDestroy(); if (endEffectIfDestroyed) { localPlayerAffected = false; } _overlay = null; } public static void StaticUpdate() { if (ContentHandler.Instance.SCP3482 != null && !((Object)(object)ContentHandler.Instance.SCP3482.Overlay == (Object)null) && enableOverlay) { bool flag = localPlayerAffected && !SCP714Behavior.localPlayerAffected && !TESTING.immunity && !Plugin.localPlayer.quickMenuManager.isMenuOpen && !Plugin.localPlayer.inSpecialMenu; if (!((Object)(object)overlay == (Object)null) && flag != overlay.activeSelf) { Plugin.logger.LogDebug((object)"Setting active"); overlay.SetActive(flag); } } } public override void EquipItem() { //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown ((PhysicsProp)this).EquipItem(); if (((NetworkBehaviour)this).IsOwner && !TESTING.immunity && !SCP714Behavior.localPlayerAffected) { localPlayerAffected = true; _ = overlay; Canvas component = overlay.GetComponent(); component.overrideSorting = true; component.sortingOrder = -100; PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new OnRemoveActionEffect((Action)delegate { localPlayerAffected = false; }, "scp3482", "antileft_effect", 0f, (Func)null, true, true, false)); } } protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } protected override void __initializeRpcs() { ((PhysicsProp)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SCP3482Behavior"; } } [HarmonyPatch] internal static class SCP3482Patches { [HarmonyPrefix] [HarmonyPatch(typeof(PlayerControllerB), "CalculateNormalLookingInput")] private static void PlayerControllerB_CalculateNormalLookingInput_Prefix(ref Vector2 inputVector, PlayerControllerB __instance) { try { if (SCP3482Behavior.localPlayerAffected && !SCP714Behavior.localPlayerAffected && !TESTING.immunity) { inputVector.x = Mathf.Max(inputVector.x, 0f); } } catch (Exception ex) { Plugin.logger.LogError((object)ex); } } [HarmonyPrefix] [HarmonyPatch(typeof(PlayerControllerB), "CalculateSmoothLookingInput")] private static void PlayerControllerB_CalculateSmoothLookingInput_Prefix(ref Vector2 inputVector, PlayerControllerB __instance) { try { if (SCP3482Behavior.localPlayerAffected && !SCP714Behavior.localPlayerAffected && !TESTING.immunity) { inputVector.x = Mathf.Max(inputVector.x, 0f); } } catch (Exception ex) { Plugin.logger.LogError((object)ex); } } [HarmonyPrefix] [HarmonyPatch(typeof(HUDManager), "SubmitChat_performed")] public static void SubmitChat_performedPrefix(HUDManager __instance) { try { if (SCP3482Behavior.localPlayerAffected && !SCP714Behavior.localPlayerAffected && !TESTING.immunity) { string text = __instance.chatTextField.text.Replace("left", "", StringComparison.OrdinalIgnoreCase); __instance.chatTextField.text = text; } } catch (Exception ex) { Plugin.logger.LogError((object)ex); } } [HarmonyTranspiler] [HarmonyPatch(typeof(PlayerControllerB), "Update")] private static IEnumerable Transpiler(IEnumerable instructions) { List codes = new List(instructions); FieldInfo moveInputField = AccessTools.Field(typeof(PlayerControllerB), "moveInputVector"); MethodInfo clampMethod = AccessTools.Method(typeof(SCP3482Patches), "ClampMoveInput", (Type[])null, (Type[])null); for (int i = 0; i < codes.Count; i++) { yield return codes[i]; if (CodeInstructionExtensions.StoresField(codes[i], moveInputField)) { yield return new CodeInstruction(OpCodes.Ldarg_0, (object)null); yield return new CodeInstruction(OpCodes.Call, (object)clampMethod); } } } public static void ClampMoveInput(PlayerControllerB player) { if (!((Object)(object)player != (Object)(object)Plugin.localPlayer) && SCP3482Behavior.localPlayerAffected && !SCP714Behavior.localPlayerAffected && !TESTING.immunity) { player.moveInputVector.x = Mathf.Max(player.moveInputVector.x, 0f); } } } public class SCP420JBehavior : PhysicsProp, ISCP { [SerializeField] private SCPInfo info = null; public AudioSource audioSource = null; public ParticleSystem particleSystem = null; public SkinnedMeshRenderer renderer = null; public AudioClip exhaleSFX = null; private PlayerControllerB previousPlayerHeldBy = null; private float fuel = 1f; private bool hasBeenLit; private float timeInhaling; private bool isUsing; private Vector3 usingPositionOffset = new Vector3(0.05f, 0f, 0.2f); private Vector3 usingRotationOffset = new Vector3(40f, 10f, 0f); private Vector3 particleSystemStart = new Vector3(0f, 0.035f, 0.2f); private Vector3 particleSystemEnd = new Vector3(0f, 0.0085f, -0.1326f); private static float baseFuelUse = 75f; public SCPInfo SCPInfo => info; private bool hasFuel => fuel > 0f; private float fuelUseMultiplier => inhaling ? 1.5f : 1f; private bool inhaling => isUsing && hasBeenLit && hasFuel; private bool isBurning => hasBeenLit && hasFuel; public static void InitConfigs() { baseFuelUse = ((BaseUnityPlugin)Plugin.PluginInstance).Config.Bind("SCP-420-J Options", "SCP-420-J | Base Fuel Use", 75f, "The base fuel use when lighting SCP-420-J. Increase this to make it last longer.").Value; } public void Awake() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).itemProperties.positionOffset = new Vector3(0.03f, 0.3f, 0.12f); ((GrabbableObject)this).itemProperties.rotationOffset = new Vector3(-60f, 0f, 0f); ((GrabbableObject)this).itemProperties.floorYOffset = 90; ((GrabbableObject)this).itemProperties.syncUseFunction = true; ((GrabbableObject)this).itemProperties.syncDiscardFunction = true; ((GrabbableObject)this).itemProperties.requiresBattery = true; ((GrabbableObject)this).itemProperties.batteryUsage = 0f; ((GrabbableObject)this).itemProperties.holdButtonUse = true; } public override void Update() { //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).Update(); if (!hasBeenLit) { return; } if (!hasFuel) { particleSystem.Stop(); audioSource.Stop(); return; } if (inhaling && (Object)(object)previousPlayerHeldBy == (Object)(object)Plugin.localPlayer) { timeInhaling += Time.deltaTime; previousPlayerHeldBy.drunknessInertia = Mathf.Clamp(previousPlayerHeldBy.drunknessInertia + Time.deltaTime / 1.75f * previousPlayerHeldBy.drunknessSpeed, 0.1f, 3f); previousPlayerHeldBy.increasingDrunknessThisFrame = true; } audioSource.volume = (inhaling ? 1f : 0.5f); fuel -= Time.deltaTime / (baseFuelUse * fuelUseMultiplier); renderer.SetBlendShapeWeight(0, Mathf.Lerp(100f, 0f, fuel)); ((Component)particleSystem).transform.localPosition = Vector3.Lerp(particleSystemEnd, particleSystemStart, fuel); } public override void LateUpdate() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0101: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((GrabbableObject)this).parentObject != (Object)null) { ((Component)this).transform.rotation = ((GrabbableObject)this).parentObject.rotation; ((Component)this).transform.Rotate(isUsing ? usingRotationOffset : ((GrabbableObject)this).itemProperties.rotationOffset); ((Component)this).transform.position = ((GrabbableObject)this).parentObject.position; Vector3 val = (isUsing ? usingPositionOffset : ((GrabbableObject)this).itemProperties.positionOffset); val = ((GrabbableObject)this).parentObject.rotation * val; Transform transform = ((Component)this).transform; transform.position += val; } if (((GrabbableObject)this).rotateObject) { ((Component)this).transform.Rotate(new Vector3(0f, Time.deltaTime * 60f, 0f), (Space)0); } if ((Object)(object)((GrabbableObject)this).radarIcon != (Object)null) { ((GrabbableObject)this).radarIcon.position = ((Component)this).transform.position; } } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); isUsing = buttonDown; if (isBurning) { if (isUsing) { particleSystem.Stop(); } else { particleSystem.Play(); } } if (((NetworkBehaviour)this).IsOwner) { ((GrabbableObject)this).playerHeldBy.activatingItem = isUsing; ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetBool("useTZPItem", isUsing); if (timeInhaling > 0f && !isUsing) { ((GrabbableObject)this).playerHeldBy.itemAudio.PlayOneShot(exhaleSFX, 1f); ((MonoBehaviour)this).StartCoroutine(EmitGas(timeInhaling)); timeInhaling = 0f; } } } public override void ChargeBatteries() { if (!((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)null)) { hasBeenLit = true; particleSystem.Play(); audioSource.Play(); } } private IEnumerator EmitGas(float time) { yield return null; HUDManager.Instance.gasHelmetAnimator.SetBool("gasEmitting", true); yield return (object)new WaitForSeconds(time); HUDManager.Instance.gasHelmetAnimator.SetBool("gasEmitting", false); } public override void EquipItem() { ((PhysicsProp)this).EquipItem(); StartOfRound.Instance.RefreshPlayerVoicePlaybackObjects(); if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { previousPlayerHeldBy = ((GrabbableObject)this).playerHeldBy; } } public override void DiscardItem() { if ((Object)(object)previousPlayerHeldBy == (Object)(object)Plugin.localPlayer) { previousPlayerHeldBy.playerBodyAnimator.SetBool("useTZPItem", false); previousPlayerHeldBy.activatingItem = false; if (timeInhaling > 0f) { ((GrabbableObject)this).playerHeldBy.itemAudio.PlayOneShot(exhaleSFX, 0.1f); ((MonoBehaviour)this).StartCoroutine(EmitGas(timeInhaling)); timeInhaling = 0f; } } ((GrabbableObject)this).DiscardItem(); } protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } protected override void __initializeRpcs() { ((PhysicsProp)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SCP420JBehavior"; } } internal class SCP498Behavior : PhysicsProp, ISCP, ISingletonItem, IVisibleThreat { [SerializeField] private SCPInfo info = null; public ScanNodeProperties scanNode = null; public AudioSource audioSource = null; public GameObject audioSourcePrefab = null; public TextMeshPro timeDisplay = null; private Dictionary audioSources = new Dictionary(); private float farthestNodeDistance; private Vector3 lastPosition; private float alarmIntensity; private float playerIntensity; private float localPlayerDistance; private float timeSinceLastSnooze; private float timeSinceCalculateVolumes; private float timeSinceDoPlayerEffects = 2f; private bool snoozing; private const float basePushForce = 1.5f; private const float minDistanceOffset = 0.5f; private static float snoozeTime = 120f; private static float timeToMaxVolume = 300f; public SCPInfo SCPInfo => info; private float timeSinceAlarmActive => timeSinceLastSnooze - snoozeTime; private bool alarmActive => timeSinceLastSnooze > snoozeTime; private float volumeIncreaseMultiplier => 1f / timeToMaxVolume; public ThreatType type => (ThreatType)5; public static void InitConfigs() { snoozeTime = ((BaseUnityPlugin)Plugin.PluginInstance).Config.Bind("SCP-498 Options", "SCP-498 | Snooze Time", 120f, "The amount of time it takes in seconds for the alarm to become active again after snoozing it.").Value; timeToMaxVolume = ((BaseUnityPlugin)Plugin.PluginInstance).Config.Bind("SCP-498 Options", "SCP-498 | Time To Max Volume", 300f, "The amount of time it takes in seconds for the alarm to reach max volume after its activated.").Value; } public void Awake() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).itemProperties.positionOffset = new Vector3(-0.15f, 0.23f, -0.3f); ((GrabbableObject)this).itemProperties.rotationOffset = new Vector3(80f, 90f, 0f); ((GrabbableObject)this).itemProperties.floorYOffset = 90; } public override void Start() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).Start(); Utils.OnShipLanded.AddListener(new UnityAction(CreateAudioSources)); if (StartOfRound.Instance.shipHasLanded) { CreateAudioSources(); } IEnumerableExtensions.GetFarthestFromPosition((IEnumerable)Utils.allAINodes, ((Component)this).transform.position, (Func)((GameObject x) => x.transform.position), ref farthestNodeDistance, true, (IEnumerable)null); lastPosition = ((Component)this).transform.position; } public override void OnDestroy() { foreach (AudioSource value in audioSources.Values) { Object.Destroy((Object)(object)((Component)value).gameObject); } ((GrabbableObject)this).OnDestroy(); } public override void Update() { ((GrabbableObject)this).Update(); if (StartOfRound.Instance.inShipPhase) { if (((NetworkBehaviour)this).IsServer && alarmActive) { SnoozeRpc(); } return; } timeSinceLastSnooze += Time.deltaTime; SetTimeDisplay(); if (!alarmActive) { return; } if (!audioSource.isPlaying) { audioSource.volume = 0f; audioSource.Play(); foreach (AudioSource value in audioSources.Values) { value.volume = 0f; value.Play(); } ((GrabbableObject)this).grabbable = false; ((GrabbableObject)this).grabbableToEnemies = false; ((GrabbableObject)this).customGrabTooltip = "Snooze [E]"; } if (((NetworkBehaviour)this).IsServer && alarmIntensity >= 1f && !TimeOfDay.Instance.shipLeavingAlertCalled) { NetworkHandler.Instance.SetShipLeaveEarlyServerRpc(TimeOfDay.Instance.normalizedTimeOfDay + 0.1f, "WARNING! Due to unsafe conditions, the autopilot ship will leave early. Please return by " + HUDManager.Instance.GetClockTimeFormatted(TimeOfDay.Instance.normalizedTimeOfDay + 0.1f, (float)TimeOfDay.Instance.numberOfHours, false) + ".", "SAFETY COMPUTER", 4f); } CalculateVolumes(); DoPlayerEffects(); PushPlayer(); SyncAudios(); } public override void InteractItem() { if (!snoozing && alarmActive) { snoozing = true; ((MonoBehaviour)this).StartCoroutine(SnoozeDelay()); } IEnumerator SnoozeDelay() { yield return null; SnoozeRpc(); snoozing = false; } } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (buttonDown && alarmActive) { SnoozeRpc(); } } private void SetTimeDisplay() { string text = ((TMP_Text)HUDManager.Instance.clockNumber).text.Replace("\n", " "); ((TMP_Text)timeDisplay).text = text; } private void CalculateVolumes() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) timeSinceCalculateVolumes += Time.deltaTime; if (timeSinceCalculateVolumes < 1f) { return; } timeSinceCalculateVolumes = 0f; alarmIntensity = Mathf.Clamp01(timeSinceAlarmActive * volumeIncreaseMultiplier); if (lastPosition != ((Component)this).transform.position) { IEnumerableExtensions.GetFarthestFromPosition((IEnumerable)Utils.allAINodes, ((Component)this).transform.position, (Func)((GameObject x) => x.transform.position), ref farthestNodeDistance, true, (IEnumerable)null); } lastPosition = ((Component)this).transform.position; if (farthestNodeDistance <= 0f) { return; } audioSource.volume = ((Plugin.localPlayer.isInsideFactory == ((GrabbableObject)this).isInFactory) ? alarmIntensity : 0f); audioSource.maxDistance = Mathf.Lerp(10f, farthestNodeDistance + 10f, alarmIntensity); audioSource.minDistance = audioSource.maxDistance * 0.5f; if (Plugin.localPlayer.isInsideFactory == ((GrabbableObject)this).isInFactory) { foreach (AudioSource value in audioSources.Values) { value.volume = 0f; } return; } foreach (EntranceTeleport entrance in Utils.entrances) { if (entrance.isEntranceToBuilding) { AudioSource val = (((GrabbableObject)this).isInFactory ? audioSources[entrance.exitScript] : audioSources[entrance]); AudioSource val2 = (((GrabbableObject)this).isInFactory ? audioSources[entrance] : audioSources[entrance.exitScript]); val.volume = 0f; float num = Vector3.Distance(((Component)this).transform.position, ((Component)val).transform.position); if (!(num > audioSource.maxDistance)) { float num2 = 1f - num / audioSource.maxDistance; val2.volume = alarmIntensity / 2f * num2; val2.maxDistance = audioSource.maxDistance - num; val2.minDistance = val2.maxDistance * 0.5f; } } } } private void CreateAudioSources() { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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) Plugin.logger.LogDebug((object)"Creating audio sources for 498"); audioSources.Clear(); foreach (EntranceTeleport entrance in Utils.entrances) { if (!entrance.gotExitPoint) { if (!entrance.FindExitPoint()) { continue; } entrance.gotExitPoint = true; } AudioSource component = Object.Instantiate(audioSourcePrefab, GetPointBehindDoor(entrance), Quaternion.identity).GetComponent(); ((Object)((Component)component).gameObject).name = "SCP498_" + ((Object)entrance).name + "_AudioPortal"; audioSources.Add(entrance, component); AudioSource component2 = Object.Instantiate(audioSourcePrefab, GetPointBehindDoor(entrance.exitScript), Quaternion.identity).GetComponent(); ((Object)((Component)component2).gameObject).name = "SCP498_" + ((Object)entrance.exitScript).name + "_AudioPortal"; audioSources.Add(entrance.exitScript, component2); } } private Vector3 GetPointBehindDoor(EntranceTeleport entrance) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)entrance).transform.InverseTransformPoint(entrance.entrancePoint.position); val.x = 0f - val.x; val.z = 0f - val.z; val.y += 0.5f; return ((Component)entrance).transform.TransformPoint(val); } private void SyncAudios() { foreach (AudioSource value in audioSources.Values) { value.time = audioSource.time; } } private void DoPlayerEffects() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) if (TESTING.immunity) { return; } timeSinceDoPlayerEffects += Time.deltaTime; if (timeSinceDoPlayerEffects < 2f) { return; } timeSinceDoPlayerEffects = 0f; localPlayerDistance = Utils.SmartDistance(((Component)Plugin.localPlayer).transform.position, ((Component)this).transform.position, true); playerIntensity = alarmIntensity * Mathf.Clamp01(1f - localPlayerDistance / audioSource.maxDistance); if (playerIntensity > 0.5f && !SCP714Behavior.localPlayerAffected) { float num = Mathf.Lerp(0f, 0.25f, playerIntensity); Plugin.localPlayer.drunkness = Mathf.Max(Plugin.localPlayer.drunkness, num); } if (playerIntensity > 0.75f && !SCP714Behavior.localPlayerAffected && !HUDManager.Instance.playerScreenShakeAnimator.GetBool("ShakingConstant")) { HUDManager.Instance.ShakeCamera((ScreenShakeType)4); } if (playerIntensity > 0.85f) { int num2 = ((!(playerIntensity > 0.95f)) ? 1 : 2); Plugin.localPlayer.inSpecialInteractAnimation = true; Plugin.localPlayer.DamagePlayer(num2, false, true, (CauseOfDeath)0, 0, false, default(Vector3)); Plugin.localPlayer.inSpecialInteractAnimation = false; if (!SCP714Behavior.localPlayerAffected) { float num3 = Mathf.Lerp(0f, 0.4f, playerIntensity); VignetteOverlay.SetIntensity(Mathf.Max(VignetteOverlay.currentIntensity, num3), 0.01f); } } } private void PushPlayer() { //IL_005d: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) if (!(playerIntensity < 0.8f)) { float num = 1.5f * playerIntensity; float num2 = audioSource.minDistance / 2f; if (!(localPlayerDistance > num2)) { Vector3 val = ((Component)Plugin.localPlayer.playerCollider).transform.position - ((Component)this).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = ((Component)Plugin.localPlayer.playerCollider).transform.position + normalized * num; float num3 = 1f - localPlayerDistance / num2; ((Component)Plugin.localPlayer.playerCollider).transform.position = Vector3.Lerp(((Component)Plugin.localPlayer.playerCollider).transform.position, val2, num * num3 * Time.fixedDeltaTime); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SnoozeRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(4052463634u, val3, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 4052463634u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; foreach (AudioSource value in audioSources.Values) { value.volume = 0f; value.Stop(); } audioSource.volume = 0f; audioSource.Stop(); timeSinceLastSnooze = 0f; ((GrabbableObject)this).grabbable = true; ((GrabbableObject)this).grabbableToEnemies = true; ((GrabbableObject)this).customGrabTooltip = ""; if (HUDManager.Instance.playerScreenShakeAnimator.GetBool("ShakingConstant")) { HUDManager.Instance.StopShakingCamera(); } if (!SCP714Behavior.localPlayerAffected) { SoundManager.Instance.earsRingingTimer = 2.5f * playerIntensity; } } public int GetThreatLevel(Vector3 seenByPosition) { if (!alarmActive) { return 0; } return (int)Mathf.Lerp(0f, 30f, alarmIntensity); } public int GetInterestLevel() { return 0; } public Transform GetThreatLookTransform() { return ((Component)this).transform; } public Transform GetThreatTransform() { return ((Component)this).transform; } public Vector3 GetThreatVelocity() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { return ((GrabbableObject)this).playerHeldBy.GetPlayerVelocity(); } return Vector3.zero; } public float GetVisibility() { if (((GrabbableObject)this).isPocketed) { return 0f; } return 1f; } public int SendSpecialBehaviour(int id) { return 0; } public GrabbableObject GetHeldObject() { return null; } public bool IsThreatDead() { return false; } protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(4052463634u, new RpcReceiveHandler(__rpc_handler_4052463634), "SnoozeRpc"); ((PhysicsProp)this).__initializeRpcs(); } private static void __rpc_handler_4052463634(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; ((SCP498Behavior)(object)target).SnoozeRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SCP498Behavior"; } } internal class SCP500Behavior : PhysicsProp, ISCP, ISingletonItem { [SerializeField] private SCPInfo info = null; public List pillsInBottle = null; public AudioClip pillSwallowSFX = null; private static BoundedRange pillAmountRange = new BoundedRange(2f, 15f); public SCPInfo SCPInfo => info; public static void InitConfigs() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown pillAmountRange = ((BaseUnityPlugin)Plugin.PluginInstance).Config.Bind("SCP-500 Options", "SCP-500 | Pill Amount Range", new BoundedRange(2f, 15f), "The amount of pills SCP-500 can have when spawned.").Value; } public void Awake() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).itemProperties.positionOffset = new Vector3(-0.08f, 0.11f, 0f); ((GrabbableObject)this).itemProperties.rotationOffset = new Vector3(0f, 0f, -90f); ((GrabbableObject)this).itemProperties.floorYOffset = 90; } public override void Start() { ((GrabbableObject)this).Start(); int num = (int)pillAmountRange.GetRandomInRange(Utils.randomGlobal); int num2 = pillsInBottle.Count - num; for (int i = 0; i < num2; i++) { RemovePillFromBottle(); } } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (buttonDown && !((GrabbableObject)this).itemUsedUp) { RemovePillFromBottleRpc(); TakePill(); ((GrabbableObject)this).playerHeldBy.itemAudio.PlayOneShot(pillSwallowSFX, 1f); } } private void TakePill() { PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).RemoveEffect((Func)((StatusEffect x) => x.curable)); SCPEvents.OnSCP500TakenByLocalPlayer.Invoke(); Plugin.localPlayer.drunkness = 0f; Plugin.localPlayer.insanityLevel = 0f; Plugin.localPlayer.health = 100; HUDManager.Instance.UpdateHealthUI(100, false); Plugin.localPlayer.MakeCriticallyInjured(false); CadaverGrowthAI val = Object.FindObjectOfType(); if ((Object)(object)val != (Object)null) { val.CurePlayerRpc((int)Plugin.localPlayer.actualClientId); } } private void RemovePillFromBottle() { GameObject val = pillsInBottle.Last(); pillsInBottle.Remove(val); Object.Destroy((Object)(object)val); if (pillsInBottle.Count == 0) { ((GrabbableObject)this).itemUsedUp = true; } } [Rpc(/*Could not decode attribute arguments.*/)] public void RemovePillFromBottleRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1483770336u, val3, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1483770336u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RemovePillFromBottle(); } } } protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1483770336u, new RpcReceiveHandler(__rpc_handler_1483770336), "RemovePillFromBottleRpc"); ((PhysicsProp)this).__initializeRpcs(); } private static void __rpc_handler_1483770336(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; ((SCP500Behavior)(object)target).RemovePillFromBottleRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SCP500Behavior"; } } internal class SCP689Behavior : PhysicsProp, ISCP, ISingletonItem { [SerializeField] private SCPInfo info = null; public Collider collider = null; public static HashSet targetPlayers = new HashSet(); private static Vector3 lastPosition; private bool inLOS; private float timeNotInLOS; private static float timeSinceDisappearing; private float timeSinceAppearing; private static float nextAppearTime; private static float killCooldown = 5f; private static float grace = 0.1f; public SCPInfo SCPInfo => info; public static SCP689Behavior? Instance { get; private set; } private static bool inShipPhase => (StartOfRound.Instance.inShipPhase || StartOfRound.Instance.shipIsLeaving) && !Utils.inTestRoom; public static void InitConfigs() { killCooldown = ((BaseUnityPlugin)Plugin.PluginInstance).Config.Bind("SCP-689 Options", "SCP-689 | Kill Cooldown", 5f, "The amount of time in seconds for SCP-689 to disappear again after killing someone and not being looked at.").Value; grace = ((BaseUnityPlugin)Plugin.PluginInstance).Config.Bind("SCP-689 Options", "SCP-689 | Grace", 0.1f, "The amount of time in seconds SCP-689 needs to be out of sight to disappear").Value; } public void Awake() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).itemProperties.positionOffset = new Vector3(0f, 0.1f, -0.06f); ((GrabbableObject)this).itemProperties.rotationOffset = new Vector3(90f, 90f, 0f); ((GrabbableObject)this).itemProperties.floorYOffset = 90; ((GrabbableObject)this).itemProperties.verticalOffset = -0.05f; ((GrabbableObject)this).itemProperties.twoHanded = false; ((GrabbableObject)this).itemProperties.allowDroppingAheadOfPlayer = true; } public static void StaticUpdate() { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_010b: 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_0118: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)NetworkHandler.Instance).IsServer) { return; } if (targetPlayers.Count > 0) { targetPlayers.RemoveWhere((PlayerControllerB p) => (Object)(object)p == (Object)null || !p.isPlayerControlled); } if ((Object)(object)Instance != (Object)null) { return; } if (inShipPhase) { lastPosition = Vector3.zero; return; } timeSinceDisappearing += Time.deltaTime; if (!(timeSinceDisappearing < nextAppearTime) && (targetPlayers.Count != 0 || !(lastPosition == Vector3.zero))) { PlayerControllerB randomPlayer = GetRandomPlayer(); if (!((Object)(object)randomPlayer == (Object)null) && randomPlayer.isPlayerControlled) { timeSinceDisappearing = 0f; Utils.SpawnItem(ItemSCPsKeys.SCP689, ((Component)randomPlayer).transform.position, default(Quaternion), (Transform)null, 0f, false); NetworkHandler.Instance.KillPlayerRpc(randomPlayer.actualClientId); targetPlayers.Remove(randomPlayer); } } } public override void OnNetworkPostSpawn() { if (!((Object)(object)Instance != (Object)null) || !((Object)(object)Instance != (Object)(object)this)) { Instance = this; ((NetworkBehaviour)this).OnNetworkPostSpawn(); } } public override void OnNetworkDespawn() { if (!((Object)(object)Instance == (Object)null) && !((Object)(object)Instance != (Object)(object)this)) { Instance = null; ((NetworkBehaviour)this).OnNetworkDespawn(); } } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); if (((NetworkBehaviour)this).IsOwner && ((GrabbableObject)this).isPocketed) { SetNextAppearTimeRpc(); int num = Array.IndexOf(((GrabbableObject)this).playerHeldBy.ItemSlots, (GrabbableObject)(object)this); ((GrabbableObject)this).playerHeldBy.DestroyItemInSlotAndSync(num); } } public override void Start() { //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) ((GrabbableObject)this).Start(); lastPosition = ((Component)this).transform.position; } public override void Update() { //IL_009a: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).Update(); if (!((NetworkBehaviour)this).IsServer) { return; } timeSinceAppearing += Time.deltaTime; inLOS = ((GrabbableObject)this).isHeld || ((GrabbableObject)this).isHeldByEnemy || (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null || inShipPhase; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if ((Object)(object)val == (Object)null || !val.isPlayerControlled || TESTING.immunity) { continue; } Bounds bounds = collider.bounds; if (val.HasLineOfSightToPosition(((Bounds)(ref bounds)).center, 50f, 2000, -1f, -1)) { if (!TESTING.immunity) { targetPlayers.Add(val); } inLOS = true; } } if (inLOS || targetPlayers.Count == 0 || timeSinceAppearing < killCooldown) { timeNotInLOS = 0f; return; } timeNotInLOS += Time.deltaTime; if (!(timeNotInLOS < grace)) { nextAppearTime = Random.Range(15, 20); lastPosition = ((Component)this).transform.position; ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } public static PlayerControllerB? GetRandomPlayer() { if (!targetPlayers.Any((PlayerControllerB x) => (Object)(object)x != (Object)null && !x.isPlayerAlone && x.isPlayerControlled)) { return IEnumerableExtensions.GetRandom((IEnumerable)targetPlayers); } return IEnumerableExtensions.GetRandom(targetPlayers.Where((PlayerControllerB x) => (Object)(object)x != (Object)null && !x.isPlayerAlone && x.isPlayerControlled)); } [Rpc(/*Could not decode attribute arguments.*/)] public void SetNextAppearTimeRpc() { //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_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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) 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(500406780u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 500406780u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; nextAppearTime = Random.Range(15, 20); lastPosition = ((Component)this).transform.position; } } } protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(500406780u, new RpcReceiveHandler(__rpc_handler_500406780), "SetNextAppearTimeRpc"); ((PhysicsProp)this).__initializeRpcs(); } private static void __rpc_handler_500406780(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; ((SCP689Behavior)(object)target).SetNextAppearTimeRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SCP689Behavior"; } } internal class SCP714Behavior : WearableObject, ISCP, ISingletonItem { [SerializeField] private SCPInfo info = null; public SCPInfo SCPInfo => info; public static bool localPlayerAffected { get; private set; } public void Awake() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).itemProperties.positionOffset = new Vector3(0.07f, 0.1f, 0f); ((GrabbableObject)this).itemProperties.rotationOffset = new Vector3(0f, 0f, 0f); ((GrabbableObject)this).itemProperties.floorYOffset = 90; base.wearableItemProperties.showWearableOnClient = true; base.wearableItemProperties.showWearable = true; base.wearableItemProperties.useLocalOffsets = true; base.wearableItemProperties.boneTransform = "spine.001/spine.002/spine.003/shoulder.R/arm.R_upper/arm.R_lower/hand.R/finger4.R/finger4.R.001"; base.wearableItemProperties.boneTransformLocal = "metarig/spine.003/shoulder.R/arm.R_upper/arm.R_lower/hand.R/finger4.R/finger4.R.001"; base.wearableItemProperties.wornPositionOffsetLocal = new Vector3(0.02f, -0.03f, 0f); base.wearableItemProperties.wornRotationOffsetLocal = new Vector3(0f, 0f, 20f); base.wearableItemProperties.wornPositionOffset = new Vector3(0.03f, -0.06f, -0.01f); base.wearableItemProperties.wornRotationOffset = new Vector3(0f, 0f, 30f); } public override void Update() { ((WearableObject)this).Update(); if (!((Object)(object)((WearableObject)this).playerWornBy == (Object)null)) { ((WearableObject)this).playerWornBy.insanityLevel = 0f; ((WearableObject)this).playerWornBy.drunkness = 0f; ((WearableObject)this).playerWornBy.sprintMeter = 0f; ((WearableObject)this).playerWornBy.isExhausted = true; VignetteOverlay.SetIntensity(Mathf.Max(VignetteOverlay.currentIntensity, 0.1f), 0.01f); } } public override void OnWear() { ((WearableObject)this).OnWear(); if ((Object)(object)Plugin.localPlayer == (Object)(object)((WearableObject)this).playerWornBy) { localPlayerAffected = true; SCPEvents.LocalPlayerWearingSCP714 = true; } } public override void OnUnWear() { ((WearableObject)this).OnUnWear(); if ((Object)(object)Plugin.localPlayer == (Object)(object)((WearableObject)this).lastPlayerWornBy) { localPlayerAffected = false; SCPEvents.LocalPlayerWearingSCP714 = false; } } protected override void __initializeVariables() { ((WearableObject)this).__initializeVariables(); } protected override void __initializeRpcs() { ((WearableObject)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SCP714Behavior"; } } internal class SCP735Behavior : PhysicsProp, ISCP, ISingletonItem { public enum Phrase { MonsterDamagePhrases, NearOtherPlayersPhrases, PlayerDiesPhrases, PlayerDamagePhrases, PlayerFallDamagePhrases, RandomPhrases } [SerializeField] private SCPInfo info = null; public AudioSource audioSource = null; public AudioClip[] monsterDamagePhrases = null; public AudioClip[] nearOtherPlayersPhrases = null; public AudioClip[] playerDiesPhrases = null; public AudioClip[] playerDamagePhrases = null; public AudioClip[] playerFallDamagePhrases = null; public AudioClip[] randomPhrases = null; public Dictionary phrases = new Dictionary(); private float phraseCooldown; public PlayerControllerB? previousPlayerHeldBy; private const float nearPlayersRadius = 10f; private static BoundedRange phraseCooldownRange = new BoundedRange(5f, 15f); public SCPInfo SCPInfo => info; public static SCP735Behavior? Instance { get; private set; } public static void InitConfigs() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown phraseCooldownRange = ((BaseUnityPlugin)Plugin.PluginInstance).Config.Bind("SCP-735 Options", "SCP-735 | Phrase Cooldown", new BoundedRange(5f, 15f), "The cooldown in which SCP-735 will insult the player while holding it.").Value; } public void Awake() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).itemProperties.positionOffset = new Vector3(0.07f, 0.2f, -0.25f); ((GrabbableObject)this).itemProperties.rotationOffset = new Vector3(80f, 0f, 90f); ((GrabbableObject)this).itemProperties.floorYOffset = 90; ((GrabbableObject)this).itemProperties.twoHanded = false; } public override void Start() { ((GrabbableObject)this).Start(); phrases.Add(Phrase.MonsterDamagePhrases, monsterDamagePhrases); phrases.Add(Phrase.NearOtherPlayersPhrases, nearOtherPlayersPhrases); phrases.Add(Phrase.PlayerDiesPhrases, playerDiesPhrases); phrases.Add(Phrase.PlayerDamagePhrases, playerDamagePhrases); phrases.Add(Phrase.PlayerFallDamagePhrases, playerFallDamagePhrases); phrases.Add(Phrase.RandomPhrases, randomPhrases); } public override void OnNetworkPostSpawn() { if (!((Object)(object)Instance != (Object)null) || !((Object)(object)Instance != (Object)(object)this)) { Instance = this; ((NetworkBehaviour)this).OnNetworkPostSpawn(); } } public override void OnNetworkDespawn() { if (!((Object)(object)Instance == (Object)null) && !((Object)(object)Instance != (Object)(object)this)) { Instance = null; ((NetworkBehaviour)this).OnNetworkDespawn(); } } public override void Update() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).Update(); if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { previousPlayerHeldBy = ((GrabbableObject)this).playerHeldBy; } else if ((Object)(object)previousPlayerHeldBy != (Object)null && Vector3.Distance(((Component)previousPlayerHeldBy).transform.position, ((Component)this).transform.position) > audioSource.maxDistance) { previousPlayerHeldBy = null; } if ((Object)(object)Plugin.localPlayer != (Object)(object)previousPlayerHeldBy || TESTING.immunity) { return; } if (phraseCooldown > 0f) { phraseCooldown -= Time.deltaTime; } if (phraseCooldown <= 0f) { if (previousPlayerHeldBy.NearOtherPlayers(10f) && Random.Range(0, 3) == 0) { SpeakPhrase(Phrase.NearOtherPlayersPhrases); } else { SpeakPhrase(Phrase.RandomPhrases); } } } public void SpeakPhrase(Phrase phrase, bool overrideIfPlaying = false) { if (!audioSource.isPlaying || overrideIfPlaying) { phraseCooldown = phraseCooldownRange.GetRandomInRange(Utils.randomLocal); int index = Random.Range(0, phrases[phrase].Length); SpeakPhraseRpc(phrase, index); } } [Rpc(/*Could not decode attribute arguments.*/)] private void SpeakPhraseRpc(Phrase phrase, int index) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2726887037u, val3, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref phrase, default(ForEnums)); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2726887037u, 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)("Speaking phrase: " + phrase)); AudioClip[] array = phrases[phrase]; AudioClip val4 = array[index]; audioSource.Stop(); audioSource.spatialBlend = ((!((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) || !((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)Plugin.localPlayer)) ? 1 : 0); audioSource.clip = val4; audioSource.Play(); RoundManager.Instance.PlayAudibleNoise(((Component)this).transform.position, audioSource.maxDistance, audioSource.volume, 0, false, 0); WalkieTalkie.TransmitOneShotAudio(audioSource, val4, 0.85f); } } } protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2726887037u, new RpcReceiveHandler(__rpc_handler_2726887037), "SpeakPhraseRpc"); ((PhysicsProp)this).__initializeRpcs(); } private static void __rpc_handler_2726887037(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Phrase phrase = default(Phrase); ((FastBufferReader)(ref reader)).ReadValueSafe(ref phrase, default(ForEnums)); int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP735Behavior)(object)target).SpeakPhraseRpc(phrase, index); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SCP735Behavior"; } } [HarmonyPatch] internal class SCP735Patches { [HarmonyPostfix] [HarmonyPatch(typeof(PlayerControllerB), "KillPlayer")] public static void KillPlayerPostfix(PlayerControllerB __instance) { try { if (!((Object)(object)SCP735Behavior.Instance == (Object)null) && !((Object)(object)__instance != (Object)(object)Plugin.localPlayer) && !((Object)(object)SCP735Behavior.Instance.previousPlayerHeldBy != (Object)(object)__instance)) { SCP735Behavior.Instance.SpeakPhrase(SCP735Behavior.Phrase.PlayerDiesPhrases, overrideIfPlaying: true); SCP735Behavior.Instance.previousPlayerHeldBy = null; } } catch (Exception ex) { Plugin.logger.LogError((object)ex); } } [HarmonyPostfix] [HarmonyPatch(typeof(PlayerControllerB), "DamagePlayer")] public static void DamagePlayerPostfix(PlayerControllerB __instance, CauseOfDeath causeOfDeath) { //IL_0035: 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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Invalid comparison between Unknown and I4 //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Invalid comparison between Unknown and I4 //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Invalid comparison between Unknown and I4 //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Invalid comparison between Unknown and I4 if ((Object)(object)SCP735Behavior.Instance == (Object)null || (Object)(object)__instance != (Object)(object)Plugin.localPlayer || (Object)(object)SCP735Behavior.Instance.previousPlayerHeldBy != (Object)(object)__instance) { return; } if ((int)causeOfDeath <= 6) { if ((int)causeOfDeath != 2) { if ((int)causeOfDeath == 6) { SCP735Behavior.Instance.SpeakPhrase(SCP735Behavior.Phrase.MonsterDamagePhrases); } } else { SCP735Behavior.Instance.SpeakPhrase(SCP735Behavior.Phrase.PlayerFallDamagePhrases); } } else if ((int)causeOfDeath != 14) { if ((int)causeOfDeath == 18) { SCP735Behavior.Instance.SpeakPhrase(SCP735Behavior.Phrase.MonsterDamagePhrases); } } else { SCP735Behavior.Instance.SpeakPhrase(SCP735Behavior.Phrase.MonsterDamagePhrases); } } [HarmonyPostfix] [HarmonyPatch(typeof(PlayerControllerB), "DamagePlayerFromOtherClientClientRpc")] public static void DamagePlayerFromOtherClientClientRpcPostfix(PlayerControllerB __instance) { if (!((Object)(object)SCP735Behavior.Instance == (Object)null) && !((Object)(object)__instance != (Object)(object)Plugin.localPlayer) && !((Object)(object)SCP735Behavior.Instance.previousPlayerHeldBy != (Object)(object)__instance)) { SCP735Behavior.Instance.SpeakPhrase(SCP735Behavior.Phrase.PlayerDamagePhrases); } } } internal class SCP983Behavior : PhysicsProp, ISCP, ISingletonItem { [SerializeField] private SCPInfo info = null; public AudioSource audioSource = null; public AudioClip monkeyFlipSFX = null; public AudioClip[] birthdaySongsSFX = null; public Animator animator = null; public Transform candyDropPosition = null; public MeshRenderer eyesRenderer = null; private PlayerControllerB targetPlayer = null; private Material eyesMaterial = null; private string defaultNoteTimes = ".150, .453, .604, 1.059, 1.363, 1.817-2.272, 2.576, 2.727, 2.879, 3.334, 3.788, 4.092-4.547, 4.850, 5.002, 5.153, 5.608, 5.911, 6.215-6.518, 6.669-6.973, 7.276, 7.428, 7.731, 8.186, 8.489-9.095, 9.399, 9.702, 10.005, 10.460, 10.612, 10.915-11.218, 11.370-12.280"; private bool activated; private bool songPlaying; private bool isSinging; private bool inWindow; private static float timesPlayedNormalized; private int timesPlayed; private float score; public static float vignetteIntensity; public static float sprintMeter; private Note[] notes = Array.Empty(); private static bool hinderingLocalPlayer; private const float distanceToActivate = 2f; private static float minAccuracyRequiredForPerfect = 0.95f; private static float minAccuracyRequiredForGood = 0.5f; private static int maxPlays = 5; private static float calculateTime = 2.5f; private static float grace = 0.1f; private static string noteHoldTimes = ".150, .453, .604, 1.059, 1.363, 1.817-2.272, 2.576, 2.727, 2.879, 3.334, 3.788, 4.092-4.547, 4.850, 5.002, 5.153, 5.608, 5.911, 6.215-6.518, 6.669-6.973, 7.276, 7.428, 7.731, 8.186, 8.489-9.095, 9.399, 9.702, 10.005, 10.460, 10.612, 10.915-11.218, 11.370-12.280"; public SCPInfo SCPInfo => info; private bool isTargetPlayer => (Object)(object)targetPlayer == (Object)(object)Plugin.localPlayer; public static void InitConfigs() { minAccuracyRequiredForPerfect = ((BaseUnityPlugin)Plugin.PluginInstance).Config.Bind("SCP-983 Options", "SCP-983 | Min Accuracy Required For Perfect", 0.95f, "The min accuracy required to win the singing minigame and dispense a perfect candy.").Value; minAccuracyRequiredForGood = ((BaseUnityPlugin)Plugin.PluginInstance).Config.Bind("SCP-983 Options", "SCP-983 | Min Accuracy Required For Good", 0.5f, "The min accuracy required to win the singing minigame and dispense a good candy.").Value; maxPlays = ((BaseUnityPlugin)Plugin.PluginInstance).Config.Bind("SCP-983 Options", "SCP-983 | Max Plays", 5, "The max amount of times SCP-983 will sing the birthday song before the player dies.").Value; calculateTime = ((BaseUnityPlugin)Plugin.PluginInstance).Config.Bind("SCP-983 Options", "SCP-983 | Calculate Time", 2.5f, "The amount of time it takes between songs to calculate score. Timing has no effect on actual score, just gives a buffer before singing again.").Value; grace = ((BaseUnityPlugin)Plugin.PluginInstance).Config.Bind("SCP-983 Options", "SCP-983 | Grace", 0.1f, "The grace time before and after each note to be counted as holding/singing the note").Value; noteHoldTimes = ((BaseUnityPlugin)Plugin.PluginInstance).Config.Bind("SCP-983 Options", "SCP-983 | Note Hold Times", ".150, .453, .604, 1.059, 1.363, 1.817-2.272, 2.576, 2.727, 2.879, 3.334, 3.788, 4.092-4.547, 4.850, 5.002, 5.153, 5.608, 5.911, 6.215-6.518, 6.669-6.973, 7.276, 7.428, 7.731, 8.186, 8.489-9.095, 9.399, 9.702, 10.005, 10.460, 10.612, 10.915-11.218, 11.370-12.280", "The singing/holding times for each note in the song time that the player should sing for").Value; } public void Awake() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).itemProperties.positionOffset = new Vector3(-0.13f, 0.01f, -0.15f); ((GrabbableObject)this).itemProperties.rotationOffset = new Vector3(120f, 0f, -90f); ((GrabbableObject)this).itemProperties.floorYOffset = 90; } public override void Start() { ((GrabbableObject)this).Start(); eyesMaterial = ((Renderer)eyesRenderer).material; eyesMaterial.SetFloat("_EmissiveIntensity", 1f); targetPlayer = Utils.GetRandomPlayer(Utils.randomGlobal); notes = ParseNoteTimesConfig(noteHoldTimes).ToArray(); } private List ParseNoteTimesConfig(string cfg) { List list = new List(); string[] array = cfg.Replace(" ", "").Split(','); foreach (string text in array) { string[] array2 = text.Split('-'); if (array2.Length > 2) { Plugin.logger.LogWarning((object)("Error parsing config string for SCP-983 NoteHoldTimes. `" + text + "` should have at most one dash, using default NoteHoldTimes...")); return ParseNoteTimesConfig(defaultNoteTimes); } if (float.TryParse(array2[0], out var result)) { float result2 = result; if (array2.Length == 2 && !float.TryParse(array2[1], out result2)) { Plugin.logger.LogWarning((object)("Invalid end time in `" + text + "`, using default NoteHoldTimes...")); return ParseNoteTimesConfig(defaultNoteTimes); } list.Add(new Note(result, result2, grace)); continue; } Plugin.logger.LogWarning((object)("Invalid start time in `" + text + "`, using default NoteHoldTimes...")); return ParseNoteTimesConfig(defaultNoteTimes); } return list; } public override void Update() { //IL_0045: 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) ((GrabbableObject)this).Update(); if (((NetworkBehaviour)this).IsServer && !TESTING.immunity && !activated && (Object)(object)targetPlayer != (Object)null && targetPlayer.isPlayerControlled && Vector3.Distance(((Component)targetPlayer).transform.position, ((Component)this).transform.position) < 2f) { activated = true; ActivateRpc(); } if (!songPlaying || !isTargetPlayer) { return; } if (!PlayerControllerBExtensions.IsPlayerMuted(Plugin.localPlayer)) { isSinging = PlayerControllerBExtensions.IsPlayerSpeaking(Plugin.localPlayer, 0.005f, true); } float time = audioSource.time; inWindow = false; for (int i = 0; i < notes.Length; i++) { inWindow = time >= notes[i].startTime - grace && time <= notes[i].endTime; if (inWindow) { if (isSinging) { notes[i].heldTime += Time.deltaTime; } break; } } SetEyes(); } private void SetEyes() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) Color val = Color.black; if (inWindow) { val = (isSinging ? Color.green : Color.white); } else if (isSinging) { val = Color.red; } eyesMaterial.SetColor("_EmissiveColor", val); } public override int GetItemDataToSave() { return activated ? 1 : 0; } public override void LoadItemSaveData(int saveData) { activated = saveData == 1; } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (isTargetPlayer) { isSinging = buttonDown; } } public void PlaySongOnLocalClient() { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) if (timesPlayed > maxPlays || !targetPlayer.isPlayerControlled || targetPlayer.isPlayerDead) { if (targetPlayer.isPlayerControlled && !targetPlayer.isPlayerDead) { targetPlayer.KillPlayer(Vector3.zero, true, (CauseOfDeath)0, 0, default(Vector3), false); } DispenseCandy(SCP9831Behavior.CandyType.Bad); eyesMaterial.SetColor("_EmissiveColor", Color.black); } else { Plugin.logger.LogDebug((object)"Animation: song"); animator.SetTrigger("song"); } } private void DispenseCandy(SCP9831Behavior.CandyType candyType) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsServer) { Plugin.logger.LogDebug((object)("Dispensing candy " + candyType)); GrabbableObject val = Utils.SpawnItem(ItemSCPsKeys.SCP9831, candyDropPosition.position, default(Quaternion), (Transform)null, 0f, false); (val as SCP9831Behavior)?.ChangeCandyTypeRpc(candyType); songPlaying = false; } } private int GetSongIndex(int playCount) { int num = birthdaySongsSFX.Length; int num2 = maxPlays / num; int num3 = maxPlays % num; int[] array = new int[num]; for (int i = 0; i < num; i++) { array[i] = num2 + ((i < num3) ? 1 : 0); } array[num - 1] = maxPlays - array.Take(num - 1).Sum(); int num4 = 0; for (int j = 0; j < num; j++) { num4 += array[j]; if (playCount <= num4) { return j; } } return num - 1; } private float CalculateResult() { float num = 0f; Note[] array = notes; for (int i = 0; i < array.Length; i++) { Note note = array[i]; if (!(note.duration <= 0f)) { float num2 = note.heldTime / note.duration; num2 = Mathf.Clamp01(num2); num += num2; } } float result = num / (float)notes.Length; Plugin.logger.LogInfo((object)("Score: " + result)); return result; } private void ResetHoldTimes() { for (int i = 0; i < notes.Length; i++) { notes[i].heldTime = 0f; } } public void OnFinishSong() { if (isTargetPlayer) { Plugin.logger.LogDebug((object)"Getting result"); ((MonoBehaviour)this).StartCoroutine(GetResultRoutine()); } IEnumerator GetResultRoutine() { yield return null; yield return (object)new WaitForSeconds(calculateTime); score = CalculateResult(); Plugin.logger.LogDebug((object)("Score: " + score)); if (score >= minAccuracyRequiredForPerfect) { DispenseCandyRpc(SCP9831Behavior.CandyType.Perfect); eyesMaterial.SetColor("_EmissiveColor", Color.black); } else if (score >= minAccuracyRequiredForGood) { DispenseCandyRpc(SCP9831Behavior.CandyType.Good); eyesMaterial.SetColor("_EmissiveColor", Color.black); } else { PlaySongRpc(); } } } public void OnStartSong() { ((GrabbableObject)this).grabbable = true; int songIndex = GetSongIndex(timesPlayed); Plugin.logger.LogDebug((object)("SongIndex: " + songIndex)); if (songIndex > 0 && isTargetPlayer) { Utils.DisplayStatusEffect("WARNING: You are aging rapidly"); } timesPlayedNormalized = timesPlayed / maxPlays; ResetHoldTimes(); audioSource.clip = birthdaySongsSFX[songIndex]; audioSource.Play(); songPlaying = true; timesPlayed++; if (timesPlayed > 2 && isTargetPlayer && score < 0.2f) { if (PlayerControllerBExtensions.IsPlayerMuted(Plugin.localPlayer)) { HUDManager.Instance.DisplayTip("Tip", "Pick up and use [LMB] the monkey toy to sing along", false, true, "SCP983Tip1"); } else { HUDManager.Instance.DisplayTip("Tip", "Sing along with your microphone", false, true, "SCP983Tip2"); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void ActivateRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Expected O, but got Unknown NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(507653220u, val3, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 507653220u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; activated = true; ((GrabbableObject)this).grabbable = false; animator.SetTrigger("flip"); audioSource.PlayOneShot(monkeyFlipSFX, 1f); if (!isTargetPlayer) { return; } PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new TickActionEffect((Action)delegate { float num = Mathf.Lerp(0f, 0.9f, timesPlayedNormalized); vignetteIntensity = Mathf.Min(num, vignetteIntensity + Time.deltaTime * 0.1f); VignetteOverlay.SetIntensity(Mathf.Max(VignetteOverlay.currentIntensity, vignetteIntensity), 0.01f); float num2 = Mathf.Clamp01(Mathf.Lerp(1f, -1f, timesPlayedNormalized)); Plugin.localPlayer.sprintMeter = Mathf.Min(num2, Plugin.localPlayer.sprintMeter); PlayerControllerB localPlayer = Plugin.localPlayer; localPlayer.isExhausted |= timesPlayedNormalized > 0.5f; if (timesPlayedNormalized > 0.6f && !hinderingLocalPlayer) { hinderingLocalPlayer = true; PlayerControllerB localPlayer2 = Plugin.localPlayer; localPlayer2.isMovementHindered++; } float num3 = Mathf.Lerp(1f, 0.3f, timesPlayedNormalized); AudioListener.volume = Mathf.Min(AudioListener.volume, num3); }, "SCP-983", "SCP-983_Aging", 0f, (Func)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)1), (Action)delegate { Plugin.logger.LogDebug((object)"SCP-983_Aging OnRemove"); AudioListener.volume = IngamePlayerSettings.Instance.settings.masterVolume; vignetteIntensity = 0f; if (hinderingLocalPlayer) { hinderingLocalPlayer = false; PlayerControllerB localPlayer = Plugin.localPlayer; localPlayer.isMovementHindered--; } }, true, true, false)); } [Rpc(/*Could not decode attribute arguments.*/)] private void PlaySongRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2113134398u, val3, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2113134398u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlaySongOnLocalClient(); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void DispenseCandyRpc(SCP9831Behavior.CandyType candyType) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2450390859u, val3, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref candyType, default(ForEnums)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2450390859u, 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) { DispenseCandy(candyType); } } } 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(507653220u, new RpcReceiveHandler(__rpc_handler_507653220), "ActivateRpc"); ((NetworkBehaviour)this).__registerRpc(2113134398u, new RpcReceiveHandler(__rpc_handler_2113134398), "PlaySongRpc"); ((NetworkBehaviour)this).__registerRpc(2450390859u, new RpcReceiveHandler(__rpc_handler_2450390859), "DispenseCandyRpc"); ((PhysicsProp)this).__initializeRpcs(); } private static void __rpc_handler_507653220(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; ((SCP983Behavior)(object)target).ActivateRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2113134398(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; ((SCP983Behavior)(object)target).PlaySongRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2450390859(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) { SCP9831Behavior.CandyType candyType = default(SCP9831Behavior.CandyType); ((FastBufferReader)(ref reader)).ReadValueSafe(ref candyType, default(ForEnums)); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP983Behavior)(object)target).DispenseCandyRpc(candyType); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SCP983Behavior"; } } [Serializable] internal struct Note { public float startTime; public float endTime; public float heldTime; public float duration => endTime - startTime; public Note(float startTime, float endTime, float grace) { heldTime = 0f; this.startTime = startTime - grace; this.endTime = endTime + grace; } } internal class SCP9831Behavior : PhysicsProp { public enum CandyType { Perfect, Good, Bad } public AudioClip eatCandySFX = null; public MeshRenderer[] renderers = null; public Material[] materials = null; private CandyType candyType; public void Awake() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).itemProperties.positionOffset = new Vector3(0.08f, 0.1f, 0f); ((GrabbableObject)this).itemProperties.rotationOffset = new Vector3(0f, 0f, 0f); ((GrabbableObject)this).itemProperties.floorYOffset = 90; } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Expected O, but got Unknown //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Expected O, but got Unknown ((GrabbableObject)this).ItemActivate(used, buttonDown); if (!buttonDown) { return; } switch (candyType) { case CandyType.Perfect: PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).RemoveEffect((Func)((StatusEffect e) => e.id == "SCP-983_Aging")); Plugin.localPlayer.health = 200; Plugin.localPlayer.MakeCriticallyInjured(false); PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new OnRemoveActionEffect((Action)delegate { //IL_0082: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown Plugin.logger.LogDebug((object)"PerfectCandyEffect start"); if (Plugin.localPlayer.isPlayerControlled && !Plugin.localPlayer.isPlayerDead && !StartOfRound.Instance.inShipPhase && !StartOfRound.Instance.shipIsLeaving && !(Random.Range(0f, 1f) > 0.2f)) { NetworkHandler.Instance.CreateLightFlashRpc(((Component)Plugin.localPlayer.bodyParts[5]).transform.position); Plugin.localPlayer.KillPlayer(Vector3.zero, false, (CauseOfDeath)0, 0, default(Vector3), false); PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new OnRemoveActionEffect((Action)delegate { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown Plugin.logger.LogDebug((object)"PerfectCandyExtraLife start"); PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new OnRemoveActionEffect((Action)delegate { //IL_0045: 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) Plugin.logger.LogDebug((object)"PerfectCandyRevive start"); if (!Plugin.localPlayer.isPlayerControlled || Plugin.localPlayer.isPlayerDead) { NetworkHandler.Instance.RevivePlayerRpc(Plugin.localPlayer.actualClientId, default(Vector3)); Plugin.localPlayer.health = 200; } }, "SCP-983-1", "PerfectCandyRevive", 10f, (Func)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)2), true, true, false)); }, "SCP-983-1", "PerfectCandyExtraLife", 0f, (Func)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)2), true, true, false)); } }, "SCP-983-1", "PerfectCandyEffect", (float)Random.Range(10, 301), (Func)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)2), true, true, false)); break; case CandyType.Good: PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).RemoveEffect((Func)((StatusEffect e) => e.id == "SCP-983_Aging")); break; case CandyType.Bad: PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new OnRemoveActionEffect((Action)delegate { //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown Plugin.logger.LogDebug((object)"BadCandyEffect start"); if (Plugin.localPlayer.isPlayerControlled && !Plugin.localPlayer.isPlayerDead) { Utils.DisplayStatusEffect("WARNING: You are aging extremely fast"); PlayerControllerBExtensions.StatusEffectController(Plugin.localPlayer).ApplyEffect((StatusEffect)new LerpValueEffect((Action)delegate(float x) { VignetteOverlay.SetIntensity(Mathf.Max(VignetteOverlay.currentIntensity, x), 0.01f); Plugin.localPlayer.sprintMeter = Mathf.Min(Plugin.localPlayer.sprintMeter, 1f - x); Plugin.localPlayer.isExhausted = true; if (x > 0.8f) { SoundManager.Instance.earsRingingTimer = 1f; } AudioListener.volume = Mathf.Min(AudioListener.volume, 1f - x); }, 0f, 1f, 10f, "SCP-983-1", "BadCandyAging", (Func)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)2), (Action)delegate { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) Plugin.logger.LogDebug((object)"BadCandyAging OnRemove"); if (Plugin.localPlayer.isPlayerControlled && !Plugin.localPlayer.isPlayerDead) { Plugin.localPlayer.KillPlayer(Vector3.zero, true, (CauseOfDeath)0, 0, default(Vector3), false); AudioListener.volume = IngamePlayerSettings.Instance.settings.masterVolume; } }, true, true, false)); } }, "SCP-983-1", "BadCandyEffect", 10f, (Func)((StatusEffect existing, StatusEffect incoming) => (ConflictResult)2), true, true, false)); break; } ((GrabbableObject)this).playerHeldBy.statusEffectAudio.PlayOneShot(eatCandySFX, 1f); ((GrabbableObject)this).playerHeldBy.DespawnHeldObject(); } [Rpc(/*Could not decode attribute arguments.*/)] public void ChangeCandyTypeRpc(CandyType candyType) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(560935390u, val3, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref candyType, default(ForEnums)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 560935390u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; this.candyType = candyType; MeshRenderer[] array = renderers; foreach (MeshRenderer val4 in array) { ((Renderer)val4).material = materials[(int)candyType]; } } } protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(560935390u, new RpcReceiveHandler(__rpc_handler_560935390), "ChangeCandyTypeRpc"); ((PhysicsProp)this).__initializeRpcs(); } private static void __rpc_handler_560935390(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) { CandyType candyType = default(CandyType); ((FastBufferReader)(ref reader)).ReadValueSafe(ref candyType, default(ForEnums)); target.__rpc_exec_stage = (__RpcExecStage)1; ((SCP9831Behavior)(object)target).ChangeCandyTypeRpc(candyType); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SCP9831Behavior"; } } public class LightFlash : MonoBehaviour { [SerializeField] private Light light = null; [SerializeField] private AnimationCurve intensityCurve = null; private float timeSinceSpawned; private const float destroyTime = 60f; private void Update() { timeSinceSpawned += Time.deltaTime; if (timeSinceSpawned >= 60f) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } float num = timeSinceSpawned / 60f; float num2 = intensityCurve.Evaluate(num); float intensity = Mathf.Lerp(0f, 40000f, num2); light.intensity = intensity; } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace ProjectSCP.ItemSCPs.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }