Decompiled source of SnowPlaygrounds v1.0.8
SnowPlaygrounds.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LethalLib.Extras; using LethalLib.Modules; using Microsoft.CodeAnalysis; using SnowPlaygrounds.Behaviours; using SnowPlaygrounds.Behaviours.Enemies; using SnowPlaygrounds.Behaviours.Items; using SnowPlaygrounds.Behaviours.MapObjects; using SnowPlaygrounds.Managers; using SnowPlaygrounds.NetcodePatcher; using SnowPlaygrounds.Patches; using SnowPlaygrounds.Patches.ModsPatches; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.Rendering.HighDefinition; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("SnowPlaygrounds")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SnowPlaygrounds")] [assembly: AssemblyCopyright("Copyright © 2024")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("da5eb4f1-463c-4837-a533-0c97fb2b145c")] [assembly: AssemblyFileVersion("1.0.0.0")] [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: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] 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.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace SnowPlaygrounds { public class Constants { public const string GLOBAL = "_Global_"; public const string FAKE_SNOWMAN = "Fake Snowman"; public const string SNOWBALL = "Snowball"; public const string SNOW_PILE = "Snow Pile"; public const string SNOWMAN = "Snowman"; public static Vector3 SNOWMAN_SCALE = new Vector3(2.1f, 2.1f, 2.1f); public const string FROSTBITE = "Frostbite"; } [BepInPlugin("Lega.SnowPlaygrounds", "Snow Playgrounds", "1.0.8")] public class SnowPlaygrounds : BaseUnityPlugin { private const string modGUID = "Lega.SnowPlaygrounds"; private const string modName = "Snow Playgrounds"; private const string modVersion = "1.0.8"; private readonly Harmony harmony = new Harmony("Lega.SnowPlaygrounds"); private static readonly AssetBundle bundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "snowplaygrounds")); internal static ManualLogSource mls; public static ConfigFile configFile; public static GameObject managerPrefab = NetworkPrefabs.CreateNetworkPrefab("SnowPlaygroundsNetworkManager"); public static bool isSellBodies = false; public static GameObject snowballObj; public static GameObject snowballEnemyObj; public static GameObject snowPileObj; public static GameObject snowmanObj; public static List<Snowman> snowmen = new List<Snowman>(); public static EnemyType frostbiteEnemy; public static GameObject snowballDecal; public static HashSet<GameObject> snowballDecals = new HashSet<GameObject>(); public static Material frozenShader; public static GameObject snowballParticle; public static GameObject snowmanParticle; public static GameObject snowmanAudio; public static GameObject jumpscareAudio; public void Awake() { mls = Logger.CreateLogSource("SnowPlaygrounds"); configFile = ((BaseUnityPlugin)this).Config; ConfigManager.Load(); LoadManager(); NetcodePatcher(); LoadItems(); LoadHazards(); LoadEnemies(); LoadDecals(); LoadParticles(); LoadAudios(); LoadShaders(); harmony.PatchAll(typeof(StartOfRoundPatch)); harmony.PatchAll(typeof(RoundManagerPatch)); harmony.PatchAll(typeof(PlayerControllerBPatch)); harmony.PatchAll(typeof(EnemyAIPatch)); PatchOtherMods(harmony); } public static void LoadManager() { Utilities.FixMixerGroups(managerPrefab); managerPrefab.AddComponent<SnowPlaygroundsNetworkManager>(); } private static void NetcodePatcher() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types; foreach (Type type in array) { MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); MethodInfo[] array2 = methods; foreach (MethodInfo methodInfo in array2) { object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false); if (customAttributes.Length != 0) { methodInfo.Invoke(null, null); } } } } public void LoadItems() { snowballObj = RegisterItem(typeof(Snowball), bundle.LoadAsset<Item>("Assets/Snowball/SP_SnowballItem.asset")).spawnPrefab; snowballEnemyObj = RegisterItem(typeof(SnowballEnemy), bundle.LoadAsset<Item>("Assets/Snowball/SP_SnowballEnemyItem.asset")).spawnPrefab; } public Item RegisterItem(Type type, Item item) { Component obj = item.spawnPrefab.AddComponent(type); PhysicsProp val = (PhysicsProp)(object)((obj is PhysicsProp) ? obj : null); ((GrabbableObject)val).grabbable = true; ((GrabbableObject)val).grabbableToEnemies = true; ((GrabbableObject)val).itemProperties = item; NetworkPrefabs.RegisterNetworkPrefab(item.spawnPrefab); Utilities.FixMixerGroups(item.spawnPrefab); Items.RegisterItem(item); return item; } public void LoadHazards() { snowPileObj = RegisterHazard(bundle.LoadAsset<GameObject>("Assets/SnowPile/SP_SnowPile.prefab"), ConfigManager.isSnowPileInside.Value, ConfigManager.minSnowPileInside.Value, ConfigManager.maxSnowPileInside.Value); snowmanObj = RegisterHazard(bundle.LoadAsset<GameObject>("Assets/Snowman/SP_Snowman.prefab"), ConfigManager.isSnowmanInside.Value, ConfigManager.minSnowmanInside.Value, ConfigManager.maxSnowmanInside.Value); } public GameObject RegisterHazard(GameObject gameObject, bool isInside, float minSpawn, float maxSpawn) { //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_001e: Expected O, but got Unknown //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown SpawnableMapObjectDef val = ScriptableObject.CreateInstance<SpawnableMapObjectDef>(); val.spawnableMapObject = new SpawnableMapObject { prefabToSpawn = gameObject }; AnimationCurve animationCurveInside = new AnimationCurve((Keyframe[])(object)new Keyframe[1] { new Keyframe(minSpawn, maxSpawn) }); NetworkPrefabs.RegisterNetworkPrefab(val.spawnableMapObject.prefabToSpawn); Utilities.FixMixerGroups(val.spawnableMapObject.prefabToSpawn); if (isInside) { if (ConfigManager.anyLevel.Value) { MapObjects.RegisterMapObject(val, (LevelTypes)(-1), (Func<SelectableLevel, AnimationCurve>)((SelectableLevel _) => animationCurveInside)); } else { MapObjects.RegisterMapObject(val, (LevelTypes)1, ConfigManager.spawnLevels.Value.Split(','), (Func<SelectableLevel, AnimationCurve>)((SelectableLevel _) => animationCurveInside)); } } return val.spawnableMapObject.prefabToSpawn; } public static void LoadEnemies() { frostbiteEnemy = bundle.LoadAsset<EnemyType>("Assets/Frostbite/SP_FrostbiteEnemy.asset"); NetworkPrefabs.RegisterNetworkPrefab(frostbiteEnemy.enemyPrefab); if (ConfigManager.anyLevel.Value) { Enemies.RegisterEnemy(frostbiteEnemy, ConfigManager.frostbiteRarity.Value, (LevelTypes)(-1), (TerminalNode)null, (TerminalKeyword)null); } else { Enemies.RegisterEnemy(frostbiteEnemy, ConfigManager.frostbiteRarity.Value, (LevelTypes)1, ConfigManager.spawnLevels.Value.Split(','), (TerminalNode)null, (TerminalKeyword)null); } } public static void LoadDecals() { snowballDecal = bundle.LoadAsset<GameObject>("Assets/Snowball/SP_SnowballDecal.prefab"); } public static void LoadParticles() { HashSet<GameObject> hashSet = new HashSet<GameObject> { snowballParticle = bundle.LoadAsset<GameObject>("Assets/Snowball/SP_SnowballParticle.prefab"), snowmanParticle = bundle.LoadAsset<GameObject>("Assets/Snowman/SP_SnowmanParticle.prefab") }; foreach (GameObject item in hashSet) { NetworkPrefabs.RegisterNetworkPrefab(item); Utilities.FixMixerGroups(item); } } public static void LoadAudios() { HashSet<GameObject> hashSet = new HashSet<GameObject> { snowmanAudio = bundle.LoadAsset<GameObject>("Assets/Snowman/SP_SnowmanAudio.prefab"), jumpscareAudio = bundle.LoadAsset<GameObject>("Assets/Snowman/SP_JumpscareAudio.prefab") }; foreach (GameObject item in hashSet) { NetworkPrefabs.RegisterNetworkPrefab(item); Utilities.FixMixerGroups(item); } } public static void LoadShaders() { frozenShader = bundle.LoadAsset<Material>("Assets/Shaders/SP_FrozenMaterial.mat"); } public static void PatchOtherMods(Harmony harmony) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown Type type = Type.GetType("ShipInventory.Helpers.ItemManager, ShipInventory"); if (type != null) { harmony.Patch((MethodBase)AccessTools.Method(type, "StoreItem", (Type[])null, (Type[])null), new HarmonyMethod(typeof(ShipInventoryPatch).GetMethod("PreStoreItem")), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } isSellBodies = Type.GetType("SellBodies.PluginInfo, SellBodies") != null; } } public class SPUtilities { public static Coroutine targetableCoroutine; public static void Shuffle<T>(IList<T> collection) { for (int num = collection.Count - 1; num > 0; num--) { int num2 = Random.Range(0, num + 1); int index = num2; int index2 = num; T value = collection[num]; T value2 = collection[num2]; collection[index] = value; collection[index2] = value2; } } public static void StartFreezeEnemy(EnemyAI enemy, float duration, float slowdownFactor) { EnemyFreezeBehaviour enemyFreezeBehaviour = ((Component)enemy).GetComponent<EnemyFreezeBehaviour>(); if ((Object)(object)enemyFreezeBehaviour == (Object)null) { enemyFreezeBehaviour = ((Component)enemy).gameObject.AddComponent<EnemyFreezeBehaviour>(); enemyFreezeBehaviour.enemy = enemy; } enemyFreezeBehaviour.StartFreeze(duration, slowdownFactor); } public static void StartTargetable(PlayerControllerB player, float duration) { if (targetableCoroutine != null) { ((MonoBehaviour)player).StopCoroutine(targetableCoroutine); } targetableCoroutine = ((MonoBehaviour)player).StartCoroutine(SetTargetablePlayerCoroutine(duration)); } public static IEnumerator SetTargetablePlayerCoroutine(float duration) { yield return (object)new WaitForSeconds(duration); EnemyAIPatch.isTargetable = true; targetableCoroutine = null; } public static void SetUntargetable(PlayerControllerB player) { if (targetableCoroutine != null) { ((MonoBehaviour)player).StopCoroutine(targetableCoroutine); } EnemyAIPatch.isTargetable = false; } public static void ApplyDecal(Vector3 point, Vector3 normal) { //IL_0011: 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_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002d: 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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate<GameObject>(SnowPlaygrounds.snowballDecal); val.transform.position = point + normal * 0.01f; val.transform.forward = normal; SnowPlaygrounds.snowballDecals.Add(val); SnowballImpact(val.transform.position, Quaternion.LookRotation(normal)); } public static void SnowballImpact(Vector3 position, Quaternion rotation) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) PlaySnowPoof(position); GameObject val = Object.Instantiate<GameObject>(SnowPlaygrounds.snowballParticle, position, rotation); ParticleSystem component = val.GetComponent<ParticleSystem>(); MainModule main = component.main; float duration = ((MainModule)(ref main)).duration; main = component.main; MinMaxCurve startLifetime = ((MainModule)(ref main)).startLifetime; Object.Destroy((Object)(object)val, duration + ((MinMaxCurve)(ref startLifetime)).constantMax); } public static void PlaySnowPoof(Vector3 position) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate<GameObject>(SnowPlaygrounds.snowmanAudio, position, Quaternion.identity); AudioSource component = val.GetComponent<AudioSource>(); Object.Destroy((Object)(object)val, component.clip.length); } public static void PlaySnowmanParticle(Vector3 position, Quaternion rotation) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) PlaySnowPoof(position); GameObject val = Object.Instantiate<GameObject>(SnowPlaygrounds.snowmanParticle, position, rotation); ParticleSystem component = val.GetComponent<ParticleSystem>(); MainModule main = component.main; float duration = ((MainModule)(ref main)).duration; main = component.main; MinMaxCurve startLifetime = ((MainModule)(ref main)).startLifetime; Object.Destroy((Object)(object)val, duration + ((MinMaxCurve)(ref startLifetime)).constantMax); } public static void PlayJumpscareAudio(Vector3 position) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate<GameObject>(SnowPlaygrounds.jumpscareAudio, position, Quaternion.identity); AudioSource component = val.GetComponent<AudioSource>(); component.volume = ConfigManager.jumpscareVolume.Value; Object.Destroy((Object)(object)val, component.clip.length); } public static void DespawnSnowmanEndGame(StartOfRound startOfRound) { if (!((NetworkBehaviour)startOfRound).IsHost) { return; } foreach (Snowman snowman in SnowPlaygrounds.snowmen) { if ((Object)(object)snowman == (Object)null) { continue; } if (snowman.isPlayerHiding) { snowman.ExitSnowmanClientRpc((int)snowman.hidingPlayer.playerClientId); continue; } NetworkObject component = ((Component)snowman).GetComponent<NetworkObject>(); if ((Object)(object)component != (Object)null && component.IsSpawned) { component.Despawn(true); } } SnowPlaygrounds.snowmen.Clear(); } public static void ClearSnowballDecals() { foreach (GameObject item in SnowPlaygrounds.snowballDecals.ToList()) { Object.Destroy((Object)(object)item); } SnowPlaygrounds.snowballDecals.Clear(); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "SnowPlaygrounds"; public const string PLUGIN_NAME = "SnowPlaygrounds"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace SnowPlaygrounds.Patches { internal class EnemyAIPatch { public static bool isTargetable = true; [HarmonyPatch(typeof(EnemyAI), "PlayerIsTargetable")] [HarmonyPrefix] private static bool IsPlayerTargetable(ref bool __result) { if (!isTargetable) { __result = false; return false; } return true; } } internal class PlayerControllerBPatch { public static int cameraCollideLayerMask = (1 << LayerMask.NameToLayer("Room")) | (1 << LayerMask.NameToLayer("PlaceableShipObject")) | (1 << LayerMask.NameToLayer("Terrain")) | (1 << LayerMask.NameToLayer("MiscLevelGeometry")); public static float targetCameraDistance = 3f; [HarmonyPatch(typeof(PlayerControllerB), "PlayerLookInput")] [HarmonyPrefix] private static bool HandleSnowmanCamera(ref PlayerControllerB __instance) { //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_004d: 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_006c: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance != (Object)(object)GameNetworkManager.Instance.localPlayerController) { return true; } Snowman componentInChildren = ((Component)__instance).GetComponentInChildren<Snowman>(); if ((Object)(object)componentInChildren == (Object)null) { return true; } if (!__instance.quickMenuManager.isMenuOpen) { MovementActions movement = __instance.playerActions.Movement; Vector2 val = ((MovementActions)(ref movement)).Look.ReadValue<Vector2>() * (float)IngamePlayerSettings.Instance.settings.lookSensitivity * 0.008f; componentInChildren.cameraPivot.Rotate(new Vector3(0f, val.x, 0f)); float num = componentInChildren.cameraPivot.localEulerAngles.x - val.y; num = ((num > 180f) ? (num - 360f) : num); num = Mathf.Clamp(num, -45f, 45f); componentInChildren.cameraPivot.localEulerAngles = new Vector3(num, componentInChildren.cameraPivot.localEulerAngles.y, 0f); return false; } return true; } [HarmonyPatch(typeof(PlayerControllerB), "ItemSecondaryUse_performed")] [HarmonyPostfix] private static void SecondaryUsePerformed(ref PlayerControllerB __instance) { if ((Object)(object)__instance == (Object)(object)GameNetworkManager.Instance.localPlayerController) { Snowman componentInChildren = ((Component)__instance).GetComponentInChildren<Snowman>(); if ((Object)(object)componentInChildren != (Object)null && (Object)(object)componentInChildren.hidingPlayer != (Object)null && (Object)(object)componentInChildren.hidingPlayer == (Object)(object)__instance) { componentInChildren.ExitSnowman(); } } } [HarmonyPatch(typeof(PlayerControllerB), "DiscardHeldObject")] [HarmonyPrefix] private static bool PreDropObject(ref PlayerControllerB __instance) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) if (__instance.currentlyHeldObjectServer is Snowball snowball && !snowball.isThrown) { if (StartOfRound.Instance.shipHasLanded && __instance.isCrouching) { SnowPlaygroundsNetworkManager.Instance.SpawnSnowmanServerRpc((int)__instance.playerClientId, NetworkObjectReference.op_Implicit(((Component)snowball).GetComponent<NetworkObject>()), ((Component)__instance.gameplayCamera).transform.position + ((Component)__instance.gameplayCamera).transform.forward, ((Component)__instance).transform.rotation); } else { snowball.DropSnowballServerRpc((int)__instance.playerClientId); } return false; } return true; } [HarmonyPatch(typeof(PlayerControllerB), "DropAllHeldItems")] [HarmonyPrefix] private static void PreDropAllObjects(ref PlayerControllerB __instance) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) bool flag = false; for (int i = 0; i < __instance.ItemSlots.Length; i++) { GrabbableObject val = __instance.ItemSlots[i]; if ((Object)(object)val != (Object)null && val is Snowball) { __instance.DestroyItemInSlot(i); flag = true; } } RaycastHit val2 = default(RaycastHit); if (flag && Physics.Raycast(((Component)__instance).transform.position + Vector3.up, Vector3.down, ref val2, 2f, 605030721, (QueryTriggerInteraction)2)) { SPUtilities.ApplyDecal(((RaycastHit)(ref val2)).point, ((RaycastHit)(ref val2)).normal); } } [HarmonyPatch(typeof(PlayerControllerB), "SetHoverTipAndCurrentInteractTrigger")] [HarmonyPrefix] private static bool SnowmanInteractTrigger(ref PlayerControllerB __instance) { //IL_0030: 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_0046: 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_0052: Unknown result type (might be due to invalid IL or missing references) if (__instance.isGrabbingObjectAnimation || __instance.inSpecialMenu || __instance.quickMenuManager.isMenuOpen) { return true; } __instance.interactRay = new Ray(((Component)__instance.gameplayCamera).transform.position, ((Component)__instance.gameplayCamera).transform.forward); if (Physics.Raycast(__instance.interactRay, ref __instance.hit, __instance.grabDistance, __instance.interactableObjectsMask) && ((Component)((RaycastHit)(ref __instance.hit)).collider).gameObject.layer != 8 && ((Component)((RaycastHit)(ref __instance.hit)).collider).gameObject.layer != 30) { if (!((Component)((RaycastHit)(ref __instance.hit)).collider).tag.Equals("InteractTrigger")) { return true; } Snowman componentInParent = ((Component)((RaycastHit)(ref __instance.hit)).collider).gameObject.GetComponentInParent<Snowman>(); if ((Object)(object)componentInParent == (Object)null) { return true; } __instance.hoveringOverTrigger = componentInParent.snowmanTrigger; if (!__instance.isHoldingInteract) { ((Behaviour)__instance.cursorIcon).enabled = true; __instance.cursorIcon.sprite = componentInParent.snowmanTrigger.hoverIcon; ((TMP_Text)__instance.cursorTip).text = componentInParent.snowmanTrigger.hoverTip; } FormatCursorTip(__instance); return false; } return true; } private static void FormatCursorTip(PlayerControllerB player) { if (StartOfRound.Instance.localPlayerUsingController) { StringBuilder stringBuilder = new StringBuilder(((TMP_Text)player.cursorTip).text); stringBuilder.Replace("[E]", "[X]"); stringBuilder.Replace("[LMB]", "[X]"); stringBuilder.Replace("[RMB]", "[R-Trigger]"); stringBuilder.Replace("[F]", "[R-Shoulder]"); stringBuilder.Replace("[Z]", "[L-Shoulder]"); ((TMP_Text)player.cursorTip).text = stringBuilder.ToString(); } else { ((TMP_Text)player.cursorTip).text = ((TMP_Text)player.cursorTip).text.Replace("[LMB]", "[E]"); } } } internal class RoundManagerPatch { [HarmonyPatch(typeof(RoundManager), "SpawnMapObjects")] [HarmonyPostfix] private static void SpawnInsideHazards(ref RoundManager __instance) { if (((NetworkBehaviour)__instance).IsHost) { SPUtilities.Shuffle(__instance.insideAINodes); } } [HarmonyPatch(typeof(RoundManager), "SpawnOutsideHazards")] [HarmonyPostfix] private static void SpawnOutsideHazards(ref RoundManager __instance) { if (((NetworkBehaviour)__instance).IsHost && (ConfigManager.anyLevel.Value || ConfigManager.spawnLevels.Value.Contains(((Object)__instance.currentLevel).name))) { SPUtilities.Shuffle(__instance.outsideAINodes); if (ConfigManager.isSnowPileOutside.Value) { SpawnSnowPile(__instance); } if (ConfigManager.isSnowmanOutside.Value) { SpawnSnowman(__instance); } } } private static void SpawnSnowPile(RoundManager roundManager) { //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) //IL_0030: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) Random random = new Random(); RaycastHit val = default(RaycastHit); for (int i = 0; i < random.Next(ConfigManager.minSnowPileOutside.Value, ConfigManager.maxSnowPileOutside.Value); i++) { GameObject[] outsideAINodes = roundManager.outsideAINodes; Vector3 position = outsideAINodes[random.Next(0, outsideAINodes.Length)].transform.position; position = RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(position, 10f, default(NavMeshHit), random, -1) + Vector3.up; if (Physics.Raycast(position, Vector3.down, ref val, 5f, StartOfRound.Instance.collidersAndRoomMaskAndDefault)) { GameObject val2 = Object.Instantiate<GameObject>(SnowPlaygrounds.snowPileObj, ((RaycastHit)(ref val)).point + Vector3.down, Quaternion.identity, RoundManager.Instance.mapPropsContainer.transform); Transform transform = val2.transform; transform.localScale *= 2.5f; val2.GetComponent<NetworkObject>().Spawn(true); } } } private static void SpawnSnowman(RoundManager roundManager) { //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) //IL_0030: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) Random random = new Random(); RaycastHit val = default(RaycastHit); for (int i = 0; i < random.Next(ConfigManager.minSnowmanOutside.Value, ConfigManager.maxSnowmanOutside.Value); i++) { GameObject[] outsideAINodes = roundManager.outsideAINodes; Vector3 position = outsideAINodes[random.Next(0, outsideAINodes.Length)].transform.position; position = RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(position, 10f, default(NavMeshHit), random, -1) + Vector3.up; if (Physics.Raycast(position, Vector3.down, ref val, 5f, StartOfRound.Instance.collidersAndRoomMaskAndDefault)) { GameObject val2 = Object.Instantiate<GameObject>(SnowPlaygrounds.snowmanObj, ((RaycastHit)(ref val)).point, Quaternion.identity, RoundManager.Instance.mapPropsContainer.transform); val2.GetComponent<NetworkObject>().Spawn(true); } } } [HarmonyPatch(typeof(RoundManager), "GeneratedFloorPostProcessing")] [HarmonyPostfix] private static void AddFakeSnowman(ref RoundManager __instance) { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkBehaviour)__instance).IsHost || (!ConfigManager.anyLevel.Value && !ConfigManager.spawnLevels.Value.Contains(((Object)__instance.currentLevel).name))) { return; } SnowPlaygrounds.snowmen.AddRange(Object.FindObjectsOfType<Snowman>()); Random random = new Random(); List<Snowman> list = SnowPlaygrounds.snowmen.OrderBy((Snowman s) => random.Next()).Take(random.Next(ConfigManager.minFakeSnowman.Value, ConfigManager.maxFakeSnowman.Value)).ToList(); foreach (Snowman item in list) { SnowPlaygroundsNetworkManager.Instance.AddFakeSnowmanClientRpc(NetworkObjectReference.op_Implicit(((Component)item).GetComponent<NetworkObject>())); } } } internal class StartOfRoundPatch { [HarmonyPatch(typeof(StartOfRound), "Start")] [HarmonyBefore(new string[] { "evaisa.lethallib" })] [HarmonyPostfix] private static void StartRound(ref StartOfRound __instance) { if (NetworkManager.Singleton.IsHost && (Object)(object)SnowPlaygroundsNetworkManager.Instance == (Object)null) { GameObject val = Object.Instantiate<GameObject>(SnowPlaygrounds.managerPrefab, ((Component)__instance).transform.parent); val.GetComponent<NetworkObject>().Spawn(false); SnowPlaygrounds.mls.LogInfo((object)"Spawning SnowPlaygroundsNetworkManager"); } } [HarmonyPatch(typeof(StartOfRound), "StartGame")] [HarmonyPostfix] public static void StartOfGame() { SnowPlaygrounds.snowmen.Clear(); SPUtilities.ClearSnowballDecals(); } [HarmonyPatch(typeof(StartOfRound), "EndOfGame")] [HarmonyPostfix] public static void EndOfGame(ref StartOfRound __instance) { SPUtilities.DespawnSnowmanEndGame(__instance); SPUtilities.ClearSnowballDecals(); } [HarmonyPatch(typeof(StartOfRound), "OnDisable")] [HarmonyPostfix] public static void OnDisable() { SnowPlaygroundsNetworkManager.Instance = null; } } } namespace SnowPlaygrounds.Patches.ModsPatches { [HarmonyPatch] internal class ShipInventoryPatch { public static bool PreStoreItem(GrabbableObject item) { return !(item is Snowball); } } } namespace SnowPlaygrounds.Managers { public class ConfigManager { public static ConfigEntry<bool> anyLevel; public static ConfigEntry<string> spawnLevels; public static ConfigEntry<string> frozenShaderExclusions; public static ConfigEntry<bool> isSnowPileInside; public static ConfigEntry<int> minSnowPileInside; public static ConfigEntry<int> maxSnowPileInside; public static ConfigEntry<bool> isSnowPileOutside; public static ConfigEntry<int> minSnowPileOutside; public static ConfigEntry<int> maxSnowPileOutside; public static ConfigEntry<int> snowballAmount; public static ConfigEntry<float> snowballPushForce; public static ConfigEntry<float> snowballSlowdownDuration; public static ConfigEntry<float> snowballSlowdownFactor; public static ConfigEntry<float> snowballThrowCooldown; public static ConfigEntry<bool> isSnowmanInside; public static ConfigEntry<int> minSnowmanInside; public static ConfigEntry<int> maxSnowmanInside; public static ConfigEntry<bool> isSnowmanOutside; public static ConfigEntry<int> minSnowmanOutside; public static ConfigEntry<int> maxSnowmanOutside; public static ConfigEntry<int> amountSnowballToBuild; public static ConfigEntry<float> snowmanSlowdownDuration; public static ConfigEntry<float> snowmanSlowdownFactor; public static ConfigEntry<bool> isJumpscareOn; public static ConfigEntry<float> jumpscareVolume; public static ConfigEntry<int> minFakeSnowman; public static ConfigEntry<int> maxFakeSnowman; public static ConfigEntry<int> frostbiteRarity; public static ConfigEntry<bool> frostbiteEating; public static ConfigEntry<int> frostbiteDamage; public static ConfigEntry<float> frostbiteMinCooldown; public static ConfigEntry<float> frostbiteMaxCooldown; public static ConfigEntry<float> frostbiteSnowballSpeed; public static ConfigEntry<int> frostbiteSnowballDamage; public static ConfigEntry<float> frostbiteStunDuration; public static ConfigEntry<float> frostbiteHitIncrement; public static ConfigEntry<float> frostbiteHitMax; public static void Load() { anyLevel = SnowPlaygrounds.configFile.Bind<bool>("_Global_", "Any level", true, "If true, the hazards can spawn on any level"); spawnLevels = SnowPlaygrounds.configFile.Bind<string>("_Global_", "Spawn levels", "TitanLevel,DineLevel,RendLevel", "Name of the levels where the hazards can spawn"); frozenShaderExclusions = SnowPlaygrounds.configFile.Bind<string>("_Global_", "Frozen shader exclusions", "Red Locust Bees", "List of creatures that are not affected by the frozen shader, but are still slowed down"); isSnowPileInside = SnowPlaygrounds.configFile.Bind<bool>("Snow Pile", "Can spawn inside", true, "Can Snow Pile spawn inside"); minSnowPileInside = SnowPlaygrounds.configFile.Bind<int>("Snow Pile", "Min spawn inside", 5, "Min Snow Pile to spawn"); maxSnowPileInside = SnowPlaygrounds.configFile.Bind<int>("Snow Pile", "Max spawn inside", 8, "Max Snow Pile to spawn"); isSnowPileOutside = SnowPlaygrounds.configFile.Bind<bool>("Snow Pile", "Can spawn outside", true, "Can Snow Pile spawn outside"); minSnowPileOutside = SnowPlaygrounds.configFile.Bind<int>("Snow Pile", "Min spawn outside", 2, "Min Snow Pile to spawn"); maxSnowPileOutside = SnowPlaygrounds.configFile.Bind<int>("Snow Pile", "Max spawn outside", 4, "Max Snow Pile to spawn"); snowballAmount = SnowPlaygrounds.configFile.Bind<int>("Snowball", "Amount", 5, "Amount of Snowball per slot"); snowballPushForce = SnowPlaygrounds.configFile.Bind<float>("Snowball", "Push force", 1f, "Push force applied to target player"); snowballSlowdownDuration = SnowPlaygrounds.configFile.Bind<float>("Snowball", "Slowdown duration", 1f, "Slowdown duration applied to targeted enemy"); snowballSlowdownFactor = SnowPlaygrounds.configFile.Bind<float>("Snowball", "Slowdown factor", 3f, "Slowdown factor applied to targeted enemy"); snowballThrowCooldown = SnowPlaygrounds.configFile.Bind<float>("Snowball", "Throw cooldown", 1f, "Snowball throw cooldown"); isSnowmanInside = SnowPlaygrounds.configFile.Bind<bool>("Snowman", "Can spawn inside", true, "Can Snowman spawn inside"); minSnowmanInside = SnowPlaygrounds.configFile.Bind<int>("Snowman", "Min spawn inside", 3, "Min Snowman to spawn"); maxSnowmanInside = SnowPlaygrounds.configFile.Bind<int>("Snowman", "Max spawn inside", 4, "Max Snowman to spawn"); isSnowmanOutside = SnowPlaygrounds.configFile.Bind<bool>("Snowman", "Can spawn outside", true, "Can Snowman spawn outside"); minSnowmanOutside = SnowPlaygrounds.configFile.Bind<int>("Snowman", "Min spawn outside", 2, "Min Snowman to spawn"); maxSnowmanOutside = SnowPlaygrounds.configFile.Bind<int>("Snowman", "Max spawn outside", 3, "Max Snowman to spawn"); amountSnowballToBuild = SnowPlaygrounds.configFile.Bind<int>("Snowman", "Amount snowball", 20, "Amout of Snowball required to build a Snowman"); snowmanSlowdownDuration = SnowPlaygrounds.configFile.Bind<float>("Snowman", "Slowdown duration", 4f, "Slowdown duration applied to targeted enemy"); snowmanSlowdownFactor = SnowPlaygrounds.configFile.Bind<float>("Snowman", "Slowdown factor", 3f, "Slowdown factor applied to targeted enemy"); isJumpscareOn = SnowPlaygrounds.configFile.Bind<bool>("Fake Snowman", "Enable jumpscare", true, "Enable jumpscare audio"); jumpscareVolume = SnowPlaygrounds.configFile.Bind<float>("Fake Snowman", "Jumpscare volume", 0.5f, "Jumpscare audio volume"); minFakeSnowman = SnowPlaygrounds.configFile.Bind<int>("Fake Snowman", "Min spawn", 2, "Min Fake Snowman to spawn by default"); maxFakeSnowman = SnowPlaygrounds.configFile.Bind<int>("Fake Snowman", "Max spawn", 3, "Max Fake Snowman to spawn by default"); frostbiteRarity = SnowPlaygrounds.configFile.Bind<int>("Frostbite", "Rarity", 10, "Frostbite rarity"); frostbiteEating = SnowPlaygrounds.configFile.Bind<bool>("Frostbite", "Eat the player?", true, "Does Frostbite eat the player on collision?"); frostbiteDamage = SnowPlaygrounds.configFile.Bind<int>("Frostbite", "Damage", 20, "Frostbite damages on collision, does not apply if 'Eat the player?' is true"); frostbiteMinCooldown = SnowPlaygrounds.configFile.Bind<float>("Frostbite", "Min cooldown", 0.5f, "Minimum cooldown between Snowball throws"); frostbiteMaxCooldown = SnowPlaygrounds.configFile.Bind<float>("Frostbite", "Max cooldown", 1.75f, "Maximum cooldown between Snowball throws"); frostbiteSnowballSpeed = SnowPlaygrounds.configFile.Bind<float>("Frostbite", "Snowball speed", 45f, "Snowball speed"); frostbiteSnowballDamage = SnowPlaygrounds.configFile.Bind<int>("Frostbite", "Snowball damage", 5, "Snowball damage"); frostbiteStunDuration = SnowPlaygrounds.configFile.Bind<float>("Frostbite", "Stun duration", 2f, "Stun duration when a player is hit by a Snowball"); frostbiteHitIncrement = SnowPlaygrounds.configFile.Bind<float>("Frostbite", "Hit increment", 0.1f, "Hit increment - this value starts at 1 and is used as a multiplier for the enemy's speed and the damage inflicted by his Snowball"); frostbiteHitMax = SnowPlaygrounds.configFile.Bind<float>("Frostbite", "Hit max value", 2f, "Max hit value before the Frostbite dies, this value is reached through the increment of the previous value"); } } public class CustomPassManager : MonoBehaviour { public static FrozenCustomPass frozenPass; public static CustomPassVolume customPassVolume; public static Dictionary<EnemyAI, List<Renderer>> frozenEnemies = new Dictionary<EnemyAI, List<Renderer>>(); public static CustomPassVolume CustomPassVolume { get { //IL_0057: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)customPassVolume == (Object)null) { customPassVolume = ((Component)GameNetworkManager.Instance.localPlayerController.gameplayCamera).gameObject.AddComponent<CustomPassVolume>(); if ((Object)(object)customPassVolume != (Object)null) { customPassVolume.targetCamera = GameNetworkManager.Instance.localPlayerController.gameplayCamera; customPassVolume.injectionPoint = (CustomPassInjectionPoint)1; customPassVolume.isGlobal = true; frozenPass = new FrozenCustomPass(); customPassVolume.customPasses.Add((CustomPass)(object)frozenPass); } } return customPassVolume; } } public static void SetupCustomPassForEnemy(EnemyAI enemy) { //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) if (frozenEnemies.ContainsKey(enemy) || ConfigManager.frozenShaderExclusions.Value.Contains(enemy.enemyType?.enemyName)) { return; } LayerMask frozenLayer = LayerMask.op_Implicit(524288); List<Renderer> list = (from r in ((Component)enemy).GetComponentsInChildren<Renderer>() where (LayerMask.op_Implicit(frozenLayer) & (1 << ((Component)r).gameObject.layer)) != 0 select r).ToList(); if (list.Any((Renderer r) => ((Object)r).name.Contains("LOD"))) { list.RemoveAll((Renderer r) => !((Object)r).name.Contains("LOD")); } if (list == null || list.Count == 0) { SnowPlaygrounds.mls.LogError((object)("No renderer could be found on " + enemy.enemyType.enemyName + ".")); return; } if ((Object)(object)CustomPassVolume == (Object)null) { SnowPlaygrounds.mls.LogError((object)"CustomPassVolume is not assigned."); return; } frozenPass = CustomPassVolume.customPasses.Find((CustomPass pass) => pass is FrozenCustomPass) as FrozenCustomPass; if (frozenPass == null) { SnowPlaygrounds.mls.LogError((object)"FrozenCustomPass could not be found in CustomPassVolume."); return; } frozenEnemies[enemy] = list; frozenPass.AddTargetRenderers(list.ToArray(), SnowPlaygrounds.frozenShader); } public static void RemoveAura(EnemyAI enemy) { if (frozenEnemies.ContainsKey(enemy)) { frozenPass.RemoveTargetRenderers(frozenEnemies[enemy]); frozenEnemies.Remove(enemy); } } } public class SnowPlaygroundsNetworkManager : NetworkBehaviour { public static SnowPlaygroundsNetworkManager Instance; public void Awake() { Instance = this; } [ServerRpc(RequireOwnership = false)] public void SpawnSnowmanServerRpc(int playerId, NetworkObjectReference obj, Vector3 position, Quaternion rotation) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: 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_008a: 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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0197: 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_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1821787614u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref rotation); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1821787614u, val, (RpcDelivery)0); } NetworkObject val3 = default(NetworkObject); if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost) && ((NetworkObjectReference)(ref obj)).TryGet(ref val3, (NetworkManager)null)) { Snowball snowball = ((Component)val3).gameObject.GetComponentInChildren<GrabbableObject>() as Snowball; RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(position, Vector3.down, ref val4, 5f, StartOfRound.Instance.collidersAndRoomMaskAndDefault)) { GameObject val5 = Object.Instantiate<GameObject>(SnowPlaygrounds.snowmanObj, ((RaycastHit)(ref val4)).point, Quaternion.Euler(0f, ((Quaternion)(ref rotation)).eulerAngles.y, ((Quaternion)(ref rotation)).eulerAngles.z), RoundManager.Instance.mapPropsContainer.transform); val5.transform.localScale = Constants.SNOWMAN_SCALE / (float)ConfigManager.amountSnowballToBuild.Value * (float)snowball.currentStackedItems; NetworkObject component = val5.GetComponent<NetworkObject>(); component.Spawn(true); SpawnSnowmanClientRpc(playerId, NetworkObjectReference.op_Implicit(component), snowball.currentStackedItems); DestroyObjectClientRpc(obj); } } } [ClientRpc] public void SpawnSnowmanClientRpc(int playerId, NetworkObjectReference obj, int nbSnowball) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Invalid comparison between Unknown and I4 //IL_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_008a: 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_0099: 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_0135: 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) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: 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_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020e: 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_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0233: 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_023c: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3894029020u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val2, nbSnowball); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3894029020u, val, (RpcDelivery)0); } NetworkObject val3 = default(NetworkObject); if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost) || !((NetworkObjectReference)(ref obj)).TryGet(ref val3, (NetworkManager)null)) { return; } Snowman componentInChildren = ((Component)val3).gameObject.GetComponentInChildren<Snowman>(); componentInChildren.currentStackedSnowball = nbSnowball; componentInChildren.RefreshHoverTip(); PlayerControllerB component = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent<PlayerControllerB>(); RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(((Component)component.gameplayCamera).transform.position + ((Component)component.gameplayCamera).transform.forward, Vector3.down, ref val4, 80f, 1342179585, (QueryTriggerInteraction)1)) { PlayerPhysicsRegion componentInChildren2 = ((Component)((Component)((RaycastHit)(ref val4)).collider).gameObject.transform).GetComponentInChildren<PlayerPhysicsRegion>(); if ((Object)(object)componentInChildren2 != (Object)null && componentInChildren2.allowDroppingItems && componentInChildren2.itemDropCollider.ClosestPoint(((RaycastHit)(ref val4)).point) == ((RaycastHit)(ref val4)).point && (Object)(object)componentInChildren2.parentNetworkObject != (Object)null) { ((Component)componentInChildren).transform.SetParent(componentInChildren2.physicsTransform); ((Component)componentInChildren).transform.localPosition = componentInChildren2.physicsTransform.InverseTransformPoint(((RaycastHit)(ref val4)).point + Vector3.up * 0.04f + componentInChildren2.addPositionOffsetToItems); Transform transform = ((Component)componentInChildren).transform; Quaternion rotation = ((Component)component).transform.rotation; float y = ((Quaternion)(ref rotation)).eulerAngles.y; rotation = ((Component)component).transform.rotation; transform.rotation = Quaternion.Euler(0f, y, ((Quaternion)(ref rotation)).eulerAngles.z); } } } [ClientRpc] public void AddFakeSnowmanClientRpc(NetworkObjectReference obj) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) 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(656925776u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 656925776u, val, (RpcDelivery)0); } NetworkObject val3 = default(NetworkObject); if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && ((NetworkObjectReference)(ref obj)).TryGet(ref val3, (NetworkManager)null)) { Snowman componentInChildren = ((Component)val3).gameObject.GetComponentInChildren<Snowman>(); componentInChildren.snowmanTrigger.interactable = false; componentInChildren.isEnemyHiding = true; } } } [ServerRpc(RequireOwnership = false)] public void DestroySnowmanServerRpc(NetworkObjectReference obj) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(3183850724u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 3183850724u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { DestroySnowmanClientRpc(obj); } } } [ClientRpc] public void DestroySnowmanClientRpc(NetworkObjectReference obj) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) 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(4091119933u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4091119933u, val, (RpcDelivery)0); } NetworkObject val3 = default(NetworkObject); if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && ((NetworkObjectReference)(ref obj)).TryGet(ref val3, (NetworkManager)null)) { Snowman componentInChildren = ((Component)val3).gameObject.GetComponentInChildren<Snowman>(); Object.Destroy((Object)(object)((Component)componentInChildren).gameObject); } } } [ClientRpc] public void DestroyObjectClientRpc(NetworkObjectReference obj) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3744428089u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3744428089u, val, (RpcDelivery)0); } NetworkObject val3 = default(NetworkObject); if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost) && ((NetworkObjectReference)(ref obj)).TryGet(ref val3, (NetworkManager)null)) { GrabbableObject componentInChildren = ((Component)val3).gameObject.GetComponentInChildren<GrabbableObject>(); if (componentInChildren is Snowball snowball) { snowball.isThrown = true; } componentInChildren.DestroyObjectInHand(componentInChildren.playerHeldBy); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_SnowPlaygroundsNetworkManager() { //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 //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown NetworkManager.__rpc_func_table.Add(1821787614u, new RpcReceiveHandler(__rpc_handler_1821787614)); NetworkManager.__rpc_func_table.Add(3894029020u, new RpcReceiveHandler(__rpc_handler_3894029020)); NetworkManager.__rpc_func_table.Add(656925776u, new RpcReceiveHandler(__rpc_handler_656925776)); NetworkManager.__rpc_func_table.Add(3183850724u, new RpcReceiveHandler(__rpc_handler_3183850724)); NetworkManager.__rpc_func_table.Add(4091119933u, new RpcReceiveHandler(__rpc_handler_4091119933)); NetworkManager.__rpc_func_table.Add(3744428089u, new RpcReceiveHandler(__rpc_handler_3744428089)); } private static void __rpc_handler_1821787614(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_006b: 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_007e: 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_0091: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); NetworkObjectReference obj = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable)); Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); Quaternion rotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation); target.__rpc_exec_stage = (__RpcExecStage)1; ((SnowPlaygroundsNetworkManager)(object)target).SpawnSnowmanServerRpc(playerId, obj, position, rotation); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3894029020(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); NetworkObjectReference obj = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable)); int nbSnowball = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref nbSnowball); target.__rpc_exec_stage = (__RpcExecStage)2; ((SnowPlaygroundsNetworkManager)(object)target).SpawnSnowmanClientRpc(playerId, obj, nbSnowball); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_656925776(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference obj = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)2; ((SnowPlaygroundsNetworkManager)(object)target).AddFakeSnowmanClientRpc(obj); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3183850724(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference obj = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((SnowPlaygroundsNetworkManager)(object)target).DestroySnowmanServerRpc(obj); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4091119933(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference obj = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)2; ((SnowPlaygroundsNetworkManager)(object)target).DestroySnowmanClientRpc(obj); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3744428089(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference obj = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref obj, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)2; ((SnowPlaygroundsNetworkManager)(object)target).DestroyObjectClientRpc(obj); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "SnowPlaygroundsNetworkManager"; } } } namespace SnowPlaygrounds.Behaviours { public class EnemyFreezeBehaviour : MonoBehaviour { public EnemyAI enemy; public Coroutine freezeCoroutine; public float originalSpeed; public float slowedSpeed; public void StartFreeze(float duration, float slowdownFactor) { if (freezeCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(freezeCoroutine); } freezeCoroutine = ((MonoBehaviour)this).StartCoroutine(FreezeCoroutine(duration, slowdownFactor)); } private IEnumerator FreezeCoroutine(float duration, float slowdownFactor) { if ((Object)(object)enemy != (Object)null) { originalSpeed = enemy.agent.speed; slowedSpeed = enemy.agent.speed / slowdownFactor; CustomPassManager.SetupCustomPassForEnemy(enemy); yield return (object)new WaitForSeconds(duration); CustomPassManager.RemoveAura(enemy); } freezeCoroutine = null; } private void LateUpdate() { if (freezeCoroutine != null && (Object)(object)enemy != (Object)null) { enemy.agent.speed = slowedSpeed; EnemyAI obj = enemy; SandSpiderAI val = (SandSpiderAI)(object)((obj is SandSpiderAI) ? obj : null); if (val != null) { val.spiderSpeed = slowedSpeed; } } } } public class FrozenCustomPass : CustomPass { public Dictionary<Renderer, Material> rendererMaterials = new Dictionary<Renderer, Material>(); public void AddTargetRenderers(Renderer[] renderers, Material material) { foreach (Renderer key in renderers) { if (!rendererMaterials.ContainsKey(key)) { rendererMaterials[key] = material; } } } public void RemoveTargetRenderers(List<Renderer> renderers) { foreach (Renderer renderer in renderers) { rendererMaterials.Remove(renderer); } } public override void Execute(CustomPassContext ctx) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) foreach (KeyValuePair<Renderer, Material> rendererMaterial in rendererMaterials) { Renderer key = rendererMaterial.Key; Material value = rendererMaterial.Value; if (!((Object)(object)key == (Object)null) && key.sharedMaterials != null) { for (int i = 0; i < key.sharedMaterials.Length; i++) { ctx.cmd.DrawRenderer(key, value); } } } } } } namespace SnowPlaygrounds.Behaviours.MapObjects { public class Snowman : NetworkBehaviour { public InteractTrigger snowmanTrigger; public Camera camera; public Transform cameraPivot; private Camera playerCamera; public int currentStackedSnowball; public bool isPlayerHiding; public PlayerControllerB hidingPlayer; public bool isEnemyHiding; private void Start() { if (currentStackedSnowball == 0) { currentStackedSnowball = ConfigManager.amountSnowballToBuild.Value; } playerCamera = GameNetworkManager.Instance.localPlayerController.gameplayCamera; } public void Update() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) if (!isEnemyHiding) { return; } Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, 7f, StartOfRound.Instance.playersMask, (QueryTriggerInteraction)2); Collider[] array2 = array; foreach (Collider val in array2) { PlayerControllerB component = ((Component)val).GetComponent<PlayerControllerB>(); if ((Object)(object)component != (Object)null && (Object)(object)component == (Object)(object)GameNetworkManager.Instance.localPlayerController) { SpawnFrostbiteServerRpc(); break; } } } [ServerRpc(RequireOwnership = false)] public void SpawnFrostbiteServerRpc() { //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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2126077130u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2126077130u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { SpawnFrostbiteClientRpc(); GameObject val3 = Object.Instantiate<GameObject>(SnowPlaygrounds.frostbiteEnemy.enemyPrefab, ((Component)this).transform.position, ((Component)this).transform.rotation); val3.GetComponentInChildren<NetworkObject>().Spawn(true); ((EnemyAI)val3.GetComponent<FrostbiteAI>()).moveTowardsDestination = true; } } } [ClientRpc] public void SpawnFrostbiteClientRpc() { //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_00cd: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2165018637u, val, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2165018637u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { if (ConfigManager.isJumpscareOn.Value) { SPUtilities.PlayJumpscareAudio(((Component)this).transform.position); } Object.Destroy((Object)(object)((Component)this).gameObject); } } public void SnowmanInteraction() { if (currentStackedSnowball < ConfigManager.amountSnowballToBuild.Value) { BuildSnowman(); } else if ((Object)(object)hidingPlayer == (Object)null) { EnterSnowmanServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId); } } public void BuildSnowman() { PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; int num = 0; for (int i = 0; i < localPlayerController.ItemSlots.Length; i++) { GrabbableObject val = localPlayerController.ItemSlots[i]; if (!((Object)(object)val == (Object)null) && val is Snowball snowball) { num += snowball.currentStackedItems; localPlayerController.DestroyItemInSlotAndSync(i); } } if (num > 0) { BuildSnowmanServerRpc(num); } } [ServerRpc(RequireOwnership = false)] public void BuildSnowmanServerRpc(int nbSnowball) { //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)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(250282495u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, nbSnowball); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 250282495u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { BuildSnowmanClientRpc(nbSnowball); } } } [ClientRpc] public void BuildSnowmanClientRpc(int nbSnowball) { //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) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(582671939u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, nbSnowball); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 582671939u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost)) { return; } currentStackedSnowball += nbSnowball; if (currentStackedSnowball >= ConfigManager.amountSnowballToBuild.Value) { ((Component)this).gameObject.transform.localScale = Constants.SNOWMAN_SCALE; if (((NetworkBehaviour)GameNetworkManager.Instance.localPlayerController).IsServer || ((NetworkBehaviour)GameNetworkManager.Instance.localPlayerController).IsHost) { SnowPlaygrounds.snowmen.Add(this); } } else { ((Component)this).gameObject.transform.localScale = Constants.SNOWMAN_SCALE / (float)ConfigManager.amountSnowballToBuild.Value * (float)currentStackedSnowball; } RefreshHoverTip(); } [ServerRpc(RequireOwnership = false)] public void EnterSnowmanServerRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_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)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1632170201u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1632170201u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { EnterSnowmanClientRpc(playerId); } } } [ClientRpc] public void EnterSnowmanClientRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_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) //IL_0119: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3258798334u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3258798334u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { PlayerControllerB component = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent<PlayerControllerB>(); component.DropAllHeldItems(true, false); snowmanTrigger.interactable = false; isPlayerHiding = true; hidingPlayer = component; ((Component)this).transform.SetParent(((Component)component).transform); ((Component)this).transform.position = ((Component)component).transform.position; ((Component)this).transform.rotation = ((Component)component).transform.rotation; if ((Object)(object)component == (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((Behaviour)camera).enabled = true; component.gameplayCamera = camera; HUDManager.Instance.ChangeControlTip(0, "Exit Snowman : [Q]", true); SPUtilities.SetUntargetable(component); IngamePlayerSettings.Instance.playerInput.actions.FindAction("Move", false).Disable(); IngamePlayerSettings.Instance.playerInput.actions.FindAction("Jump", false).Disable(); IngamePlayerSettings.Instance.playerInput.actions.FindAction("Crouch", false).Disable(); } } } public void ExitSnowman() { ExitSnowmanServerRpc((int)GameNetworkManager.Instance.localPlayerController.playerClientId); } [ServerRpc(RequireOwnership = false)] public void ExitSnowmanServerRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_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)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(1399882726u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 1399882726u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { ExitSnowmanClientRpc(playerId); } } } [ClientRpc] public void ExitSnowmanClientRpc(int playerId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_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) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(430531836u, val, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 430531836u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost)) { PlayerControllerB component = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent<PlayerControllerB>(); ((Component)this).transform.SetParent((Transform)null); if ((Object)(object)component == (Object)(object)GameNetworkManager.Instance.localPlayerController) { ((Behaviour)camera).enabled = false; component.gameplayCamera = playerCamera; HUDManager.Instance.ClearControlTips(); SPUtilities.StartTargetable(GameNetworkManager.Instance.localPlayerController, ConfigManager.snowmanSlowdownDuration.Value); IngamePlayerSettings.Instance.playerInput.actions.FindAction("Move", false).Enable(); IngamePlayerSettings.Instance.playerInput.actions.FindAction("Jump", false).Enable(); IngamePlayerSettings.Instance.playerInput.actions.FindAction("Crouch", false).Enable(); } Object.Destroy((Object)(object)((Component)this).gameObject); } } public override void OnDestroy() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) SPUtilities.PlaySnowmanParticle(((Component)this).transform.position, ((Component)this).transform.rotation); ((NetworkBehaviour)this).OnDestroy(); } private void OnTriggerEnter(Collider other) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)other == (Object)null) && isPlayerHiding) { EnemyAICollisionDetect component = ((Component)other).GetComponent<EnemyAICollisionDetect>(); if ((Object)(object)component != (Object)null) { FreezeEnemyServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)component.mainScript).NetworkObject)); } } } [ServerRpc(RequireOwnership = false)] public void FreezeEnemyServerRpc(NetworkObjectReference enemyObject) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost)) { ServerRpcParams val = default(ServerRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(262410415u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref enemyObject, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendServerRpc(ref val2, 262410415u, val, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost)) { FreezeEnemyClientRpc(enemyObject); } } } [ClientRpc] public void FreezeEnemyClientRpc(NetworkObjectReference enemyObject) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost)) { ClientRpcParams val = default(ClientRpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(2473326800u, val, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref enemyObject, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendClientRpc(ref val2, 2473326800u, val, (RpcDelivery)0); } NetworkObject val3 = default(NetworkObject); if ((int)base.__rpc_exec_stage != 2 || (!networkManager.IsClient && !networkManager.IsHost) || !((NetworkObjectReference)(ref enemyObject)).TryGet(ref val3, (NetworkManager)null)) { return; } EnemyAI componentInChildren = ((Component)val3).gameObject.GetComponentInChildren<EnemyAI>(); if ((Object)(object)componentInChildren != (Object)null) { if ((Object)(object)hidingPlayer != (Object)null && (Object)(object)hidingPlayer == (Object)(object)GameNetworkManager.Instance.localPlayerController) { ExitSnowman(); } if (componentInChildren is FrostbiteAI frostbiteAI) { frostbiteAI.HitFrostbite(); } else { SPUtilities.StartFreezeEnemy(componentInChildren, ConfigManager.snowmanSlowdownDuration.Value, ConfigManager.snowmanSlowdownFactor.Value); } } } public void RefreshHoverTip() { if (currentStackedSnowball < ConfigManager.amountSnowballToBuild.Value) { snowmanTrigger.hoverTip = $"Add snowball {currentStackedSnowball}/{ConfigManager.amountSnowballToBuild.Value} : [LMB]"; } else { snowmanTrigger.hoverTip = "Enter : [LMB]"; } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } [RuntimeInitializeOnLoadMethod] internal static void InitializeRPCS_Snowman() { //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 //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_00e9: Unknown result type (might be due to invalid IL or missing references)