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.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LegaFusionCore.Behaviours; using LegaFusionCore.Managers; using LegaFusionCore.Managers.NetworkManagers; using LegaFusionCore.ModsCompat; using LegaFusionCore.NetcodePatcher; using LegaFusionCore.Patches; using LegaFusionCore.Registries; using LegaFusionCore.Utilities; using LethalLib.Modules; using Microsoft.CodeAnalysis; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.InputSystem; using UnityEngine.Rendering; using UnityEngine.Rendering.HighDefinition; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [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: AssemblyCompany("LegaFusionCore")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("LegaFusionCore")] [assembly: AssemblyTitle("LegaFusionCore")] [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.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace LegaFusionCore { public class Constants { public const string STAT_SPEED = "Speed"; public const string KNIFE_PREFAB = "KnifeItem"; public const string MOUTH_DOG_PREFAB = "MouthDog"; public const string EARTH_LEVIATHAN_PREFAB = "SandWorm"; public const string BLOOD_PARTICLES = "BloodParticle"; public const string GROUND_PARTICLES = "AppearFromGround1"; public const string MESSAGE_NO_SHIP_ENERGY = "Not enough energy left..."; public const string MESSAGE_DEFAULT_ITEM_CHARGER = "(Requires battery-powered item)"; public const string MESSAGE_DEFAULT_SHIP_LEVER = "[Wait for ship to land]"; } [BepInPlugin("Lega.LegaFusionCore", "Lega Fusion Core", "1.1.1")] public class LegaFusionCore : BaseUnityPlugin { public const string modGUID = "Lega.LegaFusionCore"; public const string modName = "Lega Fusion Core"; public const string modVersion = "1.1.1"; private readonly Harmony harmony = new Harmony("Lega.LegaFusionCore"); private static readonly AssetBundle bundle = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "legafusioncore")); internal static ManualLogSource mls; public static GameObject managerPrefab = NetworkPrefabs.CreateNetworkPrefab("LFCNetworkManager"); public static Material wallhackShader; public static Material transparentShader; public static GameObject smokeParticle; public static GameObject darkExplosionParticle; public static GameObject brownExplosionParticle; public static GameObject poisonExplosionParticle; public static GameObject lightningExplosionParticle; public static GameObject bluePortalParticle; public static GameObject redPortalParticle; public static GameObject poofExplosionAudio; public static GameObject poisonExplosionAudio; public static GameObject lightningExplosionAudio; public static GameObject hitProjectileAudio; public void Awake() { mls = Logger.CreateLogSource("LegaFusionCore"); LoadManager(); NetcodePatcher(); LoadPrefabs(); LoadNetworkPrefabs(); harmony.PatchAll(typeof(MenuManagerPatch)); harmony.PatchAll(typeof(StartOfRoundPatch)); harmony.PatchAll(typeof(RoundManagerPatch)); harmony.PatchAll(typeof(NetworkBehaviourPatch)); harmony.PatchAll(typeof(HangarShipDoorPatch)); harmony.PatchAll(typeof(ItemChargerPatch)); harmony.PatchAll(typeof(ManualCameraRendererPatch)); harmony.PatchAll(typeof(ShipLightsPatch)); harmony.PatchAll(typeof(ShipTeleporterPatch)); harmony.PatchAll(typeof(TVScriptPatch)); harmony.PatchAll(typeof(PlayerControllerBPatch)); harmony.PatchAll(typeof(GrabbableObjectPatch)); harmony.PatchAll(typeof(EnemyAIPatch)); harmony.PatchAll(typeof(VehicleControllerPatch)); GeneralImprovementsSoftCompat.Patch(harmony); GoodItemScanSoftCompat.Patch(harmony); ModelReplacementAPISoftCompat.Patch(harmony); MoreCompantSoftCompat.Patch(harmony); NameplateTweaksSoftCompat.Patch(harmony); SelfSortingStorageSoftCompat.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.ContainsGenericParameters) { methodInfo.Invoke(null, null); } } } } public void LoadPrefabs() { wallhackShader = bundle.LoadAsset("Assets/Shaders/M_Wallhack.mat"); transparentShader = bundle.LoadAsset("Assets/Shaders/M_Transparent.mat"); } public void LoadNetworkPrefabs() { HashSet hashSet = new HashSet { smokeParticle = bundle.LoadAsset("Assets/Particles/SmokeParticle.prefab"), darkExplosionParticle = bundle.LoadAsset("Assets/Particles/DarkExplosionParticle.prefab"), brownExplosionParticle = bundle.LoadAsset("Assets/Particles/BrownExplosionParticle.prefab"), poisonExplosionParticle = bundle.LoadAsset("Assets/Particles/PoisonExplosionParticle.prefab"), lightningExplosionParticle = bundle.LoadAsset("Assets/Particles/LightningExplosionParticle.prefab"), bluePortalParticle = bundle.LoadAsset("Assets/Particles/BluePortalParticle.prefab"), redPortalParticle = bundle.LoadAsset("Assets/Particles/RedPortalParticle.prefab"), poofExplosionAudio = bundle.LoadAsset("Assets/Audios/PoofExplosionAudio.prefab"), poisonExplosionAudio = bundle.LoadAsset("Assets/Audios/PoisonExplosionAudio.prefab"), lightningExplosionAudio = bundle.LoadAsset("Assets/Audios/LightningExplosionAudio.prefab"), hitProjectileAudio = bundle.LoadAsset("Assets/Audios/HitProjectileAudio.prefab") }; foreach (GameObject item in hashSet) { NetworkPrefabs.RegisterNetworkPrefab(item); Utilities.FixMixerGroups(item); LFCPrefabRegistry.RegisterPrefab("Lega Fusion Core" + ((Object)item).name, item); } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "LegaFusionCore"; public const string PLUGIN_NAME = "LegaFusionCore"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace LegaFusionCore.Utilities { public static class LFCUtilities { public static PlayerControllerB LocalPlayer => GameNetworkManager.Instance?.localPlayerController; public static bool IsServer { get { if ((Object)(object)LocalPlayer != (Object)null) { if (!((NetworkBehaviour)LocalPlayer).IsServer) { return ((NetworkBehaviour)LocalPlayer).IsHost; } return true; } return false; } } public static bool ShouldBeLocalPlayer(PlayerControllerB player) { if ((Object)(object)player != (Object)null) { return (Object)(object)player == (Object)(object)GameNetworkManager.Instance?.localPlayerController; } return false; } public static bool ShouldNotBeLocalPlayer(PlayerControllerB player) { if ((Object)(object)player != (Object)null) { return (Object)(object)player != (Object)(object)GameNetworkManager.Instance?.localPlayerController; } return false; } public static ulong EncodePlayerId(ulong playerClientId) { return 0x8000000000000000uL | playerClientId; } public static bool TryGetComponentInParent(this GameObject gameObject, out T result) where T : Component { result = gameObject.GetComponentInParent(); return (Object)(object)result != (Object)null; } public static bool TryGetComponentInChildren(this GameObject gameObject, out T result) where T : Component { result = gameObject.GetComponentInChildren(); return (Object)(object)result != (Object)null; } public static void Shuffle(IList list) { for (int num = list.Count - 1; num > 0; num--) { int num2 = Random.Range(0, num + 1); int index = num2; int index2 = num; T value = list[num]; T value2 = list[num2]; list[index] = value; list[index2] = value2; } } public static string GetGameObjectName(GameObject gObject) { if ((Object)(object)gObject == (Object)null) { return string.Empty; } string text = ((Object)gObject).name ?? string.Empty; if (text.EndsWith("(Clone)", StringComparison.Ordinal)) { string text2 = text; int length = "(Clone)".Length; text = text2.Substring(0, text2.Length - length); } return text.Trim(); } public static bool HasNameFromList(string name, string listName) { if (string.IsNullOrWhiteSpace(name) || string.IsNullOrWhiteSpace(listName)) { return false; } string[] array = listName.Split(','); foreach (string text in array) { string text2 = text.Trim(); if (text2.Length != 0 && string.Equals(text2, name, StringComparison.Ordinal)) { return true; } } return false; } public static void UpdateTimer(ref float timer, float cooldown, bool isActive, Action onReady) { if (isActive) { timer += Time.deltaTime; if (timer >= cooldown) { timer = 0f; onReady?.Invoke(); } } } public static GameObject GetPrefabFromName(string name) { GameObject val = null; IEnumerable networkPrefabsLists = NetworkManager.Singleton.NetworkConfig.Prefabs.NetworkPrefabsLists; foreach (NetworkPrefabsList item in networkPrefabsLists ?? Enumerable.Empty()) { IEnumerable prefabList = item.PrefabList; foreach (NetworkPrefab item2 in prefabList ?? Enumerable.Empty()) { if (((Object)item2.Prefab).name.Equals(name)) { val = item2.Prefab; if ((Object)(object)val != (Object)null) { break; } } } } return val; } public static T GetSafeComponent(GameObject gameObject) where T : Component { if (!((Object)(object)gameObject == (Object)null)) { if (gameObject != null && Object.op_Implicit((Object)(object)gameObject)) { return gameObject.GetComponent(); } } return default(T); } } } namespace LegaFusionCore.Registries { public class LFCObjectStateRegistry { private static readonly Dictionary> flickeringFlashlightRegistry = new Dictionary>(); public static void AddFlickeringFlashlight(FlashlightItem flashlight, string tag) { if (!flickeringFlashlightRegistry.TryGetValue(flashlight, out var value)) { value = new HashSet(); flickeringFlashlightRegistry[flashlight] = value; } if (value.Add(tag) && value.Count == 1) { SetFlickeringFlashlightEnabled(flashlight, enabled: true); } } public static void RemoveFlickeringFlashlight(FlashlightItem flashlight, string tag) { if (flickeringFlashlightRegistry.TryGetValue(flashlight, out var value) && value.Remove(tag) && value.Count == 0) { SetFlickeringFlashlightEnabled(flashlight, enabled: false); } } public static void ClearFlickeringFlashlight() { foreach (FlashlightItem flashlight in flickeringFlashlightRegistry.Keys.ToList()) { if (flickeringFlashlightRegistry.TryGetValue(flashlight, out var value)) { value.ToList().ForEach(delegate(string t) { RemoveFlickeringFlashlight(flashlight, t); }); flickeringFlashlightRegistry.Remove(flashlight); } } } public static bool IsFlickeringFlashlight(FlashlightItem flashlight) { if (flickeringFlashlightRegistry.TryGetValue(flashlight, out var value)) { return value.Count > 0; } return false; } private static void SetFlickeringFlashlightEnabled(FlashlightItem flashlight, bool enabled) { if ((Object)(object)flashlight != (Object)null) { if (enabled) { flashlight.flashlightAudio.PlayOneShot(flashlight.flashlightFlicker); WalkieTalkie.TransmitOneShotAudio(flashlight.flashlightAudio, flashlight.flashlightFlicker, 0.8f); flashlight.flashlightInterferenceLevel = 1; } else { flashlight.flashlightInterferenceLevel = 0; } } } } public static class LFCPlayerActionRegistry { private static readonly Dictionary> lockRegistry = new Dictionary>(); public static void AddLock(string actionName, string tag) { if (!lockRegistry.TryGetValue(actionName, out var value)) { value = new HashSet(); lockRegistry[actionName] = value; } SetActionEnabled(actionName, enabled: false); value.Add(tag); } public static void RemoveLock(string actionName, string tag) { if (lockRegistry.TryGetValue(actionName, out var value) && value.Remove(tag) && value.Count == 0) { SetActionEnabled(actionName, enabled: true); } } public static bool IsLocked(string actionName) { if (lockRegistry.TryGetValue(actionName, out var value)) { return value.Count > 0; } return false; } private static void SetActionEnabled(string actionName, bool enabled) { InputAction val = IngamePlayerSettings.Instance.playerInput.actions.FindAction(actionName, false); if (val == null) { LegaFusionCore.mls.LogWarning((object)("Action '" + actionName + "' not found")); } else if (enabled) { val.Enable(); } else { val.Disable(); } } } public static class LFCPoweredLightsRegistry { private static readonly Dictionary> lockRegistry = new Dictionary>(); public static void AddLock(Animator poweredLight, string tag) { if (!lockRegistry.TryGetValue(poweredLight, out var value)) { value = new HashSet(); lockRegistry[poweredLight] = value; } SetPoweredLightEnabled(poweredLight, enabled: false); value.Add(tag); } public static void RemoveLock(Animator poweredLight, string tag) { if (lockRegistry.TryGetValue(poweredLight, out var value) && value.Remove(tag) && value.Count == 0) { SetPoweredLightEnabled(poweredLight, enabled: true); } } public static void ClearLocks() { foreach (Animator poweredLight in lockRegistry.Keys.ToList()) { if (lockRegistry.TryGetValue(poweredLight, out var value)) { value.ToList().ForEach(delegate(string t) { RemoveLock(poweredLight, t); }); lockRegistry.Remove(poweredLight); } } } public static bool IsLocked(Animator poweredLight) { if (lockRegistry.TryGetValue(poweredLight, out var value)) { return value.Count > 0; } return false; } private static void SetPoweredLightEnabled(Animator poweredLight, bool enabled) { if ((Object)(object)poweredLight != (Object)null && (Object)(object)((Component)poweredLight).gameObject != (Object)null) { poweredLight.SetBool("on", enabled); } } } public static class LFCPrefabRegistry { private static readonly Dictionary registry = new Dictionary(); public static void RegisterPrefab(string tag, GameObject prefab) { if (!registry.ContainsKey(tag)) { registry.Add(tag, prefab); } } public static GameObject GetPrefab(string tag) { registry.TryGetValue(tag, out var value); return value; } } public static class LFCShaderFilterRegistry { private static readonly Dictionary> filters = new Dictionary>(); public static void AddFilter(string modName, Func filter) { if (string.IsNullOrEmpty(modName)) { LegaFusionCore.mls.LogWarning((object)"[RendererVisibilityRegistry] Mod name is null or empty."); } else if (filter == null) { LegaFusionCore.mls.LogWarning((object)("[RendererVisibilityRegistry] Null filter provided for " + modName)); } else { filters[modName] = filter; } } public static void RemoveFilter(string modName) { if (!string.IsNullOrEmpty(modName)) { filters.Remove(modName); } } public static bool ShouldRender(GameObject sourceObject) { foreach (KeyValuePair> filter in filters) { try { if (!filter.Value(sourceObject)) { return false; } } catch (Exception arg) { LegaFusionCore.mls.LogWarning((object)$"[RendererVisibilityRegistry] Filter '{filter.Key}' threw an exception: {arg}"); } } return true; } } public static class LFCShipFeatureRegistry { public enum ShipFeatureType { SHIP_LIGHTS, MAP_SCREEN, SHIP_DOORS, SHIP_LEVER, SHIP_TERMINAL, ITEM_CHARGER, SHIP_TV, SHIP_TELEPORTERS, SMART_CUPBOARD } private static readonly Dictionary> lockRegistry = new Dictionary>(); private static HangarShipDoor shipDoor; private static StartMatchLever shipLever; private static Terminal shipTerminal; private static ItemCharger itemCharger; private static TVScript shipTV; private static List shipTeleporters = new List(); public static void AddLock(ShipFeatureType featureType, string tag) { if (!lockRegistry.TryGetValue(featureType, out var value)) { value = new HashSet(); lockRegistry[featureType] = value; } SetFeatureEnabled(featureType, enabled: false); value.Add(tag); } public static void RemoveLock(ShipFeatureType featureType, string tag) { if (lockRegistry.TryGetValue(featureType, out var value) && value.Remove(tag) && value.Count == 0) { SetFeatureEnabled(featureType, enabled: true); } } public static void ClearLocks(string tag) { foreach (ShipFeatureType item in lockRegistry.Keys.ToList()) { if (lockRegistry.TryGetValue(item, out var value) && value.Contains(tag)) { RemoveLock(item, tag); } } } public static void ClearLocks() { foreach (ShipFeatureType featureType in lockRegistry.Keys.ToList()) { if (lockRegistry.TryGetValue(featureType, out var value)) { value.ToList().ForEach(delegate(string t) { RemoveLock(featureType, t); }); } } } public static bool IsLocked(ShipFeatureType featureType) { if (lockRegistry.TryGetValue(featureType, out var value)) { return value.Count > 0; } return false; } private static void SetFeatureEnabled(ShipFeatureType featureType, bool enabled) { switch (featureType) { case ShipFeatureType.SHIP_LIGHTS: SetShipLights(enabled); break; case ShipFeatureType.MAP_SCREEN: SetMapScreen(enabled); break; case ShipFeatureType.SHIP_DOORS: SetShipDoors(enabled); break; case ShipFeatureType.SHIP_LEVER: SetShipLever(enabled); break; case ShipFeatureType.SHIP_TERMINAL: SetShipTerminal(enabled); break; case ShipFeatureType.ITEM_CHARGER: SetItemCharger(enabled); break; case ShipFeatureType.SHIP_TV: SetShipTV(enabled); break; case ShipFeatureType.SHIP_TELEPORTERS: SetShipTeleporters(enabled); break; case ShipFeatureType.SMART_CUPBOARD: SetSmartCupboard(enabled); break; default: LegaFusionCore.mls.LogWarning((object)$"[ShipFeatureRegistry] Unknown feature '{featureType}'"); break; } } private static void SetShipLights(bool enabled) { ShipLights val = StartOfRound.Instance?.shipRoomLights; if ((Object)(object)val != (Object)null) { val.areLightsOn = enabled; val.shipLightsAnimator.SetBool("lightsOn", val.areLightsOn); } } private static void SetMapScreen(bool enabled) { ManualCameraRenderer val = StartOfRound.Instance?.mapScreen; if ((Object)(object)val != (Object)null && (Object)(object)((Component)val).gameObject != (Object)null) { val.SwitchScreenOn(enabled); } } private static void SetShipDoors(bool enabled) { if (shipDoor == null) { shipDoor = Object.FindObjectOfType(); } if (!((Object)(object)shipDoor == (Object)null)) { shipDoor.hydraulicsScreenDisplayed = enabled; shipDoor.hydraulicsDisplay.SetActive(enabled); shipDoor.SetDoorButtonsEnabled(enabled); if (!enabled) { StartOfRound.Instance.shipDoorsAnimator.SetBool("Closed", enabled); shipDoor.SetDoorOpen(); } } } private static void SetShipLever(bool enabled) { if (shipLever == null) { shipLever = Object.FindObjectOfType(); } if (!((Object)(object)shipLever == (Object)null)) { shipLever.triggerScript.disabledHoverTip = (enabled ? "[Wait for ship to land]" : "Not enough energy left..."); shipLever.triggerScript.interactable = enabled; } } private static void SetShipTerminal(bool enabled) { if (shipTerminal == null) { shipTerminal = Object.FindObjectOfType(); } if (!((Object)(object)shipTerminal == (Object)null)) { if (!enabled) { shipTerminal.terminalTrigger.disabledHoverTip = "Not enough energy left..."; } shipTerminal.terminalTrigger.interactable = enabled; } } private static void SetItemCharger(bool enabled) { if (itemCharger == null) { itemCharger = Object.FindObjectOfType(); } if (!((Object)(object)itemCharger == (Object)null)) { itemCharger.triggerScript.disabledHoverTip = (enabled ? "(Requires battery-powered item)" : "Not enough energy left..."); itemCharger.triggerScript.interactable = enabled; } } private static void SetShipTV(bool enabled) { if (shipTV == null) { shipTV = Object.FindObjectOfType(); } if (!((Object)(object)shipTV == (Object)null)) { shipTV.TurnTVOnOff(enabled); } } private static void SetShipTeleporters(bool enabled) { shipTeleporters.RemoveAll((ShipTeleporter t) => (Object)(object)t == (Object)null); if (shipTeleporters.Count == 0) { shipTeleporters = Object.FindObjectsOfType().ToList(); } foreach (ShipTeleporter shipTeleporter in shipTeleporters) { shipTeleporter.buttonTrigger.interactable = enabled; } } private static void SetSmartCupboard(bool enabled) { SelfSortingStorageSoftCompat.SwitchLights(enabled); } public static void ResetCache() { shipDoor = null; shipLever = null; shipTerminal = null; itemCharger = null; shipTV = null; shipTeleporters.Clear(); } } public static class LFCSpawnableItemRegistry { public class SpawnableItem { public Type Type { get; } public Item Item { get; } public int MinSpawn { get; } public int MaxSpawn { get; } public int Rarity { get; } public int MinValue { get; } public int MaxValue { get; } public SpawnableItem(Type type, Item item, int minSpawn, int maxSpawn, int rarity, int minValue, int maxValue) { Type = type; Item = item; MinSpawn = minSpawn; MaxSpawn = maxSpawn; Rarity = rarity; MinValue = minValue; MaxValue = maxValue; base..ctor(); } public override bool Equals(object obj) { if (obj is SpawnableItem spawnableItem) { return (Object)(object)spawnableItem.Item == (Object)(object)Item; } return false; } public override int GetHashCode() { return ((object)Item)?.GetHashCode() ?? 0; } } private static readonly HashSet spawnableItems = new HashSet(); public static void Add(Type type, Item item, int minSpawn, int maxSpawn, int rarity, int minValue = 0, int maxValue = 0) { LFCObjectsManager.RegisterObject(type, item); spawnableItems.Add(new SpawnableItem(type, item, minSpawn, maxSpawn, rarity, minValue, maxValue)); } public static IReadOnlyCollection GetAll() { return spawnableItems; } } public static class LFCSpawnRegistry { private static readonly Dictionary> registry = new Dictionary>(); public static void Add(Component obj) { if (!((Object)(object)obj == (Object)null)) { Type type = ((object)obj).GetType(); if (!registry.TryGetValue(type, out var value)) { value = new HashSet(); registry[type] = value; } if (!value.Contains(obj)) { value.Add(obj); } } } public static void Remove(Component obj) { if ((Object)(object)obj == (Object)null) { return; } Type type = ((object)obj).GetType(); if (registry.TryGetValue(type, out var value)) { value.RemoveWhere((Component c) => (Object)(object)c == (Object)null || (Object)(object)c == (Object)(object)obj); } } public static List GetAllAs() where T : Component { List list = new List(); foreach (KeyValuePair> item in registry) { item.Value.RemoveWhere((Component c) => (Object)(object)c == (Object)null); foreach (Component item2 in item.Value) { if ((Object)(object)item2 != (Object)null) { T val = (T)(object)((item2 is T) ? item2 : null); if (val != null) { list.Add(val); } } } } return list; } public static HashSet GetSetExact() where T : Component { if (!registry.TryGetValue(typeof(T), out var value)) { return null; } return value; } public static void Clear() { registry.Clear(); } } public static class LFCStatRegistry { private class StatEntry { public float baseValue; public float? minValue; public float? maxValue; public readonly Dictionary modifiers = new Dictionary(); public float FinalValue { get { float num = 1f + modifiers.Values.Sum(); float num2 = baseValue * num; if (minValue.HasValue) { num2 = Mathf.Max(minValue.Value, num2); } if (maxValue.HasValue) { num2 = Mathf.Min(maxValue.Value, num2); } return num2; } } } private static readonly Dictionary stats = new Dictionary(); public static void RegisterStat(string id, float baseValue, float? min = null, float? max = null) { stats[id] = new StatEntry { baseValue = baseValue, minValue = min, maxValue = max }; } public static void SetBaseValue(string id, float newBase) { if (stats.TryGetValue(id, out var value)) { value.baseValue = newBase; } } public static void AddModifier(string id, string tag, float value) { if (stats.TryGetValue(id, out var value2)) { value2.modifiers[tag] = value; } } public static void RemoveModifier(string id, string tag) { if (stats.TryGetValue(id, out var value)) { value.modifiers.Remove(tag); } } public static bool HasModifier(string id, string sourceTag) { if (stats.TryGetValue(id, out var value)) { return value.modifiers.ContainsKey(sourceTag); } return false; } public static bool HasModifierWithTagPrefix(string id, string tagPrefix) { if (stats.TryGetValue(id, out var value)) { foreach (string key in value.modifiers.Keys) { if (key != null && key.StartsWith(tagPrefix, StringComparison.Ordinal)) { return true; } } } return false; } public static float? GetFinalValue(string id) { if (!stats.TryGetValue(id, out var value)) { return null; } return value.FinalValue; } public static float GetSumModifier(string id) { if (!stats.TryGetValue(id, out var value)) { return 0f; } return value.modifiers.Values.Sum(); } public static void ClearModifiers(string id) { if (stats.TryGetValue(id, out var value)) { value.modifiers.Clear(); } } public static void ClearModifiersWithTagPrefix(string id, string tagPrefix) { if (!stats.TryGetValue(id, out var value)) { return; } foreach (string item in value.modifiers.Keys.ToList()) { if (item != null && item.StartsWith(tagPrefix, StringComparison.Ordinal)) { value.modifiers.Remove(item); } } } } public class LFCVisibilityRegistry { private sealed class EntityState { public readonly HashSet tags = new HashSet(); public readonly HashSet disabledRenderers = new HashSet(); public readonly HashSet disabledLights = new HashSet(); public readonly HashSet disabledGravitys = new HashSet(); public readonly HashSet disabledPhysicsRegions = new HashSet(); public readonly HashSet disabledColliders = new HashSet(); public readonly HashSet disabledTextMeshes = new HashSet(); public readonly HashSet disabledDecals = new HashSet(); public readonly HashSet disabledInteractTriggers = new HashSet(); public readonly HashSet disabledAnimatedTriggers = new HashSet(); public readonly HashSet disabledParticles = new HashSet(); public readonly Dictionary audioVolumes = new Dictionary(); } private static readonly Dictionary visibilityStates = new Dictionary(); public static void Hide(GameObject entity, string tag) { if (!((Object)(object)entity == (Object)null)) { if (string.IsNullOrWhiteSpace(tag)) { tag = "default"; } CleanupDeadEntries(); if (!visibilityStates.TryGetValue(entity, out var value)) { value = new EntityState(); visibilityStates[entity] = value; } HideInternal(entity, value); value.tags.Add(tag); } } public static void Restore(GameObject entity, string tag) { if (!((Object)(object)entity == (Object)null) && visibilityStates.TryGetValue(entity, out var value)) { if (string.IsNullOrWhiteSpace(tag)) { tag = "default"; } value.tags.Remove(tag); if (value.tags.Count <= 0) { RestoreInternal(entity, value); } } } public static void ForceRestore(GameObject entity) { if ((Object)(object)entity != (Object)null && visibilityStates.TryGetValue(entity, out var value)) { RestoreInternal(entity, value); } } public static bool IsHidden(GameObject entity) { if ((Object)(object)entity != (Object)null) { return visibilityStates.ContainsKey(entity); } return false; } private static void HideInternal(GameObject entity, EntityState state) { if ((Object)(object)LFCUtilities.LocalPlayer != (Object)null && entity.TryGetComponentInParent(out VehicleController result)) { result.startKeyIgnitionTrigger.SetActive(false); result.removeKeyIgnitionTrigger.SetActive(false); result.backDoorContainer.SetActive(false); result.destroyedTruckMesh.SetActive(false); result.truckDestroyedExplosion.SetActive(false); result.backLightsContainer.SetActive(false); result.frontCabinLightContainer.SetActive(false); result.headlightsContainer.SetActive(false); result.SetVehicleCollisionForPlayer(false, LFCUtilities.LocalPlayer); } Renderer[] componentsInChildren = entity.GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { if ((Object)(object)val != (Object)null && val.enabled) { val.enabled = false; state.disabledRenderers.Add(val); } } Light[] componentsInChildren2 = entity.GetComponentsInChildren(true); foreach (Light val2 in componentsInChildren2) { if ((Object)(object)val2 != (Object)null && ((Behaviour)val2).enabled) { ((Behaviour)val2).enabled = false; state.disabledLights.Add(val2); } } Rigidbody[] componentsInChildren3 = entity.GetComponentsInChildren(true); foreach (Rigidbody val3 in componentsInChildren3) { if ((Object)(object)val3 != (Object)null && val3.useGravity) { val3.useGravity = false; state.disabledGravitys.Add(val3); } } PlayerPhysicsRegion[] componentsInChildren4 = entity.GetComponentsInChildren(true); foreach (PlayerPhysicsRegion val4 in componentsInChildren4) { if ((Object)(object)val4 != (Object)null && !val4.disablePhysicsRegion) { val4.disablePhysicsRegion = true; state.disabledPhysicsRegions.Add(val4); } } Collider[] componentsInChildren5 = entity.GetComponentsInChildren(true); foreach (Collider val5 in componentsInChildren5) { if ((Object)(object)val5 != (Object)null && val5.enabled) { val5.enabled = false; state.disabledColliders.Add(val5); } } TextMeshProUGUI[] componentsInChildren6 = entity.GetComponentsInChildren(true); foreach (TextMeshProUGUI val6 in componentsInChildren6) { if ((Object)(object)val6 != (Object)null && ((Behaviour)val6).enabled) { ((Behaviour)val6).enabled = false; state.disabledTextMeshes.Add(val6); } } DecalProjector[] componentsInChildren7 = entity.GetComponentsInChildren(true); foreach (DecalProjector val7 in componentsInChildren7) { if ((Object)(object)val7 != (Object)null && ((Behaviour)val7).enabled) { ((Behaviour)val7).enabled = false; state.disabledDecals.Add(val7); } } InteractTrigger[] componentsInChildren8 = entity.GetComponentsInChildren(true); foreach (InteractTrigger val8 in componentsInChildren8) { if ((Object)(object)val8 != (Object)null && val8.interactable) { val8.interactable = false; state.disabledInteractTriggers.Add(val8); } } ParticleSystem[] componentsInChildren9 = entity.GetComponentsInChildren(true); foreach (ParticleSystem val9 in componentsInChildren9) { if ((Object)(object)val9 != (Object)null && val9.isPlaying) { val9.Stop(true, (ParticleSystemStopBehavior)1); state.disabledParticles.Add(val9); } } AudioSource[] componentsInChildren10 = entity.GetComponentsInChildren(true); foreach (AudioSource val10 in componentsInChildren10) { if ((Object)(object)val10 != (Object)null && val10.volume > 0f) { state.audioVolumes[val10] = val10.volume; val10.volume = 0f; } } } private static void RestoreInternal(GameObject entity, EntityState state) { if ((Object)(object)LFCUtilities.LocalPlayer != (Object)null && entity.TryGetComponentInParent(out VehicleController result)) { if (!result.carDestroyed) { result.startKeyIgnitionTrigger.SetActive(true); result.removeKeyIgnitionTrigger.SetActive(true); result.backDoorContainer.SetActive(true); result.backLightsContainer.SetActive(true); result.frontCabinLightContainer.SetActive(true); result.headlightsContainer.SetActive(true); } else { result.destroyedTruckMesh.SetActive(true); } result.SetVehicleCollisionForPlayer(true, LFCUtilities.LocalPlayer); } foreach (Renderer disabledRenderer in state.disabledRenderers) { if ((Object)(object)disabledRenderer != (Object)null) { disabledRenderer.enabled = true; } } foreach (Light disabledLight in state.disabledLights) { if ((Object)(object)disabledLight != (Object)null) { ((Behaviour)disabledLight).enabled = true; CullFactorySoftCompat.RefreshLightPosition(disabledLight); } } foreach (Collider disabledCollider in state.disabledColliders) { if ((Object)(object)disabledCollider != (Object)null) { disabledCollider.enabled = true; } } foreach (PlayerPhysicsRegion disabledPhysicsRegion in state.disabledPhysicsRegions) { if ((Object)(object)disabledPhysicsRegion != (Object)null) { disabledPhysicsRegion.disablePhysicsRegion = false; } } foreach (Rigidbody disabledGravity in state.disabledGravitys) { if ((Object)(object)disabledGravity != (Object)null) { disabledGravity.useGravity = true; } } foreach (TextMeshProUGUI disabledTextMesh in state.disabledTextMeshes) { if ((Object)(object)disabledTextMesh != (Object)null) { ((Behaviour)disabledTextMesh).enabled = true; } } foreach (DecalProjector disabledDecal in state.disabledDecals) { if ((Object)(object)disabledDecal != (Object)null) { ((Behaviour)disabledDecal).enabled = true; } } foreach (InteractTrigger disabledInteractTrigger in state.disabledInteractTriggers) { if ((Object)(object)disabledInteractTrigger != (Object)null) { disabledInteractTrigger.interactable = true; } } foreach (ParticleSystem disabledParticle in state.disabledParticles) { if ((Object)(object)disabledParticle != (Object)null && (Object)(object)((Component)disabledParticle).gameObject != (Object)null) { disabledParticle.Play(true); } } foreach (KeyValuePair audioVolume in state.audioVolumes) { if ((Object)(object)audioVolume.Key != (Object)null) { audioVolume.Key.volume = audioVolume.Value; } } if (entity.TryGetComponentInParent(out GrabbableObject result2)) { CullFactorySoftCompat.RefreshGrabbableObjectPosition(result2); } state.tags.Clear(); visibilityStates.Remove(entity); } private static void CleanupDeadEntries() { List list = null; foreach (KeyValuePair visibilityState in visibilityStates) { if ((Object)(object)visibilityState.Key == (Object)null) { if (list == null) { list = new List(); } list.Add(visibilityState.Key); } } if (list == null) { return; } foreach (GameObject item in list) { visibilityStates.Remove(item); } } } } namespace LegaFusionCore.Patches { public class EnemyAIPatch { [HarmonyPatch(typeof(EnemyAI), "Start")] [HarmonyPostfix] public static void PostStart(EnemyAI __instance) { LFCEnemySpeedBehaviour lFCEnemySpeedBehaviour = default(LFCEnemySpeedBehaviour); if (!((Component)__instance).TryGetComponent(ref lFCEnemySpeedBehaviour)) { LFCEnemySpeedBehaviour lFCEnemySpeedBehaviour2 = ((Component)__instance).gameObject.AddComponent(); lFCEnemySpeedBehaviour2.enemy = __instance; } LFCEnemyDamageBehaviour.InitExtendedHP(__instance); } [HarmonyPatch(typeof(EnemyAI), "HitEnemy")] [HarmonyPostfix] public static void HitEnemyPostfix(EnemyAI __instance, int force = 1, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { int rateHP = LFCEnemyDamageBehaviour.rateHP; int num = Mathf.CeilToInt((float)(LFCEnemyDamageBehaviour.GetExtendedHP(__instance) / rateHP)); if (num >= __instance.enemyHP) { int playerWhoHit2 = (((Object)(object)playerWhoHit != (Object)null) ? ((int)playerWhoHit.playerClientId) : (-1)); LFCEnemyDamageBehaviour.DamageEnemy(__instance, force * rateHP, playerWhoHit2, playHitSFX, hitID, callHitEnemy: false); } } [HarmonyPatch(typeof(EnemyAI), "OnDestroy")] [HarmonyPostfix] public static void OnDestroyPostfix(EnemyAI __instance) { LFCEnemyDamageBehaviour.extendedEnemyHP.Remove(__instance); } } public class GrabbableObjectPatch { [HarmonyPatch(typeof(GrabbableObject), "DestroyObjectInHand")] [HarmonyPostfix] private static void DestroyObjectRenderers(ref GrabbableObject __instance) { Renderer[] componentsInChildren = ((Component)__instance).gameObject.GetComponentsInChildren(); foreach (Renderer val in componentsInChildren) { Object.Destroy((Object)(object)val); } } } public class HangarShipDoorPatch { [HarmonyPatch(typeof(HangarShipDoor), "Update")] [HarmonyPostfix] private static void UpdateShipDoor(HangarShipDoor __instance) { if (LFCShipFeatureRegistry.IsLocked(LFCShipFeatureRegistry.ShipFeatureType.SHIP_DOORS)) { __instance.doorPower = 0f; ((TMP_Text)__instance.doorPowerDisplay).text = "0%"; } } } public class ItemChargerPatch { [HarmonyPatch(typeof(ItemCharger), "Update")] [HarmonyPostfix] private static void UpdateItemCharger(ref ItemCharger __instance) { if (LFCShipFeatureRegistry.IsLocked(LFCShipFeatureRegistry.ShipFeatureType.ITEM_CHARGER)) { __instance.triggerScript.disabledHoverTip = "Not enough energy left..."; __instance.triggerScript.interactable = false; } } } public class ManualCameraRendererPatch { [HarmonyPatch(typeof(ManualCameraRenderer), "SwitchScreenButton")] [HarmonyPrefix] private static bool SwitchScreenButton() { return !LFCShipFeatureRegistry.IsLocked(LFCShipFeatureRegistry.ShipFeatureType.MAP_SCREEN); } [HarmonyPatch(typeof(ManualCameraRenderer), "SwitchScreenOn")] [HarmonyPrefix] private static bool SwitchScreenOn() { return !LFCShipFeatureRegistry.IsLocked(LFCShipFeatureRegistry.ShipFeatureType.MAP_SCREEN); } [HarmonyPatch(typeof(ManualCameraRenderer), "SwitchScreenOnClientRpc")] [HarmonyPrefix] private static bool SwitchScreenOnClientRpc() { return !LFCShipFeatureRegistry.IsLocked(LFCShipFeatureRegistry.ShipFeatureType.MAP_SCREEN); } } public class MenuManagerPatch { [HarmonyPatch(typeof(MenuManager), "Awake")] [HarmonyPostfix] private static void AwakeMenu() { LFCShipFeatureRegistry.ResetCache(); LFCShipFeatureRegistry.ClearLocks(); LFCPoweredLightsRegistry.ClearLocks(); LFCObjectStateRegistry.ClearFlickeringFlashlight(); } } public class NetworkBehaviourPatch { private static readonly Type[] trackedTypes = new Type[5] { typeof(GrabbableObject), typeof(EnemyAI), typeof(EntranceTeleport), typeof(Turret), typeof(Landmine) }; [HarmonyPatch(typeof(NetworkBehaviour), "InternalOnNetworkSpawn")] [HarmonyPostfix] private static void SpawnNetworkBehaviour(ref NetworkBehaviour __instance) { Type[] array = trackedTypes; foreach (Type type in array) { if (type.IsInstanceOfType(__instance)) { LFCSpawnRegistry.Add((Component)(object)__instance); break; } } } [HarmonyPatch(typeof(NetworkBehaviour), "InternalOnNetworkDespawn")] [HarmonyPostfix] private static void DestroyNetworkBehaviour(ref NetworkBehaviour __instance) { Type[] array = trackedTypes; foreach (Type type in array) { if (type.IsInstanceOfType(__instance)) { LFCSpawnRegistry.Remove((Component)(object)__instance); break; } } } } public class PlayerControllerBPatch { [HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")] [HarmonyPostfix] private static void ConnectPlayer(ref PlayerControllerB __instance) { if (LFCUtilities.ShouldBeLocalPlayer(__instance)) { LFCStatRegistry.RegisterStat("Speed", __instance.movementSpeed, __instance.movementSpeed / 10f); } } [HarmonyPatch(typeof(PlayerControllerB), "Update")] [HarmonyPrefix] private static void UpdatePlayer(ref PlayerControllerB __instance) { if (LFCUtilities.ShouldBeLocalPlayer(__instance)) { __instance.movementSpeed = LFCStatRegistry.GetFinalValue("Speed") ?? __instance.movementSpeed; } } } public class RoundManagerPatch { [HarmonyPatch(typeof(RoundManager), "SpawnScrapInLevel")] [HarmonyPostfix] private static void SpawnNewItems(ref RoundManager __instance) { Random random = new Random(); foreach (LFCSpawnableItemRegistry.SpawnableItem item in LFCSpawnableItemRegistry.GetAll()) { for (int i = 0; i < item.MaxSpawn; i++) { if (i < item.MinSpawn || random.Next(0, 100) <= item.Rarity) { LFCObjectsManager.SpawnNewObject(__instance, item.Item, item.MinValue, item.MaxValue); } } } } [HarmonyTranspiler] [HarmonyPatch(/*Could not decode attribute arguments.*/)] private static IEnumerable TurnOnLights(IEnumerable instructions, ILGenerator il) { //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Expected O, but got Unknown //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Expected O, but got Unknown //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Expected O, but got Unknown //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Expected O, but got Unknown List list = new List(instructions); MethodInfo methodInfo = AccessTools.Method(typeof(Animator), "SetBool", new Type[2] { typeof(string), typeof(bool) }, (Type[])null); MethodInfo methodInfo2 = AccessTools.Method(typeof(LFCPoweredLightsRegistry), "IsLocked", new Type[1] { typeof(Animator) }, (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 >= 0; num2--) { if (list[num2].opcode == OpCodes.Ldstr && list[num2].operand is string text && text == "on") { num = num2; break; } } if (num == -1) { continue; } int num3 = num - 1; if (num3 >= 0) { Label label = il.DefineLabel(); Label label2 = il.DefineLabel(); if (i + 1 < list.Count) { list[i + 1].labels.Add(label2); } List list2 = new List(5) { new CodeInstruction(OpCodes.Dup, (object)null), new CodeInstruction(OpCodes.Call, (object)methodInfo2), new CodeInstruction(OpCodes.Brfalse_S, (object)label), new CodeInstruction(OpCodes.Pop, (object)null), new CodeInstruction(OpCodes.Br_S, (object)label2) }; int num4 = num3 + 1; list.InsertRange(num4, list2); list[num4 + list2.Count].labels.Add(label); i += list2.Count; } } return list; } } public class ShipLightsPatch { [HarmonyPatch(typeof(ShipLights), "SetShipLightsBoolean")] [HarmonyPrefix] private static bool SetShipLightsBoolean() { return !LFCShipFeatureRegistry.IsLocked(LFCShipFeatureRegistry.ShipFeatureType.SHIP_LIGHTS); } [HarmonyPatch(typeof(ShipLights), "SetShipLightsClientRpc")] [HarmonyPrefix] private static bool SetShipLightsClientRpc() { return !LFCShipFeatureRegistry.IsLocked(LFCShipFeatureRegistry.ShipFeatureType.SHIP_LIGHTS); } [HarmonyPatch(typeof(ShipLights), "SetShipLightsOnLocalClientOnly")] [HarmonyPrefix] private static bool SetShipLightsOnLocalClientOnly() { return !LFCShipFeatureRegistry.IsLocked(LFCShipFeatureRegistry.ShipFeatureType.SHIP_LIGHTS); } [HarmonyPatch(typeof(ShipLights), "ToggleShipLights")] [HarmonyPrefix] private static bool ToggleShipLights() { return !LFCShipFeatureRegistry.IsLocked(LFCShipFeatureRegistry.ShipFeatureType.SHIP_LIGHTS); } [HarmonyPatch(typeof(ShipLights), "ToggleShipLightsOnLocalClientOnly")] [HarmonyPrefix] private static bool ToggleShipLightsOnLocalClientOnly() { return !LFCShipFeatureRegistry.IsLocked(LFCShipFeatureRegistry.ShipFeatureType.SHIP_LIGHTS); } } public class ShipTeleporterPatch { [HarmonyPatch(typeof(ShipTeleporter), "Update")] [HarmonyPostfix] private static void UpdateShipTeleporter(ref ShipTeleporter __instance) { if (LFCShipFeatureRegistry.IsLocked(LFCShipFeatureRegistry.ShipFeatureType.SHIP_TELEPORTERS)) { __instance.buttonTrigger.disabledHoverTip = "Not enough energy left..."; __instance.buttonTrigger.interactable = false; } } } public class StartOfRoundPatch { [HarmonyPatch(typeof(StartOfRound), "Start")] [HarmonyBefore(new string[] { "evaisa.lethallib" })] [HarmonyPostfix] private static void StartRound(ref StartOfRound __instance) { LoadVanillaPrefabs(); if (NetworkManager.Singleton.IsHost && (Object)(object)LFCNetworkManager.Instance == (Object)null) { GameObject val = Object.Instantiate(LegaFusionCore.managerPrefab, ((Component)__instance).transform.parent); val.GetComponent().Spawn(false); LegaFusionCore.mls.LogInfo((object)"Spawning LFCNetworkManager"); } } public static void LoadVanillaPrefabs() { LoadVanillaParticle("KnifeItem", "BloodParticle"); LoadVanillaParticle("SandWorm", "AppearFromGround1"); } public static void LoadVanillaParticle(string prefabName, string particleName) { GameObject prefabFromName = LFCUtilities.GetPrefabFromName(prefabName); if ((Object)(object)prefabFromName != (Object)null) { ParticleSystem val = ((IEnumerable)prefabFromName.GetComponentsInChildren(true)).FirstOrDefault((Func)((ParticleSystem p) => ((Object)((Component)p).gameObject).name.Equals(particleName))); if ((Object)(object)val != (Object)null) { GameObject val2 = Object.Instantiate(((Component)val).gameObject); ((Object)val2).name = ((Object)((Component)val).gameObject).name; val2.SetActive(false); Object.DontDestroyOnLoad((Object)(object)val2); LFCPrefabRegistry.RegisterPrefab("Lega Fusion Core" + ((Object)val2).name, val2); } } } [HarmonyPatch(typeof(StartOfRound), "ShipLeave")] [HarmonyPostfix] public static void EndRound() { LFCShipFeatureRegistry.ClearLocks(); LFCPoweredLightsRegistry.ClearLocks(); LFCObjectStateRegistry.ClearFlickeringFlashlight(); } [HarmonyPatch(typeof(StartOfRound), "OnDisable")] [HarmonyPostfix] public static void OnDisable() { LFCNetworkManager.Instance = null; LFCSpawnRegistry.Clear(); } } public class TVScriptPatch { [HarmonyPatch(typeof(TVScript), "TurnTVOnOff")] [HarmonyPrefix] private static bool TurnTVOnOff() { return !LFCShipFeatureRegistry.IsLocked(LFCShipFeatureRegistry.ShipFeatureType.SHIP_TV); } [HarmonyPatch(typeof(TVScript), "SwitchTVLocalClient")] [HarmonyPrefix] private static bool SwitchTVLocalClient() { return !LFCShipFeatureRegistry.IsLocked(LFCShipFeatureRegistry.ShipFeatureType.SHIP_TV); } [HarmonyPatch(typeof(TVScript), "TurnOnTVClientRpc")] [HarmonyPrefix] private static bool TurnOnTVClientRpc() { return !LFCShipFeatureRegistry.IsLocked(LFCShipFeatureRegistry.ShipFeatureType.SHIP_TV); } [HarmonyPatch(typeof(TVScript), "TurnOnTVAndSyncClientRpc")] [HarmonyPrefix] private static bool TurnOnTVAndSyncClientRpc() { return !LFCShipFeatureRegistry.IsLocked(LFCShipFeatureRegistry.ShipFeatureType.SHIP_TV); } [HarmonyPatch(typeof(TVScript), "TurnOffTVClientRpc")] [HarmonyPrefix] private static bool TurnOffTVClientRpc() { return !LFCShipFeatureRegistry.IsLocked(LFCShipFeatureRegistry.ShipFeatureType.SHIP_TV); } } public class VehicleControllerPatch { [HarmonyPatch(typeof(VehicleController), "Update")] [HarmonyPostfix] private static void UpdateVehicle(ref VehicleController __instance) { if (LFCVisibilityRegistry.IsHidden(((Component)__instance).gameObject)) { __instance.driverSideDoorTrigger.interactable = false; __instance.passengerSideDoorTrigger.interactable = false; } } [HarmonyPatch(typeof(VehicleController), "EnableVehicleCollisionForAllPlayers")] [HarmonyPrefix] private static bool EnableVehicleCollisionForAllPlayers(ref VehicleController __instance) { return !LFCVisibilityRegistry.IsHidden(((Component)__instance).gameObject); } [HarmonyPatch(typeof(VehicleController), "SetVehicleCollisionForPlayer")] [HarmonyPrefix] private static bool SetVehicleCollisionForPlayer(ref VehicleController __instance, bool setEnabled) { if (setEnabled) { return !LFCVisibilityRegistry.IsHidden(((Component)__instance).gameObject); } return true; } } } namespace LegaFusionCore.ModsCompat { public static class CullFactorySoftCompat { private static readonly bool CullFactoryAvailable; private static readonly MethodInfo RefreshGrabbableMethod; private static readonly MethodInfo RefreshLightMethod; static CullFactorySoftCompat() { if (Chainloader.PluginInfos.TryGetValue("com.fumiko.CullFactory", out var value) && value.Metadata.Version >= new Version(1, 5, 0)) { Type type = Type.GetType("CullFactory.Behaviours.API.DynamicObjectsAPI, CullFactory"); if (type != null) { RefreshGrabbableMethod = type.GetMethod("RefreshGrabbableObjectPosition", BindingFlags.Static | BindingFlags.Public); RefreshLightMethod = type.GetMethod("RefreshLightPosition", BindingFlags.Static | BindingFlags.Public); CullFactoryAvailable = RefreshGrabbableMethod != null && RefreshLightMethod != null; } } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void RefreshGrabbableObjectPosition(GrabbableObject item) { item.EnableItemMeshes(true); if (CullFactoryAvailable) { RefreshGrabbableMethod?.Invoke(null, new object[1] { item }); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void RefreshLightPosition(Light light) { if (CullFactoryAvailable) { RefreshLightMethod?.Invoke(null, new object[1] { light }); } } } public static class GeneralImprovementsSoftCompat { 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("GeneralImprovements.Patches.ManualCameraRendererPatch, GeneralImprovements"); if (type != null) { MethodInfo methodInfo = AccessTools.Method(type, "SwitchScreenOn", (Type[])null, (Type[])null); if (methodInfo != null) { HarmonyMethod val = new HarmonyMethod(AccessTools.Method(typeof(GeneralImprovementsSoftCompat), "SwitchScreenOn", (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 SwitchScreenOn() { return !LFCShipFeatureRegistry.IsLocked(LFCShipFeatureRegistry.ShipFeatureType.MAP_SCREEN); } } public static class GoodItemScanSoftCompat { 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("GoodItemScan.Scanner, GoodItemScan"); if (type != null) { MethodInfo methodInfo = AccessTools.Method(type, "ScanNodes", (Type[])null, (Type[])null); if (methodInfo != null) { HarmonyMethod val = new HarmonyMethod(AccessTools.Method(typeof(GoodItemScanSoftCompat), "ScanNodes", (Type[])null, (Type[])null)); harmony.Patch((MethodBase)methodInfo, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static void ScanNodes(ref ScanNodeProperties[] scanNodes) { if (scanNodes != null && scanNodes.Length != 0) { Collider val = default(Collider); scanNodes = scanNodes.Where((ScanNodeProperties n) => (Object)(object)n != (Object)null && ((Component)n).TryGetComponent(ref val) && val.enabled).ToArray(); } } } public static class ModelReplacementAPISoftCompat { private static FieldInfo fiController; private static Type viewStateType; public static void Patch(Harmony harmony) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown Type type = Type.GetType("ModelReplacement.ViewStateManager, ModelReplacementAPI"); if (type != null) { MethodInfo methodInfo = AccessTools.Method(type, "SetPlayerRenderers", (Type[])null, (Type[])null); if (methodInfo != null) { HarmonyMethod val = new HarmonyMethod(AccessTools.Method(typeof(ModelReplacementAPISoftCompat), "SetPlayerRenderers", (Type[])null, (Type[])null)); harmony.Patch((MethodBase)methodInfo, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } MethodInfo methodInfo2 = AccessTools.Method(type, "GetViewState", (Type[])null, (Type[])null); if (methodInfo2 != null) { HarmonyMethod val2 = new HarmonyMethod(AccessTools.Method(typeof(ModelReplacementAPISoftCompat), "GetViewState", (Type[])null, (Type[])null)); harmony.Patch((MethodBase)methodInfo2, (HarmonyMethod)null, val2, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); viewStateType = Type.GetType("ModelReplacement.ViewState, ModelReplacementAPI"); } Type type2 = Type.GetType("ModelReplacement.Monobehaviors.ManagerBase, ModelReplacementAPI"); if (type2 != null) { fiController = AccessTools.Field(type2, "controller"); } } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static void SetPlayerRenderers(object __instance, ref bool enabled, ref bool helmetShadow) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown PlayerControllerB val = (PlayerControllerB)(fiController?.GetValue(__instance)); if ((Object)(object)val != (Object)null && LFCVisibilityRegistry.IsHidden(((Component)val).gameObject)) { if (enabled) { enabled = false; } if (helmetShadow) { helmetShadow = false; } } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static void GetViewState(object __instance, ref object __result) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown if (viewStateType != null) { PlayerControllerB val = (PlayerControllerB)(fiController?.GetValue(__instance)); if ((Object)(object)val != (Object)null && LFCVisibilityRegistry.IsHidden(((Component)val).gameObject)) { __result = Enum.Parse(viewStateType, "None"); } } } } public static class MoreCompantSoftCompat { 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("MoreCompany.Cosmetics.CosmeticApplication, MoreCompany"); if (type != null) { MethodInfo methodInfo = AccessTools.Method(type, "UpdateAllCosmeticVisibilities", (Type[])null, (Type[])null); if (methodInfo != null) { HarmonyMethod val = new HarmonyMethod(AccessTools.Method(typeof(MoreCompantSoftCompat), "UpdateAllCosmeticVisibilities", (Type[])null, (Type[])null)); harmony.Patch((MethodBase)methodInfo, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static bool UpdateAllCosmeticVisibilities(object __instance) { MonoBehaviour val = (MonoBehaviour)((__instance is MonoBehaviour) ? __instance : null); if (val != null) { PlayerControllerB componentInParent = ((Component)val).GetComponentInParent(); object obj = ((componentInParent != null) ? ((Component)componentInParent).gameObject : null); if (obj == null) { EnemyAI componentInParent2 = ((Component)val).GetComponentInParent(); obj = ((componentInParent2 != null) ? ((Component)componentInParent2).gameObject : null) ?? ((Component)((Component)val).transform.root).gameObject; } GameObject val2 = (GameObject)obj; return !LFCVisibilityRegistry.IsHidden(val2.gameObject); } return true; } } public static class NameplateTweaksSoftCompat { 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("NameplateTweaks.Patches, NameplateTweaks"); if (type != null) { MethodInfo methodInfo = AccessTools.Method(type, "PlayerUpdate", (Type[])null, (Type[])null); if (methodInfo != null) { HarmonyMethod val = new HarmonyMethod(AccessTools.Method(typeof(NameplateTweaksSoftCompat), "PlayerUpdate", (Type[])null, (Type[])null)); harmony.Patch((MethodBase)methodInfo, (HarmonyMethod)null, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static void PlayerUpdate(object __0) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) PlayerControllerB val = (PlayerControllerB)((__0 is PlayerControllerB) ? __0 : null); if (LFCVisibilityRegistry.IsHidden(((Component)val).gameObject)) { val.usernameAlpha.alpha = 0f; val.usernameBillboard.localScale = Vector3.zero; Canvas usernameCanvas = val.usernameCanvas; if (usernameCanvas != null) { ((Component)usernameCanvas).gameObject.SetActive(false); } } } } public static class SelfSortingStorageSoftCompat { private static Type LightButtonType; private static MethodInfo SwitchLightsMethod; 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 //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown Type type = Type.GetType("SelfSortingStorage.Utils.Effects, SelfSortingStorage"); if (type != null) { MethodInfo methodInfo = AccessTools.Method(type, "IsTriggerValid", (Type[])null, (Type[])null); if (methodInfo != null) { HarmonyMethod val = new HarmonyMethod(AccessTools.Method(typeof(SelfSortingStorageSoftCompat), "IsTriggerValid", (Type[])null, (Type[])null)); harmony.Patch((MethodBase)methodInfo, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } LightButtonType = Type.GetType("SelfSortingStorage.Buttons.LightButton, SelfSortingStorage"); if (LightButtonType != null) { SwitchLightsMethod = AccessTools.Method(LightButtonType, "SwitchLights", (Type[])null, (Type[])null); if (SwitchLightsMethod != null) { HarmonyMethod val2 = new HarmonyMethod(AccessTools.Method(typeof(SelfSortingStorageSoftCompat), "PreSwitchLights", (Type[])null, (Type[])null)); harmony.Patch((MethodBase)SwitchLightsMethod, val2, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static bool IsTriggerValid(out string notValidText) { if (LFCShipFeatureRegistry.IsLocked(LFCShipFeatureRegistry.ShipFeatureType.SMART_CUPBOARD)) { notValidText = "Not enough energy left..."; return false; } notValidText = "[Nothing to store]"; return true; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static bool PreSwitchLights() { return !LFCShipFeatureRegistry.IsLocked(LFCShipFeatureRegistry.ShipFeatureType.SMART_CUPBOARD); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void SwitchLights(bool on) { if (LightButtonType != null) { Object val = Object.FindObjectOfType(LightButtonType); if (SwitchLightsMethod != null && val != (Object)null) { SwitchLightsMethod.Invoke(val, new object[1] { on }); } } } } public static class SellBodiesFixedSoftCompat { private static readonly BaseUnityPlugin SellBodiesInstance; static SellBodiesFixedSoftCompat() { if (Chainloader.PluginInfos.TryGetValue("Entity378.sellbodies", out var value)) { SellBodiesInstance = value.Instance; } } public static void RegisterBody(string enemyName, Item item, int minValue, int maxValue, bool enabled) { if ((Object)(object)SellBodiesInstance != (Object)null && (Object)(object)item != (Object)null) { Utilities.FixMixerGroups(item.spawnPrefab); item.spawnPrefab.AddComponent(AccessTools.TypeByName("BodySyncer")); item.minValue = minValue; item.maxValue = maxValue; NetworkPrefabs.RegisterNetworkPrefab(item.spawnPrefab); Items.RegisterItem(item); if (enabled && AccessTools.Field(((object)SellBodiesInstance).GetType(), "BodySpawns")?.GetValue(SellBodiesInstance) is IDictionary dictionary) { dictionary[enemyName] = item; } } } } } namespace LegaFusionCore.Managers { public class LFCCustomPassManager : MonoBehaviour { private static CustomPassVolume customPassVolume; private static LFCCustomPassShader shaderCustomPass; public static CustomPassVolume CustomPassVolume { get { //IL_004d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)customPassVolume == (Object)null && (Object)(object)LFCUtilities.LocalPlayer != (Object)null) { customPassVolume = ((Component)LFCUtilities.LocalPlayer.gameplayCamera).gameObject.AddComponent(); customPassVolume.targetCamera = LFCUtilities.LocalPlayer.gameplayCamera; customPassVolume.injectionPoint = (CustomPassInjectionPoint)1; customPassVolume.isGlobal = true; shaderCustomPass = new LFCCustomPassShader(); customPassVolume.customPasses.Add((CustomPass)(object)shaderCustomPass); } return customPassVolume; } } public static LFCCustomPassShader LFCCustomPassShader { get { if ((Object)(object)CustomPassVolume == (Object)null) { LegaFusionCore.mls.LogError((object)"CustomPassVolume is not assigned."); return null; } if (shaderCustomPass == null) { shaderCustomPass = CustomPassVolume.customPasses.Find((CustomPass pass) => pass is LFCCustomPassShader) as LFCCustomPassShader; } if (shaderCustomPass == null) { LegaFusionCore.mls.LogError((object)"ShaderCustomPass could not be found in CustomPassVolume."); } return shaderCustomPass; } } public static void SetupAuraForObject(GameObject gObject, Material material, string tag, Color color = default(Color)) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) Renderer[] filteredRenderers = GetFilteredRenderers(gObject); if (filteredRenderers.Length != 0) { LFCCustomPassShader?.AddRenderers(filteredRenderers, material, tag, color, gObject); } } public static void SetupAuraForObjects(GameObject[] gObjects, Material material, string tag, Color color = default(Color)) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) foreach (GameObject gObject in gObjects) { SetupAuraForObject(gObject, material, tag, color); } } public static void RemoveAuraFromObjects(GameObject[] gObjects, string tag = "default") { foreach (GameObject gObject in gObjects) { RemoveAuraFromObject(gObject, tag); } } public static void RemoveAuraFromObject(GameObject gObject, string tag = "default") { Renderer[] filteredRenderers = GetFilteredRenderers(gObject); if (filteredRenderers.Length != 0) { LFCCustomPassShader?.RemoveRenderers(filteredRenderers, tag); } } public static void RemoveAuraByTag(string tag) { LFCCustomPassShader?.RemoveRenderersByTag(tag); } public static void ClearAllAuras() { LFCCustomPassShader?.ClearAllRenderers(); } public static void SetupScreenFilter(Material material, string tag) { if ((Object)(object)material != (Object)null) { LFCCustomPassShader?.AddFilter(material, tag); } } public static void RemoveFiltersByTag(string tag) { LFCCustomPassShader?.RemoveFiltersByTag(tag); } public static void RemoveFiltersByMaterial(Material material) { LFCCustomPassShader?.RemoveFiltersByMaterial(material); } public static void ClearAllFilters() { LFCCustomPassShader?.ClearAllFilters(); } private static Renderer[] GetFilteredRenderers(GameObject gObject) { Renderer[] array = (from r in gObject.GetComponentsInChildren() where (Object)(object)r != (Object)null && (int)r.shadowCastingMode != 3 select r).ToArray(); if (array.Length == 0) { return Array.Empty(); } EnemyAI val = default(EnemyAI); PlayerControllerB val2 = default(PlayerControllerB); if (gObject.TryGetComponent(ref val) || gObject.TryGetComponent(ref val2)) { Renderer[] array2 = (Renderer[])(object)array.OfType().ToArray(); array = array2; array = FilterSpecialCases(gObject, array); } if (array.Length == 0) { LegaFusionCore.mls.LogError((object)("No renderer found on " + ((Object)gObject).name)); return Array.Empty(); } return array; } private static Renderer[] FilterSpecialCases(GameObject gObject, Renderer[] renderers) { if (!((Object)gObject).name.Contains("MouthDog", StringComparison.OrdinalIgnoreCase)) { return renderers; } return renderers.Where((Renderer r) => !((Object)r).name.Contains("LOD1", StringComparison.OrdinalIgnoreCase)).ToArray(); } } public static class LFCEnemyManager { [CompilerGenerated] private sealed class d__7 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public EnemyAI enemy; public Vector3 position; 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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; case 1: <>1__state = -1; LFCNetworkManager.Instance.TeleportEnemyEveryoneRpc(NetworkObjectReference.op_Implicit(enemy.thisNetworkObject), position, !enemy.isOutside); 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__10 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public EnemyAI enemy; public int layer; public string clipName; public float maxDuration; private float 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__10(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) AnimatorClipInfo[] currentAnimatorClipInfo; switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__2 = 0f; goto IL_002d; case 1: <>1__state = -1; goto IL_002d; case 2: { <>1__state = -1; break; } IL_002d: currentAnimatorClipInfo = enemy.creatureAnimator.GetCurrentAnimatorClipInfo(layer); if (currentAnimatorClipInfo.Length == 0 || !((Object)((AnimatorClipInfo)(ref currentAnimatorClipInfo[0])).clip).name.Contains(clipName)) { 5__2 += Time.deltaTime; if (5__2 > maxDuration) { return false; } <>2__current = null; <>1__state = 1; return true; } break; } AnimatorStateInfo currentAnimatorStateInfo = enemy.creatureAnimator.GetCurrentAnimatorStateInfo(layer); if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).normalizedTime < 1f) { 5__2 += Time.deltaTime; if (5__2 > maxDuration) { return false; } <>2__current = null; <>1__state = 2; 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 bool CanDie(EnemyAI enemy) { if ((Object)(object)enemy?.enemyType == (Object)null) { return false; } string[] source = new string[11] { "Spring", "Jester", "Clay Surgeon", "Red Locust Bees", "Earth Leviathan", "Girl", "Blob", "Butler Bees", "RadMech", "Docile Locust Bees", "Puffer" }; if (enemy.enemyType.canDie) { return !source.Contains(enemy.enemyType.enemyName); } return false; } public static bool FoundClosestPlayerInRange(this EnemyAI enemy, int range, int senseRange, float width = 60f, bool cannotBeInShip = false) { PlayerControllerB val = enemy.CheckLineOfSightForPlayer(width, range, senseRange); if ((Object)(object)val != (Object)null && enemy.PlayerIsTargetable(val, cannotBeInShip, false, true)) { return Object.op_Implicit((Object)(object)(enemy.targetPlayer = val)); } return false; } public static bool TargetClosestPlayerInAnyCase(this EnemyAI enemy, out float distance, bool cannotBeInShip = false) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) enemy.mostOptimalDistance = 2000f; distance = enemy.mostOptimalDistance; enemy.targetPlayer = null; for (int i = 0; i < StartOfRound.Instance.connectedPlayersAmount + 1; i++) { PlayerControllerB val = StartOfRound.Instance.allPlayerScripts[i]; if (enemy.PlayerIsTargetable(val, cannotBeInShip, false, true)) { enemy.tempDist = Vector3.Distance(((Component)enemy).transform.position, ((Component)StartOfRound.Instance.allPlayerScripts[i]).transform.position); if (enemy.tempDist < enemy.mostOptimalDistance) { distance = enemy.tempDist; enemy.mostOptimalDistance = enemy.tempDist; enemy.targetPlayer = StartOfRound.Instance.allPlayerScripts[i]; } } } return (Object)(object)enemy.targetPlayer != (Object)null; } public static bool TargetOutsideChasedPlayer(this EnemyAI enemy) { if ((Object)(object)enemy.targetPlayer != (Object)null && enemy.targetPlayer.isInsideFactory == enemy.isOutside) { enemy.GoTowardsEntrance(); return true; } return false; } public static void GoTowardsEntrance(this EnemyAI enemy) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) EntranceTeleport closestEntrance = enemy.GetClosestEntrance(); if (Vector3.Distance(((Component)enemy).transform.position, closestEntrance.entrancePoint.position) < 1f) { Vector3 entranceExitPosition = GetEntranceExitPosition(closestEntrance); ((MonoBehaviour)enemy).StartCoroutine(enemy.GoTowardsCoroutine(entranceExitPosition)); } else { enemy.SetDestinationToPosition(closestEntrance.entrancePoint.position, false); } } public static EntranceTeleport GetClosestEntrance(this EnemyAI enemy) { return (from e in LFCSpawnRegistry.GetAllAs() where e.isEntranceToBuilding == enemy.isOutside orderby Vector3.Distance(((Component)enemy).transform.position, e.entrancePoint.position) select e).FirstOrDefault(); } public static Vector3 GetEntranceExitPosition(EntranceTeleport entranceTeleport) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) EntranceTeleport? obj = ((IEnumerable)LFCSpawnRegistry.GetAllAs()).FirstOrDefault((Func)((EntranceTeleport e) => e.isEntranceToBuilding != entranceTeleport.isEntranceToBuilding && e.entranceId == entranceTeleport.entranceId)); if (obj == null) { return Vector3.zero; } return obj.entrancePoint.position; } [IteratorStateMachine(typeof(d__7))] public static IEnumerator GoTowardsCoroutine(this EnemyAI enemy, 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__7(0) { enemy = enemy, position = position }; } public static void TeleportEnemy(this EnemyAI enemy, Vector3 teleportPosition, bool isOutside) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001d: 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) if ((Object)(object)enemy != (Object)null) { enemy.SetEnemyOutside(isOutside); enemy.serverPosition = teleportPosition; ((Component)enemy).transform.position = teleportPosition; enemy.agent.Warp(teleportPosition); enemy.SyncPositionToClients(); } } public static bool TryGetSafeRandomNavMeshPosition(this EnemyAI enemy, Vector3 origin, float radius, out Vector3 position, int maxAttempts = 15) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) enemy.path1 = new NavMeshPath(); for (int i = 0; i < maxAttempts; i++) { position = RoundManager.Instance.GetRandomNavMeshPositionInRadius(origin, radius, default(NavMeshHit)); if (enemy.agent.CalculatePath(position, enemy.path1) && (int)enemy.path1.status == 0) { return true; } } position = origin; return false; } [IteratorStateMachine(typeof(d__10))] public static IEnumerator WaitForFullAnimation(this EnemyAI enemy, string clipName, float maxDuration = 10f, int layer = 0) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__10(0) { enemy = enemy, clipName = clipName, maxDuration = maxDuration, layer = layer }; } } public static class LFCGlobalManager { public static void PlayParticle(string tag, Vector3 position, Quaternion rotation, bool scaleMain = true, float scaleFactor = 1f, bool active = true) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) GameObject prefab = LFCPrefabRegistry.GetPrefab(tag); if ((Object)(object)prefab == (Object)null) { LegaFusionCore.mls.LogWarning((object)("[PlayParticle] No prefab found for the tag: " + tag)); } else { PlayParticle(prefab, position, rotation, scaleMain, scaleFactor, active); } } public static void PlayParticle(GameObject prefab, Vector3 position, Quaternion rotation, bool scaleMain = true, float scaleFactor = 1f, bool active = true) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: 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_001c: 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_006a: 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) //IL_0126: 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_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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: 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_00d3: 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) GameObject val = Object.Instantiate(prefab, position, rotation); val.transform.localScale = prefab.transform.localScale * scaleFactor; val.SetActive(active); ParticleSystem component = val.GetComponent(); if ((Object)(object)component == (Object)null) { LegaFusionCore.mls.LogWarning((object)("[PlayParticle] Prefab " + ((Object)prefab).name + " has no ParticleSystem.")); Object.Destroy((Object)(object)val); return; } MainModule main = component.main; if (scaleMain && scaleFactor != 1f) { ((MainModule)(ref main)).startSizeMultiplier = ((MainModule)(ref main)).startSizeMultiplier * scaleFactor; ((MainModule)(ref main)).startSpeedMultiplier = ((MainModule)(ref main)).startSpeedMultiplier * scaleFactor; EmissionModule emission = component.emission; if (((EmissionModule)(ref emission)).burstCount > 0) { for (int i = 0; i < ((EmissionModule)(ref emission)).burstCount; i++) { Burst burst = ((EmissionModule)(ref emission)).GetBurst(i); MinMaxCurve count = ((Burst)(ref burst)).count; ((Burst)(ref burst)).count = new MinMaxCurve(((MinMaxCurve)(ref count)).constant * scaleFactor); ((EmissionModule)(ref emission)).SetBurst(i, burst); } } ((EmissionModule)(ref emission)).rateOverTimeMultiplier = ((EmissionModule)(ref emission)).rateOverTimeMultiplier * scaleFactor; ((MainModule)(ref main)).maxParticles = Mathf.RoundToInt((float)((MainModule)(ref main)).maxParticles * scaleFactor); } MainModule main2 = component.main; if (!((MainModule)(ref main2)).playOnAwake) { component.Play(); } Object.Destroy((Object)(object)val, ((MainModule)(ref main)).duration); } public static void PlayAudio(string tag, Vector3 position, bool active = true) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) GameObject prefab = LFCPrefabRegistry.GetPrefab(tag); if ((Object)(object)prefab == (Object)null) { LegaFusionCore.mls.LogWarning((object)("[PlayAudio] No prefab found for the tag: " + tag)); } else { PlayAudio(prefab, position, active); } } public static void PlayAudio(GameObject prefab, Vector3 position, bool active = true) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(prefab, position, Quaternion.identity); AudioSource component = val.GetComponent(); if ((Object)(object)component == (Object)null || (Object)(object)component.clip == (Object)null) { LegaFusionCore.mls.LogWarning((object)("[PlayAudio] Prefab " + ((Object)prefab).name + " has no AudioSource or clip.")); Object.Destroy((Object)(object)val); return; } val.SetActive(active); if (!component.playOnAwake) { component.Play(); } Object.Destroy((Object)(object)val, component.clip.length); } } public static class LFCMapObjectsManager { public static void SpawnOutsideMapObjectsForServer(int min, int max, Action spawnAction) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_0057: 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_005a: Unknown result type (might be due to invalid IL or missing references) Random random = new Random(); for (int i = 0; i < random.Next(min, max); i++) { GameObject[] outsideAINodes = RoundManager.Instance.outsideAINodes; Vector3 position = outsideAINodes[random.Next(0, outsideAINodes.Length)].transform.position; position = RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(position, 10f, default(NavMeshHit), random, -1, 1f) + Vector3.up; spawnAction(position, Quaternion.identity); } } public static void SpawnScatteredMapObjectsForServer(int mapObjectsAmount, int minInside, int minOutside, Action spawnAction) { //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_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01be: 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_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_027b: 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_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) if (!LFCUtilities.IsServer || (Object)(object)RoundManager.Instance == (Object)null) { return; } Random random = new Random(); List selectedPositions = new List(); StartOfRound.Instance.allPlayerScripts.Where((PlayerControllerB p) => !p.isPlayerDead).ToList().ForEach(delegate(PlayerControllerB p) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) selectedPositions.Add(((Component)p).transform.position); }); List list = RoundManager.Instance.insideAINodes.Where((GameObject n) => (Object)(object)n != (Object)null).ToList(); List list2 = RoundManager.Instance.outsideAINodes.Where((GameObject n) => (Object)(object)n != (Object)null).ToList(); LFCUtilities.Shuffle(list); LFCUtilities.Shuffle(list2); List list3 = new List(mapObjectsAmount); minInside = Mathf.Clamp(minInside, 0, mapObjectsAmount); minOutside = Mathf.Clamp(minOutside, 0, mapObjectsAmount - minInside); for (int i = 0; i < minInside; i++) { list3.Add(item: false); } for (int j = 0; j < minOutside; j++) { list3.Add(item: true); } while (list3.Count < mapObjectsAmount) { list3.Add(random.Next(0, 2) == 0); } RaycastHit val3 = default(RaycastHit); foreach (bool item2 in list3) { float num = float.MinValue; Vector3 val = Vector3.zero; GameObject item = null; List list4 = (item2 ? list2 : list); foreach (GameObject item3 in list4) { Vector3 val2 = RoundManager.Instance.GetRandomNavMeshPositionInBoxPredictable(item3.transform.position, 10f, default(NavMeshHit), random, -1, 1f) + Vector3.up; if (!Physics.Raycast(val2, Vector3.down, ref val3, 5f, StartOfRound.Instance.collidersAndRoomMaskAndDefault)) { continue; } Vector3 validPosition = ((RaycastHit)(ref val3)).point; float num2 = ((selectedPositions.Count > 0) ? selectedPositions.Min((Vector3 p) => Vector3.Distance(p, validPosition)) : float.MaxValue); if (num2 > 50f || num2 > num) { num = num2; val = validPosition; item = item3; if (num2 > 50f) { break; } } } if (val != Vector3.zero) { selectedPositions.Add(val); list4.Remove(item); spawnAction(val, item2); } } } public static void AttachMapObjectForEveryone(PlayerControllerB player, GameObject mapObject) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_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_008e: 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) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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_00db: 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_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_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (Physics.Raycast(((Component)player.gameplayCamera).transform.position + ((Component)player.gameplayCamera).transform.forward, Vector3.down, ref val, 80f, 1342179585, (QueryTriggerInteraction)1)) { PlayerPhysicsRegion componentInChildren = ((Component)((Component)((RaycastHit)(ref val)).collider).gameObject.transform).GetComponentInChildren(); if ((Object)(object)componentInChildren?.parentNetworkObject != (Object)null && componentInChildren.allowDroppingItems && componentInChildren.itemDropCollider.ClosestPoint(((RaycastHit)(ref val)).point) == ((RaycastHit)(ref val)).point) { mapObject.transform.SetParent(componentInChildren.physicsTransform); mapObject.transform.localPosition = componentInChildren.physicsTransform.InverseTransformPoint(((RaycastHit)(ref val)).point + Vector3.up * 0.04f + componentInChildren.addPositionOffsetToItems); Transform transform = mapObject.transform; Quaternion rotation = ((Component)player).transform.rotation; float y = ((Quaternion)(ref rotation)).eulerAngles.y; rotation = ((Component)player).transform.rotation; transform.rotation = Quaternion.Euler(0f, y, ((Quaternion)(ref rotation)).eulerAngles.z); } } } } public static class LFCObjectsManager { [CompilerGenerated] private sealed class d__5 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerControllerB player; public GrabbableObject grabbableObject; private float 5__2; 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown //IL_0042: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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) //IL_00d3: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (player.FirstEmptyItemSlot((GrabbableObject)null) == -1) { player.DropAllHeldItemsAndSync(((Component)player).transform.position, player.localItemHolder.position, player.localItemHolder.eulerAngles, ((Component)player.playerEye).transform.position, ((Component)player.playerEye).transform.eulerAngles); } <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 1; return true; case 1: <>1__state = -1; 5__2 = 0f; break; case 2: <>1__state = -1; 5__2 += 0.1f; break; } if (player.isGrabbingObjectAnimation && 5__2 < 2f) { <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 2; return true; } if (!player.isGrabbingObjectAnimation) { ForceGrabObject(grabbableObject, player); } 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 Item RegisterObject(Type type, Item item) { if ((Object)(object)item.spawnPrefab.GetComponent(type) == (Object)null) { Component obj = item.spawnPrefab.AddComponent(type); PhysicsProp val = (PhysicsProp)(object)((obj is PhysicsProp) ? obj : null); ((GrabbableObject)val).grabbable = true; ((GrabbableObject)val).grabbableToEnemies = true; ((GrabbableObject)val).itemProperties = item; } NetworkPrefabs.RegisterNetworkPrefab(item.spawnPrefab); Utilities.FixMixerGroups(item.spawnPrefab); Items.RegisterItem(item); return item; } public static void SpawnNewObject(RoundManager roundManager, Item itemToSpawn, int minValue, int maxValue) { //IL_007d: 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_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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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_00c4: 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_00d8: 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_010a: Unknown result type (might be due to invalid IL or missing references) try { Random random = new Random(); List list = (from s in Object.FindObjectsOfType() where !s.spawnUsed select s).ToList(); if (list.Any()) { int index = random.Next(0, list.Count); RandomScrapSpawn val = list[index]; if (val.spawnedItemsCopyPosition) { val.spawnUsed = true; list.RemoveAt(index); } else { ((Component)val).transform.position = roundManager.GetRandomNavMeshPositionInBoxPredictable(((Component)val).transform.position, val.itemSpawnRange, roundManager.navHit, roundManager.AnomalyRandom, -1, 1f) + Vector3.up * itemToSpawn.verticalOffset; } Vector3 position = ((Component)val).transform.position + Vector3.up * 0.5f; GrabbableObject val2 = SpawnObjectForServer(itemToSpawn.spawnPrefab, position); if (itemToSpawn.isScrap && minValue > 0 && maxValue > minValue) { LFCNetworkManager.Instance.SetScrapValueEveryoneRpc(NetworkObjectReference.op_Implicit(((Component)val2).gameObject.GetComponent()), Random.Range(minValue, maxValue + 1)); } } } catch (Exception arg) { LegaFusionCore.mls.LogError((object)$"Error in SpawnNewItem: {arg}"); } } public static GrabbableObject SpawnObjectForServer(GameObject spawnPrefab, Vector3 position) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) return SpawnObjectForServer(spawnPrefab, position, Quaternion.identity); } public static GrabbableObject SpawnObjectForServer(GameObject spawnPrefab, Vector3 position, Quaternion rotation) { //IL_000a: 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) GrabbableObject val = null; if (LFCUtilities.IsServer) { GameObject val2 = Object.Instantiate(spawnPrefab, position, rotation, StartOfRound.Instance.propsContainer); val = val2.GetComponent(); val.fallTime = 0f; val2.GetComponent().Spawn(false); } return val; } public static GrabbableObject[] GetItemSlots(this PlayerControllerB player) { List list = new List(); GrabbableObject[] itemSlots = player.ItemSlots; foreach (GrabbableObject val in itemSlots) { if ((Object)(object)val != (Object)null) { list.Add(val); } } if ((Object)(object)player.ItemOnlySlot != (Object)null && !list.Contains(player.ItemOnlySlot)) { list.Add(player.ItemOnlySlot); } return list.ToArray(); } [IteratorStateMachine(typeof(d__5))] public static IEnumerator ForceGrabObjectCoroutine(GrabbableObject grabbableObject, PlayerControllerB player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__5(0) { grabbableObject = grabbableObject, player = player }; } public static void ForceGrabObject(GrabbableObject grabbableObject, PlayerControllerB player) { //IL_0134: Unknown result type (might be due to invalid IL or missing references) player.currentlyGrabbingObject = grabbableObject; player.grabInvalidated = false; player.currentlyGrabbingObject.InteractItem(); if (player.currentlyGrabbingObject.grabbable && player.FirstEmptyItemSlot((GrabbableObject)null) != -1) { player.playerBodyAnimator.SetBool("GrabInvalidated", false); player.playerBodyAnimator.SetBool("GrabValidated", false); player.playerBodyAnimator.SetBool("cancelHolding", false); player.playerBodyAnimator.ResetTrigger("Throw"); player.SetSpecialGrabAnimationBool(true, (GrabbableObject)null); player.isGrabbingObjectAnimation = true; ((Behaviour)player.cursorIcon).enabled = false; ((TMP_Text)player.cursorTip).text = ""; player.twoHanded = player.currentlyGrabbingObject.itemProperties.twoHanded; player.carryWeight = Mathf.Clamp(player.carryWeight + (player.currentlyGrabbingObject.itemProperties.weight - 1f), 1f, 10f); player.grabObjectAnimationTime = ((player.currentlyGrabbingObject.itemProperties.grabAnimationTime > 0f) ? player.currentlyGrabbingObject.itemProperties.grabAnimationTime : 0.4f); if (!player.isTestingPlayer) { player.GrabObjectServerRpc(NetworkObjectReference.op_Implicit(((NetworkBehaviour)player.currentlyGrabbingObject).NetworkObject)); } if (player.grabObjectCoroutine != null) { ((MonoBehaviour)player).StopCoroutine(player.grabObjectCoroutine); } player.grabObjectCoroutine = ((MonoBehaviour)player).StartCoroutine(player.GrabObject()); } } public static void DropHeldObject(this GrabbableObject grabbableObject, PlayerControllerB player, bool itemsFall = true, bool disconnecting = false) { //IL_0074: 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_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_00b2: 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) if (itemsFall) { grabbableObject.parentObject = null; grabbableObject.heldByPlayerOnServer = false; if (player.isInElevator) { ((Component)grabbableObject).transform.SetParent(player.playersManager.elevatorTransform, true); } else { ((Component)grabbableObject).transform.SetParent(player.playersManager.propsContainer, true); } player.SetItemInElevator(player.isInHangarShipRoom, player.isInElevator, grabbableObject); grabbableObject.EnablePhysics(true); grabbableObject.EnableItemMeshes(true); ((Component)grabbableObject).transform.localScale = grabbableObject.originalScale; grabbableObject.isHeld = false; grabbableObject.isPocketed = false; grabbableObject.startFallingPosition = ((Component)grabbableObject).transform.parent.InverseTransformPoint(((Component)grabbableObject).transform.position); grabbableObject.FallToGround(true, false, default(Vector3)); grabbableObject.fallTime = Random.Range(-0.3f, 0.05f); if (LFCUtilities.ShouldBeLocalPlayer(player)) { grabbableObject.DiscardItemOnClient(); } else if (!grabbableObject.itemProperties.syncDiscardFunction) { grabbableObject.playerHeldBy = null; } } if (LFCUtilities.ShouldBeLocalPlayer(player) && !disconnecting) { ((Behaviour)HUDManager.Instance.holdingTwoHandedItem).enabled = false; ((Behaviour)HUDManager.Instance.itemSlotIcons[player.currentItemSlot]).enabled = false; HUDManager.Instance.ClearControlTips(); player.activatingItem = false; } player.ItemSlots[player.currentItemSlot] = null; if (player.isHoldingObject) { player.isHoldingObject = false; if ((Object)(object)player.currentlyHeldObjectServer != (Object)null) { player.SetSpecialGrabAnimationBool(false, player.currentlyHeldObjectServer); } player.playerBodyAnimator.SetBool("cancelHolding", true); player.playerBodyAnimator.SetTrigger("Throw"); } player.activatingItem = false; player.twoHanded = false; player.carryWeight = 1f; player.currentlyHeldObjectServer = null; } public static void DestroyObjectsOfTypeAllForServer() where T : GrabbableObject { LFCSpawnRegistry.GetAllAs().ForEach(delegate(GrabbableObject g) { T val = (T)(object)((g is T) ? g : null); if (val != null) { DestroyObjectOfTypeForServer(val); } }); } public static void DestroyObjectOfTypeForServer(T grabbableObject) where T : GrabbableObject { //IL_002b: Unknown result type (might be due to invalid IL or missing references) object obj = grabbableObject; NetworkObject val = ((obj != null) ? ((Component)obj).GetComponent() : null); if (!((Object)(object)val == (Object)null) && val.IsSpawned) { LFCNetworkManager.Instance.DestroyObjectEveryoneRpc(NetworkObjectReference.op_Implicit(val)); } } } public static class LFCPlayerManager { public static void HealPlayerOnLocalClient(PlayerControllerB player, int regenHP) { if (LFCUtilities.ShouldBeLocalPlayer(player) && !player.isPlayerDead) { player.health = Mathf.Min(player.health + regenHP, 100); HUDManager.Instance.UpdateHealthUI(player.health, false); player.DamagePlayerClientRpc(-regenHP, player.health); if (player.criticallyInjured && player.health >= 10) { player.MakeCriticallyInjured(false); } } } } } namespace LegaFusionCore.Managers.NetworkManagers { public class LFCNetworkManager : NetworkBehaviour { public static LFCNetworkManager Instance; [Rpc(/*Could not decode attribute arguments.*/)] public void TeleportEnemyEveryoneRpc(NetworkObjectReference enemyObj, Vector3 teleportPosition, bool isOutside) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0117: 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(941434864u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref enemyObj, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref teleportPosition); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref isOutside, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 941434864u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; NetworkObject val4 = default(NetworkObject); if (((NetworkObjectReference)(ref enemyObj)).TryGet(ref val4, (NetworkManager)null)) { ((Component)val4).gameObject.GetComponentInChildren()?.TeleportEnemy(teleportPosition, isOutside); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void StunEnemyEveryoneRpc(NetworkObjectReference enemyObject, bool setToStunned, float stunTime = 1f, int playerId = -1) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0102: 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_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00df: 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_0111: 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(1127407031u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref enemyObject, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref setToStunned, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref stunTime, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val3, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1127407031u, 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 enemyObject)).TryGet(ref val4, (NetworkManager)null)) { PlayerControllerB val5 = ((playerId != -1) ? StartOfRound.Instance.allPlayerObjects[playerId].GetComponent() : null); EnemyAI componentInChildren = ((Component)val4).gameObject.GetComponentInChildren(); if (componentInChildren != null) { componentInChildren.SetEnemyStunned(setToStunned, stunTime, val5); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void AttachMapObjectEveryoneRpc(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) 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(3834390431u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref obj, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3834390431u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__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(); LFCMapObjectsManager.AttachMapObjectForEveryone(component, ((Component)val4).gameObject); } } } public void Awake() { Instance = this; } [Rpc(/*Could not decode attribute arguments.*/)] public void PlayParticleEveryoneRpc(string tag, Vector3 position, Quaternion rotation, bool scaleMain = true, float scaleFactor = 1f, bool active = true) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014d: 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_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0163: 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_00f5: 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_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_012a: 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) 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(2780393500u, 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 scaleMain, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref scaleFactor, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref active, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2780393500u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; LFCGlobalManager.PlayParticle(tag, position, rotation, scaleMain, scaleFactor, active); } } [Rpc(/*Could not decode attribute arguments.*/)] public void PlayAudioEveryoneRpc(string tag, Vector3 position, bool active = true) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010a: 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_0119: 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_00cd: 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_00e7: 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) 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(1515644396u, 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 active, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1515644396u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; LFCGlobalManager.PlayAudio(tag, position, active); } } [Rpc(/*Could not decode attribute arguments.*/)] public void SetScrapValueEveryoneRpc(NetworkObjectReference obj, int value) { //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_0091: 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) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(3836679240u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref obj, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val3, value); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3836679240u, 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)) { GrabbableObject componentInChildren = ((Component)val4).gameObject.GetComponentInChildren(); if (componentInChildren != null) { componentInChildren.SetScrapValue(value); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void ForceGrabObjectEveryoneRpc(NetworkObjectReference obj, 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_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_0091: 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) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(822975632u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref obj, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val3, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val3, 822975632u, 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)) { PlayerControllerB component = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent(); if (LFCUtilities.ShouldBeLocalPlayer(component)) { ((MonoBehaviour)this).StartCoroutine(LFCObjectsManager.ForceGrabObjectCoroutine(((Component)val4).gameObject.GetComponentInChildren(), component)); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void ForceDiscardObjectEveryoneRpc(NetworkObjectReference obj, 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_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_0091: 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) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(1387120802u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref obj, default(ForNetworkSerializable)); BytePacker.WriteValueBitPacked(val3, playerId); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1387120802u, 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)) { return; } PlayerControllerB component = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent(); if ((Object)(object)component.currentlyHeldObjectServer != (Object)null) { GrabbableObject componentInChildren = ((Component)val4).gameObject.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && (Object)(object)componentInChildren == (Object)(object)component.currentlyHeldObjectServer) { componentInChildren.DropHeldObject(component); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void DestroyObjectEveryoneRpc(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)base.__rpc_exec_stage != 1) { RpcAttributeParams val = new RpcAttributeParams { RequireOwnership = false }; RpcParams val2 = default(RpcParams); FastBufferWriter val3 = ((NetworkBehaviour)this).__beginSendRpc(2451031075u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref obj, default(ForNetworkSerializable)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 2451031075u, 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)) { return; } GrabbableObject componentInChildren = ((Component)val4).gameObject.GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null) { return; } FlashlightItem val5 = (FlashlightItem)(object)((componentInChildren is FlashlightItem) ? componentInChildren : null); if (val5 != null && ((GrabbableObject)val5).isBeingUsed) { ((GrabbableObject)val5).isBeingUsed = false; val5.usingPlayerHelmetLight = false; ((Behaviour)val5.flashlightBulbGlow).enabled = false; val5.SwitchFlashlight(false); } else { BeltBagItem val6 = (BeltBagItem)(object)((componentInChildren is BeltBagItem) ? componentInChildren : null); if (val6 != null) { SkinnedMeshRenderer[] componentsInChildren = ((Component)val6).gameObject.GetComponentsInChildren(); foreach (SkinnedMeshRenderer item in componentsInChildren.ToList()) { Object.Destroy((Object)(object)item); } } } componentInChildren.DestroyObjectInHand(componentInChildren.playerHeldBy); } [Rpc(/*Could not decode attribute arguments.*/)] public void TeleportPlayerEveryoneRpc(int playerId, Vector3 position, bool isInElevator, bool isInHangarShipRoom, bool isInsideFactory, bool withRotation = false, float rotation = 0f, bool withSpawnAnimation = false) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0160: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: 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_0108: 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_0123: 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_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_016f: 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_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: 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(1566431813u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref isInElevator, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref isInHangarShipRoom, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref isInsideFactory, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref withRotation, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref rotation, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref withSpawnAnimation, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1566431813u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB component = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent(); component.averageVelocity = 0f; component.velocityLastFrame = Vector3.zero; component.isInElevator = isInElevator; component.isInHangarShipRoom = isInHangarShipRoom; component.isInsideFactory = isInsideFactory; component.TeleportPlayer(position, withRotation, rotation, false, true); if (withSpawnAnimation) { component.SpawnPlayerAnimation(); } for (int i = 0; i < component.ItemSlots.Length; i++) { if (!((Object)(object)component.ItemSlots[i] == (Object)null)) { component.ItemSlots[i].isInFactory = isInsideFactory; } } } [Rpc(/*Could not decode attribute arguments.*/)] public void DamagePlayerEveryoneRpc(int playerId, int damageNumber, bool hasDamageSFX = true, bool callRPC = true, int causeOfDeath = 0) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0101: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: 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_013a: 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) 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(3332903729u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); BytePacker.WriteValueBitPacked(val3, damageNumber); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref hasDamageSFX, default(ForPrimitives)); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref callRPC, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val3, causeOfDeath); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3332903729u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB component = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent(); if (LFCUtilities.ShouldBeLocalPlayer(component)) { component.DamagePlayer(damageNumber, hasDamageSFX, callRPC, (CauseOfDeath)causeOfDeath, 0, false, default(Vector3)); } } } [Rpc(/*Could not decode attribute arguments.*/)] public void KillPlayerEveryoneRpc(int playerId, Vector3 velocity, bool spawnBody, int causeOfDeath) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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(744021449u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref velocity); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref spawnBody, default(ForPrimitives)); BytePacker.WriteValueBitPacked(val3, causeOfDeath); ((NetworkBehaviour)this).__endSendRpc(ref val3, 744021449u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; PlayerControllerB component = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent(); if (LFCUtilities.ShouldBeLocalPlayer(component)) { component.KillPlayer(velocity, spawnBody, (CauseOfDeath)causeOfDeath, 0, default(Vector3), false); } } } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(941434864u, new RpcReceiveHandler(__rpc_handler_941434864), "TeleportEnemyEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(1127407031u, new RpcReceiveHandler(__rpc_handler_1127407031), "StunEnemyEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(3834390431u, new RpcReceiveHandler(__rpc_handler_3834390431), "AttachMapObjectEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(2780393500u, new RpcReceiveHandler(__rpc_handler_2780393500), "PlayParticleEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(1515644396u, new RpcReceiveHandler(__rpc_handler_1515644396), "PlayAudioEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(3836679240u, new RpcReceiveHandler(__rpc_handler_3836679240), "SetScrapValueEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(822975632u, new RpcReceiveHandler(__rpc_handler_822975632), "ForceGrabObjectEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(1387120802u, new RpcReceiveHandler(__rpc_handler_1387120802), "ForceDiscardObjectEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(2451031075u, new RpcReceiveHandler(__rpc_handler_2451031075), "DestroyObjectEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(1566431813u, new RpcReceiveHandler(__rpc_handler_1566431813), "TeleportPlayerEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(3332903729u, new RpcReceiveHandler(__rpc_handler_3332903729), "DamagePlayerEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(744021449u, new RpcReceiveHandler(__rpc_handler_744021449), "KillPlayerEveryoneRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_941434864(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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference enemyObj = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemyObj, default(ForNetworkSerializable)); Vector3 teleportPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref teleportPosition); bool isOutside = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isOutside, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((LFCNetworkManager)(object)target).TeleportEnemyEveryoneRpc(enemyObj, teleportPosition, isOutside); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1127407031(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_0074: 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_0092: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { NetworkObjectReference enemyObject = default(NetworkObjectReference); ((FastBufferReader)(ref reader)).ReadValueSafe(ref enemyObject, default(ForNetworkSerializable)); bool setToStunned = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref setToStunned, default(ForPrimitives)); float stunTime = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref stunTime, default(ForPrimitives)); int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((LFCNetworkManager)(object)target).StunEnemyEveryoneRpc(enemyObject, setToStunned, stunTime, playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3834390431(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; ((LFCNetworkManager)(object)target).AttachMapObjectEveryoneRpc(playerId, obj); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2780393500(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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_00df: 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) 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); bool scaleMain = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref scaleMain, default(ForPrimitives)); float scaleFactor = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref scaleFactor, default(ForPrimitives)); bool active = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref active, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((LFCNetworkManager)(object)target).PlayParticleEveryoneRpc(tag, position, rotation, scaleMain, scaleFactor, active); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1515644396(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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_00ab: 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); bool active = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref active, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((LFCNetworkManager)(object)target).PlayAudioEveryoneRpc(tag, position, active); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3836679240(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_003e: 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_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)); int value = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref value); target.__rpc_exec_stage = (__RpcExecStage)1; ((LFCNetworkManager)(object)target).SetScrapValueEveryoneRpc(obj, value); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_822975632(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_003e: 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_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)); int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((LFCNetworkManager)(object)target).ForceGrabObjectEveryoneRpc(obj, playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1387120802(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_003e: 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_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)); int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); target.__rpc_exec_stage = (__RpcExecStage)1; ((LFCNetworkManager)(object)target).ForceDiscardObjectEveryoneRpc(obj, playerId); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2451031075(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; ((LFCNetworkManager)(object)target).DestroyObjectEveryoneRpc(obj); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1566431813(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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_009a: 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_00b5: 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_00d0: 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_00e5: 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_011b: 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); bool isInElevator = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isInElevator, default(ForPrimitives)); bool isInHangarShipRoom = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isInHangarShipRoom, default(ForPrimitives)); bool isInsideFactory = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isInsideFactory, default(ForPrimitives)); bool withRotation = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref withRotation, default(ForPrimitives)); float rotation = default(float); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation, default(ForPrimitives)); bool withSpawnAnimation = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref withSpawnAnimation, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((LFCNetworkManager)(object)target).TeleportPlayerEveryoneRpc(playerId, position, isInElevator, isInHangarShipRoom, isInsideFactory, withRotation, rotation, withSpawnAnimation); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3332903729(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_00b0: 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); int damageNumber = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref damageNumber); bool hasDamageSFX = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref hasDamageSFX, default(ForPrimitives)); bool callRPC = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref callRPC, default(ForPrimitives)); int causeOfDeath = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref causeOfDeath); target.__rpc_exec_stage = (__RpcExecStage)1; ((LFCNetworkManager)(object)target).DamagePlayerEveryoneRpc(playerId, damageNumber, hasDamageSFX, callRPC, causeOfDeath); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_744021449(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_0091: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); Vector3 velocity = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref velocity); bool spawnBody = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref spawnBody, default(ForPrimitives)); int causeOfDeath = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref causeOfDeath); target.__rpc_exec_stage = (__RpcExecStage)1; ((LFCNetworkManager)(object)target).KillPlayerEveryoneRpc(playerId, velocity, spawnBody, causeOfDeath); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "LFCNetworkManager"; } } } namespace LegaFusionCore.Behaviours { public class LFCBouncyAoEProjectile : NetworkBehaviour, IHittable { [CompilerGenerated] private sealed class d__37 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Vector3 position; public LFCBouncyAoEProjectile <>4__this; 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__37(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0032: 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_010f: Expected O, but got Unknown int num = <>1__state; LFCBouncyAoEProjectile lFCBouncyAoEProjectile = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; 5__2 = 0f; break; case 1: <>1__state = -1; 5__2 += lFCBouncyAoEProjectile.AoETick; break; } if (5__2 < duration) { int num2 = Physics.OverlapSphereNonAlloc(position, lFCBouncyAoEProjectile.AoERadius, lFCBouncyAoEProjectile.overlapBuffer, lFCBouncyAoEProjectile.AoEMask, (QueryTriggerInteraction)2); for (int i = 0; i < num2; i++) { Collider val = lFCBouncyAoEProjectile.overlapBuffer[i]; if ((Object)(object)val == (Object)null) { continue; } EnemyAICollisionDetect result2; if (((Component)val).gameObject.TryGetComponentInParent(out PlayerControllerB result) && !result.isPlayerDead) { if (lFCBouncyAoEProjectile.CanAffectPlayer(result) && lFCBouncyAoEProjectile.affectedIds.Add(LFCUtilities.EncodePlayerId(result.playerClientId))) { lFCBouncyAoEProjectile.OnAffectPlayerServer(result); } } else if (((Component)val).gameObject.TryGetComponentInParent(out result2)) { EnemyAI mainScript = result2.mainScript; if (lFCBouncyAoEProjectile.CanAffectEnemy(mainScript) && lFCBouncyAoEProjectile.affectedIds.Add(((NetworkBehaviour)mainScript).NetworkObjectId)) { lFCBouncyAoEProjectile.OnAffectEnemyServer(mainScript); } } } <>2__current = (object)new WaitForSeconds(lFCBouncyAoEProjectile.AoETick); <>1__state = 1; return true; } Object.Destroy((Object)(object)((Component)lFCBouncyAoEProjectile).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(); } } public Rigidbody rigidbody; public int throwingPlayer = -1; public int bouncesLeft = 1; protected bool deactivated; private Vector3 lastVelocity; private readonly HashSet affectedIds = new HashSet(); private readonly Collider[] overlapBuffer = (Collider[])(object)new Collider[64]; public float InsideSpeed = 30f; public float OutsideSpeed = 40f; public float EntityThrowAngle = 45f; public int MaxBounces = 2; public float BounceDamping = 0.85f; public float PushOut = 0.05f; public float ExplosionNormalOffset = 0.2f; public float PlayerThrowSpeed = 30f; public float PlayerThrowUpVelocity = 3f; public float PlayerThrowMinY = -2f; public float AoERadius = 2f; public float AoEDuration = 2f; public float AoETick = 0.2f; public int AoEMask = 1084754248; protected virtual void PlayExplosionFx(Vector3 position, Quaternion rotation) { } protected virtual void PlayExplosionSfx(Vector3 position) { } protected virtual void OnAffectPlayerServer(PlayerControllerB player) { } protected virtual void OnAffectEnemyServer(EnemyAI enemy) { } protected virtual bool CanAffectPlayer(PlayerControllerB player) { return true; } protected virtual bool CanAffectEnemy(EnemyAI enemy) { if ((Object)(object)enemy != (Object)null && !enemy.isEnemyDead) { return (Object)(object)((NetworkBehaviour)enemy).NetworkObject != (Object)null; } return false; } private void FixedUpdate() { //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) if ((Object)(object)rigidbody != (Object)null) { lastVelocity = rigidbody.velocity; } } [Rpc(/*Could not decode attribute arguments.*/)] public void ThrowFromPositionEveryoneRpc(ulong entityId, Vector3 startPosition, Vector3 direction, bool isOutside) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018d: 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(681886309u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, entityId); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref startPosition); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref direction); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref isOutside, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val3, 681886309u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (!deactivated && !((Object)(object)rigidbody == (Object)null)) { if (LFCUtilities.IsServer) { bouncesLeft = Random.Range(0, MaxBounces + 1); } affectedIds.Clear(); affectedIds.Add(entityId); ((Component)this).transform.position = startPosition; rigidbody.position = startPosition; rigidbody.velocity = Vector3.zero; float speed = (isOutside ? OutsideSpeed : InsideSpeed); rigidbody.AddForce(ComputeArcVelocity(direction, speed, EntityThrowAngle), (ForceMode)2); } } [Rpc(/*Could not decode attribute arguments.*/)] public void ThrowFromPlayerEveryoneRpc(int playerId, Vector3 startPosition, Vector3 direction) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_00a8: 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_00da: 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_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: 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_01d2: 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_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: 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(3649219698u, val2, val, (SendTo)6, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val3, playerId); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref startPosition); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref direction); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3649219698u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (!deactivated && !((Object)(object)rigidbody == (Object)null)) { if (LFCUtilities.IsServer) { bouncesLeft = Random.Range(0, MaxBounces + 1); } PlayerControllerB component = StartOfRound.Instance.allPlayerObjects[playerId].GetComponent(); throwingPlayer = (int)component.playerClientId; affectedIds.Clear(); affectedIds.Add(LFCUtilities.EncodePlayerId(component.playerClientId)); if (direction.y < PlayerThrowMinY) { Vector3 val4 = new Vector3(direction.x, PlayerThrowMinY, direction.z); direction = ((Vector3)(ref val4)).normalized; } ((Component)this).transform.position = startPosition; rigidbody.position = startPosition; rigidbody.velocity = Vector3.zero; rigidbody.AddForce(direction * PlayerThrowSpeed, (ForceMode)2); rigidbody.AddForce(Vector3.up * PlayerThrowUpVelocity, (ForceMode)2); } } private static Vector3 ComputeArcVelocity(Vector3 direction, float speed, float angleDeg) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(direction.x, 0f, direction.z); float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude <= 0.0001f) { return Vector3.up * speed; } float num = angleDeg * (MathF.PI / 180f); float num2 = magnitude / (speed * Mathf.Cos(num)); float num3 = direction.y / num2 - 0.5f * Physics.gravity.y * num2; Vector3 val2 = ((Vector3)(ref val)).normalized * (speed * Mathf.Cos(num)); return val2 + Vector3.up * num3; } private void OnCollisionEnter(Collision collision) { //IL_005a: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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_00ed: 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_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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_00b2: 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_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) if (collision != null && !deactivated && LFCUtilities.IsServer && !((Object)(object)rigidbody == (Object)null) && (!((Object)(object)collision.collider != (Object)null) || (!((Component)collision.collider).gameObject.TryGetComponentInParent(out PlayerControllerB _) && !((Component)collision.collider).gameObject.TryGetComponentInParent(out EnemyAI _)))) { ContactPoint contact = collision.GetContact(0); Vector3 point = ((ContactPoint)(ref contact)).point; Vector3 normal = ((ContactPoint)(ref contact)).normal; if (bouncesLeft > 0) { bouncesLeft--; Vector3 position = point + normal * PushOut; Vector3 velocity = Vector3.Reflect(lastVelocity, normal) * BounceDamping; rigidbody.position = position; rigidbody.velocity = velocity; BounceEveryoneRpc(position, velocity); } else { ExplodeServerRpc(point + normal * ExplosionNormalOffset, Quaternion.LookRotation(normal)); } } } private void OnTriggerEnter(Collider collider) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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) if ((Object)(object)collider != (Object)null && !deactivated) { PlayerControllerB val = default(PlayerControllerB); EnemyAICollisionDetect val2 = default(EnemyAICollisionDetect); if (((Component)collider).TryGetComponent(ref val) && LFCUtilities.ShouldBeLocalPlayer(val) && !affectedIds.Contains(LFCUtilities.EncodePlayerId(val.playerClientId))) { ExplodeServerRpc(((Component)this).transform.position, Quaternion.identity); } else if (LFCUtilities.IsServer && ((Component)collider).TryGetComponent(ref val2) && (Object)(object)val2.mainScript != (Object)null && !affectedIds.Contains(((NetworkBehaviour)val2.mainScript).NetworkObjectId)) { ExplodeServerRpc(((Component)this).transform.position, Quaternion.identity); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void ExplodeServerRpc(Vector3 position, Quaternion rotation) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: 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_00fd: 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(1176404894u, val2, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref rotation); ((NetworkBehaviour)this).__endSendRpc(ref val3, 1176404894u, val2, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!deactivated) { PlayHitAudioEveryoneRpc("Lega Fusion Core" + ((Object)LegaFusionCore.hitProjectileAudio).name, position); DeactivateProjectile(); ExplodeEveryoneRpc(position, rotation); } } } [Rpc(/*Could not decode attribute arguments.*/)] private void BounceEveryoneRpc(Vector3 position, Vector3 velocity) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: 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) 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(3469097032u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref velocity); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3469097032u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; if (!deactivated && (Object)(object)rigidbody != (Object)null) { rigidbody.position = position; rigidbody.velocity = velocity; } } } [Rpc(/*Could not decode attribute arguments.*/)] private void PlayHitAudioEveryoneRpc(string tag, Vector3 pos) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) 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(3257513266u, 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 pos); ((NetworkBehaviour)this).__endSendRpc(ref val3, 3257513266u, val2, val, (SendTo)6, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; LFCGlobalManager.PlayAudio(tag, pos); } } [Rpc(/*Could not decode attribute arguments.*/)] private void ExplodeEveryoneRpc(Vector3 position, Quaternion rotation) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) 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(4249644908u, val2, val, (SendTo)6, (RpcDelivery)0); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref position); ((FastBufferWriter)(ref val3)).WriteValueSafe(ref rotation); ((NetworkBehaviour)this).__endSendRpc(ref val3, 4249644908u, 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(AoECoroutine(position, AoEDuration)); } else { DeactivateProjectile(); } PlayExplosionFx(position, rotation); PlayExplosionSfx(position); } } [IteratorStateMachine(typeof(d__37))] private IEnumerator AoECoroutine(Vector3 position, float duration) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__37(0) { <>4__this = this, position = position, duration = duration }; } protected virtual void DeactivateProjectile() { deactivated = true; ParticleSystem[] componentsInChildren = ((Component)this).GetComponentsInChildren(); foreach (ParticleSystem val in componentsInChildren) { Object.Destroy((Object)(object)val); } MeshRenderer[] componentsInChildren2 = ((Component)this).GetComponentsInChildren(); foreach (MeshRenderer val2 in componentsInChildren2) { Object.Destroy((Object)(object)val2); } TrailRenderer[] componentsInChildren3 = ((Component)this).GetComponentsInChildren(); foreach (TrailRenderer val3 in componentsInChildren3) { Object.Destroy((Object)(object)val3); } Collider[] componentsInChildren4 = ((Component)this).GetComponentsInChildren(); foreach (Collider val4 in componentsInChildren4) { Object.Destroy((Object)(object)val4); } } public bool Hit(int force, Vector3 hitDirection, PlayerControllerB playerWhoHit = null, bool playHitSFX = false, int hitID = -1) { //IL_0024: 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) if ((Object)(object)playerWhoHit != (Object)null && playerWhoHit.currentlyHeldObjectServer is Shovel) { ThrowFromPlayerEveryoneRpc((int)playerWhoHit.playerClientId, ((Component)this).transform.position, ((Component)playerWhoHit).transform.forward); } return true; } protected override void __initializeVariables() { ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(681886309u, new RpcReceiveHandler(__rpc_handler_681886309), "ThrowFromPositionEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(3649219698u, new RpcReceiveHandler(__rpc_handler_3649219698), "ThrowFromPlayerEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(1176404894u, new RpcReceiveHandler(__rpc_handler_1176404894), "ExplodeServerRpc"); ((NetworkBehaviour)this).__registerRpc(3469097032u, new RpcReceiveHandler(__rpc_handler_3469097032), "BounceEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(3257513266u, new RpcReceiveHandler(__rpc_handler_3257513266), "PlayHitAudioEveryoneRpc"); ((NetworkBehaviour)this).__registerRpc(4249644908u, new RpcReceiveHandler(__rpc_handler_4249644908), "ExplodeEveryoneRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_681886309(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { ulong entityId = default(ulong); ByteUnpacker.ReadValueBitPacked(reader, ref entityId); Vector3 startPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref startPosition); Vector3 direction = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref direction); bool isOutside = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe(ref isOutside, default(ForPrimitives)); target.__rpc_exec_stage = (__RpcExecStage)1; ((LFCBouncyAoEProjectile)(object)target).ThrowFromPositionEveryoneRpc(entityId, startPosition, direction, isOutside); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3649219698(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: 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_0063: 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) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { int playerId = default(int); ByteUnpacker.ReadValueBitPacked(reader, ref playerId); Vector3 startPosition = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref startPosition); Vector3 direction = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref direction); target.__rpc_exec_stage = (__RpcExecStage)1; ((LFCBouncyAoEProjectile)(object)target).ThrowFromPlayerEveryoneRpc(playerId, startPosition, direction); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1176404894(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); Quaternion rotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation); target.__rpc_exec_stage = (__RpcExecStage)1; ((LFCBouncyAoEProjectile)(object)target).ExplodeServerRpc(position, rotation); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3469097032(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); Vector3 velocity = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref velocity); target.__rpc_exec_stage = (__RpcExecStage)1; ((LFCBouncyAoEProjectile)(object)target).BounceEveryoneRpc(position, velocity); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3257513266(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007d: 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) 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 pos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pos); target.__rpc_exec_stage = (__RpcExecStage)1; ((LFCBouncyAoEProjectile)(object)target).PlayHitAudioEveryoneRpc(tag, pos); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_4249644908(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { Vector3 position = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref position); Quaternion rotation = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rotation); target.__rpc_exec_stage = (__RpcExecStage)1; ((LFCBouncyAoEProjectile)(object)target).ExplodeEveryoneRpc(position, rotation); target.__rpc_exec_stage = (__RpcExecStage)0; } } [MethodImpl(MethodImplOptions.NoInlining)] protected internal override string __getTypeName() { return "LFCBouncyAoEProjectile"; } } public class LFCCustomPassShader : CustomPass { private readonly Dictionary> targetRenderers = new Dictionary>(); private readonly Dictionary screenFilters = new Dictionary(); public void AddRenderers(Renderer[] renderers, Material material, string tag, Color color, GameObject source) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (tag == null) { tag = "default"; } if (!targetRenderers.TryGetValue(tag, out var value)) { value = new Dictionary(); targetRenderers[tag] = value; } foreach (Renderer val in renderers) { if ((Object)(object)val != (Object)null) { value[val] = (material, color, source); } } } public void RemoveRenderers(Renderer[] renderers, string tag) { if (string.IsNullOrEmpty(tag) || !targetRenderers.TryGetValue(tag, out var value)) { return; } foreach (Renderer val in renderers) { if ((Object)(object)val != (Object)null && value.Remove(val)) { val.SetPropertyBlock((MaterialPropertyBlock)null); } } if (value.Count == 0) { targetRenderers.Remove(tag); } } public void RemoveRenderersByTag(string tag) { if (!targetRenderers.TryGetValue(tag, out var value)) { return; } foreach (Renderer key in value.Keys) { if (key != null) { key.SetPropertyBlock((MaterialPropertyBlock)null); } } targetRenderers.Remove(tag); } public void ClearAllRenderers() { targetRenderers.Clear(); } public void AddFilter(Material material, string tag) { if (tag == null) { tag = "default"; } screenFilters[tag] = material; } public void RemoveFiltersByTag(string tag) { if (!string.IsNullOrEmpty(tag)) { screenFilters.Remove(tag); } } public void RemoveFiltersByMaterial(Material material) { List list = new List(); foreach (KeyValuePair screenFilter in screenFilters) { if ((Object)(object)screenFilter.Value == (Object)(object)material) { list.Add(screenFilter.Key); } } foreach (string item in list) { screenFilters.Remove(item); } } public void ClearAllFilters() { screenFilters.Clear(); } public override void Execute(CustomPassContext ctx) { //IL_0001: 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) DrawRenderers(ctx); DrawFilters(ctx); } private void DrawRenderers(CustomPassContext ctx) { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown //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_00ea: 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_0102: 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) if (targetRenderers.Count == 0) { return; } HashSet hashSet = new HashSet(); foreach (KeyValuePair> targetRenderer in targetRenderers) { Dictionary value = targetRenderer.Value; List list = new List(); foreach (KeyValuePair item in value) { Renderer key = item.Key; if ((Object)(object)key == (Object)null) { list.Add(key); continue; } var (val, val2, sourceObject) = item.Value; if (key.enabled && (Object)(object)val != (Object)null && LFCShaderFilterRegistry.ShouldRender(sourceObject) && hashSet.Add(key)) { if (val.HasProperty("_BaseColor")) { MaterialPropertyBlock val3 = new MaterialPropertyBlock(); val3.SetColor("_BaseColor", new Color(val2.r, val2.g, val2.b, val.GetColor("_BaseColor").a)); key.SetPropertyBlock(val3); } for (int i = 0; i < key.sharedMaterials.Length; i++) { ctx.cmd.DrawRenderer(key, val, i, 0); } } } foreach (Renderer item2 in list) { value.Remove(item2); } } } private void DrawFilters(CustomPassContext ctx) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) foreach (Material value in screenFilters.Values) { CoreUtils.DrawFullScreen(ctx.cmd, value, (MaterialPropertyBlock)null, 0); } } } public class LFCDecalMaskModfier : MonoBehaviour { public DecalProjector decalProjector; public LayerMask includeLayer; private readonly Collider[] overlapColliders = (Collider[])(object)new Collider[512]; public void Start() { //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_002c: 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) int num = Physics.OverlapBoxNonAlloc(((Component)decalProjector).transform.position, decalProjector.size, overlapColliders, ((Component)decalProjector).transform.rotation, LayerMask.op_Implicit(includeLayer), (QueryTriggerInteraction)1); for (int i = 0; i < num; i++) { Collider val = overlapColliders[i]; if (!((Object)(object)val != (Object)null)) { continue; } Renderer[] componentsInParent = ((Component)val).GetComponentsInParent(); foreach (Renderer val2 in componentsInParent) { if ((Object)(object)val2 != (Object)null) { val2.renderingLayerMask |= ConvertToRendererDecalMask(); } } } } public uint ConvertToRendererDecalMask() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected I4, but got Unknown uint num = (uint)(int)decalProjector.decalLayerMask; if (num == 0 || num > 255) { return num; } return num << 8; } } public class LFCEnemyDamageBehaviour { public static Dictionary extendedEnemyHP = new Dictionary(); public static int rateHP = 100; public static void InitExtendedHP(EnemyAI __instance) { if (!extendedEnemyHP.ContainsKey(__instance)) { extendedEnemyHP[__instance] = __instance.enemyHP * rateHP; } } public static int GetExtendedHP(EnemyAI enemy) { if (!extendedEnemyHP.ContainsKey(enemy)) { InitExtendedHP(enemy); } return extendedEnemyHP[enemy]; } public static void SetExtendedHP(EnemyAI enemy, int value) { extendedEnemyHP[enemy] = Mathf.Max(0, value); } public static void DamageEnemy(EnemyAI enemy, int force, int playerWhoHit = -1, bool playHitSFX = false, int hitID = -1, bool callHitEnemy = true) { //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) InitExtendedHP(enemy); PlayerControllerB val = ((playerWhoHit == -1) ? null : StartOfRound.Instance.allPlayerObjects[playerWhoHit].GetComponent()); int num = GetExtendedHP(enemy) - force; SetExtendedHP(enemy, num); int num2 = Mathf.CeilToInt((float)num / (float)rateHP); if (callHitEnemy) { if (num2 < enemy.enemyHP) { int num3 = enemy.enemyHP - num2; PlayerControllerB val2 = val; bool flag = playHitSFX; enemy.HitEnemyOnLocalClient(num3, default(Vector3), val2, flag, hitID); } else if (playHitSFX && (Object)(object)enemy.enemyType?.hitBodySFX != (Object)null && !enemy.isEnemyDead) { enemy.creatureSFX.PlayOneShot(enemy.enemyType.hitBodySFX); WalkieTalkie.TransmitOneShotAudio(enemy.creatureSFX, enemy.enemyType.hitBodySFX, 1f); } } } } public class LFCEnemySpeedBehaviour : MonoBehaviour { private struct EnemySpeedData { public float speedFactor; public float originalSpeed; public EnemySpeedData(float speedFactor, float originalSpeed) { this.speedFactor = speedFactor; this.originalSpeed = originalSpeed; } } public EnemyAI enemy; private readonly Dictionary enemySpeedFactor = new Dictionary(); private float FinalSpeed { get { float num = 1f + enemySpeedFactor.Values.Select((EnemySpeedData e) => e.speedFactor).Sum(); float num2 = enemySpeedFactor.Values.Select((EnemySpeedData e) => e.originalSpeed).Max(); return num2 * num; } } public void AddSpeedData(string id, float speedFactor, float originalSpeed) { if (!HasSpeedData(id)) { enemySpeedFactor[id] = new EnemySpeedData(speedFactor, originalSpeed); } } public void RemoveSpeedData(string id) { if (enemySpeedFactor.TryGetValue(id, out var value) && enemy.agent.speed > 0f) { enemy.agent.speed = value.originalSpeed; EnemyAI obj = enemy; SandSpiderAI val = (SandSpiderAI)(object)((obj is SandSpiderAI) ? obj : null); if (val != null) { val.spiderSpeed = enemy.agent.speed; } } enemySpeedFactor.Remove(id); } public bool HasSpeedData(string id) { EnemySpeedData value; return enemySpeedFactor.TryGetValue(id, out value); } private void ApplySpeedData() { if ((Object)(object)enemy != (Object)null && (Object)(object)enemy.agent != (Object)null && enemySpeedFactor.Count != 0) { enemy.agent.speed = Mathf.Min(enemy.agent.speed, FinalSpeed); EnemyAI obj = enemy; SandSpiderAI val = (SandSpiderAI)(object)((obj is SandSpiderAI) ? obj : null); if (val != null) { val.spiderSpeed = enemy.agent.speed; } } } private void Update() { ApplySpeedData(); } private void LateUpdate() { ApplySpeedData(); } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } } namespace __GEN { internal class NetworkVariableSerializationHelper { [RuntimeInitializeOnLoadMethod] internal static void InitializeSerialization() { } } } namespace LegaFusionCore.NetcodePatcher { [AttributeUsage(AttributeTargets.Module)] internal class NetcodePatchedAssemblyAttribute : Attribute { } }