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 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.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+d0e3490d1b22e37609d8ab42e366ab3fe1e2eabe")]
[assembly: AssemblyProduct("CoolPeopleMod")]
[assembly: AssemblyTitle("Snowlance.CoolPeopleMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.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;
}
}
}
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 ulong GlitchSteamID;
public ulong RodrigoSteamID;
public Animator ItemAnimator;
private Ray grenadeThrowRay;
private RaycastHit grenadeHit;
private int stunGrenadeMask = 268437761;
private bool isThrown;
public override void ItemActivate(bool used, bool buttonDown = true)
{
//IL_0060: 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 == GlitchSteamID || TESTING.testing)
{
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 == RodrigoSteamID)
{
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_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_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: 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_009c: 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_00ae: 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_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
//IL_0100: 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_011c: Unknown result type (might be due to invalid IL or missing references)
//IL_0137: Unknown result type (might be due to invalid IL or missing references)
//IL_0213: Unknown result type (might be due to invalid IL or missing references)
//IL_022e: Unknown result type (might be due to invalid IL or missing references)
//IL_0238: Unknown result type (might be due to invalid IL or missing references)
//IL_0243: Unknown result type (might be due to invalid IL or missing references)
//IL_025e: Unknown result type (might be due to invalid IL or missing references)
//IL_0268: Unknown result type (might be due to invalid IL or missing references)
//IL_027e: Unknown result type (might be due to invalid IL or missing references)
//IL_017a: Unknown result type (might be due to invalid IL or missing references)
//IL_0195: Unknown result type (might be due to invalid IL or missing references)
//IL_019f: Unknown result type (might be due to invalid IL or missing references)
//IL_01aa: 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)
//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
//IL_029a: Unknown result type (might be due to invalid IL or missing references)
logger.LogDebug((object)$"cFallWithCurve called. Start Position: {((GrabbableObject)this).startFallingPosition}, Target Position: {((GrabbableObject)this).targetFloorPosition}, Initial cfallTime: {((GrabbableObject)this).fallTime}");
Vector3 val = ((GrabbableObject)this).startFallingPosition - ((GrabbableObject)this).targetFloorPosition;
float magnitude = ((Vector3)(ref val)).magnitude;
logger.LogDebug((object)$"Calculated magnitude: {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);
ManualLogSource obj = logger;
Quaternion rotation = ((Component)this).transform.rotation;
obj.LogDebug((object)$"Updated rotation to: {((Quaternion)(ref rotation)).eulerAngles}");
((Component)this).transform.localPosition = Vector3.Lerp(((GrabbableObject)this).startFallingPosition, ((GrabbableObject)this).targetFloorPosition, grenadeFallCurve.Evaluate(((GrabbableObject)this).fallTime));
logger.LogDebug((object)$"Updated primary fall position to: {((Component)this).transform.localPosition}");
if (magnitude > 5f)
{
logger.LogDebug((object)"Magnitude > 5, using grenadeVerticalFallCurveNoBounce.");
((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
{
logger.LogDebug((object)"Magnitude <= 5, using grenadeVerticalFallCurve.");
((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));
}
logger.LogDebug((object)$"Updated local position after vertical fall: {((Component)this).transform.localPosition}");
((GrabbableObject)this).fallTime = ((GrabbableObject)this).fallTime + Mathf.Abs(Time.deltaTime * 12f / magnitude);
logger.LogDebug((object)$"Updated cfallTime to: {((GrabbableObject)this).fallTime}");
}
public override void OnHitGround()
{
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
((GrabbableObject)this).OnHitGround();
logger.LogDebug((object)"Hit ground");
if (isThrown)
{
Landmine.SpawnExplosion(((Component)this).transform.position, true, 1f, 1f, 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 = false;
private static ManualLogSource logger = Plugin.LoggerInstance;
private static bool toggle;
[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 "/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.0.0")]
[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 snowySteamID = 76561198253760639uL;
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 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.");
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));
((BaseUnityPlugin)this).Logger.LogInfo((object)"Snowlance.CoolPeopleMod v1.0.0 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");
}
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "Snowlance.CoolPeopleMod";
public const string PLUGIN_NAME = "CoolPeopleMod";
public const string PLUGIN_VERSION = "1.0.0";
}
}
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 MimicPlushBehavior : PhysicsProp
{
public Animator ItemAnimator;
public AudioSource ItemAudio;
public AudioClip SacrificerSFX;
public AudioClip[] HugSFX;
public AudioClip BaldSFX;
public AudioClip[] BirthdaySFX;
protected override void __initializeVariables()
{
((PhysicsProp)this).__initializeVariables();
}
[MethodImpl(MethodImplOptions.NoInlining)]
protected internal override string __getTypeName()
{
return "MimicPlushBehavior";
}
}
internal class SCP999PlushBehavior : PhysicsProp
{
public Animator ItemAnimator;
public AudioSource ItemAudio;
public AudioClip[] HugSFX;
public AudioClip[] RoamSFX;
public ulong LizzieSteamID;
private Coroutine? hugRoutine;
private 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 == LizzieSteamID || ((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)
{
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 ulong RatSteamID;
public ulong SlayerSteamID;
public AudioSource ItemAudio;
public AudioClip[] BirthdaySFX;
public Animator ItemAnimator;
public GameObject RatPrefab;
private RatScript? currentRat;
private Vector3 mainEntrancePosition;
public override void Start()
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
((GrabbableObject)this).Start();
mainEntrancePosition = RoundManager.FindMainEntrancePosition(true, false);
}
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 == RatSteamID)
{
TrySpawnRatOnServer();
}
}
}
private void TrySpawnRatOnServer()
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: 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_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0094: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
if (Plugin.IsServerOrHost && CalculatePath(((Component)((GrabbableObject)this).playerHeldBy).transform.position, mainEntrancePosition))
{
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 == SlayerSteamID)
{
return true;
}
}
return false;
}
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;
}
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;
private float timeSinceAIInterval;
private Vector3 mainEntrancePosition;
private NavMeshPath path1;
private bool moveTowardsDestination;
private Vector3 destination;
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()
{
timeSinceAIInterval += Time.deltaTime;
if (timeSinceAIInterval > AIIntervalTime)
{
DoAIInterval();
timeSinceAIInterval = 0f;
}
}
private void DoAIInterval()
{
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
if (moveTowardsDestination)
{
agent.SetDestination(destination);
}
if (!SetDestinationToPosition(mainEntrancePosition, checkForPath: true) || Vector3.Distance(((Component)this).transform.position, mainEntrancePosition) < 1f)
{
Disappear();
}
}
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()
{
}
[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)
{
}
}
}
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;
private int damage = 5;
public override void ItemActivate(bool used, bool buttonDown = true)
{
((GrabbableObject)this).ItemActivate(used, buttonDown);
if (buttonDown)
{
if (((GrabbableObject)this).playerHeldBy.playerSteamId == 76561198253760639L || TESTING.testing)
{
ItemAnimator.SetTrigger("squeeze");
ItemAudio.PlayOneShot(PartySFX);
ActivateRandomCandyEffect();
}
else
{
ItemAnimator.SetTrigger("headbutt");
}
}
}
public void DamagePlayerHeldBy()
{
//IL_002f: 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)
ItemAudio.PlayOneShot(AttackSFX);
((GrabbableObject)this).playerHeldBy.DamagePlayer(damage, false, false, (CauseOfDeath)1, 7, false, ((Component)((GrabbableObject)this).playerHeldBy).transform.forward * 10f);
}
private void ActivateRandomCandyEffect()
{
//IL_0199: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)(object)Plugin.localPlayer))
{
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");
Landmine.SpawnExplosion(((Component)Plugin.localPlayer).transform.position, true, 3f, 3f, 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;
}
}
}
protected override void __initializeVariables()
{
((PhysicsProp)this).__initializeVariables();
}
[MethodImpl(MethodImplOptions.NoInlining)]
protected internal override string __getTypeName()
{
return "PinataPlushBehavior";
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}
namespace Snowlance.CoolPeopleMod.NetcodePatcher
{
[AttributeUsage(AttributeTargets.Module)]
internal class NetcodePatchedAssemblyAttribute : Attribute
{
}
}