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.MapObjects; using StrangerThings.Behaviours.Scripts; 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] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace 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 DEMOGORGON_KIDNAPPER = "Demogorgon Kidnapper"; 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.2")] public class StrangerThings : BaseUnityPlugin { public const string modGUID = "Lega.StrangerThings"; public const string modName = "Stranger Things"; public const string modVersion = "1.0.2"; 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 rockExplosionAudioObj; public static GameObject tree1Obj; public static GameObject tree2Obj; public static GameObject tree3Obj; public static GameObject batsSkyObj; public static Item antennaItem; public static GameObject batsHordeObj; public static GameObject vinesZoneObj; public static EnemyType limadonType; public static EnemyType crustopikanLarvaeType; public static Material zoneFilterMat; 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(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(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, 150, 125, 225); 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() { (Dictionary spawnRateByLevelType, Dictionary spawnRateByCustomLevelType) demogorgonsSpawns = ConfigManager.GetDemogorgonsSpawns(); Dictionary item = demogorgonsSpawns.spawnRateByLevelType; Dictionary item2 = demogorgonsSpawns.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"), item, item2, terminalNode, terminalKeyword, bodyItem, ConfigManager.demogorgonMinHeadValue.Value, ConfigManager.demogorgonMaxHeadValue.Value); RegisterEnemy(bundle.LoadAsset("Assets/Enemies/Demogorgon/DemogorgonHunterEnemy.asset"), item, item2, terminalNode, terminalKeyword, bodyItem, ConfigManager.demogorgonMinHeadValue.Value, ConfigManager.demogorgonMaxHeadValue.Value); 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, int bodyMinValue, int bodyMaxValue, bool bodyEnabled = true) { NetworkPrefabs.RegisterNetworkPrefab(enemyType.enemyPrefab); Enemies.RegisterEnemy(enemyType, spawnRateByLevelType, spawnRateByCustomLevelType, terminalNode, terminalKeyword); SellBodiesFixedSoftCompat.RegisterBody(enemyType.enemyName, bodyItem, bodyMinValue, bodyMaxValue, bodyEnabled); } public EnemyType RegisterUpsideDownEnemy(EnemyType enemyType, int rarity, TerminalNode terminalNode, TerminalKeyword terminalKeyword, Item bodyItem, int bodyMinValue, int bodyMaxValue, bool bodyEnabled = true) { NetworkPrefabs.RegisterNetworkPrefab(enemyType.enemyPrefab); Enemies.RegisterEnemy(enemyType, rarity, (LevelTypes)1, terminalNode, terminalKeyword); 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() { HashSet hashSet = new HashSet { upsideDownPortalObj = bundle.LoadAsset("Assets/UpsideDown/Portal/UpsideDownPortal.prefab"), upsideDownMirrorObjectObj = bundle.LoadAsset("Assets/Items/UpsideDownMirrorObject.prefab"), antennaHazardObj = bundle.LoadAsset("Assets/Antenna/AntennaHazard.prefab"), rockProjectileObj = bundle.LoadAsset("Assets/Enemies/Crustapikan/RockProjectile.prefab"), rockExplosionAudioObj = bundle.LoadAsset("Assets/Enemies/Crustapikan/RockExplosionAudio.prefab") }; foreach (GameObject item in hashSet) { NetworkPrefabs.RegisterNetworkPrefab(item); Utilities.FixMixerGroups(item); } } } 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) { UpsideDownPortal[] upsideDownPortals = MapObjectsManager.GetUpsideDownPortals(); foreach (UpsideDownPortal upsideDownPortal in upsideDownPortals) { 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); 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.IsNearAntennaHazard(val) ? 1f : 0f)) : (((!localPlayer.speakingToWalkieTalkie || !val.holdingWalkieTalkie) && (!val.speakingToWalkieTalkie || !localPlayer.holdingWalkieTalkie)) ? 0.1f : (MapObjectsManager.IsNearAntennaHazard(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_0069: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) if (LFCUtilities.IsServer && !__instance.isDoorOpened && !((Object)(object)((Component)__instance).GetComponent() != (Object)null) && !((Object)(object)other == (Object)null) && ((Component)other).CompareTag("Enemy")) { EnemyAICollisionDetect component = ((Component)other).GetComponent(); if ((Object)(object)component != (Object)null && component.mainScript is DemogorgonAI demogorgonAI && demogorgonAI.isDashing) { Vector3 val = ((Component)((EnemyAI)demogorgonAI).targetPlayer).transform.position - ((Component)demogorgonAI).transform.position; Vector3 direction = ((Vector3)(ref val)).normalized * 5f; demogorgonAI.BreakDoorEveryoneRpc(NetworkObjectReference.op_Implicit(((Component)__instance).GetComponentInParent()), direction); ((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_001e: Unknown result type (might be due to invalid IL or missing references) if (LFCUtilities.IsServer && !(__instance is UpsideDownEnemyAI)) { SpawnUpsideDownEnemy(__instance.isOutside, ((Component)__instance).transform.position); } } private static void SpawnUpsideDownEnemy(bool isOutside, Vector3 position) { //IL_0015: 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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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) EnemyType randomEnemy = GetRandomEnemy(isOutside); 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, ((Component)playerScript).gameObject) && (!(__instance is DemogorgonKidnapperAI demogorgonKidnapperAI) || ((EnemyAI)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 { [CompilerGenerated] private sealed class d__3 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public IEnumerator result; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //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_014d: 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_0165: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if (result.MoveNext()) { <>2__current = result.Current; <>1__state = 1; return true; } 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; } } } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [HarmonyPatch(typeof(RoundManager), "SpawnOutsideHazards")] [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) : 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); } } [IteratorStateMachine(typeof(d__3))] [HarmonyPatch(typeof(RoundManager), "waitForScrapToSpawnToSync")] [HarmonyPostfix] private static IEnumerator SpawnMirrorObjects(IEnumerator result) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(0) { result = result }; } 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 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 EndRound(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.upsideDownPortals.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.IsNearAntennaHazard(val) ? 1f : 0f)) : (((!localPlayer.speakingToWalkieTalkie || !val.holdingWalkieTalkie) && (!val.speakingToWalkieTalkie || !localPlayer.holdingWalkieTalkie)) ? 0.1f : (MapObjectsManager.IsNearAntennaHazard(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 demogorgonRarity; public static ConfigEntry demogorgonMinHeadValue; public static ConfigEntry demogorgonMaxHeadValue; 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."); demogorgonRarity = StrangerThings.configFile.Bind("Demogorgon", "Rarity", 20, "Demogorgon Kidnapper base rarity (Upside Down spawn)."); 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)."); 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 (Dictionary spawnRateByLevelType, Dictionary spawnRateByCustomLevelType) GetDemogorgonsSpawns() { //IL_0083: Unknown result type (might be due to invalid IL or missing references) Dictionary dictionary = new Dictionary(); Dictionary dictionary2 = new Dictionary(); foreach (string item in from s in demogorgonSpawnWeights.Value.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)) { dictionary[result2] = result; } else { dictionary2[text] = result; } } } return (dictionary, dictionary2); } } public static class MapObjectsManager { public static HashSet antennaHazards = new HashSet(); public static HashSet upsideDownPortals = new HashSet(); public static void AddAntennaHazards(AntennaHazard antennaHazard) { antennaHazards.Add(antennaHazard); } public static HashSet GetAntennaHazards() { antennaHazards.RemoveWhere((AntennaHazard p) => (Object)(object)p == (Object)null); return antennaHazards; } public static bool IsNearAntennaHazard(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 AddUpsideDownPortal(UpsideDownPortal upsideDownPortal) { upsideDownPortals.Add(upsideDownPortal); } public static UpsideDownPortal[] GetUpsideDownPortals() { upsideDownPortals.RemoveWhere((UpsideDownPortal p) => (Object)(object)p == (Object)null); return upsideDownPortals.Where((UpsideDownPortal p) => !p.isFake).ToArray(); } public static void SpawnPortalsForServer() { if (GetUpsideDownPortals().Length < 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) SpawnUpsideDownPortalForServer(position, isOutside); }); } } public static UpsideDownPortal SpawnUpsideDownPortalForServer(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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) UpsideDownPortal result = null; float num = float.MaxValue; UpsideDownPortal[] array = GetUpsideDownPortals(); foreach (UpsideDownPortal upsideDownPortal in array) { 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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) UpsideDownPortal result = null; float num = 0f; UpsideDownPortal[] array = GetUpsideDownPortals(); foreach (UpsideDownPortal upsideDownPortal in array) { 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 { [CompilerGenerated] private sealed class d__7 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Vector3 position; public float duration; private float 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0033: 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: Expected O, but got Unknown //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) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__2 = 0f; break; case 1: <>1__state = -1; 5__2 += 0.2f; break; } if (5__2 < duration) { Collider[] array = (Collider[])(object)new Collider[64]; int num = Physics.OverlapSphereNonAlloc(position, Mathf.Max(5__2 * 5f, 7.5f), array, StartOfRound.Instance.playersMask, (QueryTriggerInteraction)2); PlayerControllerB val = default(PlayerControllerB); 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)); } } <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } 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_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: 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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(912406207u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, seed); ((NetworkBehaviour)this).__endSendRpc(ref val3, 912406207u, val2, 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); Collider[] array = (Collider[])(object)new Collider[4096]; int num = Physics.OverlapSphereNonAlloc(Vector3.zero, 1000f, array, 33554432, (QueryTriggerInteraction)1); for (int i = 0; i < num; i++) { if ((Object)(object)array[i] != (Object)null) { instance.aliveTrees.Add(((Component)array[i]).gameObject); } } 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[] array2 = (GameObject[])(object)new GameObject[3] { StrangerThings.tree1Obj, StrangerThings.tree2Obj, StrangerThings.tree3Obj }; GameObject val4 = Object.Instantiate(array2[random.Next(0, array2.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); } } [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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(792643303u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref isInUpsideDown, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 792643303u, val2, 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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(968582711u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref obj, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref isInUpsideDown, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 968582711u, val2, 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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2994801010u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref scriptObj, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref mirrorObj, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref twinObj, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2994801010u, val2, 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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1550006684u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1550006684u, val2, 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)); } } [IteratorStateMachine(typeof(d__7))] 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) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(0) { position = position, duration = duration }; } 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 ((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).__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; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "StrangerThingsNetworkManager"; } } } namespace StrangerThings.Behaviours.Scripts { public class DoorProjectile : MonoBehaviour { [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public float delay; public DoorProjectile <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown int num = <>1__state; DoorProjectile doorProjectile = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(delay); <>1__state = 1; return true; case 1: { <>1__state = -1; if (doorProjectile.rigidbody == null) { doorProjectile.rigidbody = ((Component)doorProjectile).GetComponent(); } Object.Destroy((Object)(object)doorProjectile.rigidbody); Collider[] componentsInChildren = ((Component)doorProjectile).GetComponentsInChildren(); foreach (Collider val in componentsInChildren) { Object.Destroy((Object)(object)val); } NavMeshObstacle[] componentsInChildren2 = ((Component)doorProjectile).GetComponentsInChildren(); foreach (NavMeshObstacle val2 in componentsInChildren2) { val2.carving = false; Object.Destroy((Object)(object)val2); } Object.Destroy((Object)(object)((Component)doorProjectile).GetComponentInChildren()); Object.Destroy((Object)(object)doorProjectile, 1f); return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private Rigidbody rigidbody; private bool hasHit; private void Start() { ((MonoBehaviour)this).StartCoroutine(SelfDestructAfterDelay(2f)); } private void OnCollisionEnter(Collision collision) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_006b: 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_00ac: 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_00b2: 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_00b8: 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_00c5: 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) PlayerControllerB val = default(PlayerControllerB); if (!hasHit && LFCUtilities.TryGetComponentInParent(collision.gameObject, ref val)) { hasHit = true; rigidbody = ((Component)this).GetComponent(); Vector3 velocity = rigidbody.velocity; int num = (int)(((Vector3)(ref velocity)).magnitude * 2f); if (num > 0) { LFCNetworkManager.Instance.DamagePlayerEveryoneRpc((int)val.playerClientId, num, true, true, 0); } Rigidbody obj = rigidbody; obj.velocity *= 0.3f; rigidbody.useGravity = true; rigidbody.constraints = (RigidbodyConstraints)0; if (collision.contactCount > 0) { Vector3 normal = ((ContactPoint)(ref collision.contacts[0])).normal; Vector3 val2 = Vector3.Cross(normal, Vector3.up); rigidbody.AddTorque(val2 * 15f, (ForceMode)1); } ((MonoBehaviour)this).StartCoroutine(SelfDestructAfterDelay(1f)); } } [IteratorStateMachine(typeof(d__4))] private IEnumerator SelfDestructAfterDelay(float delay) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { <>4__this = this, delay = delay }; } } public class RockProjectile : NetworkBehaviour { [CompilerGenerated] private sealed class d__6 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public RockProjectile <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown int num = <>1__state; RockProjectile rockProjectile = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; case 1: <>1__state = -1; if (rockProjectile.deactivated) { return false; } rockProjectile.deactivated = true; if (LFCUtilities.IsServer) { Object.Destroy((Object)(object)((Component)rockProjectile).gameObject); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__5 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public RockProjectile <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0029: 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_0069: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; RockProjectile rockProjectile = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if (!rockProjectile.deactivated) { RaycastHit val = default(RaycastHit); if (Physics.SphereCast(((Component)rockProjectile).transform.position, 0.4f, Vector3.down, ref val, 1.5f, 605030721, (QueryTriggerInteraction)2)) { rockProjectile.SpawnRockExplosionEveryoneRpc(); rockProjectile.throwingEnemy?.SpawnEnemyForServer(StrangerThings.crustopikanLarvaeType, ((Component)rockProjectile).transform.position, 2f); ((MonoBehaviour)rockProjectile).StartCoroutine(rockProjectile.DestroyCoroutine()); return false; } <>2__current = null; <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public Rigidbody rigidbody; public CrustapikanAI throwingEnemy; public bool isThrown; public bool deactivated; [Rpc(/*Could not decode attribute arguments.*/)] public void ThrowRockEveryoneRpc(NetworkObjectReference enemyObject, Vector3 targetPosition) { //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_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0133: 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) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0188: 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_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) 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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1375109082u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref enemyObject, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref targetPosition); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1375109082u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } 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.SetParent((Transform)null); float num = 40f; Vector3 val5 = targetPosition - ((Component)this).transform.position; Vector3 val6 = default(Vector3); ((Vector3)(ref val6))..ctor(val5.x, 0f, val5.z); float magnitude = ((Vector3)(ref val6)).magnitude; float num2 = MathF.PI / 12f; float num3 = magnitude / (num * Mathf.Cos(num2)); float num4 = val5.y / num3 - 0.5f * Physics.gravity.y * num3; Vector3 val7 = ((Vector3)(ref val6)).normalized * (num * Mathf.Cos(num2)); rigidbody.isKinematic = false; rigidbody.interpolation = (RigidbodyInterpolation)1; rigidbody.collisionDetectionMode = (CollisionDetectionMode)2; rigidbody.velocity = Vector3.zero; rigidbody.AddForce(val7 + Vector3.up * num4, (ForceMode)2); if (LFCUtilities.IsServer) { ((MonoBehaviour)this).StartCoroutine(DetectGroundAndWalls()); } } } [IteratorStateMachine(typeof(d__5))] public IEnumerator DetectGroundAndWalls() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__5(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__6))] public IEnumerator DestroyCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__6(0) { <>4__this = this }; } public void OnTriggerEnter(Collider other) { if (isThrown && !((Object)(object)other == (Object)null) && LFCUtilities.IsServer && HandlePlayerHit(other)) { deactivated = true; SpawnRockExplosionEveryoneRpc(); Object.Destroy((Object)(object)((Component)this).gameObject); } } public bool HandlePlayerHit(Collider other) { PlayerControllerB component = ((Component)other).GetComponent(); if ((Object)(object)component != (Object)null && DimensionRegistry.AreInSameDimension(((Component)component).gameObject, ((Component)this).gameObject)) { LFCNetworkManager.Instance.DamagePlayerEveryoneRpc((int)component.playerClientId, 50, true, true, 8); return true; } return false; } [Rpc(/*Could not decode attribute arguments.*/)] public void SpawnRockExplosionEveryoneRpc() { //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_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_0108: 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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3408199161u, val2, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3408199161u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; string text = "Lega Fusion Core" + ((Object)LegaFusionCore.brownExplosionParticle).name; Vector3 position = ((Component)this).transform.position; Quaternion identity = Quaternion.identity; PlayerControllerB localPlayer = LFCUtilities.LocalPlayer; LFCGlobalManager.PlayParticle(text, position, identity, true, 2f, DimensionRegistry.IsInUpsideDown((localPlayer != null) ? ((Component)localPlayer).gameObject : null)); GameObject rockExplosionAudioObj = StrangerThings.rockExplosionAudioObj; Vector3 position2 = ((Component)this).transform.position; PlayerControllerB localPlayer2 = LFCUtilities.LocalPlayer; LFCGlobalManager.PlayAudio(rockExplosionAudioObj, position2, 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 //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(1375109082u, new RpcReceiveHandler(__rpc_handler_1375109082), "ThrowRockEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(3408199161u, new RpcReceiveHandler(__rpc_handler_3408199161), "SpawnRockExplosionEveryoneRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_1375109082(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 enemyObject = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemyObject, default(ForNetworkSerializable)); Vector3 targetPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref targetPosition); target.__rpc_exec_stage = (__RpcExecStage)1; ((RockProjectile)(object)target).ThrowRockEveryoneRpc(enemyObject, targetPosition); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3408199161(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).SpawnRockExplosionEveryoneRpc(); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "RockProjectile"; } } 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 obj = spores; if (obj != null) { ((Component)obj).gameObject.SetActive(enable); } GameObject obj2 = batsSky; if (obj2 != null) { obj2.SetActive(enable); } if (enable) { AudioSource obj3 = audioVibe; if (obj3 != null) { obj3.Play(); } } else { AudioSource obj4 = audioVibe; if (obj4 != null) { obj4.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) : null); Vector3 val2 = Vector3.forward * 2f; transform.position = (val.HasValue ? new Vector3?(val.GetValueOrDefault() + val2) : 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 InteractTrigger twinTrigger; 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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(94455293u, val2, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 94455293u, val2, 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.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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1753755191u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1753755191u, val2, 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 { [CompilerGenerated] private sealed class d__20 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public UpsideDownPortal <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__20(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown int num = <>1__state; UpsideDownPortal upsideDownPortal = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; ((Component)upsideDownPortal.portalTrigger).gameObject.SetActive(false); <>2__current = (object)new WaitForSeconds(5f); <>1__state = 1; return true; case 1: <>1__state = -1; ((Component)upsideDownPortal.portalTrigger).gameObject.SetActive(true); upsideDownPortal.disableCoroutine = null; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public bool isOutside; public bool isFake; public bool isLocked; public bool isCorrupted; public float lockTimer; public PlayerControllerB corruptedPlayer; public InteractTrigger portalTrigger; public ParticleSystem portalSpores; 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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1297034105u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref isOutside, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref isFake, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1297034105u, val2, 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.AddUpsideDownPortal(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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1764775483u, val2, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1764775483u, val2, 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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(72492245u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val3, 72492245u, val2, 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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(248418442u, val2, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 248418442u, val2, 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; } [IteratorStateMachine(typeof(d__20))] public IEnumerator DisableCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__20(0) { <>4__this = this }; } 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 { [CompilerGenerated] private sealed class d__5 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public AntennaItem <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Expected O, but got Unknown //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Expected O, but got Unknown //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Expected O, but got Unknown //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Expected O, but got Unknown int num = <>1__state; AntennaItem CS$<>8__locals0 = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; ((GrabbableObject)CS$<>8__locals0).playerHeldBy.activatingItem = true; ((GrabbableObject)CS$<>8__locals0).playerHeldBy.twoHanded = true; ((GrabbableObject)CS$<>8__locals0).playerHeldBy.playerBodyAnimator.ResetTrigger("shovelHit"); ((GrabbableObject)CS$<>8__locals0).playerHeldBy.playerBodyAnimator.SetBool("reelingUp", true); CS$<>8__locals0.ReelUpSFXEveryoneRpc(); <>2__current = (object)new WaitForSeconds(0.35f); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = (object)new WaitUntil((Func)(() => !((Shovel)CS$<>8__locals0).isHoldingButton || !((GrabbableObject)CS$<>8__locals0).isHeld)); <>1__state = 2; return true; case 2: <>1__state = -1; CS$<>8__locals0.SwingAntenna(!((GrabbableObject)CS$<>8__locals0).isHeld); <>2__current = (object)new WaitForSeconds(0.13f); <>1__state = 3; return true; case 3: <>1__state = -1; <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 4; return true; case 4: <>1__state = -1; CS$<>8__locals0.HitAntenna(!((GrabbableObject)CS$<>8__locals0).isHeld); <>2__current = (object)new WaitForSeconds(0.3f); <>1__state = 5; return true; case 5: <>1__state = -1; ((Shovel)CS$<>8__locals0).reelingUp = false; ((Shovel)CS$<>8__locals0).reelingUpCoroutine = null; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public int antennaHitForce = 3; public RaycastHit[] objectsHitByAntenna; public List objectsHitByAntennaList = new List(); public AudioSource antennaAudio; 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()); } } [IteratorStateMachine(typeof(d__5))] private IEnumerator ReelUpAntenna() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__5(0) { <>4__this = this }; } [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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(4252981852u, val2, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 4252981852u, val2, 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 i = 0; i < StartOfRound.Instance.footstepSurfaces.Length; i++) { if (StartOfRound.Instance.footstepSurfaces[i].surfaceTag == ((Component)((RaycastHit)(ref current)).collider).gameObject.tag) { hitSurfaceID = i; 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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3388906295u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, hitSurfaceID); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3388906295u, val2, 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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(207452063u, val2, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref position); ((NetworkBehaviour)this).__endSendRpc(ref val3, 207452063u, val2, 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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(975664246u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref obj, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 975664246u, val2, 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.AddAntennaHazards(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 { [CompilerGenerated] private sealed class d__13 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public BaseballBat <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Expected O, but got Unknown //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Expected O, but got Unknown //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Expected O, but got Unknown //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Expected O, but got Unknown int num = <>1__state; BaseballBat CS$<>8__locals0 = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; ((GrabbableObject)CS$<>8__locals0).playerHeldBy.activatingItem = true; ((GrabbableObject)CS$<>8__locals0).playerHeldBy.twoHanded = true; ((GrabbableObject)CS$<>8__locals0).playerHeldBy.playerBodyAnimator.ResetTrigger("shovelHit"); ((GrabbableObject)CS$<>8__locals0).playerHeldBy.playerBodyAnimator.SetBool("reelingUp", true); CS$<>8__locals0.ReelUpSFXEveryoneRpc(); <>2__current = (object)new WaitForSeconds(0.35f); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = (object)new WaitUntil((Func)(() => !CS$<>8__locals0.isHoldingButton || !((GrabbableObject)CS$<>8__locals0).isHeld)); <>1__state = 2; return true; case 2: <>1__state = -1; CS$<>8__locals0.SwingBaseballBat(!((GrabbableObject)CS$<>8__locals0).isHeld); <>2__current = (object)new WaitForSeconds(0.13f); <>1__state = 3; return true; case 3: <>1__state = -1; <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 4; return true; case 4: <>1__state = -1; CS$<>8__locals0.HitBaseballBat(!((GrabbableObject)CS$<>8__locals0).isHeld); <>2__current = (object)new WaitForSeconds(0.3f); <>1__state = 5; return true; case 5: <>1__state = -1; CS$<>8__locals0.reelingUp = false; CS$<>8__locals0.reelingUpCoroutine = null; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public int baseballBatHitForce = 1; public bool reelingUp; public bool isHoldingButton; private Coroutine reelingUpCoroutine; private RaycastHit[] objectsHitByBaseballBat; private List objectsHitByBaseballBatList = new List(); public AudioClip ReelUp; public AudioClip Swing; public AudioClip[] HitSFX; public AudioSource BaseballBatAudio; 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()); } } [IteratorStateMachine(typeof(d__13))] private IEnumerator ReelUpBaseballBat() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__13(0) { <>4__this = this }; } [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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(749079199u, val2, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 749079199u, val2, 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 i = 0; i < StartOfRound.Instance.footstepSurfaces.Length; i++) { if (StartOfRound.Instance.footstepSurfaces[i].surfaceTag == ((Component)((RaycastHit)(ref current)).collider).gameObject.tag) { hitSurfaceID = i; 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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(4169060244u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, hitSurfaceID); ((NetworkBehaviour)this).__endSendRpc(ref val3, 4169060244u, val2, 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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3081695872u, val2, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3081695872u, val2, 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.Enemies { public class CrustapikanAI : UpsideDownEnemyAI { public enum State { WANDERING, CHASING, CARRYING } public enum Sound { SMASH, ROAR, GRAB, THROW, SWING } [CompilerGenerated] private sealed class d__39 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CrustapikanAI <>4__this; private HashSet 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__39(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_007b: 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_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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; CrustapikanAI crustapikanAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; ((EnemyAI)crustapikanAI).agent.speed = 0f; crustapikanAI.DoAnimationEveryoneRpc("startSmash"); <>2__current = (object)new WaitForSeconds(2.15f); <>1__state = 1; return true; case 1: <>1__state = -1; crustapikanAI.PlayAudioEveryoneRpc(0); crustapikanAI.PlayParticleEveryoneRpc("Lega Fusion CoreAppearFromGround1", ((Component)crustapikanAI).transform.position + ((Component)crustapikanAI).transform.forward, Quaternion.identity, 0.5f); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)crustapikanAI, "smash", 10f, 0); <>1__state = 2; return true; case 2: { <>1__state = -1; 5__2 = new HashSet(); int num2 = Physics.OverlapSphereNonAlloc(((Component)crustapikanAI).transform.position, crustapikanAI.AoERadius, crustapikanAI.overlapBuffer, crustapikanAI.AoEMask, (QueryTriggerInteraction)2); for (int i = 0; i < num2; i++) { EnemyAI val = ((Component)crustapikanAI.overlapBuffer[i]).GetComponent()?.mainScript; if (!((Object)(object)val == (Object)null) && !((Object)(object)val == (Object)(object)crustapikanAI) && !val.isEnemyDead && DimensionRegistry.AreInSameDimension(((Component)crustapikanAI).gameObject, ((Component)val).gameObject) && val is UpsideDownEnemyAI upsideDownEnemyAI && !(Vector3.Distance(((Component)upsideDownEnemyAI).transform.position, ((Component)crustapikanAI).transform.position) > upsideDownEnemyAI.syncDistance)) { upsideDownEnemyAI.SetSyncedTarget(((EnemyAI)crustapikanAI).targetPlayer); 5__2.Add(upsideDownEnemyAI); } } UpsideDownEnemyAI upsideDownEnemyAI2 = crustapikanAI.SpawnEnemyForServer(StrangerThings.crustopikanLarvaeType, ((Component)crustapikanAI).transform.position, 5f); if ((Object)(object)upsideDownEnemyAI2 != (Object)null) { upsideDownEnemyAI2.SetSyncedTarget(((EnemyAI)crustapikanAI).targetPlayer); 5__2.Add(upsideDownEnemyAI2); } if (5__2.Any((UpsideDownEnemyAI e) => (Object)(object)((EnemyAI)e).targetPlayer == (Object)null)) { crustapikanAI.PlayAudioEveryoneRpc(1); crustapikanAI.DoAnimationEveryoneRpc("startRoar"); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)crustapikanAI, "roar", 10f, 0); <>1__state = 3; return true; } break; } case 3: <>1__state = -1; foreach (UpsideDownEnemyAI item in 5__2) { item.ForceSend(); } break; } crustapikanAI.DoAnimationEveryoneRpc("startMove"); ((EnemyAI)crustapikanAI).SwitchToBehaviourClientRpc(1); crustapikanAI.callCoroutine = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__42 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CrustapikanAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__42(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown int num = <>1__state; CrustapikanAI crustapikanAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; ((EnemyAI)crustapikanAI).agent.speed = 0f; crustapikanAI.PlayAudioEveryoneRpc(2); crustapikanAI.DoAnimationEveryoneRpc("startGrab"); <>2__current = (object)new WaitForSeconds(1.7f); <>1__state = 1; return true; case 1: <>1__state = -1; crustapikanAI.SpawnRockForServer(); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)crustapikanAI, "grab", 10f, 0); <>1__state = 2; return true; case 2: <>1__state = -1; crustapikanAI.DoAnimationEveryoneRpc("startCarry"); ((EnemyAI)crustapikanAI).SwitchToBehaviourClientRpc(2); crustapikanAI.grabCoroutine = null; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__36 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CrustapikanAI <>4__this; private IEnumerator 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__36(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; CrustapikanAI crustapikanAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; ((EnemyAI)crustapikanAI).agent.speed = 0f; crustapikanAI.DoAnimationEveryoneRpc("startLook"); 5__2 = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)crustapikanAI, "look", 10f, 0); break; case 1: <>1__state = -1; break; } if (5__2.MoveNext()) { if (LFCEnemyManager.FoundClosestPlayerInRange((EnemyAI)(object)crustapikanAI, 50, 15, 90f, true)) { crustapikanAI.DoAnimationEveryoneRpc("startMove"); ((EnemyAI)crustapikanAI).SwitchToBehaviourClientRpc(1); return false; } <>2__current = 5__2.Current; <>1__state = 1; return true; } ((EnemyAI)crustapikanAI).StartSearch(((Component)crustapikanAI).transform.position, (AISearchRoutine)null); crustapikanAI.DoAnimationEveryoneRpc("startMove"); crustapikanAI.lookCoroutine = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__33 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CrustapikanAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__33(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; CrustapikanAI crustapikanAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; crustapikanAI.CancelActionsForServer(); ((EnemyAI)crustapikanAI).agent.speed = 0f; crustapikanAI.DoAnimationEveryoneRpc("startStun"); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)crustapikanAI, "stun", 10f, 0); <>1__state = 1; return true; case 1: <>1__state = -1; goto IL_008e; case 2: <>1__state = -1; goto IL_008e; case 3: { <>1__state = -1; break; } IL_008e: if (((EnemyAI)crustapikanAI).stunNormalizedTimer > 0f) { <>2__current = null; <>1__state = 2; return true; } break; } if (((EnemyAI)crustapikanAI).postStunInvincibilityTimer > 0f) { <>2__current = null; <>1__state = 3; return true; } crustapikanAI.DoAnimationEveryoneRpc("startMove"); if (((EnemyAI)crustapikanAI).currentBehaviourStateIndex == 0 && (Object)(object)((EnemyAI)crustapikanAI).stunnedByPlayer != (Object)null) { ((EnemyAI)crustapikanAI).targetPlayer = ((EnemyAI)crustapikanAI).stunnedByPlayer; ((EnemyAI)crustapikanAI).StopSearch(((EnemyAI)crustapikanAI).currentSearch, true); ((EnemyAI)crustapikanAI).SwitchToBehaviourClientRpc(1); } crustapikanAI.stunCoroutine = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__52 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CrustapikanAI <>4__this; public int playerId; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__52(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_00d6: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; CrustapikanAI crustapikanAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; ((EnemyAI)crustapikanAI).agent.speed = 0f; crustapikanAI.DoAnimationEveryoneRpc("startSwing"); crustapikanAI.PlayAudioEveryoneRpc(4); <>2__current = (object)new WaitForSeconds(2.08f); <>1__state = 1; return true; case 1: <>1__state = -1; LFCNetworkManager.Instance.DamagePlayerEveryoneRpc(playerId, 100, true, true, 8); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)crustapikanAI, "swing", 10f, 0); <>1__state = 2; return true; case 2: <>1__state = -1; crustapikanAI.DoAnimationEveryoneRpc("startMove"); if (StartOfRound.Instance.allPlayerObjects[playerId].GetComponent().isPlayerDead) { ((EnemyAI)crustapikanAI).StartSearch(((Component)crustapikanAI).transform.position, (AISearchRoutine)null); ((EnemyAI)crustapikanAI).SwitchToBehaviourClientRpc(0); } crustapikanAI.swingCoroutine = null; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__47 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CrustapikanAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__47(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; CrustapikanAI crustapikanAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; ((EnemyAI)crustapikanAI).agent.speed = 0f; crustapikanAI.PlayAudioEveryoneRpc(3); crustapikanAI.DoAnimationEveryoneRpc("startThrow"); <>2__current = (object)new WaitForSeconds(0.8f); <>1__state = 1; return true; case 1: <>1__state = -1; crustapikanAI.rockProjectile?.ThrowRockEveryoneRpc(NetworkObjectReference.op_Implicit(((EnemyAI)crustapikanAI).thisNetworkObject), crustapikanAI.lastSeenPosition); crustapikanAI.rockProjectile = null; <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)crustapikanAI, "throw", 10f, 0); <>1__state = 2; return true; case 2: <>1__state = -1; crustapikanAI.DoAnimationEveryoneRpc("startMove"); ((EnemyAI)crustapikanAI).SwitchToBehaviourClientRpc(1); crustapikanAI.lastSeenPosition = Vector3.zero; crustapikanAI.throwCoroutine = null; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public Transform TurnCompass; public Transform GrabPoint; public AudioClip[] FootstepSounds = Array.Empty(); public AudioClip[] CrustapikanSounds = Array.Empty(); public float footstepTimer; public float lookTimer = 10f; public float callTimer = 30f; public 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; public RockProjectile rockProjectile; public 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_0014: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Start(); ((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) { PlayFootstepSound(); 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 PlayFootstepSound() { AnimatorClipInfo[] currentAnimatorClipInfo = ((EnemyAI)this).creatureAnimator.GetCurrentAnimatorClipInfo(0); if (currentAnimatorClipInfo.Length != 0 && ((Object)((AnimatorClipInfo)(ref currentAnimatorClipInfo[0])).clip).name.Contains("move")) { footstepTimer -= Time.deltaTime; if (FootstepSounds.Length != 0 && footstepTimer <= 0f) { ((EnemyAI)this).creatureSFX.PlayOneShot(FootstepSounds[Random.Range(0, FootstepSounds.Length)]); footstepTimer = 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()); } } [IteratorStateMachine(typeof(d__33))] public IEnumerator StunCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__33(0) { <>4__this = this }; } 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()); } } } [IteratorStateMachine(typeof(d__36))] public IEnumerator LookCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__36(0) { <>4__this = this }; } 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); } } [IteratorStateMachine(typeof(d__39))] public IEnumerator CallCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__39(0) { <>4__this = this }; } [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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1993170488u, val2, val, (SendTo)6, (RpcDelivery)0); bool flag = tag != null; ((FastBufferWriter)(ref val3)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val3)).WriteValueSafe(tag, false); } ((FastBufferWriter)(ref val3)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref rotation); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref scaleFactor, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1993170488u, val2, 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); } } [IteratorStateMachine(typeof(d__42))] public IEnumerator GrabCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__42(0) { <>4__this = this }; } 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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(4068221311u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref obj, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 4068221311u, val2, 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_0038: Unknown result type (might be due to invalid IL or missing references) if (grabCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(grabCoroutine); grabCoroutine = null; rockProjectile?.ThrowRockEveryoneRpc(NetworkObjectReference.op_Implicit(((EnemyAI)this).thisNetworkObject), ((Component)this).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); } } [IteratorStateMachine(typeof(d__47))] public IEnumerator ThrowCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__47(0) { <>4__this = this }; } public void CancelThrowCoroutine() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if (throwCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(throwCoroutine); throwCoroutine = null; canGrab = true; grabTimer = 0f; rockProjectile?.ThrowRockEveryoneRpc(NetworkObjectReference.op_Implicit(((EnemyAI)this).thisNetworkObject), ((Component)this).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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3413558653u, val2, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3413558653u, val2, 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)); } } } [IteratorStateMachine(typeof(d__52))] public IEnumerator SwingCoroutine(int playerId) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__52(0) { <>4__this = this, playerId = playerId }; } 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 PlayAudioEveryoneRpc(int enemySound) { //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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(711309000u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, enemySound); ((NetworkBehaviour)this).__endSendRpc(ref val3, 711309000u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (CrustapikanSounds.Length != 0) { ((EnemyAI)this).creatureSFX.PlayOneShot(CrustapikanSounds[enemySound]); } } } [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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(570486282u, val2, val, (SendTo)6, (RpcDelivery)0); bool flag = animationState != null; ((FastBufferWriter)(ref val3)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val3)).WriteValueSafe(animationState, false); } ((NetworkBehaviour)this).__endSendRpc(ref val3, 570486282u, val2, 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(711309000u, new RpcReceiveHandler(__rpc_handler_711309000), "PlayAudioEveryoneRpc"); ((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_711309000(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 enemySound = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref enemySound); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrustapikanAI)(object)target).PlayAudioEveryoneRpc(enemySound); 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 { DIGIN, DIGOUT, DASH, BITE, ROAR } [CompilerGenerated] private sealed class d__33 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CrustapikanLarvaeAI <>4__this; public int playerId; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__33(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; CrustapikanLarvaeAI crustapikanLarvaeAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; ((EnemyAI)crustapikanLarvaeAI).agent.speed = 0f; crustapikanLarvaeAI.DoAnimationEveryoneRpc("startBite"); crustapikanLarvaeAI.PlayAudioEveryoneRpc(3); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)crustapikanLarvaeAI, "bite", 10f, 0); <>1__state = 1; return true; case 1: <>1__state = -1; LFCNetworkManager.Instance.DamagePlayerEveryoneRpc(playerId, 10, true, true, 8); crustapikanLarvaeAI.DoAnimationEveryoneRpc("startMove"); ((EnemyAI)crustapikanLarvaeAI).agent.speed = 6f; crustapikanLarvaeAI.biteCoroutine = null; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__26 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CrustapikanLarvaeAI <>4__this; private Transform 5__2; private float 5__3; private Vector3 5__4; private float 5__5; private float 5__6; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__26(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; CrustapikanLarvaeAI crustapikanLarvaeAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; ((EnemyAI)crustapikanLarvaeAI).agent.speed = 0f; crustapikanLarvaeAI.DoAnimationEveryoneRpc("startRoar"); crustapikanLarvaeAI.PlayAudioEveryoneRpc(4); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)crustapikanLarvaeAI, "roar", 10f, 0); <>1__state = 1; return true; case 1: <>1__state = -1; crustapikanLarvaeAI.DoAnimationEveryoneRpc("startDigIn"); crustapikanLarvaeAI.PlayAudioEveryoneRpc(0); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)crustapikanLarvaeAI, "digin", 10f, 0); <>1__state = 2; return true; case 2: <>1__state = -1; crustapikanLarvaeAI.SetDiggingEveryoneRpc(enable: true); ((EnemyAI)crustapikanLarvaeAI).agent.speed = 9f; 5__2 = (((Object)(object)((EnemyAI)crustapikanLarvaeAI).targetPlayer != (Object)null && !((EnemyAI)crustapikanLarvaeAI).targetPlayer.isPlayerDead) ? ((Component)((EnemyAI)crustapikanLarvaeAI).targetPlayer).transform : null); 5__3 = 50f; goto IL_0166; case 3: <>1__state = -1; goto IL_0166; case 4: { <>1__state = -1; if (!((Object)(object)((EnemyAI)crustapikanLarvaeAI).targetPlayer != (Object)null) || !(Vector3.Distance(((Component)crustapikanLarvaeAI).transform.position, ((Component)((EnemyAI)crustapikanLarvaeAI).targetPlayer).transform.position) <= 15f)) { break; } crustapikanLarvaeAI.DoAnimationEveryoneRpc("startDash"); crustapikanLarvaeAI.PlayAudioEveryoneRpc(2); crustapikanLarvaeAI.isDashing = true; ((EnemyAI)crustapikanLarvaeAI).agent.speed = 24f; ((EnemyAI)crustapikanLarvaeAI).agent.angularSpeed = 0f; ((EnemyAI)crustapikanLarvaeAI).agent.acceleration = 100f; Vector3 val = ((Component)((EnemyAI)crustapikanLarvaeAI).targetPlayer).transform.position - ((Component)crustapikanLarvaeAI).transform.position; 5__4 = ((Vector3)(ref val)).normalized; 5__5 = 0.75f; 5__6 = 0f; goto IL_02d8; } case 5: { <>1__state = -1; goto IL_02d8; } IL_02d8: if (5__6 < 5__5 && crustapikanLarvaeAI.isDashing) { 5__6 += Time.deltaTime; ((EnemyAI)crustapikanLarvaeAI).agent.velocity = 5__4 * ((EnemyAI)crustapikanLarvaeAI).agent.speed; <>2__current = null; <>1__state = 5; return true; } break; IL_0166: if ((Object)(object)5__2 != (Object)null) { float num2 = Vector3.Distance(((Component)crustapikanLarvaeAI).transform.position, 5__2.position); if (!(num2 <= 5f) && !(num2 >= 5__3) && DimensionRegistry.AreInSameDimension(((Component)5__2).gameObject, ((Component)crustapikanLarvaeAI).gameObject)) { <>2__current = null; <>1__state = 3; return true; } } ((EnemyAI)crustapikanLarvaeAI).agent.speed = 0f; crustapikanLarvaeAI.SetDiggingEveryoneRpc(enable: false); crustapikanLarvaeAI.DoAnimationEveryoneRpc("startDigOut"); crustapikanLarvaeAI.PlayAudioEveryoneRpc(1); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)crustapikanLarvaeAI, "spawn", 10f, 0); <>1__state = 4; return true; } crustapikanLarvaeAI.CancelDashCoroutine(); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__28 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CrustapikanLarvaeAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__28(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //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_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) int num = <>1__state; CrustapikanLarvaeAI crustapikanLarvaeAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if (crustapikanLarvaeAI.isDigging) { crustapikanLarvaeAI.PlayGroundstepSound(); Vector3 position = ((Component)crustapikanLarvaeAI).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)crustapikanLarvaeAI).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)); <>2__current = null; <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__17 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CrustapikanLarvaeAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__17(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0088: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; CrustapikanLarvaeAI crustapikanLarvaeAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; ((EnemyAI)crustapikanLarvaeAI).agent.speed = 0f; if (crustapikanLarvaeAI.CrustapikanLarvaeSounds.Length != 0) { ((EnemyAI)crustapikanLarvaeAI).creatureSFX.PlayOneShot(crustapikanLarvaeAI.CrustapikanLarvaeSounds[1]); } <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)crustapikanLarvaeAI, "spawn", 10f, 0); <>1__state = 1; return true; case 1: <>1__state = -1; ((EnemyAI)crustapikanLarvaeAI).agent.speed = 3f; ((EnemyAI)crustapikanLarvaeAI).StartSearch(((Component)crustapikanLarvaeAI).transform.position, (AISearchRoutine)null); ((EnemyAI)crustapikanLarvaeAI).currentBehaviourStateIndex = 0; crustapikanLarvaeAI.CancelSpawnCoroutine(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__22 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CrustapikanLarvaeAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__22(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; CrustapikanLarvaeAI crustapikanLarvaeAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; crustapikanLarvaeAI.CancelActionsForServer(); ((EnemyAI)crustapikanLarvaeAI).agent.speed = 0f; crustapikanLarvaeAI.DoAnimationEveryoneRpc("startStun"); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)crustapikanLarvaeAI, "stun", 10f, 0); <>1__state = 1; return true; case 1: <>1__state = -1; goto IL_008e; case 2: <>1__state = -1; goto IL_008e; case 3: { <>1__state = -1; break; } IL_008e: if (((EnemyAI)crustapikanLarvaeAI).stunNormalizedTimer > 0f) { <>2__current = null; <>1__state = 2; return true; } break; } if (((EnemyAI)crustapikanLarvaeAI).postStunInvincibilityTimer > 0f) { <>2__current = null; <>1__state = 3; return true; } switch (((EnemyAI)crustapikanLarvaeAI).currentBehaviourStateIndex) { case 0: crustapikanLarvaeAI.DoAnimationEveryoneRpc("startMove"); if ((Object)(object)((EnemyAI)crustapikanLarvaeAI).stunnedByPlayer != (Object)null) { ((EnemyAI)crustapikanLarvaeAI).targetPlayer = ((EnemyAI)crustapikanLarvaeAI).stunnedByPlayer; ((EnemyAI)crustapikanLarvaeAI).StopSearch(((EnemyAI)crustapikanLarvaeAI).currentSearch, true); ((EnemyAI)crustapikanLarvaeAI).SwitchToBehaviourClientRpc(1); } break; case 1: crustapikanLarvaeAI.DoAnimationEveryoneRpc("startMove"); break; } crustapikanLarvaeAI.stunCoroutine = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public Transform TurnCompass; public AudioClip[] FootstepSounds = Array.Empty(); public AudioClip[] GroundSounds = Array.Empty(); public AudioClip[] CrustapikanLarvaeSounds = Array.Empty(); public bool isDigging; public bool isDashing; public float footstepTimer; public float groundstepTimer; 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(); if (spawnCoroutine == null) { spawnCoroutine = ((MonoBehaviour)this).StartCoroutine(SpawnCoroutine()); } } [IteratorStateMachine(typeof(d__17))] public IEnumerator SpawnCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__17(0) { <>4__this = this }; } 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) { PlayFootstepSound(); 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 PlayFootstepSound() { AnimatorClipInfo[] currentAnimatorClipInfo = ((EnemyAI)this).creatureAnimator.GetCurrentAnimatorClipInfo(0); if (currentAnimatorClipInfo.Length != 0 && ((Object)((AnimatorClipInfo)(ref currentAnimatorClipInfo[0])).clip).name.Contains("move")) { footstepTimer -= Time.deltaTime; if (FootstepSounds.Length != 0 && footstepTimer <= 0f) { ((EnemyAI)this).creatureSFX.PlayOneShot(FootstepSounds[Random.Range(0, FootstepSounds.Length)]); footstepTimer = 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()); } } [IteratorStateMachine(typeof(d__22))] public IEnumerator StunCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__22(0) { <>4__this = this }; } 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); } [IteratorStateMachine(typeof(d__26))] public IEnumerator DashCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__26(0) { <>4__this = this }; } [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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3664175517u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref enable, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3664175517u, val2, 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()); } } } [IteratorStateMachine(typeof(d__28))] public IEnumerator DiggingCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__28(0) { <>4__this = this }; } public void PlayGroundstepSound() { groundstepTimer -= Time.deltaTime; if (GroundSounds.Length != 0 && groundstepTimer <= 0f) { ((EnemyAI)this).creatureSFX.PlayOneShot(GroundSounds[Random.Range(0, GroundSounds.Length)]); groundstepTimer = 0.2f; } } 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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1114428u, val2, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1114428u, val2, 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)); } } } [IteratorStateMachine(typeof(d__33))] public IEnumerator BiteCoroutine(int playerId) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__33(0) { <>4__this = this, playerId = playerId }; } 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 PlayAudioEveryoneRpc(int enemySound) { //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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1784994802u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, enemySound); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1784994802u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (CrustapikanLarvaeSounds.Length != 0) { ((EnemyAI)this).creatureSFX.PlayOneShot(CrustapikanLarvaeSounds[enemySound]); } } } [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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(777192765u, val2, val, (SendTo)6, (RpcDelivery)0); bool flag = animationState != null; ((FastBufferWriter)(ref val3)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val3)).WriteValueSafe(animationState, false); } ((NetworkBehaviour)this).__endSendRpc(ref val3, 777192765u, val2, 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(1784994802u, new RpcReceiveHandler(__rpc_handler_1784994802), "PlayAudioEveryoneRpc"); ((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_1784994802(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 enemySound = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref enemySound); target.__rpc_exec_stage = (__RpcExecStage)1; ((CrustapikanLarvaeAI)(object)target).PlayAudioEveryoneRpc(enemySound); 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 { SET, DIG, CHARGE, DASH, SWING, ROAR } [CompilerGenerated] private sealed class d__36 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DemogorgonAI <>4__this; private bool 5__2; private int 5__3; private int 5__4; private Vector3 5__5; private float 5__6; private float 5__7; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__36(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0128: 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_0132: 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_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; DemogorgonAI demogorgonAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; 5__2 = true; 5__3 = Random.Range(1, 4); 5__4 = 0; goto IL_01e7; case 1: <>1__state = -1; demogorgonAI.DoAnimationEveryoneRpc("startDash"); demogorgonAI.PlayAudioEveryoneRpc(3); demogorgonAI.isDashing = true; ((EnemyAI)demogorgonAI).agent.speed = 24f; ((EnemyAI)demogorgonAI).agent.angularSpeed = 0f; ((EnemyAI)demogorgonAI).agent.acceleration = 100f; if ((Object)(object)((EnemyAI)demogorgonAI).targetPlayer != (Object)null) { Vector3 val = ((Component)((EnemyAI)demogorgonAI).targetPlayer).transform.position - ((Component)demogorgonAI).transform.position; 5__5 = ((Vector3)(ref val)).normalized; 5__6 = 0.6f; 5__7 = 0f; goto IL_01a1; } goto IL_01b7; case 2: <>1__state = -1; goto IL_01a1; case 3: { <>1__state = -1; goto IL_01d7; } IL_01e7: if (5__4 < 5__3) { if (5__2 || demogorgonAI.isDashing) { 5__2 = false; demogorgonAI.isDashing = false; ((EnemyAI)demogorgonAI).agent.speed = 0f; demogorgonAI.DoAnimationEveryoneRpc("startCharge"); demogorgonAI.PlayAudioEveryoneRpc(2); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)demogorgonAI, "charge", 10f, 0); <>1__state = 1; return true; } goto IL_01d7; } if (demogorgonAI.isDashing) { demogorgonAI.StopDash(); } return false; IL_01a1: if (5__7 < 5__6 && demogorgonAI.isDashing) { 5__7 += Time.deltaTime; ((EnemyAI)demogorgonAI).agent.velocity = 5__5 * ((EnemyAI)demogorgonAI).agent.speed; <>2__current = null; <>1__state = 2; return true; } goto IL_01b7; IL_01d7: 5__4++; goto IL_01e7; IL_01b7: <>2__current = (object)new WaitForSeconds(0.33f); <>1__state = 3; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__48 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Rigidbody rb; public Vector3 force; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__48(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_0044: 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_005a: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForFixedUpdate(); <>1__state = 1; return true; case 1: <>1__state = -1; rb.AddForce(force, (ForceMode)1); <>2__current = (object)new WaitForFixedUpdate(); <>1__state = 2; return true; case 2: <>1__state = -1; rb.useGravity = true; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__38 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB player; public DemogorgonAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__38(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; DemogorgonAI demogorgonAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; if ((Object)(object)player != (Object)null) { LFCNetworkManager.Instance.DamagePlayerEveryoneRpc((int)player.playerClientId, 80, true, true, 8); } demogorgonAI.PlayAudioEveryoneRpc(5); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)demogorgonAI, "recover", 10f, 0); <>1__state = 1; return true; case 1: <>1__state = -1; demogorgonAI.DoAnimationEveryoneRpc("startMove"); demogorgonAI.CancelDashCoroutine(); demogorgonAI.stopDashCoroutine = null; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__28 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DemogorgonAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__28(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; DemogorgonAI demogorgonAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; demogorgonAI.CancelActionsForServer(); ((EnemyAI)demogorgonAI).agent.speed = 0f; demogorgonAI.DoAnimationEveryoneRpc("startStun"); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)demogorgonAI, "stun", 10f, 0); <>1__state = 1; return true; case 1: <>1__state = -1; goto IL_008e; case 2: <>1__state = -1; goto IL_008e; case 3: { <>1__state = -1; break; } IL_008e: if (((EnemyAI)demogorgonAI).stunNormalizedTimer > 0f) { <>2__current = null; <>1__state = 2; return true; } break; } if (((EnemyAI)demogorgonAI).postStunInvincibilityTimer > 0f) { <>2__current = null; <>1__state = 3; return true; } demogorgonAI.DoAnimationEveryoneRpc("startMove"); if (((EnemyAI)demogorgonAI).currentBehaviourStateIndex == 1 && ((Object)(object)((EnemyAI)demogorgonAI).stunnedByPlayer != (Object)null || (Object)(object)((EnemyAI)demogorgonAI).targetPlayer != (Object)null)) { if (!Object.op_Implicit((Object)(object)((EnemyAI)demogorgonAI).targetPlayer)) { ((EnemyAI)demogorgonAI).targetPlayer = ((EnemyAI)demogorgonAI).stunnedByPlayer; } demogorgonAI.closestPortal = null; ((EnemyAI)demogorgonAI).StopSearch(((EnemyAI)demogorgonAI).currentSearch, true); ((EnemyAI)demogorgonAI).SwitchToBehaviourClientRpc(2); } demogorgonAI.stunCoroutine = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__43 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DemogorgonAI <>4__this; public PlayerControllerB player; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__43(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown int num = <>1__state; DemogorgonAI demogorgonAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; ((EnemyAI)demogorgonAI).agent.speed = 0f; demogorgonAI.DoAnimationEveryoneRpc("startSwing"); demogorgonAI.PlayAudioEveryoneRpc(4); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)demogorgonAI, "swing", 10f, 0); <>1__state = 1; return true; case 1: <>1__state = -1; LFCNetworkManager.Instance.DamagePlayerEveryoneRpc((int)player.playerClientId, 20, true, true, 8); demogorgonAI.DoAnimationEveryoneRpc("startMove"); <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 2; return true; case 2: <>1__state = -1; ((EnemyAI)demogorgonAI).agent.speed = 7f; demogorgonAI.swingCoroutine = null; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public Transform TurnCompass; public AudioClip[] FootstepSounds = Array.Empty(); public AudioClip[] GrowlSounds = Array.Empty(); public AudioClip[] DemogorgonSounds = Array.Empty(); public float footstepTimer; public float growlTimer; public 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; public 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_0014: Unknown result type (might be due to invalid IL or missing references) ((EnemyAI)this).Start(); ((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; } PlayFootstepSound(); 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 PlayFootstepSound() { 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"))) { footstepTimer -= Time.deltaTime; if (FootstepSounds.Length != 0 && footstepTimer <= 0f) { ((EnemyAI)this).creatureSFX.PlayOneShot(FootstepSounds[Random.Range(0, FootstepSounds.Length)]); footstepTimer = 0.45f; } } } public void PlayGrowlSound() { growlTimer -= Time.deltaTime; if (GrowlSounds.Length != 0 && growlTimer <= 0f) { ((EnemyAI)this).creatureSFX.PlayOneShot(GrowlSounds[Random.Range(0, GrowlSounds.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()); } } [IteratorStateMachine(typeof(d__28))] public IEnumerator StunCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__28(0) { <>4__this = this }; } 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); } [IteratorStateMachine(typeof(d__36))] public IEnumerator DashCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__36(0) { <>4__this = this }; } 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)); } } [IteratorStateMachine(typeof(d__38))] public virtual IEnumerator StopDashCoroutine(PlayerControllerB player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__38(0) { <>4__this = this, player = player }; } 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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(893425162u, val2, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val3, 893425162u, val2, 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)); } } } [IteratorStateMachine(typeof(d__43))] public IEnumerator SwingCoroutine(PlayerControllerB player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__43(0) { <>4__this = this, player = player }; } 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_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_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_012d: 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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3599037694u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref obj, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref direction); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3599037694u, val2, 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)val4).gameObject; Transform transform = gameObject.transform; transform.position += direction * 0.5f; gameObject.AddComponent(); Rigidbody val5 = gameObject.AddComponent(); val5.useGravity = false; ((MonoBehaviour)this).StartCoroutine(ReleaseDoor(val5, direction)); AnimatedObjectTrigger val6 = default(AnimatedObjectTrigger); if (LFCUtilities.TryGetComponentInChildren(((Component)val4).gameObject, ref val6)) { val6.PlayAudio(val6.boolValue, true); } } } [IteratorStateMachine(typeof(d__48))] protected IEnumerator ReleaseDoor(Rigidbody rb, Vector3 force) { //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) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__48(0) { rb = rb, force = force }; } 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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3893804584u, val2, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3893804584u, val2, 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 PlayAudioEveryoneRpc(int enemySound) { //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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2203809850u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, enemySound); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2203809850u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (DemogorgonSounds.Length != 0) { ((EnemyAI)this).creatureSFX.PlayOneShot(DemogorgonSounds[enemySound]); } } } [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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1630148796u, val2, val, (SendTo)6, (RpcDelivery)0); bool flag = animationState != null; ((FastBufferWriter)(ref val3)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val3)).WriteValueSafe(animationState, false); } ((NetworkBehaviour)this).__endSendRpc(ref val3, 1630148796u, val2, 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(2203809850u, new RpcReceiveHandler(__rpc_handler_2203809850), "PlayAudioEveryoneRpc"); ((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_2203809850(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 enemySound = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref enemySound); target.__rpc_exec_stage = (__RpcExecStage)1; ((DemogorgonAI)(object)target).PlayAudioEveryoneRpc(enemySound); 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 { [CompilerGenerated] private sealed class d__17 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DemogorgonHunterAI <>4__this; public bool isInUpsideDown; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__17(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00a3: 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_00e6: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; DemogorgonHunterAI demogorgonHunterAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; demogorgonHunterAI.DoAnimationEveryoneRpc("startDig"); demogorgonHunterAI.PlayAudioEveryoneRpc(1); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)demogorgonHunterAI, "dig", 10f, 0); <>1__state = 1; return true; case 1: <>1__state = -1; demogorgonHunterAI.DoAnimationEveryoneRpc("startDigIn"); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)demogorgonHunterAI, "digin", 10f, 0); <>1__state = 2; return true; case 2: <>1__state = -1; LFCNetworkManager.Instance.TeleportEnemyEveryoneRpc(NetworkObjectReference.op_Implicit(((EnemyAI)demogorgonHunterAI).thisNetworkObject), ((Component)demogorgonHunterAI.closestPortal).transform.position, demogorgonHunterAI.closestPortal.isOutside); if (DimensionRegistry.IsInUpsideDown(((Component)demogorgonHunterAI).gameObject) != isInUpsideDown) { StrangerThingsNetworkManager.Instance.SetGObjectInUpsideDownEveryoneRpc(NetworkObjectReference.op_Implicit(((EnemyAI)demogorgonHunterAI).thisNetworkObject), isInUpsideDown); if (isInUpsideDown) { demogorgonHunterAI.RestoreEnemyHealthEveryoneRpc(); } } demogorgonHunterAI.DoAnimationEveryoneRpc("startDigOut"); if (demogorgonHunterAI.isHunting) { demogorgonHunterAI.PlayScreamAudioEveryoneRpc(); } <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)demogorgonHunterAI, "digout", 10f, 0); <>1__state = 3; return true; case 3: <>1__state = -1; demogorgonHunterAI.closestPortal = null; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__16 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DemogorgonHunterAI <>4__this; public bool isInUpsideDown; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__16(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0076: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; DemogorgonHunterAI demogorgonHunterAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; ((EnemyAI)demogorgonHunterAI).agent.speed = 0f; <>2__current = demogorgonHunterAI.DigCoroutine(isInUpsideDown); <>1__state = 1; return true; case 1: { <>1__state = -1; demogorgonHunterAI.DoAnimationEveryoneRpc("startMove"); float distanceWithPlayer = default(float); if (!LFCEnemyManager.TargetClosestPlayerInAnyCase((EnemyAI)(object)demogorgonHunterAI, ref distanceWithPlayer, false) || demogorgonHunterAI.ShouldLoseTarget(distanceWithPlayer)) { ((EnemyAI)demogorgonHunterAI).StartSearch(((Component)demogorgonHunterAI).transform.position, (AISearchRoutine)null); ((EnemyAI)demogorgonHunterAI).SwitchToBehaviourClientRpc(0); } else { ((EnemyAI)demogorgonHunterAI).SwitchToBehaviourClientRpc(2); } demogorgonHunterAI.portalingCoroutine = null; return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__13 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DemogorgonHunterAI <>4__this; public PlayerControllerB player; private UpsideDownPortal 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_00b3: 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) int num = <>1__state; DemogorgonHunterAI demogorgonHunterAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; ((EnemyAI)demogorgonHunterAI).agent.speed = 0f; demogorgonHunterAI.DoAnimationEveryoneRpc("startSetIn"); demogorgonHunterAI.PlayAudioEveryoneRpc(0); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)demogorgonHunterAI, "setin", 10f, 0); <>1__state = 1; return true; case 1: <>1__state = -1; demogorgonHunterAI.DoAnimationEveryoneRpc("startSet"); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)demogorgonHunterAI, "set", 10f, 0); <>1__state = 2; return true; case 2: <>1__state = -1; 5__2 = MapObjectsManager.SpawnUpsideDownPortalForServer(((Component)demogorgonHunterAI).transform.position, ((EnemyAI)demogorgonHunterAI).isOutside, isFake: true); demogorgonHunterAI.DoAnimationEveryoneRpc("startSetOut"); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)demogorgonHunterAI, "setout", 10f, 0); <>1__state = 3; return true; case 3: <>1__state = -1; demogorgonHunterAI.closestPortal = MapObjectsManager.GetClosestPortal(((Component)player).transform.position); <>2__current = demogorgonHunterAI.DigCoroutine(DimensionRegistry.IsInUpsideDown(((Component)player).gameObject)); <>1__state = 4; return true; case 4: <>1__state = -1; ((EnemyAI)demogorgonHunterAI).targetPlayer = player; Object.Destroy((Object)(object)((Component)5__2).gameObject); demogorgonHunterAI.DoAnimationEveryoneRpc("startMove"); ((EnemyAI)demogorgonHunterAI).SwitchToBehaviourClientRpc(2); demogorgonHunterAI.setCoroutine = null; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public AudioClip ScreamSound; public float setTimer = 30f; public 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); } } } [IteratorStateMachine(typeof(d__13))] public IEnumerator SetCoroutine(PlayerControllerB player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__13(0) { <>4__this = this, player = player }; } 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); } } [IteratorStateMachine(typeof(d__16))] public IEnumerator PortalingCoroutine(bool isInUpsideDown) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__16(0) { <>4__this = this, isInUpsideDown = isInUpsideDown }; } [IteratorStateMachine(typeof(d__17))] public IEnumerator DigCoroutine(bool isInUpsideDown) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__17(0) { <>4__this = this, isInUpsideDown = isInUpsideDown }; } [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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2849937270u, val2, val, (SendTo)6, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2849937270u, val2, 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 { [CompilerGenerated] private sealed class d__22 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DemogorgonKidnapperAI <>4__this; public UpsideDownPortal targetedPortal; public bool isInUpsideDown; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__22(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00a3: 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_00e6: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; DemogorgonKidnapperAI demogorgonKidnapperAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; demogorgonKidnapperAI.DoAnimationEveryoneRpc("startDig"); demogorgonKidnapperAI.PlayAudioEveryoneRpc(1); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)demogorgonKidnapperAI, "dig", 10f, 0); <>1__state = 1; return true; case 1: <>1__state = -1; demogorgonKidnapperAI.DoAnimationEveryoneRpc("startDigIn"); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)demogorgonKidnapperAI, "digin", 10f, 0); <>1__state = 2; return true; case 2: <>1__state = -1; LFCNetworkManager.Instance.TeleportEnemyEveryoneRpc(NetworkObjectReference.op_Implicit(((EnemyAI)demogorgonKidnapperAI).thisNetworkObject), ((Component)targetedPortal).transform.position, targetedPortal.isOutside); if (DimensionRegistry.IsInUpsideDown(((Component)demogorgonKidnapperAI).gameObject) != isInUpsideDown) { StrangerThingsNetworkManager.Instance.SetGObjectInUpsideDownEveryoneRpc(NetworkObjectReference.op_Implicit(((EnemyAI)demogorgonKidnapperAI).thisNetworkObject), isInUpsideDown); if (isInUpsideDown) { demogorgonKidnapperAI.RestoreEnemyHealthEveryoneRpc(); } } demogorgonKidnapperAI.DoAnimationEveryoneRpc("startDigOut"); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)demogorgonKidnapperAI, "digout", 10f, 0); <>1__state = 3; return true; case 3: <>1__state = -1; demogorgonKidnapperAI.closestPortal = null; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__17 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DemogorgonKidnapperAI <>4__this; public PlayerControllerB player; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__17(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; DemogorgonKidnapperAI demogorgonKidnapperAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; ((EnemyAI)demogorgonKidnapperAI).agent.speed = 0f; demogorgonKidnapperAI.DoAnimationEveryoneRpc("startDrop"); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)demogorgonKidnapperAI, "drop", 10f, 0); <>1__state = 1; return true; case 1: <>1__state = -1; demogorgonKidnapperAI.DropPlayerEveryoneRpc((int)player.playerClientId); <>2__current = demogorgonKidnapperAI.DigCoroutine(isInUpsideDown: true, demogorgonKidnapperAI.closestPortal); <>1__state = 2; return true; case 2: <>1__state = -1; ((EnemyAI)demogorgonKidnapperAI).targetPlayer = player; demogorgonKidnapperAI.DoAnimationEveryoneRpc("startMove"); ((EnemyAI)demogorgonKidnapperAI).SwitchToBehaviourClientRpc(2); if ((Object)(object)demogorgonKidnapperAI.openedPortal != (Object)null) { Object.Destroy((Object)(object)((Component)demogorgonKidnapperAI.openedPortal).gameObject); demogorgonKidnapperAI.openedPortal = null; } demogorgonKidnapperAI.dropCoroutine = null; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__21 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DemogorgonKidnapperAI <>4__this; public bool isInUpsideDown; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__21(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_007c: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; DemogorgonKidnapperAI demogorgonKidnapperAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; ((EnemyAI)demogorgonKidnapperAI).agent.speed = 0f; <>2__current = demogorgonKidnapperAI.DigCoroutine(isInUpsideDown, demogorgonKidnapperAI.closestPortal); <>1__state = 1; return true; case 1: { <>1__state = -1; demogorgonKidnapperAI.DoAnimationEveryoneRpc("startMove"); float distanceWithPlayer = default(float); if (!LFCEnemyManager.TargetClosestPlayerInAnyCase((EnemyAI)(object)demogorgonKidnapperAI, ref distanceWithPlayer, false) || demogorgonKidnapperAI.ShouldLoseTarget(distanceWithPlayer)) { ((EnemyAI)demogorgonKidnapperAI).StartSearch(((Component)demogorgonKidnapperAI).transform.position, (AISearchRoutine)null); ((EnemyAI)demogorgonKidnapperAI).SwitchToBehaviourClientRpc(0); } else { ((EnemyAI)demogorgonKidnapperAI).SwitchToBehaviourClientRpc(2); } if ((Object)(object)demogorgonKidnapperAI.openedPortal != (Object)null) { Object.Destroy((Object)(object)((Component)demogorgonKidnapperAI.openedPortal).gameObject); demogorgonKidnapperAI.openedPortal = null; } demogorgonKidnapperAI.portalingCoroutine = null; return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__14 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public DemogorgonKidnapperAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__14(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00b3: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; DemogorgonKidnapperAI demogorgonKidnapperAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; ((EnemyAI)demogorgonKidnapperAI).agent.speed = 0f; demogorgonKidnapperAI.DoAnimationEveryoneRpc("startSetIn"); demogorgonKidnapperAI.PlayAudioEveryoneRpc(0); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)demogorgonKidnapperAI, "setin", 10f, 0); <>1__state = 1; return true; case 1: <>1__state = -1; demogorgonKidnapperAI.DoAnimationEveryoneRpc("startSet"); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)demogorgonKidnapperAI, "set", 10f, 0); <>1__state = 2; return true; case 2: <>1__state = -1; demogorgonKidnapperAI.openedPortal = MapObjectsManager.SpawnUpsideDownPortalForServer(((Component)demogorgonKidnapperAI).transform.position, ((EnemyAI)demogorgonKidnapperAI).isOutside, isFake: true); demogorgonKidnapperAI.DoAnimationEveryoneRpc("startSetOut"); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)demogorgonKidnapperAI, "setout", 10f, 0); <>1__state = 3; return true; case 3: <>1__state = -1; <>2__current = demogorgonKidnapperAI.DigCoroutine(DimensionRegistry.IsInUpsideDown(((Component)((EnemyAI)demogorgonKidnapperAI).targetPlayer).gameObject), demogorgonKidnapperAI.openedPortal); <>1__state = 4; return true; case 4: <>1__state = -1; demogorgonKidnapperAI.DoAnimationEveryoneRpc("startMove"); ((EnemyAI)demogorgonKidnapperAI).SwitchToBehaviourClientRpc(2); demogorgonKidnapperAI.setCoroutine = null; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__24 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB player; public DemogorgonKidnapperAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__24(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; DemogorgonKidnapperAI demogorgonKidnapperAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; if ((Object)(object)player == (Object)null || DimensionRegistry.IsInUpsideDown(((Component)demogorgonKidnapperAI).gameObject)) { if ((Object)(object)player != (Object)null) { LFCNetworkManager.Instance.DamagePlayerEveryoneRpc((int)player.playerClientId, 80, true, true, 8); } demogorgonKidnapperAI.PlayAudioEveryoneRpc(5); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)demogorgonKidnapperAI, "recover", 10f, 0); <>1__state = 1; return true; } demogorgonKidnapperAI.GrabPlayerEveryoneRpc((int)player.playerClientId); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)demogorgonKidnapperAI, "grab", 10f, 0); <>1__state = 2; return true; case 1: <>1__state = -1; demogorgonKidnapperAI.DoAnimationEveryoneRpc("startMove"); break; case 2: <>1__state = -1; demogorgonKidnapperAI.DoAnimationEveryoneRpc("startCarry"); break; } if ((Object)(object)demogorgonKidnapperAI.carriedPlayer != (Object)null) { ((EnemyAI)demogorgonKidnapperAI).SwitchToBehaviourClientRpc(1); } demogorgonKidnapperAI.CancelDashCoroutine(); demogorgonKidnapperAI.stopDashCoroutine = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public Transform GrabPoint; public Transform cameraPivot; public Camera camera; public Camera playerCamera; public Coroutine setCoroutine; public Coroutine dropCoroutine; public UpsideDownPortal openedPortal; public PlayerControllerB carriedPlayer; public 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; } [IteratorStateMachine(typeof(d__14))] public IEnumerator SetCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__14(0) { <>4__this = this }; } 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); } } [IteratorStateMachine(typeof(d__17))] public IEnumerator DropCoroutine(PlayerControllerB player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__17(0) { <>4__this = this, player = player }; } 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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1507312492u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref isInUpsideDown, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1507312492u, val2, 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_0010: Unknown result type (might be due to invalid IL or missing references) UpsideDownPortal[] upsideDownPortals = MapObjectsManager.GetUpsideDownPortals(); if (upsideDownPortals.Length != 0) { UpsideDownPortal furthestPortal = MapObjectsManager.GetFurthestPortal(((Component)player).transform.position); furthestPortal.CorruptPortalForServer(player); } } [IteratorStateMachine(typeof(d__21))] public IEnumerator PortalingCoroutine(bool isInUpsideDown) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__21(0) { <>4__this = this, isInUpsideDown = isInUpsideDown }; } [IteratorStateMachine(typeof(d__22))] public IEnumerator DigCoroutine(bool isInUpsideDown, UpsideDownPortal targetedPortal) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__22(0) { <>4__this = this, isInUpsideDown = isInUpsideDown, targetedPortal = targetedPortal }; } 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)); } } [IteratorStateMachine(typeof(d__24))] public override IEnumerator StopDashCoroutine(PlayerControllerB player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__24(0) { <>4__this = this, player = player }; } [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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1989075469u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1989075469u, val2, 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 LimadonAI : UpsideDownEnemyAI { public enum State { WANDERING, CHASING } public enum Sound { SPAWN, SWING, ROAR, JUMP, LAND, CHARGE } [CompilerGenerated] private sealed class d__36 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public LimadonAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__36(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; LimadonAI limadonAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; ((EnemyAI)limadonAI).agent.speed = 0f; limadonAI.DoAnimationEveryoneRpc("startCharge"); limadonAI.PlayAudioEveryoneRpc(5); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)limadonAI, "charge", 10f, 0); <>1__state = 1; return true; case 1: <>1__state = -1; limadonAI.CancelChargeCoroutine(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__32 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public LimadonAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__32(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_0170: 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_00ba: 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_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: 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_01a1: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; LimadonAI limadonAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; ((EnemyAI)limadonAI).agent.speed = 0f; limadonAI.DoAnimationEveryoneRpc("startRoar"); limadonAI.PlayAudioEveryoneRpc(2); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)limadonAI, "roar", 10f, 0); <>1__state = 1; return true; case 1: { <>1__state = -1; limadonAI.DoAnimationEveryoneRpc("startJump"); limadonAI.PlayAudioEveryoneRpc(3); Vector3 val = ((Vector3.Distance(((Component)((EnemyAI)limadonAI).targetPlayer).transform.position, ((Component)limadonAI).transform.position) > 25f) ? ((Component)limadonAI).transform.position : ((Component)((EnemyAI)limadonAI).targetPlayer).transform.position); ((EnemyAI)limadonAI).agent.angularSpeed = 0f; ((EnemyAI)limadonAI).agent.acceleration = 100f; ((EnemyAI)limadonAI).SetDestinationToPosition(val, false); ((EnemyAI)limadonAI).agent.SetDestination(val); ((EnemyAI)limadonAI).agent.speed = ((EnemyAI)limadonAI).agent.remainingDistance / limadonAI.jumpDuration; <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)limadonAI, "jump", 10f, 0); <>1__state = 2; return true; } case 2: { <>1__state = -1; ((EnemyAI)limadonAI).agent.speed = 0f; limadonAI.isSplashing = true; limadonAI.PlayAudioEveryoneRpc(4); StrangerThingsNetworkManager.Instance.PlayPoisonExplosionEveryoneRpc(((Component)limadonAI).transform.position); Vector3 position = default(Vector3); if (((EnemyAI)limadonAI).enemyHP > 4 && LFCEnemyManager.TryGetSafeRandomNavMeshPosition((EnemyAI)(object)limadonAI, ((Component)limadonAI).transform.position, 3f, ref position, 15)) { ((MonoBehaviour)limadonAI).StartCoroutine(limadonAI.SpawnEnemyCoroutine(position)); limadonAI.DeductHealthEveryoneRpc(((EnemyAI)limadonAI).enemyHP - 4); } limadonAI.isSplashing = false; limadonAI.DoAnimationEveryoneRpc("startDigOut"); limadonAI.PlayAudioEveryoneRpc(0); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)limadonAI, "spawn", 10f, 0); <>1__state = 3; return true; } case 3: <>1__state = -1; limadonAI.CancelJumpCoroutine(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__22 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public LimadonAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__22(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0088: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; LimadonAI limadonAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; ((EnemyAI)limadonAI).agent.speed = 0f; if (limadonAI.LimadonSounds.Length != 0) { ((EnemyAI)limadonAI).creatureSFX.PlayOneShot(limadonAI.LimadonSounds[0]); } <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)limadonAI, "spawn", 10f, 0); <>1__state = 1; return true; case 1: <>1__state = -1; ((EnemyAI)limadonAI).agent.speed = 2f; ((EnemyAI)limadonAI).StartSearch(((Component)limadonAI).transform.position, (AISearchRoutine)null); ((EnemyAI)limadonAI).currentBehaviourStateIndex = 0; limadonAI.CancelSpawnCoroutine(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__33 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Vector3 position; public LimadonAI <>4__this; private LimadonAI 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__33(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //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) int num = <>1__state; LimadonAI limadonAI = <>4__this; switch (num) { default: return false; case 0: { <>1__state = -1; GameObject val = Object.Instantiate(StrangerThings.limadonType.enemyPrefab, position, Quaternion.identity); NetworkObject componentInChildren = val.GetComponentInChildren(); componentInChildren.Spawn(true); 5__2 = ((Component)componentInChildren).GetComponentInChildren(); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)5__2, "spawn", 10f, 0); <>1__state = 1; return true; } case 1: <>1__state = -1; 5__2.InitializeDuplicateEveryoneRpc(((Object)(object)((EnemyAI)limadonAI).targetPlayer != (Object)null) ? ((int)((EnemyAI)limadonAI).targetPlayer.playerClientId) : (-1)); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__28 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public LimadonAI <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__28(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; LimadonAI limadonAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; limadonAI.CancelActionsForServer(); ((EnemyAI)limadonAI).agent.speed = 0f; limadonAI.DoAnimationEveryoneRpc("startStun"); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)limadonAI, "stun", 10f, 0); <>1__state = 1; return true; case 1: <>1__state = -1; goto IL_008e; case 2: <>1__state = -1; goto IL_008e; case 3: { <>1__state = -1; break; } IL_008e: if (((EnemyAI)limadonAI).stunNormalizedTimer > 0f) { <>2__current = null; <>1__state = 2; return true; } break; } if (((EnemyAI)limadonAI).postStunInvincibilityTimer > 0f) { <>2__current = null; <>1__state = 3; return true; } switch (((EnemyAI)limadonAI).currentBehaviourStateIndex) { case 0: limadonAI.DoAnimationEveryoneRpc("startCrawl"); if ((Object)(object)((EnemyAI)limadonAI).stunnedByPlayer != (Object)null) { ((EnemyAI)limadonAI).targetPlayer = ((EnemyAI)limadonAI).stunnedByPlayer; ((EnemyAI)limadonAI).StopSearch(((EnemyAI)limadonAI).currentSearch, true); ((EnemyAI)limadonAI).SwitchToBehaviourClientRpc(1); } break; case 1: limadonAI.DoAnimationEveryoneRpc("startCrawl"); break; } limadonAI.stunCoroutine = null; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__40 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public LimadonAI <>4__this; public int playerId; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__40(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; LimadonAI limadonAI = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; ((EnemyAI)limadonAI).agent.speed = 0f; limadonAI.DoAnimationEveryoneRpc("startSwing"); limadonAI.PlayAudioEveryoneRpc(1); <>2__current = LFCEnemyManager.WaitForFullAnimation((EnemyAI)(object)limadonAI, "swing", 10f, 0); <>1__state = 1; return true; case 1: <>1__state = -1; LFCNetworkManager.Instance.DamagePlayerEveryoneRpc(playerId, 10, true, true, 8); limadonAI.DoAnimationEveryoneRpc("startCrawl"); ((EnemyAI)limadonAI).agent.speed = 6f; limadonAI.swingCoroutine = null; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public Transform TurnCompass; public AudioClip[] CrawlSounds = Array.Empty(); public AudioClip[] LimadonSounds = Array.Empty(); public float crawlTimer; public float jumpTimer = 15f; public 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(); if (spawnCoroutine == null) { spawnCoroutine = ((MonoBehaviour)this).StartCoroutine(SpawnCoroutine()); } } [IteratorStateMachine(typeof(d__22))] public IEnumerator SpawnCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__22(0) { <>4__this = this }; } 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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2193107535u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2193107535u, val2, 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.Equals("crawl")) { crawlTimer -= Time.deltaTime; if (CrawlSounds.Length != 0 && crawlTimer <= 0f) { ((EnemyAI)this).creatureSFX.PlayOneShot(CrawlSounds[Random.Range(0, CrawlSounds.Length)]); crawlTimer = 1f; } } } 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()); } } [IteratorStateMachine(typeof(d__28))] public IEnumerator StunCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__28(0) { <>4__this = this }; } 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); } [IteratorStateMachine(typeof(d__32))] public IEnumerator JumpCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__32(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__33))] 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) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__33(0) { <>4__this = this, position = position }; } [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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2718858014u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, newHP); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2718858014u, val2, 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; } } [IteratorStateMachine(typeof(d__36))] public IEnumerator ChargeCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__36(0) { <>4__this = this }; } 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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3680966314u, val2, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3680966314u, val2, 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)); } } [IteratorStateMachine(typeof(d__40))] public IEnumerator SwingCoroutine(int playerId) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__40(0) { <>4__this = this, playerId = playerId }; } 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 PlayAudioEveryoneRpc(int enemySound) { //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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2816698808u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, enemySound); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2816698808u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)((NetworkBehaviour)this).__rpc_exec_stage == 1) { ((NetworkBehaviour)this).__rpc_exec_stage = (__RpcExecStage)0; if (LimadonSounds.Length != 0) { ((EnemyAI)this).creatureSFX.PlayOneShot(LimadonSounds[enemySound]); } } } [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 val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3468167854u, val2, val, (SendTo)6, (RpcDelivery)0); bool flag = animationState != null; ((FastBufferWriter)(ref val3)).WriteValueSafe(ref flag, default(ForPrimitives)); if (flag) { ((FastBufferWriter)(ref val3)).WriteValueSafe(animationState, false); } ((NetworkBehaviour)this).__endSendRpc(ref val3, 3468167854u, val2, 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(2816698808u, new RpcReceiveHandler(__rpc_handler_2816698808), "PlayAudioEveryoneRpc"); ((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_2816698808(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 enemySound = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref enemySound); target.__rpc_exec_stage = (__RpcExecStage)1; ((LimadonAI)(object)target).PlayAudioEveryoneRpc(enemySound); 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; public 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(); } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace StrangerThings.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }