using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using DigitalRuby.ThunderAndLightning; using GameNetcodeStuff; using HarmonyLib; using LegaFusionCore; using LegaFusionCore.Managers; using LegaFusionCore.Managers.NetworkManagers; using LegaFusionCore.ModsCompat; using LegaFusionCore.Registries; using LegaFusionCore.Utilities; using LethalLib.Extras; using LethalLib.Modules; using LethalStatus.Managers; using Microsoft.CodeAnalysis; using StrangerThings.Behaviours.Enemies; using StrangerThings.Behaviours.Items; using StrangerThings.Behaviours.Items.Figurines; using StrangerThings.Behaviours.MapObjects; using StrangerThings.Behaviours.Scripts; using StrangerThings.Behaviours.Scripts.Projectiles; using StrangerThings.Managers; using StrangerThings.ModsCompat; using StrangerThings.NetcodePatcher; using StrangerThings.Patches; using StrangerThings.Registries; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.Audio; using UnityEngine.InputSystem; using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("StrangerThings")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("StrangerThings")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("55a48e0f-a2f5-4aaf-a2fa-909d3c45d5d2")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: IgnoresAccessChecksTo("AmazingAssets.TerrainToMesh")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("ClientNetworkTransform")] [assembly: IgnoresAccessChecksTo("com.olegknyazev.softmask")] [assembly: IgnoresAccessChecksTo("DissonanceVoip")] [assembly: IgnoresAccessChecksTo("DunGen")] [assembly: IgnoresAccessChecksTo("DunGen.Integration.ASPP")] [assembly: IgnoresAccessChecksTo("DunGen.Integration.UnityNav")] [assembly: IgnoresAccessChecksTo("EasyTextEffects")] [assembly: IgnoresAccessChecksTo("Facepunch Transport for Netcode for GameObjects")] [assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")] [assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")] [assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging")] [assembly: IgnoresAccessChecksTo("Unity.Animation.Rigging.DocCodeExamples")] [assembly: IgnoresAccessChecksTo("Unity.Burst")] [assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")] [assembly: IgnoresAccessChecksTo("Unity.Collections")] [assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")] [assembly: IgnoresAccessChecksTo("Unity.Jobs")] [assembly: IgnoresAccessChecksTo("Unity.Mathematics")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.Common")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.MetricTypes")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStats")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Component")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Configuration")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsMonitor.Implementation")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetStatsReporting")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkProfiler.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Multiplayer.Tools.NetworkSolutionInterface")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Components")] [assembly: IgnoresAccessChecksTo("Unity.Netcode.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Networking.Transport")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Csg")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.KdTree")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Poly2Tri")] [assembly: IgnoresAccessChecksTo("Unity.ProBuilder.Stl")] [assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Config.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.HighDefinition.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")] [assembly: IgnoresAccessChecksTo("Unity.Services.Authentication")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Analytics")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Components")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Configuration")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Device")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Environments.Internal")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Internal")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Networking")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Registration")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Scheduler")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Telemetry")] [assembly: IgnoresAccessChecksTo("Unity.Services.Core.Threading")] [assembly: IgnoresAccessChecksTo("Unity.Services.QoS")] [assembly: IgnoresAccessChecksTo("Unity.Services.Relay")] [assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")] [assembly: IgnoresAccessChecksTo("Unity.Timeline")] [assembly: IgnoresAccessChecksTo("Unity.VisualEffectGraph.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.XR.CoreUtils")] [assembly: IgnoresAccessChecksTo("Unity.XR.Management")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.ConformanceAutomation")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.MetaQuestSupport")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.MockRuntime")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.OculusQuestSupport")] [assembly: IgnoresAccessChecksTo("Unity.XR.OpenXR.Features.RuntimeDebugger")] [assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.SpatialTracking")] [assembly: IgnoresAccessChecksTo("UnityEngine.UI")] [assembly: IgnoresAccessChecksTo("UnityEngine.XR.LegacyInputHelpers")] [assembly: 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] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace StrangerThings { internal class Constants { public const string GLOBAL = "_Global_"; public const string MIRROR_SCRAPS = "Mirror Scraps"; public const string UPSIDE_DOWN = "Upside Down"; public const string BATS_HORDE = "Bats Horde"; public const string VINES_ZONE = "Vines Zone"; public const string DEMOGORGON = "Demogorgon"; public const string HENRY_CREEL = "Henry Creel"; public const string VECNA = "Vecna"; public const string CRUSTAPIKAN = "Crustapikan"; public const string CRUSTAPIKAN_LARVAE = "Crustapikan Larvae"; public const string LIMADON = "Limadon"; public const string MIRROR_FUSION = "Mirror Fusion : [E]"; } [BepInPlugin("Lega.StrangerThings", "Stranger Things", "1.0.4")] public class StrangerThings : BaseUnityPlugin { public const string modGUID = "Lega.StrangerThings"; public const string modName = "Stranger Things"; public const string modVersion = "1.0.4"; private readonly Harmony harmony = new Harmony("Lega.StrangerThings"); internal static readonly AssetBundle bundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "strangerthings")); internal static ManualLogSource mls; public static ConfigFile configFile; public static GameObject managerPrefab = NetworkPrefabs.CreateNetworkPrefab("StrangerThingsNetworkManager"); public static Dictionary UpsideDownEnemies = new Dictionary(); public static GameObject UpsideDownAtmosphereObj; public static GameObject UpsideDownSporesObj; public static GameObject UpsideDownPortalObj; public static GameObject UpsideDownMirrorObjectObj; public static GameObject AntennaHazardObj; public static GameObject RockProjectileObj; public static GameObject PebbleProjectileObj; public static GameObject LogProjectileObj; public static GameObject Tree1Obj; public static GameObject Tree2Obj; public static GameObject Tree3Obj; public static GameObject BatsSkyObj; public static Item AntennaItem; public static Item ElevenPopItem; public static GameObject BatsHordeObj; public static GameObject VinesZoneObj; public static EnemyType LimadonType; public static EnemyType CrustopikanLarvaeType; public static Material ZoneFilterMat; public static GameObject StoneImpactAudioObj; public static GameObject DoorImpact1AudioObj; public static GameObject DoorImpact2AudioObj; public static GameObject DoorImpact3AudioObj; public void Awake() { mls = Logger.CreateLogSource("StrangerThings"); configFile = ((BaseUnityPlugin)this).Config; ConfigManager.Load(); LoadManager(); NetcodePatcher(); LoadItems(); LoadHazards(); LoadEnemies(); LoadPrefabs(); LoadNetworkPrefabs(); harmony.PatchAll(typeof(AudioMixerPatch)); harmony.PatchAll(typeof(NetworkBehaviourPatch)); harmony.PatchAll(typeof(StartOfRoundPatch)); harmony.PatchAll(typeof(RoundManagerPatch)); harmony.PatchAll(typeof(StartMatchLeverPatch)); harmony.PatchAll(typeof(PlayerControllerBPatch)); harmony.PatchAll(typeof(GrabbableObjectPatch)); harmony.PatchAll(typeof(ShotgunItemPatch)); harmony.PatchAll(typeof(FlashlightItemPatch)); harmony.PatchAll(typeof(GiftBoxItemPatch)); harmony.PatchAll(typeof(StormyWeatherPatch)); harmony.PatchAll(typeof(LightningBoltScriptPatch)); harmony.PatchAll(typeof(DoorLockPatch)); harmony.PatchAll(typeof(EnemyAIPatch)); harmony.PatchAll(typeof(FlowerSnakeEnemyPatch)); harmony.PatchAll(typeof(HoarderBugAIPatch)); harmony.PatchAll(typeof(JesterAIPatch)); harmony.PatchAll(typeof(NutcrackerEnemyAIPatch)); harmony.PatchAll(typeof(RadMechAIPatch)); harmony.PatchAll(typeof(SandSpiderWebTrapPatch)); harmony.PatchAll(typeof(DeadBodyInfoPatch)); harmony.PatchAll(typeof(VehicleControllerPatch)); LethalMinSoftCompat.Patch(harmony); MelaniesVoiceSoftCompat.Patch(harmony); OpenBodyCamsSoftCompat.Patch(harmony); SelfSortingStorageSoftCompat.Patch(harmony); SpectateEnemySoftCompat.Patch(harmony); } public static void LoadManager() { Utilities.FixMixerGroups(managerPrefab); managerPrefab.AddComponent(); } 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() { AntennaItem = LFCObjectsManager.RegisterObject(typeof(AntennaItem), bundle.LoadAsset("Assets/Antenna/AntennaItem.asset")); Items.RegisterShopItem(AntennaItem, 10); LFCSpawnableItemRegistry.Add(typeof(ElevenPop), ElevenPopItem = bundle.LoadAsset("Assets/Items/Figurines/Eleven/ElevenPopItem.asset"), 0, 1, 5, 200, 300); LFCSpawnableItemRegistry.Add(typeof(BaseballBat), bundle.LoadAsset("Assets/Items/BaseballBat/BaseballBatItem.asset"), 0, 2, 10, 180, 270); LFCSpawnableItemRegistry.Add(typeof(Guitar), bundle.LoadAsset("Assets/Items/Guitar/GuitarItem.asset"), 0, 2, 15, 170, 255); LFCSpawnableItemRegistry.Add(typeof(UpsideDownObject), bundle.LoadAsset("Assets/Items/StarcourtSign/StarcourtSignItem.asset"), 0, 2, 50, 100, 150); LFCSpawnableItemRegistry.Add(typeof(UpsideDownObject), bundle.LoadAsset("Assets/Items/WalkieTalkie/WalkieTalkieItem.asset"), 0, 2, 60, 80, 120); LFCSpawnableItemRegistry.Add(typeof(UpsideDownObject), bundle.LoadAsset("Assets/Items/Camera/CameraItem.asset"), 0, 2, 70, 60, 90); LFCSpawnableItemRegistry.Add(typeof(UpsideDownObject), bundle.LoadAsset("Assets/Items/WafflesBox/WafflesBoxItem.asset"), 0, 2, 75, 50, 75); LFCSpawnableItemRegistry.Add(typeof(UpsideDownObject), bundle.LoadAsset("Assets/Items/FairyLights/FairyLightsItem.asset"), 0, 2, 75, 50, 75); } public void LoadHazards() { BatsHordeObj = RegisterHazard(bundle.LoadAsset("Assets/UpsideDown/Bats/BatsHorde.prefab"), ConfigManager.minBatsHordeInside.Value, ConfigManager.maxBatsHordeInside.Value); VinesZoneObj = RegisterHazard(bundle.LoadAsset("Assets/UpsideDown/Vines/VinesZone.prefab"), ConfigManager.minVinesZoneInside.Value, ConfigManager.maxVinesZoneInside.Value); } public GameObject RegisterHazard(GameObject gameObject, 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown SpawnableMapObjectDef val = ScriptableObject.CreateInstance(); 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); MapObjects.RegisterMapObject(val, (LevelTypes)(-1), (Func)((SelectableLevel _) => animationCurveInside)); return val.spawnableMapObject.prefabToSpawn; } public void LoadEnemies() { ConfigManager.GetEnemySpawns(ConfigManager.demogorgonSpawnWeights.Value, out var spawnRateByLevelType, out var spawnRateByCustomLevelType); TerminalNode terminalNode = bundle.LoadAsset("Assets/Enemies/Demogorgon/DemogorgonTN.asset"); TerminalKeyword terminalKeyword = bundle.LoadAsset("Assets/Enemies/Demogorgon/DemogorgonTK.asset"); Item bodyItem = bundle.LoadAsset("Assets/Enemies/Demogorgon/DemogorgonHeadItem.asset"); RegisterEnemy(bundle.LoadAsset("Assets/Enemies/Demogorgon/DemogorgonKidnapperEnemy.asset"), spawnRateByLevelType, spawnRateByCustomLevelType, terminalNode, terminalKeyword, bodyItem, ConfigManager.demogorgonMinHeadValue.Value, ConfigManager.demogorgonMaxHeadValue.Value); RegisterEnemy(bundle.LoadAsset("Assets/Enemies/Demogorgon/DemogorgonHunterEnemy.asset"), spawnRateByLevelType, spawnRateByCustomLevelType, terminalNode, terminalKeyword, bodyItem, ConfigManager.demogorgonMinHeadValue.Value, ConfigManager.demogorgonMaxHeadValue.Value); ConfigManager.GetEnemySpawns(ConfigManager.henrySpawnWeights.Value, out var spawnRateByLevelType2, out var spawnRateByCustomLevelType2); RegisterEnemy(bundle.LoadAsset("Assets/Enemies/Vecna/Henry/HenryEnemy.asset"), spawnRateByLevelType2, spawnRateByCustomLevelType2, null, null); RegisterUpsideDownEnemy(bundle.LoadAsset("Assets/Enemies/Crustapikan/CrustapikanEnemy.asset"), ConfigManager.crustapikanRarity.Value, bundle.LoadAsset("Assets/Enemies/Crustapikan/CrustapikanTN.asset"), bundle.LoadAsset("Assets/Enemies/Crustapikan/CrustapikanTK.asset"), bundle.LoadAsset("Assets/Enemies/Crustapikan/CrustapikanArmItem.asset"), ConfigManager.crustapikanMinArmValue.Value, ConfigManager.crustapikanMaxArmValue.Value); LimadonType = RegisterUpsideDownEnemy(bundle.LoadAsset("Assets/Enemies/Limadon/LimadonEnemy.asset"), ConfigManager.limadonRarity.Value, bundle.LoadAsset("Assets/Enemies/Limadon/LimadonTN.asset"), bundle.LoadAsset("Assets/Enemies/Limadon/LimadonTK.asset"), bundle.LoadAsset("Assets/Enemies/Limadon/LimadonCorpseItem.asset"), ConfigManager.limadonMinCorpseValue.Value, ConfigManager.limadonMaxCorpseValue.Value); CrustopikanLarvaeType = RegisterUpsideDownEnemy(bundle.LoadAsset("Assets/Enemies/CrustapikanLarvae/CrustapikanLarvaeEnemy.asset"), ConfigManager.crustapikanLarvaeRarity.Value, bundle.LoadAsset("Assets/Enemies/CrustapikanLarvae/CrustapikanLarvaeTN.asset"), bundle.LoadAsset("Assets/Enemies/CrustapikanLarvae/CrustapikanLarvaeTK.asset"), bundle.LoadAsset("Assets/Enemies/CrustapikanLarvae/CrustapikanLarvaeCorpseItem.asset"), ConfigManager.crustapikanLarvaeMinCorpseValue.Value, ConfigManager.crustapikanLarvaeMaxCorpseValue.Value); } public void RegisterEnemy(EnemyType enemyType, Dictionary spawnRateByLevelType, Dictionary spawnRateByCustomLevelType, TerminalNode terminalNode, TerminalKeyword terminalKeyword, Item bodyItem = null, int bodyMinValue = 0, int bodyMaxValue = 0, bool bodyEnabled = true) { NetworkPrefabs.RegisterNetworkPrefab(enemyType.enemyPrefab); Enemies.RegisterEnemy(enemyType, spawnRateByLevelType, spawnRateByCustomLevelType, terminalNode, terminalKeyword); if ((Object)(object)bodyItem != (Object)null && bodyMinValue > 0 && bodyMaxValue > bodyMinValue) { SellBodiesFixedSoftCompat.RegisterBody(enemyType.enemyName, bodyItem, bodyMinValue, bodyMaxValue, bodyEnabled); } } public EnemyType RegisterUpsideDownEnemy(EnemyType enemyType, int rarity, TerminalNode terminalNode, TerminalKeyword terminalKeyword, Item bodyItem, int bodyMinValue = 0, int bodyMaxValue = 0, bool bodyEnabled = true) { NetworkPrefabs.RegisterNetworkPrefab(enemyType.enemyPrefab); Enemies.RegisterEnemy(enemyType, rarity, (LevelTypes)1, terminalNode, terminalKeyword); if ((Object)(object)bodyItem != (Object)null && bodyMinValue > 0 && bodyMaxValue > bodyMinValue) { SellBodiesFixedSoftCompat.RegisterBody(enemyType.enemyName, bodyItem, bodyMinValue, bodyMaxValue, bodyEnabled); } UpsideDownEnemies.Add(enemyType, rarity); return enemyType; } public void LoadPrefabs() { UpsideDownAtmosphereObj = bundle.LoadAsset("Assets/UpsideDown/UpsideDownAtmosphere.prefab"); UpsideDownSporesObj = bundle.LoadAsset("Assets/UpsideDown/Spores/Spores.prefab"); Tree1Obj = bundle.LoadAsset("Assets/UpsideDown/Trees/Tree1.prefab"); Tree2Obj = bundle.LoadAsset("Assets/UpsideDown/Trees/Tree2.prefab"); Tree3Obj = bundle.LoadAsset("Assets/UpsideDown/Trees/Tree3.prefab"); BatsSkyObj = bundle.LoadAsset("Assets/UpsideDown/Bats/BatsSky.prefab"); ZoneFilterMat = bundle.LoadAsset("Assets/UpsideDown/Vines/M_ZoneFilter.mat"); } public void LoadNetworkPrefabs() { Dictionary dictionary = new Dictionary { { UpsideDownPortalObj = bundle.LoadAsset("Assets/UpsideDown/Portal/UpsideDownPortal.prefab"), false }, { UpsideDownMirrorObjectObj = bundle.LoadAsset("Assets/Items/UpsideDownMirrorObject.prefab"), false }, { AntennaHazardObj = bundle.LoadAsset("Assets/Antenna/AntennaHazard.prefab"), false }, { RockProjectileObj = bundle.LoadAsset("Assets/Projectiles/Stone/RockProjectile.prefab"), false }, { PebbleProjectileObj = bundle.LoadAsset("Assets/Projectiles/Stone/PebbleProjectile.prefab"), false }, { LogProjectileObj = bundle.LoadAsset("Assets/Projectiles/Log/LogProjectile.prefab"), false }, { StoneImpactAudioObj = bundle.LoadAsset("Assets/Audios/Prefabs/StoneImpactAudio.prefab"), false }, { DoorImpact1AudioObj = bundle.LoadAsset("Assets/Audios/Prefabs/DoorImpact1Audio.prefab"), true }, { DoorImpact2AudioObj = bundle.LoadAsset("Assets/Audios/Prefabs/DoorImpact2Audio.prefab"), true }, { DoorImpact3AudioObj = bundle.LoadAsset("Assets/Audios/Prefabs/DoorImpact3Audio.prefab"), true } }; foreach (KeyValuePair item in dictionary) { GameObject key = item.Key; NetworkPrefabs.RegisterNetworkPrefab(key); Utilities.FixMixerGroups(key); if (item.Value) { LFCPrefabRegistry.RegisterPrefab(((Object)key).name, key); } } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "StrangerThings"; public const string PLUGIN_NAME = "StrangerThings"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace StrangerThings.Registries { public class DimensionRegistry : MonoBehaviour { private static readonly HashSet UpsideDownEntities = new HashSet(); public static GameObject GetUpsideDownEntity(GameObject entity) { UpsideDownEntities.RemoveWhere((GameObject e) => (Object)(object)e == (Object)null); return ((IEnumerable)UpsideDownEntities).FirstOrDefault((Func)((GameObject e) => (Object)(object)e == (Object)(object)entity)); } public static bool CanSetInUpsideDown(GameObject entity, bool isInUpsideDown) { PlayerControllerB safeComponent = LFCUtilities.GetSafeComponent(entity); if ((Object)(object)safeComponent != (Object)null && !safeComponent.isPlayerDead && !isInUpsideDown) { foreach (UpsideDownPortal upsideDownPortal in MapObjectsManager.GetUpsideDownPortals()) { if (!((Object)(object)upsideDownPortal.corruptedPlayer == (Object)(object)safeComponent)) { continue; } if (!StartOfRound.Instance.shipHasLanded) { upsideDownPortal.RestorePortalEveryoneRpc(); continue; } if (LFCUtilities.ShouldBeLocalPlayer(safeComponent)) { HUDManager.Instance.DisplayTip("Impossible action", "You have been corrupted. You must find another way out.", false, false, "LC_Tip1"); } return false; } } if (!isInUpsideDown) { return UpsideDownEntities.Remove(entity); } return UpsideDownEntities.Add(entity); } public static void SetInUpsideDown(GameObject entity, bool isInUpsideDown) { if ((Object)(object)LFCUtilities.LocalPlayer == (Object)null || (Object)(object)entity == (Object)null || !CanSetInUpsideDown(entity, isInUpsideDown)) { return; } PlayerControllerB safeComponent = LFCUtilities.GetSafeComponent(entity); if ((Object)(object)safeComponent != (Object)null) { if (LFCUtilities.ShouldBeLocalPlayer(safeComponent)) { RefreshStatesForLocalClient(); UpdateLightsVisibilityForLocalClient(); UpdateShipFeaturesForLocalClient(); UpdateFlickeringFlashlights(safeComponent); if (!isInUpsideDown) { LFCCustomPassManager.RemoveFiltersByMaterial(StrangerThings.ZoneFilterMat); } UpsideDownAtmosphereController.Instance.SetUpsideDownState(isInUpsideDown); } else { if (LFCUtilities.LocalPlayer.isPlayerDead && (Object)(object)LFCUtilities.LocalPlayer.spectatedPlayerScript == (Object)(object)safeComponent) { SetInUpsideDown(((Component)LFCUtilities.LocalPlayer).gameObject, isInUpsideDown); return; } UpdateVisibilityState(((Component)safeComponent).gameObject); UpdateFlickeringFlashlights(safeComponent); } StartOfRound.Instance.UpdatePlayerVoiceEffects(); } else { UpdateVisibilityState(entity); } } public static bool IsInUpsideDown(GameObject entity) { if ((Object)(object)entity != (Object)null) { return Object.op_Implicit((Object)(object)GetUpsideDownEntity(entity)); } return false; } public static bool AreInSameDimension(GameObject a, GameObject b) { if (!((Object)(object)a == (Object)null) && !((Object)(object)b == (Object)null) && !IsBlacklisted(a) && !IsBlacklisted(b)) { return IsInUpsideDown(a) == IsInUpsideDown(b); } return true; } public static void RefreshStatesForLocalClient() { //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) NetworkBehaviour[] array = Object.FindObjectsOfType(true); foreach (NetworkBehaviour val in array) { if (val.IsSpawned && IsWhitelisted(((Component)val).gameObject)) { UpdateVisibilityState(((Component)val).gameObject); } } foreach (GrabbableObject allA in LFCSpawnRegistry.GetAllAs()) { if (LFCObjectsManager.GetItemSlots(LFCUtilities.LocalPlayer).Contains(allA)) { BeltBagItem val2 = (BeltBagItem)(object)((allA is BeltBagItem) ? allA : null); if (val2 != null) { for (int num = val2.objectsInBag.Count - 1; num >= 0; num--) { GrabbableObject val3 = val2.objectsInBag[num]; if ((Object)(object)val3 != (Object)null) { StrangerThingsNetworkManager.Instance.SetGObjectInUpsideDownEveryoneRpc(NetworkObjectReference.op_Implicit(((Component)val3).GetComponent()), IsInUpsideDown(((Component)LFCUtilities.LocalPlayer).gameObject)); } } } StrangerThingsNetworkManager.Instance.SetGObjectInUpsideDownEveryoneRpc(NetworkObjectReference.op_Implicit(((Component)allA).GetComponent()), IsInUpsideDown(((Component)LFCUtilities.LocalPlayer).gameObject)); } else { UpdateVisibilityState(((Component)allA).gameObject); } } PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val4 in allPlayerScripts) { if (LFCUtilities.ShouldNotBeLocalPlayer(val4)) { UpdateVisibilityState(((Component)val4).gameObject); } } SandSpiderWebTrap[] array2 = Object.FindObjectsOfType(true); foreach (SandSpiderWebTrap val5 in array2) { UpdateVisibilityState(((Component)val5).gameObject); } DeadBodyInfo[] array3 = Object.FindObjectsOfType(true); foreach (DeadBodyInfo val6 in array3) { UpdateVisibilityState(((Component)val6).gameObject); } } public static void UpdateVisibilityState(GameObject entity) { PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; if (AreInSameDimension((localPlayer != null) ? ((Component)localPlayer).gameObject : null, entity)) { LFCVisibilityRegistry.Restore(entity, "Stranger ThingsDimension"); } else { LFCVisibilityRegistry.Hide(entity, "Stranger ThingsDimension"); } } private static void UpdateLightsVisibilityForLocalClient() { foreach (Animator allPoweredLightsAnimator in RoundManager.Instance.allPoweredLightsAnimators) { if (IsInUpsideDown(((Component)LFCUtilities.LocalPlayer).gameObject)) { LFCPoweredLightsRegistry.AddLock(allPoweredLightsAnimator, "Stranger Things"); } else { LFCPoweredLightsRegistry.RemoveLock(allPoweredLightsAnimator, "Stranger Things"); } } } private static void UpdateShipFeaturesForLocalClient() { if (IsInUpsideDown(((Component)LFCUtilities.LocalPlayer).gameObject)) { LFCShipFeatureRegistry.AddLock((ShipFeatureType)0, "Stranger Things"); LFCShipFeatureRegistry.AddLock((ShipFeatureType)1, "Stranger Things"); LFCShipFeatureRegistry.AddLock((ShipFeatureType)2, "Stranger Things"); LFCShipFeatureRegistry.AddLock((ShipFeatureType)3, "Stranger Things"); LFCShipFeatureRegistry.AddLock((ShipFeatureType)4, "Stranger Things"); LFCShipFeatureRegistry.AddLock((ShipFeatureType)5, "Stranger Things"); LFCShipFeatureRegistry.AddLock((ShipFeatureType)6, "Stranger Things"); LFCShipFeatureRegistry.AddLock((ShipFeatureType)7, "Stranger Things"); LFCShipFeatureRegistry.AddLock((ShipFeatureType)8, "Stranger Things"); } else { LFCShipFeatureRegistry.ClearLocks("Stranger Things"); } } private static void UpdateFlickeringFlashlights(PlayerControllerB player) { if (IsInUpsideDown(((Component)player).gameObject)) { return; } HashSet setExact = LFCSpawnRegistry.GetSetExact(); if (setExact == null) { return; } foreach (FlashlightItem item in setExact.Cast()) { LFCObjectStateRegistry.RemoveFlickeringFlashlight(item, "Stranger Things" + player.playerUsername); } } public static bool IsWhitelisted(GameObject gObject) { if ((Object)(object)gObject != (Object)null && !IsBlacklisted(gObject)) { EnemyAI val = default(EnemyAI); VehicleController val2 = default(VehicleController); RockProjectile rockProjectile = default(RockProjectile); AntennaHazard antennaHazard = default(AntennaHazard); BatsHorde batsHorde = default(BatsHorde); VinesZone vinesZone = default(VinesZone); if (!gObject.TryGetComponent(ref val) && !gObject.TryGetComponent(ref val2) && !gObject.TryGetComponent(ref rockProjectile) && !gObject.TryGetComponent(ref antennaHazard) && !gObject.TryGetComponent(ref batsHorde) && !gObject.TryGetComponent(ref vinesZone)) { return LFCUtilities.HasNameFromList(LFCUtilities.GetGameObjectName(gObject), ConfigManager.visibilityStateInclusions.Value); } return true; } return false; } public static bool IsBlacklisted(GameObject gObject) { if ((Object)(object)gObject != (Object)null) { return LFCUtilities.HasNameFromList(LFCUtilities.GetGameObjectName(gObject), ConfigManager.visibilityStateExclusions.Value); } return false; } } } namespace StrangerThings.Patches { public class AudioMixerPatch { [HarmonyPatch(typeof(AudioMixer), "SetFloat")] [HarmonyBefore(new string[] { "me.swipez.melonloader.morecompany" })] [HarmonyPrefix] private static void UpdatePlayerVolume(string name, ref float value) { if ((Object)(object)StartOfRound.Instance == (Object)null || !name.StartsWith("PlayerVolume")) { return; } PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; if ((Object)(object)localPlayer == (Object)null || !localPlayer.isPlayerControlled || localPlayer.isPlayerDead) { return; } int length = "PlayerVolume".Length; string s = name.Substring(length, name.Length - length); if (int.TryParse(s, out var result) && result >= 0 && result < StartOfRound.Instance.allPlayerScripts.Length) { float num = 1f; PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[result]; if ((Object)(object)val != (Object)null && !DimensionRegistry.AreInSameDimension(((Component)localPlayer).gameObject, ((Component)val).gameObject)) { num = ((!DimensionRegistry.IsInUpsideDown(((Component)localPlayer).gameObject)) ? (((!localPlayer.speakingToWalkieTalkie || !val.holdingWalkieTalkie) && (!val.speakingToWalkieTalkie || !localPlayer.holdingWalkieTalkie)) ? 0f : (MapObjectsManager.IsNearAntenna(val) ? 1f : 0f)) : (((!localPlayer.speakingToWalkieTalkie || !val.holdingWalkieTalkie) && (!val.speakingToWalkieTalkie || !localPlayer.holdingWalkieTalkie)) ? 0.1f : (MapObjectsManager.IsNearAntenna(localPlayer) ? 1f : 0f))); } value *= num; } } } public class DeadBodyInfoPatch { [HarmonyPatch(typeof(DeadBodyInfo), "Awake")] [HarmonyPostfix] private static void AwakeDeadBodyInfo(DeadBodyInfo __instance) { if ((Object)(object)LFCUtilities.LocalPlayer != (Object)null) { DimensionRegistry.UpdateVisibilityState(((Component)__instance).gameObject); } } } public class DoorLockPatch { [HarmonyPatch(typeof(DoorLock), "OnTriggerStay")] [HarmonyPostfix] private static void BreakDoor(DoorLock __instance, ref Collider other) { //IL_0052: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_009a: Unknown result type (might be due to invalid IL or missing references) DoorProjectile doorProjectile = default(DoorProjectile); EnemyAICollisionDetect val = default(EnemyAICollisionDetect); if (LFCUtilities.IsServer && !__instance.isDoorOpened && !((Component)((Component)__instance).transform.root).TryGetComponent(ref doorProjectile) && ((Component)other).TryGetComponent(ref val) && val.mainScript is DemogorgonAI { isDashing: not false } demogorgonAI) { NetworkObjectReference obj = NetworkObjectReference.op_Implicit(((Component)__instance).GetComponentInParent()); Vector3 val2 = ((Component)((EnemyAI)demogorgonAI).targetPlayer).transform.position - ((Component)demogorgonAI).transform.position; demogorgonAI.BreakDoorEveryoneRpc(obj, ((Vector3)(ref val2)).normalized); ((EnemyAI)demogorgonAI).agent.speed = 0f; ((EnemyAI)demogorgonAI).agent.velocity = Vector3.zero; } } } public class EnemyAIPatch { [HarmonyPatch(typeof(EnemyAI), "Start")] [HarmonyPostfix] private static void StartEnemy(ref EnemyAI __instance) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) if (LFCUtilities.IsServer && !(__instance is UpsideDownEnemyAI)) { SpawnUpsideDownEnemy(((Component)__instance).transform.position); } } private static void SpawnUpsideDownEnemy(Vector3 position) { //IL_0000: 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_0029: 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_0030: 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_003d: 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) EnemyType randomEnemy = GetRandomEnemy(position.y > -80f); if ((Object)(object)randomEnemy != (Object)null) { position = RoundManager.Instance.GetRandomNavMeshPositionInRadiusSpherical(position, 10f, default(NavMeshHit)); GameObject val = Object.Instantiate(randomEnemy.enemyPrefab, position, Quaternion.identity); NetworkObject componentInChildren = val.GetComponentInChildren(); componentInChildren.Spawn(true); randomEnemy.numberSpawned++; RoundManager.Instance.SpawnedEnemies.Add(val.GetComponent()); } } public static EnemyType GetRandomEnemy(bool isOutside) { List eligibleEnemies = GetEligibleEnemies(isOutside); if (eligibleEnemies.Count <= 0) { return null; } return eligibleEnemies[new Random().Next(eligibleEnemies.Count)]; } public static List GetEligibleEnemies(bool isOutside) { List list = new List(); foreach (KeyValuePair upsideDownEnemy in StrangerThings.UpsideDownEnemies) { EnemyType key = upsideDownEnemy.Key; if (key.isOutsideEnemy == isOutside && key.numberSpawned < key.MaxCount) { for (int i = 0; i < upsideDownEnemy.Value; i++) { list.Add(key); } } } return list; } [HarmonyPatch(typeof(EnemyAI), "PlayerIsTargetable")] [HarmonyPrefix] private static bool PlayerIsTargetable(ref EnemyAI __instance, ref bool __result, PlayerControllerB playerScript) { if (!DimensionRegistry.AreInSameDimension(((Component)__instance).gameObject, (playerScript != null) ? ((Component)playerScript).gameObject : null) && !(__instance is DemogorgonKidnapperAI { currentBehaviourStateIndex: 0 })) { __result = false; return false; } return true; } [HarmonyPatch(typeof(EnemyAI), "NavigateTowardsTargetPlayer")] [HarmonyPrefix] private static bool NavigateTowardsPlayer(ref EnemyAI __instance) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (!DimensionRegistry.AreInSameDimension(((Component)__instance).gameObject, ((Component)__instance.targetPlayer).gameObject)) { UpsideDownPortal closestPortal = MapObjectsManager.GetClosestPortal(((Component)__instance).transform.position); if ((Object)(object)closestPortal != (Object)null) { __instance.destination = ((Component)closestPortal).transform.position; return false; } } return true; } [HarmonyPatch(typeof(EnemyAI), "TargetClosestPlayer")] [HarmonyPostfix] private static void PreventTargetClosestPlayer(EnemyAI __instance, ref bool __result) { if (__result && (Object)(object)__instance.targetPlayer != (Object)null && !DimensionRegistry.AreInSameDimension(((Component)__instance).gameObject, ((Component)__instance.targetPlayer).gameObject)) { __result = false; } } [HarmonyPatch(typeof(EnemyAI), "CheckLineOfSightForClosestPlayer")] [HarmonyPostfix] private static void PreventCheckLineOfSightForClosestPlayer(EnemyAI __instance, ref PlayerControllerB __result) { if ((Object)(object)__result != (Object)null && !DimensionRegistry.AreInSameDimension(((Component)__instance).gameObject, ((Component)__result).gameObject)) { __result = null; } } [HarmonyPatch(typeof(EnemyAI), "CheckLineOfSightForPlayer")] [HarmonyPostfix] private static void PreventCheckLineOfSightForPlayer(EnemyAI __instance, ref PlayerControllerB __result) { if ((Object)(object)__result != (Object)null && !DimensionRegistry.AreInSameDimension(((Component)__instance).gameObject, ((Component)__result).gameObject)) { __result = null; } } [HarmonyPatch(typeof(EnemyAI), "GetClosestPlayer")] [HarmonyPostfix] private static void PreventGetClosestPlayer(EnemyAI __instance, ref PlayerControllerB __result) { if ((Object)(object)__result != (Object)null && !DimensionRegistry.AreInSameDimension(((Component)__instance).gameObject, ((Component)__result).gameObject)) { __result = null; } } } public class FlashlightItemPatch { [HarmonyPatch(typeof(FlashlightItem), "SwitchFlashlight")] [HarmonyPostfix] private static void SwitchFlashlight(FlashlightItem __instance) { PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; if (!DimensionRegistry.AreInSameDimension((localPlayer != null) ? ((Component)localPlayer).gameObject : null, ((Component)__instance).gameObject)) { DimensionRegistry.UpdateVisibilityState(((Component)__instance).gameObject); } } [HarmonyPatch(typeof(FlashlightItem), "PocketFlashlightClientRpc")] [HarmonyPostfix] private static void PocketFlashlightForClients(FlashlightItem __instance) { PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; if (!DimensionRegistry.AreInSameDimension((localPlayer != null) ? ((Component)localPlayer).gameObject : null, ((Component)__instance).gameObject)) { DimensionRegistry.UpdateVisibilityState(((Component)__instance).gameObject); } } } public class FlowerSnakeEnemyPatch { [HarmonyPatch(typeof(FlowerSnakeEnemy), "Update")] [HarmonyPostfix] private static void UpdateTulipSnake(FlowerSnakeEnemy __instance) { if ((Object)(object)__instance.clingingToPlayer != (Object)null && !DimensionRegistry.AreInSameDimension(((Component)__instance).gameObject, ((Component)__instance.clingingToPlayer).gameObject)) { __instance.StopClingingOnLocalClient(__instance.clingPosition == 4); } } } public class GiftBoxItemPatch { [HarmonyTranspiler] [HarmonyPatch(typeof(GiftBoxItem), "OpenGiftBoxServerRpc")] private static IEnumerable OpenGiftBoxForServer(IEnumerable instructions) { //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Expected O, but got Unknown //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Expected O, but got Unknown List list = new List(instructions); MethodInfo methodInfo = AccessTools.Method(typeof(NetworkObject), "Spawn", new Type[1] { typeof(bool) }, (Type[])null); MethodInfo methodInfo2 = AccessTools.PropertyGetter(typeof(NetworkBehaviour), "NetworkObject"); MethodInfo methodInfo3 = AccessTools.Method(typeof(GiftBoxItemPatch), "SetInUpsideDown", (Type[])null, (Type[])null); for (int i = 0; i < list.Count; i++) { if (!CodeInstructionExtensions.Calls(list[i], methodInfo)) { continue; } int num = -1; for (int num2 = i; num2 >= 1; num2--) { if (CodeInstructionExtensions.Calls(list[num2], methodInfo2) && CodeInstructionExtensions.IsLdloc(list[num2 - 1], (LocalBuilder)null)) { num = num2 - 1; break; } } if (num != -1) { List list2 = new List(3) { list[num].Clone(), new CodeInstruction(OpCodes.Ldarg_0, (object)null), new CodeInstruction(OpCodes.Call, (object)methodInfo3) }; int index = i + 1; list.InsertRange(index, list2); i += list2.Count; } } return list; } private static void SetInUpsideDown(GrabbableObject grabbableObject, GiftBoxItem giftBox) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)grabbableObject != (Object)null && (Object)(object)giftBox != (Object)null && DimensionRegistry.IsInUpsideDown(((Component)giftBox).gameObject)) { StrangerThingsNetworkManager.Instance.SetGObjectInUpsideDownEveryoneRpc(NetworkObjectReference.op_Implicit(((Component)grabbableObject).GetComponent()), isInUpsideDown: true); } } } public class GrabbableObjectPatch { [HarmonyPatch(typeof(GrabbableObject), "EnableItemMeshes")] [HarmonyPostfix] private static void EnableItemMeshes(GrabbableObject __instance) { PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; if (!DimensionRegistry.AreInSameDimension((localPlayer != null) ? ((Component)localPlayer).gameObject : null, ((Component)__instance).gameObject)) { DimensionRegistry.UpdateVisibilityState(((Component)__instance).gameObject); } } [HarmonyPatch(typeof(GrabbableObject), "PocketItem")] [HarmonyPostfix] private static void PocketItem(GrabbableObject __instance) { PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; if (!DimensionRegistry.AreInSameDimension((localPlayer != null) ? ((Component)localPlayer).gameObject : null, ((Component)__instance).gameObject)) { DimensionRegistry.UpdateVisibilityState(((Component)__instance).gameObject); } } [HarmonyPatch(typeof(GrabbableObject), "DiscardItem")] [HarmonyPostfix] private static void DiscardItem(GrabbableObject __instance) { PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; if (!DimensionRegistry.AreInSameDimension((localPlayer != null) ? ((Component)localPlayer).gameObject : null, ((Component)__instance).gameObject)) { DimensionRegistry.UpdateVisibilityState(((Component)__instance).gameObject); } } } public class HoarderBugAIPatch { [HarmonyPatch(typeof(HoarderBugAI), "RefreshGrabbableObjectsInMapList")] [HarmonyPostfix] private static void RefreshGrabbableObjects() { HashSet gObjects = new HashSet(from g in LFCSpawnRegistry.GetAllAs() where (Object)(object)g != (Object)null && DimensionRegistry.IsInUpsideDown(((Component)g).gameObject) select ((Component)g).gameObject); HoarderBugAI.grabbableObjectsInMap.RemoveAll((GameObject g) => (Object)(object)g == (Object)null || gObjects.Contains(g)); HoarderBugAI.HoarderBugItems.RemoveAll((HoarderBugItem h) => h == null || (Object)(object)h.itemGrabbableObject == (Object)null || gObjects.Contains(((Component)h.itemGrabbableObject).gameObject)); } } public static class JesterAIPatch { [HarmonyPrefix] [HarmonyPatch(typeof(JesterAI), "Update")] private static void CaptureTimer(ref float ___noPlayersToChaseTimer, ref float __state) { __state = ___noPlayersToChaseTimer; } [HarmonyPostfix] [HarmonyAfter(new string[] { "AudioKnight.StarlancerAIFix" })] [HarmonyPatch(typeof(JesterAI), "Update")] private static void UpdateJester(ref JesterAI __instance, ref bool ___targetingPlayer, ref float ___noPlayersToChaseTimer, float __state) { if (!LFCUtilities.IsServer || ((EnemyAI)__instance).currentBehaviourStateIndex != 2) { return; } if ((Object)(object)((EnemyAI)__instance).targetPlayer != (Object)null && !DimensionRegistry.AreInSameDimension(((Component)__instance).gameObject, ((Component)((EnemyAI)__instance).targetPlayer).gameObject)) { ((EnemyAI)__instance).targetPlayer = null; } ___targetingPlayer = false; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (val.isPlayerControlled && val.isInsideFactory != ((EnemyAI)__instance).isOutside && DimensionRegistry.AreInSameDimension(((Component)__instance).gameObject, ((Component)val).gameObject)) { ___targetingPlayer = true; break; } } float num = __state; if (!___targetingPlayer) { num -= Time.deltaTime; if (num <= 0f) { ((EnemyAI)__instance).SwitchToBehaviourState(0); } } else { num = 5f; } ___noPlayersToChaseTimer = num; } } public class LightningBoltScriptPatch { [HarmonyPatch(typeof(LightningBoltScript), "CreateParameters")] [HarmonyPostfix] private static void UpsideDownStrike(ref LightningBoltParameters __result) { //IL_002f: 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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; if (DimensionRegistry.IsInUpsideDown((localPlayer != null) ? ((Component)localPlayer).gameObject : null)) { Color32 val = default(Color32); ((Color32)(ref val))..ctor((byte)230, (byte)25, (byte)25, byte.MaxValue); __result.Color = val; __result.MainTrunkTintColor = val; __result.Intensity = 1.6f; __result.GlowIntensity = 1.4f; __result.GlowWidthMultiplier = 1.2f; __result.Forkedness = 1.2f; } } } public class NetworkBehaviourPatch { [HarmonyPatch(typeof(NetworkBehaviour), "InternalOnNetworkSpawn")] [HarmonyPostfix] private static void SpawnNetworkBehaviour(NetworkBehaviour __instance) { VehicleController val = default(VehicleController); if (!((Component)__instance).gameObject.TryGetComponent(ref val) && (DimensionRegistry.IsWhitelisted(((Component)__instance).gameObject) || __instance is GrabbableObject)) { if (__instance is UpsideDownObject || __instance is UpsideDownEnemyAI) { DimensionRegistry.SetInUpsideDown(((Component)__instance).gameObject, isInUpsideDown: true); } else { DimensionRegistry.UpdateVisibilityState(((Component)__instance).gameObject); } } } } public class NutcrackerEnemyAIPatch { [HarmonyPatch(typeof(NutcrackerEnemyAI), "CheckLineOfSightForLocalPlayer")] [HarmonyPostfix] private static void PreventCheckLineOfSightForLocalPlayer(NutcrackerEnemyAI __instance, ref bool __result) { if (__result && (Object)(object)LFCUtilities.LocalPlayer != (Object)null && !DimensionRegistry.AreInSameDimension(((Component)__instance).gameObject, ((Component)LFCUtilities.LocalPlayer).gameObject)) { __result = false; } } [HarmonyPatch(typeof(NutcrackerEnemyAI), "TurnTorsoToTargetDegrees")] [HarmonyPostfix] private static void TurnTorsoAudio(NutcrackerEnemyAI __instance) { GameObject gameObject = ((Component)__instance).gameObject; PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; if (!DimensionRegistry.AreInSameDimension(gameObject, (localPlayer != null) ? ((Component)localPlayer).gameObject : null)) { __instance.torsoTurnAudio.volume = 0f; } } } public class PlayerControllerBPatch { private static bool canFlick = false; private static float flickerTimer = 0f; private static readonly float flickerCooldown = 0.5f; [HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")] [HarmonyPostfix] private static void StartPlayer(PlayerControllerB __instance) { if (LFCUtilities.ShouldBeLocalPlayer(__instance) && (Object)(object)UpsideDownAtmosphereController.Instance == (Object)null) { Object.Instantiate(StrangerThings.UpsideDownAtmosphereObj, ((Component)__instance.gameplayCamera).transform); } } [HarmonyPatch(typeof(PlayerControllerB), "Update")] [HarmonyPrefix] private static void PreUpdatePlayer(PlayerControllerB __instance, bool ___isCameraDisabled, bool ___isPlayerControlled, bool ___isHostPlayerObject, bool ___isTestingPlayer) { if (___isCameraDisabled && ((((NetworkBehaviour)__instance).IsOwner && ___isPlayerControlled && (!((NetworkBehaviour)__instance).IsServer || ___isHostPlayerObject)) || ___isTestingPlayer) && DimensionRegistry.IsInUpsideDown(((Component)__instance).gameObject)) { DimensionRegistry.SetInUpsideDown(((Component)LFCUtilities.LocalPlayer).gameObject, isInUpsideDown: false); } } [HarmonyPatch(typeof(PlayerControllerB), "Update")] [HarmonyPostfix] private static void PostUpdatePlayer(PlayerControllerB __instance) { //IL_0097: 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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)RoundManager.Instance == (Object)null) { return; } if (LFCUtilities.ShouldBeLocalPlayer(__instance)) { LFCUtilities.UpdateTimer(ref flickerTimer, flickerCooldown, !canFlick, (Action)delegate { canFlick = true; }); } else { if (!canFlick || !DimensionRegistry.IsInUpsideDown(((Component)__instance).gameObject)) { return; } canFlick = false; Animator val = null; float num = float.MaxValue; Vector3 val2; foreach (Animator allPoweredLightsAnimator in RoundManager.Instance.allPoweredLightsAnimators) { val2 = ((Component)allPoweredLightsAnimator).transform.position - ((Component)__instance).transform.position; float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude; if (!LFCPoweredLightsRegistry.IsLocked(allPoweredLightsAnimator) && sqrMagnitude <= 50f && sqrMagnitude < num) { num = sqrMagnitude; val = allPoweredLightsAnimator; } } if (val != null) { val.SetTrigger("Flicker"); } HashSet setExact = LFCSpawnRegistry.GetSetExact(); if (setExact == null) { return; } foreach (FlashlightItem item in setExact.Cast()) { if (!DimensionRegistry.IsInUpsideDown(((Component)item).gameObject)) { val2 = ((Component)item).transform.position - ((Component)__instance).transform.position; if (((Vector3)(ref val2)).sqrMagnitude <= 25f) { LFCObjectStateRegistry.AddFlickeringFlashlight(item, "Stranger Things" + __instance.playerUsername); continue; } } LFCObjectStateRegistry.RemoveFlickeringFlashlight(item, "Stranger Things" + __instance.playerUsername); } } } [HarmonyPatch(typeof(PlayerControllerB), "SetHoverTipAndCurrentInteractTrigger")] [HarmonyPrefix] private static bool SetHoverTipMirrorFusion(PlayerControllerB __instance) { if (DimensionRegistry.IsInUpsideDown(((Component)__instance).gameObject) && !string.IsNullOrEmpty(((TMP_Text)__instance.cursorTip).text)) { return !((TMP_Text)__instance.cursorTip).text.Equals("Mirror Fusion : [E]"); } return true; } [HarmonyPatch(typeof(PlayerControllerB), "Interact_performed")] [HarmonyPrefix] private static bool MirrorFusionActivate(PlayerControllerB __instance, ref CallbackContext context) { if (!((CallbackContext)(ref context)).performed || !LFCUtilities.ShouldBeLocalPlayer(__instance) || !DimensionRegistry.IsInUpsideDown(((Component)__instance).gameObject) || __instance.isPlayerDead || !__instance.isPlayerControlled || __instance.isGrabbingObjectAnimation || __instance.inSpecialMenu || __instance.quickMenuManager.isMenuOpen) { return true; } GrabbableObject currentlyHeldObjectServer = __instance.currentlyHeldObjectServer; UpsideDownMirrorBehaviour upsideDownMirrorBehaviour = default(UpsideDownMirrorBehaviour); if ((Object)(object)currentlyHeldObjectServer != (Object)null && LFCUtilities.TryGetComponentInChildren(((Component)currentlyHeldObjectServer).gameObject, ref upsideDownMirrorBehaviour) && upsideDownMirrorBehaviour.canFusion) { upsideDownMirrorBehaviour.CompleteFusionServerRpc(); return false; } return true; } [HarmonyPatch(typeof(PlayerControllerB), "TeleportPlayer")] [HarmonyPrefix] public static void PreTeleportPlayer(PlayerControllerB __instance) { if (LFCUtilities.ShouldBeLocalPlayer(__instance)) { LFCCustomPassManager.RemoveFiltersByMaterial(StrangerThings.ZoneFilterMat); } } [HarmonyPatch(typeof(PlayerControllerB), "KillPlayer")] [HarmonyPrefix] public static void PreKillPlayer(PlayerControllerB __instance) { if (LFCUtilities.ShouldBeLocalPlayer(__instance)) { LFCCustomPassManager.RemoveFiltersByMaterial(StrangerThings.ZoneFilterMat); } } [HarmonyPatch(typeof(PlayerControllerB), "KillPlayerClientRpc")] [HarmonyPostfix] private static void KillPlayerForClients(PlayerControllerB __instance) { if ((Object)(object)LFCUtilities.LocalPlayer != (Object)(object)__instance && DimensionRegistry.IsInUpsideDown(((Component)__instance).gameObject)) { DimensionRegistry.SetInUpsideDown(((Component)__instance).gameObject, isInUpsideDown: false); } } [HarmonyPatch(typeof(PlayerControllerB), "SpectateNextPlayer")] [HarmonyPostfix] private static void SwitchSpectatedPlayer(PlayerControllerB __instance) { if ((Object)(object)__instance.spectatedPlayerScript != (Object)null && !DimensionRegistry.AreInSameDimension(((Component)__instance.spectatedPlayerScript).gameObject, ((Component)__instance).gameObject)) { DimensionRegistry.SetInUpsideDown(((Component)__instance).gameObject, DimensionRegistry.IsInUpsideDown(((Component)__instance.spectatedPlayerScript).gameObject)); } } [HarmonyPatch(typeof(PlayerControllerB), "ResetZAndXRotation")] [HarmonyPostfix] private static void ResetZAndXRotation(PlayerControllerB __instance) { if ((Object)(object)LFCUtilities.LocalPlayer != (Object)(object)__instance) { PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; if (!DimensionRegistry.AreInSameDimension((localPlayer != null) ? ((Component)localPlayer).gameObject : null, ((Component)__instance).gameObject)) { DimensionRegistry.UpdateVisibilityState(((Component)__instance).gameObject); } } } } public class RadMechAIPatch { [HarmonyPatch(typeof(RadMechAI), "ShootGun")] [HarmonyPrefix] private static bool ShootGun(RadMechAI __instance) { PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; return DimensionRegistry.AreInSameDimension((localPlayer != null) ? ((Component)localPlayer).gameObject : null, ((Component)__instance).gameObject); } [HarmonyPatch(typeof(RadMechAI), "SetExplosion")] [HarmonyPrefix] private static bool SetExplosion(RadMechAI __instance) { PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; return DimensionRegistry.AreInSameDimension((localPlayer != null) ? ((Component)localPlayer).gameObject : null, ((Component)__instance).gameObject); } [HarmonyPatch(typeof(RadMechAI), "Stomp")] [HarmonyPrefix] private static bool Stomp(RadMechAI __instance) { PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; return DimensionRegistry.AreInSameDimension((localPlayer != null) ? ((Component)localPlayer).gameObject : null, ((Component)__instance).gameObject); } [HarmonyPatch(typeof(RadMechAI), "CheckSightForThreat")] [HarmonyTranspiler] private static IEnumerable CheckSightForThreatTranspiler(IEnumerable instructions, ILGenerator il) { //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Expected O, but got Unknown //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Expected O, but got Unknown //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Expected O, but got Unknown List list = new List(instructions); FieldInfo fieldInfo = AccessTools.Field(typeof(RadMechAI), "focusedThreatTransform"); MethodInfo methodInfo = AccessTools.Method(typeof(RadMechAIPatch), "AreInSameDimension", (Type[])null, (Type[])null); for (int i = 0; i < list.Count - 1; i++) { if (list[i].opcode == OpCodes.Stfld && list[i].operand is FieldInfo fieldInfo2 && fieldInfo2 == fieldInfo) { Label label = il.DefineLabel(); list[i + 1].labels.Add(label); list.InsertRange(i + 1, new <>z__ReadOnlyArray((CodeInstruction[])(object)new CodeInstruction[5] { new CodeInstruction(OpCodes.Ldarg_0, (object)null), new CodeInstruction(OpCodes.Call, (object)methodInfo), new CodeInstruction(OpCodes.Brtrue_S, (object)label), new CodeInstruction(OpCodes.Ldc_I4_0, (object)null), new CodeInstruction(OpCodes.Ret, (object)null) })); break; } } return list; } private static bool AreInSameDimension(RadMechAI radMech) { Transform focusedThreatTransform = radMech.focusedThreatTransform; if (!DimensionRegistry.AreInSameDimension((focusedThreatTransform != null) ? ((Component)focusedThreatTransform).gameObject : null, ((Component)radMech).gameObject)) { ((EnemyAI)radMech).SwitchToBehaviourStateOnLocalClient(0); return false; } return true; } } public class RoundManagerPatch { [HarmonyPatch(typeof(RoundManager), "FinishGeneratingLevel")] [HarmonyAfter(new string[] { "Lega.LegaFusionCore" })] [HarmonyPostfix] private static void SpawnUpsideDownEnvironment() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) UpsideDownAtmosphereController instance = UpsideDownAtmosphereController.Instance; if (!((Object)(object)instance == (Object)null)) { instance.BatsSky = Object.Instantiate(StrangerThings.BatsSkyObj, StartOfRound.Instance.shipLandingPosition.position + Vector3.up * 50f, Quaternion.identity); instance.BatsSky.SetActive(false); if (LFCUtilities.IsServer) { LFCMapObjectsManager.SpawnOutsideMapObjectsForServer(ConfigManager.minBatsHordeOutside.Value, ConfigManager.maxBatsHordeOutside.Value, (Action)SpawnBatsHorde); LFCMapObjectsManager.SpawnOutsideMapObjectsForServer(ConfigManager.minVinesZoneOutside.Value, ConfigManager.maxVinesZoneOutside.Value, (Action)SpawnUpsideDownZone); StrangerThingsNetworkManager.Instance.SpawnUpsideDownTreesEveryoneRpc(StartOfRound.Instance.randomMapSeed); } if ((Object)(object)instance.Spores == (Object)null) { GameObject upsideDownSporesObj = StrangerThings.UpsideDownSporesObj; PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; GameObject val = Object.Instantiate(upsideDownSporesObj, ((localPlayer != null) ? new Vector3?(((Component)localPlayer.gameplayCamera).transform.position) : ((Vector3?)null)).Value + Vector3.forward * 2f, Quaternion.identity); instance.Spores = val.GetComponent(); ((Component)instance.Spores).gameObject.SetActive(false); } } } public static void SpawnBatsHorde(Vector3 position, Quaternion rotation) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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_0039: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (Physics.Raycast(position, Vector3.down, ref val, 5f, StartOfRound.Instance.collidersAndRoomMaskAndDefault)) { GameObject val2 = Object.Instantiate(StrangerThings.BatsHordeObj, ((RaycastHit)(ref val)).point + Vector3.up * 2.25f, Quaternion.Euler(0f, ((Quaternion)(ref rotation)).eulerAngles.y, ((Quaternion)(ref rotation)).eulerAngles.z), RoundManager.Instance.mapPropsContainer.transform); val2.GetComponent().Spawn(true); } } public static void SpawnUpsideDownZone(Vector3 position, Quaternion rotation) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (Physics.Raycast(position, Vector3.down, ref val, 5f, StartOfRound.Instance.collidersAndRoomMaskAndDefault)) { GameObject val2 = Object.Instantiate(StrangerThings.VinesZoneObj, ((RaycastHit)(ref val)).point, Quaternion.Euler(0f, ((Quaternion)(ref rotation)).eulerAngles.y, 0f), RoundManager.Instance.mapPropsContainer.transform); val2.GetComponent().Spawn(true); } } [HarmonyPatch(typeof(RoundManager), "waitForScrapToSpawnToSync")] [HarmonyPostfix] private static IEnumerator PostGeneratedProcess(IEnumerator result) { while (result.MoveNext()) { yield return result.Current; } SpawnMirrorObjects(); } public static void SpawnMirrorObjects() { //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) int num = Random.Range(ConfigManager.minMirrorScraps.Value, ConfigManager.maxMirrorScraps.Value + 1); int num2 = 0; foreach (GrabbableObject allA in LFCSpawnRegistry.GetAllAs()) { if (!string.IsNullOrEmpty(allA.itemProperties?.itemName) && (string.IsNullOrEmpty(ConfigManager.scrapExclusions.Value) || !ConfigManager.scrapExclusions.Value.Contains(allA.itemProperties.itemName)) && allA.isInFactory && !allA.isInShipRoom && allA.scrapValue > 0 && !DimensionRegistry.IsInUpsideDown(((Component)allA).gameObject)) { GrabbableObject val = SpawnUpsideDownObject(allA.itemProperties); if ((Object)(object)val != (Object)null) { GameObject val2 = Object.Instantiate(StrangerThings.UpsideDownMirrorObjectObj, ((Component)val).transform.position, Quaternion.identity); NetworkObject component = val2.GetComponent(); component.Spawn(false); StrangerThingsNetworkManager.Instance.AddToMirrorEveryoneRpc(NetworkObjectReference.op_Implicit(component), NetworkObjectReference.op_Implicit(((Component)val).GetComponent()), NetworkObjectReference.op_Implicit(((Component)allA).GetComponent())); } if (num <= num2++) { break; } } } } public static GrabbableObject SpawnUpsideDownObject(Item itemToSpawn, int value = 0) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) List list = Object.FindObjectsOfType().ToList(); if (list.Any()) { LFCUtilities.Shuffle((IList)list); int index = new Random().Next(0, list.Count); RandomScrapSpawn val = list[index]; RoundManager instance = RoundManager.Instance; ((Component)val).transform.position = instance.GetRandomNavMeshPositionInBoxPredictable(((Component)val).transform.position, val.itemSpawnRange, instance.navHit, instance.AnomalyRandom, -1, 1f) + Vector3.up * itemToSpawn.verticalOffset; Vector3 val2 = ((Component)val).transform.position + Vector3.up * 0.5f; GrabbableObject val3 = LFCObjectsManager.SpawnObjectForServer(itemToSpawn.spawnPrefab, val2); if (!(val3 is UpsideDownObject)) { StrangerThingsNetworkManager.Instance.SetGObjectInUpsideDownEveryoneRpc(NetworkObjectReference.op_Implicit(((Component)val3).GetComponent()), isInUpsideDown: true); } LFCNetworkManager.Instance.SetScrapValueEveryoneRpc(NetworkObjectReference.op_Implicit(((Component)val3).GetComponent()), value); return val3; } return null; } [HarmonyPatch(typeof(RoundManager), "ResetEnemyTypesSpawnedCounts")] [HarmonyPostfix] private static void ResetEnemyTypesSpawnedCounts(RoundManager __instance) { foreach (KeyValuePair upsideDownEnemy in StrangerThings.UpsideDownEnemies) { EnemyType key = upsideDownEnemy.Key; key.numberSpawned = 0; foreach (EnemyAI spawnedEnemy in __instance.SpawnedEnemies) { if ((Object)(object)spawnedEnemy.enemyType == (Object)(object)key) { key.numberSpawned++; } } } } [HarmonyPatch(typeof(RoundManager), "PlayRandomClip")] [HarmonyPrefix] private static bool PlayRandomClip(AudioSource audioSource) { GameObject val = ((audioSource != null) ? ((Component)audioSource).gameObject : null); if ((Object)(object)val == (Object)null) { return true; } PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; GameObject val2 = ((localPlayer != null) ? ((Component)localPlayer).gameObject : null); if ((Object)(object)val2 == (Object)null) { return true; } EnemyAI val3 = default(EnemyAI); if (LFCUtilities.TryGetComponentInParent(val, ref val3)) { return DimensionRegistry.AreInSameDimension(((Component)val3).gameObject, val2); } GrabbableObject val4 = default(GrabbableObject); if (LFCUtilities.TryGetComponentInParent(val, ref val4)) { return DimensionRegistry.AreInSameDimension(((Component)val4).gameObject, val2); } return true; } } public class SandSpiderWebTrapPatch { [HarmonyPatch(typeof(SandSpiderWebTrap), "Awake")] [HarmonyPostfix] private static void AwakeSpiderWeb(SandSpiderWebTrap __instance) { if ((Object)(object)LFCUtilities.LocalPlayer != (Object)null) { DimensionRegistry.UpdateVisibilityState(((Component)__instance).gameObject); } } } public class ShotgunItemPatch { [HarmonyTranspiler] [HarmonyPatch(typeof(ShotgunItem), "ShootGun")] private static IEnumerable ShootGun(IEnumerable instructions, ILGenerator il) { //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Expected O, but got Unknown //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Expected O, but got Unknown //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Expected O, but got Unknown //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Expected O, but got Unknown //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Expected O, but got Unknown //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Expected O, but got Unknown //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Expected O, but got Unknown //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Expected O, but got Unknown //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Expected O, but got Unknown //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Expected O, but got Unknown //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Expected O, but got Unknown //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Expected O, but got Unknown //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Expected O, but got Unknown List list = new List(instructions); MethodInfo methodInfo = AccessTools.Method(typeof(PlayerControllerB), "DamagePlayer", new Type[7] { typeof(int), typeof(bool), typeof(bool), typeof(CauseOfDeath), typeof(int), typeof(bool), typeof(Vector3) }, (Type[])null); MethodInfo methodInfo2 = AccessTools.Method(typeof(IHittable), "Hit", new Type[5] { typeof(int), typeof(Vector3), typeof(PlayerControllerB), typeof(bool), typeof(int) }, (Type[])null); MethodInfo methodInfo3 = AccessTools.PropertyGetter(typeof(Component), "gameObject"); MethodInfo methodInfo4 = AccessTools.Method(typeof(DimensionRegistry), "AreInSameDimension", new Type[2] { typeof(GameObject), typeof(GameObject) }, (Type[])null); for (int i = 0; i < list.Count; i++) { if (methodInfo != null && CodeInstructionExtensions.Calls(list[i], methodInfo)) { int num = FindPrevLdlocIndex(list, i, 1); if (num != -1) { Label label = il.DefineLabel(); Label label2 = il.DefineLabel(); list[num].labels.Add(label); if (i + 1 < list.Count) { list[i + 1].labels.Add(label2); } List list2 = new List(7) { new CodeInstruction(OpCodes.Ldarg_0, (object)null), new CodeInstruction(OpCodes.Callvirt, (object)methodInfo3), new CodeInstruction(OpCodes.Ldloc_1, (object)null), new CodeInstruction(OpCodes.Callvirt, (object)methodInfo3), new CodeInstruction(OpCodes.Call, (object)methodInfo4), new CodeInstruction(OpCodes.Brtrue_S, (object)label), new CodeInstruction(OpCodes.Br_S, (object)label2) }; list.InsertRange(num, list2); i += list2.Count; } } else { if (!(methodInfo2 != null) || !CodeInstructionExtensions.Calls(list[i], methodInfo2)) { continue; } int num2 = FindPrevLdlocIndex(list, i, 10); if (num2 == -1) { continue; } Label label4; if (i + 1 < list.Count && (list[i + 1].opcode == OpCodes.Brfalse || list[i + 1].opcode == OpCodes.Brfalse_S) && list[i + 1].operand is Label label3) { label4 = label3; } else { label4 = il.DefineLabel(); if (i + 1 < list.Count) { list[i + 1].labels.Add(label4); } } List list3 = new List(6) { new CodeInstruction(OpCodes.Ldarg_0, (object)null), new CodeInstruction(OpCodes.Callvirt, (object)methodInfo3), new CodeInstruction(OpCodes.Ldloc_S, (object)(byte)12), new CodeInstruction(OpCodes.Callvirt, (object)methodInfo3), new CodeInstruction(OpCodes.Call, (object)methodInfo4), new CodeInstruction(OpCodes.Brfalse_S, (object)label4) }; list.InsertRange(num2, list3); i += list3.Count; } } return list; } private static int FindPrevLdlocIndex(List code, int fromIndex, int localIndex) { for (int num = fromIndex; num >= 0; num--) { if (TryGetLdlocIndex(code[num], out var index) && index == localIndex) { return num; } } return -1; } private static bool TryGetLdlocIndex(CodeInstruction ci, out int index) { index = -1; if (ci.opcode == OpCodes.Ldloc_0) { index = 0; return true; } if (ci.opcode == OpCodes.Ldloc_1) { index = 1; return true; } if (ci.opcode == OpCodes.Ldloc_2) { index = 2; return true; } if (ci.opcode == OpCodes.Ldloc_3) { index = 3; return true; } if (ci.opcode != OpCodes.Ldloc && ci.opcode != OpCodes.Ldloc_S) { return false; } if (ci.operand is LocalBuilder localBuilder) { index = localBuilder.LocalIndex; return true; } if (ci.operand is int num) { index = num; return true; } if (ci.operand is byte b) { index = b; return true; } return false; } } public class StartMatchLeverPatch { [HarmonyPatch(typeof(StartMatchLever), "EndGame")] [HarmonyPrefix] public static bool SMLEndGame() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) Collider[] array = (Collider[])(object)new Collider[64]; int num = Physics.OverlapSphereNonAlloc(((Component)StartOfRound.Instance.shipAnimator).gameObject.transform.position, 20f, array, 524288, (QueryTriggerInteraction)2); for (int i = 0; i < num; i++) { EnemyAI val = ((Component)array[i]).GetComponent()?.mainScript; if (val is HenryAI { isEnemyDead: false, killCoroutine: null } henryAI) { henryAI.StopShipServerRpc(); return false; } } return true; } } public class StartOfRoundPatch { [HarmonyPatch(typeof(StartOfRound), "Start")] [HarmonyPostfix] private static void StartRound(StartOfRound __instance) { if (NetworkManager.Singleton.IsHost && (Object)(object)StrangerThingsNetworkManager.Instance == (Object)null) { GameObject val = Object.Instantiate(StrangerThings.managerPrefab, ((Component)__instance).transform.parent); val.GetComponent().Spawn(false); StrangerThings.mls.LogInfo((object)"Spawning StrangerThingsNetworkManager"); } } [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] [HarmonyPostfix] public static void EndGame(StartOfRound __instance) { PlayerControllerB[] allPlayerScripts = __instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (DimensionRegistry.IsInUpsideDown(((Component)val).gameObject)) { DimensionRegistry.SetInUpsideDown(((Component)val).gameObject, isInUpsideDown: false); } } UpsideDownAtmosphereController instance = UpsideDownAtmosphereController.Instance; if ((Object)(object)instance != (Object)null) { foreach (GameObject item in instance.DeadTrees.ToList()) { if ((Object)(object)item != (Object)null) { Object.Destroy((Object)(object)item); } } Object.Destroy((Object)(object)instance.BatsSky); instance.AliveTrees.Clear(); instance.DeadTrees.Clear(); instance.BatsSky = null; } MapObjectsManager.GetUpsideDownPortals().Clear(); } [HarmonyPatch(typeof(StartOfRound), "OnDisable")] [HarmonyPostfix] public static void OnDisable() { StrangerThingsNetworkManager.Instance = null; } } public class StormyWeatherPatch { [HarmonyTranspiler] [HarmonyPatch(typeof(StormyWeather), "Update")] private static IEnumerable UpdateTranspiler(IEnumerable instructions) { List list = new List(instructions); FieldInfo fieldInfo = AccessTools.Field(typeof(GrabbableObject), "isInFactory"); MethodInfo operand = AccessTools.Method(typeof(StormyWeatherPatch), "IsUntargetableObject", (Type[])null, (Type[])null); for (int i = 0; i < list.Count; i++) { if (list[i].opcode == OpCodes.Ldfld && list[i].operand is FieldInfo fieldInfo2 && fieldInfo2 == fieldInfo) { list[i].opcode = OpCodes.Call; list[i].operand = operand; } } return list; } [HarmonyPatch(typeof(StormyWeather), "LightningStrike")] [HarmonyPrefix] private static bool ShouldRunLightningStrike(StormyWeather __instance) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Invalid comparison between Unknown and I4 if ((int)StartOfRound.Instance.currentLevel.currentWeather != 2) { PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; if (!DimensionRegistry.IsInUpsideDown((localPlayer != null) ? ((Component)localPlayer).gameObject : null)) { __instance.staticElectricityParticle.Stop(); ((Component)__instance.staticElectricityParticle).GetComponent().Stop(); __instance.setStaticToObject = null; return false; } } return true; } private static bool IsUntargetableObject(GrabbableObject grabbableObject) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Invalid comparison between Unknown and I4 if (!((Object)(object)grabbableObject == (Object)null) && !grabbableObject.isInFactory) { if ((int)StartOfRound.Instance.currentLevel.currentWeather != 2) { return !DimensionRegistry.IsInUpsideDown(((Component)grabbableObject).gameObject); } return false; } return true; } [HarmonyPatch(typeof(StormyWeather), "SetStaticElectricityWarning")] [HarmonyPrefix] private static bool SetStaticElectricityWarning(NetworkObject warningObject) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 GameObject gameObject = ((Component)warningObject).gameObject; PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; if (DimensionRegistry.AreInSameDimension(gameObject, (localPlayer != null) ? ((Component)localPlayer).gameObject : null)) { if ((int)StartOfRound.Instance.currentLevel.currentWeather != 2) { PlayerControllerB localPlayer2 = LFCUtilities.LocalPlayer; return DimensionRegistry.IsInUpsideDown((localPlayer2 != null) ? ((Component)localPlayer2).gameObject : null); } return true; } return false; } [HarmonyPatch(typeof(StormyWeather), "PlayThunderEffects")] [HarmonyPrefix] private static void FogFlash() { UpsideDownAtmosphereController.Instance?.TriggerLightning(); } } public class VehicleControllerPatch { [HarmonyPatch(typeof(VehicleController), "Start")] [HarmonyPostfix] private static void StartVehicleController(VehicleController __instance) { if ((Object)(object)LFCUtilities.LocalPlayer != (Object)null) { DimensionRegistry.UpdateVisibilityState(((Component)__instance).gameObject); } } } } namespace StrangerThings.ModsCompat { public static class LethalMinSoftCompat { public static void Patch(Harmony harmony) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown Type type = Type.GetType("LethalMin.PikminAI, NoteBoxz.LethalMin"); if (type != null) { MethodInfo methodInfo = AccessTools.Method(type, "Start", (Type[])null, (Type[])null); if (methodInfo != null) { HarmonyMethod val = new HarmonyMethod(AccessTools.Method(typeof(LethalMinSoftCompat), "Start", (Type[])null, (Type[])null)); harmony.Patch((MethodBase)methodInfo, (HarmonyMethod)null, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } } private static void Start(object __instance) { EnemyAI val = (EnemyAI)((__instance is EnemyAI) ? __instance : null); if (val != null) { PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; if (!DimensionRegistry.AreInSameDimension((localPlayer != null) ? ((Component)localPlayer).gameObject : null, ((Component)val).gameObject)) { DimensionRegistry.UpdateVisibilityState(((Component)val).gameObject); } } } } public static class MelaniesVoiceSoftCompat { private static PropertyInfo piPlayerAudioGroup; private static PropertyInfo piPlayerScript; private static PropertyInfo piGroupVolume; public static void Patch(Harmony harmony) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown Type type = Type.GetType("com.github.zehsteam.MelaniesVoice.MonoBehaviours.VoiceController, com.github.zehsteam.MelaniesVoice"); if (type != null) { MethodInfo methodInfo = AccessTools.Method(type, "UpdateVoiceVolume", (Type[])null, (Type[])null); if (methodInfo != null) { piPlayerAudioGroup = AccessTools.Property(type, "PlayerAudioGroup"); piPlayerScript = AccessTools.Property(type, "PlayerScript"); HarmonyMethod val = new HarmonyMethod(AccessTools.Method(typeof(MelaniesVoiceSoftCompat), "UpdateVoiceVolume", (Type[])null, (Type[])null)); harmony.Patch((MethodBase)methodInfo, (HarmonyMethod)null, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } } private static void UpdateVoiceVolume(object __instance) { if (__instance == null) { return; } PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; if ((Object)(object)localPlayer == (Object)null || !localPlayer.isPlayerControlled || localPlayer.isPlayerDead) { return; } object? obj = piPlayerScript?.GetValue(__instance, null); PlayerControllerB val = (PlayerControllerB)((obj is PlayerControllerB) ? obj : null); if (!LFCUtilities.ShouldNotBeLocalPlayer(val) || DimensionRegistry.AreInSameDimension(((Component)localPlayer).gameObject, ((Component)val).gameObject)) { return; } object obj2 = piPlayerAudioGroup?.GetValue(__instance, null); if (obj2 == null) { return; } if (piGroupVolume == null) { piGroupVolume = AccessTools.Property(obj2.GetType(), "Volume"); } float num = ((piGroupVolume != null) ? ((float)piGroupVolume.GetValue(obj2, null)) : 0f); if (num > 0f) { float num2 = ((!DimensionRegistry.IsInUpsideDown(((Component)localPlayer).gameObject)) ? (((!localPlayer.speakingToWalkieTalkie || !val.holdingWalkieTalkie) && (!val.speakingToWalkieTalkie || !localPlayer.holdingWalkieTalkie)) ? 0f : (MapObjectsManager.IsNearAntenna(val) ? 1f : 0f)) : (((!localPlayer.speakingToWalkieTalkie || !val.holdingWalkieTalkie) && (!val.speakingToWalkieTalkie || !localPlayer.holdingWalkieTalkie)) ? 0.1f : (MapObjectsManager.IsNearAntenna(localPlayer) ? 1f : 0f))); if (piGroupVolume != null && piGroupVolume.CanWrite) { piGroupVolume.SetValue(obj2, num * num2, null); } } } } public static class OpenBodyCamsSoftCompat { private static FieldInfo fiCurrentActualTarget; private static FieldInfo fiCurrentPlayer; private static FieldInfo fiEnableCamera; private static MethodInfo miGetForceTargetInvalid; private static Type statusEnumType; private static object statusDisabled; private static object statusTargetInvalid; public static void Patch(Harmony harmony) { //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Expected O, but got Unknown Type type = Type.GetType("OpenBodyCams.BodyCamComponent, OpenBodyCams"); if (!(type != null)) { return; } MethodInfo methodInfo = AccessTools.Method(type, "GetUpdatedCameraStatus", (Type[])null, (Type[])null); if (!(methodInfo != null)) { return; } statusEnumType = methodInfo.ReturnType; if (statusEnumType != null && statusEnumType.IsEnum) { statusDisabled = Enum.Parse(statusEnumType, "Disabled", ignoreCase: false); statusTargetInvalid = Enum.Parse(statusEnumType, "TargetInvalid", ignoreCase: false); fiEnableCamera = AccessTools.Field(type, "EnableCamera"); miGetForceTargetInvalid = AccessTools.PropertyGetter(type, "ForceTargetInvalid"); fiCurrentActualTarget = AccessTools.Field(type, "currentActualTarget"); fiCurrentPlayer = AccessTools.Field(type, "currentPlayer"); if (fiEnableCamera == null || miGetForceTargetInvalid == null || fiCurrentActualTarget == null || fiCurrentPlayer == null) { StrangerThings.mls.LogError((object)"OpenBodyCams compat: members not found."); return; } HarmonyMethod val = new HarmonyMethod(AccessTools.Method(typeof(OpenBodyCamsSoftCompat), "GetUpdatedCameraStatus_Prefix", (Type[])null, (Type[])null)); harmony.Patch((MethodBase)methodInfo, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static bool GetUpdatedCameraStatus_Prefix(object __instance, ref object __result) { if (!(bool)fiEnableCamera.GetValue(__instance) || fiCurrentActualTarget.GetValue(__instance) == null || (bool)miGetForceTargetInvalid.Invoke(__instance, null)) { return true; } if ((Object)(object)LFCUtilities.LocalPlayer != (Object)null && DimensionRegistry.IsInUpsideDown(((Component)LFCUtilities.LocalPlayer).gameObject)) { __result = statusDisabled; return false; } PlayerControllerB val = (PlayerControllerB)((fiCurrentPlayer != null) ? /*isinst with value type is only supported in some contexts*/: null); if ((Object)(object)LFCUtilities.LocalPlayer != (Object)null && (Object)(object)val != (Object)null && val.isPlayerControlled && !DimensionRegistry.AreInSameDimension(((Component)LFCUtilities.LocalPlayer).gameObject, ((Component)val).gameObject)) { __result = statusTargetInvalid; return false; } return true; } } public static class SelfSortingStorageSoftCompat { public static void Patch(Harmony harmony) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown Type type = Type.GetType("SelfSortingStorage.Utils.Effects, SelfSortingStorage") ?? AccessTools.TypeByName("SelfSortingStorage.Utils.Effects"); if (type != null) { MethodInfo methodInfo = AccessTools.Method(type, "SpawnItem", (Type[])null, (Type[])null); if (methodInfo != null) { HarmonyMethod val = new HarmonyMethod(AccessTools.Method(typeof(SelfSortingStorageSoftCompat), "SpawnItem", (Type[])null, (Type[])null)); harmony.Patch((MethodBase)methodInfo, (HarmonyMethod)null, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } } private static void SpawnItem(object __result) { //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_007a: Unknown result type (might be due to invalid IL or missing references) if (__result == null) { return; } FieldInfo fieldInfo = AccessTools.GetDeclaredFields(__result.GetType()).FirstOrDefault((FieldInfo f) => f.FieldType == typeof(NetworkObjectReference)); if (fieldInfo == null) { return; } NetworkObjectReference val = (NetworkObjectReference)fieldInfo.GetValue(__result); NetworkObject val2 = default(NetworkObject); if (((NetworkObjectReference)(ref val)).TryGet(ref val2, (NetworkManager)null) && (Object)(object)val2 != (Object)null) { GrabbableObject component = ((Component)val2).GetComponent(); if (component is UpsideDownObject) { StrangerThingsNetworkManager.Instance?.SetGObjectInUpsideDownEveryoneRpc(NetworkObjectReference.op_Implicit(val2), isInUpsideDown: false); } } } } public static class SpectateEnemySoftCompat { private static FieldInfo fiSpectatedEnemyIndex; private static FieldInfo fiSpectatingEnemies; private static FieldInfo fiSpectatorList; public static void Patch(Harmony harmony) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown Type type = Type.GetType("SpectateEnemy.SpectateEnemies, SpectateEnemy"); if (type != null) { MethodInfo methodInfo = AccessTools.Method(type, "GetNextValidSpectatable", (Type[])null, (Type[])null); if (methodInfo != null) { HarmonyMethod val = new HarmonyMethod(AccessTools.Method(typeof(SpectateEnemySoftCompat), "GetNextValidSpectatable", (Type[])null, (Type[])null)); harmony.Patch((MethodBase)methodInfo, (HarmonyMethod)null, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); fiSpectatedEnemyIndex = AccessTools.Field(type, "SpectatedEnemyIndex"); fiSpectatingEnemies = AccessTools.Field(type, "SpectatingEnemies"); fiSpectatorList = AccessTools.Field(type, "SpectatorList"); } } } private static void GetNextValidSpectatable(object __instance) { if (fiSpectatedEnemyIndex != null && fiSpectatingEnemies != null && (bool)fiSpectatingEnemies.GetValue(__instance) && fiSpectatorList != null) { int index = (int)fiSpectatedEnemyIndex.GetValue(__instance); IEnumerable source = (IEnumerable)fiSpectatorList.GetValue(__instance); object obj = source.ElementAtOrDefault(index); object? obj2 = AccessTools.Field(obj.GetType(), "enemyInstance")?.GetValue(obj); EnemyAI val = (EnemyAI)((obj2 is EnemyAI) ? obj2 : null); PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; if (!DimensionRegistry.AreInSameDimension((localPlayer != null) ? ((Component)localPlayer).gameObject : null, (val != null) ? ((Component)val).gameObject : null)) { DimensionRegistry.SetInUpsideDown(((Component)LFCUtilities.LocalPlayer).gameObject, DimensionRegistry.IsInUpsideDown(((Component)val).gameObject)); } } } } } namespace StrangerThings.Managers { public class ConfigManager { public static ConfigEntry globalTips; public static ConfigEntry minMirrorScraps; public static ConfigEntry maxMirrorScraps; public static ConfigEntry colorBlindTips; public static ConfigEntry scrapExclusions; public static ConfigEntry demogorgonSpawnWeights; public static ConfigEntry demogorgonMinHeadValue; public static ConfigEntry demogorgonMaxHeadValue; public static ConfigEntry henrySpawnWeights; public static ConfigEntry crustapikanRarity; public static ConfigEntry crustapikanMinArmValue; public static ConfigEntry crustapikanMaxArmValue; public static ConfigEntry crustapikanLarvaeRarity; public static ConfigEntry crustapikanLarvaeMinCorpseValue; public static ConfigEntry crustapikanLarvaeMaxCorpseValue; public static ConfigEntry limadonRarity; public static ConfigEntry limadonMinCorpseValue; public static ConfigEntry limadonMaxCorpseValue; public static ConfigEntry portalLockDuration; public static ConfigEntry upsideDownVolume; public static ConfigEntry visibilityStateInclusions; public static ConfigEntry visibilityStateExclusions; public static ConfigEntry minBatsHordeOutside; public static ConfigEntry maxBatsHordeOutside; public static ConfigEntry minBatsHordeInside; public static ConfigEntry maxBatsHordeInside; public static ConfigEntry minVinesZoneOutside; public static ConfigEntry maxVinesZoneOutside; public static ConfigEntry minVinesZoneInside; public static ConfigEntry maxVinesZoneInside; public static void Load() { globalTips = StrangerThings.configFile.Bind("_Global_", "Global tips", true, "Enable global tips to help learn the mod’s mechanics."); minMirrorScraps = StrangerThings.configFile.Bind("Mirror Scraps", "Min Mirror Scraps", 6, "Min Mirror Scraps."); maxMirrorScraps = StrangerThings.configFile.Bind("Mirror Scraps", "Max Mirror Scraps", 10, "Max Mirror Scraps."); colorBlindTips = StrangerThings.configFile.Bind("Mirror Scraps", "Colorblind tips", true, "Enable particle color change notifications for mirror Mirror Scraps."); scrapExclusions = StrangerThings.configFile.Bind("Mirror Scraps", "Exclusion list", "Key,Bee hive,Apparatus,EnginePart1,V-type engine,Toy car", "List of scraps that will not spawn in the Upside Down.\nYou can add scraps by separating them with a comma."); demogorgonSpawnWeights = StrangerThings.configFile.Bind("Demogorgon", "Spawn weights", "Vanilla:20,Modded:20", "Demogorgon spawn weights."); demogorgonMinHeadValue = StrangerThings.configFile.Bind("Demogorgon", "Min head value", 80, "Demogorgon min head value (SellBodiesFixed must be installed)."); demogorgonMaxHeadValue = StrangerThings.configFile.Bind("Demogorgon", "Max head value", 120, "Demogorgon max head value (SellBodiesFixed must be installed)."); henrySpawnWeights = StrangerThings.configFile.Bind("Henry Creel", "Spawn weights", "Vanilla:20,Modded:20", "Henry Creel spawn weights."); crustapikanRarity = StrangerThings.configFile.Bind("Crustapikan", "Rarity", 20, "Crustapikan base rarity."); crustapikanMinArmValue = StrangerThings.configFile.Bind("Crustapikan", "Min arm value", 250, "Crustapikan min arm value (SellBodiesFixed must be installed)."); crustapikanMaxArmValue = StrangerThings.configFile.Bind("Crustapikan", "Max arm value", 300, "Crustapikan max arm value (SellBodiesFixed must be installed)."); crustapikanLarvaeRarity = StrangerThings.configFile.Bind("Crustapikan Larvae", "Rarity", 20, "Crustapikan Larvae base rarity."); crustapikanLarvaeMinCorpseValue = StrangerThings.configFile.Bind("Crustapikan Larvae", "Min corpse value", 20, "Crustapikan Larvae min corpse value (SellBodiesFixed must be installed)."); crustapikanLarvaeMaxCorpseValue = StrangerThings.configFile.Bind("Crustapikan Larvae", "Max corpse value", 40, "Crustapikan Larvae max corpse value (SellBodiesFixed must be installed)."); limadonRarity = StrangerThings.configFile.Bind("Limadon", "Rarity", 20, "Limadon base rarity."); limadonMinCorpseValue = StrangerThings.configFile.Bind("Limadon", "Min corpse value", 70, "Limadon min corpse value (SellBodiesFixed must be installed)."); limadonMaxCorpseValue = StrangerThings.configFile.Bind("Limadon", "Max corpse value", 110, "Limadon max corpse value (SellBodiesFixed must be installed)."); portalLockDuration = StrangerThings.configFile.Bind("Upside Down", "Portal lock duration", 60, "Portal lock duration when entering or exiting."); upsideDownVolume = StrangerThings.configFile.Bind("Upside Down", "Upside Down volume", 0.6f, "Volume of background music in the Upside Down."); visibilityStateInclusions = StrangerThings.configFile.Bind("Upside Down", "Visibility state whitelist", "SP_Snowman,SP_SnowPile,LK_Lantern,SawBoxExplosive,ChainEscape,Sprout", "Additional list of Network Objects whose visibility (visible/invisible) will be updated when switching between dimensions."); visibilityStateExclusions = StrangerThings.configFile.Bind("Upside Down", "Visibility state blacklist", "Locker,DressGirl", "Network Objects whose visibility (visible/invisible) will not be updated when switching between dimensions."); minBatsHordeOutside = StrangerThings.configFile.Bind("Bats Horde", "Min outside", 3, "Min Bats Horde to spawn outside."); maxBatsHordeOutside = StrangerThings.configFile.Bind("Bats Horde", "Max outside", 4, "Min Bats Horde to spawn outside."); minBatsHordeInside = StrangerThings.configFile.Bind("Bats Horde", "Min inside", 4, "Min Bats Horde to spawn inside."); maxBatsHordeInside = StrangerThings.configFile.Bind("Bats Horde", "Max inside", 5, "Min Bats Horde to spawn inside."); minVinesZoneOutside = StrangerThings.configFile.Bind("Vines Zone", "Min outside", 3, "Min Vines Zone to spawn outside."); maxVinesZoneOutside = StrangerThings.configFile.Bind("Vines Zone", "Max outside", 4, "Min Vines Zone to spawn outside."); minVinesZoneInside = StrangerThings.configFile.Bind("Vines Zone", "Min inside", 2, "Min Vines Zone to spawn inside."); maxVinesZoneInside = StrangerThings.configFile.Bind("Vines Zone", "Max inside", 3, "Min Vines Zone to spawn inside."); } public static void GetEnemySpawns(string spawnWeights, out Dictionary spawnRateByLevelType, out Dictionary spawnRateByCustomLevelType) { //IL_0077: Unknown result type (might be due to invalid IL or missing references) spawnRateByLevelType = new Dictionary(); spawnRateByCustomLevelType = new Dictionary(); foreach (string item in from s in spawnWeights.Split(',') select s.Trim()) { string[] array = item.Split(':'); if (array.Length != 2) { continue; } string text = array[0]; if (int.TryParse(array[1], out var result)) { if (Enum.TryParse(text, ignoreCase: true, out LevelTypes result2)) { spawnRateByLevelType[result2] = result; } else { spawnRateByCustomLevelType[text] = result; } } } } } public static class MapObjectsManager { private static readonly HashSet AntennaHazards = new HashSet(); private static readonly HashSet UpsideDownPortals = new HashSet(); public static void AddAntenna(AntennaHazard antennaHazard) { AntennaHazards.Add(antennaHazard); } public static HashSet GetAntennaHazards() { AntennaHazards.RemoveWhere((AntennaHazard p) => (Object)(object)p == (Object)null); return AntennaHazards; } public static bool IsNearAntenna(PlayerControllerB player) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) foreach (AntennaHazard antennaHazard in GetAntennaHazards()) { if ((Object)(object)antennaHazard != (Object)null && (Object)(object)antennaHazard.antennaItem != (Object)null) { float num = Vector3.SqrMagnitude(((Component)antennaHazard).transform.position - ((Component)player).transform.position); if (num < 5625f) { return true; } } } return false; } public static void AddPortal(UpsideDownPortal upsideDownPortal) { UpsideDownPortals.Add(upsideDownPortal); } public static void ClearPortals() { UpsideDownPortals.Clear(); } public static HashSet GetUpsideDownPortals() { UpsideDownPortals.RemoveWhere((UpsideDownPortal p) => (Object)(object)p == (Object)null); return UpsideDownPortals.Where((UpsideDownPortal p) => !p.isFake).ToHashSet(); } public static void SpawnPortalsForServer() { if (GetUpsideDownPortals().Count < 8) { LFCMapObjectsManager.SpawnScatteredMapObjectsForServer(8, 2, 2, (Action)delegate(Vector3 position, bool isOutside) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) SpawnPortalForServer(position, isOutside); }); } } public static UpsideDownPortal SpawnPortalForServer(Vector3 position, bool isOutside, bool isFake = false) { //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) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(StrangerThings.UpsideDownPortalObj, position + Vector3.down * 0.1f, Quaternion.identity, RoundManager.Instance.mapPropsContainer.transform); val.GetComponent().Spawn(true); UpsideDownPortal component = val.GetComponent(); component.InitializeEveryoneRpc(isOutside, isFake); return component; } public static UpsideDownPortal GetClosestPortal(Vector3 position) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) UpsideDownPortal result = null; float num = float.MaxValue; foreach (UpsideDownPortal upsideDownPortal in GetUpsideDownPortals()) { if ((Object)(object)upsideDownPortal != (Object)null) { float num2 = Vector3.SqrMagnitude(((Component)upsideDownPortal).transform.position - position); if (num2 < num) { num = num2; result = upsideDownPortal; } } } return result; } public static UpsideDownPortal GetFurthestPortal(Vector3 position) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) UpsideDownPortal result = null; float num = 0f; foreach (UpsideDownPortal upsideDownPortal in GetUpsideDownPortals()) { if ((Object)(object)upsideDownPortal != (Object)null) { float num2 = Vector3.SqrMagnitude(((Component)upsideDownPortal).transform.position - position); if (num2 > num) { num = num2; result = upsideDownPortal; } } } return result; } } public class StrangerThingsNetworkManager : NetworkBehaviour { public static StrangerThingsNetworkManager Instance; public void Awake() { Instance = this; } [Rpc(/*Could not decode attribute arguments.*/)] public void SpawnUpsideDownTreesEveryoneRpc(int seed) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(912406207u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, seed); ((NetworkBehaviour)this).__endSendRpc(ref val2, 912406207u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; UpsideDownAtmosphereController instance = UpsideDownAtmosphereController.Instance; if (!((Object)(object)instance != (Object)null)) { return; } Random random = new Random(seed); instance.AliveTrees = LFCTreesRegistry.GetTrees().ToHashSet(); IOrderedEnumerable orderedEnumerable = instance.AliveTrees.OrderBy(delegate(GameObject t) { //IL_0006: 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) Vector3 position = t.transform.position; return ((Vector3)(ref position)).sqrMagnitude; }); foreach (GameObject item in orderedEnumerable) { GameObject[] array = (GameObject[])(object)new GameObject[3] { StrangerThings.Tree1Obj, StrangerThings.Tree2Obj, StrangerThings.Tree3Obj }; GameObject val4 = Object.Instantiate(array[random.Next(0, array.Length)], item.transform.position, item.transform.rotation); Transform transform = val4.transform; transform.localScale *= Mathf.Lerp(1f, 2.5f, (float)random.NextDouble()); val4.SetActive(false); instance.DeadTrees.Add(val4); LFCTreesRegistry.AddTree(val4); } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetPlayerInUpsideDownEveryoneRpc(int playerId, bool isInUpsideDown) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(792643303u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isInUpsideDown, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 792643303u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; GameObject entity = StartOfRound.Instance.allPlayerObjects[playerId]; DimensionRegistry.SetInUpsideDown(entity, isInUpsideDown); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetGObjectInUpsideDownEveryoneRpc(NetworkObjectReference obj, bool isInUpsideDown) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(968582711u, val3, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref obj, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isInUpsideDown, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 968582711u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); if (((NetworkObjectReference)(ref obj)).TryGet(ref val4, (NetworkManager)null)) { DimensionRegistry.SetInUpsideDown(((Component)val4).gameObject, isInUpsideDown); GrabbableObject val5 = default(GrabbableObject); if (LFCUtilities.IsServer && LFCUtilities.TryGetComponentInChildren(((Component)val4).gameObject, ref val5)) { HoarderBugAI.RefreshGrabbableObjectsInMapList(); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void AddToMirrorEveryoneRpc(NetworkObjectReference scriptObj, NetworkObjectReference mirrorObj, NetworkObjectReference twinObj) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: 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_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2994801010u, val3, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref scriptObj, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref mirrorObj, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref twinObj, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2994801010u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); NetworkObject val5 = default(NetworkObject); NetworkObject val6 = default(NetworkObject); UpsideDownMirrorBehaviour upsideDownMirrorBehaviour = default(UpsideDownMirrorBehaviour); if (((NetworkObjectReference)(ref scriptObj)).TryGet(ref val4, (NetworkManager)null) && ((NetworkObjectReference)(ref mirrorObj)).TryGet(ref val5, (NetworkManager)null) && ((NetworkObjectReference)(ref twinObj)).TryGet(ref val6, (NetworkManager)null) && ((Component)val4).TryGetComponent(ref upsideDownMirrorBehaviour)) { GrabbableObject val7 = (upsideDownMirrorBehaviour.mirror = ((Component)val5).GetComponentInChildren()); ((Component)val4).transform.SetParent(((Component)val7).transform, true); GrabbableObject val8 = (upsideDownMirrorBehaviour.twin = ((Component)val6).GetComponentInChildren()); upsideDownMirrorBehaviour.twinRenderers = (from r in ((Component)val8).GetComponentsInChildren() where ((Renderer)r).enabled select r).ToList(); } } [Rpc(/*Could not decode attribute arguments.*/)] public void PlayPoisonExplosionEveryoneRpc(Vector3 position) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1550006684u, val3, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1550006684u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; if (LFCUtilities.IsServer) { ((MonoBehaviour)this).StartCoroutine(PoisonCoroutine(position, 4f)); } string text = "Lega Fusion Core" + ((Object)LegaFusionCore.poisonExplosionParticle).name; Vector3 val4 = position; Quaternion val5 = Quaternion.Euler(90f, 0f, 0f); PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; LFCGlobalManager.PlayParticle(text, val4, val5, true, 4f, DimensionRegistry.IsInUpsideDown((localPlayer != null) ? ((Component)localPlayer).gameObject : null)); string text2 = "Lega Fusion Core" + ((Object)LegaFusionCore.poisonExplosionAudio).name; Vector3 val6 = position; PlayerControllerB localPlayer2 = LFCUtilities.LocalPlayer; LFCGlobalManager.PlayAudio(text2, val6, DimensionRegistry.IsInUpsideDown((localPlayer2 != null) ? ((Component)localPlayer2).gameObject : null)); } } public IEnumerator PoisonCoroutine(Vector3 position, float duration) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = default(PlayerControllerB); for (float timePassed = 0f; timePassed < duration; timePassed += 0.2f) { Collider[] array = (Collider[])(object)new Collider[64]; int num = Physics.OverlapSphereNonAlloc(position, Mathf.Max(timePassed * 5f, 7.5f), array, StartOfRound.Instance.playersMask, (QueryTriggerInteraction)2); for (int i = 0; i < num; i++) { if (((Component)array[i]).TryGetComponent(ref val) && !val.isPlayerDead && DimensionRegistry.IsInUpsideDown(((Component)val).gameObject)) { LSNetworkManager.Instance.ApplyStatusEveryoneRpc(-1, (int)val.playerClientId, 2, 10, 20, default(NetworkObjectReference)); } } yield return (object)new WaitForSeconds(0.2f); } } [Rpc(/*Could not decode attribute arguments.*/)] public void SyncDoorPositionNotServerRpc(NetworkObjectReference doorObj, Vector3 position, Quaternion rotation, bool hasLanded) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2932614711u, val3, val, (SendTo)3, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref doorObj, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref rotation); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref hasLanded, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2932614711u, val3, val, (SendTo)3, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); DoorProjectile doorProjectile = default(DoorProjectile); if (((NetworkObjectReference)(ref doorObj)).TryGet(ref val4, (NetworkManager)null) && ((Component)val4).TryGetComponent(ref doorProjectile)) { doorProjectile.SyncPosition(position, rotation, hasLanded); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(912406207u, new RpcReceiveHandler(__rpc_handler_912406207), "SpawnUpsideDownTreesEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(792643303u, new RpcReceiveHandler(__rpc_handler_792643303), "SetPlayerInUpsideDownEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(968582711u, new RpcReceiveHandler(__rpc_handler_968582711), "SetGObjectInUpsideDownEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(2994801010u, new RpcReceiveHandler(__rpc_handler_2994801010), "AddToMirrorEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(1550006684u, new RpcReceiveHandler(__rpc_handler_1550006684), "PlayPoisonExplosionEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(2932614711u, new RpcReceiveHandler(__rpc_handler_2932614711), "SyncDoorPositionNotServerRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_912406207(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int seed = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref seed); target.__rpc_exec_stage = (__RpcExecStage)1; ((StrangerThingsNetworkManager)(object)target).SpawnUpsideDownTreesEveryoneRpc(seed); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_792643303(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); bool isInUpsideDown = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isInUpsideDown, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((StrangerThingsNetworkManager)(object)target).SetPlayerInUpsideDownEveryoneRpc(playerId, isInUpsideDown); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_968582711(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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007d: 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(ref obj, default(ForNetworkSerializable)); bool isInUpsideDown = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isInUpsideDown, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((StrangerThingsNetworkManager)(object)target).SetGObjectInUpsideDownEveryoneRpc(obj, isInUpsideDown); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2994801010(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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_0085: 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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference scriptObj = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref scriptObj, default(ForNetworkSerializable)); NetworkObjectReference mirrorObj = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref mirrorObj, default(ForNetworkSerializable)); NetworkObjectReference twinObj = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref twinObj, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((StrangerThingsNetworkManager)(object)target).AddToMirrorEveryoneRpc(scriptObj, mirrorObj, twinObj); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1550006684(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); target.__rpc_exec_stage = (__RpcExecStage)1; ((StrangerThingsNetworkManager)(object)target).PlayPoisonExplosionEveryoneRpc(position); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2932614711(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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference doorObj = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref doorObj, default(ForNetworkSerializable)); Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); Quaternion rotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation); bool hasLanded = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref hasLanded, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((StrangerThingsNetworkManager)(object)target).SyncDoorPositionNotServerRpc(doorObj, position, rotation, hasLanded); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "StrangerThingsNetworkManager"; } } } namespace StrangerThings.Behaviours.Scripts { public class UpsideDownAtmosphereController : MonoBehaviour { public Volume Volume; public Fog Fog; public GradientSky Sky; public AudioSource AudioVibe; public ParticleSystem Spores; public GameObject BatsSky; public HashSet AliveTrees = new HashSet(); public HashSet DeadTrees = new HashSet(); private bool isInUpsideDown; public Color lightningColor = new Color(1f, 0.1f, 0.1f); public float lightningDuration = 1.5f; private bool lightningActive; private float lightningTimer; public Color outdoorFog = new Color(0.25f, 0.45f, 0.9f); public Color indoorFog = new Color(0.15f, 0.25f, 0.4f); [Range(0f, 1f)] public float fogVariation = 0.4f; public float fogSpeed = 0.6f; public float baseMeanFreePath = 150f; public float densityVariation = 0.6f; public float densitySpeed = 0.5f; public Color skyTopDay = new Color(0.25f, 0.45f, 1f); public Color skyTopNight = new Color(0.05f, 0.1f, 0.25f); public Color skyMidDay = new Color(0.2f, 0.35f, 0.7f); public Color skyMidNight = new Color(0.05f, 0.08f, 0.2f); public Color skyBotDay = new Color(0.15f, 0.25f, 0.45f); public Color skyBotNight = new Color(0.03f, 0.05f, 0.15f); public float skySpeed = 0.4f; private float dayFactor; public static UpsideDownAtmosphereController Instance { get; private set; } public void Awake() { if ((Object)(object)Instance != (Object)null) { StrangerThings.mls.LogWarning((object)"[UpsideDown] Duplicate controller destroyed."); Object.Destroy((Object)(object)((Component)this).gameObject); return; } Instance = this; Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); if (!Volume.profile.TryGet(ref Fog)) { StrangerThings.mls.LogWarning((object)"[UpsideDown] Missing Fog override in Volume."); } if (!Volume.profile.TryGet(ref Sky)) { StrangerThings.mls.LogWarning((object)"[UpsideDown] Missing GradientSky override in Volume."); } if ((Object)(object)AudioVibe != (Object)null) { AudioVibe.volume = ConfigManager.upsideDownVolume.Value; } SetUpsideDownState(enable: false); } public void SetUpsideDownState(bool enable) { isInUpsideDown = enable; ((Component)this).gameObject.SetActive(enable); ParticleSystem spores = Spores; if (spores != null) { ((Component)spores).gameObject.SetActive(enable); } GameObject batsSky = BatsSky; if (batsSky != null) { batsSky.SetActive(enable); } if (enable) { AudioSource audioVibe = AudioVibe; if (audioVibe != null) { audioVibe.Play(); } } else { AudioSource audioVibe2 = AudioVibe; if (audioVibe2 != null) { audioVibe2.Pause(); } } foreach (GameObject aliveTree in AliveTrees) { aliveTree.SetActive(!enable); } foreach (GameObject deadTree in DeadTrees) { deadTree.SetActive(enable); } EnableStormLogic(); } private void EnableStormLogic() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Invalid comparison between Unknown and I4 bool flag = (int)StartOfRound.Instance.currentLevel.currentWeather == 2; StormyWeather val = Object.FindObjectsByType((FindObjectsInactive)1, (FindObjectsSortMode)0).FirstOrDefault(); if ((Object)(object)val == (Object)null) { return; } if (isInUpsideDown) { if (!flag) { ((Component)val).gameObject.SetActive(true); } } else if (!flag && (Object)(object)val != (Object)null) { val.staticElectricityParticle.Stop(); ((Component)val.staticElectricityParticle).GetComponent().Stop(); val.setStaticToObject = null; } } private void Update() { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) if (isInUpsideDown && (Object)(object)LFCUtilities.LocalPlayer != (Object)null) { ComputeDayFactor(); AnimateFog(); AnimateSky(); UpdateLightning(); if ((Object)(object)Spores != (Object)null) { Transform transform = ((Component)Spores).transform; PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; Vector3? val = ((localPlayer != null) ? new Vector3?(((Component)localPlayer.gameplayCamera).transform.position) : ((Vector3?)null)); Vector3 val2 = Vector3.forward * 2f; transform.position = (val.HasValue ? new Vector3?(val.GetValueOrDefault() + val2) : ((Vector3?)null)).Value; } } } public void TriggerLightning() { if (isInUpsideDown && (Object)(object)LFCUtilities.LocalPlayer != (Object)null && !LFCUtilities.LocalPlayer.isInsideFactory) { lightningActive = true; lightningTimer = 0f; } } private void UpdateLightning() { if (lightningActive) { lightningTimer += Time.deltaTime; if (lightningTimer >= lightningDuration) { lightningActive = false; } } } private void ComputeDayFactor() { //IL_004e: 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) Light val = TimeOfDay.Instance?.sunDirect; dayFactor = (((Object)(object)val != (Object)null && (Object)(object)((Component)val).transform != (Object)null) ? Mathf.Clamp01(Vector3.Dot(((Component)val).transform.forward, Vector3.down) * 0.5f + 0.5f) : (Mathf.Sin(Time.time * 0.05f) * 0.5f + 0.5f)); } private void AnimateFog() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)LFCUtilities.LocalPlayer == (Object)null) && !((Object)(object)Fog == (Object)null)) { bool isInsideFactory = LFCUtilities.LocalPlayer.isInsideFactory; Color val = (isInsideFactory ? indoorFog : outdoorFog); float num = Mathf.Sin(Time.time * fogSpeed) * 0.5f + 0.5f; Color val2 = Color.Lerp(val * (1f - fogVariation), val * (1f + fogVariation), num); if (lightningActive && !isInsideFactory) { float num2 = 1f - lightningTimer / lightningDuration; val2 = Color.Lerp(val2, lightningColor, num2); } float num3 = Mathf.Lerp(0.5f, 2f, Mathf.Pow(dayFactor, 0.8f)); ((VolumeParameter)(object)Fog.albedo).value = val2 * num3; float num4 = Mathf.Sin(Time.time * densitySpeed) * 0.5f + 0.5f; float num5 = baseMeanFreePath * Mathf.Lerp(1f - densityVariation, 1f + densityVariation, num4); if (isInsideFactory) { num5 *= 0.8f; } ((VolumeParameter)(object)Fog.meanFreePath).value = Mathf.Clamp(num5, 50f, 500f); } } private void AnimateSky() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0118: 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) if (!((Object)(object)LFCUtilities.LocalPlayer == (Object)null) && !((Object)(object)Sky == (Object)null)) { bool isInsideFactory = LFCUtilities.LocalPlayer.isInsideFactory; float num = Mathf.Sin(Time.time * skySpeed) * 0.5f + 0.5f; Color val = Color.Lerp(skyTopNight, skyTopDay, dayFactor); Color val2 = Color.Lerp(skyMidNight, skyMidDay, dayFactor); Color val3 = Color.Lerp(skyBotNight, skyBotDay, dayFactor); if (isInsideFactory) { val *= 0.6f; val2 *= 0.6f; val3 *= 0.6f; } else if (lightningActive) { float num2 = 1f - lightningTimer / lightningDuration; Color val4 = Color.Lerp(Color.white, lightningColor, num2); val = Color.Lerp(val, val4, num2 * 0.5f); val2 = Color.Lerp(val2, val4, num2 * 0.5f); val3 = Color.Lerp(val3, val4, num2 * 0.5f); } float num3 = Mathf.Sin(Time.time * skySpeed * 2f) * 0.05f; ((VolumeParameter)(object)Sky.top).value = Color.Lerp(val * (1f - num3), val * (1f + num3), num); ((VolumeParameter)(object)Sky.middle).value = Color.Lerp(val2 * (1f - num3), val2 * (1f + num3), num); ((VolumeParameter)(object)Sky.bottom).value = Color.Lerp(val3 * (1f - num3), val3 * (1f + num3), num); } } } public class UpsideDownMirrorBehaviour : NetworkBehaviour { private enum DistanceBand { Near, Mid, Far } public GrabbableObject mirror; public GrabbableObject twin; public List twinRenderers = new List(); public bool canFusion; public int valueMultiplier = 3; public ParticleSystem HeldParticles; public Color particlesColor; public float fxTickInterval = 0.1f; private float fxTick; private DistanceBand lastBand = (DistanceBand)(-1); private void Update() { if ((Object)(object)HeldParticles != (Object)null && (Object)(object)twin != (Object)null && (Object)(object)mirror != (Object)null) { fxTick -= Time.deltaTime; if (fxTick <= 0f) { fxTick = fxTickInterval; UpdateHeldFxLayeredColor(mirror.playerHeldBy); } ShowAuraTwinObject(mirror.playerHeldBy); } } private void UpdateHeldFxLayeredColor(PlayerControllerB player) { //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) if (!mirror.isHeld || mirror.isPocketed || !LFCUtilities.ShouldBeLocalPlayer(player) || DimensionRegistry.AreInSameDimension(((Component)mirror).gameObject, ((Component)twin).gameObject)) { if ((Object)(object)HeldParticles != (Object)null && HeldParticles.isPlaying) { HeldParticles.Stop(); } lastBand = (DistanceBand)(-1); return; } if (!HeldParticles.isPlaying) { HeldParticles.Play(); if (ConfigManager.globalTips.Value) { HUDManager.Instance.DisplayTip("Tips", "Find the real world counterpart and with help combine them between realms", false, false, "LC_Tip1"); } } float num = Vector3.Distance(((Component)mirror).transform.position, ((Component)twin).transform.position); GetLayerValues(num, out var layerMin, out var layerMax); float num2 = Mathf.Pow(Mathf.Clamp01(Mathf.InverseLerp(layerMax, layerMin, num)), 2f); MainModule main = HeldParticles.main; ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(particlesColor); ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(Mathf.Lerp(2f, 1f, num2)); ((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(Mathf.Lerp(0.1f, 1f, num2)); ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(Mathf.Lerp(0.02f, 0.1f, num2)); EmissionModule emission = HeldParticles.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(Mathf.Lerp(2f, 10f, num2)); } private void GetLayerValues(float distance, out float layerMin, out float layerMax) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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) DistanceBand distanceBand; if (distance > 60f) { distanceBand = DistanceBand.Far; particlesColor = new Color(0.3f, 0.6f, 1f); layerMin = 60f; layerMax = 100f; } else if (distance > 25f) { distanceBand = DistanceBand.Mid; particlesColor = new Color(0.7f, 0.3f, 1f); layerMin = 25f; layerMax = 60f; } else { distanceBand = DistanceBand.Near; particlesColor = new Color(1f, 0f, 0f); layerMin = 0f; layerMax = 25f; } if (ConfigManager.colorBlindTips.Value && distanceBand != lastBand) { lastBand = distanceBand; string text = "Mirror distance"; HUDManager.Instance.DisplayTip(text, distanceBand switch { DistanceBand.Far => "Far range (blue layer).", DistanceBand.Mid => "Mid range (purple layer).", _ => "Close range (red layer).", }, false, false, "LC_Tip1"); } } public void ShowAuraTwinObject(PlayerControllerB player) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) if (!LFCUtilities.ShouldBeLocalPlayer(player) || !DimensionRegistry.IsInUpsideDown(((Component)player).gameObject)) { return; } if (!mirror.isHeld || mirror.isPocketed || !twin.isHeld || twin.isPocketed || DimensionRegistry.AreInSameDimension(((Component)mirror).gameObject, ((Component)twin).gameObject) || !player.HasLineOfSightToPosition(((Component)twin).transform.position, 20f, 3, 1f, -1)) { RemoveAuraTwinObject(); return; } canFusion = true; twinRenderers?.ForEach(delegate(MeshRenderer r) { if ((Object)(object)r != (Object)null) { ((Renderer)r).enabled = true; } }); LFCCustomPassManager.SetupAuraForObjects((GameObject[])(object)new GameObject[1] { ((Component)twin).gameObject }, LegaFusionCore.transparentShader, string.Format("{0}TwinObject{1}", "Stranger Things", ((Object)twin).GetInstanceID()), Color.yellow); ((TMP_Text)player.cursorTip).text = "Mirror Fusion : [E]"; } public void RemoveAuraTwinObject() { PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; if (!DimensionRegistry.IsInUpsideDown((localPlayer != null) ? ((Component)localPlayer).gameObject : null)) { return; } canFusion = false; twinRenderers?.ForEach(delegate(MeshRenderer r) { if ((Object)(object)r != (Object)null) { ((Renderer)r).enabled = false; } }); LFCCustomPassManager.RemoveAuraByTag(string.Format("{0}TwinObject{1}", "Stranger Things", ((Object)twin).GetInstanceID())); if ((Object)(object)LFCUtilities.LocalPlayer != (Object)null && "Mirror Fusion : [E]".Equals(((TMP_Text)LFCUtilities.LocalPlayer.cursorTip).text)) { ((TMP_Text)LFCUtilities.LocalPlayer.cursorTip).text = ""; } } [Rpc(/*Could not decode attribute arguments.*/)] public void CompleteFusionServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(94455293u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 94455293u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; LFCNetworkManager.Instance.SetScrapValueEveryoneRpc(NetworkObjectReference.op_Implicit(((Component)twin).GetComponent()), twin.scrapValue * valueMultiplier); LFCNetworkManager.Instance.DestroyObjectEveryoneRpc(NetworkObjectReference.op_Implicit(((Component)mirror).GetComponent())); if ((Object)(object)twin.playerHeldBy != (Object)null) { LFCNetworkManager.Instance.ForceDiscardObjectEveryoneRpc(NetworkObjectReference.op_Implicit(((Component)twin).GetComponent()), (int)twin.playerHeldBy.playerClientId); } Object.Destroy((Object)(object)((Component)this).gameObject); } } public override void OnDestroy() { RemoveAuraTwinObject(); ((NetworkBehaviour)this).OnDestroy(); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(94455293u, new RpcReceiveHandler(__rpc_handler_94455293), "CompleteFusionServerRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_94455293(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((UpsideDownMirrorBehaviour)(object)target).CompleteFusionServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "UpsideDownMirrorBehaviour"; } } } namespace StrangerThings.Behaviours.Scripts.Projectiles { public class DoorProjectile : MonoBehaviour { protected bool isCarried; protected bool isThrown; protected bool isLastThrow; protected bool isLanding; protected bool hasLanded; protected bool hasHit; protected Transform carryTarget; protected Vector3 carryPositionOffset; private Vector3 originalColliderSize; private const float LowVelocityThreshold = 1f; private const float LowVelocityGracePeriod = 0.15f; private float lowVelocityTimer; protected Vector3 networkPosition; protected Quaternion networkRotation; private float syncTimer; public Rigidbody Rigidbody { get; protected set; } public BoxCollider BoxCollider { get; private set; } public void Initialize() { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) isCarried = false; isThrown = false; isLastThrow = false; hasLanded = false; hasHit = false; lowVelocityTimer = 0f; if (Rigidbody == null) { Rigidbody val = (Rigidbody = ((Component)this).GetComponent()); } if ((Object)(object)Rigidbody == (Object)null) { Rigidbody = ((Component)this).gameObject.AddComponent(); } Rigidbody.useGravity = false; Rigidbody.isKinematic = false; Rigidbody.velocity = Vector3.zero; Rigidbody.angularVelocity = Vector3.zero; Rigidbody.interpolation = (RigidbodyInterpolation)1; Rigidbody.collisionDetectionMode = (CollisionDetectionMode)2; if (BoxCollider == null) { BoxCollider val2 = (BoxCollider = ((IEnumerable)((Component)this).GetComponentsInChildren()).FirstOrDefault((Func)((BoxCollider c) => !((Collider)c).isTrigger))); } if ((Object)(object)BoxCollider != (Object)null) { originalColliderSize = BoxCollider.size; } NavMeshObstacle[] componentsInChildren = ((Component)this).GetComponentsInChildren(); foreach (NavMeshObstacle val4 in componentsInChildren) { ((Behaviour)val4).enabled = false; } } public IEnumerator GrabCoroutine(Transform target) { yield return ShakeCoroutine(1f, 0.1f); yield return MoveToTargetCoroutine(target, 0.2f); } public IEnumerator ShakeCoroutine(float duration, float intensity) { Vector3 startPosition = ((Component)this).transform.position; for (float timePassed = 0f; timePassed < duration; timePassed += 0.025f) { PlayImpactAudio(); ((Component)this).transform.position = startPosition + Random.insideUnitSphere * intensity; yield return (object)new WaitForSeconds(0.025f); } ((Component)this).transform.position = startPosition; } public IEnumerator MoveToTargetCoroutine(Transform target, float duration) { Vector3 startPosition = ((Component)this).transform.position; Quaternion startRotation = ((Component)this).transform.rotation; float timePassed = 0f; while (timePassed < duration) { timePassed += Time.deltaTime; float num = Mathf.Clamp01(timePassed / duration); ((Component)this).transform.position = Vector3.Lerp(startPosition, target.position, num); ((Component)this).transform.rotation = Quaternion.Slerp(startRotation, target.rotation, num); yield return null; } DoorLock val = default(DoorLock); AnimatedObjectTrigger val2 = default(AnimatedObjectTrigger); if (LFCUtilities.TryGetComponentInChildren(((Component)this).gameObject, ref val) && val.isDoorOpened && ((Component)val).gameObject.TryGetComponent(ref val2)) { if (LFCUtilities.IsServer) { val2.TriggerAnimationNonPlayer(false, false, false); } val.isDoorOpened = false; ((Behaviour)val.navMeshObstacle).enabled = false; ((Behaviour)val).enabled = false; } isCarried = true; carryTarget = target; carryPositionOffset = target.InverseTransformPoint(((Component)this).transform.position); if ((Object)(object)BoxCollider != (Object)null) { ((Collider)BoxCollider).enabled = false; } Rigidbody.isKinematic = true; Rigidbody.detectCollisions = false; } public void Throw(Vector3 direction, float force, bool isLastThrow) { //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) isThrown = true; this.isLastThrow = isLastThrow; isLanding = false; isCarried = false; carryTarget = null; if ((Object)(object)BoxCollider != (Object)null) { ((Collider)BoxCollider).enabled = false; } SphereCollider val = ((Component)this).gameObject.AddComponent(); ((Collider)val).isTrigger = true; val.radius = Mathf.Max(new float[3] { originalColliderSize.x, originalColliderSize.y, originalColliderSize.z }) * 0.4f; Rigidbody.isKinematic = false; Rigidbody.detectCollisions = true; Rigidbody.angularVelocity = Vector3.zero; Rigidbody.excludeLayers = LayerMask.op_Implicit(LayerMask.GetMask(new string[2] { "Railing", "RoomLight" })); Rigidbody.AddForce(((Vector3)(ref direction)).normalized * force, (ForceMode)2); } public void LateUpdate() { //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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_0079: 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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) if (hasLanded) { return; } if (isCarried && (Object)(object)carryTarget != (Object)null) { float num = Mathf.Sin(Time.time * 3f) * 4f; Quaternion val = Quaternion.AngleAxis(num, carryTarget.forward); ((Component)this).transform.position = carryTarget.TransformPoint(carryPositionOffset); ((Component)this).transform.rotation = val * Quaternion.Euler(0f, carryTarget.eulerAngles.y, 0f); } else { if (!isThrown || hasHit) { return; } Vector3 val2; if (isLanding && isLastThrow) { if (!LFCUtilities.IsServer) { ((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, networkPosition, Time.deltaTime * 18f); ((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, networkRotation, Time.deltaTime * 18f); return; } syncTimer += Time.deltaTime; if (syncTimer >= 0.05f) { syncTimer = 0f; StrangerThingsNetworkManager.Instance.SyncDoorPositionNotServerRpc(NetworkObjectReference.op_Implicit(((Component)this).GetComponent()), ((Component)this).transform.position, ((Component)this).transform.rotation, hasLanded: false); } val2 = Rigidbody.velocity; if (((Vector3)(ref val2)).magnitude <= 1f) { val2 = Rigidbody.angularVelocity; if (((Vector3)(ref val2)).magnitude <= 1f) { hasLanded = true; Rigidbody.velocity = Vector3.zero; Rigidbody.angularVelocity = Vector3.zero; Rigidbody.useGravity = false; Rigidbody.isKinematic = true; StrangerThingsNetworkManager.Instance.SyncDoorPositionNotServerRpc(NetworkObjectReference.op_Implicit(((Component)this).GetComponent()), ((Component)this).transform.position, ((Component)this).transform.rotation, hasLanded: true); return; } } } val2 = Rigidbody.velocity; if (((Vector3)(ref val2)).magnitude <= 1f) { lowVelocityTimer += Time.deltaTime; if (lowVelocityTimer >= 0.15f) { Land(); } } else { lowVelocityTimer = 0f; } } } public void OnTriggerEnter(Collider collider) { if (LFCUtilities.IsServer && isThrown && !isLanding && !hasHit) { PlayImpactAudio(); PlayerControllerB val = default(PlayerControllerB); if (LFCUtilities.TryGetComponentInParent(((Component)collider).gameObject, ref val)) { hasHit = true; LFCNetworkManager.Instance.DamagePlayerEveryoneRpc((int)val.playerClientId, 50, true, true, 0); Land(); } } } private void Land() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_008b: Unknown result type (might be due to invalid IL or missing references) isLanding = true; if ((Object)(object)BoxCollider != (Object)null) { BoxCollider.size = originalColliderSize; ((Collider)BoxCollider).enabled = true; } SphereCollider val = default(SphereCollider); if (((Component)this).TryGetComponent(ref val)) { Object.Destroy((Object)(object)val); } Rigidbody.velocity = Vector3.zero; Rigidbody.angularVelocity = Vector3.zero; if (LFCUtilities.IsServer) { Rigidbody.useGravity = true; Rigidbody.AddTorque(((Component)this).transform.right * 3f, (ForceMode)1); } } public void SyncPosition(Vector3 position, Quaternion rotation, bool hasLanded) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_0028: 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) if (hasLanded) { this.hasLanded = true; ((Component)this).transform.position = position; ((Component)this).transform.rotation = rotation; Rigidbody.velocity = Vector3.zero; Rigidbody.angularVelocity = Vector3.zero; Rigidbody.useGravity = false; Rigidbody.isKinematic = true; } else { networkPosition = position; networkRotation = rotation; } } public void PlayImpactAudio() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) GameObject[] array = (GameObject[])(object)new GameObject[3] { StrangerThings.DoorImpact1AudioObj, StrangerThings.DoorImpact2AudioObj, StrangerThings.DoorImpact3AudioObj }; LFCNetworkManager.Instance.PlayAudioEveryoneRpc(((Object)array[Random.Range(0, array.Length)]).name, ((Component)this).transform.position, true); } } public class LogProjectile : NetworkBehaviour { public Rigidbody Rigidbody; public BoxCollider BoxCollider; private bool isFalling; private bool hasLanded; private bool hasHit; private float lowVelocityTimer; private const float LowVelocityThreshold = 0.5f; private const float LowVelocityGracePeriod = 0.5f; protected Vector3 networkPosition; protected Quaternion networkRotation; private float syncTimer; [Rpc(/*Could not decode attribute arguments.*/)] public void FallEveryoneRpc(Vector3 treeSize, Vector3 direction) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0112: 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_0138: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1293529306u, val3, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref treeSize); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref direction); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1293529306u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; ((Component)this).transform.localScale = new Vector3(treeSize.x / BoxCollider.size.x, treeSize.y / BoxCollider.size.y, treeSize.z / BoxCollider.size.z); if (!isFalling) { isFalling = true; ((MonoBehaviour)this).StartCoroutine(FallCoroutine(direction)); } } } private IEnumerator FallCoroutine(Vector3 direction) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Vector3 pivotPoint = ((Component)this).transform.position; Vector3 val = Vector3.Cross(Vector3.up, direction); Vector3 rotationAxis = ((Vector3)(ref val)).normalized; if (rotationAxis == Vector3.zero) { rotationAxis = Vector3.right; } float previousAngle = 0f; float timePassed = 0f; float duration = 0.1f; while (timePassed < duration && !hasHit) { float num = Mathf.SmoothStep(0f, 45f, timePassed / duration); float num2 = num - previousAngle; ((Component)this).transform.RotateAround(pivotPoint, rotationAxis, num2); previousAngle = num; timePassed += Time.deltaTime; yield return null; } if (!hasHit) { ((Component)this).transform.RotateAround(pivotPoint, rotationAxis, 45f - previousAngle); } Rigidbody.angularVelocity = rotationAxis * 0.8f; Rigidbody.useGravity = true; Rigidbody.isKinematic = false; } private void LateUpdate() { //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) if (!isFalling || hasHit || hasLanded || Rigidbody.isKinematic) { return; } if (LFCUtilities.IsServer) { syncTimer += Time.deltaTime; if (syncTimer >= 0.05f) { syncTimer = 0f; SyncPositionNotServerRpc(((Component)this).transform.position, ((Component)this).transform.rotation, hasLanded: false); } Vector3 val = Rigidbody.velocity; if (((Vector3)(ref val)).magnitude <= 0.5f) { val = Rigidbody.angularVelocity; if (((Vector3)(ref val)).magnitude <= 0.5f) { lowVelocityTimer += Time.deltaTime; if (lowVelocityTimer >= 0.5f) { hasLanded = true; Rigidbody.velocity = Vector3.zero; Rigidbody.angularVelocity = Vector3.zero; Rigidbody.useGravity = false; Rigidbody.isKinematic = true; SyncPositionNotServerRpc(((Component)this).transform.position, ((Component)this).transform.rotation, hasLanded: true); } return; } } lowVelocityTimer = 0f; } else { ((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, networkPosition, Time.deltaTime * 18f); ((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, networkRotation, Time.deltaTime * 18f); } } [Rpc(/*Could not decode attribute arguments.*/)] public void SyncPositionNotServerRpc(Vector3 position, Quaternion rotation, bool hasLanded) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0149: 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_0150: 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_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3572115970u, val3, val, (SendTo)3, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref rotation); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref hasLanded, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3572115970u, val3, val, (SendTo)3, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; if (hasLanded) { this.hasLanded = true; ((Component)this).transform.position = position; ((Component)this).transform.rotation = rotation; Rigidbody.velocity = Vector3.zero; Rigidbody.angularVelocity = Vector3.zero; Rigidbody.useGravity = false; Rigidbody.isKinematic = true; } else { networkPosition = position; networkRotation = rotation; } } } private void OnCollisionEnter(Collision collision) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = default(PlayerControllerB); if (isFalling && !hasLanded && !hasHit && collision.gameObject.TryGetComponent(ref val) && DimensionRegistry.AreInSameDimension(((Component)val).gameObject, ((Component)this).gameObject)) { hasHit = true; if (LFCUtilities.IsServer) { LFCNetworkManager.Instance.KillPlayerEveryoneRpc((int)val.playerClientId, Vector3.zero, true, 8); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1293529306u, new RpcReceiveHandler(__rpc_handler_1293529306), "FallEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(3572115970u, new RpcReceiveHandler(__rpc_handler_3572115970), "SyncPositionNotServerRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1293529306(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 treeSize = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref treeSize); Vector3 direction = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref direction); target.__rpc_exec_stage = (__RpcExecStage)1; ((LogProjectile)(object)target).FallEveryoneRpc(treeSize, direction); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3572115970(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0049: 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) //IL_0069: 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) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); Quaternion rotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation); bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((LogProjectile)(object)target).SyncPositionNotServerRpc(position, rotation, flag); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "LogProjectile"; } } public class PebbleProjectile : NetworkBehaviour { public Rigidbody Rigidbody; private bool isThrown; public IEnumerator GrabCoroutine() { yield return ShakeCoroutine(1f, 0.1f); yield return MoveToPositionCoroutine(((Component)this).transform.position + Vector3.up, 0.1f); } public IEnumerator ShakeCoroutine(float duration, float intensity) { Vector3 startPosition = ((Component)this).transform.position; for (float timePassed = 0f; timePassed < duration; timePassed += 0.025f) { SpawnRockExplosion(((Component)this).transform.position); ((Component)this).transform.position = startPosition + Random.insideUnitSphere * intensity; yield return (object)new WaitForSeconds(0.025f); } ((Component)this).transform.position = startPosition; } private IEnumerator MoveToPositionCoroutine(Vector3 targetPosition, float duration) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) float timePassed = 0f; while (timePassed < duration && (Object)(object)((Component)this).transform != (Object)null) { timePassed += Time.deltaTime; ((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, targetPosition, Mathf.SmoothStep(0f, 1f, timePassed / duration)); yield return null; } if ((Object)(object)((Component)this).transform != (Object)null) { ((Component)this).transform.position = targetPosition; } } public void Throw(Vector3 direction, float force) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) isThrown = true; Rigidbody.interpolation = (RigidbodyInterpolation)1; Rigidbody.collisionDetectionMode = (CollisionDetectionMode)2; Rigidbody.angularVelocity = Vector3.zero; Rigidbody.AddForce(((Vector3)(ref direction)).normalized * force, (ForceMode)2); } private void OnCollisionEnter(Collision collision) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = default(PlayerControllerB); EnemyAI val2 = default(EnemyAI); if (LFCUtilities.IsServer && collision != null && isThrown && ((NetworkBehaviour)this).NetworkObject.IsSpawned && (!((Object)(object)collision.collider != (Object)null) || (!LFCUtilities.TryGetComponentInParent(((Component)collision.collider).gameObject, ref val) && !LFCUtilities.TryGetComponentInParent(((Component)collision.collider).gameObject, ref val2)))) { SpawnRockExplosionEveryoneRpc(((Component)this).transform.position); ((NetworkBehaviour)this).NetworkObject.Despawn(Object.op_Implicit((Object)(object)((Component)this).gameObject)); } } private void OnTriggerEnter(Collider collider) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = default(PlayerControllerB); if (LFCUtilities.IsServer && isThrown && ((NetworkBehaviour)this).NetworkObject.IsSpawned && (Object)(object)collider != (Object)null && ((Component)collider).TryGetComponent(ref val) && DimensionRegistry.AreInSameDimension(((Component)val).gameObject, ((Component)this).gameObject)) { LFCNetworkManager.Instance.DamagePlayerEveryoneRpc((int)val.playerClientId, 10, true, true, 8); SpawnRockExplosionEveryoneRpc(((Component)this).transform.position); ((NetworkBehaviour)this).NetworkObject.Despawn(Object.op_Implicit((Object)(object)((Component)this).gameObject)); } } [Rpc(/*Could not decode attribute arguments.*/)] public void SpawnRockExplosionEveryoneRpc(Vector3 position) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(110118704u, val3, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendRpc(ref val2, 110118704u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; SpawnRockExplosion(position); } } } public void SpawnRockExplosion(Vector3 position) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) string text = "Lega Fusion Core" + ((Object)LegaFusionCore.brownExplosionParticle).name; Quaternion identity = Quaternion.identity; PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; LFCGlobalManager.PlayParticle(text, position, identity, true, 0.5f, !DimensionRegistry.IsInUpsideDown((localPlayer != null) ? ((Component)localPlayer).gameObject : null)); GameObject stoneImpactAudioObj = StrangerThings.StoneImpactAudioObj; PlayerControllerB localPlayer2 = LFCUtilities.LocalPlayer; LFCGlobalManager.PlayAudio(stoneImpactAudioObj, position, !DimensionRegistry.IsInUpsideDown((localPlayer2 != null) ? ((Component)localPlayer2).gameObject : null)); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(110118704u, new RpcReceiveHandler(__rpc_handler_110118704), "SpawnRockExplosionEveryoneRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_110118704(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); target.__rpc_exec_stage = (__RpcExecStage)1; ((PebbleProjectile)(object)target).SpawnRockExplosionEveryoneRpc(position); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "PebbleProjectile"; } } public class RockProjectile : NetworkBehaviour { public Rigidbody Rigidbody; private EnemyAI throwingEnemy; private bool isThrown; [Rpc(/*Could not decode attribute arguments.*/)] public void GrabEveryoneRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2189498429u, val3, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2189498429u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(MoveToPositionCoroutine(((Component)this).transform.position + Vector3.up * 7f, 0.2f)); } } } private IEnumerator MoveToPositionCoroutine(Vector3 targetPosition, float duration) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) SpawnRockExplosion(((Component)this).transform.position, withParticle: true, withAudio: true); float timePassed = 0f; while (timePassed < duration) { timePassed += Time.deltaTime; ((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, targetPosition, Mathf.SmoothStep(0f, 1f, timePassed / duration)); yield return null; } ((Component)this).transform.position = targetPosition; } [Rpc(/*Could not decode attribute arguments.*/)] public void ShakeEveryoneRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(4091481351u, val3, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 4091481351u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; ((MonoBehaviour)this).StartCoroutine(ShakeCoroutine(1f, 0.1f)); } } } private IEnumerator ShakeCoroutine(float duration, float intensity) { Vector3 startPosition = ((Component)this).transform.position; for (float timePassed = 0f; timePassed < duration; timePassed += 0.025f) { SpawnRockExplosion(((Component)this).transform.position, withParticle: false, withAudio: true); ((Component)this).transform.position = startPosition + Random.insideUnitSphere * intensity; yield return (object)new WaitForSeconds(0.025f); } ((Component)this).transform.position = startPosition; } [Rpc(/*Could not decode attribute arguments.*/)] public void ThrowFromPositionEveryoneRpc(NetworkObjectReference enemyObject, Vector3 startPosition, Vector3 direction) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2535820002u, val3, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref enemyObject, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref startPosition); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref direction); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2535820002u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); if (!isThrown && ((NetworkObjectReference)(ref enemyObject)).TryGet(ref val4, (NetworkManager)null)) { isThrown = true; throwingEnemy = ((Component)val4).gameObject.GetComponentInChildren(); ((Component)this).transform.position = startPosition; Rigidbody.position = startPosition; Rigidbody.isKinematic = false; Rigidbody.interpolation = (RigidbodyInterpolation)1; Rigidbody.collisionDetectionMode = (CollisionDetectionMode)2; Rigidbody.velocity = Vector3.zero; float speed = 40f; Rigidbody.AddForce(ComputeArcVelocity(direction, speed, 15f), (ForceMode)2); } } } private static Vector3 ComputeArcVelocity(Vector3 direction, float speed, float angleDeg) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_007c: 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_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(direction.x, 0f, direction.z); float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude <= 0.0001f) { return Vector3.up * speed; } float num = angleDeg * (MathF.PI / 180f); float num2 = magnitude / (speed * Mathf.Cos(num)); float num3 = direction.y / num2 - 0.5f * Physics.gravity.y * num2; Vector3 val2 = ((Vector3)(ref val)).normalized * (speed * Mathf.Cos(num)); return val2 + Vector3.up * num3; } private void OnCollisionEnter(Collision collision) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = default(PlayerControllerB); EnemyAI val2 = default(EnemyAI); if (LFCUtilities.IsServer && collision != null && isThrown && ((NetworkBehaviour)this).NetworkObject.IsSpawned && (!((Object)(object)collision.collider != (Object)null) || (!LFCUtilities.TryGetComponentInParent(((Component)collision.collider).gameObject, ref val) && !LFCUtilities.TryGetComponentInParent(((Component)collision.collider).gameObject, ref val2)))) { SpawnRockExplosionEveryoneRpc(((Component)this).transform.position, withParticle: true, withAudio: true); if (throwingEnemy is CrustapikanAI crustapikanAI) { crustapikanAI.SpawnEnemyForServer(StrangerThings.CrustopikanLarvaeType, ((Component)this).transform.position, 2f); ((NetworkBehaviour)this).NetworkObject.Despawn(Object.op_Implicit((Object)(object)((Component)this).gameObject)); } } } private void OnTriggerEnter(Collider collider) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = default(PlayerControllerB); if (LFCUtilities.IsServer && isThrown && ((NetworkBehaviour)this).NetworkObject.IsSpawned && (Object)(object)collider != (Object)null && ((Component)collider).TryGetComponent(ref val) && DimensionRegistry.AreInSameDimension(((Component)val).gameObject, ((Component)this).gameObject)) { LFCNetworkManager.Instance.DamagePlayerEveryoneRpc((int)val.playerClientId, 50, true, true, 8); SpawnRockExplosionEveryoneRpc(((Component)this).transform.position, withParticle: true, withAudio: true); ((NetworkBehaviour)this).NetworkObject.Despawn(Object.op_Implicit((Object)(object)((Component)this).gameObject)); } } public void SpawnRockExplosion(Vector3 position, bool withParticle, bool withAudio) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) SpawnRockExplosionEveryoneRpc(position, withParticle, withAudio); } [Rpc(/*Could not decode attribute arguments.*/)] public void SpawnRockExplosionEveryoneRpc(Vector3 position, bool withParticle, bool withAudio) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0113: 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) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3705911469u, val3, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref withParticle, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref withAudio, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3705911469u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; if (withParticle) { string text = "Lega Fusion Core" + ((Object)LegaFusionCore.brownExplosionParticle).name; Vector3 val4 = position; Quaternion identity = Quaternion.identity; GameObject gameObject = ((Component)this).gameObject; PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; LFCGlobalManager.PlayParticle(text, val4, identity, true, 1.5f, DimensionRegistry.AreInSameDimension(gameObject, (localPlayer != null) ? ((Component)localPlayer).gameObject : null)); } if (withAudio) { GameObject stoneImpactAudioObj = StrangerThings.StoneImpactAudioObj; Vector3 val5 = position; GameObject gameObject2 = ((Component)this).gameObject; PlayerControllerB localPlayer2 = LFCUtilities.LocalPlayer; LFCGlobalManager.PlayAudio(stoneImpactAudioObj, val5, DimensionRegistry.AreInSameDimension(gameObject2, (localPlayer2 != null) ? ((Component)localPlayer2).gameObject : null)); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2189498429u, new RpcReceiveHandler(__rpc_handler_2189498429), "GrabEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(4091481351u, new RpcReceiveHandler(__rpc_handler_4091481351), "ShakeEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(2535820002u, new RpcReceiveHandler(__rpc_handler_2535820002), "ThrowFromPositionEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(3705911469u, new RpcReceiveHandler(__rpc_handler_3705911469), "SpawnRockExplosionEveryoneRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2189498429(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((RockProjectile)(object)target).GrabEveryoneRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4091481351(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((RockProjectile)(object)target).ShakeEveryoneRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2535820002(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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_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_0080: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference enemyObject = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemyObject, default(ForNetworkSerializable)); Vector3 startPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref startPosition); Vector3 direction = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref direction); target.__rpc_exec_stage = (__RpcExecStage)1; ((RockProjectile)(object)target).ThrowFromPositionEveryoneRpc(enemyObject, startPosition, direction); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3705911469(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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_008e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); bool withParticle = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref withParticle, default(ForPrimitives)); bool withAudio = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref withAudio, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((RockProjectile)(object)target).SpawnRockExplosionEveryoneRpc(position, withParticle, withAudio); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "RockProjectile"; } } } namespace StrangerThings.Behaviours.MapObjects { public class AntennaHazard : NetworkBehaviour { public AntennaItem antennaItem; public PlayerControllerB previousPlayerHeldBy; public void AntennaInteraction() { RestoreAntennaItemEveryoneRpc((int)LFCUtilities.LocalPlayer.playerClientId); } [Rpc(/*Could not decode attribute arguments.*/)] public void RestoreAntennaItemEveryoneRpc(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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1753755191u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1753755191u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; ((GrabbableObject)antennaItem).isBeingUsed = false; ((GrabbableObject)antennaItem).EnablePhysics(true); if (LFCUtilities.IsServer) { LFCNetworkManager.Instance.ForceGrabObjectEveryoneRpc(NetworkObjectReference.op_Implicit(((Component)antennaItem).GetComponent()), playerId); Object.Destroy((Object)(object)((Component)this).gameObject); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1753755191u, new RpcReceiveHandler(__rpc_handler_1753755191), "RestoreAntennaItemEveryoneRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1753755191(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((AntennaHazard)(object)target).RestoreAntennaItemEveryoneRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "AntennaHazard"; } } public class BatsHorde : NetworkBehaviour { public ParticleSystem BatsParticle; public AudioSource AudioBatsHorde; public AudioClip BatsSound; public bool isActive = true; public float batsTimer; public float batsCooldown = 60f; public void Start() { DimensionRegistry.SetInUpsideDown(((Component)this).gameObject, isInUpsideDown: true); } private void OnTriggerEnter(Collider collider) { PlayerControllerB val = default(PlayerControllerB); if (isActive && (Object)(object)collider != (Object)null && ((Component)collider).TryGetComponent(ref val)) { isActive = false; if (BatsParticle.isPlaying) { BatsParticle.Stop(true, (ParticleSystemStopBehavior)0); } AudioBatsHorde.PlayOneShot(BatsSound); if (LFCUtilities.ShouldBeLocalPlayer(val)) { val.JumpToFearLevel(0.9f, true); } } } public void Update() { LFCUtilities.UpdateTimer(ref batsTimer, batsCooldown, !isActive, (Action)delegate { isActive = true; if (!BatsParticle.isPlaying) { BatsParticle.Play(); } }); } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "BatsHorde"; } } public class UpsideDownPortal : NetworkBehaviour, IHittable { public InteractTrigger PortalTrigger; public ParticleSystem PortalSpores; public bool isOutside; public bool isFake; public bool isLocked; public bool isCorrupted; public float lockTimer; public PlayerControllerB corruptedPlayer; public Coroutine disableCoroutine; private readonly Color baseColor = new Color(0.2f, 0.48f, 0.84f); private readonly Color corruptedColor = new Color(1f, 0f, 0f); [Rpc(/*Could not decode attribute arguments.*/)] public void InitializeEveryoneRpc(bool isOutside, bool isFake) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1297034105u, val3, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isOutside, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isFake, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1297034105u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; this.isOutside = isOutside; this.isFake = isFake; ((Component)PortalTrigger).gameObject.SetActive(!isFake); if (!isFake) { MapObjectsManager.AddPortal(this); } } } public void PortalInteraction() { PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; if (isCorrupted) { if (!DimensionRegistry.IsInUpsideDown((localPlayer != null) ? ((Component)localPlayer).gameObject : null) || (Object)(object)localPlayer == (Object)(object)corruptedPlayer) { RestorePortalEveryoneRpc(); } else { HUDManager.Instance.DisplayTip("Impossible action", "The portal is corrupted. It needs to be restored.", false, false, "LC_Tip1"); } } else if (isLocked) { HUDManager.Instance.DisplayTip("Impossible action", "The portal seems to be blocked for now...", false, false, "LC_Tip1"); } else if ((Object)(object)localPlayer != (Object)null) { isLocked = true; StrangerThingsNetworkManager.Instance.SetPlayerInUpsideDownEveryoneRpc((int)localPlayer.playerClientId, !DimensionRegistry.IsInUpsideDown(((Component)localPlayer).gameObject)); } } public void CorruptPortalForServer(PlayerControllerB player) { isCorrupted = true; corruptedPlayer = player; CorruptPortalEveryoneRpc(); CorruptPlayerEveryoneRpc(((Object)(object)corruptedPlayer != (Object)null) ? ((int)corruptedPlayer.playerClientId) : (-1)); } [Rpc(/*Could not decode attribute arguments.*/)] public void CorruptPortalEveryoneRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1764775483u, val3, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1764775483u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; isCorrupted = true; MainModule main = PortalSpores.main; ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(corruptedColor); EmissionModule emission = PortalSpores.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(7f); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void CorruptPlayerEveryoneRpc(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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(72492245u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 72492245u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (playerId == -1) { return; } corruptedPlayer = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent(); DimensionRegistry.SetInUpsideDown(((Component)corruptedPlayer).gameObject, isInUpsideDown: true); if (LFCUtilities.ShouldBeLocalPlayer(corruptedPlayer)) { if (ConfigManager.globalTips.Value) { HUDManager.Instance.DisplayTip("Information", "A portal has been corrupted. You must find a way to restore it in order to escape the dimension.", false, false, "LC_Tip1"); } LFCCustomPassManager.SetupAuraForObjects((GameObject[])(object)new GameObject[1] { ((Component)this).gameObject }, LegaFusionCore.wallhackShader, "Stranger ThingsPortal", Color.red); } } [Rpc(/*Could not decode attribute arguments.*/)] public void RestorePortalEveryoneRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(248418442u, val3, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 248418442u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; if (LFCUtilities.ShouldBeLocalPlayer(corruptedPlayer)) { LFCCustomPassManager.RemoveAuraByTag("Stranger ThingsPortal"); } isCorrupted = false; corruptedPlayer = null; MainModule main = PortalSpores.main; ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(baseColor); EmissionModule emission = PortalSpores.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(4f); } } public void Update() { if (isLocked) { lockTimer += Time.deltaTime; if (lockTimer >= (float)ConfigManager.portalLockDuration.Value) { isLocked = false; lockTimer = 0f; } } if (LFCUtilities.IsServer && isCorrupted && (Object)(object)corruptedPlayer != (Object)null && corruptedPlayer.isPlayerDead) { RestorePortalEveryoneRpc(); } } private void OnTriggerEnter(Collider other) { if (isFake || !LFCUtilities.IsServer || !((Component)other).CompareTag("Player")) { return; } PlayerControllerB player = ((Component)other).GetComponent(); if (isCorrupted) { if ((Object)(object)corruptedPlayer == (Object)null && !DimensionRegistry.IsInUpsideDown(((Component)player).gameObject)) { corruptedPlayer = player; CorruptPlayerEveryoneRpc((int)player.playerClientId); } return; } DemogorgonHunterAI demogorgonHunterAI = LFCSpawnRegistry.GetSetExact()?.Cast()?.FirstOrDefault((DemogorgonHunterAI d) => d.canSet && Vector3.Distance(((Component)d).transform.position, ((Component)player).transform.position) > 50f && ((EnemyAI)d).currentBehaviourStateIndex == 0); if ((Object)(object)demogorgonHunterAI != (Object)null) { demogorgonHunterAI.canSet = false; demogorgonHunterAI.isHunting = true; DemogorgonHunterAI demogorgonHunterAI2 = demogorgonHunterAI; if (demogorgonHunterAI2.setCoroutine == null) { demogorgonHunterAI2.setCoroutine = ((MonoBehaviour)demogorgonHunterAI).StartCoroutine(demogorgonHunterAI.SetCoroutine(player)); } } } public bool Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { if (!isFake) { if (disableCoroutine == null) { disableCoroutine = ((MonoBehaviour)this).StartCoroutine(DisableCoroutine()); } return true; } return false; } public IEnumerator DisableCoroutine() { ((Component)PortalTrigger).gameObject.SetActive(false); yield return (object)new WaitForSeconds(5f); ((Component)PortalTrigger).gameObject.SetActive(true); disableCoroutine = null; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1297034105u, new RpcReceiveHandler(__rpc_handler_1297034105), "InitializeEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(1764775483u, new RpcReceiveHandler(__rpc_handler_1764775483), "CorruptPortalEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(72492245u, new RpcReceiveHandler(__rpc_handler_72492245), "CorruptPlayerEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(248418442u, new RpcReceiveHandler(__rpc_handler_248418442), "RestorePortalEveryoneRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1297034105(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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag2, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((UpsideDownPortal)(object)target).InitializeEveryoneRpc(flag, flag2); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1764775483(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((UpsideDownPortal)(object)target).CorruptPortalEveryoneRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_72492245(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((UpsideDownPortal)(object)target).CorruptPlayerEveryoneRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_248418442(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((UpsideDownPortal)(object)target).RestorePortalEveryoneRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "UpsideDownPortal"; } } public class VinesZone : NetworkBehaviour { private readonly Collider[] overlapBuffer = (Collider[])(object)new Collider[64]; private readonly float AoERadius = 100f; private readonly int AoEMask = 524288; public void Start() { DimensionRegistry.SetInUpsideDown(((Component)this).gameObject, isInUpsideDown: true); } private void OnTriggerEnter(Collider collider) { //IL_004e: 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) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = default(PlayerControllerB); if (!((Object)(object)collider != (Object)null) || !((Component)collider).TryGetComponent(ref val) || !LFCUtilities.ShouldBeLocalPlayer(val)) { return; } LFCCustomPassManager.SetupScreenFilter(StrangerThings.ZoneFilterMat, string.Format("{0}{1}", "Stranger Things", ((Object)this).GetInstanceID())); int num = Physics.OverlapSphereNonAlloc(((Component)val).transform.position, AoERadius, overlapBuffer, AoEMask, (QueryTriggerInteraction)2); for (int i = 0; i < num; i++) { EnemyAI val2 = ((Component)overlapBuffer[i]).GetComponent()?.mainScript; if (!((Object)(object)val2 == (Object)null) && !((Object)(object)val2 == (Object)(object)this) && !val2.isEnemyDead && DimensionRegistry.AreInSameDimension(((Component)this).gameObject, ((Component)val2).gameObject) && val2 is UpsideDownEnemyAI upsideDownEnemyAI && !(Vector3.Distance(((Component)upsideDownEnemyAI).transform.position, ((Component)this).transform.position) > upsideDownEnemyAI.syncDistance)) { upsideDownEnemyAI.SetSyncedTarget(val); upsideDownEnemyAI.ForceSend(); } } } private void OnTriggerExit(Collider collider) { PlayerControllerB val = default(PlayerControllerB); if ((Object)(object)collider != (Object)null && ((Component)collider).TryGetComponent(ref val) && LFCUtilities.ShouldBeLocalPlayer(val)) { LFCCustomPassManager.RemoveFiltersByTag(string.Format("{0}{1}", "Stranger Things", ((Object)this).GetInstanceID())); } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { ((NetworkBehaviour)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "VinesZone"; } } } namespace StrangerThings.Behaviours.Items { public class AntennaItem : Shovel { public AudioSource AntennaAudio; public int antennaHitForce = 3; public RaycastHit[] objectsHitByAntenna; public List objectsHitByAntennaList = new List(); public override void ItemActivate(bool used, bool buttonDown = true) { if (!((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null)) { return; } base.isHoldingButton = buttonDown; if (!base.reelingUp && buttonDown) { base.reelingUp = true; base.previousPlayerHeldBy = ((GrabbableObject)this).playerHeldBy; if (base.reelingUpCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(base.reelingUpCoroutine); base.reelingUpCoroutine = null; } base.reelingUpCoroutine = ((MonoBehaviour)this).StartCoroutine(ReelUpAntenna()); } } private IEnumerator ReelUpAntenna() { ((GrabbableObject)this).playerHeldBy.activatingItem = true; ((GrabbableObject)this).playerHeldBy.twoHanded = true; ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.ResetTrigger("shovelHit"); ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetBool("reelingUp", true); ReelUpSFXEveryoneRpc(); yield return (object)new WaitForSeconds(0.35f); yield return (object)new WaitUntil((Func)(() => !base.isHoldingButton || !((GrabbableObject)this).isHeld)); SwingAntenna(!((GrabbableObject)this).isHeld); yield return (object)new WaitForSeconds(0.13f); yield return (object)new WaitForEndOfFrame(); HitAntenna(!((GrabbableObject)this).isHeld); yield return (object)new WaitForSeconds(0.3f); base.reelingUp = false; base.reelingUpCoroutine = null; } [Rpc(/*Could not decode attribute arguments.*/)] public void ReelUpSFXEveryoneRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(4252981852u, val3, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 4252981852u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; AntennaAudio.PlayOneShot(base.reelUp); } } } public void SwingAntenna(bool cancel = false) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) base.previousPlayerHeldBy.playerBodyAnimator.SetBool("reelingUp", false); if (!cancel) { AntennaAudio.PlayOneShot(base.swing); base.previousPlayerHeldBy.UpdateSpecialAnimationValue(true, (short)((Component)base.previousPlayerHeldBy).transform.localEulerAngles.y, 0.4f, false); } } public void HitAntenna(bool cancel = false) { //IL_0057: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)base.previousPlayerHeldBy == (Object)null) { StrangerThings.mls.LogError((object)"Previousplayerheldby is null on this client when HitAntenna is called"); return; } base.previousPlayerHeldBy.activatingItem = false; bool flag = false; int hitSurfaceID = -1; if (!cancel) { HashSet hashSet = new HashSet(); base.previousPlayerHeldBy.twoHanded = false; objectsHitByAntenna = Physics.SphereCastAll(((Component)base.previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)base.previousPlayerHeldBy.gameplayCamera).transform.right * -0.35f, 0.8f, ((Component)base.previousPlayerHeldBy.gameplayCamera).transform.forward, 1.5f, base.shovelMask, (QueryTriggerInteraction)2); objectsHitByAntennaList = objectsHitByAntenna.OrderBy((RaycastHit x) => ((RaycastHit)(ref x)).distance).ToList(); IHittable val = default(IHittable); RaycastHit val2 = default(RaycastHit); EnemyAICollisionDetect val3 = default(EnemyAICollisionDetect); PlayerControllerB val4 = default(PlayerControllerB); foreach (RaycastHit objectsHitByAntenna in objectsHitByAntennaList) { RaycastHit current = objectsHitByAntenna; if (((Component)((RaycastHit)(ref current)).transform).gameObject.layer == 8 || ((Component)((RaycastHit)(ref current)).transform).gameObject.layer == 11) { if (((RaycastHit)(ref current)).collider.isTrigger) { continue; } flag = true; for (int num = 0; num < StartOfRound.Instance.footstepSurfaces.Length; num++) { if (StartOfRound.Instance.footstepSurfaces[num].surfaceTag == ((Component)((RaycastHit)(ref current)).collider).gameObject.tag) { hitSurfaceID = num; break; } } } else if (((Component)((RaycastHit)(ref current)).transform).TryGetComponent(ref val) && !((Object)(object)((RaycastHit)(ref current)).transform == (Object)(object)((Component)base.previousPlayerHeldBy).transform) && (((RaycastHit)(ref current)).point == Vector3.zero || !Physics.Linecast(((Component)base.previousPlayerHeldBy.gameplayCamera).transform.position, ((RaycastHit)(ref current)).point, ref val2, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1))) { flag = true; if (((Component)((RaycastHit)(ref current)).transform).TryGetComponent(ref val3) && (Object)(object)val3.mainScript != (Object)null && hashSet.Add(((NetworkBehaviour)val3.mainScript).NetworkObjectId)) { val.Hit(antennaHitForce, ((Component)base.previousPlayerHeldBy.gameplayCamera).transform.forward, base.previousPlayerHeldBy, true, 1); } else if (((Component)((RaycastHit)(ref current)).transform).TryGetComponent(ref val4) && hashSet.Add(LFCUtilities.EncodePlayerId(val4.playerClientId))) { val.Hit(antennaHitForce, ((Component)base.previousPlayerHeldBy.gameplayCamera).transform.forward, base.previousPlayerHeldBy, true, 1); } } } } if (flag) { RoundManager.PlayRandomClip(AntennaAudio, base.hitSFX, true, 1f, 0, 1000); Object.FindObjectOfType().PlayAudibleNoise(((Component)this).transform.position, 17f, 0.8f, 0, false, 0); HitAntennaEveryoneRpc(hitSurfaceID); } } [Rpc(/*Could not decode attribute arguments.*/)] public void HitAntennaEveryoneRpc(int hitSurfaceID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3388906295u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, hitSurfaceID); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3388906295u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RoundManager.PlayRandomClip(AntennaAudio, base.hitSFX, true, 1f, 0, 1000); if (hitSurfaceID != -1) { AntennaAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[hitSurfaceID].hitSurfaceSFX); WalkieTalkie.TransmitOneShotAudio(AntennaAudio, StartOfRound.Instance.footstepSurfaces[hitSurfaceID].hitSurfaceSFX, 1f); } ((GrabbableObject)this).DestroyObjectInHand(((GrabbableObject)this).playerHeldBy); } } public override void ItemInteractLeftRight(bool right) { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).ItemInteractLeftRight(right); if (!right && LFCUtilities.ShouldBeLocalPlayer(((GrabbableObject)this).playerHeldBy) && !base.reelingUp) { if (DimensionRegistry.IsInUpsideDown(((Component)((GrabbableObject)this).playerHeldBy).gameObject)) { HUDManager.Instance.DisplayTip("Impossible action", "Antennas can only be activated in the real world.", false, false, "LC_Tip1"); } else { SpawnAntennaHazardServerRpc((int)((GrabbableObject)this).playerHeldBy.playerClientId, ((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.position + ((Component)((GrabbableObject)this).playerHeldBy.gameplayCamera).transform.forward); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SpawnAntennaHazardServerRpc(int playerId, Vector3 position) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(207452063u, val3, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendRpc(ref val2, 207452063u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(position, Vector3.down, ref val4, 5f, StartOfRound.Instance.collidersAndRoomMaskAndDefault)) { Quaternion rotation = ((Component)StartOfRound.Instance.allPlayerObjects[playerId].GetComponent()).transform.rotation; GameObject val5 = Object.Instantiate(StrangerThings.AntennaHazardObj, ((RaycastHit)(ref val4)).point, Quaternion.Euler(0f, ((Quaternion)(ref rotation)).eulerAngles.y, ((Quaternion)(ref rotation)).eulerAngles.z), RoundManager.Instance.mapPropsContainer.transform); NetworkObject component = val5.GetComponent(); component.Spawn(true); SpawnAntennaHazardEveryoneRpc(playerId, NetworkObjectReference.op_Implicit(component)); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SpawnAntennaHazardEveryoneRpc(int playerId, 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(975664246u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref obj, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 975664246u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); if (((NetworkObjectReference)(ref obj)).TryGet(ref val4, (NetworkManager)null)) { PlayerControllerB component = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent(); ((GrabbableObject)this).isBeingUsed = true; LFCObjectsManager.DropHeldObject((GrabbableObject)(object)this, component, true, false); ((GrabbableObject)this).EnablePhysics(false); ((Component)this).transform.SetParent((Transform)null); ((GrabbableObject)this).targetFloorPosition = new Vector3(3000f, -400f, 3000f); ((GrabbableObject)this).startFallingPosition = new Vector3(3000f, -400f, 3000f); AntennaHazard componentInChildren = ((Component)val4).gameObject.GetComponentInChildren(); componentInChildren.antennaItem = this; componentInChildren.previousPlayerHeldBy = component; MapObjectsManager.AddAntenna(componentInChildren); LFCMapObjectsManager.AttachMapObjectForEveryone(component, ((Component)componentInChildren).gameObject); } } } public override void EquipItem() { ((GrabbableObject)this).EquipItem(); ((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = true; } public override void PocketItem() { ((GrabbableObject)this).PocketItem(); if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { ((GrabbableObject)this).playerHeldBy.activatingItem = false; ((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = false; } } public override void DiscardItem() { if ((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { ((GrabbableObject)this).playerHeldBy.activatingItem = false; ((GrabbableObject)this).playerHeldBy.equippedUsableItemQE = false; } ((Shovel)this).DiscardItem(); } protected override void __initializeVariables() { ((Shovel)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(4252981852u, new RpcReceiveHandler(__rpc_handler_4252981852), "ReelUpSFXEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(3388906295u, new RpcReceiveHandler(__rpc_handler_3388906295), "HitAntennaEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(207452063u, new RpcReceiveHandler(__rpc_handler_207452063), "SpawnAntennaHazardServerRpc"); ((NetworkBehaviour)this).__registerRpc(975664246u, new RpcReceiveHandler(__rpc_handler_975664246), "SpawnAntennaHazardEveryoneRpc"); ((Shovel)this).__initializeRpcs(); } private static void __rpc_handler_4252981852(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((AntennaItem)(object)target).ReelUpSFXEveryoneRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3388906295(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int hitSurfaceID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hitSurfaceID); target.__rpc_exec_stage = (__RpcExecStage)1; ((AntennaItem)(object)target).HitAntennaEveryoneRpc(hitSurfaceID); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_207452063(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); target.__rpc_exec_stage = (__RpcExecStage)1; ((AntennaItem)(object)target).SpawnAntennaHazardServerRpc(playerId, position); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_975664246(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); NetworkObjectReference obj = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref obj, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((AntennaItem)(object)target).SpawnAntennaHazardEveryoneRpc(playerId, obj); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "AntennaItem"; } } public class BaseballBat : UpsideDownObject { public AudioSource BaseballBatAudio; public AudioClip ReelUp; public AudioClip Swing; public AudioClip[] HitSFX; public int baseballBatHitForce = 1; public bool reelingUp; public bool isHoldingButton; private Coroutine reelingUpCoroutine; private RaycastHit[] objectsHitByBaseballBat; private List objectsHitByBaseballBatList = new List(); private PlayerControllerB previousPlayerHeldBy; private readonly int baseballBatMask = 1084754248; public override void ItemActivate(bool used, bool buttonDown = true) { if (!((Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null)) { return; } isHoldingButton = buttonDown; if (!reelingUp && buttonDown) { reelingUp = true; previousPlayerHeldBy = ((GrabbableObject)this).playerHeldBy; if (reelingUpCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(reelingUpCoroutine); reelingUpCoroutine = null; } reelingUpCoroutine = ((MonoBehaviour)this).StartCoroutine(ReelUpBaseballBat()); } } private IEnumerator ReelUpBaseballBat() { ((GrabbableObject)this).playerHeldBy.activatingItem = true; ((GrabbableObject)this).playerHeldBy.twoHanded = true; ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.ResetTrigger("shovelHit"); ((GrabbableObject)this).playerHeldBy.playerBodyAnimator.SetBool("reelingUp", true); ReelUpSFXEveryoneRpc(); yield return (object)new WaitForSeconds(0.35f); yield return (object)new WaitUntil((Func)(() => !isHoldingButton || !((GrabbableObject)this).isHeld)); SwingBaseballBat(!((GrabbableObject)this).isHeld); yield return (object)new WaitForSeconds(0.13f); yield return (object)new WaitForEndOfFrame(); HitBaseballBat(!((GrabbableObject)this).isHeld); yield return (object)new WaitForSeconds(0.3f); reelingUp = false; reelingUpCoroutine = null; } [Rpc(/*Could not decode attribute arguments.*/)] public void ReelUpSFXEveryoneRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(749079199u, val3, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 749079199u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; BaseballBatAudio.PlayOneShot(ReelUp); } } } public void SwingBaseballBat(bool cancel = false) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) previousPlayerHeldBy.playerBodyAnimator.SetBool("reelingUp", false); if (!cancel) { BaseballBatAudio.PlayOneShot(Swing); previousPlayerHeldBy.UpdateSpecialAnimationValue(true, (short)((Component)previousPlayerHeldBy).transform.localEulerAngles.y, 0.4f, false); } } public void HitBaseballBat(bool cancel = false) { //IL_0057: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)previousPlayerHeldBy == (Object)null) { StrangerThings.mls.LogError((object)"Previousplayerheldby is null on this client when HitBaseballBat is called"); return; } previousPlayerHeldBy.activatingItem = false; bool flag = false; int hitSurfaceID = -1; if (!cancel) { HashSet hashSet = new HashSet(); previousPlayerHeldBy.twoHanded = false; objectsHitByBaseballBat = Physics.SphereCastAll(((Component)previousPlayerHeldBy.gameplayCamera).transform.position + ((Component)previousPlayerHeldBy.gameplayCamera).transform.right * -0.35f, 0.8f, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward, 1.5f, baseballBatMask, (QueryTriggerInteraction)2); objectsHitByBaseballBatList = objectsHitByBaseballBat.OrderBy((RaycastHit x) => ((RaycastHit)(ref x)).distance).ToList(); IHittable val = default(IHittable); RaycastHit val2 = default(RaycastHit); EnemyAICollisionDetect val3 = default(EnemyAICollisionDetect); PlayerControllerB val4 = default(PlayerControllerB); foreach (RaycastHit objectsHitByBaseballBat in objectsHitByBaseballBatList) { RaycastHit current = objectsHitByBaseballBat; if (((Component)((RaycastHit)(ref current)).transform).gameObject.layer == 8 || ((Component)((RaycastHit)(ref current)).transform).gameObject.layer == 11) { if (((RaycastHit)(ref current)).collider.isTrigger) { continue; } flag = true; for (int num = 0; num < StartOfRound.Instance.footstepSurfaces.Length; num++) { if (StartOfRound.Instance.footstepSurfaces[num].surfaceTag == ((Component)((RaycastHit)(ref current)).collider).gameObject.tag) { hitSurfaceID = num; break; } } } else if (((Component)((RaycastHit)(ref current)).transform).TryGetComponent(ref val) && !((Object)(object)((RaycastHit)(ref current)).transform == (Object)(object)((Component)previousPlayerHeldBy).transform) && (((RaycastHit)(ref current)).point == Vector3.zero || !Physics.Linecast(((Component)previousPlayerHeldBy.gameplayCamera).transform.position, ((RaycastHit)(ref current)).point, ref val2, StartOfRound.Instance.collidersAndRoomMaskAndDefault, (QueryTriggerInteraction)1))) { flag = true; if (((Component)((RaycastHit)(ref current)).transform).TryGetComponent(ref val3) && (Object)(object)val3.mainScript != (Object)null && hashSet.Add(((NetworkBehaviour)val3.mainScript).NetworkObjectId)) { LSNetworkManager.Instance.ApplyStatusEveryoneRpc((int)((GrabbableObject)this).playerHeldBy.playerClientId, NetworkObjectReference.op_Implicit(((NetworkBehaviour)val3.mainScript).NetworkObject), 0, 2, 20, default(NetworkObjectReference)); val.Hit(baseballBatHitForce, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward, previousPlayerHeldBy, true, 1); } else if (((Component)((RaycastHit)(ref current)).transform).TryGetComponent(ref val4) && hashSet.Add(LFCUtilities.EncodePlayerId(val4.playerClientId))) { LSNetworkManager.Instance.ApplyStatusEveryoneRpc((int)((GrabbableObject)this).playerHeldBy.playerClientId, (int)val4.playerClientId, 0, 2, 2, default(NetworkObjectReference)); val.Hit(baseballBatHitForce, ((Component)previousPlayerHeldBy.gameplayCamera).transform.forward, previousPlayerHeldBy, true, 1); } } } } if (flag) { RoundManager.PlayRandomClip(BaseballBatAudio, HitSFX, true, 1f, 0, 1000); Object.FindObjectOfType().PlayAudibleNoise(((Component)this).transform.position, 17f, 0.8f, 0, false, 0); HitBaseballBatEveryoneRpc(hitSurfaceID); } } [Rpc(/*Could not decode attribute arguments.*/)] public void HitBaseballBatEveryoneRpc(int hitSurfaceID) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(4169060244u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, hitSurfaceID); ((NetworkBehaviour)this).__endSendRpc(ref val2, 4169060244u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; RoundManager.PlayRandomClip(BaseballBatAudio, HitSFX, true, 1f, 0, 1000); if (hitSurfaceID != -1) { BaseballBatAudio.PlayOneShot(StartOfRound.Instance.footstepSurfaces[hitSurfaceID].hitSurfaceSFX); WalkieTalkie.TransmitOneShotAudio(BaseballBatAudio, StartOfRound.Instance.footstepSurfaces[hitSurfaceID].hitSurfaceSFX, 1f); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(749079199u, new RpcReceiveHandler(__rpc_handler_749079199), "ReelUpSFXEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(4169060244u, new RpcReceiveHandler(__rpc_handler_4169060244), "HitBaseballBatEveryoneRpc"); base.__initializeRpcs(); } private static void __rpc_handler_749079199(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((BaseballBat)(object)target).ReelUpSFXEveryoneRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4169060244(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int hitSurfaceID = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref hitSurfaceID); target.__rpc_exec_stage = (__RpcExecStage)1; ((BaseballBat)(object)target).HitBaseballBatEveryoneRpc(hitSurfaceID); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "BaseballBat"; } } public class Guitar : UpsideDownObject { public AudioSource GuitarAudio; public override void ItemActivate(bool used, bool buttonDown = true) { if (buttonDown && (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null) { PlayGuitarEveryoneRpc(); } } [Rpc(/*Could not decode attribute arguments.*/)] public void PlayGuitarEveryoneRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3081695872u, val3, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3081695872u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (GuitarAudio.isPlaying) { GuitarAudio.Stop(); } else { GuitarAudio.Play(); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3081695872u, new RpcReceiveHandler(__rpc_handler_3081695872), "PlayGuitarEveryoneRpc"); base.__initializeRpcs(); } private static void __rpc_handler_3081695872(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((Guitar)(object)target).PlayGuitarEveryoneRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "Guitar"; } } public class UpsideDownObject : PhysicsProp { protected override void __initializeVariables() { ((PhysicsProp)this).__initializeVariables(); } protected override void __initializeRpcs() { ((PhysicsProp)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "UpsideDownObject"; } } } namespace StrangerThings.Behaviours.Items.Figurines { public class ElevenPop : FigurinePop { private HenryAI aimedEnemy; private PlayerControllerB aimedPlayer; private readonly string auraTag = "Stranger ThingsElevenPopAimed"; private readonly float auraRadius = 5f; private readonly int auraMask = 1084754248; private readonly Collider[] overlapBuffer = (Collider[])(object)new Collider[64]; public override void GrabItem() { ((GrabbableObject)this).GrabItem(); LFCCustomPassManager.RemoveAuraFromObject(((Component)this).gameObject, "Stranger ThingsElevenPop"); } public override void Update() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) ((GrabbableObject)this).Update(); if (onCooldown || !((GrabbableObject)this).isHeld || ((GrabbableObject)this).isPocketed || !LFCUtilities.ShouldBeLocalPlayer(((GrabbableObject)this).playerHeldBy)) { ClearAuras(); return; } int num = Physics.OverlapSphereNonAlloc(((Component)((GrabbableObject)this).playerHeldBy).transform.position, auraRadius, overlapBuffer, auraMask, (QueryTriggerInteraction)2); EnemyAICollisionDetect val2 = default(EnemyAICollisionDetect); PlayerControllerB val3 = default(PlayerControllerB); for (int i = 0; i < num; i++) { Collider val = overlapBuffer[i]; if (!((Object)(object)val == (Object)null) && DimensionRegistry.AreInSameDimension(((Component)((GrabbableObject)this).playerHeldBy).gameObject, ((Component)val).gameObject)) { if (LFCUtilities.TryGetComponentInParent(((Component)val).gameObject, ref val2) && val2.mainScript is HenryAI { isEnemyDead: false } henryAI && (Object)(object)((NetworkBehaviour)henryAI).NetworkObject != (Object)null && (Object)(object)aimedEnemy != (Object)(object)henryAI) { SetAimedTarget(henryAI, Color.red, ref aimedEnemy); return; } if (LFCUtilities.TryGetComponentInParent(((Component)val).gameObject, ref val3) && !val3.isPlayerDead && (Object)(object)val3 != (Object)(object)((GrabbableObject)this).playerHeldBy && (Object)(object)aimedPlayer != (Object)(object)val3) { SetAimedTarget(val3, Color.yellow, ref aimedPlayer); return; } } } ClearAuras(); } public override void ItemActivate(bool used, bool buttonDown = true) { if (buttonDown && !onCooldown && (Object)(object)((GrabbableObject)this).playerHeldBy != (Object)null && (Object)(object)aimedEnemy != (Object)null) { ((EnemyAI)aimedEnemy).KillEnemyServerRpc(true); StartChronoEveryoneRpc(120); } } private void SetAimedTarget(T target, Color color, ref T aimedTarget) where T : Component { //IL_002c: Unknown result type (might be due to invalid IL or missing references) ClearAuras(); aimedTarget = target; LFCCustomPassManager.SetupAuraForObjects((GameObject[])(object)new GameObject[1] { ((Component)target).gameObject }, LegaFusionCore.transparentShader, auraTag, color); } private void ClearAuras() { HenryAI henryAI = aimedEnemy; if ((Object)(object)((henryAI != null) ? ((Component)henryAI).gameObject : null) != (Object)null) { LFCCustomPassManager.RemoveAuraFromObject(((Component)aimedEnemy).gameObject, auraTag); aimedEnemy = null; } PlayerControllerB obj = aimedPlayer; if ((Object)(object)((obj != null) ? ((Component)obj).gameObject : null) != (Object)null) { LFCCustomPassManager.RemoveAuraFromObject(((Component)aimedPlayer).gameObject, auraTag); aimedPlayer = null; } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { base.__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "ElevenPop"; } } public class FigurinePop : UpsideDownObject { public bool onCooldown; public int currentTimeLeft; [Rpc(/*Could not decode attribute arguments.*/)] public void StartChronoEveryoneRpc(int cooldown) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2908479862u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, cooldown); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2908479862u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; onCooldown = true; currentTimeLeft = cooldown; ((MonoBehaviour)this).StartCoroutine(StartChronoCoroutine()); } } } public IEnumerator StartChronoCoroutine() { while (currentTimeLeft > 0) { yield return (object)new WaitForSecondsRealtime(1f); currentTimeLeft--; ((GrabbableObject)this).SetControlTipsForItem(); } onCooldown = false; ((GrabbableObject)this).SetControlTipsForItem(); } public override void SetControlTipsForItem() { if (LFCUtilities.ShouldBeLocalPlayer(((GrabbableObject)this).playerHeldBy)) { string item = (onCooldown ? $"[On Cooldown : {currentTimeLeft}]" : ""); HUDManager.Instance.ChangeControlTipMultiple(((GrabbableObject)this).itemProperties.toolTips.Concat(new <>z__ReadOnlySingleElementList(item)).ToArray(), true, ((GrabbableObject)this).itemProperties); } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2908479862u, new RpcReceiveHandler(__rpc_handler_2908479862), "StartChronoEveryoneRpc"); base.__initializeRpcs(); } private static void __rpc_handler_2908479862(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int cooldown = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref cooldown); target.__rpc_exec_stage = (__RpcExecStage)1; ((FigurinePop)(object)target).StartChronoEveryoneRpc(cooldown); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "FigurinePop"; } } } namespace StrangerThings.Behaviours.Enemies { public class CrustapikanAI : UpsideDownEnemyAI { public enum State { WANDERING, CHASING, CARRYING } public enum Sound { MOVE, SMASH, ROAR, GRAB, THROW, SWING } [Serializable] public class CrustapikanSoundSerializableEntry : SerializableEntry { } public Transform TurnCompass; public Transform GrabPoint; public CrustapikanSoundSerializableEntry[] CrustapikanSoundsEntry; public Dictionary CrustapikanSounds; private float moveTimer; private float lookTimer = 10f; private float callTimer = 30f; private float grabTimer; public float lookCooldown = 20f; public float callCooldown = 60f; public float grabCooldown = 20f; public bool canLook; public bool canCall; public bool canGrab; public Coroutine stunCoroutine; public Coroutine lookCoroutine; public Coroutine callCoroutine; public Coroutine grabCoroutine; public Coroutine throwCoroutine; public Coroutine swingCoroutine; protected RockProjectile rockProjectile; protected Vector3 lastSeenPosition; private readonly Collider[] overlapBuffer = (Collider[])(object)new Collider[64]; private readonly float AoERadius = 100f; private readonly int AoEMask = 524288; public override void CancelActionsForServer() { if (LFCUtilities.IsServer) { CancelLookCoroutine(); CancelGrabCoroutine(); CancelSwingCoroutine(); CancelCallCoroutine(); CancelThrowCoroutine(); } } public override void ForceSend() { if (((EnemyAI)this).currentBehaviourStateIndex == 0) { ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).SetMovingTowardsTargetPlayer(syncedTarget); ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } } public override void Start() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Start(); CrustapikanSounds = LFCUtilities.ToDictionary((IEnumerable>)CrustapikanSoundsEntry); ((EnemyAI)this).currentBehaviourStateIndex = 0; ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); } public override void Update() { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) base.Update(); if (!((EnemyAI)this).isEnemyDead && stunCoroutine == null) { PlayMoveSound(); int currentBehaviourStateIndex = ((EnemyAI)this).currentBehaviourStateIndex; if ((Object)(object)((EnemyAI)this).targetPlayer != (Object)null && (currentBehaviourStateIndex == 1 || currentBehaviourStateIndex == 2)) { TurnCompass.LookAt(((Component)((EnemyAI)this).targetPlayer.gameplayCamera).transform.position); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(new Vector3(0f, TurnCompass.eulerAngles.y, 0f)), 4f * Time.deltaTime); } LFCUtilities.UpdateTimer(ref lookTimer, lookCooldown, !canLook, (Action)delegate { canLook = true; }); LFCUtilities.UpdateTimer(ref callTimer, callCooldown, !canCall, (Action)delegate { canCall = true; }); LFCUtilities.UpdateTimer(ref grabTimer, grabCooldown, !canGrab, (Action)delegate { canGrab = true; }); } } public void PlayMoveSound() { AnimatorClipInfo[] currentAnimatorClipInfo = ((EnemyAI)this).creatureAnimator.GetCurrentAnimatorClipInfo(0); if (currentAnimatorClipInfo.Length != 0 && ((Object)((AnimatorClipInfo)(ref currentAnimatorClipInfo[0])).clip).name.Contains("move")) { moveTimer -= Time.deltaTime; if (CrustapikanSounds.TryGetValue(Sound.MOVE, out var value) && value.Length != 0 && moveTimer <= 0f) { ((EnemyAI)this).creatureSFX.PlayOneShot(value[Random.Range(0, value.Length)]); moveTimer = 1.25f; } } } public override void SetEnemyStunned(bool setToStunned, float setToStunTime = 2.333f, PlayerControllerB setStunnedByPlayer = null) { if (LFCUtilities.IsServer && setToStunned && stunCoroutine == null) { ((EnemyAI)this).SetEnemyStunned(setToStunned, setToStunTime, setStunnedByPlayer); stunCoroutine = ((MonoBehaviour)this).StartCoroutine(StunCoroutine()); } } public IEnumerator StunCoroutine() { CancelActionsForServer(); ((EnemyAI)this).agent.speed = 0f; DoAnimationEveryoneRpc("startStun"); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "stun", 10f, 0); while (((EnemyAI)this).stunNormalizedTimer > 0f) { yield return null; } while (((EnemyAI)this).postStunInvincibilityTimer > 0f) { yield return null; } DoAnimationEveryoneRpc("startMove"); if (((EnemyAI)this).currentBehaviourStateIndex == 0 && (Object)(object)((EnemyAI)this).stunnedByPlayer != (Object)null) { ((EnemyAI)this).targetPlayer = ((EnemyAI)this).stunnedByPlayer; ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } stunCoroutine = null; } public override void DoAIInterval() { ((EnemyAI)this).DoAIInterval(); if (!((EnemyAI)this).isEnemyDead && !StartOfRound.Instance.allPlayersDead && stunCoroutine == null) { switch ((State)((EnemyAI)this).currentBehaviourStateIndex) { case State.WANDERING: DoWandering(); break; case State.CHASING: DoChasing(); break; case State.CARRYING: DoCarrying(); break; } } } public void DoWandering() { if (lookCoroutine != null) { return; } ((EnemyAI)this).agent.speed = 3f; if (LFCEnemyManager.FoundClosestPlayerInRange((EnemyAI)(object)this, 35, 10, 60f, true)) { canCall = true; ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } else if (canLook) { canLook = false; ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); if (lookCoroutine == null) { lookCoroutine = ((MonoBehaviour)this).StartCoroutine(LookCoroutine()); } } } public IEnumerator LookCoroutine() { ((EnemyAI)this).agent.speed = 0f; DoAnimationEveryoneRpc("startLook"); IEnumerator waitForLook = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "look", 10f, 0); while (waitForLook.MoveNext()) { if (LFCEnemyManager.FoundClosestPlayerInRange((EnemyAI)(object)this, 50, 15, 90f, true)) { DoAnimationEveryoneRpc("startMove"); ((EnemyAI)this).SwitchToBehaviourClientRpc(1); lookCoroutine = null; yield break; } yield return waitForLook.Current; } ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); DoAnimationEveryoneRpc("startMove"); lookCoroutine = null; } public void CancelLookCoroutine() { if (lookCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(lookCoroutine); lookCoroutine = null; canLook = true; lookTimer = 0f; } } public void DoChasing() { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) if (swingCoroutine != null || callCoroutine != null || grabCoroutine != null) { return; } ((EnemyAI)this).agent.speed = 4f; float num = default(float); if (!LFCEnemyManager.TargetClosestPlayerInAnyCase((EnemyAI)(object)this, ref num, true) || (!isSynced && num > 50f && !((EnemyAI)this).CheckLineOfSightForPosition(((Component)((EnemyAI)this).targetPlayer).transform.position, 45f, 60, -1f, (Transform)null))) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } else if (canCall) { canCall = false; if (callCoroutine == null) { callCoroutine = ((MonoBehaviour)this).StartCoroutine(CallCoroutine()); } } else if (canGrab && num >= 15f && ((EnemyAI)this).CheckLineOfSightForPosition(((Component)((EnemyAI)this).targetPlayer).transform.position, 45f, 60, -1f, (Transform)null)) { canGrab = false; if (grabCoroutine == null) { grabCoroutine = ((MonoBehaviour)this).StartCoroutine(GrabCoroutine()); } } else { ((EnemyAI)this).SetMovingTowardsTargetPlayer(((EnemyAI)this).targetPlayer); } } public IEnumerator CallCoroutine() { ((EnemyAI)this).agent.speed = 0f; DoAnimationEveryoneRpc("startSmash"); yield return (object)new WaitForSeconds(2.15f); PlaySFXEveryoneRpc(1); PlayParticleEveryoneRpc("Lega Fusion CoreAppearFromGround1", ((Component)this).transform.position + ((Component)this).transform.forward, Quaternion.identity, 0.5f); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "smash", 10f, 0); HashSet syncedEnemies = new HashSet(); int num = Physics.OverlapSphereNonAlloc(((Component)this).transform.position, AoERadius, overlapBuffer, AoEMask, (QueryTriggerInteraction)2); for (int i = 0; i < num; i++) { EnemyAI val = ((Component)overlapBuffer[i]).GetComponent()?.mainScript; if (!((Object)(object)val == (Object)null) && !((Object)(object)val == (Object)(object)this) && !val.isEnemyDead && DimensionRegistry.AreInSameDimension(((Component)this).gameObject, ((Component)val).gameObject) && val is UpsideDownEnemyAI upsideDownEnemyAI && !(Vector3.Distance(((Component)upsideDownEnemyAI).transform.position, ((Component)this).transform.position) > upsideDownEnemyAI.syncDistance)) { upsideDownEnemyAI.SetSyncedTarget(((EnemyAI)this).targetPlayer); syncedEnemies.Add(upsideDownEnemyAI); } } UpsideDownEnemyAI upsideDownEnemyAI2 = SpawnEnemyForServer(StrangerThings.CrustopikanLarvaeType, ((Component)this).transform.position, 5f); if ((Object)(object)upsideDownEnemyAI2 != (Object)null) { upsideDownEnemyAI2.SetSyncedTarget(((EnemyAI)this).targetPlayer); syncedEnemies.Add(upsideDownEnemyAI2); } if (syncedEnemies.Any((UpsideDownEnemyAI e) => (Object)(object)((EnemyAI)e).targetPlayer == (Object)null)) { PlaySFXEveryoneRpc(2); DoAnimationEveryoneRpc("startRoar"); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "roar", 10f, 0); foreach (UpsideDownEnemyAI item in syncedEnemies) { item.ForceSend(); } } DoAnimationEveryoneRpc("startMove"); ((EnemyAI)this).SwitchToBehaviourClientRpc(1); callCoroutine = null; } [Rpc(/*Could not decode attribute arguments.*/)] public void PlayParticleEveryoneRpc(string tag, Vector3 position, Quaternion rotation, float scaleFactor) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1993170488u, val3, val, (SendTo)6, (RpcDelivery)0); bool flag = tag != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(tag, false); } ((FastBufferWriter)(ref val2)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref rotation); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref scaleFactor, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1993170488u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; Vector3 val4 = position; Quaternion val5 = rotation; float num = scaleFactor; PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; LFCGlobalManager.PlayParticle(tag, val4, val5, true, num, DimensionRegistry.IsInUpsideDown((localPlayer != null) ? ((Component)localPlayer).gameObject : null)); } } public void CancelCallCoroutine() { if (callCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(callCoroutine); callCoroutine = null; ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } } public IEnumerator GrabCoroutine() { ((EnemyAI)this).agent.speed = 0f; PlaySFXEveryoneRpc(3); DoAnimationEveryoneRpc("startGrab"); yield return (object)new WaitForSeconds(1.7f); SpawnRockForServer(); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "grab", 10f, 0); DoAnimationEveryoneRpc("startCarry"); ((EnemyAI)this).SwitchToBehaviourClientRpc(2); grabCoroutine = null; } public void SpawnRockForServer() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(StrangerThings.RockProjectileObj, GrabPoint.position, GrabPoint.rotation); NetworkObject component = val.GetComponent(); component.Spawn(false); SpawnRockEveryoneRpc(NetworkObjectReference.op_Implicit(component)); rockProjectile = val.GetComponent(); } [Rpc(/*Could not decode attribute arguments.*/)] public void SpawnRockEveryoneRpc(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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(4068221311u, val3, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref obj, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 4068221311u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); if (((NetworkObjectReference)(ref obj)).TryGet(ref val4, (NetworkManager)null)) { ((Component)val4).transform.SetParent(GrabPoint, true); DimensionRegistry.SetInUpsideDown(((Component)val4).gameObject, isInUpsideDown: true); } } } public void CancelGrabCoroutine() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) if (grabCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(grabCoroutine); grabCoroutine = null; rockProjectile?.ThrowFromPositionEveryoneRpc(NetworkObjectReference.op_Implicit(((EnemyAI)this).thisNetworkObject), ((Component)GrabPoint).transform.position, ((Component)this).transform.position - ((Component)GrabPoint).transform.position); rockProjectile = null; } } public void DoCarrying() { //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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) if (throwCoroutine != null) { return; } if ((Object)(object)rockProjectile == (Object)null) { lastSeenPosition = Vector3.zero; ((EnemyAI)this).SwitchToBehaviourClientRpc(1); return; } ((EnemyAI)this).agent.speed = 4f; float num = default(float); bool flag = LFCEnemyManager.TargetClosestPlayerInAnyCase((EnemyAI)(object)this, ref num, false); lastSeenPosition = ((flag && num <= 60f) ? ((Component)((EnemyAI)this).targetPlayer).transform.position : ((lastSeenPosition != Vector3.zero) ? lastSeenPosition : ((Component)this).transform.position)); if (!flag || Vector3.Distance(((Component)this).transform.position, lastSeenPosition) <= 40f || (num > 60f && !((EnemyAI)this).CheckLineOfSightForPosition(((Component)((EnemyAI)this).targetPlayer).transform.position, 45f, 60, -1f, (Transform)null))) { if (throwCoroutine == null) { throwCoroutine = ((MonoBehaviour)this).StartCoroutine(ThrowCoroutine()); } } else { ((EnemyAI)this).SetMovingTowardsTargetPlayer(((EnemyAI)this).targetPlayer); } } public IEnumerator ThrowCoroutine() { ((EnemyAI)this).agent.speed = 0f; PlaySFXEveryoneRpc(4); DoAnimationEveryoneRpc("startThrow"); yield return (object)new WaitForSeconds(0.8f); rockProjectile?.ThrowFromPositionEveryoneRpc(NetworkObjectReference.op_Implicit(((EnemyAI)this).thisNetworkObject), ((Component)GrabPoint).transform.position, lastSeenPosition + Vector3.up * 1.5f - ((Component)GrabPoint).transform.position); rockProjectile = null; yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "throw", 10f, 0); DoAnimationEveryoneRpc("startMove"); ((EnemyAI)this).SwitchToBehaviourClientRpc(1); lastSeenPosition = Vector3.zero; throwCoroutine = null; } public void CancelThrowCoroutine() { //IL_003f: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) if (throwCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(throwCoroutine); throwCoroutine = null; canGrab = true; grabTimer = 0f; rockProjectile?.ThrowFromPositionEveryoneRpc(NetworkObjectReference.op_Implicit(((EnemyAI)this).thisNetworkObject), ((Component)GrabPoint).transform.position, ((Component)this).transform.position - ((Component)GrabPoint).transform.position); rockProjectile = null; } } public UpsideDownEnemyAI SpawnEnemyForServer(EnemyType enemyType, Vector3 position, float radius) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); if (LFCEnemyManager.TryGetSafeRandomNavMeshPosition((EnemyAI)(object)this, position, radius, ref val, 15) && Random.Range(0, 100) < 75) { GameObject val2 = Object.Instantiate(enemyType.enemyPrefab, val, Quaternion.identity); NetworkObject componentInChildren = val2.GetComponentInChildren(); componentInChildren.Spawn(true); return val2.GetComponentInChildren(); } return null; } public override void OnCollideWithPlayer(Collider other) { ((EnemyAI)this).OnCollideWithPlayer(other); if (!((EnemyAI)this).isEnemyDead && ((EnemyAI)this).currentBehaviourStateIndex == 1 && swingCoroutine == null) { PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false); if (LFCUtilities.ShouldBeLocalPlayer(val)) { SwingServerRpc((int)val.playerClientId); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SwingServerRpc(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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3413558653u, val3, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3413558653u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (swingCoroutine == null) { swingCoroutine = ((MonoBehaviour)this).StartCoroutine(SwingCoroutine(playerId)); } } } public IEnumerator SwingCoroutine(int playerId) { ((EnemyAI)this).agent.speed = 0f; DoAnimationEveryoneRpc("startSwing"); PlaySFXEveryoneRpc(5); yield return (object)new WaitForSeconds(2.08f); LFCNetworkManager.Instance.DamagePlayerEveryoneRpc(playerId, 100, true, true, 8); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "swing", 10f, 0); DoAnimationEveryoneRpc("startMove"); if (StartOfRound.Instance.allPlayerObjects[playerId].GetComponent().isPlayerDead) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } swingCoroutine = null; } public void CancelSwingCoroutine() { if (swingCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(swingCoroutine); swingCoroutine = null; } } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { } public override void KillEnemy(bool destroy = false) { CancelActionsForServer(); ((EnemyAI)this).KillEnemy(destroy); } [Rpc(/*Could not decode attribute arguments.*/)] public void PlaySFXEveryoneRpc(int soundId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3835793871u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, soundId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3835793871u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (CrustapikanSounds.TryGetValue((Sound)soundId, out var value) && value.Length != 0) { ((EnemyAI)this).creatureSFX.PlayOneShot(value[Random.Range(0, value.Length)]); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void DoAnimationEveryoneRpc(string animationState) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(570486282u, val3, val, (SendTo)6, (RpcDelivery)0); bool flag = animationState != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(animationState, false); } ((NetworkBehaviour)this).__endSendRpc(ref val2, 570486282u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((EnemyAI)this).creatureAnimator.SetTrigger(animationState); } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1993170488u, new RpcReceiveHandler(__rpc_handler_1993170488), "PlayParticleEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(4068221311u, new RpcReceiveHandler(__rpc_handler_4068221311), "SpawnRockEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(3413558653u, new RpcReceiveHandler(__rpc_handler_3413558653), "SwingServerRpc"); ((NetworkBehaviour)this).__registerRpc(3835793871u, new RpcReceiveHandler(__rpc_handler_3835793871), "PlaySFXEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(570486282u, new RpcReceiveHandler(__rpc_handler_570486282), "DoAnimationEveryoneRpc"); base.__initializeRpcs(); } private static void __rpc_handler_1993170488(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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string tag = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref tag, false); } Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); Quaternion rotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation); float scaleFactor = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref scaleFactor, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrustapikanAI)(object)target).PlayParticleEveryoneRpc(tag, position, rotation, scaleFactor); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4068221311(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(ref obj, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrustapikanAI)(object)target).SpawnRockEveryoneRpc(obj); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3413558653(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrustapikanAI)(object)target).SwingServerRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3835793871(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int soundId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref soundId); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrustapikanAI)(object)target).PlaySFXEveryoneRpc(soundId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_570486282(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string animationState = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref animationState, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((CrustapikanAI)(object)target).DoAnimationEveryoneRpc(animationState); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "CrustapikanAI"; } } public class CrustapikanLarvaeAI : UpsideDownEnemyAI { public enum State { WANDERING, CHASING } public enum Sound { MOVE, GROUND, DIGIN, DIGOUT, DASH, BITE, ROAR } [Serializable] public class CrustapikanLarvaeSoundSerializableEntry : SerializableEntry { } public Transform TurnCompass; public CrustapikanLarvaeSoundSerializableEntry[] CrustapikanLarvaeSoundsEntry; public Dictionary CrustapikanLarvaeSounds; public bool isDigging; public bool isDashing; private float moveTimer; private float groundTimer; public Coroutine spawnCoroutine; public Coroutine stunCoroutine; public Coroutine dashCoroutine; public Coroutine biteCoroutine; public override void CancelActionsForServer() { if (LFCUtilities.IsServer) { CancelSpawnCoroutine(); CancelDashCoroutine(); CancelBiteCoroutine(); } } public override void ForceSend() { if (((EnemyAI)this).currentBehaviourStateIndex == 0) { CancelDashCoroutine(); ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).SetMovingTowardsTargetPlayer(syncedTarget); ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } } public override void Start() { ((EnemyAI)this).Start(); CrustapikanLarvaeSounds = LFCUtilities.ToDictionary((IEnumerable>)CrustapikanLarvaeSoundsEntry); if (spawnCoroutine == null) { spawnCoroutine = ((MonoBehaviour)this).StartCoroutine(SpawnCoroutine()); } } public IEnumerator SpawnCoroutine() { ((EnemyAI)this).agent.speed = 0f; PlaySFX(Sound.DIGOUT); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "spawn", 10f, 0); ((EnemyAI)this).agent.speed = 3f; ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).currentBehaviourStateIndex = 0; CancelSpawnCoroutine(); } public void CancelSpawnCoroutine() { if (spawnCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(spawnCoroutine); spawnCoroutine = null; } } public override void Update() { //IL_004c: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) base.Update(); if (!((EnemyAI)this).isEnemyDead && stunCoroutine == null) { PlayMoveSound(); int currentBehaviourStateIndex = ((EnemyAI)this).currentBehaviourStateIndex; if ((Object)(object)((EnemyAI)this).targetPlayer != (Object)null && currentBehaviourStateIndex == 1) { TurnCompass.LookAt(((Component)((EnemyAI)this).targetPlayer.gameplayCamera).transform.position); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(new Vector3(0f, TurnCompass.eulerAngles.y, 0f)), 4f * Time.deltaTime); } } } public void PlayMoveSound() { AnimatorClipInfo[] currentAnimatorClipInfo = ((EnemyAI)this).creatureAnimator.GetCurrentAnimatorClipInfo(0); if (currentAnimatorClipInfo.Length != 0 && ((Object)((AnimatorClipInfo)(ref currentAnimatorClipInfo[0])).clip).name.Contains("move")) { moveTimer -= Time.deltaTime; if (CrustapikanLarvaeSounds.TryGetValue(Sound.MOVE, out var value) && value.Length != 0 && moveTimer <= 0f) { ((EnemyAI)this).creatureSFX.PlayOneShot(value[Random.Range(0, value.Length)]); moveTimer = 0.5f; } } } public override void SetEnemyStunned(bool setToStunned, float setToStunTime = 0.833f, PlayerControllerB setStunnedByPlayer = null) { if (LFCUtilities.IsServer && setToStunned && stunCoroutine == null) { ((EnemyAI)this).SetEnemyStunned(setToStunned, setToStunTime, setStunnedByPlayer); stunCoroutine = ((MonoBehaviour)this).StartCoroutine(StunCoroutine()); } } public IEnumerator StunCoroutine() { CancelActionsForServer(); ((EnemyAI)this).agent.speed = 0f; DoAnimationEveryoneRpc("startStun"); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "stun", 10f, 0); while (((EnemyAI)this).stunNormalizedTimer > 0f) { yield return null; } while (((EnemyAI)this).postStunInvincibilityTimer > 0f) { yield return null; } switch (((EnemyAI)this).currentBehaviourStateIndex) { case 0: DoAnimationEveryoneRpc("startMove"); if ((Object)(object)((EnemyAI)this).stunnedByPlayer != (Object)null) { ((EnemyAI)this).targetPlayer = ((EnemyAI)this).stunnedByPlayer; ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } break; case 1: DoAnimationEveryoneRpc("startMove"); break; } stunCoroutine = null; } public override void DoAIInterval() { ((EnemyAI)this).DoAIInterval(); if (!((EnemyAI)this).isEnemyDead && !StartOfRound.Instance.allPlayersDead && stunCoroutine == null) { switch ((State)((EnemyAI)this).currentBehaviourStateIndex) { case State.WANDERING: DoWandering(); break; case State.CHASING: DoChasing(); break; } } } public void DoWandering() { if (spawnCoroutine == null) { ((EnemyAI)this).agent.speed = 3f; if (LFCEnemyManager.FoundClosestPlayerInRange((EnemyAI)(object)this, 35, 10, 60f, false)) { ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } } } public void DoChasing() { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) if (biteCoroutine != null) { return; } if (dashCoroutine == null) { ((EnemyAI)this).agent.speed = 6f; float num = default(float); if (!LFCEnemyManager.TargetClosestPlayerInAnyCase((EnemyAI)(object)this, ref num, false) || (!isSynced && num > 50f && !((EnemyAI)this).CheckLineOfSightForPosition(((Component)((EnemyAI)this).targetPlayer).transform.position, 45f, 60, -1f, (Transform)null))) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); return; } if (num >= 10f) { dashCoroutine = ((MonoBehaviour)this).StartCoroutine(DashCoroutine()); return; } } ((EnemyAI)this).SetMovingTowardsTargetPlayer(((EnemyAI)this).targetPlayer); } public IEnumerator DashCoroutine() { ((EnemyAI)this).agent.speed = 0f; DoAnimationEveryoneRpc("startRoar"); PlaySFXEveryoneRpc(6); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "roar", 10f, 0); DoAnimationEveryoneRpc("startDigIn"); PlaySFXEveryoneRpc(2); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "digin", 10f, 0); SetDiggingEveryoneRpc(enable: true); ((EnemyAI)this).agent.speed = 9f; Transform entity = (((Object)(object)((EnemyAI)this).targetPlayer != (Object)null && !((EnemyAI)this).targetPlayer.isPlayerDead) ? ((Component)((EnemyAI)this).targetPlayer).transform : null); float maxDistance = 50f; while ((Object)(object)entity != (Object)null) { float num = Vector3.Distance(((Component)this).transform.position, entity.position); if (num <= 5f || num >= maxDistance || !DimensionRegistry.AreInSameDimension(((Component)entity).gameObject, ((Component)this).gameObject)) { break; } yield return null; } ((EnemyAI)this).agent.speed = 0f; SetDiggingEveryoneRpc(enable: false); DoAnimationEveryoneRpc("startDigOut"); PlaySFXEveryoneRpc(3); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "spawn", 10f, 0); if ((Object)(object)((EnemyAI)this).targetPlayer != (Object)null && Vector3.Distance(((Component)this).transform.position, ((Component)((EnemyAI)this).targetPlayer).transform.position) <= 15f) { DoAnimationEveryoneRpc("startDash"); PlaySFXEveryoneRpc(4); isDashing = true; ((EnemyAI)this).agent.speed = 24f; ((EnemyAI)this).agent.angularSpeed = 0f; ((EnemyAI)this).agent.acceleration = 100f; Vector3 val = ((Component)((EnemyAI)this).targetPlayer).transform.position - ((Component)this).transform.position; Vector3 dashDirection = ((Vector3)(ref val)).normalized; float dashTime = 0.75f; float timer = 0f; while (timer < dashTime && isDashing) { timer += Time.deltaTime; ((EnemyAI)this).agent.velocity = dashDirection * ((EnemyAI)this).agent.speed; yield return null; } } CancelDashCoroutine(); } [Rpc(/*Could not decode attribute arguments.*/)] public void SetDiggingEveryoneRpc(bool enable) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3664175517u, val3, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref enable, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3664175517u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; isDigging = enable; ((EnemyAI)this).EnableEnemyMesh(!enable, false, false); if (enable) { ((MonoBehaviour)this).StartCoroutine(DiggingCoroutine()); } } } public IEnumerator DiggingCoroutine() { while (isDigging) { PlayGroundSound(); Vector3 position = ((Component)this).transform.position; Quaternion identity = Quaternion.identity; PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; LFCGlobalManager.PlayParticle("Lega Fusion CoreAppearFromGround1", position, identity, true, 0.075f, DimensionRegistry.IsInUpsideDown((localPlayer != null) ? ((Component)localPlayer).gameObject : null)); Vector3 position2 = ((Component)this).transform.position; Quaternion identity2 = Quaternion.identity; PlayerControllerB localPlayer2 = LFCUtilities.LocalPlayer; LFCGlobalManager.PlayParticle("Lega Fusion CoreBloodParticle", position2, identity2, true, 1f, DimensionRegistry.IsInUpsideDown((localPlayer2 != null) ? ((Component)localPlayer2).gameObject : null)); yield return null; } } public void PlayGroundSound() { groundTimer -= Time.deltaTime; if (CrustapikanLarvaeSounds.TryGetValue(Sound.GROUND, out var value) && value.Length != 0 && groundTimer <= 0f) { ((EnemyAI)this).creatureSFX.PlayOneShot(value[Random.Range(0, value.Length)]); groundTimer = 1.25f; } } public void CancelDashCoroutine() { //IL_006a: Unknown result type (might be due to invalid IL or missing references) if (dashCoroutine != null) { SetDiggingEveryoneRpc(enable: false); DoAnimationEveryoneRpc("startMove"); isDashing = false; ((MonoBehaviour)this).StopCoroutine(dashCoroutine); dashCoroutine = null; ((EnemyAI)this).agent.speed = 6f; ((EnemyAI)this).agent.angularSpeed = 120f; ((EnemyAI)this).agent.acceleration = 8f; ((EnemyAI)this).agent.velocity = Vector3.zero; } } public override void OnCollideWithPlayer(Collider other) { ((EnemyAI)this).OnCollideWithPlayer(other); if (!((EnemyAI)this).isEnemyDead && ((EnemyAI)this).currentBehaviourStateIndex == 1 && biteCoroutine == null) { PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false); if (LFCUtilities.ShouldBeLocalPlayer(val)) { OnCollideWithPlayerServerRpc((int)val.playerClientId); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void OnCollideWithPlayerServerRpc(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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1114428u, val3, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1114428u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (isDashing) { LFCNetworkManager.Instance.DamagePlayerEveryoneRpc(playerId, 20, true, true, 8); CancelDashCoroutine(); } if (dashCoroutine == null && biteCoroutine == null) { biteCoroutine = ((MonoBehaviour)this).StartCoroutine(BiteCoroutine(playerId)); } } } public IEnumerator BiteCoroutine(int playerId) { ((EnemyAI)this).agent.speed = 0f; DoAnimationEveryoneRpc("startBite"); PlaySFXEveryoneRpc(5); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "bite", 10f, 0); LFCNetworkManager.Instance.DamagePlayerEveryoneRpc(playerId, 10, true, true, 8); DoAnimationEveryoneRpc("startMove"); ((EnemyAI)this).agent.speed = 6f; biteCoroutine = null; } public void CancelBiteCoroutine() { if (biteCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(biteCoroutine); biteCoroutine = null; } } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { if (!((EnemyAI)this).isEnemyDead && dashCoroutine == null) { base.HitEnemy(force, playerWhoHit, playHitSFX, hitID); } } public override void KillEnemy(bool destroy = false) { CancelActionsForServer(); ((EnemyAI)this).KillEnemy(destroy); } [Rpc(/*Could not decode attribute arguments.*/)] public void PlaySFXEveryoneRpc(int soundId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1793023509u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, soundId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1793023509u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlaySFX((Sound)soundId); } } } public void PlaySFX(Sound enemySound) { if (CrustapikanLarvaeSounds.TryGetValue(enemySound, out var value) && value.Length != 0) { ((EnemyAI)this).creatureSFX.PlayOneShot(value[Random.Range(0, value.Length)]); } } [Rpc(/*Could not decode attribute arguments.*/)] public void DoAnimationEveryoneRpc(string animationState) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(777192765u, val3, val, (SendTo)6, (RpcDelivery)0); bool flag = animationState != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(animationState, false); } ((NetworkBehaviour)this).__endSendRpc(ref val2, 777192765u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((EnemyAI)this).creatureAnimator.SetTrigger(animationState); } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(3664175517u, new RpcReceiveHandler(__rpc_handler_3664175517), "SetDiggingEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(1114428u, new RpcReceiveHandler(__rpc_handler_1114428), "OnCollideWithPlayerServerRpc"); ((NetworkBehaviour)this).__registerRpc(1793023509u, new RpcReceiveHandler(__rpc_handler_1793023509), "PlaySFXEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(777192765u, new RpcReceiveHandler(__rpc_handler_777192765), "DoAnimationEveryoneRpc"); base.__initializeRpcs(); } private static void __rpc_handler_3664175517(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool diggingEveryoneRpc = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref diggingEveryoneRpc, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrustapikanLarvaeAI)(object)target).SetDiggingEveryoneRpc(diggingEveryoneRpc); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1114428(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrustapikanLarvaeAI)(object)target).OnCollideWithPlayerServerRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1793023509(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int soundId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref soundId); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrustapikanLarvaeAI)(object)target).PlaySFXEveryoneRpc(soundId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_777192765(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string animationState = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref animationState, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((CrustapikanLarvaeAI)(object)target).DoAnimationEveryoneRpc(animationState); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "CrustapikanLarvaeAI"; } } public abstract class DemogorgonAI : UpsideDownEnemyAI { public enum State { WANDERING, PORTALING, CHASING } public enum Sound { MOVE, GROWL, SET, DIG, CHARGE, DASH, SWING, ROAR } [Serializable] public class DemogorgonSoundSerializableEntry : SerializableEntry { } public Transform TurnCompass; public DemogorgonSoundSerializableEntry[] DemogorgonSoundsEntry; public Dictionary DemogorgonSounds; private float moveTimer; private float growlTimer; private float dashTimer; public float dashCooldown = 15f; public bool canDash; public bool isDashing; public Coroutine stunCoroutine; public Coroutine portalingCoroutine; public Coroutine dashCoroutine; public Coroutine stopDashCoroutine; public Coroutine swingCoroutine; protected UpsideDownPortal closestPortal; protected virtual bool IgnoreLoseTargetConditions => false; public override void ForceSend() { if (((EnemyAI)this).currentBehaviourStateIndex == 0) { ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).SetMovingTowardsTargetPlayer(syncedTarget); ((EnemyAI)this).SwitchToBehaviourClientRpc(2); } } public override void Start() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Start(); DemogorgonSounds = LFCUtilities.ToDictionary((IEnumerable>)DemogorgonSoundsEntry); ((EnemyAI)this).currentBehaviourStateIndex = 0; ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); MapObjectsManager.SpawnPortalsForServer(); OnDemogorgonStart(); } protected virtual void OnDemogorgonStart() { } public override void Update() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) base.Update(); if (stunCoroutine != null) { return; } PlayMoveSound(); PlayGrowlSound(); if ((Object)(object)((EnemyAI)this).targetPlayer != (Object)null) { if (((EnemyAI)this).currentBehaviourStateIndex == 2) { TurnCompass.LookAt(((Component)((EnemyAI)this).targetPlayer.gameplayCamera).transform.position); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(new Vector3(0f, TurnCompass.eulerAngles.y, 0f)), 4f * Time.deltaTime); } else { UpdateNonChasingTargetPlayer(((EnemyAI)this).targetPlayer); } } UpdateCooldowns(); } protected virtual void UpdateNonChasingTargetPlayer(PlayerControllerB player) { } protected virtual void UpdateCooldowns() { LFCUtilities.UpdateTimer(ref dashTimer, dashCooldown, !canDash, (Action)delegate { canDash = true; }); } public override void CancelActionsForServer() { if (LFCUtilities.IsServer) { CancelPortalingCoroutine(); CancelDashCoroutine(); CancelSwingCoroutine(); } } public void PlayMoveSound() { AnimatorClipInfo[] currentAnimatorClipInfo = ((EnemyAI)this).creatureAnimator.GetCurrentAnimatorClipInfo(0); if (currentAnimatorClipInfo.Length != 0 && (((Object)((AnimatorClipInfo)(ref currentAnimatorClipInfo[0])).clip).name.Contains("move") || ((Object)((AnimatorClipInfo)(ref currentAnimatorClipInfo[0])).clip).name.Contains("carry"))) { moveTimer -= Time.deltaTime; if (DemogorgonSounds.TryGetValue(Sound.MOVE, out var value) && value.Length != 0 && moveTimer <= 0f) { ((EnemyAI)this).creatureSFX.PlayOneShot(value[Random.Range(0, value.Length)]); moveTimer = 0.45f; } } } public void PlayGrowlSound() { growlTimer -= Time.deltaTime; if (DemogorgonSounds.TryGetValue(Sound.GROWL, out var value) && value.Length != 0 && growlTimer <= 0f) { ((EnemyAI)this).creatureSFX.PlayOneShot(value[Random.Range(0, value.Length)]); growlTimer = 4f; } } public override void SetEnemyStunned(bool setToStunned, float setToStunTime = 3.958f, PlayerControllerB setStunnedByPlayer = null) { if (LFCUtilities.IsServer && setToStunned && stunCoroutine == null && stopDashCoroutine == null) { ((EnemyAI)this).SetEnemyStunned(setToStunned, setToStunTime, setStunnedByPlayer); stunCoroutine = ((MonoBehaviour)this).StartCoroutine(StunCoroutine()); } } public IEnumerator StunCoroutine() { CancelActionsForServer(); ((EnemyAI)this).agent.speed = 0f; DoAnimationEveryoneRpc("startStun"); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "stun", 10f, 0); while (((EnemyAI)this).stunNormalizedTimer > 0f) { yield return null; } while (((EnemyAI)this).postStunInvincibilityTimer > 0f) { yield return null; } DoAnimationEveryoneRpc("startMove"); if (((EnemyAI)this).currentBehaviourStateIndex == 1 && ((Object)(object)((EnemyAI)this).stunnedByPlayer != (Object)null || (Object)(object)((EnemyAI)this).targetPlayer != (Object)null)) { if (!Object.op_Implicit((Object)(object)((EnemyAI)this).targetPlayer)) { ((EnemyAI)this).targetPlayer = ((EnemyAI)this).stunnedByPlayer; } closestPortal = null; ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).SwitchToBehaviourClientRpc(2); } stunCoroutine = null; } public override void DoAIInterval() { ((EnemyAI)this).DoAIInterval(); if (!((EnemyAI)this).isEnemyDead && !StartOfRound.Instance.allPlayersDead && stunCoroutine == null) { switch ((State)((EnemyAI)this).currentBehaviourStateIndex) { case State.WANDERING: DoWandering(); break; case State.PORTALING: DoPortaling(); break; case State.CHASING: DoChasing(); break; } } } public abstract void DoWandering(); public abstract void DoPortaling(); protected bool ShouldLoseTarget(float distanceWithPlayer) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)((EnemyAI)this).targetPlayer == (Object)null)) { if (!isSynced && !IgnoreLoseTargetConditions && distanceWithPlayer > 30f) { return !((EnemyAI)this).CheckLineOfSightForPosition(((Component)((EnemyAI)this).targetPlayer).transform.position, 45f, 60, -1f, (Transform)null); } return false; } return true; } public virtual void DoChasing() { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) if (swingCoroutine != null) { return; } if (dashCoroutine == null) { ((EnemyAI)this).agent.speed = 7f; if (LFCEnemyManager.TargetOutsideChasedPlayer((EnemyAI)(object)this)) { return; } if (IsFleeing() || ((Object)(object)((EnemyAI)this).targetPlayer != (Object)null && !DimensionRegistry.AreInSameDimension(((Component)this).gameObject, ((Component)((EnemyAI)this).targetPlayer).gameObject))) { ((EnemyAI)this).SwitchToBehaviourClientRpc(1); return; } float num = default(float); if (!LFCEnemyManager.TargetClosestPlayerInAnyCase((EnemyAI)(object)this, ref num, false) || ShouldLoseTarget(num)) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); return; } if (canDash && num <= 15f && num >= 3f && (Object)(object)((EnemyAI)this).targetPlayer != (Object)null && ((EnemyAI)this).CheckLineOfSightForPosition(((Component)((EnemyAI)this).targetPlayer).transform.position, 45f, 60, -1f, (Transform)null)) { canDash = false; dashCoroutine = ((MonoBehaviour)this).StartCoroutine(DashCoroutine()); return; } } ((EnemyAI)this).SetMovingTowardsTargetPlayer(((EnemyAI)this).targetPlayer); } public IEnumerator DashCoroutine() { bool firstPass = true; int nbDashes = Random.Range(1, 4); for (int i = 0; i < nbDashes; i++) { if (!firstPass && !isDashing) { continue; } firstPass = false; isDashing = false; ((EnemyAI)this).agent.speed = 0f; DoAnimationEveryoneRpc("startCharge"); PlaySFXEveryoneRpc(4); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "charge", 10f, 0); DoAnimationEveryoneRpc("startDash"); PlaySFXEveryoneRpc(5); isDashing = true; ((EnemyAI)this).agent.speed = 24f; ((EnemyAI)this).agent.angularSpeed = 0f; ((EnemyAI)this).agent.acceleration = 100f; if ((Object)(object)((EnemyAI)this).targetPlayer != (Object)null) { Vector3 val = ((Component)((EnemyAI)this).targetPlayer).transform.position - ((Component)this).transform.position; Vector3 dashDirection = ((Vector3)(ref val)).normalized; float dashTime = 0.6f; float timer = 0f; while (timer < dashTime && isDashing) { timer += Time.deltaTime; ((EnemyAI)this).agent.velocity = dashDirection * ((EnemyAI)this).agent.speed; yield return null; } } yield return (object)new WaitForSeconds(0.33f); } if (isDashing) { StopDash(); } } public virtual void StopDash(PlayerControllerB player = null) { ((EnemyAI)this).agent.speed = 0f; isDashing = false; DoAnimationEveryoneRpc("startRecover"); if (stopDashCoroutine == null) { stopDashCoroutine = ((MonoBehaviour)this).StartCoroutine(StopDashCoroutine(player)); } } public virtual IEnumerator StopDashCoroutine(PlayerControllerB player) { if ((Object)(object)player != (Object)null) { LFCNetworkManager.Instance.DamagePlayerEveryoneRpc((int)player.playerClientId, 80, true, true, 8); } PlaySFXEveryoneRpc(7); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "recover", 10f, 0); DoAnimationEveryoneRpc("startMove"); CancelDashCoroutine(); stopDashCoroutine = null; } public void CancelDashCoroutine() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) if (dashCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(dashCoroutine); dashCoroutine = null; isDashing = false; ((EnemyAI)this).agent.speed = 7f; ((EnemyAI)this).agent.angularSpeed = 120f; ((EnemyAI)this).agent.acceleration = 8f; ((EnemyAI)this).agent.velocity = Vector3.zero; } } public void CancelPortalingCoroutine() { if (portalingCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(portalingCoroutine); portalingCoroutine = null; closestPortal = null; } } public override void OnCollideWithPlayer(Collider other) { ((EnemyAI)this).OnCollideWithPlayer(other); if (((EnemyAI)this).currentBehaviourStateIndex == 2 && !IsFleeing()) { PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false); if (LFCUtilities.ShouldBeLocalPlayer(val)) { OnCollideWithPlayerServerRpc((int)val.playerClientId); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void OnCollideWithPlayerServerRpc(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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(893425162u, val3, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 893425162u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB component = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent(); if (isDashing) { StopDash(component); } if (dashCoroutine == null && swingCoroutine == null) { swingCoroutine = ((MonoBehaviour)this).StartCoroutine(SwingCoroutine(component)); } } } public IEnumerator SwingCoroutine(PlayerControllerB player) { ((EnemyAI)this).agent.speed = 0f; DoAnimationEveryoneRpc("startSwing"); PlaySFXEveryoneRpc(6); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "swing", 10f, 0); LFCNetworkManager.Instance.DamagePlayerEveryoneRpc((int)player.playerClientId, 20, true, true, 8); DoAnimationEveryoneRpc("startMove"); yield return (object)new WaitForSeconds(0.5f); ((EnemyAI)this).agent.speed = 7f; swingCoroutine = null; } public void CancelSwingCoroutine() { if (swingCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(swingCoroutine); swingCoroutine = null; } } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { if (!((EnemyAI)this).isEnemyDead && !IsFleeing()) { base.HitEnemy(force, playerWhoHit, playHitSFX, hitID); } } public override void KillEnemy(bool destroy = false) { if (DimensionRegistry.IsInUpsideDown(((Component)this).gameObject)) { CancelActionsForServer(); ((EnemyAI)this).KillEnemy(destroy); } } [Rpc(/*Could not decode attribute arguments.*/)] public void BreakDoorEveryoneRpc(NetworkObjectReference obj, Vector3 direction) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3599037694u, val3, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref obj, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref direction); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3599037694u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); if (((NetworkObjectReference)(ref obj)).TryGet(ref val4, (NetworkManager)null)) { GameObject gameObject = ((Component)((Component)val4).transform.root).gameObject; Transform transform = gameObject.transform; transform.position += direction * 0.5f; DoorProjectile doorProjectile = gameObject.GetComponent() ?? gameObject.AddComponent(); doorProjectile.Initialize(); doorProjectile.Throw(direction, 20f, isLastThrow: true); AnimatedObjectTrigger val5 = default(AnimatedObjectTrigger); if (LFCUtilities.TryGetComponentInChildren(((Component)val4).gameObject, ref val5)) { val5.PlayAudio(val5.boolValue, true); } } } public bool IsFleeing() { if (!DimensionRegistry.IsInUpsideDown(((Component)this).gameObject)) { return ((EnemyAI)this).enemyHP <= 5; } return false; } [Rpc(/*Could not decode attribute arguments.*/)] public void RestoreEnemyHealthEveryoneRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3893804584u, val3, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3893804584u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((EnemyAI)this).enemyHP = 10; } } } [Rpc(/*Could not decode attribute arguments.*/)] public void PlaySFXEveryoneRpc(int soundId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2641337311u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, soundId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2641337311u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (DemogorgonSounds.TryGetValue((Sound)soundId, out var value) && value.Length != 0) { ((EnemyAI)this).creatureSFX.PlayOneShot(value[Random.Range(0, value.Length)]); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void DoAnimationEveryoneRpc(string animationState) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1630148796u, val3, val, (SendTo)6, (RpcDelivery)0); bool flag = animationState != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(animationState, false); } ((NetworkBehaviour)this).__endSendRpc(ref val2, 1630148796u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((EnemyAI)this).creatureAnimator.SetTrigger(animationState); } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(893425162u, new RpcReceiveHandler(__rpc_handler_893425162), "OnCollideWithPlayerServerRpc"); ((NetworkBehaviour)this).__registerRpc(3599037694u, new RpcReceiveHandler(__rpc_handler_3599037694), "BreakDoorEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(3893804584u, new RpcReceiveHandler(__rpc_handler_3893804584), "RestoreEnemyHealthEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(2641337311u, new RpcReceiveHandler(__rpc_handler_2641337311), "PlaySFXEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(1630148796u, new RpcReceiveHandler(__rpc_handler_1630148796), "DoAnimationEveryoneRpc"); base.__initializeRpcs(); } private static void __rpc_handler_893425162(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((DemogorgonAI)(object)target).OnCollideWithPlayerServerRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3599037694(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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference obj = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref obj, default(ForNetworkSerializable)); Vector3 direction = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref direction); target.__rpc_exec_stage = (__RpcExecStage)1; ((DemogorgonAI)(object)target).BreakDoorEveryoneRpc(obj, direction); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3893804584(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((DemogorgonAI)(object)target).RestoreEnemyHealthEveryoneRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2641337311(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int soundId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref soundId); target.__rpc_exec_stage = (__RpcExecStage)1; ((DemogorgonAI)(object)target).PlaySFXEveryoneRpc(soundId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1630148796(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string animationState = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref animationState, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((DemogorgonAI)(object)target).DoAnimationEveryoneRpc(animationState); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "DemogorgonAI"; } } public class DemogorgonHunterAI : DemogorgonAI { public AudioClip ScreamSound; private float setTimer = 30f; private float huntTimer; public float setCooldown = 60f; public float huntDuration = 30f; public bool canSet; public bool isHunting; public Coroutine setCoroutine; protected override bool IgnoreLoseTargetConditions => isHunting; protected override void UpdateCooldowns() { base.UpdateCooldowns(); LFCUtilities.UpdateTimer(ref setTimer, setCooldown, !canSet, (Action)delegate { canSet = true; }); LFCUtilities.UpdateTimer(ref huntTimer, huntDuration, isHunting, (Action)delegate { isHunting = false; }); } public override void CancelActionsForServer() { base.CancelActionsForServer(); if (LFCUtilities.IsServer) { CancelSetCoroutine(); } } public override void DoWandering() { if (setCoroutine == null) { ((EnemyAI)this).agent.speed = 4f; if (LFCEnemyManager.FoundClosestPlayerInRange((EnemyAI)(object)this, 25, 10, 60f, false)) { ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).SwitchToBehaviourClientRpc(2); } else if (DimensionRegistry.IsInUpsideDown(((Component)this).gameObject)) { ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } } } public IEnumerator SetCoroutine(PlayerControllerB player) { ((EnemyAI)this).agent.speed = 0f; DoAnimationEveryoneRpc("startSetIn"); PlaySFXEveryoneRpc(2); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "setin", 10f, 0); DoAnimationEveryoneRpc("startSet"); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "set", 10f, 0); UpsideDownPortal upsideDownPortal = MapObjectsManager.SpawnPortalForServer(((Component)this).transform.position, ((EnemyAI)this).isOutside, isFake: true); DoAnimationEveryoneRpc("startSetOut"); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "setout", 10f, 0); closestPortal = MapObjectsManager.GetClosestPortal(((Component)player).transform.position); yield return DigCoroutine(DimensionRegistry.IsInUpsideDown(((Component)player).gameObject)); ((EnemyAI)this).targetPlayer = player; Object.Destroy((Object)(object)((Component)upsideDownPortal).gameObject); DoAnimationEveryoneRpc("startMove"); ((EnemyAI)this).SwitchToBehaviourClientRpc(2); setCoroutine = null; } public void CancelSetCoroutine() { if (setCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(setCoroutine); setCoroutine = null; closestPortal = null; canSet = true; setTimer = 0f; } } public override void DoPortaling() { //IL_0051: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) if (portalingCoroutine != null) { return; } ((EnemyAI)this).agent.speed = 7f; if (!IsFleeing() && LFCEnemyManager.FoundClosestPlayerInRange((EnemyAI)(object)this, 25, 10, 60f, false)) { closestPortal = null; ((EnemyAI)this).SwitchToBehaviourClientRpc(2); return; } if (closestPortal == null) { closestPortal = MapObjectsManager.GetClosestPortal(((Component)this).transform.position); } if ((Object)(object)closestPortal == (Object)null) { ((EnemyAI)this).SwitchToBehaviourClientRpc(2); } else if (Vector3.Distance(((Component)this).transform.position, ((Component)closestPortal).transform.position) <= 1f) { if (portalingCoroutine == null) { portalingCoroutine = ((MonoBehaviour)this).StartCoroutine(PortalingCoroutine(!DimensionRegistry.IsInUpsideDown(((Component)this).gameObject))); } } else { ((EnemyAI)this).SetDestinationToPosition(((Component)closestPortal).transform.position, false); } } public IEnumerator PortalingCoroutine(bool isInUpsideDown) { ((EnemyAI)this).agent.speed = 0f; yield return DigCoroutine(isInUpsideDown); DoAnimationEveryoneRpc("startMove"); float distanceWithPlayer = default(float); if (!LFCEnemyManager.TargetClosestPlayerInAnyCase((EnemyAI)(object)this, ref distanceWithPlayer, false) || ShouldLoseTarget(distanceWithPlayer)) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } else { ((EnemyAI)this).SwitchToBehaviourClientRpc(2); } portalingCoroutine = null; } public IEnumerator DigCoroutine(bool isInUpsideDown) { DoAnimationEveryoneRpc("startDig"); PlaySFXEveryoneRpc(3); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "dig", 10f, 0); DoAnimationEveryoneRpc("startDigIn"); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "digin", 10f, 0); LFCNetworkManager.Instance.TeleportEnemyEveryoneRpc(NetworkObjectReference.op_Implicit(((EnemyAI)this).thisNetworkObject), ((Component)closestPortal).transform.position, closestPortal.isOutside); if (DimensionRegistry.IsInUpsideDown(((Component)this).gameObject) != isInUpsideDown) { StrangerThingsNetworkManager.Instance.SetGObjectInUpsideDownEveryoneRpc(NetworkObjectReference.op_Implicit(((EnemyAI)this).thisNetworkObject), isInUpsideDown); if (isInUpsideDown) { RestoreEnemyHealthEveryoneRpc(); } } DoAnimationEveryoneRpc("startDigOut"); if (isHunting) { PlayScreamAudioEveryoneRpc(); } yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "digout", 10f, 0); closestPortal = null; } [Rpc(/*Could not decode attribute arguments.*/)] public void PlayScreamAudioEveryoneRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Expected O, but got Unknown //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2849937270u, val3, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2849937270u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if ((Object)(object)LFCUtilities.LocalPlayer != (Object)null) { GameObject val4 = new GameObject("ScreamAudio"); val4.transform.parent = ((Component)LFCUtilities.LocalPlayer).transform; val4.transform.localPosition = Vector3.forward * 160f; AudioSource val5 = val4.AddComponent(); val5.clip = ScreamSound; val5.spatialBlend = 1f; val5.minDistance = 10f; val5.maxDistance = 200f; val5.rolloffMode = (AudioRolloffMode)1; val5.Play(); Object.Destroy((Object)(object)val4, ScreamSound.length); } } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2849937270u, new RpcReceiveHandler(__rpc_handler_2849937270), "PlayScreamAudioEveryoneRpc"); base.__initializeRpcs(); } private static void __rpc_handler_2849937270(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((DemogorgonHunterAI)(object)target).PlayScreamAudioEveryoneRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "DemogorgonHunterAI"; } } public class DemogorgonKidnapperAI : DemogorgonAI { public Transform GrabPoint; public Transform CameraPivot; public Camera Camera; public Camera PlayerCamera; public Coroutine setCoroutine; public Coroutine dropCoroutine; protected UpsideDownPortal openedPortal; protected PlayerControllerB carriedPlayer; protected DeadBodyInfo fakeBody; protected override void OnDemogorgonStart() { PlayerCamera = LFCUtilities.LocalPlayer?.gameplayCamera; } protected override void UpdateNonChasingTargetPlayer(PlayerControllerB player) { //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) if (((Behaviour)Camera).enabled && (Object)(object)Camera == (Object)(object)player.gameplayCamera && LFCUtilities.ShouldBeLocalPlayer(player)) { MovementActions movement = player.playerActions.Movement; Vector2 val = ((MovementActions)(ref movement)).Look.ReadValue() * (float)IngamePlayerSettings.Instance.settings.lookSensitivity * 0.008f; CameraPivot.Rotate(new Vector3(0f, val.x, 0f)); float num = CameraPivot.localEulerAngles.x - val.y; num = ((num > 180f) ? (num - 360f) : num); num = Mathf.Clamp(num, -45f, 45f); CameraPivot.localEulerAngles = new Vector3(num, CameraPivot.localEulerAngles.y, 0f); } if ((Object)(object)player == (Object)(object)carriedPlayer) { ((Component)player).transform.position = ((Component)this).transform.position; } } public override void CancelActionsForServer() { base.CancelActionsForServer(); if (LFCUtilities.IsServer) { CancelSetCoroutine(); CancelDropCoroutine(); } } public override void DoWandering() { if (setCoroutine != null) { return; } ((EnemyAI)this).agent.speed = 4f; if (LFCEnemyManager.FoundClosestPlayerInRange((EnemyAI)(object)this, 25, 10, 60f, false)) { ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).SwitchToBehaviourClientRpc(2); return; } if (!DimensionRegistry.IsInUpsideDown(((Component)this).gameObject)) { ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).SwitchToBehaviourClientRpc(1); return; } PlayerControllerB val = CheckForNormalWorldPlayer(); if ((Object)(object)val != (Object)null && !DimensionRegistry.IsInUpsideDown(((Component)val).gameObject)) { ((EnemyAI)this).targetPlayer = val; ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); if (setCoroutine == null) { setCoroutine = ((MonoBehaviour)this).StartCoroutine(SetCoroutine()); } } } public PlayerControllerB CheckForNormalWorldPlayer() { //IL_0025: 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) PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (((EnemyAI)this).PlayerIsTargetable(val, false, false, true) && Vector3.Distance(((Component)val).transform.position, ((Component)this).transform.position) < 15f) { return val; } } return null; } public IEnumerator SetCoroutine() { ((EnemyAI)this).agent.speed = 0f; DoAnimationEveryoneRpc("startSetIn"); PlaySFXEveryoneRpc(2); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "setin", 10f, 0); DoAnimationEveryoneRpc("startSet"); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "set", 10f, 0); openedPortal = MapObjectsManager.SpawnPortalForServer(((Component)this).transform.position, ((EnemyAI)this).isOutside, isFake: true); DoAnimationEveryoneRpc("startSetOut"); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "setout", 10f, 0); yield return DigCoroutine(DimensionRegistry.IsInUpsideDown(((Component)((EnemyAI)this).targetPlayer).gameObject), openedPortal); DoAnimationEveryoneRpc("startMove"); ((EnemyAI)this).SwitchToBehaviourClientRpc(2); setCoroutine = null; } public void CancelSetCoroutine() { if (setCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(setCoroutine); setCoroutine = null; closestPortal = null; } } public override void DoPortaling() { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) if (dropCoroutine != null || portalingCoroutine != null) { return; } ((EnemyAI)this).agent.speed = 7f; if (!IsFleeing() && (Object)(object)carriedPlayer == (Object)null && LFCEnemyManager.FoundClosestPlayerInRange((EnemyAI)(object)this, 25, 10, 60f, false)) { closestPortal = null; ((EnemyAI)this).SwitchToBehaviourClientRpc(2); return; } if (closestPortal == null) { closestPortal = openedPortal ?? MapObjectsManager.GetClosestPortal(((Component)this).transform.position); } if ((Object)(object)closestPortal == (Object)null) { ((EnemyAI)this).SwitchToBehaviourClientRpc(2); } else if (closestPortal.isOutside != ((EnemyAI)this).isOutside) { LFCEnemyManager.GoTowardsEntrance((EnemyAI)(object)this); } else if (Vector3.Distance(((Component)this).transform.position, ((Component)closestPortal).transform.position) <= 1f) { if ((Object)(object)carriedPlayer != (Object)null) { if (dropCoroutine == null) { dropCoroutine = ((MonoBehaviour)this).StartCoroutine(DropCoroutine(carriedPlayer)); } } else if (portalingCoroutine == null) { portalingCoroutine = ((MonoBehaviour)this).StartCoroutine(PortalingCoroutine(!DimensionRegistry.IsInUpsideDown(((Component)this).gameObject))); } } else { ((EnemyAI)this).SetDestinationToPosition(((Component)closestPortal).transform.position, false); } } public IEnumerator DropCoroutine(PlayerControllerB player) { ((EnemyAI)this).agent.speed = 0f; DoAnimationEveryoneRpc("startDrop"); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "drop", 10f, 0); DropPlayerEveryoneRpc((int)player.playerClientId); yield return DigCoroutine(isInUpsideDown: true, closestPortal); ((EnemyAI)this).targetPlayer = player; DoAnimationEveryoneRpc("startMove"); ((EnemyAI)this).SwitchToBehaviourClientRpc(2); if ((Object)(object)openedPortal != (Object)null) { Object.Destroy((Object)(object)((Component)openedPortal).gameObject); openedPortal = null; } dropCoroutine = null; } public void CancelDropCoroutine() { if (dropCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(dropCoroutine); dropCoroutine = null; } if ((Object)(object)carriedPlayer != (Object)null) { DropPlayerEveryoneRpc((int)carriedPlayer.playerClientId, isInUpsideDown: false); } } [Rpc(/*Could not decode attribute arguments.*/)] public void DropPlayerEveryoneRpc(int playerId, bool isInUpsideDown = true) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1507312492u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isInUpsideDown, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1507312492u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB component = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent(); carriedPlayer = null; if (!component.isPlayerDead) { LFCVisibilityRegistry.Restore(((Component)component).gameObject, "Stranger ThingsDemogorgon"); component.inSpecialInteractAnimation = false; component.inAnimationWithEnemy = null; component.ResetZAndXRotation(); if (LFCUtilities.ShouldBeLocalPlayer(component)) { if ((Object)(object)Camera != (Object)null) { ((Behaviour)Camera).enabled = false; } component.gameplayCamera = PlayerCamera; } if (LFCUtilities.IsServer) { LFCNetworkManager.Instance.TeleportPlayerEveryoneRpc((int)component.playerClientId, ((Component)this).transform.position, false, false, !((EnemyAI)this).isOutside, false, 0f, false); if (isInUpsideDown) { CorruptPortalForServer(component); } } } if ((Object)(object)fakeBody != (Object)null) { fakeBody.attachedTo = null; fakeBody.attachedLimb = null; fakeBody.matchPositionExactly = false; Object.Destroy((Object)(object)((Component)fakeBody).gameObject, 0.1f); fakeBody = null; } } public void CorruptPortalForServer(PlayerControllerB player) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) HashSet upsideDownPortals = MapObjectsManager.GetUpsideDownPortals(); if (upsideDownPortals.Count != 0) { UpsideDownPortal furthestPortal = MapObjectsManager.GetFurthestPortal(((Component)player).transform.position); furthestPortal.CorruptPortalForServer(player); } } public IEnumerator PortalingCoroutine(bool isInUpsideDown) { ((EnemyAI)this).agent.speed = 0f; yield return DigCoroutine(isInUpsideDown, closestPortal); DoAnimationEveryoneRpc("startMove"); float distanceWithPlayer = default(float); if (!LFCEnemyManager.TargetClosestPlayerInAnyCase((EnemyAI)(object)this, ref distanceWithPlayer, false) || ShouldLoseTarget(distanceWithPlayer)) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } else { ((EnemyAI)this).SwitchToBehaviourClientRpc(2); } if ((Object)(object)openedPortal != (Object)null) { Object.Destroy((Object)(object)((Component)openedPortal).gameObject); openedPortal = null; } portalingCoroutine = null; } public IEnumerator DigCoroutine(bool isInUpsideDown, UpsideDownPortal targetedPortal) { DoAnimationEveryoneRpc("startDig"); PlaySFXEveryoneRpc(3); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "dig", 10f, 0); DoAnimationEveryoneRpc("startDigIn"); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "digin", 10f, 0); LFCNetworkManager.Instance.TeleportEnemyEveryoneRpc(NetworkObjectReference.op_Implicit(((EnemyAI)this).thisNetworkObject), ((Component)targetedPortal).transform.position, targetedPortal.isOutside); if (DimensionRegistry.IsInUpsideDown(((Component)this).gameObject) != isInUpsideDown) { StrangerThingsNetworkManager.Instance.SetGObjectInUpsideDownEveryoneRpc(NetworkObjectReference.op_Implicit(((EnemyAI)this).thisNetworkObject), isInUpsideDown); if (isInUpsideDown) { RestoreEnemyHealthEveryoneRpc(); } } DoAnimationEveryoneRpc("startDigOut"); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "digout", 10f, 0); closestPortal = null; } public override void StopDash(PlayerControllerB player = null) { ((EnemyAI)this).agent.speed = 0f; isDashing = false; DoAnimationEveryoneRpc(((Object)(object)player == (Object)null || DimensionRegistry.IsInUpsideDown(((Component)this).gameObject)) ? "startRecover" : "startGrab"); if (stopDashCoroutine == null) { stopDashCoroutine = ((MonoBehaviour)this).StartCoroutine(StopDashCoroutine(player)); } } public override IEnumerator StopDashCoroutine(PlayerControllerB player) { if ((Object)(object)player == (Object)null || DimensionRegistry.IsInUpsideDown(((Component)this).gameObject)) { if ((Object)(object)player != (Object)null) { LFCNetworkManager.Instance.DamagePlayerEveryoneRpc((int)player.playerClientId, 80, true, true, 8); } PlaySFXEveryoneRpc(7); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "recover", 10f, 0); DoAnimationEveryoneRpc("startMove"); } else { GrabPlayerEveryoneRpc((int)player.playerClientId); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "grab", 10f, 0); DoAnimationEveryoneRpc("startCarry"); } if ((Object)(object)carriedPlayer != (Object)null) { ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } CancelDashCoroutine(); stopDashCoroutine = null; } [Rpc(/*Could not decode attribute arguments.*/)] public void GrabPlayerEveryoneRpc(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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0146: 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_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1989075469u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1989075469u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB val4 = (carriedPlayer = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent()); if (val4.inSpecialInteractAnimation && (Object)(object)val4.currentTriggerInAnimationWith != (Object)null) { val4.currentTriggerInAnimationWith.CancelAnimationExternally(); } val4.isCrouching = false; val4.playerBodyAnimator.SetBool("crouching", false); val4.inSpecialInteractAnimation = true; val4.inAnimationWithEnemy = (EnemyAI)(object)this; val4.isInElevator = false; val4.isInHangarShipRoom = false; val4.ResetZAndXRotation(); val4.DropAllHeldItems(true, false, false, false, default(Vector3), default(Vector3), default(Vector3), default(Vector3), default(Vector3)); LFCVisibilityRegistry.Hide(((Component)val4).gameObject, "Stranger ThingsDemogorgon"); GameObject val5 = Object.Instantiate(StartOfRound.Instance.playerRagdolls[0], GrabPoint.position, GrabPoint.rotation); Vector3 localScale = val5.transform.localScale; val5.transform.SetParent(GrabPoint, true); fakeBody = val5.GetComponent(); fakeBody.playerObjectId = playerId; fakeBody.attachedTo = GrabPoint; fakeBody.attachedLimb = fakeBody.bodyParts[5]; fakeBody.matchPositionExactly = false; fakeBody.seenByLocalPlayer = true; Vector3 val6 = default(Vector3); ((Vector3)(ref val6))..ctor(1f / GrabPoint.lossyScale.x, 1f / GrabPoint.lossyScale.y, 1f / GrabPoint.lossyScale.z); val5.transform.localScale = new Vector3(localScale.x * val6.x, localScale.y * val6.y, localScale.z * val6.z); ScanNodeProperties val7 = default(ScanNodeProperties); Collider val8 = default(Collider); if (LFCUtilities.TryGetComponentInChildren(((Component)fakeBody).gameObject, ref val7) && ((Component)val7).TryGetComponent(ref val8)) { val8.enabled = false; } if (LFCUtilities.ShouldBeLocalPlayer(val4) && (Object)(object)Camera != (Object)null) { if ((Object)(object)PlayerCamera == (Object)null) { PlayerCamera = val4.gameplayCamera; } ((Behaviour)Camera).enabled = true; val4.gameplayCamera = Camera; } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1507312492u, new RpcReceiveHandler(__rpc_handler_1507312492), "DropPlayerEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(1989075469u, new RpcReceiveHandler(__rpc_handler_1989075469), "GrabPlayerEveryoneRpc"); base.__initializeRpcs(); } private static void __rpc_handler_1507312492(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); bool isInUpsideDown = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isInUpsideDown, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((DemogorgonKidnapperAI)(object)target).DropPlayerEveryoneRpc(playerId, isInUpsideDown); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1989075469(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((DemogorgonKidnapperAI)(object)target).GrabPlayerEveryoneRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "DemogorgonKidnapperAI"; } } public class HenryAI : EnemyAI { public enum State { WANDERING, CHASING } public enum Sound { MOVE, GRAB, THROW, SWING, DEATH } public enum Voice { DETECT, ANGRY, FOCUS } [Serializable] public class HenrySoundSerializableEntry : SerializableEntry { } [Serializable] public class HenryVoiceSerializableEntry : SerializableEntry { } public Transform TurnCompass; public Transform DoorGrabPoint; public HenrySoundSerializableEntry[] HenrySoundsEntry; public HenryVoiceSerializableEntry[] HenryVoicesEntry; public Dictionary HenrySounds; public Dictionary HenryVoices; private float moveTimer; private float speakTimer = 5f; private float doorGrabTimer; private float treeGrabTimer; private float rockGrabTimer; private float pebbleGrabTimer; private float doorThrowTimer; public float speakCooldown = 5f; public float doorGrabCooldown = 20f; public float treeGrabCooldown = 20f; public float rockGrabCooldown = 10f; public float pebbleGrabCooldown = 10f; public float doorThrowCooldown = 30f; protected bool hasDoor; protected bool canSpeak; protected bool canDoorGrab; protected bool canTreeGrab; protected bool canRockGrab; protected bool canPebbleGrab; protected bool canDoorThrow; public Coroutine openShipDoorCoroutine; public Coroutine grabCoroutine; public Coroutine throwCoroutine; public Coroutine swingCoroutine; public Coroutine stopShipCoroutine; public Coroutine killCoroutine; protected DoorProjectile doorProjectile; protected PebbleProjectile[] pebbleProjectiles = new PebbleProjectile[6]; protected HangarShipDoor shipDoor; protected ElevenPop elevenPop; private readonly int interactableObjectsMask = 1073742656; private readonly Collider[] overlapBuffer = (Collider[])(object)new Collider[64]; public override void Start() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Start(); HenrySounds = LFCUtilities.ToDictionary((IEnumerable>)HenrySoundsEntry); HenryVoices = LFCUtilities.ToDictionary((IEnumerable>)HenryVoicesEntry); shipDoor = Object.FindObjectOfType(); base.currentBehaviourStateIndex = 0; ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); if (LFCUtilities.IsServer) { elevenPop = LFCObjectsManager.SpawnNewObject(StrangerThings.ElevenPopItem, 200, 300) as ElevenPop; MapObjectsManager.SpawnPortalsForServer(); } } public override void Update() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Update(); if (!base.isEnemyDead && stopShipCoroutine == null && killCoroutine == null) { PlayMoveSound(); int currentBehaviourStateIndex = base.currentBehaviourStateIndex; if ((Object)(object)base.targetPlayer != (Object)null && currentBehaviourStateIndex == 1) { TurnCompass.LookAt(((Component)base.targetPlayer.gameplayCamera).transform.position); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(new Vector3(0f, TurnCompass.eulerAngles.y, 0f)), 4f * Time.deltaTime); } LFCUtilities.UpdateTimer(ref speakTimer, speakCooldown, !canSpeak, (Action)delegate { canSpeak = true; }); LFCUtilities.UpdateTimer(ref doorGrabTimer, doorGrabCooldown, !canDoorGrab && !hasDoor, (Action)delegate { canDoorGrab = true; }); LFCUtilities.UpdateTimer(ref rockGrabTimer, rockGrabCooldown, !canRockGrab && !hasDoor, (Action)delegate { canRockGrab = true; }); LFCUtilities.UpdateTimer(ref pebbleGrabTimer, pebbleGrabCooldown, !canPebbleGrab && !hasDoor, (Action)delegate { canPebbleGrab = true; }); LFCUtilities.UpdateTimer(ref treeGrabTimer, treeGrabCooldown, !canTreeGrab, (Action)delegate { canTreeGrab = true; }); LFCUtilities.UpdateTimer(ref doorThrowTimer, doorThrowCooldown, !canDoorThrow && hasDoor, (Action)delegate { canDoorThrow = true; }); } } public void PlayMoveSound() { AnimatorClipInfo[] currentAnimatorClipInfo = base.creatureAnimator.GetCurrentAnimatorClipInfo(0); if (currentAnimatorClipInfo.Length != 0 && ((Object)((AnimatorClipInfo)(ref currentAnimatorClipInfo[0])).clip).name.Contains("move")) { moveTimer -= Time.deltaTime; if (HenrySounds.TryGetValue(Sound.MOVE, out var value) && value.Length != 0 && moveTimer <= 0f) { base.creatureSFX.PlayOneShot(value[Random.Range(0, value.Length)]); moveTimer = 1.25f; } } } public override void DoAIInterval() { ((EnemyAI)this).DoAIInterval(); if (!base.isEnemyDead && stopShipCoroutine == null && killCoroutine == null && !StartOfRound.Instance.allPlayersDead) { switch ((State)base.currentBehaviourStateIndex) { case State.WANDERING: DoWandering(); break; case State.CHASING: DoChasing(); break; } } } public void DoWandering() { base.agent.speed = 4f; if (LFCEnemyManager.FoundClosestPlayerInRange((EnemyAI)(object)this, 35, 10, 60f, false)) { ((EnemyAI)this).StopSearch(base.currentSearch, true); PlayVoiceServerRpc(0); ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } } public void DoChasing() { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) if (swingCoroutine != null || openShipDoorCoroutine != null || grabCoroutine != null || throwCoroutine != null) { return; } base.agent.speed = 6f; if (LFCEnemyManager.TargetOutsideChasedPlayer((EnemyAI)(object)this)) { return; } if (StartOfRound.Instance.hangarDoorsClosed) { Bounds bounds = StartOfRound.Instance.shipStrictInnerRoomBounds.bounds; if (((Bounds)(ref bounds)).Contains(base.destination)) { OpenShipDoorEveryoneRpc(); return; } } float num = default(float); bool flag = LFCEnemyManager.TargetClosestPlayerInAnyCase((EnemyAI)(object)this, ref num, false); bool flag2 = flag && ((EnemyAI)this).CheckLineOfSightForPosition(((Component)base.targetPlayer).transform.position, 45f, 60, -1f, (Transform)null); if (!flag || (num > 50f && !flag2)) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); return; } if (canDoorGrab && !hasDoor) { DoorLock val = FindDoorForGrab(); if ((Object)(object)val != (Object)null) { canDoorGrab = false; if (grabCoroutine == null) { grabCoroutine = ((MonoBehaviour)this).StartCoroutine(GrabDoorCoroutine(((Component)((Component)val).transform.root).gameObject)); } return; } } if (flag2 && canDoorThrow && hasDoor && num < 10f) { canDoorThrow = false; if (throwCoroutine == null) { throwCoroutine = ((MonoBehaviour)this).StartCoroutine(ThrowDoorCoroutine()); } return; } if (canTreeGrab) { GameObject val2 = FindTreeForGrab(); if ((Object)(object)val2 != (Object)null) { canTreeGrab = false; if (grabCoroutine == null) { grabCoroutine = ((MonoBehaviour)this).StartCoroutine(GrabTreeCoroutine(val2)); } return; } } if (canPebbleGrab && !base.isOutside) { GameObject[] array = SpawnPebblesForGrab(); if (array != null && array.Any((GameObject p) => (Object)(object)p != (Object)null)) { canPebbleGrab = false; NetworkObjectReference[] pebblesObjs = array.Select((GameObject p) => (NetworkObjectReference)((!((Object)(object)p != (Object)null)) ? default(NetworkObjectReference) : NetworkObjectReference.op_Implicit(p.GetComponent()))).ToArray(); if (grabCoroutine == null) { grabCoroutine = ((MonoBehaviour)this).StartCoroutine(GrabPebblesCoroutine(pebblesObjs)); } return; } } if (canRockGrab && base.isOutside && !base.targetPlayer.isInElevator && !base.targetPlayer.isInHangarShipRoom) { GameObject[] array2 = SpawnRocksForGrab(); if (array2 != null && array2.Any((GameObject r) => (Object)(object)r != (Object)null)) { canRockGrab = false; RockProjectile[] rockProjectiles = (from r in array2 where (Object)(object)r != (Object)null select r.GetComponent()).ToArray(); if (grabCoroutine == null) { grabCoroutine = ((MonoBehaviour)this).StartCoroutine(GrabRocksCoroutine(rockProjectiles)); } return; } } ((EnemyAI)this).SetMovingTowardsTargetPlayer(base.targetPlayer); IEnumerator ThrowDoorCoroutine() { int i; for (i = 0; i < 2; i++) { yield return ThrowCoroutine(delegate { ThrowDoorEveryoneRpc((int)base.targetPlayer.playerClientId, i == 1); }); if (i != 1) { yield return (object)new WaitForSeconds(0.3f); } } } } [Rpc(/*Could not decode attribute arguments.*/)] public void OpenShipDoorEveryoneRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2085476083u, val3, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2085476083u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (openShipDoorCoroutine == null) { openShipDoorCoroutine = ((MonoBehaviour)this).StartCoroutine(OpenShipDoorCoroutine()); } } } public IEnumerator OpenShipDoorCoroutine() { base.agent.speed = 0f; base.creatureAnimator.SetTrigger("startGrab"); PlaySFX(Sound.GRAB); shipDoor.shipDoorsAnimator.SetBool("PryingOpenDoor", true); shipDoor.shipDoorsAnimator.SetFloat("pryOpenDoor", 0f); if (LFCUtilities.LocalPlayer.isInElevator || LFCUtilities.LocalPlayer.isInHangarShipRoom) { HUDManager.Instance.ShakeCamera((ScreenShakeType)3); } StartOfRound.Instance.shipDoorAudioSource.PlayOneShot(StartOfRound.Instance.alarmSFX); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "grab", (Action)delegate(float progress) { shipDoor.shipDoorsAnimator.SetFloat("pryOpenDoor", progress); }, 10f, 0); shipDoor.shipDoorsAnimator.SetBool("Closed", false); StartOfRound.Instance.SetShipDoorsClosed(false); StartOfRound.Instance.SetShipDoorsOverheatLocalClient(); shipDoor.doorPower = 0f; shipDoor.shipDoorsAnimator.SetBool("PryingOpenDoor", false); base.creatureAnimator.SetTrigger("startMove"); PlayVoice(Voice.ANGRY); openShipDoorCoroutine = null; } public DoorLock FindDoorForGrab() { //IL_000e: 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_006b: 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) DoorLock result = null; float num = float.MaxValue; int num2 = Physics.OverlapSphereNonAlloc(((Component)this).transform.position, 20f, overlapBuffer, interactableObjectsMask); DoorLock val = default(DoorLock); for (int i = 0; i < num2; i++) { if (LFCUtilities.TryGetComponentInParent(((Component)overlapBuffer[i]).gameObject, ref val) && ((EnemyAI)this).CheckLineOfSightForPosition(((Component)val).transform.position, 120f, 20, 5f, (Transform)null)) { float num3 = Vector3.Distance(((Component)this).transform.position, ((Component)val).transform.position); if (num3 < num) { num = num3; result = val; } } } return result; } public GameObject FindTreeForGrab() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) GameObject result = null; float num = float.MaxValue; foreach (GameObject tree in LFCTreesRegistry.GetTrees()) { if (tree.activeSelf) { float num2 = Vector3.Distance(((Component)base.targetPlayer).transform.position, tree.transform.position); if (num2 < 15f && num2 < num) { num = num2; result = tree; } } } return result; } public GameObject[] SpawnPebblesForGrab() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) GameObject[] array = (GameObject[])(object)new GameObject[3]; float num = Random.Range(0f, 120f); for (int i = 0; i < 3; i++) { float angle = num + (float)i * 120f + Random.Range(-20f, 20f); float radius = Random.Range(6f, 12f); if (TryGetPositionAroundPlayer(angle, radius, out var position)) { array[i] = Object.Instantiate(StrangerThings.PebbleProjectileObj, position, Quaternion.identity); array[i].GetComponent().Spawn(false); } } return array; } public GameObject[] SpawnRocksForGrab() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) GameObject[] array = (GameObject[])(object)new GameObject[2]; float num = Random.Range(0f, 120f); for (int i = 0; i < 2; i++) { float angle = num + (float)i * 180f + Random.Range(-20f, 20f); float radius = Random.Range(10f, 12f); if (TryGetPositionAroundPlayer(angle, radius, out var position)) { array[i] = Object.Instantiate(StrangerThings.RockProjectileObj, position, Quaternion.identity); array[i].GetComponent().Spawn(false); } } return array; } public bool TryGetPositionAroundPlayer(float angle, float radius, out Vector3 position) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) position = ((Component)base.targetPlayer).transform.position + new Vector3(Mathf.Cos(angle * (MathF.PI / 180f)) * radius, 0f, Mathf.Sin(angle * (MathF.PI / 180f)) * radius); Vector3 val = position + Vector3.up - base.targetPlayer.playerEye.position; Vector3 normalized = ((Vector3)(ref val)).normalized; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(base.targetPlayer.playerEye.position, normalized, ref val2, radius, StartOfRound.Instance.collidersAndRoomMaskAndDefault)) { position = ((RaycastHit)(ref val2)).point - normalized * 0.4f; } RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(position + Vector3.up * 2f, Vector3.down, ref val3, 5f, StartOfRound.Instance.collidersAndRoomMaskAndDefault)) { position = ((RaycastHit)(ref val3)).point; return true; } return false; } public IEnumerator GrabDoorCoroutine(GameObject doorObject) { base.agent.speed = 0f; DoAnimationEveryoneRpc("startGrab"); PlaySFXEveryoneRpc(1); GrabDoorEveryoneRpc(NetworkObjectReference.op_Implicit(doorObject.GetComponent())); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "grab", 10f, 0); hasDoor = true; DoAnimationEveryoneRpc("startMove"); PlayVoiceServerRpc(2); grabCoroutine = null; } [Rpc(/*Could not decode attribute arguments.*/)] public void GrabDoorEveryoneRpc(NetworkObjectReference doorObj) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1913639714u, val3, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref doorObj, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1913639714u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); if (((NetworkObjectReference)(ref doorObj)).TryGet(ref val4, (NetworkManager)null)) { GameObject gameObject = ((Component)val4).gameObject; doorProjectile = gameObject.GetComponent() ?? gameObject.AddComponent(); doorProjectile.Initialize(); ((MonoBehaviour)this).StartCoroutine(doorProjectile.GrabCoroutine(DoorGrabPoint)); } } } public IEnumerator GrabTreeCoroutine(GameObject targetTree) { base.agent.speed = 0f; DoAnimationEveryoneRpc("startGrab"); PlaySFXEveryoneRpc(1); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "grab", 10f, 0); Collider val = targetTree.GetComponentsInChildren()?.FirstOrDefault((Func)((Collider c) => c.isTrigger)); if ((Object)(object)val != (Object)null) { Vector3 val2 = targetTree.transform.position + Vector3.up * 2f; Vector3 direction = ((Component)base.targetPlayer).transform.position - val2; direction.y = 0f; direction = ((Vector3)(ref direction)).normalized; PlayVoiceServerRpc(2); GameObject val3 = Object.Instantiate(StrangerThings.LogProjectileObj, val2, Quaternion.identity); val3.GetComponent().Spawn(false); LogProjectile component = val3.GetComponent(); Bounds bounds = val.bounds; component.FallEveryoneRpc(((Bounds)(ref bounds)).size, direction); RoundManager.Instance.DestroyTreeOnLocalClient(val2); } DoAnimationEveryoneRpc("startMove"); grabCoroutine = null; } public IEnumerator GrabPebblesCoroutine(NetworkObjectReference[] pebblesObjs) { base.agent.speed = 0f; DoAnimationEveryoneRpc("startGrab"); PlaySFXEveryoneRpc(1); GrabPebblesEveryoneRpc(pebblesObjs); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "grab", 10f, 0); PlayVoiceServerRpc(1); yield return ThrowCoroutine((Func)ThrowPebblesCoroutine); grabCoroutine = null; IEnumerator ThrowPebblesCoroutine() { for (int i = 0; i < 3; i++) { if ((Object)(object)pebbleProjectiles[i] != (Object)null) { Vector3 val = ((Component)base.targetPlayer).transform.position + Vector3.up * 1.2f - ((Component)pebbleProjectiles[i]).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; ThrowPebbleAtIndexEveryoneRpc(i, normalized); } if (i < 2) { yield return (object)new WaitForSeconds(0.25f); } } } } [Rpc(/*Could not decode attribute arguments.*/)] public void GrabPebblesEveryoneRpc(NetworkObjectReference[] pebbleObjs) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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_00b7: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(81269387u, val3, val, (SendTo)6, (RpcDelivery)0); bool flag = pebbleObjs != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(pebbleObjs, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendRpc(ref val2, 81269387u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); PebbleProjectile pebbleProjectile = default(PebbleProjectile); for (int i = 0; i < pebbleObjs.Length; i++) { if (((NetworkObjectReference)(ref pebbleObjs[i])).TryGet(ref val4, (NetworkManager)null) && ((Component)val4).TryGetComponent(ref pebbleProjectile)) { pebbleProjectiles[i] = pebbleProjectile; ((MonoBehaviour)this).StartCoroutine(pebbleProjectile.GrabCoroutine()); } } } public IEnumerator GrabRocksCoroutine(RockProjectile[] rockProjectiles) { base.agent.speed = 0f; DoAnimationEveryoneRpc("startGrab"); PlaySFXEveryoneRpc(1); foreach (RockProjectile rockProjectile in rockProjectiles) { rockProjectile.GrabEveryoneRpc(); } yield return (object)new WaitForSeconds(0.25f); PlayVoiceServerRpc(2); foreach (RockProjectile rockProjectile2 in rockProjectiles) { rockProjectile2.ShakeEveryoneRpc(); } yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "grab", 10f, 0); List list = new List(); foreach (RockProjectile rockProjectile3 in rockProjectiles) { GameObject[] source = SpawnRockPebbles(((Component)rockProjectile3).transform.position); List list2 = new List(); list2.AddRange(source.Select((GameObject p) => (NetworkObjectReference)((!((Object)(object)p != (Object)null)) ? default(NetworkObjectReference) : NetworkObjectReference.op_Implicit(p.GetComponent())))); list.AddRange(new <>z__ReadOnlyList(list2)); } NetworkObjectReference[] rockObjs = rockProjectiles.Select((RockProjectile r) => (NetworkObjectReference)((!((Object)(object)r != (Object)null)) ? default(NetworkObjectReference) : NetworkObjectReference.op_Implicit(((Component)r).GetComponent()))).ToArray(); ExplodeRocksEveryoneRpc(rockObjs, list.ToArray()); yield return ThrowCoroutine((Func)ThrowPebblesCoroutine); grabCoroutine = null; IEnumerator ThrowPebblesCoroutine() { for (int l = 0; l < 6; l++) { if ((Object)(object)pebbleProjectiles[l] != (Object)null) { Vector3 val = ((Component)base.targetPlayer).transform.position + Vector3.up * 1.2f - ((Component)pebbleProjectiles[l]).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; ThrowPebbleAtIndexEveryoneRpc(l, normalized); } if (l < 5) { yield return (object)new WaitForSeconds(0.25f); } } } } public GameObject[] SpawnRockPebbles(Vector3 position) { //IL_0070: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) GameObject[] array = (GameObject[])(object)new GameObject[3]; Vector3 val = default(Vector3); for (int i = 0; i < 3; i++) { float num = (float)i * 120f + Random.Range(-15f, 15f); float num2 = Random.Range(0.4f, 1f); ((Vector3)(ref val))..ctor(Mathf.Cos(num * (MathF.PI / 180f)) * num2, Random.Range(1.5f, 2.5f), Mathf.Sin(num * (MathF.PI / 180f)) * num2); array[i] = Object.Instantiate(StrangerThings.PebbleProjectileObj, position + val, Quaternion.identity); array[i].GetComponent().Spawn(false); } return array; } [Rpc(/*Could not decode attribute arguments.*/)] public void ExplodeRocksEveryoneRpc(NetworkObjectReference[] rockObjs, NetworkObjectReference[] pebbleObjs) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3494823288u, val3, val, (SendTo)6, (RpcDelivery)0); bool flag = rockObjs != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(rockObjs, default(ForNetworkSerializable)); } bool flag2 = pebbleObjs != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag2, default(ForPrimitives)); if (flag2) { ((FastBufferWriter)(ref val2)).WriteValueSafe(pebbleObjs, default(ForNetworkSerializable)); } ((NetworkBehaviour)this).__endSendRpc(ref val2, 3494823288u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val5 = default(NetworkObject); for (int i = 0; i < rockObjs.Length; i++) { NetworkObjectReference val4 = rockObjs[i]; if (((NetworkObjectReference)(ref val4)).TryGet(ref val5, (NetworkManager)null)) { RockProjectile component = ((Component)val5).GetComponent(); string text = "Lega Fusion Core" + ((Object)LegaFusionCore.brownExplosionParticle).name; Vector3 position = ((Component)component).transform.position; Quaternion identity = Quaternion.identity; GameObject gameObject = ((Component)this).gameObject; PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; LFCGlobalManager.PlayParticle(text, position, identity, true, 1.5f, DimensionRegistry.AreInSameDimension(gameObject, (localPlayer != null) ? ((Component)localPlayer).gameObject : null)); GameObject stoneImpactAudioObj = StrangerThings.StoneImpactAudioObj; Vector3 position2 = ((Component)component).transform.position; GameObject gameObject2 = ((Component)this).gameObject; PlayerControllerB localPlayer2 = LFCUtilities.LocalPlayer; LFCGlobalManager.PlayAudio(stoneImpactAudioObj, position2, DimensionRegistry.AreInSameDimension(gameObject2, (localPlayer2 != null) ? ((Component)localPlayer2).gameObject : null)); if (LFCUtilities.IsServer) { ((Component)component).GetComponent().Despawn(true); } } } NetworkObject val6 = default(NetworkObject); PebbleProjectile pebbleProjectile = default(PebbleProjectile); for (int j = 0; j < pebbleObjs.Length; j++) { if (((NetworkObjectReference)(ref pebbleObjs[j])).TryGet(ref val6, (NetworkManager)null) && ((Component)val6).TryGetComponent(ref pebbleProjectile)) { pebbleProjectiles[j] = pebbleProjectile; } } } public IEnumerator ThrowCoroutine(Action onThrow) { base.agent.speed = 0f; DoAnimationEveryoneRpc("startThrow"); PlaySFXEveryoneRpc(2); yield return (object)new WaitForSeconds(0.8f); onThrow(); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "throw", 10f, 0); DoAnimationEveryoneRpc("startMove"); throwCoroutine = null; } public IEnumerator ThrowCoroutine(Func onThrow) { base.agent.speed = 0f; DoAnimationEveryoneRpc("startThrow"); PlaySFXEveryoneRpc(2); yield return (object)new WaitForSeconds(0.8f); yield return onThrow(); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "throw", 10f, 0); DoAnimationEveryoneRpc("startMove"); throwCoroutine = null; } [Rpc(/*Could not decode attribute arguments.*/)] public void ThrowDoorEveryoneRpc(int playerId, bool isLastThrow) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: 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_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2599211288u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref isLastThrow, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2599211288u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; hasDoor = false; if ((Object)(object)doorProjectile != (Object)null) { PlayerControllerB component = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent(); DoorProjectile obj = doorProjectile; Vector3 val4 = ((Component)component).transform.position + Vector3.up * 1.2f - ((Component)doorProjectile).transform.position; obj.Throw(((Vector3)(ref val4)).normalized, 25f, isLastThrow); if (isLastThrow) { doorProjectile = null; } } } [Rpc(/*Could not decode attribute arguments.*/)] public void ThrowPebbleAtIndexEveryoneRpc(int index, Vector3 direction) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2892328606u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, index); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref direction); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2892328606u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (index < pebbleProjectiles.Length && (Object)(object)pebbleProjectiles[index] != (Object)null) { pebbleProjectiles[index].Throw(direction, 50f); pebbleProjectiles[index] = null; } } } public override void OnCollideWithPlayer(Collider other) { ((EnemyAI)this).OnCollideWithPlayer(other); if (!base.isEnemyDead && killCoroutine == null && base.currentBehaviourStateIndex == 1 && swingCoroutine == null) { PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false); if (LFCUtilities.ShouldBeLocalPlayer(val)) { SwingServerRpc((int)val.playerClientId); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void SwingServerRpc(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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(953064491u, val3, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 953064491u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (swingCoroutine == null) { swingCoroutine = ((MonoBehaviour)this).StartCoroutine(SwingCoroutine(playerId)); } } } public IEnumerator SwingCoroutine(int playerId) { base.agent.speed = 0f; DoAnimationEveryoneRpc("startSwing"); PlaySFXEveryoneRpc(3); yield return (object)new WaitForSeconds(0.5f); LFCNetworkManager.Instance.DamagePlayerEveryoneRpc(playerId, 20, true, true, 8); PlayVoiceServerRpc(1); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "recover", 10f, 0); DoAnimationEveryoneRpc("startMove"); if (StartOfRound.Instance.allPlayerObjects[playerId].GetComponent().isPlayerDead) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); } swingCoroutine = null; } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { //IL_0083: Unknown result type (might be due to invalid IL or missing references) if (base.isEnemyDead && base.enemyHP > 1 && (killCoroutine == null || hasDoor)) { return; } ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID); base.enemyHP = Math.Max(base.enemyHP - force, 1); if (LFCUtilities.IsServer && base.enemyHP <= 1) { if (ConfigManager.globalTips.Value) { HUDManager.Instance.DisplayTip("Information", "Find a way to defeat Henry in the dimension.", false, false, "LC_Tip1"); } SetupElevenPopAuraEveryoneRpc(NetworkObjectReference.op_Implicit(((Component)elevenPop).GetComponent())); } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetupElevenPopAuraEveryoneRpc(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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1553821997u, val3, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe(ref obj, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1553821997u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); if (((NetworkObjectReference)(ref obj)).TryGet(ref val4, (NetworkManager)null)) { LFCCustomPassManager.SetupAuraForObject(((Component)val4).gameObject, LegaFusionCore.wallhackShader, "Stranger ThingsElevenPop", Color.yellow); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void StopShipServerRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3513777712u, val3, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3513777712u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; stopShipCoroutine = ((MonoBehaviour)this).StartCoroutine(StopShipCoroutine()); } } } public IEnumerator StopShipCoroutine() { yield return (object)new WaitUntil((Func)(() => grabCoroutine == null && throwCoroutine == null && swingCoroutine == null)); base.agent.speed = 0f; DoAnimationEveryoneRpc("startHold"); PlaySFXEveryoneRpc(1); StopShipEveryoneRpc(); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "hold", 10f, 0); DoAnimationEveryoneRpc("startMove"); PlayVoiceServerRpc(2); stopShipCoroutine = null; } [Rpc(/*Could not decode attribute arguments.*/)] public void StopShipEveryoneRpc() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3359021323u, val3, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3359021323u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (LFCUtilities.LocalPlayer.isInElevator || LFCUtilities.LocalPlayer.isInHangarShipRoom) { HUDManager.Instance.ShakeCamera((ScreenShakeType)3); } StartOfRound.Instance.shipDoorAudioSource.PlayOneShot(StartOfRound.Instance.alarmSFX); } } public override void KillEnemy(bool destroy = false) { killCoroutine = ((MonoBehaviour)this).StartCoroutine(KillCoroutine(destroy)); } public IEnumerator KillCoroutine(bool destroy) { base.agent.speed = 0f; DoAnimationEveryoneRpc("KillEnemy"); PlaySFXEveryoneRpc(4); PlayVoiceEveryoneRpc(1); MapObjectsManager.SpawnPortalForServer(((Component)this).transform.position, base.isOutside); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "kill", 10f, 0); <>n__0(destroy); } [Rpc(/*Could not decode attribute arguments.*/)] public void PlaySFXEveryoneRpc(int soundId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1053565877u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, soundId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1053565877u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlaySFX((Sound)soundId); } } } public void PlaySFX(Sound enemySound) { if (HenrySounds.TryGetValue(enemySound, out var value) && value.Length != 0) { base.creatureSFX.PlayOneShot(value[Random.Range(0, value.Length)]); } } [Rpc(/*Could not decode attribute arguments.*/)] public void PlayVoiceServerRpc(int enemyVoice) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3572352420u, val3, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, enemyVoice); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3572352420u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (canSpeak) { canSpeak = false; PlayVoiceEveryoneRpc(enemyVoice); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void PlayVoiceEveryoneRpc(int voiceId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1227395955u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, voiceId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1227395955u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlayVoice((Voice)voiceId); } } } public void PlayVoice(Voice enemyVoice) { if (HenryVoices.TryGetValue(enemyVoice, out var value) && value.Length != 0) { base.creatureVoice.PlayOneShot(value[Random.Range(0, value.Length)]); } } [Rpc(/*Could not decode attribute arguments.*/)] public void DoAnimationEveryoneRpc(string animationState) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3063966151u, val3, val, (SendTo)6, (RpcDelivery)0); bool flag = animationState != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(animationState, false); } ((NetworkBehaviour)this).__endSendRpc(ref val2, 3063966151u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; base.creatureAnimator.SetTrigger(animationState); } } [CompilerGenerated] [DebuggerHidden] private void <>n__0(bool destroy = false) { ((EnemyAI)this).KillEnemy(destroy); } protected override void __initializeVariables() { ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2085476083u, new RpcReceiveHandler(__rpc_handler_2085476083), "OpenShipDoorEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(1913639714u, new RpcReceiveHandler(__rpc_handler_1913639714), "GrabDoorEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(81269387u, new RpcReceiveHandler(__rpc_handler_81269387), "GrabPebblesEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(3494823288u, new RpcReceiveHandler(__rpc_handler_3494823288), "ExplodeRocksEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(2599211288u, new RpcReceiveHandler(__rpc_handler_2599211288), "ThrowDoorEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(2892328606u, new RpcReceiveHandler(__rpc_handler_2892328606), "ThrowPebbleAtIndexEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(953064491u, new RpcReceiveHandler(__rpc_handler_953064491), "SwingServerRpc"); ((NetworkBehaviour)this).__registerRpc(1553821997u, new RpcReceiveHandler(__rpc_handler_1553821997), "SetupElevenPopAuraEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(3513777712u, new RpcReceiveHandler(__rpc_handler_3513777712), "StopShipServerRpc"); ((NetworkBehaviour)this).__registerRpc(3359021323u, new RpcReceiveHandler(__rpc_handler_3359021323), "StopShipEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(1053565877u, new RpcReceiveHandler(__rpc_handler_1053565877), "PlaySFXEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(3572352420u, new RpcReceiveHandler(__rpc_handler_3572352420), "PlayVoiceServerRpc"); ((NetworkBehaviour)this).__registerRpc(1227395955u, new RpcReceiveHandler(__rpc_handler_1227395955), "PlayVoiceEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(3063966151u, new RpcReceiveHandler(__rpc_handler_3063966151), "DoAnimationEveryoneRpc"); ((EnemyAI)this).__initializeRpcs(); } private static void __rpc_handler_2085476083(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((HenryAI)(object)target).OpenShipDoorEveryoneRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1913639714(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 doorObj = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref doorObj, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HenryAI)(object)target).GrabDoorEveryoneRpc(doorObj); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_81269387(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_006e: 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_0058: 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) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] pebbleObjs = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pebbleObjs, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((HenryAI)(object)target).GrabPebblesEveryoneRpc(pebbleObjs); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3494823288(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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_00b3: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); NetworkObjectReference[] rockObjs = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref rockObjs, default(ForNetworkSerializable)); } bool flag2 = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag2, default(ForPrimitives)); NetworkObjectReference[] pebbleObjs = null; if (flag2) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref pebbleObjs, default(ForNetworkSerializable)); } target.__rpc_exec_stage = (__RpcExecStage)1; ((HenryAI)(object)target).ExplodeRocksEveryoneRpc(rockObjs, pebbleObjs); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2599211288(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); bool isLastThrow = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isLastThrow, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HenryAI)(object)target).ThrowDoorEveryoneRpc(playerId, isLastThrow); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2892328606(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int index = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref index); Vector3 direction = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref direction); target.__rpc_exec_stage = (__RpcExecStage)1; ((HenryAI)(object)target).ThrowPebbleAtIndexEveryoneRpc(index, direction); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_953064491(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((HenryAI)(object)target).SwingServerRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1553821997(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(ref obj, default(ForNetworkSerializable)); target.__rpc_exec_stage = (__RpcExecStage)1; ((HenryAI)(object)target).SetupElevenPopAuraEveryoneRpc(obj); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3513777712(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((HenryAI)(object)target).StopShipServerRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3359021323(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { target.__rpc_exec_stage = (__RpcExecStage)1; ((HenryAI)(object)target).StopShipEveryoneRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1053565877(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int soundId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref soundId); target.__rpc_exec_stage = (__RpcExecStage)1; ((HenryAI)(object)target).PlaySFXEveryoneRpc(soundId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3572352420(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int enemyVoice = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref enemyVoice); target.__rpc_exec_stage = (__RpcExecStage)1; ((HenryAI)(object)target).PlayVoiceServerRpc(enemyVoice); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1227395955(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int voiceId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref voiceId); target.__rpc_exec_stage = (__RpcExecStage)1; ((HenryAI)(object)target).PlayVoiceEveryoneRpc(voiceId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3063966151(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string animationState = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref animationState, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((HenryAI)(object)target).DoAnimationEveryoneRpc(animationState); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "HenryAI"; } } public class LimadonAI : UpsideDownEnemyAI { public enum State { WANDERING, CHASING } public enum Sound { CRAWL, SPAWN, SWING, ROAR, JUMP, LAND, CHARGE } [Serializable] public class LimadonSoundSerializableEntry : SerializableEntry { } public Transform TurnCompass; public LimadonSoundSerializableEntry[] LimadonSoundsEntry; public Dictionary LimadonSounds; private float crawlTimer; private float jumpTimer = 15f; private float chargeTimer; public float jumpDuration = 1.167f; public float jumpCooldown = 20f; public float chargeCooldown = 10f; public bool canJump; public bool canCharge; public bool isSplashing; public Coroutine spawnCoroutine; public Coroutine stunCoroutine; public Coroutine jumpCoroutine; public Coroutine chargeCoroutine; public Coroutine swingCoroutine; public override void CancelActionsForServer() { if (LFCUtilities.IsServer) { CancelSpawnCoroutine(); CancelJumpCoroutine(); CancelChargeCoroutine(); CancelSwingCoroutine(); } } public override void ForceSend() { if (((EnemyAI)this).currentBehaviourStateIndex == 0) { ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).SetMovingTowardsTargetPlayer(syncedTarget); ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } } public override void Start() { ((EnemyAI)this).Start(); LimadonSounds = LFCUtilities.ToDictionary((IEnumerable>)LimadonSoundsEntry); if (spawnCoroutine == null) { spawnCoroutine = ((MonoBehaviour)this).StartCoroutine(SpawnCoroutine()); } } public IEnumerator SpawnCoroutine() { ((EnemyAI)this).agent.speed = 0f; PlaySFX(Sound.SPAWN); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "spawn", 10f, 0); ((EnemyAI)this).agent.speed = 2f; ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).currentBehaviourStateIndex = 0; CancelSpawnCoroutine(); } public void CancelSpawnCoroutine() { if (spawnCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(spawnCoroutine); spawnCoroutine = null; } } [Rpc(/*Could not decode attribute arguments.*/)] public void InitializeDuplicateEveryoneRpc(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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2193107535u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2193107535u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((EnemyAI)this).enemyHP = 2; if (((EnemyAI)this).currentBehaviourStateIndex != 1) { ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); if (playerId != -1) { ((EnemyAI)this).SetMovingTowardsTargetPlayer(StartOfRound.Instance.allPlayerObjects[playerId].GetComponent()); } ((EnemyAI)this).currentBehaviourStateIndex = 1; } } public override void Update() { //IL_004c: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) base.Update(); if (!((EnemyAI)this).isEnemyDead && stunCoroutine == null) { PlayCrawlSound(); int currentBehaviourStateIndex = ((EnemyAI)this).currentBehaviourStateIndex; if ((Object)(object)((EnemyAI)this).targetPlayer != (Object)null && currentBehaviourStateIndex == 1) { TurnCompass.LookAt(((Component)((EnemyAI)this).targetPlayer.gameplayCamera).transform.position); ((Component)this).transform.rotation = Quaternion.Lerp(((Component)this).transform.rotation, Quaternion.Euler(new Vector3(0f, TurnCompass.eulerAngles.y, 0f)), 4f * Time.deltaTime); } LFCUtilities.UpdateTimer(ref jumpTimer, jumpCooldown, !canJump, (Action)delegate { canJump = true; }); LFCUtilities.UpdateTimer(ref chargeTimer, chargeCooldown, !canCharge, (Action)delegate { canCharge = true; }); } } public void PlayCrawlSound() { AnimatorClipInfo[] currentAnimatorClipInfo = ((EnemyAI)this).creatureAnimator.GetCurrentAnimatorClipInfo(0); if (currentAnimatorClipInfo.Length != 0 && ((Object)((AnimatorClipInfo)(ref currentAnimatorClipInfo[0])).clip).name.Contains("crawl")) { crawlTimer -= Time.deltaTime; if (LimadonSounds.TryGetValue(Sound.CRAWL, out var value) && value.Length != 0 && crawlTimer <= 0f) { ((EnemyAI)this).creatureSFX.PlayOneShot(value[Random.Range(0, value.Length)]); crawlTimer = 1.25f; } } } public override void SetEnemyStunned(bool setToStunned, float setToStunTime = 0.833f, PlayerControllerB setStunnedByPlayer = null) { if (LFCUtilities.IsServer && setToStunned && !isSplashing && stunCoroutine == null) { ((EnemyAI)this).SetEnemyStunned(setToStunned, setToStunTime, setStunnedByPlayer); stunCoroutine = ((MonoBehaviour)this).StartCoroutine(StunCoroutine()); } } public IEnumerator StunCoroutine() { CancelActionsForServer(); ((EnemyAI)this).agent.speed = 0f; DoAnimationEveryoneRpc("startStun"); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "stun", 10f, 0); while (((EnemyAI)this).stunNormalizedTimer > 0f) { yield return null; } while (((EnemyAI)this).postStunInvincibilityTimer > 0f) { yield return null; } switch (((EnemyAI)this).currentBehaviourStateIndex) { case 0: DoAnimationEveryoneRpc("startCrawl"); if ((Object)(object)((EnemyAI)this).stunnedByPlayer != (Object)null) { ((EnemyAI)this).targetPlayer = ((EnemyAI)this).stunnedByPlayer; ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } break; case 1: DoAnimationEveryoneRpc("startCrawl"); break; } stunCoroutine = null; } public override void DoAIInterval() { ((EnemyAI)this).DoAIInterval(); if (!((EnemyAI)this).isEnemyDead && !StartOfRound.Instance.allPlayersDead && stunCoroutine == null) { switch ((State)((EnemyAI)this).currentBehaviourStateIndex) { case State.WANDERING: DoWandering(); break; case State.CHASING: DoChasing(); break; } } } public void DoWandering() { if (spawnCoroutine == null) { ((EnemyAI)this).agent.speed = 2f; if (LFCEnemyManager.FoundClosestPlayerInRange((EnemyAI)(object)this, 25, 10, 60f, false)) { ((EnemyAI)this).StopSearch(((EnemyAI)this).currentSearch, true); ((EnemyAI)this).SwitchToBehaviourClientRpc(1); } } } public void DoChasing() { //IL_0073: 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) if (swingCoroutine != null || chargeCoroutine != null) { return; } if (jumpCoroutine == null) { ((EnemyAI)this).agent.speed = 5f; float num = default(float); if (!LFCEnemyManager.TargetClosestPlayerInAnyCase((EnemyAI)(object)this, ref num, false) || (!isSynced && num > 35f && !((EnemyAI)this).CheckLineOfSightForPosition(((Component)((EnemyAI)this).targetPlayer).transform.position, 45f, 60, -1f, (Transform)null))) { ((EnemyAI)this).StartSearch(((Component)this).transform.position, (AISearchRoutine)null); ((EnemyAI)this).SwitchToBehaviourClientRpc(0); return; } if (canJump && num >= 5f && num < 15f) { canJump = false; jumpCoroutine = ((MonoBehaviour)this).StartCoroutine(JumpCoroutine()); return; } if (canCharge && num < 5f) { canCharge = false; chargeCoroutine = ((MonoBehaviour)this).StartCoroutine(ChargeCoroutine()); return; } } ((EnemyAI)this).SetMovingTowardsTargetPlayer(((EnemyAI)this).targetPlayer); } public IEnumerator JumpCoroutine() { ((EnemyAI)this).agent.speed = 0f; DoAnimationEveryoneRpc("startRoar"); PlaySFXEveryoneRpc(3); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "roar", 10f, 0); DoAnimationEveryoneRpc("startJump"); PlaySFXEveryoneRpc(4); Vector3 val = ((Vector3.Distance(((Component)((EnemyAI)this).targetPlayer).transform.position, ((Component)this).transform.position) > 25f) ? ((Component)this).transform.position : ((Component)((EnemyAI)this).targetPlayer).transform.position); ((EnemyAI)this).agent.angularSpeed = 0f; ((EnemyAI)this).agent.acceleration = 100f; ((EnemyAI)this).SetDestinationToPosition(val, false); ((EnemyAI)this).agent.SetDestination(val); ((EnemyAI)this).agent.speed = ((EnemyAI)this).agent.remainingDistance / jumpDuration; yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "jump", 10f, 0); ((EnemyAI)this).agent.speed = 0f; isSplashing = true; PlaySFXEveryoneRpc(5); StrangerThingsNetworkManager.Instance.PlayPoisonExplosionEveryoneRpc(((Component)this).transform.position); Vector3 position = default(Vector3); if (((EnemyAI)this).enemyHP > 4 && LFCEnemyManager.TryGetSafeRandomNavMeshPosition((EnemyAI)(object)this, ((Component)this).transform.position, 3f, ref position, 15)) { ((MonoBehaviour)this).StartCoroutine(SpawnEnemyCoroutine(position)); DeductHealthEveryoneRpc(((EnemyAI)this).enemyHP - 4); } isSplashing = false; DoAnimationEveryoneRpc("startDigOut"); PlaySFXEveryoneRpc(1); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "spawn", 10f, 0); CancelJumpCoroutine(); } public IEnumerator SpawnEnemyCoroutine(Vector3 position) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(StrangerThings.LimadonType.enemyPrefab, position, Quaternion.identity); NetworkObject componentInChildren = val.GetComponentInChildren(); componentInChildren.Spawn(true); LimadonAI limadon = ((Component)componentInChildren).GetComponentInChildren(); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)limadon, "spawn", 10f, 0); limadon.InitializeDuplicateEveryoneRpc(((Object)(object)((EnemyAI)this).targetPlayer != (Object)null) ? ((int)((EnemyAI)this).targetPlayer.playerClientId) : (-1)); } [Rpc(/*Could not decode attribute arguments.*/)] public void DeductHealthEveryoneRpc(int newHP) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2718858014u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, newHP); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2718858014u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((EnemyAI)this).enemyHP = ((EnemyAI)this).enemyHP - newHP; } } } public void CancelJumpCoroutine() { if (jumpCoroutine != null) { DoAnimationEveryoneRpc("startCrawl"); ((MonoBehaviour)this).StopCoroutine(jumpCoroutine); jumpCoroutine = null; ((EnemyAI)this).agent.angularSpeed = 120f; ((EnemyAI)this).agent.acceleration = 8f; } } public IEnumerator ChargeCoroutine() { ((EnemyAI)this).agent.speed = 0f; DoAnimationEveryoneRpc("startCharge"); PlaySFXEveryoneRpc(6); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "charge", 10f, 0); CancelChargeCoroutine(); } public void CancelChargeCoroutine() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (chargeCoroutine != null) { StrangerThingsNetworkManager.Instance.PlayPoisonExplosionEveryoneRpc(((Component)this).transform.position); DoAnimationEveryoneRpc("startCrawl"); ((MonoBehaviour)this).StopCoroutine(chargeCoroutine); chargeCoroutine = null; } } public override void OnCollideWithPlayer(Collider other) { ((EnemyAI)this).OnCollideWithPlayer(other); if (!((EnemyAI)this).isEnemyDead && ((EnemyAI)this).currentBehaviourStateIndex == 1 && swingCoroutine == null) { PlayerControllerB val = ((EnemyAI)this).MeetsStandardPlayerCollisionConditions(other, false, false); if (LFCUtilities.ShouldBeLocalPlayer(val)) { OnCollideWithPlayerServerRpc((int)val.playerClientId); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void OnCollideWithPlayerServerRpc(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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3680966314u, val3, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3680966314u, val3, val, (SendTo)2, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { return; } ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (chargeCoroutine != null) { CancelChargeCoroutine(); return; } if (isSplashing) { isSplashing = false; LFCNetworkManager.Instance.DamagePlayerEveryoneRpc(playerId, 20, true, true, 8); } if (jumpCoroutine == null && swingCoroutine == null) { swingCoroutine = ((MonoBehaviour)this).StartCoroutine(SwingCoroutine(playerId)); } } public IEnumerator SwingCoroutine(int playerId) { ((EnemyAI)this).agent.speed = 0f; DoAnimationEveryoneRpc("startSwing"); PlaySFXEveryoneRpc(2); yield return LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)this, "swing", 10f, 0); LFCNetworkManager.Instance.DamagePlayerEveryoneRpc(playerId, 10, true, true, 8); DoAnimationEveryoneRpc("startCrawl"); ((EnemyAI)this).agent.speed = 6f; swingCoroutine = null; } public void CancelSwingCoroutine() { if (swingCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(swingCoroutine); swingCoroutine = null; } } public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { if (!((EnemyAI)this).isEnemyDead) { CancelChargeCoroutine(); base.HitEnemy(force, playerWhoHit, playHitSFX, hitID); } } public override void KillEnemy(bool destroy = false) { CancelActionsForServer(); ((EnemyAI)this).KillEnemy(destroy); } [Rpc(/*Could not decode attribute arguments.*/)] public void PlaySFXEveryoneRpc(int soundId) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager != null && networkManager.IsListening) { if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2913723971u, val3, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, soundId); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2913723971u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; PlaySFX((Sound)soundId); } } } public void PlaySFX(Sound enemySound) { if (LimadonSounds.TryGetValue(enemySound, out var value) && value.Length != 0) { ((EnemyAI)this).creatureSFX.PlayOneShot(value[Random.Range(0, value.Length)]); } } [Rpc(/*Could not decode attribute arguments.*/)] public void DoAnimationEveryoneRpc(string animationState) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)((NetworkBehaviour)this).__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val3 = default(RpcParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3468167854u, val3, val, (SendTo)6, (RpcDelivery)0); bool flag = animationState != null; ((FastBufferWriter)(ref val2)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val2)).WriteValueSafe(animationState, false); } ((NetworkBehaviour)this).__endSendRpc(ref val2, 3468167854u, val3, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; ((EnemyAI)this).creatureAnimator.SetTrigger(animationState); } } protected override void __initializeVariables() { base.__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2193107535u, new RpcReceiveHandler(__rpc_handler_2193107535), "InitializeDuplicateEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(2718858014u, new RpcReceiveHandler(__rpc_handler_2718858014), "DeductHealthEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(3680966314u, new RpcReceiveHandler(__rpc_handler_3680966314), "OnCollideWithPlayerServerRpc"); ((NetworkBehaviour)this).__registerRpc(2913723971u, new RpcReceiveHandler(__rpc_handler_2913723971), "PlaySFXEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(3468167854u, new RpcReceiveHandler(__rpc_handler_3468167854), "DoAnimationEveryoneRpc"); base.__initializeRpcs(); } private static void __rpc_handler_2193107535(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((LimadonAI)(object)target).InitializeDuplicateEveryoneRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2718858014(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int newHP = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref newHP); target.__rpc_exec_stage = (__RpcExecStage)1; ((LimadonAI)(object)target).DeductHealthEveryoneRpc(newHP); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3680966314(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((LimadonAI)(object)target).OnCollideWithPlayerServerRpc(playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2913723971(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int soundId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref soundId); target.__rpc_exec_stage = (__RpcExecStage)1; ((LimadonAI)(object)target).PlaySFXEveryoneRpc(soundId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3468167854(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { bool flag = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref flag, default(ForPrimitives)); string animationState = null; if (flag) { ((FastBufferReader)(ref reader)).ReadValueSafe(ref animationState, false); } target.__rpc_exec_stage = (__RpcExecStage)1; ((LimadonAI)(object)target).DoAnimationEveryoneRpc(animationState); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "LimadonAI"; } } public abstract class UpsideDownEnemyAI : EnemyAI { protected PlayerControllerB syncedTarget; public bool isSynced; private float syncTimer; public float syncDuration = 30f; public float syncDistance = 50f; private readonly Collider[] overlapBuffer = (Collider[])(object)new Collider[64]; private readonly float AoERadius = 100f; private readonly int AoEMask = 524288; public override void Update() { ((EnemyAI)this).Update(); LFCUtilities.UpdateTimer(ref syncTimer, syncDuration, isSynced, (Action)delegate { isSynced = false; syncedTarget = null; }); } public virtual void SetSyncedTarget(PlayerControllerB syncedTarget) { isSynced = true; this.syncedTarget = syncedTarget; } public abstract void ForceSend(); public override void HitEnemy(int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).HitEnemy(force, playerWhoHit, playHitSFX, hitID); bool flag = false; if (!DimensionRegistry.IsInUpsideDown(((Component)this).gameObject)) { int num = Physics.OverlapSphereNonAlloc(((Component)this).transform.position, AoERadius, overlapBuffer, AoEMask, (QueryTriggerInteraction)2); for (int i = 0; i < num; i++) { EnemyAI val = ((Component)overlapBuffer[i]).GetComponent()?.mainScript; if (!((Object)(object)val != (Object)null) || !((Object)(object)val != (Object)(object)this) || val.isEnemyDead || !(val is CrustapikanAI)) { continue; } flag = true; val.enemyHP -= force; if (val.enemyHP <= 0) { if (((NetworkBehaviour)val).IsOwner) { val.KillEnemyOnOwnerClient(false); } } else { val.SetEnemyStunned(true, 1f, (PlayerControllerB)null); } break; } } if (!flag) { foreach (EnemyAI allA in LFCSpawnRegistry.GetAllAs()) { if ((Object)(object)allA != (Object)null && !allA.isEnemyDead && allA is UpsideDownEnemyAI && (Object)(object)allA != (Object)(object)this) { allA.SetEnemyStunned(true, 1f, (PlayerControllerB)null); } } } base.enemyHP -= force; if (base.enemyHP <= 0 && ((NetworkBehaviour)this).IsOwner) { ((EnemyAI)this).KillEnemyOnOwnerClient(false); } } public abstract void CancelActionsForServer(); public override void OnNetworkDespawn() { CancelActionsForServer(); ((NetworkBehaviour)this).OnNetworkDespawn(); } protected override void __initializeVariables() { ((EnemyAI)this).__initializeVariables(); } protected override void __initializeRpcs() { ((EnemyAI)this).__initializeRpcs(); } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "UpsideDownEnemyAI"; } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } } [CompilerGenerated] internal sealed class <>z__ReadOnlyArray : IEnumerable, ICollection, IList, IEnumerable, IReadOnlyCollection, IReadOnlyList, ICollection, IList { int ICollection.Count => _items.Length; bool ICollection.IsSynchronized => false; object ICollection.SyncRoot => this; object IList.this[int index] { get { return _items[index]; } set { throw new NotSupportedException(); } } bool IList.IsFixedSize => true; bool IList.IsReadOnly => true; int IReadOnlyCollection.Count => _items.Length; T IReadOnlyList.this[int index] => _items[index]; int ICollection.Count => _items.Length; bool ICollection.IsReadOnly => true; T IList.this[int index] { get { return _items[index]; } set { throw new NotSupportedException(); } } public <>z__ReadOnlyArray(T[] items) { _items = items; } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)_items).GetEnumerator(); } void ICollection.CopyTo(Array array, int index) { ((ICollection)_items).CopyTo(array, index); } int IList.Add(object value) { throw new NotSupportedException(); } void IList.Clear() { throw new NotSupportedException(); } bool IList.Contains(object value) { return ((IList)_items).Contains(value); } int IList.IndexOf(object value) { return ((IList)_items).IndexOf(value); } void IList.Insert(int index, object value) { throw new NotSupportedException(); } void IList.Remove(object value) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)_items).GetEnumerator(); } void ICollection.Add(T item) { throw new NotSupportedException(); } void ICollection.Clear() { throw new NotSupportedException(); } bool ICollection.Contains(T item) { return ((ICollection)_items).Contains(item); } void ICollection.CopyTo(T[] array, int arrayIndex) { ((ICollection)_items).CopyTo(array, arrayIndex); } bool ICollection.Remove(T item) { throw new NotSupportedException(); } int IList.IndexOf(T item) { return ((IList)_items).IndexOf(item); } void IList.Insert(int index, T item) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } } [CompilerGenerated] internal sealed class <>z__ReadOnlyList : IEnumerable, ICollection, IList, IEnumerable, IReadOnlyCollection, IReadOnlyList, ICollection, IList { int ICollection.Count => _items.Count; bool ICollection.IsSynchronized => false; object ICollection.SyncRoot => this; object IList.this[int index] { get { return _items[index]; } set { throw new NotSupportedException(); } } bool IList.IsFixedSize => true; bool IList.IsReadOnly => true; int IReadOnlyCollection.Count => _items.Count; T IReadOnlyList.this[int index] => _items[index]; int ICollection.Count => _items.Count; bool ICollection.IsReadOnly => true; T IList.this[int index] { get { return _items[index]; } set { throw new NotSupportedException(); } } public <>z__ReadOnlyList(List items) { _items = items; } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)_items).GetEnumerator(); } void ICollection.CopyTo(Array array, int index) { ((ICollection)_items).CopyTo(array, index); } int IList.Add(object value) { throw new NotSupportedException(); } void IList.Clear() { throw new NotSupportedException(); } bool IList.Contains(object value) { return ((IList)_items).Contains(value); } int IList.IndexOf(object value) { return ((IList)_items).IndexOf(value); } void IList.Insert(int index, object value) { throw new NotSupportedException(); } void IList.Remove(object value) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)_items).GetEnumerator(); } void ICollection.Add(T item) { throw new NotSupportedException(); } void ICollection.Clear() { throw new NotSupportedException(); } bool ICollection.Contains(T item) { return _items.Contains(item); } void ICollection.CopyTo(T[] array, int arrayIndex) { _items.CopyTo(array, arrayIndex); } bool ICollection.Remove(T item) { throw new NotSupportedException(); } int IList.IndexOf(T item) { return _items.IndexOf(item); } void IList.Insert(int index, T item) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } } [CompilerGenerated] internal sealed class <>z__ReadOnlySingleElementList : IEnumerable, ICollection, IList, IEnumerable, IReadOnlyCollection, IReadOnlyList, ICollection, IList { private sealed class Enumerator : IDisposable, IEnumerator, IEnumerator { object IEnumerator.Current => _item; T IEnumerator.Current => _item; public Enumerator(T item) { _item = item; } bool IEnumerator.MoveNext() { if (!_moveNextCalled) { return _moveNextCalled = true; } return false; } void IEnumerator.Reset() { _moveNextCalled = false; } void IDisposable.Dispose() { } } int ICollection.Count => 1; bool ICollection.IsSynchronized => false; object ICollection.SyncRoot => this; object IList.this[int index] { get { if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } set { throw new NotSupportedException(); } } bool IList.IsFixedSize => true; bool IList.IsReadOnly => true; int IReadOnlyCollection.Count => 1; T IReadOnlyList.this[int index] { get { if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } } int ICollection.Count => 1; bool ICollection.IsReadOnly => true; T IList.this[int index] { get { if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } set { throw new NotSupportedException(); } } public <>z__ReadOnlySingleElementList(T item) { _item = item; } IEnumerator IEnumerable.GetEnumerator() { return new Enumerator(_item); } void ICollection.CopyTo(Array array, int index) { array.SetValue(_item, index); } int IList.Add(object value) { throw new NotSupportedException(); } void IList.Clear() { throw new NotSupportedException(); } bool IList.Contains(object value) { return EqualityComparer.Default.Equals(_item, (T)value); } int IList.IndexOf(object value) { if (!EqualityComparer.Default.Equals(_item, (T)value)) { return -1; } return 0; } void IList.Insert(int index, object value) { throw new NotSupportedException(); } void IList.Remove(object value) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return new Enumerator(_item); } void ICollection.Add(T item) { throw new NotSupportedException(); } void ICollection.Clear() { throw new NotSupportedException(); } bool ICollection.Contains(T item) { return EqualityComparer.Default.Equals(_item, item); } void ICollection.CopyTo(T[] array, int arrayIndex) { array[arrayIndex] = _item; } bool ICollection.Remove(T item) { throw new NotSupportedException(); } int IList.IndexOf(T item) { if (!EqualityComparer.Default.Equals(_item, item)) { return -1; } return 0; } void IList.Insert(int index, T item) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace StrangerThings.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }