Decompiled source of CoolPeopleMod v1.1.3
CoolPeopleMod/Snowlance.CoolPeopleMod.dll
Decompiled 4 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using CoolPeopleMod.Items.PinataPlush; using CoolPeopleMod.Items.RatPlush; using GameNetcodeStuff; using HarmonyLib; using LethalLib.Modules; using Microsoft.CodeAnalysis; using Snowlance.CoolPeopleMod.NetcodePatcher; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; [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("DissonanceVoip")] [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.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("UnityEngine.ARModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.UI")] [assembly: AssemblyCompany("Snowlance.CoolPeopleMod")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.1.3.0")] [assembly: AssemblyInformationalVersion("1.1.3+e7dbcd42107896cfa299d5343f5fb6a71e032d7d")] [assembly: AssemblyProduct("CoolPeopleMod")] [assembly: AssemblyTitle("Snowlance.CoolPeopleMod")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.3.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] internal class <Module> { static <Module>() { } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } public class Spinner : MonoBehaviour { public bool IsBeingUsed = false; private float SpinVelocity = 0f; private float SpinAcceleration = 100f; private float NormalSpinVelocity = 90f; private float CurrentTimer = 0f; private float SpinningTime = 3f; private Quaternion InitialRotation; private Quaternion FromRotation; private void Start() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) InitialRotation = ((Component)this).transform.rotation; } public void StartHyperSpinning(float spinTime) { IsBeingUsed = true; SpinVelocity = NormalSpinVelocity; SpinAcceleration = 1000f; SpinningTime = spinTime; } public void StopHyperSpinning() { //IL_0025: 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) IsBeingUsed = false; SpinVelocity = 0f; SpinAcceleration = 0f; FromRotation = ((Component)this).transform.rotation; } private void Update() { //IL_0096: 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_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) if (IsBeingUsed) { CurrentTimer += Time.deltaTime; if (CurrentTimer >= SpinningTime) { StopHyperSpinning(); CurrentTimer = 0f; } } if (!IsBeingUsed) { ((Component)this).transform.Rotate(Vector3.forward, NormalSpinVelocity * Time.deltaTime); return; } SpinVelocity += SpinAcceleration * Time.deltaTime; ((Component)this).transform.Rotate(Vector3.up, SpinVelocity * Time.deltaTime); ((Component)this).transform.Rotate(Vector3.forward, SpinVelocity * Time.deltaTime); ((Component)this).transform.Rotate(Vector3.right, SpinVelocity * Time.deltaTime); } } namespace CoolPeopleMod { internal class GlitchPlushBehavior : PhysicsProp { private static ManualLogSource logger = Plugin.LoggerInstance; public AnimationCurve grenadeFallCurve; public AnimationCurve grenadeVerticalFallCurve; public AnimationCurve grenadeVerticalFallCurveNoBounce; public AudioSource ItemAudio; public AudioClip BaldSFX; public AudioClip DefaultSFX; public AudioClip RodrigoSFX; public Animator ItemAnimator; public Material HairMat; public SkinnedMeshRenderer HairRenderer; private Random? random; private bool initializedRandomSeed; private Ray grenadeThrowRay; private RaycastHit grenadeHit; private int stunGrenadeMask = 268437761; private int explodeGlitchChance = 500; private bool isThrown; public override void Start() { ((GrabbableObject)this).Start(); if (!RoundManager.Instance.hasInitializedLevelRandomSeed) { RoundManager.Instance.InitializeRandomNumberGenerators(); } logger.LogDebug((object)"initialized random number generators"); if (Plugin.localPlayer.playerSteamId == 76561198984467725L || TESTING.testing) { ((Renderer)HairRenderer).material = HairMat; } } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_00fb: 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) ((GrabbableObject)this).ItemActivate(used, buttonDown); if (((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198253760639L || ((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198984467725L || TESTING.testing) { if (!initializedRandomSeed) { int seed = StartOfRound.Instance.randomMapSeed + 158; logger.LogDebug((object)("Assigning new random with seed: " + seed)); random = new Random(seed); initializedRandomSeed = true; } if (random.Next(1, explodeGlitchChance + 1) == 1) { Landmine.SpawnExplosion(((Component)this).transform.position, true, 10f, 6f, 50, 0f, (GameObject)null, false); return; } isThrown = true; ((GrabbableObject)this).playerHeldBy.DiscardHeldObject(true, (NetworkObject)null, GetGrenadeThrowDestination(((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform), true); ItemAudio.PlayOneShot(BaldSFX); } else if (((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198164429786L) { ItemAnimator.SetTrigger("squeeze"); ItemAudio.PlayOneShot(RodrigoSFX); } else { ItemAnimator.SetTrigger("squeeze"); ItemAudio.PlayOneShot(DefaultSFX); } } public Vector3 GetGrenadeThrowDestination(Transform ejectPoint) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: 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_002b: 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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_0088: 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_008d: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_0106: 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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; Debug.DrawRay(ejectPoint.position, ejectPoint.forward, Color.yellow, 15f); grenadeThrowRay = new Ray(ejectPoint.position, ejectPoint.forward); position = ((!Physics.Raycast(grenadeThrowRay, ref grenadeHit, 12f, stunGrenadeMask, (QueryTriggerInteraction)1)) ? ((Ray)(ref grenadeThrowRay)).GetPoint(10f) : ((Ray)(ref grenadeThrowRay)).GetPoint(((RaycastHit)(ref grenadeHit)).distance - 0.05f)); Debug.DrawRay(position, Vector3.down, Color.blue, 15f); grenadeThrowRay = new Ray(position, Vector3.down); position = ((!Physics.Raycast(grenadeThrowRay, ref grenadeHit, 30f, stunGrenadeMask, (QueryTriggerInteraction)1)) ? ((Ray)(ref grenadeThrowRay)).GetPoint(30f) : (((RaycastHit)(ref grenadeHit)).point + Vector3.up * 0.05f)); return position + new Vector3(Random.Range(-1f, 1f), 0f, Random.Range(-1f, 1f)); } public override void FallWithCurve() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //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_0031: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: 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_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011a: 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) Vector3 val = ((GrabbableObject)this).startFallingPosition - ((GrabbableObject)this).targetFloorPosition; float magnitude = ((Vector3)(ref val)).magnitude; Quaternion val2 = Quaternion.Euler(((GrabbableObject)this).itemProperties.restingRotation.x, ((Component)this).transform.eulerAngles.y, ((GrabbableObject)this).itemProperties.restingRotation.z); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, val2, 14f * Time.deltaTime / magnitude); ((Component)this).transform.localPosition = Vector3.Lerp(((GrabbableObject)this).startFallingPosition, ((GrabbableObject)this).targetFloorPosition, grenadeFallCurve.Evaluate(((GrabbableObject)this).fallTime)); if (magnitude > 5f) { ((Component)this).transform.localPosition = Vector3.Lerp(new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).startFallingPosition.y, ((Component)this).transform.localPosition.z), new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).targetFloorPosition.y, ((Component)this).transform.localPosition.z), grenadeVerticalFallCurveNoBounce.Evaluate(((GrabbableObject)this).fallTime)); } else { ((Component)this).transform.localPosition = Vector3.Lerp(new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).startFallingPosition.y, ((Component)this).transform.localPosition.z), new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).targetFloorPosition.y, ((Component)this).transform.localPosition.z), grenadeVerticalFallCurve.Evaluate(((GrabbableObject)this).fallTime)); } ((GrabbableObject)this).fallTime = ((GrabbableObject)this).fallTime + Mathf.Abs(Time.deltaTime * 12f / magnitude); } public override void OnHitGround() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).OnHitGround(); if (isThrown) { Landmine.SpawnExplosion(((Component)this).transform.position + Vector3.up, true, 1.5f, 5.7f, 50, 0f, (GameObject)null, false); isThrown = false; } } protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "GlitchPlushBehavior"; } } public class StatusEffectController : MonoBehaviour { private static StatusEffectController _instance; private static ManualLogSource logger = Plugin.LoggerInstance; private Coroutine statusNegationCoroutine; private Coroutine damageReductionCoroutine; private Coroutine infiniteSprintCoroutine; private Coroutine increasedMovementSpeedCoroutine; public int statusNegationSeconds = 0; public int damageReductionSeconds = 0; public int infiniteSprintSeconds = 0; public int increasedMovementSpeedSeconds = 0; public int damageReductionPercent = 0; public int increasedMovementSpeedPercent = 0; public float freezeSprintMeter; public float baseMovementSpeed = 4.6f; public int bulletProofMultiplier = 0; private readonly string[] effectNames = new string[7] { "HealPlayer", "RestoreStamina", "HealthRegen", "StatusNegation", "DamageReduction", "InfiniteSprint", "IncreasedMovementSpeed" }; private Dictionary<string, MethodInfo> effectMethods = null; public float pitchAdjust; public static StatusEffectController Instance { get { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown if ((Object)(object)_instance == (Object)null) { _instance = Object.FindObjectOfType<StatusEffectController>(); if ((Object)(object)_instance == (Object)null) { GameObject val = new GameObject("SCP-956 StatusEffectController"); _instance = val.AddComponent<StatusEffectController>(); } } return _instance; } } private void Awake() { if ((Object)(object)_instance == (Object)null) { _instance = this; Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); } else if ((Object)(object)this != (Object)(object)_instance) { Object.Destroy((Object)(object)((Component)this).gameObject); } effectMethods = new Dictionary<string, MethodInfo>(); MethodInfo[] methods = typeof(StatusEffectController).GetMethods(BindingFlags.Instance | BindingFlags.Public); foreach (MethodInfo methodInfo in methods) { if (effectNames.Contains(methodInfo.Name)) { effectMethods[methodInfo.Name] = methodInfo; } } logger.LogDebug((object)("Effect methods: " + string.Join(", ", effectMethods.Keys))); } public void ApplyCandyEffects(string config) { string[] array = config.Split(new char[1] { ';' }, StringSplitOptions.RemoveEmptyEntries); string[] array2 = array; foreach (string text in array2) { string[] array3 = text.Split(new char[1] { ':' }, 2); if (array3.Length != 2) { continue; } string text2 = array3[0].Trim(); string[] array4 = array3[1].Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries); if (!effectMethods.TryGetValue(text2, out MethodInfo value)) { continue; } try { ParameterInfo[] parameters = value.GetParameters(); object[] array5 = new object[parameters.Length]; for (int j = 0; j < parameters.Length; j++) { if (j < array4.Length) { array5[j] = Convert.ChangeType(array4[j], parameters[j].ParameterType); continue; } if (parameters[j].IsOptional) { array5[j] = parameters[j].DefaultValue; continue; } throw new ArgumentException("Not enough parameters provided for non-optional parameters."); } value.Invoke(Instance, array5); } catch (Exception ex) { logger.LogError((object)("Failed to apply effect " + text2 + ": " + ex.Message)); } } } public void HealPlayer(int amount, bool overHeal = false) { logger.LogDebug((object)("Healing: " + amount)); PlayerControllerB localPlayer = Plugin.localPlayer; localPlayer.MakeCriticallyInjured(false); int num = localPlayer.health + amount; if (num > 100 && !overHeal) { num = 100; } localPlayer.health = num; HUDManager.Instance.UpdateHealthUI(num, false); } public void RestoreStamina(int percent) { float num = (float)percent / 100f; float sprintMeter = Plugin.localPlayer.sprintMeter + 1f * num; Plugin.localPlayer.sprintMeter = sprintMeter; } public void HealthRegen(int hpPerSecond, int seconds) { ((MonoBehaviour)this).StartCoroutine(HealthRegenCoroutine(hpPerSecond, seconds)); } public void StatusNegation(int seconds, bool timeStackable = false) { if (statusNegationCoroutine != null) { if (timeStackable) { statusNegationSeconds += seconds; return; } ((MonoBehaviour)this).StopCoroutine(statusNegationCoroutine); } statusNegationCoroutine = ((MonoBehaviour)this).StartCoroutine(StatusNegationCoroutine(seconds)); } public void DamageReduction(int seconds, int percent, bool timeStackable = false, bool stackable = false) { if (damageReductionCoroutine != null) { if (timeStackable) { damageReductionSeconds += seconds; } if (stackable) { damageReductionPercent += percent; } if (timeStackable || stackable) { return; } ((MonoBehaviour)this).StopCoroutine(damageReductionCoroutine); } damageReductionCoroutine = ((MonoBehaviour)this).StartCoroutine(DamageReductionCoroutine(seconds, percent)); } public void InfiniteSprint(int seconds, bool timeStackable = false) { if (infiniteSprintCoroutine != null) { if (timeStackable) { infiniteSprintSeconds += seconds; return; } ((MonoBehaviour)this).StopCoroutine(infiniteSprintCoroutine); } infiniteSprintCoroutine = ((MonoBehaviour)this).StartCoroutine(InfiniteSprintCoroutine(seconds)); } public void IncreasedMovementSpeed(int seconds, int percent, bool timeStackable = false, bool stackable = false) { if (increasedMovementSpeedCoroutine != null) { if (timeStackable) { increasedMovementSpeedSeconds += seconds; } if (stackable) { increasedMovementSpeedPercent += percent; } if (timeStackable || stackable) { return; } ((MonoBehaviour)this).StopCoroutine(increasedMovementSpeedCoroutine); if (baseMovementSpeed != 0f) { Plugin.localPlayer.movementSpeed = baseMovementSpeed; } } increasedMovementSpeedCoroutine = ((MonoBehaviour)this).StartCoroutine(IncreasedMovementSpeedCoroutine(seconds, percent)); } public void DamagePlayerOverTime(int damage, int perSeconds, bool untilDead = false, int totalSeconds = 10) { ((MonoBehaviour)this).StartCoroutine(DamagePlayerOverTimeCoroutine(damage, perSeconds, untilDead, totalSeconds)); } private IEnumerator HealthRegenCoroutine(int hpPerSecond, int seconds) { for (int i = 0; i < seconds; i++) { HealPlayer(hpPerSecond); yield return (object)new WaitForSecondsRealtime(1f); } } private IEnumerator StatusNegationCoroutine(int seconds) { statusNegationSeconds = seconds; while (statusNegationSeconds > 0) { logger.LogDebug((object)("Status Negation: " + statusNegationSeconds)); statusNegationSeconds--; yield return (object)new WaitForSecondsRealtime(1f); } statusNegationSeconds = 0; statusNegationCoroutine = null; } private IEnumerator DamageReductionCoroutine(int seconds, int percent) { damageReductionSeconds = seconds; damageReductionPercent = percent; while (damageReductionSeconds > 0) { logger.LogDebug((object)("Damage Reduction: " + damageReductionPercent + " " + damageReductionSeconds)); damageReductionSeconds--; yield return (object)new WaitForSecondsRealtime(1f); } damageReductionPercent = 0; damageReductionSeconds = 0; damageReductionCoroutine = null; } private IEnumerator InfiniteSprintCoroutine(int seconds) { freezeSprintMeter = Plugin.localPlayer.sprintMeter; infiniteSprintSeconds = seconds; while (infiniteSprintSeconds > 0) { infiniteSprintSeconds--; logger.LogDebug((object)("Infinite sprint: " + infiniteSprintSeconds)); yield return (object)new WaitForSecondsRealtime(1f); } infiniteSprintSeconds = 0; infiniteSprintCoroutine = null; } private IEnumerator IncreasedMovementSpeedCoroutine(int seconds, int percent) { baseMovementSpeed = Plugin.localPlayer.movementSpeed; increasedMovementSpeedSeconds = seconds; increasedMovementSpeedPercent = percent; while (increasedMovementSpeedSeconds > 0) { float movementSpeedMultiplier = 1f + (float)increasedMovementSpeedPercent / 100f; Plugin.localPlayer.movementSpeed = baseMovementSpeed * movementSpeedMultiplier; increasedMovementSpeedSeconds--; logger.LogDebug((object)("Increased movement speed: " + increasedMovementSpeedPercent + "% " + increasedMovementSpeedSeconds)); yield return (object)new WaitForSecondsRealtime(1f); } increasedMovementSpeedPercent = 0; Plugin.localPlayer.movementSpeed = baseMovementSpeed; increasedMovementSpeedSeconds = 0; increasedMovementSpeedCoroutine = null; } private IEnumerator DamagePlayerOverTimeCoroutine(int damage, int perSeconds, bool untilDead, int totalSeconds) { if (untilDead) { while (!Plugin.localPlayer.isPlayerDead) { Plugin.localPlayer.inSpecialInteractAnimation = true; Plugin.localPlayer.DamagePlayer(damage, false, true, (CauseOfDeath)0, 0, false, default(Vector3)); HUDManager.Instance.ShakeCamera((ScreenShakeType)0); Plugin.localPlayer.inSpecialInteractAnimation = false; HUDManager.Instance.UpdateHealthUI(Plugin.localPlayer.health, false); yield return (object)new WaitForSecondsRealtime((float)perSeconds); } } else { int seconds = 0; while (seconds < totalSeconds) { Plugin.localPlayer.DamagePlayer(damage, false, true, (CauseOfDeath)0, 0, false, default(Vector3)); seconds += perSeconds; yield return (object)new WaitForSecondsRealtime((float)perSeconds); } } } } internal class TESTING : MonoBehaviour { public static bool testing; private static ManualLogSource logger = Plugin.LoggerInstance; public static bool mimic = true; [HarmonyPostfix] [HarmonyPatch(typeof(HUDManager), "PingScan_performed")] public static void PingScan_performedPostFix() { } [HarmonyPrefix] [HarmonyPatch(typeof(HUDManager), "SubmitChat_performed")] public static void SubmitChat_performedPrefix(HUDManager __instance) { try { string text = __instance.chatTextField.text; string[] array = text.Split(" "); switch (array[0]) { case "/mimic": mimic = !mimic; HUDManager.Instance.DisplayTip("Mimic Spawning", testing.ToString(), false, false, "LC_Tip1"); break; case "/testing": testing = !testing; HUDManager.Instance.DisplayTip("Testing", testing.ToString(), false, false, "LC_Tip1"); break; case "/crash": Application.Quit(); break; case "/refresh": RoundManager.Instance.RefreshEnemiesList(); HoarderBugAI.RefreshGrabbableObjectsInMapList(); break; case "/levels": { SelectableLevel[] levels = StartOfRound.Instance.levels; foreach (SelectableLevel val2 in levels) { logger.LogDebug((object)((Object)val2).name); } break; } case "/dungeon": logger.LogDebug((object)((Object)RoundManager.Instance.dungeonGenerator.Generator.DungeonFlow).name); break; case "/dungeons": { IndoorMapType[] dungeonFlowTypes = RoundManager.Instance.dungeonFlowTypes; foreach (IndoorMapType val in dungeonFlowTypes) { logger.LogDebug((object)((Object)val.dungeonFlow).name); } break; } } } catch { logger.LogError((object)"Invalid chat command"); } } } [BepInPlugin("Snowlance.CoolPeopleMod", "CoolPeopleMod", "1.1.3")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public static Plugin PluginInstance; public static ManualLogSource LoggerInstance; private readonly Harmony harmony = new Harmony("Snowlance.CoolPeopleMod"); public static AssetBundle? ModAssets; public const ulong RodrigoSteamID = 76561198164429786uL; public const ulong LizzieSteamID = 76561199094139351uL; public const ulong GlitchSteamID = 76561198984467725uL; public const ulong RatSteamID = 76561199182474292uL; public const ulong XuSteamID = 76561198399127090uL; public const ulong SlayerSteamID = 76561198077184650uL; public const ulong SnowySteamID = 76561198253760639uL; public const ulong FunoSteamID = 76561198993437314uL; public static ConfigEntry<string> configGlitchPlushLevelRarities; public static ConfigEntry<string> configGlitchPlushCustomLevelRarities; public static ConfigEntry<int> configGlitchPlushMinValue; public static ConfigEntry<int> configGlitchPlushMaxValue; public static ConfigEntry<string> configPinataPlushLevelRarities; public static ConfigEntry<string> configPinataPlushCustomLevelRarities; public static ConfigEntry<int> configPinataPlushMinValue; public static ConfigEntry<int> configPinataPlushMaxValue; public static ConfigEntry<string> configSCP999PlushLevelRarities; public static ConfigEntry<string> configSCP999PlushCustomLevelRarities; public static ConfigEntry<int> configSCP999PlushMinValue; public static ConfigEntry<int> configSCP999PlushMaxValue; public static ConfigEntry<string> configDiceMimicPlushLevelRarities; public static ConfigEntry<string> configDiceMimicPlushCustomLevelRarities; public static ConfigEntry<int> configDiceMimicPlushMinValue; public static ConfigEntry<int> configDiceMimicPlushMaxValue; public static ConfigEntry<string> configRatPlushLevelRarities; public static ConfigEntry<string> configRatPlushCustomLevelRarities; public static ConfigEntry<int> configRatPlushMinValue; public static ConfigEntry<int> configRatPlushMaxValue; public static ConfigEntry<string> configFunoPlushLevelRarities; public static ConfigEntry<string> configFunoPlushCustomLevelRarities; public static ConfigEntry<int> configFunoPlushMinValue; public static ConfigEntry<int> configFunoPlushMaxValue; public static PlayerControllerB localPlayer => GameNetworkManager.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).First(); } private void Awake() { if ((Object)(object)PluginInstance == (Object)null) { PluginInstance = this; } LoggerInstance = ((BaseUnityPlugin)PluginInstance).Logger; harmony.PatchAll(); InitializeNetworkBehaviours(); configGlitchPlushLevelRarities = ((BaseUnityPlugin)this).Config.Bind<string>("GlitchPlush", "Level Rarities", "All: 10", "Rarities for each level. See default for formatting."); configGlitchPlushCustomLevelRarities = ((BaseUnityPlugin)this).Config.Bind<string>("GlitchPlush", "Custom Level Rarities", "", "Rarities for modded levels. Same formatting as level rarities."); configGlitchPlushMinValue = ((BaseUnityPlugin)this).Config.Bind<int>("GlitchPlush", "Min Value", 150, "Minimum scrap value."); configGlitchPlushMaxValue = ((BaseUnityPlugin)this).Config.Bind<int>("GlitchPlush", "Max Value", 200, "Maximum scrap value."); configPinataPlushLevelRarities = ((BaseUnityPlugin)this).Config.Bind<string>("PinataPlush", "Level Rarities", "All: 10", "Rarities for each level. See default for formatting."); configPinataPlushCustomLevelRarities = ((BaseUnityPlugin)this).Config.Bind<string>("PinataPlush", "Custom Level Rarities", "", "Rarities for modded levels. Same formatting as level rarities."); configPinataPlushMinValue = ((BaseUnityPlugin)this).Config.Bind<int>("PinataPlush", "Min Value", 150, "Minimum scrap value."); configPinataPlushMaxValue = ((BaseUnityPlugin)this).Config.Bind<int>("PinataPlush", "Max Value", 200, "Maximum scrap value."); configSCP999PlushLevelRarities = ((BaseUnityPlugin)this).Config.Bind<string>("SCP999Plush", "Level Rarities", "All: 10", "Rarities for each level. See default for formatting."); configSCP999PlushCustomLevelRarities = ((BaseUnityPlugin)this).Config.Bind<string>("SCP999Plush", "Custom Level Rarities", "", "Rarities for modded levels. Same formatting as level rarities."); configSCP999PlushMinValue = ((BaseUnityPlugin)this).Config.Bind<int>("SCP999Plush", "Min Value", 150, "Minimum scrap value."); configSCP999PlushMaxValue = ((BaseUnityPlugin)this).Config.Bind<int>("SCP999Plush", "Max Value", 200, "Maximum scrap value."); configDiceMimicPlushLevelRarities = ((BaseUnityPlugin)this).Config.Bind<string>("DiceMimicPlush", "Level Rarities", "All: 10", "Rarities for each level. See default for formatting."); configDiceMimicPlushCustomLevelRarities = ((BaseUnityPlugin)this).Config.Bind<string>("DiceMimicPlush", "Custom Level Rarities", "", "Rarities for modded levels. Same formatting as level rarities."); configDiceMimicPlushMinValue = ((BaseUnityPlugin)this).Config.Bind<int>("DiceMimicPlush", "Min Value", 150, "Minimum scrap value."); configDiceMimicPlushMaxValue = ((BaseUnityPlugin)this).Config.Bind<int>("DiceMimicPlush", "Max Value", 200, "Maximum scrap value."); configRatPlushLevelRarities = ((BaseUnityPlugin)this).Config.Bind<string>("RatPlush", "Level Rarities", "All: 12", "Rarities for each level. See default for formatting."); configRatPlushCustomLevelRarities = ((BaseUnityPlugin)this).Config.Bind<string>("RatPlush", "Custom Level Rarities", "", "Rarities for modded levels. Same formatting as level rarities."); configRatPlushMinValue = ((BaseUnityPlugin)this).Config.Bind<int>("RatPlush", "Min Value", 150, "Minimum scrap value."); configRatPlushMaxValue = ((BaseUnityPlugin)this).Config.Bind<int>("RatPlush", "Max Value", 200, "Maximum scrap value."); configFunoPlushLevelRarities = ((BaseUnityPlugin)this).Config.Bind<string>("FunoPlush", "Level Rarities", "All: 8", "Rarities for each level. See default for formatting."); configFunoPlushCustomLevelRarities = ((BaseUnityPlugin)this).Config.Bind<string>("FunoPlush", "Custom Level Rarities", "", "Rarities for modded levels. Same formatting as level rarities."); configFunoPlushMinValue = ((BaseUnityPlugin)this).Config.Bind<int>("FunoPlush", "Min Value", 150, "Minimum scrap value."); configFunoPlushMaxValue = ((BaseUnityPlugin)this).Config.Bind<int>("FunoPlush", "Max Value", 200, "Maximum scrap value."); new StatusEffectController(); string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); ModAssets = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "cool_assets")); if ((Object)(object)ModAssets == (Object)null) { ((BaseUnityPlugin)this).Logger.LogError((object)"Failed to load custom assets."); return; } LoggerInstance.LogDebug((object)("Got AssetBundle at: " + Path.Combine(directoryName, "cool_assets"))); Item val = ModAssets.LoadAsset<Item>("Assets/ModAssets/Glitch/GlitchPlushItem.asset"); if ((Object)(object)val == (Object)null) { LoggerInstance.LogError((object)"Error: Couldnt get GlitchPlush from assets"); return; } LoggerInstance.LogDebug((object)"Got GlitchPlush prefab"); val.minValue = configGlitchPlushMinValue.Value; val.maxValue = configGlitchPlushMaxValue.Value; NetworkPrefabs.RegisterNetworkPrefab(val.spawnPrefab); Utilities.FixMixerGroups(val.spawnPrefab); Items.RegisterScrap(val, GetLevelRarities(configGlitchPlushLevelRarities.Value), GetCustomLevelRarities(configGlitchPlushCustomLevelRarities.Value)); Item val2 = ModAssets.LoadAsset<Item>("Assets/ModAssets/Snowy/PinataPlushItem.asset"); if ((Object)(object)val2 == (Object)null) { LoggerInstance.LogError((object)"Error: Couldnt get PinataPlush from assets"); return; } LoggerInstance.LogDebug((object)"Got PinataPlush prefab"); val2.minValue = configPinataPlushMinValue.Value; val2.maxValue = configPinataPlushMaxValue.Value; NetworkPrefabs.RegisterNetworkPrefab(val2.spawnPrefab); Utilities.FixMixerGroups(val2.spawnPrefab); Items.RegisterScrap(val2, GetLevelRarities(configPinataPlushLevelRarities.Value), GetCustomLevelRarities(configPinataPlushCustomLevelRarities.Value)); Item val3 = ModAssets.LoadAsset<Item>("Assets/ModAssets/Lizzie/SCP999PlushItem.asset"); if ((Object)(object)val3 == (Object)null) { LoggerInstance.LogError((object)"Error: Couldnt get SCP999Plush from assets"); return; } LoggerInstance.LogDebug((object)"Got SCP999Plush prefab"); val3.minValue = configSCP999PlushMinValue.Value; val3.maxValue = configSCP999PlushMaxValue.Value; NetworkPrefabs.RegisterNetworkPrefab(val3.spawnPrefab); Utilities.FixMixerGroups(val3.spawnPrefab); Items.RegisterScrap(val3, GetLevelRarities(configSCP999PlushLevelRarities.Value), GetCustomLevelRarities(configSCP999PlushCustomLevelRarities.Value)); Item val4 = ModAssets.LoadAsset<Item>("Assets/ModAssets/Slayer/DiceMimicItem.asset"); if ((Object)(object)val4 == (Object)null) { LoggerInstance.LogError((object)"Error: Couldnt get DiceMimicPlush from assets"); return; } LoggerInstance.LogDebug((object)"Got DiceMimicPlush prefab"); val4.minValue = configDiceMimicPlushMinValue.Value; val4.maxValue = configDiceMimicPlushMaxValue.Value; NetworkPrefabs.RegisterNetworkPrefab(val4.spawnPrefab); Utilities.FixMixerGroups(val4.spawnPrefab); Items.RegisterScrap(val4, GetLevelRarities(configDiceMimicPlushLevelRarities.Value), GetCustomLevelRarities(configDiceMimicPlushCustomLevelRarities.Value)); Item val5 = ModAssets.LoadAsset<Item>("Assets/ModAssets/Rat/RatPlushItem.asset"); if ((Object)(object)val5 == (Object)null) { LoggerInstance.LogError((object)"Error: Couldnt get RatPlush from assets"); return; } LoggerInstance.LogDebug((object)"Got RatPlush prefab"); val5.minValue = configRatPlushMinValue.Value; val5.maxValue = configRatPlushMaxValue.Value; NetworkPrefabs.RegisterNetworkPrefab(val5.spawnPrefab); Utilities.FixMixerGroups(val5.spawnPrefab); Items.RegisterScrap(val5, GetLevelRarities(configRatPlushLevelRarities.Value), GetCustomLevelRarities(configRatPlushCustomLevelRarities.Value)); Item val6 = ModAssets.LoadAsset<Item>("Assets/ModAssets/Funo/FunoPlushItem.asset"); if ((Object)(object)val6 == (Object)null) { LoggerInstance.LogError((object)"Error: Couldnt get FunoPlush from assets"); return; } LoggerInstance.LogDebug((object)"Got FunoPlush prefab"); val6.minValue = configFunoPlushMinValue.Value; val6.maxValue = configFunoPlushMaxValue.Value; NetworkPrefabs.RegisterNetworkPrefab(val6.spawnPrefab); Utilities.FixMixerGroups(val6.spawnPrefab); Items.RegisterScrap(val6, GetLevelRarities(configFunoPlushLevelRarities.Value), GetCustomLevelRarities(configFunoPlushCustomLevelRarities.Value)); ((BaseUnityPlugin)this).Logger.LogInfo((object)"Snowlance.CoolPeopleMod v1.1.3 has loaded!"); } public Dictionary<LevelTypes, int> GetLevelRarities(string levelsString) { //IL_0091: Unknown result type (might be due to invalid IL or missing references) try { Dictionary<LevelTypes, int> dictionary = new Dictionary<LevelTypes, int>(); if (levelsString != null && levelsString != "") { string[] array = levelsString.Split(','); string[] array2 = array; foreach (string text in array2) { string[] array3 = text.Split(':'); if (array3.Length == 2) { string text2 = array3[0].Trim(); string text3 = array3[1].Trim(); if (Enum.TryParse<LevelTypes>(text2, out LevelTypes result) && int.TryParse(text3, out var result2)) { dictionary.Add(result, result2); } else { LoggerInstance.LogError((object)("Error: Invalid level rarity: " + text2 + ":" + text3)); } } } } return dictionary; } catch (Exception arg) { ((BaseUnityPlugin)this).Logger.LogError((object)$"Error: {arg}"); return null; } } public Dictionary<string, int> GetCustomLevelRarities(string levelsString) { try { Dictionary<string, int> dictionary = new Dictionary<string, int>(); if (levelsString != null) { string[] array = levelsString.Split(','); string[] array2 = array; foreach (string text in array2) { string[] array3 = text.Split(':'); if (array3.Length == 2) { string text2 = array3[0].Trim(); string text3 = array3[1].Trim(); if (int.TryParse(text3, out var result)) { dictionary.Add(text2, result); } else { LoggerInstance.LogError((object)("Error: Invalid level rarity: " + text2 + ":" + text3)); } } } } return dictionary; } catch (Exception arg) { ((BaseUnityPlugin)this).Logger.LogError((object)$"Error: {arg}"); return null; } } public static void FreezePlayer(PlayerControllerB player, bool value) { player.disableInteract = value; player.disableLookInput = value; player.disableMoveInput = value; } 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); } } } LoggerInstance.LogDebug((object)"Finished initializing network behaviours"); } } internal static class Utils { private static ManualLogSource logger = Plugin.LoggerInstance; public static bool CalculatePath(Vector3 fromPos, Vector3 toPos) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //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_0022: 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_0033: 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_003f: Expected O, but got Unknown //IL_003f: 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_005a: 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_0075: Unknown result type (might be due to invalid IL or missing references) Vector3 navMeshPosition = RoundManager.Instance.GetNavMeshPosition(fromPos, RoundManager.Instance.navHit, 1.75f, -1); Vector3 navMeshPosition2 = RoundManager.Instance.GetNavMeshPosition(toPos, RoundManager.Instance.navHit, 1.75f, -1); NavMeshPath val = new NavMeshPath(); return NavMesh.CalculatePath(navMeshPosition, navMeshPosition2, -1, val) && Vector3.Distance(val.corners[val.corners.Length - 1], RoundManager.Instance.GetNavMeshPosition(navMeshPosition2, RoundManager.Instance.navHit, 2.7f, -1)) <= 1.55f; } public static SpawnableEnemyWithRarity getEnemyByName(string name) { string name2 = name; List<SpawnableEnemyWithRarity> list = new List<SpawnableEnemyWithRarity>(); SelectableLevel[] levels = StartOfRound.Instance.levels; foreach (SelectableLevel val in levels) { list = list.Union(val.Enemies).Union(val.OutsideEnemies).Union(val.DaytimeEnemies) .ToList(); } list = (from x in list group x by x.enemyType.enemyName into g select g.First() into x orderby x.enemyType.enemyName select x).ToList(); SpawnableEnemyWithRarity val2 = ((IEnumerable<SpawnableEnemyWithRarity>)list).FirstOrDefault((Func<SpawnableEnemyWithRarity, bool>)((SpawnableEnemyWithRarity x) => x.enemyType.enemyName == name2)); if (val2 == null) { SelectableLevel[] levels2 = StartOfRound.Instance.levels; foreach (SelectableLevel val3 in levels2) { val2 = ((IEnumerable<SpawnableEnemyWithRarity>)val3.Enemies).FirstOrDefault((Func<SpawnableEnemyWithRarity, bool>)((SpawnableEnemyWithRarity x) => x.enemyType.enemyName.ToLower() == name2.ToLower())); if (val2 == null) { val2 = ((IEnumerable<SpawnableEnemyWithRarity>)val3.DaytimeEnemies).FirstOrDefault((Func<SpawnableEnemyWithRarity, bool>)((SpawnableEnemyWithRarity x) => x.enemyType.enemyName.ToLower() == name2.ToLower())); } if (val2 == null) { val2 = ((IEnumerable<SpawnableEnemyWithRarity>)val3.OutsideEnemies).FirstOrDefault((Func<SpawnableEnemyWithRarity, bool>)((SpawnableEnemyWithRarity x) => x.enemyType.enemyName.ToLower() == name2.ToLower())); } } } if (val2 == null) { logger.LogWarning((object)("Enemy '" + name2 + "' not found. Available enemies: " + string.Join(", ", list.Select((SpawnableEnemyWithRarity e) => e.enemyType.enemyName)))); return null; } return val2; } public static Transform? GetRandomNode(bool outside = false) { try { GameObject[] array = (outside ? RoundManager.Instance.outsideAINodes : RoundManager.Instance.insideAINodes); int num = Random.Range(0, array.Length); return array[num].transform; } catch { return null; } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "Snowlance.CoolPeopleMod"; public const string PLUGIN_NAME = "CoolPeopleMod"; public const string PLUGIN_VERSION = "1.1.3"; } } namespace CoolPeopleMod.Patches { [HarmonyPatch(typeof(PlayerControllerB))] internal class PlayerControllerBPatch { private static ManualLogSource logger = Plugin.LoggerInstance; [HarmonyPostfix] [HarmonyPatch("Update")] private static void UpdatePostfix(ref bool ___inTerminalMenu, ref Transform ___thisPlayerBody, ref float ___fallValue) { if (StatusEffectController.Instance.infiniteSprintSeconds > 0) { Plugin.localPlayer.sprintMeter = StatusEffectController.Instance.freezeSprintMeter; } } [HarmonyPrefix] [HarmonyPatch("Update")] private static void UpdatePrefix() { if (StatusEffectController.Instance.statusNegationSeconds > 0) { Plugin.localPlayer.bleedingHeavily = false; Plugin.localPlayer.criticallyInjured = false; Plugin.localPlayer.isMovementHindered = 0; Plugin.localPlayer.isExhausted = false; } } [HarmonyPrefix] [HarmonyPatch("DamagePlayer")] private static void DamagePlayerPrefix(ref int damageNumber, ref CauseOfDeath causeOfDeath) { try { if (StatusEffectController.Instance.damageReductionSeconds > 0) { logger.LogDebug((object)("Applying " + StatusEffectController.Instance.damageReductionPercent + "% damage reduction")); float num = (float)StatusEffectController.Instance.damageReductionPercent / 100f; int num2 = Convert.ToInt32((float)damageNumber * num); int num3 = damageNumber - num2; logger.LogDebug((object)$"Initial damage: {damageNumber}, Damage reduction: {num2}, damage after reduction: {num3}"); damageNumber = num3; } if (StatusEffectController.Instance.bulletProofMultiplier != 0 && (int)causeOfDeath == 7) { float num4 = (float)StatusEffectController.Instance.bulletProofMultiplier * 0.1f; int num5 = (int)((float)damageNumber * num4); int num6 = damageNumber - num5; logger.LogDebug((object)$"Initial damage: {damageNumber}, Damage reduction: {num5}, damage after reduction: {num6}"); damageNumber = num6; } } catch (Exception ex) { logger.LogError((object)("Error in DamagePlayerPrefix: " + ex)); } } } } namespace CoolPeopleMod.Items { internal class CrossPlush { } internal class FunoPlushBehavior : PhysicsProp { public Animator ItemAnimator; public AudioSource ItemAudio; public AudioClip[] FunoSFX; public Material BlackMat; public static float pushDistance = 5f; public static float pushForce = 50f; public override void Start() { ((GrabbableObject)this).Start(); if (Plugin.localPlayer.playerSteamId == 76561198984467725L || TESTING.testing) { ((Renderer)((GrabbableObject)this).mainObjectRenderer).material = BlackMat; } } public override void ItemActivate(bool used, bool buttonDown = true) { //IL_0086: 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_00d9: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemActivate(used, buttonDown); if (buttonDown) { ItemAnimator.SetTrigger("squeeze"); RoundManager.PlayRandomClip(ItemAudio, FunoSFX, true, 1f, 0, 1000); if (((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198993437314L || ((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198253760639L || TESTING.testing) { Landmine.SpawnExplosion(((Component)((GrabbableObject)this).playerHeldBy).transform.position + Vector3.up, true, 0f, 5f, 1, 100f, (GameObject)null, false); PushNearbyPlayers(); } else if (((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198984467725L) { Landmine.SpawnExplosion(((Component)this).transform.position, true, 1f, 5f, 50, 100f, (GameObject)null, false); } } } private Vector3 GetDirectionToPlayer(PlayerControllerB player) { //IL_0007: 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_001c: 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) //IL_0024: 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) Vector3 val = ((Component)player).transform.position - ((Component)this).transform.position; return ((Vector3)(ref val)).normalized; } public void PushNearbyPlayers() { //IL_0042: 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_0069: 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_0082: 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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //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) PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (val.isPlayerControlled && !((Object)(object)val == (Object)(object)((GrabbableObject)this).playerHeldBy) && !(Vector3.Distance(((Component)this).transform.position, ((Component)val).transform.position) > pushDistance)) { Vector3 directionToPlayer = GetDirectionToPlayer(val); val.playerRigidbody.isKinematic = false; val.playerRigidbody.velocity = Vector3.zero; val.externalForceAutoFade += directionToPlayer * pushForce; DropBabyIfHolding(val); val.playerRigidbody.isKinematic = true; } } } private void DropBabyIfHolding(PlayerControllerB player) { //IL_0036: 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) if ((Object)(object)player.currentlyHeldObjectServer != (Object)null && ((Object)player.currentlyHeldObjectServer.itemProperties).name == "CaveDwellerBaby") { player.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true); } } protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "FunoPlushBehavior"; } } internal class LeverPlushBehavior : PhysicsProp { public Animator ItemAnimator; public AudioSource ItemAudio; protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "LeverPlushBehavior"; } } internal class LunxaraPlushBehavior : PhysicsProp { public Animator ItemAnimator; protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "LunxaraPlushBehavior"; } } internal class RedrigoPlushBehavior : PhysicsProp { public Animator ItemAnimator; public AudioSource ItemAudio; public GameObject SeaminePrefab; protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "RedrigoPlushBehavior"; } } internal class SCP999PlushBehavior : PhysicsProp { public Animator ItemAnimator; public AudioSource ItemAudio; public AudioClip[] HugSFX; public AudioClip[] RoamSFX; private Coroutine? hugRoutine; public static int healthPerSecond = 2; public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (!buttonDown) { return; } if (((GrabbableObject)this).playerHeldBy.playerSteamId == 76561199094139351L || ((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198253760639L || TESTING.testing) { RoundManager.PlayRandomClip(ItemAudio, HugSFX, true, 1f, 0, 1000); if (hugRoutine == null) { hugRoutine = ((MonoBehaviour)this).StartCoroutine(HugCoroutine()); } } else { ItemAnimator.SetTrigger("squeeze"); RoundManager.PlayRandomClip(ItemAudio, RoamSFX, true, 1f, 0, 1000); } } private IEnumerator HugCoroutine() { ItemAnimator.SetBool("hug", true); while ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && ((GrabbableObject)this).playerHeldBy.health < 100 && !((GrabbableObject)this).isPocketed) { PlayerControllerB playerHeldBy = ((GrabbableObject)this).playerHeldBy; playerHeldBy.health += healthPerSecond; if ((Object)(object)((GrabbableObject)this).playerHeldBy == (Object)(object)Plugin.localPlayer) { HUDManager.Instance.UpdateHealthUI(Plugin.localPlayer.health, false); } yield return (object)new WaitForSecondsRealtime(1f); } yield return (object)new WaitForSecondsRealtime(3f); ItemAnimator.SetBool("hug", false); hugRoutine = null; } protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SCP999PlushBehavior"; } } } namespace CoolPeopleMod.Items.RatPlush { internal class RatPlushBehavior : PhysicsProp { public AudioSource ItemAudio; public AudioClip[] BirthdaySFX; public Animator ItemAnimator; public GameObject RatPrefab; private RatScript? currentRat; public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (buttonDown) { RoundManager.PlayRandomClip(ItemAudio, BirthdaySFX, true, 1f, 0, 1000); ItemAnimator.SetTrigger("squeeze"); if (!IsSlayerInGame() && (((GrabbableObject)this).playerHeldBy.playerSteamId == 76561199182474292L || ((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198253760639L || TESTING.testing)) { TrySpawnRatOnServer(); } } } private void TrySpawnRatOnServer() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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_00bf: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.IsServerOrHost || !((GrabbableObject)this).playerHeldBy.isInsideFactory) { return; } Vector3 toPos = RoundManager.FindMainEntrancePosition(true, false); if (Utils.CalculatePath(((Component)((GrabbableObject)this).playerHeldBy).transform.position, toPos)) { if ((Object)(object)currentRat != (Object)null) { currentRat.DisappearClientRpc(); } float num = 1f; Vector3 val = ((Component)((GrabbableObject)this).playerHeldBy).transform.position + ((Component)((GrabbableObject)this).playerHeldBy).transform.forward * num; currentRat = Object.Instantiate<GameObject>(RatPrefab, val, ((Component)((GrabbableObject)this).playerHeldBy).transform.rotation).GetComponent<RatScript>(); ((NetworkBehaviour)currentRat).NetworkObject.Spawn(true); } } private bool IsSlayerInGame() { PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (val.playerSteamId == 76561198077184650L) { return true; } } return false; } protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "RatPlushBehavior"; } } internal class RatScript : NetworkBehaviour { public AudioSource RatAudio; public AudioClip BirthdayMixtapeSFX; public NavMeshAgent agent; public float AIIntervalTime; public ParticleSystem particleSystem; private float timeSinceAIInterval; private Vector3 mainEntrancePosition; private NavMeshPath path1; private bool moveTowardsDestination; private Vector3 destination; private bool inSpecialAnimation; public void Start() { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) mainEntrancePosition = RoundManager.FindMainEntrancePosition(true, false); } public void Update() { if (Plugin.IsServerOrHost) { timeSinceAIInterval += Time.deltaTime; if (timeSinceAIInterval > AIIntervalTime) { DoAIInterval(); timeSinceAIInterval = 0f; } } } private void DoAIInterval() { //IL_002e: 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_0041: 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) if (!inSpecialAnimation) { if (moveTowardsDestination) { agent.SetDestination(destination); } if (!SetDestinationToPosition(mainEntrancePosition, checkForPath: true) || Vector3.Distance(((Component)this).transform.position, mainEntrancePosition) < 1f) { inSpecialAnimation = true; DisappearClientRpc(); } } } public bool SetDestinationToPosition(Vector3 position, bool checkForPath = false) { //IL_00ad: 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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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_0025: 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_0032: Expected O, but got Unknown //IL_0038: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) if (checkForPath) { position = RoundManager.Instance.GetNavMeshPosition(position, RoundManager.Instance.navHit, 1.75f, -1); path1 = new NavMeshPath(); if (!agent.CalculatePath(position, path1)) { return false; } if (Vector3.Distance(path1.corners[path1.corners.Length - 1], RoundManager.Instance.GetNavMeshPosition(position, RoundManager.Instance.navHit, 2.7f, -1)) > 1.55f) { return false; } } moveTowardsDestination = true; destination = RoundManager.Instance.GetNavMeshPosition(position, RoundManager.Instance.navHit, -1f, -1); return true; } public void Disappear() { particleSystem.Play(); if (Plugin.IsServerOrHost) { ((NetworkBehaviour)this).NetworkObject.Despawn(true); } } private IEnumerator DisappearCoroutine(float delay) { yield return (object)new WaitForSecondsRealtime(delay); ((NetworkBehaviour)this).NetworkObject.Despawn(true); } [ClientRpc] public void DisappearClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3291613333u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3291613333u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { Disappear(); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_RatScript() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(3291613333u, new RpcReceiveHandler(__rpc_handler_3291613333)); } private static void __rpc_handler_3291613333(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)2; ((RatScript)(object)target).DisappearClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "RatScript"; } } } namespace CoolPeopleMod.Items.PinataPlush { internal class PinataPlushBehavior : PhysicsProp { public Animator ItemAnimator; public AudioSource ItemAudio; public AudioClip AttackSFX; public AudioClip PartySFX; public AudioClip ShutUpSnowySFX; private int damage = 5; public static float explodeChance = 0.2f; public static float shutUpSnowyChance = 0.1f; private bool shutUpSnowy; public override void EquipItem() { ((PhysicsProp)this).EquipItem(); ((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = true; } public override void DiscardItem() { ((GrabbableObject)this).DiscardItem(); ((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = false; } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); ((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = false; } public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (!shutUpSnowy && buttonDown) { if (((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198253760639L || TESTING.testing) { ItemAnimator.SetTrigger("squeeze"); ItemAudio.PlayOneShot(PartySFX); ActivateRandomCandyEffect(); } else { ItemAnimator.SetTrigger("headbutt"); } } } public override void ItemInteractLeftRight(bool right) { ((GrabbableObject)this).ItemInteractLeftRight(right); if (right) { if (((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198253760639L || TESTING.testing) { ItemAnimator.SetTrigger("squeeze"); ItemAudio.PlayOneShot(PartySFX); TeleportPlayerToRandomNode(((GrabbableObject)this).playerHeldBy); } } else if (((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198253760639L || TESTING.testing) { ItemAnimator.SetTrigger("headbutt"); } } public void DamagePlayerHeldBy() { //IL_0046: 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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB playerHeldBy = ((GrabbableObject)this).playerHeldBy; ItemAudio.PlayOneShot(AttackSFX); if (playerHeldBy.playerSteamId == 76561198253760639L || TESTING.testing) { CatchTheBus(); return; } playerHeldBy.DiscardHeldObject(false, (NetworkObject)null, default(Vector3), true); playerHeldBy.DamagePlayer(damage, false, false, (CauseOfDeath)1, 7, false, ((Component)playerHeldBy).transform.forward * 10f); TeleportPlayerToRandomNode(playerHeldBy); } private void CatchTheBus() { //IL_0041: 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) if ((((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198253760639L || TESTING.testing) && !((Object)(object)Plugin.localPlayer != (Object)(object)((GrabbableObject)this).playerHeldBy)) { ((GrabbableObject)this).playerHeldBy.KillPlayer(Vector3.zero, false, (CauseOfDeath)0, 0, default(Vector3)); } } public void TeleportPlayerToRandomNode(PlayerControllerB player) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) Transform randomNode = Utils.GetRandomNode(); if (!((Object)(object)randomNode == (Object)null)) { player.TeleportPlayer(randomNode.position, false, 0f, false, true); } } private void ActivateRandomCandyEffect() { //IL_01ea: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)(object)Plugin.localPlayer) { return; } if (Random.Range(0f, 1f) <= shutUpSnowyChance) { shutUpSnowy = true; ShutUpSnowyServerRpc(); return; } switch (Random.Range(0, 7)) { case 0: HUDManager.Instance.DisplayTip("Blue", "", false, false, "LC_Tip1"); StatusEffectController.Instance.HealPlayer(30, overHeal: true); break; case 1: HUDManager.Instance.DisplayTip("Green", "", false, false, "LC_Tip1"); StatusEffectController.Instance.StatusNegation(30); StatusEffectController.Instance.HealthRegen(1, 80); break; case 2: HUDManager.Instance.DisplayTip("Purple", "", false, false, "LC_Tip1"); StatusEffectController.Instance.DamageReduction(15, 20, timeStackable: true); StatusEffectController.Instance.HealthRegen(2, 10); break; case 3: HUDManager.Instance.DisplayTip("Red", "", false, false, "LC_Tip1"); StatusEffectController.Instance.HealthRegen(9, 5); break; case 4: HUDManager.Instance.DisplayTip("Yellow", "", false, false, "LC_Tip1"); StatusEffectController.Instance.RestoreStamina(25); StatusEffectController.Instance.InfiniteSprint(8); StatusEffectController.Instance.IncreasedMovementSpeed(8, 2, timeStackable: true, stackable: true); break; case 5: HUDManager.Instance.DisplayTip("Pink", "", false, false, "LC_Tip1"); if (!(Random.Range(0f, 1f) > explodeChance)) { Landmine.SpawnExplosion(((Component)this).transform.position, true, 5.7f, 6f, 50, 0f, (GameObject)null, false); } break; case 6: HUDManager.Instance.DisplayTip("Rainbow", "", false, false, "LC_Tip1"); StatusEffectController.Instance.HealPlayer(15); StatusEffectController.Instance.InfiniteSprint(5, timeStackable: true); StatusEffectController.Instance.bulletProofMultiplier++; StatusEffectController.Instance.StatusNegation(10); StatusEffectController.Instance.HealPlayer(20, overHeal: true); break; } } private IEnumerator ShutUpSnowyCoroutine(float delay) { yield return (object)new WaitForSeconds(delay); Landmine.SpawnExplosion(((Component)this).transform.position, true, 5.7f, 6f, 50, 0f, (GameObject)null, false); shutUpSnowy = false; } [ServerRpc(RequireOwnership = false)] public void ShutUpSnowyServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2073402381u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2073402381u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost) && Plugin.IsServerOrHost) { ShutUpSnowyClientRpc(); } } } [ClientRpc] public void ShutUpSnowyClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2820405468u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2820405468u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { ItemAudio.PlayOneShot(ShutUpSnowySFX); ((MonoBehaviour)this).StartCoroutine(ShutUpSnowyCoroutine(3f)); } } } protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_PinataPlushBehavior() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(2073402381u, new RpcReceiveHandler(__rpc_handler_2073402381)); NetworkManager.__rpc_func_table.Add(2820405468u, new RpcReceiveHandler(__rpc_handler_2820405468)); } private static void __rpc_handler_2073402381(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; ((PinataPlushBehavior)(object)target).ShutUpSnowyServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2820405468(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)2; ((PinataPlushBehavior)(object)target).ShutUpSnowyClientRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "PinataPlushBehavior"; } } } namespace CoolPeopleMod.Items.DiceMimic { internal class DiceMimicPlushBehavior : PhysicsProp { private static ManualLogSource logger = Plugin.LoggerInstance; public Animator ItemAnimator; public AudioSource ItemAudio; public AudioClip DiceSFX; public Spinner DiceScript; private bool isThrown; private const int plushieCount = 5; private int currentBehavior; public AnimationCurve grenadeFallCurve; public AnimationCurve grenadeVerticalFallCurve; public AnimationCurve grenadeVerticalFallCurveNoBounce; public AudioClip BaldSFX; private Ray grenadeThrowRay; private RaycastHit grenadeHit; private int stunGrenadeMask = 268437761; public AudioClip PartySFX; public AudioClip[] HugSFX; private Coroutine? hugRoutine; public AudioClip[] BirthdaySFX; public GameObject RatPrefab; private RatScript? currentRat; public AudioClip[] FunoSFX; public AudioClip LeverPullSFX; public GameObject SeaminePrefab; public override void ItemActivate(bool used, bool buttonDown = true) { ((GrabbableObject)this).ItemActivate(used, buttonDown); if (!buttonDown) { return; } ItemAudio.PlayOneShot(DiceSFX); ItemAnimator.SetTrigger("squeeze"); DiceScript.StartHyperSpinning(3f); if (!((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)(object)Plugin.localPlayer) && !IsRatInGame()) { if (((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198077184650L || ((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198253760639L || TESTING.testing) { int index = Random.Range(0, 6); DoPlushieEffectServerRpc(index); } else { SpawnMimicServerRpc(); } } } private bool IsRatInGame() { PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (val.playerSteamId == 76561199182474292L) { return true; } } return false; } private void DoPlushieEffect(int index) { currentBehavior = index; switch (currentBehavior) { case 1: DoGlitchPlushBehavior(); break; case 2: DoPinataPlushBehavior(); break; case 3: DoSCP999PlushBehavior(); break; case 4: DoRatPlushBehavior(); break; case 5: DoFunoPlushBehavior(); break; } } public override void OnHitGround() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) int num = currentBehavior; int num2 = num; if (num2 == 1) { if (isThrown) { Landmine.SpawnExplosion(((Component)this).transform.position + Vector3.up, true, 5.7f, 6f, 50, 0f, (GameObject)null, false); isThrown = false; } } else { ((GrabbableObject)this).OnHitGround(); } } public override void FallWithCurve() { //IL_0014: 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_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_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) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_0163: 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_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0125: 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_0145: Unknown result type (might be due to invalid IL or missing references) int num = currentBehavior; int num2 = num; if (num2 == 1) { Vector3 val = ((GrabbableObject)this).startFallingPosition - ((GrabbableObject)this).targetFloorPosition; float magnitude = ((Vector3)(ref val)).magnitude; Quaternion val2 = Quaternion.Euler(((GrabbableObject)this).itemProperties.restingRotation.x, ((Component)this).transform.eulerAngles.y, ((GrabbableObject)this).itemProperties.restingRotation.z); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, val2, 14f * Time.deltaTime / magnitude); ((Component)this).transform.localPosition = Vector3.Lerp(((GrabbableObject)this).startFallingPosition, ((GrabbableObject)this).targetFloorPosition, grenadeFallCurve.Evaluate(((GrabbableObject)this).fallTime)); if (magnitude > 5f) { ((Component)this).transform.localPosition = Vector3.Lerp(new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).startFallingPosition.y, ((Component)this).transform.localPosition.z), new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).targetFloorPosition.y, ((Component)this).transform.localPosition.z), grenadeVerticalFallCurveNoBounce.Evaluate(((GrabbableObject)this).fallTime)); } else { ((Component)this).transform.localPosition = Vector3.Lerp(new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).startFallingPosition.y, ((Component)this).transform.localPosition.z), new Vector3(((Component)this).transform.localPosition.x, ((GrabbableObject)this).targetFloorPosition.y, ((Component)this).transform.localPosition.z), grenadeVerticalFallCurve.Evaluate(((GrabbableObject)this).fallTime)); } ((GrabbableObject)this).fallTime = ((GrabbableObject)this).fallTime + Mathf.Abs(Time.deltaTime * 12f / magnitude); } else { ((GrabbableObject)this).FallWithCurve(); } } [ServerRpc(RequireOwnership = false)] public void SpawnMimicServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1685722898u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1685722898u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost) && Plugin.IsServerOrHost) { SpawnMimicClientRpc(); } } } [ClientRpc] public void SpawnMimicClientRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: 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 != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1402882301u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1402882301u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && Plugin.IsServerOrHost && TESTING.mimic) { GameObject val3 = Object.Instantiate<GameObject>(Utils.getEnemyByName("Masked").enemyType.enemyPrefab, ((Component)((GrabbableObject)this).playerHeldBy).transform.position, Quaternion.identity); val3.GetComponentInChildren<NetworkObject>().Spawn(true); RoundManager.Instance.SpawnedEnemies.Add(val3.GetComponent<EnemyAI>()); } } } [ServerRpc(RequireOwnership = false)] public void DoPlushieEffectServerRpc(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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(785127287u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 785127287u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost) && Plugin.IsServerOrHost) { DoPlushieEffectClientRpc(index); } } } [ClientRpc] public void DoPlushieEffectClientRpc(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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4056420124u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4056420124u, val, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { DoPlushieEffect(index); } } } private void DoGlitchPlushBehavior() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) isThrown = true; ((GrabbableObject)this).playerHeldBy.DiscardHeldObject(true, (NetworkObject)null, GetGrenadeThrowDestination(((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform), true); ItemAudio.PlayOneShot(BaldSFX); } public Vector3 GetGrenadeThrowDestination(Transform ejectPoint) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: 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_002b: 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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_0088: 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_008d: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_0106: 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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; Debug.DrawRay(ejectPoint.position, ejectPoint.forward, Color.yellow, 15f); grenadeThrowRay = new Ray(ejectPoint.position, ejectPoint.forward); position = ((!Physics.Raycast(grenadeThrowRay, ref grenadeHit, 12f, stunGrenadeMask, (QueryTriggerInteraction)1)) ? ((Ray)(ref grenadeThrowRay)).GetPoint(10f) : ((Ray)(ref grenadeThrowRay)).GetPoint(((RaycastHit)(ref grenadeHit)).distance - 0.05f)); Debug.DrawRay(position, Vector3.down, Color.blue, 15f); grenadeThrowRay = new Ray(position, Vector3.down); position = ((!Physics.Raycast(grenadeThrowRay, ref grenadeHit, 30f, stunGrenadeMask, (QueryTriggerInteraction)1)) ? ((Ray)(ref grenadeThrowRay)).GetPoint(30f) : (((RaycastHit)(ref grenadeHit)).point + Vector3.up * 0.05f)); return position + new Vector3(Random.Range(-1f, 1f), 0f, Random.Range(-1f, 1f)); } private void DoPinataPlushBehavior() { ItemAudio.PlayOneShot(PartySFX); ActivateRandomCandyEffect(); } private void ActivateRandomCandyEffect() { //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)(object)Plugin.localPlayer) { return; } switch (Random.Range(0, 7)) { case 0: HUDManager.Instance.DisplayTip("Blue", "", false, false, "LC_Tip1"); StatusEffectController.Instance.HealPlayer(30, overHeal: true); break; case 1: HUDManager.Instance.DisplayTip("Green", "", false, false, "LC_Tip1"); StatusEffectController.Instance.StatusNegation(30); StatusEffectController.Instance.HealthRegen(1, 80); break; case 2: HUDManager.Instance.DisplayTip("Purple", "", false, false, "LC_Tip1"); StatusEffectController.Instance.DamageReduction(15, 20, timeStackable: true); StatusEffectController.Instance.HealthRegen(2, 10); break; case 3: HUDManager.Instance.DisplayTip("Red", "", false, false, "LC_Tip1"); StatusEffectController.Instance.HealthRegen(9, 5); break; case 4: HUDManager.Instance.DisplayTip("Yellow", "", false, false, "LC_Tip1"); StatusEffectController.Instance.RestoreStamina(25); StatusEffectController.Instance.InfiniteSprint(8); StatusEffectController.Instance.IncreasedMovementSpeed(8, 2, timeStackable: true, stackable: true); break; case 5: HUDManager.Instance.DisplayTip("Pink", "", false, false, "LC_Tip1"); if (!(Random.Range(0f, 1f) > PinataPlushBehavior.explodeChance)) { Landmine.SpawnExplosion(((Component)Plugin.localPlayer).transform.position + Vector3.up, true, 5.7f, 6f, 50, 0f, (GameObject)null, false); } break; case 6: HUDManager.Instance.DisplayTip("Rainbow", "", false, false, "LC_Tip1"); StatusEffectController.Instance.HealPlayer(15); StatusEffectController.Instance.InfiniteSprint(5, timeStackable: true); StatusEffectController.Instance.bulletProofMultiplier++; StatusEffectController.Instance.StatusNegation(10); StatusEffectController.Instance.HealPlayer(20, overHeal: true); break; } } private void DoSCP999PlushBehavior() { RoundManager.PlayRandomClip(ItemAudio, HugSFX, true, 1f, 0, 1000); if (hugRoutine == null) { hugRoutine = ((MonoBehaviour)this).StartCoroutine(HugCoroutine(