using System; using System.Collections; using System.Collections.Generic; using System.Collections.Immutable; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using AIGraph; using AK; using Agents; using AssetShards; using BepInEx; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using BepInEx.Unity.IL2CPP.Utils.Collections; using BoosterImplants; using CellMenu; using ChainedPuzzles; using EOSExt.Reactor.Managers; using Enemies; using ExtraObjectiveSetup; using ExtraObjectiveSetup.BaseClasses; using ExtraObjectiveSetup.ExtendedWardenEvents; using ExtraObjectiveSetup.Instances; using ExtraObjectiveSetup.JSON; using ExtraObjectiveSetup.Utils; using FloLib.Infos; using FloLib.Networks.Replications; using GTFO.API; using GTFO.API.Utilities; using GameData; using GameEvent; using Gear; using HarmonyLib; using Il2CppInterop.Runtime.Injection; using Il2CppInterop.Runtime.InteropTypes; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSystem; using Il2CppSystem.Collections.Generic; using LEGACY.ExtraEvents; using LEGACY.ExtraEvents.Patches; using LEGACY.LegacyOverride; using LEGACY.LegacyOverride.DummyVisual; using LEGACY.LegacyOverride.DummyVisual.VisualGOAnimation; using LEGACY.LegacyOverride.DummyVisual.VisualGOAnimation.AnimationConfig; using LEGACY.LegacyOverride.DummyVisual.VisualSequenceType; using LEGACY.LegacyOverride.ElevatorCargo; using LEGACY.LegacyOverride.EnemyTagger; using LEGACY.LegacyOverride.EventScan; using LEGACY.LegacyOverride.ExpeditionIntelNotification; using LEGACY.LegacyOverride.ExpeditionSuccessPage; using LEGACY.LegacyOverride.FogBeacon; using LEGACY.LegacyOverride.ForceFail; using LEGACY.LegacyOverride.Music; using LEGACY.LegacyOverride.ResourceStations; using LEGACY.LegacyOverride.Restart; using LEGACY.Utils; using LEGACY.VanillaFix; using LevelGeneration; using Localization; using MTFO.API; using Microsoft.CodeAnalysis; using Player; using SNetwork; using ScanPosOverride.Managers; using TMPro; using ThermalSights; using UnityEngine; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("LEGACY")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("LEGACY")] [assembly: AssemblyTitle("LEGACY")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] 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; } } } [HarmonyPatch(typeof(PUI_Watermark), "UpdateWatermark")] internal static class Patch_WatermarkUpdateWatermark { private static void Postfix(PUI_Watermark __instance) { string text = "4.6.2+git44e73d7-dirty-main".Remove("x.x.x".Length); ((TMP_Text)__instance.m_watermarkText).SetText("MODDED " + text + "\nPE 2.6.2", true); } } namespace LEGACY { internal static class Assets { public static GameObject CircleSensor { get; private set; } public static GameObject MovableSensor { get; private set; } public static GameObject OBSVisual { get; private set; } public static GameObject ObjectiveMarker { get; private set; } public static GameObject EventScan { get; private set; } internal static GameObject DummyScan { get; private set; } internal static GameObject DummySensor { get; private set; } internal static GameObject AmmoStation { get; private set; } internal static GameObject MediStation { get; private set; } internal static GameObject ToolStation { get; private set; } internal static GameObject RestartPage { get; private set; } public static void Init() { CircleSensor = AssetAPI.GetLoadedAsset("Assets/SecuritySensor/CircleSensor.prefab"); MovableSensor = AssetAPI.GetLoadedAsset("Assets/SecuritySensor/MovableSensor.prefab"); OBSVisual = AssetAPI.GetLoadedAsset("Assets/SecuritySensor/OBSVisual.prefab"); ObjectiveMarker = AssetAPI.GetLoadedAsset("Assets/SecuritySensor/ObjectiveMarker.prefab"); EventScan = AssetAPI.GetLoadedAsset("Assets/EventObjects/EventScan.prefab"); DummyScan = AssetAPI.GetLoadedAsset("Assets/DummyVisual/DummyScan.prefab"); DummySensor = AssetAPI.GetLoadedAsset("Assets/DummyVisual/DummySensor.prefab"); AmmoStation = AssetAPI.GetLoadedAsset("Assets/Misc/AmmoStation.prefab"); MediStation = AssetAPI.GetLoadedAsset("Assets/Misc/MediStation.prefab"); ToolStation = AssetAPI.GetLoadedAsset("Assets/Misc/ToolStation.prefab"); RestartPage = AssetAPI.GetLoadedAsset("Assets/Misc/CM_PageRestart_CellUI.prefab"); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInIncompatibility("Localia.TeammatesIgnoreBullets")] [BepInIncompatibility("Hikaria.InLevelCarryOnBack")] [BepInIncompatibility("com.Chaxi.StrongerPrisoner")] [BepInPlugin("Inas.LEGACY", "LEGACY", "4.4.5")] public class EntryPoint : BasePlugin { public const string AUTHOR = "Inas"; public const string RUNDOWN_NAME = "LEGACY"; public const string VERSION = "4.4.5"; public const bool TESTING = false; public const string TEST_STRING = "TESTING"; private Harmony m_Harmony; public override void Load() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown m_Harmony = new Harmony("LEGACY"); m_Harmony.PatchAll(); LegacyOverrideManagers.Init(); LegacyExtraEvents.Init(); LEGACY.VanillaFix.Debugger.Current.Init(); AssetAPI.OnAssetBundlesLoaded += Assets.Init; EventAPI.OnManagersSetup += delegate { AssetShardManager.OnStartupAssetsLoaded += Action.op_Implicit((Action)MainMenuGuiLayer.Current.PageRundownNew.SetupCustomTutorialButton); }; } } } namespace LEGACY.Reactor { [HarmonyPatch] internal class Patch_ReactorShutdown { [HarmonyPostfix] [HarmonyPatch(typeof(LG_WardenObjective_Reactor), "OnStateChange")] private static void Post_OnStateChange(LG_WardenObjective_Reactor __instance, pReactorState oldState, pReactorState newState) { //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_0017: 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_0037: 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_0072: Invalid comparison between Unknown and I4 //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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_0097: 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_009b: 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_00b0: Expected I4, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance == (Object)null || oldState.status == newState.status) { return; } WardenObjectiveDataBlock val = null; if (!WardenObjectiveManager.Current.TryGetActiveWardenObjectiveData(__instance.SpawnNode.LayerType, ref val) || val == null) { LegacyLogger.Error("Patch_ReactorShutdown: "); LegacyLogger.Error("Failed to get warden objective"); } else if ((int)val.Type == 2 && !val.OnActivateOnSolveItem) { eWardenObjectiveEventTrigger val2 = (eWardenObjectiveEventTrigger)0; eReactorStatus status = newState.status; eReactorStatus val3 = status; switch (val3 - 7) { default: return; case 0: val2 = (eWardenObjectiveEventTrigger)1; break; case 1: val2 = (eWardenObjectiveEventTrigger)2; break; case 2: val2 = (eWardenObjectiveEventTrigger)3; break; } LG_LayerType layerType = __instance.SpawnNode.LayerType; WardenObjectiveManager.CheckAndExecuteEventsOnTrigger(val.EventsOnActivate, val2, false, 0f, (Il2CppStructArray)null); } } [HarmonyPrefix] [HarmonyPatch(typeof(LG_WardenObjective_Reactor), "OnBuildDone")] private static void Pre_OnBuildDone_ChainedPuzzleMidObjectiveFix(LG_WardenObjective_Reactor __instance) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) WardenObjectiveDataBlock val = null; if (!WardenObjectiveManager.Current.TryGetActiveWardenObjectiveData(__instance.SpawnNode.LayerType, ref val) || val == null) { LegacyLogger.Error("Patch_ReactorShutdown: Failed to get warden objective"); } else if (val.ChainedPuzzleMidObjective != 0) { __instance.m_chainedPuzzleAlignMidObjective = __instance.m_chainedPuzzleAlign; } } [HarmonyPrefix] [HarmonyPatch(typeof(LG_WardenObjective_Reactor), "Update")] private static bool Pre_Update(LG_WardenObjective_Reactor __instance) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Invalid comparison between Unknown and I4 if ((int)__instance.m_currentState.status != 7) { return true; } if (!__instance.m_currentWaveData.HasVerificationTerminal) { return true; } __instance.SetGUIMessage(true, Text.Format(3000u, (Object[])(object)new Object[1] { Object.op_Implicit("" + __instance.m_currentWaveData.VerificationTerminalSerial + "") }), (ePUIMessageStyle)3, false, "", ""); return false; } } [HarmonyPatch] internal class Patch_ReactorStartup_ExtraEventsExecution { [HarmonyPostfix] [HarmonyPatch(typeof(LG_WardenObjective_Reactor), "OnStateChange")] private static void Post_ExecuteOnNoneEventsOnDefenseStart(LG_WardenObjective_Reactor __instance, pReactorState oldState, pReactorState newState) { //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_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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_001c: Invalid comparison between Unknown and I4 if (oldState.status != newState.status && (int)newState.status == 3) { WardenObjectiveManager.CheckAndExecuteEventsOnTrigger(__instance.m_currentWaveData.Events, (eWardenObjectiveEventTrigger)0, false, 0f, (Il2CppStructArray)null); } } [HarmonyPostfix] [HarmonyPatch(typeof(LG_WardenObjective_Reactor), "OnBuildDone")] private static void Post_OnBuildDone(LG_WardenObjective_Reactor __instance) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Invalid comparison between Unknown and I4 WardenObjectiveDataBlock db = default(WardenObjectiveDataBlock); if (!WardenObjectiveManager.Current.TryGetActiveWardenObjectiveData(__instance.SpawnNode.LayerType, ref db) || db == null) { LegacyLogger.Error("Patch_ReactorStartup_ExtraEventsExecution: "); LegacyLogger.Error("Failed to get warden objective"); } else if ((int)db.Type == 1 && !db.OnActivateOnSolveItem) { ChainedPuzzleInstance chainedPuzzleToStartSequence = __instance.m_chainedPuzzleToStartSequence; chainedPuzzleToStartSequence.OnPuzzleSolved += Action.op_Implicit((Action)delegate { WardenObjectiveManager.CheckAndExecuteEventsOnTrigger(db.EventsOnActivate, (eWardenObjectiveEventTrigger)0, true, 0f, (Il2CppStructArray)null); }); } } } [HarmonyPatch] internal class Patch_ReactorStartup_OverwriteGUIBehaviour { private static HashSet ForceDisableLevels; [HarmonyPrefix] [HarmonyPatch(typeof(LG_WardenObjective_Reactor), "OnStateChange")] private static bool Pre_HideReactorMessageForInfiniteWave(LG_WardenObjective_Reactor __instance, pReactorState oldState, pReactorState newState) { //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_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_001a: 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_0021: Invalid comparison between Unknown and I4 //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Invalid comparison between Unknown and I4 //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Invalid comparison between Unknown and I4 //IL_0053: 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_0077: 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_006b: 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_00a4: 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_00ab: 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_00af: 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_00c4: Expected I4, but got Unknown //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) if (oldState.status == newState.status) { return true; } if ((int)newState.status != 2 && (int)newState.status != 3 && (int)newState.status != 4) { return true; } if (ForceDisable()) { if (oldState.stateCount != newState.stateCount) { __instance.OnStateCountUpdate(newState.stateCount); } if (oldState.stateProgress != newState.stateProgress) { __instance.OnStateProgressUpdate(newState.stateProgress); } __instance.ReadyForVerification = false; eReactorStatus status = newState.status; eReactorStatus val = status; switch (val - 2) { case 0: { WardenObjectiveDataBlock val2 = null; if (!WardenObjectiveManager.Current.TryGetActiveWardenObjectiveData(__instance.SpawnNode.LayerType, ref val2) || val2 == null) { LegacyLogger.Error("Patch_ReactorStartup_OverwriteGUIBehaviour: "); LegacyLogger.Error("Failed to get warden objective datablock"); break; } __instance.m_lightCollection.SetMode(val2.LightsOnDuringIntro); __instance.m_lightCollection.ResetUpdateValues(true); __instance.lcReset = true; __instance.m_lightsBlinking = false; __instance.m_spawnEnemies = false; __instance.m_progressUpdateEnabled = true; __instance.m_alarmCountdownPlayed = false; __instance.m_currentDuration = ((!newState.verifyFailed) ? __instance.m_currentWaveData.Warmup : __instance.m_currentWaveData.WarmupFail); WardenObjectiveManager.CheckAndExecuteEventsOnTrigger(__instance.m_currentWaveData.Events, (eWardenObjectiveEventTrigger)1, false, 0f, (Il2CppStructArray)null); if (__instance.m_currentWaveCount == 1) { Debug.LogError(Object.op_Implicit("Reactor IDLE START")); __instance.m_sound.Post(EVENTS.REACTOR_POWER_LEVEL_1_LOOP, true); __instance.m_sound.SetRTPCValue(GAME_PARAMETERS.REACTOR_POWER, 0f); } else { Debug.LogError(Object.op_Implicit("Reactor REACTOR_POWER_DOWN")); __instance.m_sound.Post(EVENTS.REACTOR_POWER_LEVEL_2_TO_1_TRANSITION, true); __instance.m_sound.SetRTPCValue(GAME_PARAMETERS.REACTOR_POWER, 0f); } break; } case 1: __instance.m_lightCollection.ResetUpdateValues(true); __instance.lcReset = true; __instance.m_spawnEnemies = true; __instance.m_currentEnemyWaveIndex = 0; __instance.m_alarmCountdownPlayed = false; __instance.m_progressUpdateEnabled = true; __instance.m_currentDuration = __instance.m_currentWaveData.Wave; __instance.m_sound.Post(EVENTS.REACTOR_POWER_LEVEL_1_TO_3_TRANSITION, true); break; case 2: __instance.m_lightCollection.ResetUpdateValues(false); __instance.lcReset = true; __instance.m_spawnEnemies = false; __instance.m_progressUpdateEnabled = true; __instance.ReadyForVerification = true; Debug.Log(Object.op_Implicit("Wait for verify! newState.verifyFailed? " + newState.verifyFailed)); __instance.m_currentDuration = ((!newState.verifyFailed) ? __instance.m_currentWaveData.Verify : __instance.m_currentWaveData.VerifyFail); WardenObjectiveManager.CheckAndExecuteEventsOnTrigger(__instance.m_currentWaveData.Events, (eWardenObjectiveEventTrigger)2, false, 0f, (Il2CppStructArray)null); break; } __instance.m_currentState = newState; return false; } return true; } private static bool ForceDisable() { return ForceDisableLevels.Contains(RundownManager.ActiveExpedition.LevelLayoutData); } static Patch_ReactorStartup_OverwriteGUIBehaviour() { ForceDisableLevels = new HashSet(); LevelLayoutDataBlock block = GameDataBlockBase.GetBlock("Legacy_L3E2_L1"); if (block != null) { ForceDisableLevels.Add(((GameDataBlockBase)(object)block).persistentID); } block = GameDataBlockBase.GetBlock("Legacy_L1E1_L1"); if (block != null) { ForceDisableLevels.Add(((GameDataBlockBase)(object)block).persistentID); } } } } namespace LEGACY.HardcodedBehaviours { [HarmonyPatch] internal class Patch_PickupItem_Hardcoded { [HarmonyPrefix] [HarmonyPatch(typeof(LG_Distribute_PickupItemsPerZone), "Build")] private static void Pre_LG_Distribute_PickupItemsPerZone(LG_Distribute_PickupItemsPerZone __instance) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Invalid comparison between Unknown and I4 //IL_004b: 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_0052: 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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Invalid comparison between Unknown and I4 //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Invalid comparison between Unknown and I4 LevelLayoutDataBlock block = GameDataBlockBase.GetBlock("LAYOUT_O4_1_L1"); if (block == null || RundownManager.ActiveExpedition.LevelLayoutData != ((GameDataBlockBase)(object)block).persistentID) { return; } eLocalZoneIndex localIndex = __instance.m_zone.LocalIndex; eLocalZoneIndex val = localIndex; if ((int)val != 1) { if ((int)val == 5) { __instance.m_zonePlacementWeights.Start = 0f; __instance.m_zonePlacementWeights.Middle = 0f; __instance.m_zonePlacementWeights.End = 100000f; } return; } ePickupItemType pickupType = __instance.m_pickupType; ePickupItemType val2 = pickupType; if ((int)val2 == 1) { __instance.m_zonePlacementWeights.Start = 100000f; __instance.m_zonePlacementWeights.Middle = 0f; __instance.m_zonePlacementWeights.End = 0f; } } } } namespace LEGACY.VanillaFix { [HarmonyPatch] internal class Patch_FixScoutFreeze { [HarmonyPrefix] [HarmonyPatch(typeof(ES_ScoutScream), "CommonUpdate")] private static bool Prefix_Debug(ES_ScoutScream __instance) { if (((AgentAI)((ES_Base)__instance).m_ai).Target == null) { return false; } return true; } } [HarmonyPatch] internal class Patch_LG_SecurityDoor_Fix_EventsOnUnlockDoor_Powergenerator { [HarmonyPrefix] [HarmonyPatch(typeof(LG_SecurityDoor), "OnSyncDoorStatusChange")] private static void Pre_OnSyncDoorStatusChange(LG_SecurityDoor __instance, pDoorState state, bool isRecall) { //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_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Invalid comparison between Unknown and I4 //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Invalid comparison between Unknown and I4 //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Invalid comparison between Unknown and I4 eDoorStatus status = state.status; eDoorStatus val = status; if ((val - 4 <= 1 || (int)val == 9) && (int)__instance.m_lastState.status == 6 && !isRecall) { WardenObjectiveManager.CheckAndExecuteEventsOnTrigger(__instance.LinkedToZoneData.EventsOnUnlockDoor, (eWardenObjectiveEventTrigger)0, true, 0f, (Il2CppStructArray)null); } } } [HarmonyPatch] internal class Patch_LockSecurityDoor_FixCustomText { [HarmonyPostfix] [HarmonyPatch(typeof(LG_SecurityDoor_Locks), "Setup", new Type[] { typeof(LG_SecurityDoor) })] private static void Post_LG_SecurityDoor_Locks_Setup(LG_SecurityDoor door, LG_SecurityDoor_Locks __instance) { LocalizedText customText = door.LinkedToZoneData.ProgressionPuzzleToEnter.CustomText; __instance.m_lockedWithNoKeyInteractionText = customText; } } [HarmonyPatch] internal class Debugger { public static Debugger Current { get; private set; } = new Debugger(); public bool DEBUGGING { get; private set; } = false; private Debugger() { } internal void Init() { if (DEBUGGING) { } } private void f1(int k, out string v) { if (k < 2) { v = "2"; } v = null; } private void f2(int k, ref string v) { if (k < 2) { v = "2"; } } } } namespace LEGACY.Utils { public delegate float EasingFunction(float t, float b, float c, float d); public delegate bool BoolCheck(); internal static class CoroutineEase { [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Transform trans; public Vector3 sourcePos; public Vector3 targetPos; public float startTime; public float duration; public EasingFunction ease; public Action onDone; public BoolCheck checkAbort; private bool 5__1; private float 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = false; break; case 1: <>1__state = -1; break; } if (Clock.Time < startTime + duration && !5__1) { 5__1 = checkAbort != null && checkAbort(); 5__2 = ease(Clock.Time - startTime, 0f, 1f, duration); trans.localPosition = Vector3.Lerp(sourcePos, targetPos, 5__2); <>2__current = null; <>1__state = 1; return true; } trans.localPosition = targetPos; if (!5__1 && onDone != null) { onDone(); } 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__2 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Transform trans; public Vector3 sourceEuler; public Vector3 targetEuler; public float startTime; public float duration; public EasingFunction ease; public Action onDone; public BoolCheck checkAbort; private bool 5__1; private float 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__2(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = false; break; case 1: <>1__state = -1; break; } if (Clock.Time < startTime + duration && !5__1) { 5__1 = checkAbort != null && checkAbort(); 5__2 = ease(Clock.Time - startTime, 0f, 1f, duration); trans.localEulerAngles = Vector3.Lerp(sourceEuler, targetEuler, 5__2); <>2__current = null; <>1__state = 1; return true; } trans.localEulerAngles = targetEuler; if (!5__1 && onDone != null) { onDone(); } 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__0 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Transform trans; public Vector3 startScale; public Vector3 targetScale; public float startTime; public float duration; public EasingFunction ease; public Action onDone; public BoolCheck checkAbort; private bool 5__1; private float 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__0(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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) switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = false; break; case 1: <>1__state = -1; break; } if (Clock.Time < startTime + duration && !5__1) { 5__1 = checkAbort != null && checkAbort(); 5__2 = ease(Clock.Time - startTime, 0f, 1f, duration); trans.localScale = Vector3.Lerp(startScale, targetScale, 5__2); <>2__current = null; <>1__state = 1; return true; } trans.localScale = targetScale; if (!5__1 && onDone != null) { onDone(); } 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(); } } [IteratorStateMachine(typeof(d__0))] private static IEnumerator DoEaseLocalScale(Transform trans, Vector3 startScale, Vector3 targetScale, float startTime, float duration, EasingFunction ease, Action onDone, BoolCheck checkAbort) { //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) //IL_0015: 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) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__0(0) { trans = trans, startScale = startScale, targetScale = targetScale, startTime = startTime, duration = duration, ease = ease, onDone = onDone, checkAbort = checkAbort }; } [IteratorStateMachine(typeof(d__1))] private static IEnumerator DoEaseLocalPos(Transform trans, Vector3 sourcePos, Vector3 targetPos, float startTime, float duration, EasingFunction ease, Action onDone, BoolCheck checkAbort) { //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) //IL_0015: 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) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { trans = trans, sourcePos = sourcePos, targetPos = targetPos, startTime = startTime, duration = duration, ease = ease, onDone = onDone, checkAbort = checkAbort }; } [IteratorStateMachine(typeof(d__2))] private static IEnumerator DoEaseLocalRot(Transform trans, Vector3 sourceEuler, Vector3 targetEuler, float startTime, float duration, EasingFunction ease, Action onDone, BoolCheck checkAbort) { //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) //IL_0015: 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) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__2(0) { trans = trans, sourceEuler = sourceEuler, targetEuler = targetEuler, startTime = startTime, duration = duration, ease = ease, onDone = onDone, checkAbort = checkAbort }; } internal static Coroutine EaseLocalScale(Transform trans, Vector3 startScale, Vector3 targetScale, float duration, EasingFunction ease = null, Action onDone = null, BoolCheck checkAbort = null) { //IL_0015: 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) EasingFunction ease2 = ease ?? new EasingFunction(Easing.EaseOutExpo); return CoroutineManager.StartCoroutine(CollectionExtensions.WrapToIl2Cpp(DoEaseLocalScale(trans, startScale, targetScale, Clock.Time, duration, ease2, onDone, checkAbort)), (Action)null); } internal static Coroutine EaseLocalPos(Transform trans, Vector3 sourcePos, Vector3 targetPos, float duration, EasingFunction ease = null, Action onDone = null, BoolCheck checkAbort = null) { //IL_0015: 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) EasingFunction ease2 = ease ?? new EasingFunction(Easing.EaseOutExpo); return CoroutineManager.StartCoroutine(CollectionExtensions.WrapToIl2Cpp(DoEaseLocalPos(trans, sourcePos, targetPos, Clock.Time, duration, ease2, onDone, checkAbort)), (Action)null); } internal static Coroutine EaseLocalRot(Transform trans, Vector3 sourceEuler, Vector3 targetEuler, float duration, EasingFunction ease = null, Action onDone = null, BoolCheck checkAbort = null) { //IL_0015: 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) EasingFunction ease2 = ease ?? new EasingFunction(Easing.EaseOutExpo); return CoroutineManager.StartCoroutine(CollectionExtensions.WrapToIl2Cpp(DoEaseLocalRot(trans, sourceEuler, targetEuler, Clock.Time, duration, ease2, onDone, checkAbort)), (Action)null); } } public static class GOExtensions { public static GameObject GetChild(this GameObject go, string childName, bool substrSearch = false, bool recursiveSearch = true) { if (((Object)go).name.Equals(childName) || (substrSearch && ((Object)go).name.Contains(childName))) { return go; } for (int i = 0; i < go.transform.childCount; i++) { GameObject gameObject = ((Component)go.transform.GetChild(i)).gameObject; GameObject val = null; if (recursiveSearch) { val = gameObject.GetChild(childName, substrSearch); } else if (((Object)gameObject).name.Equals(childName) || (substrSearch && ((Object)gameObject).name.Contains(childName))) { val = gameObject; } if ((Object)(object)val != (Object)null) { return val; } } return null; } } public static class Helper { private static void ResetChild(iChainedPuzzleCore ICore) { CP_Bioscan_Core val = ((Il2CppObjectBase)ICore).TryCast(); if ((Object)(object)val != (Object)null) { CP_Holopath_Spline val2 = ((Il2CppObjectBase)val.m_spline).Cast(); CP_PlayerScanner val3 = ((Il2CppObjectBase)val.PlayerScanner).Cast(); val3.ResetScanProgression(0f); val.Deactivate(); return; } CP_Cluster_Core val4 = ((Il2CppObjectBase)ICore).TryCast(); if ((Object)(object)val4 == (Object)null) { LegacyLogger.Error("ResetChild: found iChainedPuzzleCore that is neither CP_Bioscan_Core nor CP_Cluster_Core..."); return; } CP_Holopath_Spline val5 = ((Il2CppObjectBase)val4.m_spline).Cast(); foreach (iChainedPuzzleCore item in (Il2CppArrayBase)(object)val4.m_childCores) { ResetChild(item); } val4.Deactivate(); } public static void ResetChainedPuzzle(ChainedPuzzleInstance chainedPuzzleInstance) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //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_007f: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_00b9: 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) if (chainedPuzzleInstance.Data.DisableSurvivalWaveOnComplete) { chainedPuzzleInstance.m_sound = new CellSoundPlayer(chainedPuzzleInstance.m_parent.position); } foreach (iChainedPuzzleCore item in (Il2CppArrayBase)(object)chainedPuzzleInstance.m_chainedPuzzleCores) { ResetChild(item); } if (SNet.IsMaster) { pChainedPuzzleState state = chainedPuzzleInstance.m_stateReplicator.State; pChainedPuzzleState val = default(pChainedPuzzleState); val.status = (eChainedPuzzleStatus)0; val.currentSurvivalWave_EventID = state.currentSurvivalWave_EventID; val.isSolved = false; val.isActive = false; pChainedPuzzleState val2 = val; chainedPuzzleInstance.m_stateReplicator.InteractWithState(val2, new pChainedPuzzleInteraction { type = (eChainedPuzzleInteraction)2 }); } } public static List ToManagedList(this List il2cppList) { List list = new List(); Enumerator enumerator = il2cppList.GetEnumerator(); while (enumerator.MoveNext()) { T current = enumerator.Current; list.Add(current); } return list; } public static bool TryGetComponent(this GameObject obj, out T comp) { comp = obj.GetComponent(); return comp != null; } public static bool IsPlayerInLevel(PlayerAgent player) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Invalid comparison between Unknown and I4 return (int)player.Owner.Load().gameState == 10; } public static ChainedPuzzleInstance GetChainedPuzzleForCommandOnTerminal(LG_ComputerTerminal terminal, string command) { //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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected I4, but got Unknown //IL_00d7: 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_0184: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Invalid comparison between Unknown and I4 //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Invalid comparison between Unknown and I4 //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Invalid comparison between Unknown and I4 //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Invalid comparison between Unknown and I4 //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Invalid comparison between Unknown and I4 //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Invalid comparison between Unknown and I4 //IL_025f: Unknown result type (might be due to invalid IL or missing references) uint num = 0u; if (terminal.SpawnNode.m_dimension.IsMainDimension) { LG_LayerType layerType = terminal.SpawnNode.LayerType; LG_LayerType val = layerType; switch ((int)val) { case 0: num = RundownManager.ActiveExpedition.LevelLayoutData; break; case 1: num = RundownManager.ActiveExpedition.SecondaryLayout; break; case 2: num = RundownManager.ActiveExpedition.ThirdLayout; break; default: LegacyLogger.Error("Unimplemented layer type."); return null; } } else { num = terminal.SpawnNode.m_dimension.DimensionData.LevelLayoutData; } LevelLayoutDataBlock block = GameDataBlockBase.GetBlock(num); List val2 = null; List terminalsSpawnedInZone = terminal.SpawnNode.m_zone.TerminalsSpawnedInZone; int num2 = terminalsSpawnedInZone.IndexOf(terminal); ExpeditionZoneData val3 = null; Enumerator enumerator = block.Zones.GetEnumerator(); while (enumerator.MoveNext()) { ExpeditionZoneData current = enumerator.Current; if (current.LocalIndex == terminal.SpawnNode.m_zone.LocalIndex) { val3 = current; break; } } if (val3 == null) { LegacyLogger.Error("Cannot find target zone data."); return null; } if (val3.TerminalPlacements.Count != terminalsSpawnedInZone.Count) { LegacyLogger.Error("The numbers of terminal placement and spawn, skipped for the zone terminal."); return null; } val2 = val3.TerminalPlacements[num2].UniqueCommands; if (val2.Count == 0) { return null; } List val4 = null; TERM_Command val5 = (TERM_Command)0; Enumerator enumerator2 = val2.GetEnumerator(); string text = default(string); string text2 = default(string); while (enumerator2.MoveNext()) { CustomTerminalCommand current2 = enumerator2.Current; if (current2.Command == command) { val4 = current2.CommandEvents; if (!terminal.m_command.TryGetCommand(current2.Command, ref val5, ref text, ref text2)) { LegacyLogger.Error("Cannot get TERM_COMMAND for command {0} on the specified terminal."); } break; } } if (val4 == null || (int)val5 == 0) { return null; } if ((int)val5 != 38 && (int)val5 != 39 && (int)val5 != 40 && (int)val5 != 41 && (int)val5 != 42) { return null; } ChainedPuzzleInstance val6 = null; for (int i = 0; i < val4.Count && (val4[i].ChainPuzzle == 0 || !terminal.TryGetChainPuzzleForCommand(val5, i, ref val6) || !((Object)(object)val6 != (Object)null)); i++) { } return val6; } public static bool TryGetZoneEntranceSecDoor(LG_Zone zone, out LG_SecurityDoor door) { if ((Object)(object)zone == (Object)null) { door = null; return false; } if ((Object)(object)zone.m_sourceGate == (Object)null) { door = null; return false; } if (zone.m_sourceGate.SpawnedDoor == null) { door = null; return false; } door = ((Il2CppObjectBase)zone.m_sourceGate.SpawnedDoor).TryCast(); return (Object)(object)door != (Object)null; } internal static bool isSecDoorToZoneOpened(LG_Zone zone14) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Invalid comparison between Unknown and I4 LG_SecurityDoor door = null; if (!TryGetZoneEntranceSecDoor(zone14, out door) || (Object)(object)door == (Object)null) { return false; } return (int)door.m_sync.GetCurrentSyncState().status == 10; } public static List cast(List list) { List list2 = new List(); Enumerator enumerator = list.GetEnumerator(); while (enumerator.MoveNext()) { T current = enumerator.Current; list2.Add(current); } return list2; } private static eDimensionIndex GetCurrentDimensionIndex() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (PlayerManager.PlayerAgentsInLevel.Count <= 0) { throw new Exception("? You don't have any player agent in level? How could that happen?"); } return ((Agent)PlayerManager.PlayerAgentsInLevel[0]).DimensionIndex; } public static void GetMinLayerAndLocalIndex(out LG_LayerType MinLayer, out eLocalZoneIndex MinLocalIndex) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Invalid comparison between I4 and Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Invalid comparison between I4 and Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected I4, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected I4, but got Unknown MinLayer = (LG_LayerType)2; MinLocalIndex = (eLocalZoneIndex)20; Enumerator enumerator = PlayerManager.PlayerAgentsInLevel.GetEnumerator(); while (enumerator.MoveNext()) { PlayerAgent current = enumerator.Current; if (IsPlayerInLevel(current)) { if ((int)MinLayer > (int)current.m_courseNode.LayerType) { MinLayer = (LG_LayerType)(int)current.m_courseNode.LayerType; MinLocalIndex = (eLocalZoneIndex)20; } if ((int)MinLocalIndex >= (int)current.m_courseNode.m_zone.LocalIndex) { MinLocalIndex = (eLocalZoneIndex)(int)current.m_courseNode.m_zone.LocalIndex; } } } } public static void GetMaxLayerAndLocalIndex(out LG_LayerType MaxLayer, out eLocalZoneIndex MaxLocalIndex) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Invalid comparison between I4 and Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Invalid comparison between I4 and Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected I4, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected I4, but got Unknown MaxLayer = (LG_LayerType)0; MaxLocalIndex = (eLocalZoneIndex)0; Enumerator enumerator = PlayerManager.PlayerAgentsInLevel.GetEnumerator(); while (enumerator.MoveNext()) { PlayerAgent current = enumerator.Current; if (IsPlayerInLevel(current)) { if ((int)MaxLayer < (int)current.m_courseNode.LayerType) { MaxLayer = (LG_LayerType)(int)current.m_courseNode.LayerType; MaxLocalIndex = (eLocalZoneIndex)0; } if ((int)MaxLocalIndex < (int)current.m_courseNode.m_zone.LocalIndex) { MaxLocalIndex = (eLocalZoneIndex)(int)current.m_courseNode.m_zone.LocalIndex; } } } } public static int GetMinAreaIndex(LG_Zone zone) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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) //IL_0077: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)zone == (Object)null) { return -1; } LG_LayerType type = zone.m_layer.m_type; eLocalZoneIndex localIndex = zone.LocalIndex; eDimensionIndex currentDimensionIndex = GetCurrentDimensionIndex(); int num = zone.m_areas.Count; Enumerator enumerator = PlayerManager.PlayerAgentsInLevel.GetEnumerator(); while (enumerator.MoveNext()) { PlayerAgent current = enumerator.Current; if (current.m_courseNode.LayerType != type || current.m_courseNode.m_zone.LocalIndex != localIndex) { continue; } int i = 0; for (List areas = zone.m_areas; i < areas.Count; i++) { if (((Object)((Component)areas[i]).gameObject).GetInstanceID() == ((Object)((Component)current.m_courseNode.m_area).gameObject).GetInstanceID()) { if (num > i) { num = i; } break; } } } return num; } public static LG_ComputerTerminal FindTerminal(eDimensionIndex dimensionIndex, LG_LayerType layerType, eLocalZoneIndex localIndex, int terminalIndex) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) LG_Zone val = null; if (!Builder.CurrentFloor.TryGetZoneByLocalIndex(dimensionIndex, layerType, localIndex, ref val) || (Object)(object)val == (Object)null) { LegacyLogger.Error($"FindTerminal: Didn't find LG_Zone {dimensionIndex}, {layerType}, {localIndex}"); return null; } if (val.TerminalsSpawnedInZone == null || terminalIndex >= val.TerminalsSpawnedInZone.Count) { LegacyLogger.Error($"FindTerminal: Invalid terminal index {terminalIndex} - {((val.TerminalsSpawnedInZone != null) ? val.TerminalsSpawnedInZone.Count : 0)} terminals are spawned in {dimensionIndex}, {layerType}, {localIndex}"); return null; } return (terminalIndex < 0) ? null : val.TerminalsSpawnedInZone[terminalIndex]; } public static AIG_NodeCluster GetNodeFromDimensionPosition(eDimensionIndex dimensionIndex, Vector3 position) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) AIG_GeomorphNodeVolume val = default(AIG_GeomorphNodeVolume); AIG_VoxelNodePillar val2 = default(AIG_VoxelNodePillar); AIG_INode val3 = default(AIG_INode); AIG_NodeCluster result = default(AIG_NodeCluster); if (!AIG_GeomorphNodeVolume.TryGetGeomorphVolume(0, dimensionIndex, position, ref val) || !((AIG_NodeVolume)val).m_voxelNodeVolume.TryGetPillar(position, ref val2) || !val2.TryGetVoxelNode(position.y, ref val3) || !AIG_NodeCluster.TryGetNodeCluster(val3.ClusterID, ref result)) { LegacyLogger.Error("TryWarpTo : Position is not valid, try again inside an area."); return null; } return result; } } internal static class Json { static Json() { } public static T Deserialize(string json) { return EOSJson.Deserialize(json); } public static object Deserialize(Type type, string json) { return EOSJson.Deserialize(type, json); } public static string Serialize(T value) { return EOSJson.Serialize(value); } public static void Load(string filePath, out T config) where T : new() { config = Deserialize(File.ReadAllText(filePath)); } } internal static class LegacyLogger { private static ManualLogSource logger = Logger.CreateLogSource("LEGACYCore"); public static void Log(string format, params object[] args) { Log(string.Format(format, args)); } public static void Log(string str) { if (logger != null) { logger.Log((LogLevel)8, (object)str); } } public static void Warning(string format, params object[] args) { Warning(string.Format(format, args)); } public static void Warning(string str) { if (logger != null) { logger.Log((LogLevel)4, (object)str); } } public static void Error(string format, params object[] args) { Error(string.Format(format, args)); } public static void Error(string str) { if (logger != null) { logger.Log((LogLevel)2, (object)str); } } public static void Debug(string format, params object[] args) { Debug(string.Format(format, args)); } public static void Debug(string str) { if (logger != null) { logger.Log((LogLevel)32, (object)str); } } } public class SpawnHibernateEnemiesEvent { public eWardenObjectiveEventTrigger Trigger { get; set; } = (eWardenObjectiveEventTrigger)0; public int Type { get; set; } = 170; public eDimensionIndex DimensionIndex { get; set; } = (eDimensionIndex)0; public LG_LayerType Layer { get; set; } = (LG_LayerType)0; public eLocalZoneIndex LocalIndex { get; set; } = (eLocalZoneIndex)0; public string WorldEventObjectFilter { get; set; } = "RANDOM"; public uint EnemyID { get; set; } public int Count { get; set; } = 1; public float Delay { get; set; } = 0f; public float Duration { get; set; } = 2f; } public class WeightedAreaSelector { private static readonly Dictionary dict; private WeightedRandomBag weightedRandomBag; public static WeightedAreaSelector Get(LG_Zone zone) { //IL_003f: 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_0046: 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_004a: 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_0067: Expected I4, but got Unknown //IL_00b0: Unknown result type (might be due to invalid IL or missing references) if (!dict.ContainsKey(zone)) { WeightedAreaSelector weightedAreaSelector = new WeightedAreaSelector(); Enumerator enumerator = zone.m_areas.GetEnumerator(); while (enumerator.MoveNext()) { LG_Area current = enumerator.Current; float num = 0f; LG_AreaSize size = current.m_size; LG_AreaSize val = size; switch (val - 1) { case 4: num = 7f; break; case 0: num = 20f; break; case 1: num = 30f; break; case 2: num = 35f; break; case 3: num = 45f; break; default: LegacyLogger.Error($"Unhandled LG_AreaSize: {current.m_size}. Won't build."); return null; } weightedAreaSelector.AddEntry(current, num); } dict.Add(zone, weightedAreaSelector); } return dict[zone]; } public static WeightedAreaSelector Get(eDimensionIndex eDimensionIndex, LG_LayerType layerType, eLocalZoneIndex localIndex) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) LG_Zone val = default(LG_Zone); if (!Builder.CurrentFloor.TryGetZoneByLocalIndex(eDimensionIndex, layerType, localIndex, ref val) || !Object.op_Implicit((Object)(object)val)) { return null; } return Get(val); } private WeightedAreaSelector() { weightedRandomBag = new WeightedRandomBag(); } private void AddEntry(LG_Area area, float weight) { weightedRandomBag.AddEntry(area, weight); } public LG_Area GetRandom() { return weightedRandomBag.GetRandom(); } private static void OnBuildDone() { } private static void Clear() { dict.Clear(); } static WeightedAreaSelector() { dict = new Dictionary(); LevelAPI.OnLevelCleanup += dict.Clear; } } public class WeightedRandomBag { private struct Entry { public double accumulatedWeight; public T item; } private List entries = new List(); private double accumulatedWeight; private Random rand = new Random(); public void AddEntry(T item, double weight) { if (weight <= 0.0) { LegacyLogger.Error("AddEntry: no non-positive weight pls."); return; } accumulatedWeight += weight; entries.Add(new Entry { item = item, accumulatedWeight = accumulatedWeight }); } public T GetRandom() { double num = rand.NextDouble() * accumulatedWeight; foreach (Entry entry in entries) { if (entry.accumulatedWeight >= num) { return entry.item; } } return default(T); } } } namespace LEGACY.LegacyOverride { internal class NavMarkerManager { private Dictionary markerVisuals = new Dictionary(); private Dictionary navMarkers = new Dictionary(); private List arbitraryNavMarkers = new List(); public static NavMarkerManager Current { get; private set; } = new NavMarkerManager(); private GameObject InstantiateMarkerVisual() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(Assets.ObjectiveMarker); float num = 0.16216217f; Transform transform = val.transform; transform.localPosition += Vector3.up * num; return val; } public void EnableMarkerAt(string markerName, GameObject target, float scale) { //IL_0051: 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_00d9: 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) if (navMarkers.ContainsKey(markerName)) { navMarkers[markerName].SetVisible(true); } else { NavMarker val = GuiManager.NavMarkerLayer.PrepareGenericMarker(target); if ((Object)(object)val != (Object)null) { val.SetColor(new Color(0.855f, 0.482f, 0.976f)); val.SetStyle((eNavMarkerStyle)14); val.SetVisible(true); navMarkers[markerName] = val; } else { LegacyLogger.Error("EnableMarkerAt: got null nav marker"); } } GameObject val2 = null; if (markerVisuals.ContainsKey(markerName)) { val2 = markerVisuals[markerName]; } else { val2 = InstantiateMarkerVisual(); val2.transform.localScale = new Vector3(scale, scale, scale); val2.transform.SetPositionAndRotation(target.transform.position, Quaternion.identity); markerVisuals[markerName] = val2; } CoroutineManager.BlinkIn(val2, 0f); LegacyLogger.Debug("EnableMarker: marker " + markerName + " enabled"); } public void EnableArbitraryMarkerAt(string markerName, Vector3 Position) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) if (navMarkers.ContainsKey(markerName)) { navMarkers[markerName].SetVisible(true); } else { GameObject val = new GameObject(markerName); val.transform.SetPositionAndRotation(Position, Quaternion.identity); arbitraryNavMarkers.Add(val); NavMarker val2 = GuiManager.NavMarkerLayer.PrepareGenericMarker(val); if ((Object)(object)val2 != (Object)null) { val2.SetColor(new Color(0.855f, 0.482f, 0.976f)); val2.SetStyle((eNavMarkerStyle)14); val2.SetVisible(true); navMarkers[markerName] = val2; } else { LegacyLogger.Error("EnableMarkerAt: got null nav marker"); } } LegacyLogger.Debug("EnableMarker: marker " + markerName + " enabled"); } internal (GameObject markerVisual, NavMarker navMakrer) GetMarkerVisuals(string markerName) { GameObject value; NavMarker value2; return (markerVisuals.TryGetValue(markerName, out value) && navMarkers.TryGetValue(markerName, out value2)) ? (value, value2) : (null, null); } public void DisableMakrer(string markerName) { if (navMarkers.ContainsKey(markerName)) { navMarkers[markerName].SetVisible(false); } if (markerVisuals.ContainsKey(markerName)) { GameObject val = markerVisuals[markerName]; if (val.active) { CoroutineManager.BlinkOut(val, 0f); } LegacyLogger.Debug("DisableMakrer: marker " + markerName + " disabled"); } } public void Clear() { foreach (GameObject value in markerVisuals.Values) { Object.Destroy((Object)(object)value); } arbitraryNavMarkers.ForEach((Action)Object.Destroy); markerVisuals.Clear(); navMarkers.Clear(); arbitraryNavMarkers.Clear(); } private NavMarkerManager() { LevelAPI.OnBuildStart += Clear; LevelAPI.OnLevelCleanup += Clear; } } internal static class LegacyOverrideManagers { internal static readonly string LEGACY_CONFIG_PATH = Path.Combine(MTFOPathAPI.CustomPath, "LegacyOverride"); internal static void Init() { ElevatorCargoOverrideManager.Current.Init(); BigPickupFogBeaconSettingManager.Current.Init(); EnemyTaggerSettingManager.Current.Init(); ForceFailManager.Current.Init(); ((GenericExpeditionDefinitionManager)ExpeditionIntelNotifier.Current).Init(); ((GenericExpeditionDefinitionManager)EventScanManager.Current).Init(); ((GenericExpeditionDefinitionManager)VisualManager.Current).Init(); ((GenericExpeditionDefinitionManager)MusicStateOverrider.Current).Init(); ((ZoneDefinitionManager)LevelSpawnedFogBeaconManager.Current).Init(); ((GenericExpeditionDefinitionManager)SuccessPageCustomizationManager.Current).Init(); ((GenericExpeditionDefinitionManager)ResourceStationManager.Current).Init(); } } } namespace LEGACY.LegacyOverride.Restart { public static class CM_PageRestart { internal static TextMeshPro Text { get; private set; } internal static GameObject Reconnecting { get; private set; } public static GameObject Page { get; private set; } internal static void Setup() { //IL_0069: 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_0105: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Assets.RestartPage == (Object)null) { return; } if ((Object)(object)Page != (Object)null) { LegacyLogger.Warning("Duplicate setup for CM_PageRestart!"); try { Object.Destroy((Object)(object)Page); } finally { Page = null; } } Transform transform = ((Component)((GuiLayer)GuiManager.Current.m_mainMenuLayer).GuiLayerBase).transform; Page = Object.Instantiate(Assets.RestartPage, transform.position, transform.rotation, transform); CM_PageBase component = Page.GetComponent(); GameObject gameObject = ((Component)component.m_movingContentHolder).gameObject; Reconnecting = gameObject.GetChild("Reconnecting"); GameObject gameObject2 = ((Component)GuiManager.Current.m_mainMenuLayer.PageMap.m_mapDisconnected.transform.GetChild(0)).gameObject; gameObject2 = Object.Instantiate(gameObject2, Reconnecting.transform); Text = gameObject2.GetComponent(); ((Graphic)Text).color = new Color(0f, 1f, 72f / 85f, 1f); ((TMP_Text)Text).SetText("RECONNECTING", true); ((TMP_Text)Text).ForceMeshUpdate(false, false); Page.GetComponent().Setup(GuiManager.Current.m_mainMenuLayer); } public static void SetPageActive(bool active) { Page.GetComponent().SetPageActive(active); } } } namespace LEGACY.LegacyOverride.ResourceStations { public sealed class ToolStation : ResourceStation { public override string ItemKey => $"Tool_Station_{base.SerialNumber}"; protected override void SetupInteraction() { base.SetupInteraction(); TextDataBlock block = GameDataBlockBase.GetBlock("InGame.InteractionPrompt.ToolStation"); Interact.InteractionMessage = ((block == null) ? "TOOL STATION" : Text.Get(((GameDataBlockBase)(object)block).persistentID)); } protected override void Replenish(PlayerAgent player) { PlayerBackpack backpack = PlayerBackpackManager.GetBackpack(player.Owner); PlayerAmmoStorage ammoStorage = backpack.AmmoStorage; float num = Math.Max(0f, Math.Min(def.SupplyUplimit.Tool - ammoStorage.ClassAmmo.RelInPack, def.SupplyEfficiency.Tool)); player.GiveAmmoRel((PlayerAgent)null, 0f, 0f, num); player.Sound.Post(EVENTS.AMMOPACK_APPLY, true); } public static ToolStation Instantiate(ResourceStationDefinition def) { if (def.StationType != StationType.TOOL) { LegacyLogger.Error($"Trying to instantiate MediStation with def with 'StationType': {def.StationType}!"); return null; } GameObject gO = Object.Instantiate(Assets.ToolStation); return new ToolStation(def, gO); } private ToolStation(ResourceStationDefinition def, GameObject GO) : base(def, GO) { } static ToolStation() { } } public sealed class MediStation : ResourceStation { public const float VANILLA_MAX_HEALTH = 25f; public override string ItemKey => $"Health_Station_{base.SerialNumber}"; protected override void SetupInteraction() { base.SetupInteraction(); TextDataBlock block = GameDataBlockBase.GetBlock("InGame.InteractionPrompt.MediStation"); Interact.InteractionMessage = ((block == null) ? "HEALTH STATION" : Text.Get(((GameDataBlockBase)(object)block).persistentID)); } protected override void Replenish(PlayerAgent player) { float health = ((Dam_SyncedDamageBase)player.Damage).Health; float num = def.SupplyUplimit.Medi * 25f; if (!(health >= num)) { player.GiveHealth((PlayerAgent)null, Math.Min(def.SupplyEfficiency.Medi, (num - health) / 25f)); player.Sound.Post(EVENTS.MEDPACK_APPLY, true); } } public static MediStation Instantiate(ResourceStationDefinition def) { if (def.StationType != 0) { LegacyLogger.Error($"Trying to instantiate MediStation with def with 'StationType': {def.StationType}!"); return null; } GameObject gO = Object.Instantiate(Assets.MediStation); return new MediStation(def, gO); } private MediStation(ResourceStationDefinition def, GameObject GO) : base(def, GO) { } static MediStation() { } } public abstract class ResourceStation { [CompilerGenerated] private sealed class d__61 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ResourceStation <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__61(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } <>4__this.StationMarkerGO.SetActive(!<>4__this.StationMarkerGO.active); <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public const int UNLIMITED_USE_TIME = int.MaxValue; private Coroutine m_blinkMarkerCoroutine = null; public virtual GameObject GameObject { get; protected set; } public GameObject InteractGO { get { GameObject gameObject = GameObject; return ((gameObject != null) ? ((Component)gameObject.transform.GetChild(3)).gameObject : null) ?? null; } } public GameObject StationMarkerGO { get { GameObject gameObject = GameObject; return ((gameObject != null) ? ((Component)gameObject.transform.GetChild(2)).gameObject : null) ?? null; } } public virtual Interact_Timed Interact { get; protected set; } public virtual ResourceStationDefinition def { get; protected set; } public RSTimer Timer { get; protected set; } public StateReplicator StateReplicator { get; protected set; } public RSStateStruct State => StateReplicator?.State ?? new RSStateStruct(); public LG_GenericTerminalItem TerminalItem { get; protected set; } public AIG_CourseNode SpawnNode { get { return TerminalItem.SpawnNode; } set { TerminalItem.SpawnNode = value; } } protected int SerialNumber { get; private set; } public virtual string ItemKey => $"Resource_Station_{SerialNumber}"; public bool Enabled => State.Enabled; protected virtual bool InCooldown => State.RemainingUseTime <= 0 && State.CurrentCooldownTime > 0f; public virtual bool HasUnlimitedUseTime => def.AllowedUseTimePerCooldown == int.MaxValue; public virtual void Destroy() { if (m_blinkMarkerCoroutine != null) { CoroutineManager.StopCoroutine(m_blinkMarkerCoroutine); m_blinkMarkerCoroutine = null; } Object.Destroy((Object)(object)GameObject); StateReplicator?.Unload(); Interact = null; def = null; StateReplicator = null; } protected virtual bool CanInteract() { return Enabled && !InCooldown; } protected abstract void Replenish(PlayerAgent player); protected virtual void SetInteractionText() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) string text = Text.Format(827u, (Object[])(object)new Object[1] { Object.op_Implicit(InputMapper.GetBindingName(((Interact_Base)Interact).InputAction)) }); TextDataBlock block = GameDataBlockBase.GetBlock("InGame.OnAdditionalInteractionText.ResourceStation"); string text2 = ((block == null) ? " TO REPLENISH" : Text.Get(((GameDataBlockBase)(object)block).persistentID)); string text3 = (HasUnlimitedUseTime ? string.Empty : $"({State.RemainingUseTime}/{def.AllowedUseTimePerCooldown}) per {def.CooldownTime}s"); GuiManager.InteractionLayer.SetInteractPrompt(Interact.InteractionMessage, text + text2 + text3, (ePUIMessageStyle)0); } protected virtual void OnTriggerInteraction(PlayerAgent player) { RSStateStruct state = State; int num = (HasUnlimitedUseTime ? int.MaxValue : Math.Max(state.RemainingUseTime - 1, 0)); int num2 = player.Owner.PlayerSlotIndex(); if (num2 < 0 || num2 >= ((Il2CppArrayBase)(object)SNet.Slots.PlayerSlots).Count) { LegacyLogger.Error($"ResourceStation_OnTriggerInteraction: player {player.PlayerName} has invalid slot index: {num2}"); } else { StateReplicator?.SetState(new RSStateStruct { LastInteractedPlayer = num2, RemainingUseTime = num, CurrentCooldownTime = ((num == 0) ? def.CooldownTime : 0f), Enabled = true }); } } protected virtual void OnInteractionSelected(PlayerAgent agent, bool selected) { if (selected) { SetInteractionText(); } } protected virtual void SetupInteraction() { Interact.InteractDuration = def.InteractDuration; Interact_Timed interact = Interact; interact.ExternalPlayerCanInteract += Func.op_Implicit((Func)((PlayerAgent _) => CanInteract())); Interact_Timed interact2 = Interact; interact2.OnInteractionSelected += Action.op_Implicit((Action)OnInteractionSelected); Interact_Timed interact3 = Interact; interact3.OnInteractionTriggered += Action.op_Implicit((Action)OnTriggerInteraction); } protected virtual void SetupTerminalItem() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) LG_Zone val = default(LG_Zone); if (!Builder.CurrentFloor.TryGetZoneByLocalIndex(((GlobalZoneIndex)def).DimensionIndex, ((GlobalZoneIndex)def).LayerType, ((GlobalZoneIndex)def).LocalIndex, ref val) || (Object)(object)val == (Object)null) { LegacyLogger.Error("ResourceStation: Cannot find spawn node!"); return; } if (def.AreaIndex < 0 || def.AreaIndex >= val.m_areas.Count) { LegacyLogger.Error("ResourceStation: Cannot find spawn node - Area index is invalid!"); return; } TerminalItem.Setup(ItemKey, val.m_areas[def.AreaIndex].m_courseNode); if (SpawnNode != null) { TerminalItem.FloorItemLocation = SpawnNode.m_zone.NavInfo.GetFormattedText((LG_NavInfoFormat)7); } TerminalItem.FloorItemStatus = (eFloorInventoryObjectStatus)0; } protected virtual void OnStateChanged(RSStateStruct oldState, RSStateStruct newState, bool isRecall) { if (isRecall) { return; } int lastInteractedPlayer = newState.LastInteractedPlayer; if (lastInteractedPlayer < 0 || lastInteractedPlayer >= ((Il2CppArrayBase)(object)SNet.Slots.PlayerSlots).Count) { return; } if (((Interact_Base)Interact).IsSelected) { SetInteractionText(); } if (!SNet.IsMaster) { return; } LegacyLogger.Warning($"ResourceStation OnStateChanged: replenish for player {lastInteractedPlayer}, remaining use time: {newState.RemainingUseTime}"); if (oldState.RemainingUseTime > 0) { SNet_Player playerInSlot = SNet.Slots.GetPlayerInSlot(lastInteractedPlayer); if ((Object)(object)playerInSlot != (Object)null) { Replenish(((Il2CppObjectBase)playerInSlot.m_playerAgent).Cast()); } else { LegacyLogger.Error($"playerSlot_{lastInteractedPlayer} has no player agent!"); } } if (newState.RemainingUseTime == 0) { LegacyLogger.Warning("ResourceStation OnStateChanged: cooldown timer starts!"); OnCoolDownStart(); } } protected virtual void OnCoolDownStart() { Timer.StartTimer(def.CooldownTime); if (m_blinkMarkerCoroutine == null) { m_blinkMarkerCoroutine = CoroutineManager.StartCoroutine(CollectionExtensions.WrapToIl2Cpp(BlinkMarker()), (Action)null); } } protected virtual void OnCoolDownTimerProgress(float progress) { } protected virtual void OnCoolDownEnd() { LegacyLogger.Warning("ResourceStation OnCoolDownEnd"); if (m_blinkMarkerCoroutine != null) { CoroutineManager.StopCoroutine(m_blinkMarkerCoroutine); m_blinkMarkerCoroutine = null; StationMarkerGO.SetActive(true); } if (SNet.IsMaster) { LegacyLogger.Warning("ResourceStation OnCoolDownEnd: master reset state!"); StateReplicator.SetState(new RSStateStruct { LastInteractedPlayer = -1, RemainingUseTime = def.AllowedUseTimePerCooldown, CurrentCooldownTime = 0f, Enabled = true }); } } protected virtual void SetupReplicator() { if (StateReplicator == null) { uint num = EOSNetworking.AllotReplicatorID(); if (num == 0) { LegacyLogger.Error("ResourceStation: replicatorID depleted, cannot setup replicator!"); return; } StateReplicator = StateReplicator.Create(num, new RSStateStruct { RemainingUseTime = def.AllowedUseTimePerCooldown, CurrentCooldownTime = -1f, Enabled = true }, (LifeTimeType)1, (IStateReplicatorHolder)null); StateReplicator.OnStateChanged += OnStateChanged; } } protected virtual void SetupRSTimer() { if ((Object)(object)Timer == (Object)null) { Timer = RSTimer.Instantiate(OnCoolDownTimerProgress, OnCoolDownEnd); } } [IteratorStateMachine(typeof(d__61))] private IEnumerator BlinkMarker() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__61(0) { <>4__this = this }; } protected ResourceStation(ResourceStationDefinition def, GameObject GO) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) this.def = def; GameObject = GO; GameObject.transform.SetPositionAndRotation(def.Position.ToVector3(), def.Rotation.ToQuaternion()); Interact = InteractGO.GetComponent(); SerialNumber = SerialGenerator.GetUniqueSerialNo(); if ((Object)(object)Interact == (Object)null) { LegacyLogger.Error("ResourceStation: Interact Comp not found!"); } else { SetupInteraction(); } TerminalItem = GO.GetComponent(); if ((Object)(object)TerminalItem == (Object)null) { LegacyLogger.Error("ResourceStation: TerminalItem not found!"); } else { SetupTerminalItem(); } SetupReplicator(); SetupRSTimer(); } static ResourceStation() { } } public sealed class AmmoStation : ResourceStation { public override string ItemKey => $"Ammunition_Station_{base.SerialNumber}"; protected override void SetupInteraction() { base.SetupInteraction(); TextDataBlock block = GameDataBlockBase.GetBlock("InGame.InteractionPrompt.AmmoStation"); Interact.InteractionMessage = ((block == null) ? "AMMUNITION STATION" : Text.Get(((GameDataBlockBase)(object)block).persistentID)); } public static AmmoStation Instantiate(ResourceStationDefinition def) { if (def.StationType != StationType.AMMO) { LegacyLogger.Error($"Trying to instantiate AmmoStation with def with 'StationType': {def.StationType}!"); return null; } GameObject gO = Object.Instantiate(Assets.AmmoStation); return new AmmoStation(def, gO); } protected override void Replenish(PlayerAgent player) { PlayerBackpack backpack = PlayerBackpackManager.GetBackpack(player.Owner); PlayerAmmoStorage ammoStorage = backpack.AmmoStorage; float num = Math.Max(0f, Math.Min(def.SupplyUplimit.AmmoStandard - ammoStorage.StandardAmmo.RelInPack, def.SupplyEfficiency.AmmoStandard)); float num2 = Math.Max(0f, Math.Min(def.SupplyUplimit.AmmoSpecial - ammoStorage.SpecialAmmo.RelInPack, def.SupplyEfficiency.AmmoSpecial)); player.GiveAmmoRel((PlayerAgent)null, num, num2, 0f); player.Sound.Post(EVENTS.AMMOPACK_APPLY, true); } private AmmoStation(ResourceStationDefinition def, GameObject GO) : base(def, GO) { } static AmmoStation() { } } public enum StationType { MEDI, AMMO, TOOL } public class SupplyUplimit { public float Medi { get; set; } = 0.6f; public float AmmoStandard { get; set; } = 1f; public float AmmoSpecial { get; set; } = 1f; public float Tool { get; set; } = 0f; } public class SupplyEfficiency { public float Medi { get; set; } = 0.2f; public float AmmoStandard { get; set; } = 0.15f; public float AmmoSpecial { get; set; } = 0.15f; public float Tool { get; set; } = 0f; } public class ResourceStationDefinition : GlobalZoneIndex { public int AreaIndex { get; set; } = 0; public string WorldEventObjectFilter { get; set; } = string.Empty; public StationType StationType { get; set; } = StationType.AMMO; public Vec3 Position { get; set; } = new Vec3(); public Vec3 Rotation { get; set; } = new Vec3(); public float InteractDuration { get; set; } = 2.5f; public SupplyEfficiency SupplyEfficiency { get; set; } = new SupplyEfficiency(); public SupplyUplimit SupplyUplimit { get; set; } = new SupplyUplimit(); public int AllowedUseTimePerCooldown { get; set; } = int.MaxValue; public float CooldownTime { get; set; } = 3f; } public class ResourceStationManager : GenericExpeditionDefinitionManager { public static ResourceStationManager Current { get; private set; } protected override string DEFINITION_NAME => "ResourceStation"; private Dictionary Stations { get; } = new Dictionary(); private void Build(ResourceStationDefinition def) { if (Stations.ContainsKey(def.WorldEventObjectFilter)) { LegacyLogger.Error("ResourceStationManager: WorldEventObjectFilter '" + def.WorldEventObjectFilter + "' is already used"); return; } ResourceStation resourceStation = null; switch (def.StationType) { case StationType.MEDI: resourceStation = MediStation.Instantiate(def); break; case StationType.AMMO: resourceStation = AmmoStation.Instantiate(def); break; case StationType.TOOL: resourceStation = ToolStation.Instantiate(def); break; default: LegacyLogger.Error($"ResourceStation {def.StationType} is unimplemented"); return; } if (resourceStation != null) { Stations[def.WorldEventObjectFilter] = resourceStation; LegacyLogger.Debug("ResourceStation '" + def.WorldEventObjectFilter + "' instantiated"); } } private void BuildStations() { if (base.definitions.TryGetValue(base.CurrentMainLevelLayout, out var value)) { value.Definitions.ForEach(Build); } } private void Clear() { foreach (ResourceStation value in Stations.Values) { value.Destroy(); } Stations.Clear(); } private ResourceStationManager() { LevelAPI.OnBuildStart += delegate { Clear(); }; LevelAPI.OnLevelCleanup += Clear; LevelAPI.OnBuildDone += BuildStations; } static ResourceStationManager() { Current = new ResourceStationManager(); } } public struct RSStateStruct { public int LastInteractedPlayer; public int RemainingUseTime; public float CurrentCooldownTime; public bool Enabled; public RSStateStruct() { LastInteractedPlayer = 0; RemainingUseTime = 0; CurrentCooldownTime = 0f; Enabled = false; } } public class RSTimer : MonoBehaviour { private float startTime = 0f; private float endTime = 0f; private bool hasOnGoingTimer = false; private Action OnProgress; private Action OnTimerEnd; public float RemainingTime => hasOnGoingTimer ? Math.Max(endTime - Clock.Time, 0f) : 0f; private static List TimerGOs { get; } private void Update() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 if ((int)GameStateManager.CurrentStateName == 10 && hasOnGoingTimer) { float time = Clock.Time; if (OnProgress != null) { OnProgress((time - startTime) / (endTime - startTime)); } if (!(time < endTime)) { endTime = 0f; hasOnGoingTimer = false; OnTimerEnd?.Invoke(); } } } public void StartTimer(float time) { if (time <= 0f) { LegacyLogger.Error("StartTimer: time is not positive!"); return; } if (hasOnGoingTimer) { LegacyLogger.Error("StartTimer: this timer is yet ended!"); return; } startTime = Clock.Time; endTime = startTime + time; hasOnGoingTimer = true; } private void OnDestroy() { endTime = 0f; hasOnGoingTimer = false; OnTimerEnd = null; } public static RSTimer Instantiate(Action onProgress, Action actionOnEnd) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown GameObject val = new GameObject(); RSTimer rSTimer = val.AddComponent(); rSTimer.OnProgress = onProgress; rSTimer.OnTimerEnd = actionOnEnd; TimerGOs.Add(val); return rSTimer; } public static void DestroyAll() { TimerGOs.ForEach((Action)Object.Destroy); TimerGOs.Clear(); } private RSTimer() { } static RSTimer() { TimerGOs = new List(); ClassInjector.RegisterTypeInIl2Cpp(); LevelAPI.OnBuildStart += DestroyAll; LevelAPI.OnLevelCleanup += DestroyAll; } } } namespace LEGACY.LegacyOverride.Patches { [HarmonyPatch] internal static class ExpeditionSuccessPage { [HarmonyPostfix] [HarmonyPatch(typeof(CM_PageExpeditionSuccess), "OnEnable")] private static void Post_CM_PageExpeditionSuccess_OnEnable(CM_PageExpeditionSuccess __instance) { if (!((Object)(object)__instance == (Object)null)) { SuccessPageCustomization currentCustomization = SuccessPageCustomizationManager.Current.CurrentCustomization; if (currentCustomization != null) { ((TMP_Text)__instance.m_header).SetText(LocalizedText.op_Implicit(currentCustomization.PageHeader), true); __instance.m_overrideSuccessMusic = currentCustomization.OverrideSuccessMusic; LegacyLogger.Warning("Post_CM_PageExpeditionSuccess_OnEnable: " + ((Object)currentCustomization.PageHeader).ToString()); } } } } [HarmonyPatch] internal class GUIManager_RestartPage { [HarmonyPostfix] [HarmonyWrapSafe] [HarmonyPatch(typeof(GuiManager), "Setup")] private static void Post_Setup(GuiManager __instance) { LevelAPI.OnBuildStart += delegate { CM_PageRestart.Setup(); }; } } [HarmonyPatch] internal static class LevelSpawnFogBeacon_BugFix { [HarmonyPostfix] [HarmonyPatch(typeof(HeavyFogRepellerGlobalState), "AttemptInteract")] private static void Post_HeavyFogRepellerGlobalState_AttemptInteract(HeavyFogRepellerGlobalState __instance) { LevelSpawnedFogBeaconSettings lSFBDef = LevelSpawnedFogBeaconManager.Current.GetLSFBDef(__instance); if (lSFBDef != null) { __instance.m_repellerSphere.Range = lSFBDef.Range; } } } [HarmonyPatch] internal static class PouncerArenaPosition_Fix { [HarmonyPatch(typeof(LG_Floor), "CreateDimension")] [HarmonyPrefix] private static void CreateDimension_Prefix(eDimensionIndex dimensionIndex, bool arenaDimension, ref 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) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0005: 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) //IL_000a: Invalid comparison between Unknown and I4 //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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) if (dimensionIndex - 17 <= 3) { position += new Vector3 { y = -500f }; } } } [HarmonyPatch] internal class RundownSelectionCustomization { [CompilerGenerated] private sealed class d__7 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CM_PageRundown_New p; public bool hosting; public Transform guixSurfaceTransform; private float 5__1; private float 5__2; private int 5__3; private int 5__4; private int 5__5; private int 5__6; private int 5__7; 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_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Expected O, but got Unknown //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Expected O, but got Unknown //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Expected O, but got Unknown //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Expected O, but got Unknown //IL_040f: Unknown result type (might be due to invalid IL or missing references) //IL_0419: Expected O, but got Unknown //IL_0459: Unknown result type (might be due to invalid IL or missing references) //IL_046e: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Expected O, but got Unknown //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Expected O, but got Unknown //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04d4: Expected O, but got Unknown //IL_05aa: Unknown result type (might be due to invalid IL or missing references) //IL_05b4: Expected O, but got Unknown //IL_068c: Unknown result type (might be due to invalid IL or missing references) //IL_0696: Expected O, but got Unknown //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0778: Expected O, but got Unknown //IL_0850: Unknown result type (might be due to invalid IL or missing references) //IL_085a: Expected O, but got Unknown //IL_0932: Unknown result type (might be due to invalid IL or missing references) //IL_093c: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = p.m_tierSpacing * 5f * p.m_tierSpaceToArrowScale; if (hosting) { CoroutineManager.BlinkIn(p.m_buttonConnect, 0f, (Transform)null); <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; } goto IL_0147; case 1: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.24f); <>1__state = 2; return true; case 2: <>1__state = -1; ((RectTransformComp)p.m_buttonConnect).SetVisible(false); goto IL_0147; case 3: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 4; return true; case 4: <>1__state = -1; CM_PageBase.PostSound(EVENTS.MENU_SURFACE_LEVEL_SHRINK, ""); CoroutineEase.EaseLocalScale(p.m_textRundownHeader.transform, Vector3.one, new Vector3(0.6f, 0.6f, 0.6f), 0.2f, (EasingFunction)Easing.LinearTween, (Action)null, (BoolCheck)null); <>2__current = CoroutineEase.EaseLocalScale(guixSurfaceTransform, Vector3.one, new Vector3(0.2f, 0.2f, 0.2f), 0.2f, (EasingFunction)Easing.LinearTween, (Action)null, (BoolCheck)null); <>1__state = 5; return true; case 5: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 6; return true; case 6: <>1__state = -1; CoroutineEase.EaseLocalPos(p.m_textRundownHeader.transform, p.m_textRundownHeader.transform.localPosition, p.m_rundownHeaderPos, 0.2f, (EasingFunction)Easing.LinearTween, (Action)null, (BoolCheck)null); CoroutineManager.BlinkIn(p.m_rundownIntelButton, 0f, (Transform)null); <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 7; return true; case 7: <>1__state = -1; CM_PageBase.PostSound(EVENTS.MENU_SURFACE_LEVEL_TURN, ""); <>2__current = CoroutineEase.EaseLocalRot(guixSurfaceTransform, Vector3.zero, new Vector3(70f, 0f, 0f), 0.3f, (EasingFunction)Easing.LinearTween, (Action)null, (BoolCheck)null); <>1__state = 8; return true; case 8: <>1__state = -1; p.m_verticalArrow.SetActive(true); <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 9; return true; case 9: <>1__state = -1; CoroutineManager.BlinkIn(((Component)p.m_tierMarkerSectorSummary).gameObject, 0f); CM_PageBase.PostSound(EVENTS.MENU_RUNDOWN_DISC_APPEAR_5, ""); <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 10; return true; case 10: <>1__state = -1; CM_PageBase.PostSound(EVENTS.MENU_RUNDOWN_SPINE_START, ""); CoroutineEase.EaseLocalScale(p.m_verticalArrow.transform, new Vector3(1f, 0f, 1f), new Vector3(1f, 5__1, 1f), 4.3f, (EasingFunction)Easing.LinearTween, (Action)delegate { CM_PageBase.PostSound(EVENTS.MENU_RUNDOWN_SPINE_STOP, ""); }, (BoolCheck)null); 5__2 = 0.6f; <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 11; return true; case 11: <>1__state = -1; CM_PageBase.PostSound(EVENTS.MENU_RUNDOWN_DISC_APPEAR_3, ""); ((Component)p.m_guix_Tier3).gameObject.SetActive(true); 5__3 = 0; while (5__3 < p.m_expIconsTier3.Count) { CoroutineManager.BlinkIn(((Component)p.m_expIconsTier3[5__3]).gameObject, (float)5__3 * 0.1f); 5__3++; } if (p.m_expIconsTier3.Count > 0) { p.m_tierMarker3.SetVisible(true, 5__2); } <>2__current = (object)new WaitForSeconds(1f); <>1__state = 12; return true; case 12: <>1__state = -1; CM_PageBase.PostSound(EVENTS.MENU_RUNDOWN_DISC_APPEAR_5, ""); ((Component)p.m_guix_Tier5).gameObject.SetActive(true); 5__4 = 0; while (5__4 < p.m_expIconsTier5.Count) { CoroutineManager.BlinkIn(((Component)p.m_expIconsTier5[5__4]).gameObject, (float)5__4 * 0.1f); 5__4++; } if (p.m_expIconsTier5.Count > 0) { p.m_tierMarker5.SetVisible(true, 5__2); } <>2__current = (object)new WaitForSeconds(1f); <>1__state = 13; return true; case 13: <>1__state = -1; CM_PageBase.PostSound(EVENTS.MENU_RUNDOWN_DISC_APPEAR_4, ""); ((Component)p.m_guix_Tier4).gameObject.SetActive(true); 5__5 = 0; while (5__5 < p.m_expIconsTier4.Count) { CoroutineManager.BlinkIn(((Component)p.m_expIconsTier4[5__5]).gameObject, (float)5__5 * 0.1f); 5__5++; } if (p.m_expIconsTier4.Count > 0) { p.m_tierMarker4.SetVisible(true, 5__2); } <>2__current = (object)new WaitForSeconds(1f); <>1__state = 14; return true; case 14: <>1__state = -1; CM_PageBase.PostSound(EVENTS.MENU_RUNDOWN_DISC_APPEAR_2, ""); ((Component)p.m_guix_Tier2).gameObject.SetActive(true); 5__6 = 0; while (5__6 < p.m_expIconsTier2.Count) { CoroutineManager.BlinkIn(((Component)p.m_expIconsTier2[5__6]).gameObject, (float)5__6 * 0.1f); 5__6++; } if (p.m_expIconsTier2.Count > 0) { p.m_tierMarker2.SetVisible(true, 5__2); } <>2__current = (object)new WaitForSeconds(1f); <>1__state = 15; return true; case 15: <>1__state = -1; CM_PageBase.PostSound(EVENTS.MENU_RUNDOWN_DISC_APPEAR_1, ""); ((Component)p.m_guix_Tier1).gameObject.SetActive(true); 5__7 = 0; while (5__7 < p.m_expIconsTier1.Count) { CoroutineManager.BlinkIn(((Component)p.m_expIconsTier1[5__7]).gameObject, (float)5__7 * 0.1f); 5__7++; } if (p.m_expIconsTier1.Count > 0) { p.m_tierMarker1.SetVisible(true, 5__2); } <>2__current = (object)new WaitForSeconds(1f); <>1__state = 16; return true; case 16: { <>1__state = -1; ((Component)p.m_joinOnServerIdText).gameObject.SetActive(true); CoroutineManager.BlinkIn(p.m_aboutTheRundownButton, 0f, (Transform)null); CoroutineManager.BlinkIn(p.m_discordButton, 0.1f, (Transform)null); if (SNet.IsMaster || !SNet.IsInLobby) { CoroutineManager.BlinkIn(p.m_matchmakeAllButton, 0.2f, (Transform)null); } p.m_selectionIsRevealed = true; p.CheckClipboard(); return false; } IL_0147: CM_PageBase.PostSound(EVENTS.MENU_SURFACE_LEVEL_MOVE_UP, ""); <>2__current = CoroutineEase.EaseLocalPos(guixSurfaceTransform, Vector3.zero, new Vector3(0f, 650f, 0f), 0.5f, (EasingFunction)Easing.LinearTween, (Action)null, (BoolCheck)null); <>1__state = 3; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static uint r1TitleID; private static uint r2TitleID; private static uint r3TitleID; [HarmonyPostfix] [HarmonyPatch(typeof(CM_PageRundown_New), "Setup")] private static void Post_CM_PageRundown_New(CM_PageRundown_New __instance) { //IL_0055: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_0111: 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_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) GameSetupDataBlock block = GameDataBlockBase.GetBlock(1u); if (block.RundownIdsToLoad.Count <= 1) { return; } int count = block.RundownIdsToLoad.Count; int num = count; if (num == 3) { ((Il2CppArrayBase)(object)__instance.m_rundownSelectionPositions)[0] = new Vector3(-430f, 180f, 0f); ((Il2CppArrayBase)(object)__instance.m_rundownSelectionPositions)[1] = new Vector3(0f, 100f, 0f); ((Il2CppArrayBase)(object)__instance.m_rundownSelectionPositions)[2] = new Vector3(420f, 100f, 0f); Vector3 zero = Vector3.zero; for (int i = block.RundownIdsToLoad.Count; i < ((Il2CppArrayBase)(object)__instance.m_rundownSelectionPositions).Count; i++) { zero = ((Il2CppArrayBase)(object)__instance.m_rundownSelectionPositions)[i]; ((Il2CppArrayBase)(object)__instance.m_rundownSelectionPositions)[i] = new Vector3(zero.x, -10000f, zero.z); } zero = __instance.m_textRundownHeaderTop.transform.position; __instance.m_textRundownHeaderTop.transform.position = new Vector3(zero.x, -350f, zero.z); } } private static void SetSelectionScale(CM_PageRundown_New p) { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: 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_018c: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: 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_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) GameSetupDataBlock block = GameDataBlockBase.GetBlock(1u); if (block.RundownIdsToLoad.Count > 1) { int count = block.RundownIdsToLoad.Count; int num = count; if (num == 3) { CM_RundownSelection val = p.m_rundownSelections[0]; CM_RundownSelection val2 = p.m_rundownSelections[1]; CM_RundownSelection val3 = p.m_rundownSelections[2]; ((Component)val).transform.localScale = new Vector3(2f, 2f, 2f) * 1.8f; ((Component)val2).transform.localScale = new Vector3(1.25f, 1.25f, 1.25f) * 1f; ((Component)val3).transform.localScale = new Vector3(1.25f, 1.25f, 1.25f) * 2.05f; Transform transform = val.m_rundownText.transform; Quaternion localRotation = (val3.m_rundownText.transform.localRotation = Quaternion.AngleAxis(45f, Vector3.right) * Quaternion.AngleAxis(4f, Vector3.forward)); transform.localRotation = localRotation; val2.m_rundownText.transform.localRotation = Quaternion.AngleAxis(45f, Vector3.right) * Quaternion.AngleAxis(-1f, Vector3.forward); val.m_rundownText.transform.localPosition = Vector3.up * 60f + Vector3.right * 20f; val2.m_rundownText.transform.localPosition = Vector3.up * 85f; val3.m_rundownText.transform.localPosition = Vector3.up * 60f + Vector3.left * 30f; Transform transform2 = ((Component)val).transform; localRotation = (((Component)val3).transform.localRotation = Quaternion.AngleAxis(-45f, Vector3.right) * Quaternion.AngleAxis(10f, Vector3.up)); transform2.localRotation = localRotation; ((Component)val2).transform.localRotation = Quaternion.AngleAxis(-45f, Vector3.right); ((TMP_Text)val.m_rundownText).text = ((r1TitleID != 0) ? Text.Get(r1TitleID) : "L"); ((TMP_Text)val3.m_rundownText).text = ((r2TitleID != 0) ? Text.Get(r2TitleID) : "R"); ((TMP_Text)val2.m_rundownText).text = ((r3TitleID != 0) ? Text.Get(r3TitleID) : "M"); DestroyAltText(val); DestroyAltText(val2); DestroyAltText(val3); } } static void DestroyAltText(CM_RundownSelection s) { if ((Object)(object)s.m_altText != (Object)null) { Object.Destroy((Object)(object)((Component)s.m_altText).gameObject); s.m_altText = null; } } } [HarmonyPostfix] [HarmonyPatch(typeof(CM_PageRundown_New), "UpdateRundownSelectionButton")] private static void Post_UpdateRundownSelectionButton(CM_PageRundown_New __instance) { InitTitle(); SetSelectionScale(__instance); } private static void InitTitle() { if (r1TitleID == 0) { TextDataBlock block = GameDataBlockBase.GetBlock("L_Title"); if (block != null) { r1TitleID = ((GameDataBlockBase)(object)block).persistentID; } block = GameDataBlockBase.GetBlock("R_Title"); if (block != null) { r2TitleID = ((GameDataBlockBase)(object)block).persistentID; } block = GameDataBlockBase.GetBlock("M_Title"); if (block != null) { r3TitleID = ((GameDataBlockBase)(object)block).persistentID; } } } [IteratorStateMachine(typeof(d__7))] private static IEnumerator reverseReveal(CM_PageRundown_New p, bool hosting, Transform guixSurfaceTransform) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(0) { p = p, hosting = hosting, guixSurfaceTransform = guixSurfaceTransform }; } } [HarmonyPatch] internal class DisableExpeditionFailPageArtifactDisplay { private class CustomExpeditionFailedSequence { [CompilerGenerated] private sealed class d__2 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CustomExpeditionFailedSequence <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__2(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Expected O, but got Unknown //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Expected O, but got Unknown //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Expected O, but got Unknown //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Expected O, but got Unknown //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Expected O, but got Unknown //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Expected O, but got Unknown //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; case 1: <>1__state = -1; ((Component)<>4__this.page.m_bgCortex_text).gameObject.SetActive(false); <>4__this.page.m_bgCortex_textBoxSmall.SetActive(false); <>4__this.page.m_bgCortex_textBoxLarge.SetActive(false); ((Component)<>4__this.page.m_returnToLobby_text).gameObject.SetActive(false); CM_PageBase.PostSound(EVENTS.PLAY_01_FIRST_TEXT_APPEAR, ""); <>2__current = CoroutineManager.BlinkIn(<>4__this.page.m_bgCortex_logo, 0f); <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.3f); <>1__state = 3; return true; case 3: <>1__state = -1; CM_PageBase.PostSound(EVENTS.PLAY_01_FIRST_TEXT_APPEAR, ""); <>2__current = CoroutineManager.BlinkIn(<>4__this.page.m_bgCortex_text, 0f, (Transform)null); <>1__state = 4; return true; case 4: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.4f); <>1__state = 5; return true; case 5: <>1__state = -1; CoroutineManager.BlinkIn(<>4__this.page.m_bgCortex_textBoxSmall, 0f); CoroutineManager.BlinkIn(<>4__this.page.m_bgCortex_textBoxLarge, 0.15f); <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 6; return true; case 6: <>1__state = -1; <>2__current = CoroutineManager.BlinkOut(<>4__this.page.m_bgCortex_textBoxLarge, 0f); <>1__state = 7; return true; case 7: <>1__state = -1; <>2__current = CoroutineManager.BlinkOut(<>4__this.page.m_bgCortex_textBoxSmall, 0f); <>1__state = 8; return true; case 8: <>1__state = -1; ((Component)<>4__this.page.m_bgCortex_text).gameObject.SetActive(false); <>2__current = CoroutineManager.BlinkOut(<>4__this.page.m_bgCortex_logo, 0f); <>1__state = 9; return true; case 9: <>1__state = -1; <>2__current = (object)new WaitForSeconds(1f); <>1__state = 10; return true; case 10: <>1__state = -1; CM_PageBase.PostSound(EVENTS.PLAY_06_MAIN_MENU_LAUNCH, ""); ((Component)<>4__this.page.m_bgScare).gameObject.SetActive(true); <>4__this.page.m_bgScare.Play(); <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 11; return true; case 11: <>1__state = -1; ((Component)<>4__this.page.m_bgScare).gameObject.SetActive(false); <>2__current = CoroutineManager.BlinkIn(((Component)<>4__this.page.m_missionFailed_text).gameObject, 0f); <>1__state = 12; return true; case 12: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.2f); <>1__state = 13; return true; case 13: <>1__state = -1; <>2__current = CoroutineManager.BlinkIn(((Component)<>4__this.page.m_returnToLobby_text).gameObject, 0f); <>1__state = 14; return true; case 14: <>1__state = -1; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private CM_PageExpeditionFail page; public CustomExpeditionFailedSequence(CM_PageExpeditionFail page) { this.page = page; } [IteratorStateMachine(typeof(d__2))] public IEnumerator CustomFailedSequence() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__2(0) { <>4__this = this }; } } [HarmonyPrefix] [HarmonyPatch(typeof(CM_PageExpeditionFail), "OnEnable")] private static bool Pre_CM_PageExpeditionFail(CM_PageExpeditionFail __instance) { if (((CM_PageBase)__instance).m_isSetup) { CellSound.StopAll(); CellSound.AllSoundsStoppedThisSession = true; CM_PageBase.PostSound(EVENTS.MUSIC_EXPEDITION_FAILED, ""); ((RectTransformComp)__instance.m_ArtifactInventoryDisplay).Setup(); __instance.m_ArtifactInventoryDisplay.SetArtifactValuesFromInventory(BoosterImplantManager.ArtifactInventory); ((Component)__instance.m_missionFailed_text).gameObject.SetActive(false); ((Component)__instance.m_artifactInfo_text).gameObject.SetActive(false); __instance.m_btnRestartCheckpoint.SetText(Text.Get(916u)); if (SNet.IsMaster) { __instance.m_btnRestartCheckpoint.SetButtonEnabled(true); __instance.m_btnGoToLobby.SetButtonEnabled(true); __instance.m_btnGoToLobby.SetText(Text.Get(917u)); } else { __instance.m_btnRestartCheckpoint.SetButtonEnabled(false); __instance.m_btnGoToLobby.SetButtonEnabled(false); __instance.m_btnGoToLobby.SetText(Text.Get(918u)); } ((Component)__instance.m_btnGoToLobby).gameObject.SetActive(false); ((Component)__instance.m_btnRestartCheckpoint).gameObject.SetActive(false); __instance.m_lobbyButtonVisible = false; __instance.m_showLobbybuttonTimer = Clock.Time + 3f; ((RectTransformComp)__instance.m_ArtifactInventoryDisplay).SetVisible(false); ((CM_PageBase)__instance).StartPageTransitionRoutine(CollectionExtensions.WrapToIl2Cpp(new CustomExpeditionFailedSequence(__instance).CustomFailedSequence())); } return false; } } [HarmonyPatch] internal class SetupBigPickupItemWithItemId { private static void SetupAsFogBeacon(LG_PickupItem __instance) { //IL_000c: 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_00ea: 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_0180: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Expected O, but got Unknown //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Expected O, but got Unknown //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) FogRepeller_Sphere val = new GameObject("FogInstance_Beacon_Fake").AddComponent(); val.InfiniteDuration = false; val.LifeDuration = 99999f; val.GrowDuration = 99999f; val.ShrinkDuration = 99999f; val.Range = 1f; BigPickupFogBeaconSetting setting = BigPickupFogBeaconSettingManager.Current.SettingForCurrentLevel; FogRepeller_Sphere fogRepHold = new GameObject("FogInstance_Beacon_SmallLayer").AddComponent(); fogRepHold.InfiniteDuration = setting.RSHold.InfiniteDuration; fogRepHold.GrowDuration = setting.RSHold.GrowDuration; fogRepHold.ShrinkDuration = setting.RSHold.ShrinkDuration; fogRepHold.Range = setting.RSHold.Range; fogRepHold.Offset = Vector3.zero; FogRepeller_Sphere fogRepPlaced = new GameObject("FogInstance_Beacon_BigLayer").AddComponent(); fogRepPlaced.InfiniteDuration = setting.RSPlaced.InfiniteDuration; fogRepPlaced.GrowDuration = setting.RSPlaced.GrowDuration; fogRepPlaced.ShrinkDuration = setting.RSPlaced.ShrinkDuration; fogRepPlaced.Range = setting.RSPlaced.Range; fogRepPlaced.Offset = Vector3.zero; CarryItemPickup_Core componentInChildren = ((Component)__instance.m_root).GetComponentInChildren(); HeavyFogRepellerPickup val2 = ((Il2CppObjectBase)componentInChildren).Cast(); iCarryItemWithGlobalState val3 = default(iCarryItemWithGlobalState); byte byteId = default(byte); if (CarryItemWithGlobalStateManager.TryCreateItemInstance((eCarryItemWithGlobalStateType)0, __instance.m_root, ref val3, ref byteId)) { pItemData_Custom customData = ((Item)val2).GetCustomData(); customData.byteId = byteId; pItemData_Custom val4 = customData; ((Item)val2).SetCustomData(val4, true); } HeavyFogRepellerGlobalState val5 = ((Il2CppObjectBase)val3).Cast(); ((Component)fogRepHold).transform.SetParent(((Component)val5).transform, false); ((Component)fogRepPlaced).transform.SetParent(((Component)val5).transform, false); val5.m_repellerSphere = val; fogRepHold.m_sphereAllocator = new FogSphereAllocator(); fogRepPlaced.m_sphereAllocator = new FogSphereAllocator(); Interact_Pickup_PickupItem interact = ((Il2CppObjectBase)componentInChildren.m_interact).Cast(); ((Interact_Timed)interact).InteractDuration = setting.TimeToPickup; val5.CallbackOnStateChange += Action.op_Implicit((Action)delegate(pCarryItemWithGlobalState_State oldState, pCarryItemWithGlobalState_State newState, bool isRecall) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Invalid comparison between Unknown and I4 //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Invalid comparison between Unknown and I4 //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (isRecall) { FogRepeller_Sphere obj = fogRepHold; if (obj != null) { obj.KillRepellerInstantly(); } FogRepeller_Sphere obj2 = fogRepPlaced; if (obj2 != null) { obj2.KillRepellerInstantly(); } } else { eHeavyFogRepellerStatus val6 = (eHeavyFogRepellerStatus)newState.status; eHeavyFogRepellerStatus val7 = val6; if ((int)val7 != 1) { if ((int)val7 == 2) { FogRepeller_Sphere obj3 = fogRepHold; if (obj3 != null) { obj3.StopRepelling(); } FogRepeller_Sphere obj4 = fogRepPlaced; if (obj4 != null) { obj4.StartRepelling(); } ((Interact_Timed)interact).InteractDuration = setting.TimeToPickup; } } else { FogRepeller_Sphere obj5 = fogRepHold; if (obj5 != null) { obj5.StartRepelling(); } if (oldState.status != 0) { FogRepeller_Sphere obj6 = fogRepPlaced; if (obj6 != null) { obj6.StopRepelling(); } } ((Interact_Timed)interact).InteractDuration = setting.TimeToPlace; } } }); } [HarmonyPostfix] [HarmonyPatch(typeof(LG_PickupItem), "SetupBigPickupItemWithItemId")] private static void Post_SetupBigPickupItemWithItemId(LG_PickupItem __instance, uint itemId) { switch (itemId) { case 233u: SetupAsFogBeacon(__instance); break; case 234u: case 235u: case 236u: case 237u: EnemyTaggerSettingManager.Current.SetupAsObserver(__instance); break; } } static SetupBigPickupItemWithItemId() { } } [HarmonyPatch] internal class ElevatorCargoOverride { [HarmonyPrefix] [HarmonyPatch(typeof(ElevatorCargoCage), "SpawnObjectiveItemsInLandingArea")] private static bool Pre_ElevatorCargoOverride(ElevatorCargoCage __instance) { LevelElevatorCargo levelElevatorCargoItems = ElevatorCargoOverrideManager.Current.GetLevelElevatorCargoItems(RundownManager.ActiveExpedition.LevelLayoutData); if (levelElevatorCargoItems == null) { return true; } if (levelElevatorCargoItems.ForceDisable) { ElevatorRide.Current.m_cargoCageInUse = false; return false; } return true; } [HarmonyPostfix] [HarmonyPatch(typeof(ElevatorCargoCage), "SpawnObjectiveItemsInLandingArea")] private static void Post_ElevatorCargoOverride(ElevatorCargoCage __instance) { LevelElevatorCargo levelElevatorCargoItems = ElevatorCargoOverrideManager.Current.GetLevelElevatorCargoItems(RundownManager.ActiveExpedition.LevelLayoutData); if (levelElevatorCargoItems == null || levelElevatorCargoItems.ElevatorCargoItems.Count < 1 || levelElevatorCargoItems.ForceDisable) { return; } foreach (ElevatorCargoItem elevatorCargoItem in levelElevatorCargoItems.ElevatorCargoItems) { LG_PickupItem val = LG_PickupItem.SpawnGenericPickupItem(ElevatorShaftLanding.CargoAlign); val.SpawnNode = Builder.GetElevatorArea().m_courseNode; switch (elevatorCargoItem.ItemType) { case ItemType.Consumable: val.SetupAsConsumable(Random.Range(0, int.MaxValue), elevatorCargoItem.ItemID); break; case ItemType.BigPickup: val.SetupAsBigPickupItem(Random.Range(0, int.MaxValue), elevatorCargoItem.ItemID, false, 0); break; default: LegacyLogger.Error($"Undefined Item Type {elevatorCargoItem.ItemType}"); continue; } __instance.m_itemsToMoveToCargo.Add(((Component)val).transform); ElevatorRide.Current.m_cargoCageInUse = true; } } } } namespace LEGACY.LegacyOverride.Music { public class MusicOverride { public string WorldEventObjectFilter { get; set; } = string.Empty; public uint StartID { get; set; } public uint StopID { get; set; } = 0u; public uint VolumeRTPC { get; set; } = 0u; public float Duration { get; set; } = -1f; public MusicOverride() { } public MusicOverride(string MusicName, uint StartID, uint StopID, uint VolumeRTPC, float Duration = -1f) { WorldEventObjectFilter = MusicName; this.StartID = StartID; this.StopID = StopID; this.VolumeRTPC = VolumeRTPC; this.Duration = Duration; } } public class MusicStateOverrider : GenericExpeditionDefinitionManager { public const uint DEF_ID = 0u; public const int MAX_PLAYING_MUSIC_COUNT = 5; private Dictionary musicStartID = new Dictionary(); private HashSet musicPlaying = new HashSet(); public static MusicStateOverrider Current { get; private set; } = new MusicStateOverrider(); protected override string DEFINITION_NAME => "MusicState"; private CellSoundPlayer Sound => MusicManager.Current.m_machine.Sound; public bool MCSStateLocked { get; internal set; } = false; private Dictionary Musics { get; } = new Dictionary(); public StateReplicator StateReplicator { get; private set; } internal void PlayMusic(string worldEventObjectFilter) { if (musicPlaying.Count >= 5) { LegacyLogger.Error("PlayMusic: There're 5 music playing now, cannot start playing more!"); return; } if (!Musics.ContainsKey(worldEventObjectFilter)) { LegacyLogger.Error("Music " + worldEventObjectFilter + " is not config-ed."); return; } if (musicPlaying.Contains(worldEventObjectFilter)) { LegacyLogger.Error("Music " + worldEventObjectFilter + " is already playing"); return; } DoPlayMusic(worldEventObjectFilter); LegacyLogger.Debug("Play music " + worldEventObjectFilter); } private void DoPlayMusic(string worldEventObjectFilter) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) musicPlaying.Add(worldEventObjectFilter); MusicOverride musicOverride = Musics[worldEventObjectFilter]; Sound.Post(musicOverride.StartID, true); CellSound.SetGlobalRTPCValue(musicOverride.VolumeRTPC, CellSettingsManager.SettingsData.Audio.MusicVolume.Value * 100f); MusicManager.Current.m_machine.ChangeState((MUS_State)14); if (SNet.IsMaster) { MusicSyncStruct state = new MusicSyncStruct(StateReplicator.State); if (state.Id0 == 0) { state.Id0 = musicOverride.StartID; } else if (state.Id1 == 0) { state.Id1 = musicOverride.StartID; } else if (state.Id2 == 0) { state.Id2 = musicOverride.StartID; } else if (state.Id3 == 0) { state.Id3 = musicOverride.StartID; } else if (state.Id4 == 0) { state.Id4 = musicOverride.StartID; } StateReplicator.SetState(state); } } internal void StopMusic(string worldEventObjectFilter) { if (!Musics.ContainsKey(worldEventObjectFilter)) { LegacyLogger.Error("Music " + worldEventObjectFilter + " is not config-ed."); return; } if (!musicPlaying.Contains(worldEventObjectFilter)) { LegacyLogger.Error("Music " + worldEventObjectFilter + " is not playing"); return; } DoStopMusic(worldEventObjectFilter); LegacyLogger.Debug("Stop music " + worldEventObjectFilter); } private void DoStopMusic(string worldEventObjectFilter) { musicPlaying.Remove(worldEventObjectFilter); MusicOverride musicOverride = Musics[worldEventObjectFilter]; Sound.Post(musicOverride.StopID, true); if (SNet.IsMaster) { MusicSyncStruct state = new MusicSyncStruct(StateReplicator.State); if (state.Id0 == musicOverride.StartID) { state.Id0 = 0u; } if (state.Id1 == musicOverride.StartID) { state.Id1 = 0u; } if (state.Id2 == musicOverride.StartID) { state.Id2 = 0u; } if (state.Id3 == musicOverride.StartID) { state.Id3 = 0u; } if (state.Id4 == musicOverride.StartID) { state.Id4 = 0u; } StateReplicator.SetState(state); } } public bool ShouldOverrideMusicState(MUS_State currentState) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 if ((int)GameStateManager.CurrentStateName != 10) { return false; } return musicPlaying.Count > 0; } internal void OnApplicationFocus(bool focus) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) float num = (focus ? CellSettingsManager.SettingsData.Audio.MusicVolume.Value : 0f); foreach (string item in musicPlaying) { MusicOverride musicOverride = Musics[item]; CellSound.SetGlobalRTPCValue(musicOverride.VolumeRTPC, num * 100f); } } internal void OnMusicVolumeSettingChange() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) foreach (string item in musicPlaying) { MusicOverride musicOverride = Musics[item]; CellSound.SetGlobalRTPCValue(musicOverride.VolumeRTPC, CellSettingsManager.SettingsData.Audio.MusicVolume.Value * 100f); } } private void UpdateOverrideSetting() { if (!base.definitions.ContainsKey(0u)) { LegacyLogger.Error($"Didn't find global definition, ('MainLevelLayout' {0})"); return; } Musics.Clear(); List definitions = base.definitions[0u].Definitions; foreach (MusicOverride item in definitions) { string worldEventObjectFilter = item.WorldEventObjectFilter; if (worldEventObjectFilter != null && worldEventObjectFilter.Length == 0) { LegacyLogger.Debug("WorldEventObjectFilter(Music name) unspecified, won't load"); continue; } if (item.StartID == 0) { LegacyLogger.Debug("StartID unspecified (could not be 0)"); continue; } if (item.StopID == 0) { LegacyLogger.Error("StopID == 0: MusicStateOverrider doesn't implement un-looped sound!"); } Musics[item.WorldEventObjectFilter] = item; musicStartID[item.StartID] = item; } } protected override void FileChanged(LiveEditEventArgs e) { base.FileChanged(e); UpdateOverrideSetting(); } private void Reset() { MCSStateLocked = false; musicPlaying.Clear(); } private void OnStateChanged(MusicSyncStruct oldState, MusicSyncStruct newState, bool isRecall) { if (isRecall) { Reset(); TryPlay(newState.Id0); TryPlay(newState.Id1); TryPlay(newState.Id2); TryPlay(newState.Id3); TryPlay(newState.Id4); } void TryPlay(uint StartID) { if (StartID != 0 && musicStartID.TryGetValue(StartID, out var value)) { PlayMusic(value.WorldEventObjectFilter); } } } public override void Init() { base.Init(); EventAPI.OnAssetsLoaded += delegate { if (StateReplicator == null) { uint num = EOSNetworking.AllotForeverReplicatorID(); if (num == 0) { LegacyLogger.Error("PlayMusic: failed to setup state replicator!"); } StateReplicator = StateReplicator.Create(num, new MusicSyncStruct(), (LifeTimeType)0, (IStateReplicatorHolder)null); StateReplicator.OnStateChanged += OnStateChanged; } }; } private MusicStateOverrider() { UpdateOverrideSetting(); LevelAPI.OnBuildStart += Reset; LevelAPI.OnLevelCleanup += Reset; } } public struct MusicSyncStruct { public uint Id0; public uint Id1; public uint Id2; public uint Id3; public uint Id4; public MusicSyncStruct() { Id0 = 0u; Id1 = 0u; Id2 = 0u; Id3 = 0u; Id4 = 0u; } public MusicSyncStruct(MusicSyncStruct o) { Id0 = o.Id0; Id1 = o.Id1; Id2 = o.Id2; Id3 = o.Id3; Id4 = o.Id4; } } [HarmonyPatch] internal class Patches { [HarmonyPrefix] [HarmonyPatch(typeof(MusicMachine), "ChangeState")] private static bool Pre_MusicMachine_ChangeState(MusicMachine __instance, ref MUS_State state) { if (MusicStateOverrider.Current.ShouldOverrideMusicState(state)) { if (MusicStateOverrider.Current.MCSStateLocked) { return false; } LegacyLogger.Debug("Music State overriden and locked"); state = (MUS_State)14; MusicStateOverrider.Current.MCSStateLocked = true; return true; } if (MusicStateOverrider.Current.MCSStateLocked) { LegacyLogger.Debug("Music State un-overriden"); } MusicStateOverrider.Current.MCSStateLocked = false; return true; } [HarmonyPostfix] [HarmonyPatch(typeof(CellSettingsManager), "OnApplicationFocus")] private static void Post_OnApplicationFocus(CellSettingsManager __instance, bool focus) { MusicStateOverrider.Current.OnApplicationFocus(focus); } [HarmonyPostfix] [HarmonyPatch(typeof(CellSettings_Audio), "ApplyAllValues")] private static void Post_ApplyAllValues(CellSettingsManager __instance) { MusicStateOverrider.Current.OnMusicVolumeSettingChange(); } } } namespace LEGACY.LegacyOverride.GearFunctions { [HarmonyPatch] internal static class Patch_BulletWeapon { private static uint GLUE_GUN_PID = 400u; [HarmonyPostfix] [HarmonyPatch(typeof(BulletWeapon), "Fire")] private static void Post_BulletHit(BulletWeapon __instance) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (((GameDataBlockBase)(object)((ItemEquippable)__instance).ArchetypeData).persistentID != GLUE_GUN_PID) { return; } RaycastHit rayHit = Weapon.s_weaponRayData.rayHit; GameObject gameObject = ((Component)((RaycastHit)(ref rayHit)).collider).gameObject; if ((Object)(object)gameObject == (Object)null) { return; } IDamageable val = null; BulletWeapon.s_tempColliderInfo = gameObject.GetComponent(); if ((Object)(object)BulletWeapon.s_tempColliderInfo != (Object)null) { val = BulletWeapon.s_tempColliderInfo.Damageable; } if (val == null) { val = gameObject.GetComponent(); } if (val != null) { Agent baseAgent = val.GetBaseAgent(); EnemyAgent val2 = ((baseAgent != null) ? ((Il2CppObjectBase)baseAgent).TryCast() : null); if ((Object)(object)val2 != (Object)null && val2.Damage.AttachedGlueRel < 1f) { val.GlueDamage(100f); } } } } } namespace LEGACY.LegacyOverride.ExpeditionIntelNotification { public class ExpeditionIntel { public bool BlinkInContent { get; set; } = true; public float BlinkTimeInterval { get; set; } = 0.2f; public LocalizedText Header { get; set; } = null; public LocalizedText Text { get; set; } = null; } public class ExpeditionIntelNotifier : GenericExpeditionDefinitionManager { public static ExpeditionIntelNotifier Current { get; private set; } private Random rand { get; } = new Random(); protected override string DEFINITION_NAME => "ExpeditionIntel"; private void ShowIntelForExpedition(ExpeditionIntel intel) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0013: 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_0032: 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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Expected O, but got Unknown CM_GlobalPopup val = GlobalPopupMessageManager.ShowPopup(new PopupMessage { BlinkInContent = intel.BlinkInContent, BlinkTimeInterval = intel.BlinkTimeInterval, Header = LocalizedText.op_Implicit(intel.Header), UpperText = LocalizedText.op_Implicit(intel.Text), PopupType = (PopupType)3, OnCloseCallback = Action.op_Implicit((Action)delegate { }) }); } internal void OnLevelSelected(ExpeditionInTierData expData) { if (base.definitions.ContainsKey(expData.LevelLayoutData) && base.definitions[expData.LevelLayoutData].Definitions.Count > 0) { List definitions = base.definitions[expData.LevelLayoutData].Definitions; ShowIntelForExpedition(definitions[rand.Next(0, definitions.Count)]); LegacyLogger.Warning("ShowIntelForExpedition"); } } private ExpeditionIntelNotifier() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown LevelAPI.OnLevelSelected += (LevelSelectedEvent)delegate(eRundownTier _, int _, ExpeditionInTierData e) { OnLevelSelected(e); }; } static ExpeditionIntelNotifier() { Current = new ExpeditionIntelNotifier(); } } } namespace LEGACY.LegacyOverride.ForceFail { public class FFPlayerGroup { public const int MAX_PLAYER_CNT = 4; private List isPlayerInGroup = new List(); private StateReplicator stateReplicator; public bool enabled { get; private set; } = false; public ImmutableList IsPlayerInGroup => isPlayerInGroup.ToImmutableList(); public bool PlayerInGroup(int playerSlotIndex) { if (playerSlotIndex < 0 || playerSlotIndex >= 4) { LegacyLogger.Error($"Invalid player slot index, should be in [0, {4}), but got {playerSlotIndex}"); return false; } return isPlayerInGroup[playerSlotIndex]; } public int NumPlayersInGroup() { return isPlayerInGroup.Sum((bool b) => b ? 1 : 0); } public void Toggle(bool enabled) { this.enabled = enabled; Sync(); } public void SetPlayerInGroup(int playerSlotIndex, bool inGroup) { if (playerSlotIndex < 0 || playerSlotIndex >= 4) { LegacyLogger.Error($"Invalid player slot index, should be in [0, {4}), but got {playerSlotIndex}"); return; } int num = NumPlayersInGroup(); isPlayerInGroup[playerSlotIndex] = inGroup; int num2 = NumPlayersInGroup(); if (num == 0 && num2 > 0) { enabled = true; } else if (num > 0 && num2 == 0) { enabled = false; } Sync(); } public void ResetSynced() { Reset(); Sync(); } public void ResetUnsynced() { Reset(); stateReplicator.SetStateUnsynced(GetSyncStruct()); } private void Reset() { enabled = false; for (int i = 0; i < isPlayerInGroup.Count; i++) { isPlayerInGroup[i] = false; } } private void Sync() { stateReplicator.SetState(GetSyncStruct()); } private void OnStateChanged(FFReplicationStruct oldState, FFReplicationStruct newState, bool isRecall) { if (isRecall) { enabled = newState.enabled; isPlayerInGroup[0] = newState.checkP1; isPlayerInGroup[1] = newState.checkP2; isPlayerInGroup[2] = newState.checkP3; isPlayerInGroup[3] = newState.checkP4; } } internal FFReplicationStruct GetSyncStruct() { FFReplicationStruct result = new FFReplicationStruct(); result.enabled = enabled; result.checkP1 = isPlayerInGroup[0]; result.checkP2 = isPlayerInGroup[1]; result.checkP3 = isPlayerInGroup[2]; result.checkP4 = isPlayerInGroup[3]; return result; } internal static FFPlayerGroup Instantiate() { uint num = EOSNetworking.AllotForeverReplicatorID(); if (num == 0) { LegacyLogger.Error("ForceFailManager: cannot instantiate replicator - id depleted"); return null; } FFPlayerGroup fFPlayerGroup = new FFPlayerGroup(); fFPlayerGroup.stateReplicator = StateReplicator.Create(num, new FFReplicationStruct(), (LifeTimeType)0, (IStateReplicatorHolder)null); fFPlayerGroup.stateReplicator.OnStateChanged += fFPlayerGroup.OnStateChanged; fFPlayerGroup.Setup(); return fFPlayerGroup; } private void Setup() { for (int i = 0; i < 4; i++) { isPlayerInGroup.Add(item: false); } LevelAPI.OnBuildStart += ResetUnsynced; LevelAPI.OnLevelCleanup += ResetUnsynced; } private FFPlayerGroup() { } } public struct FFReplicationStruct { public bool enabled; public bool checkP1; public bool checkP2; public bool checkP3; public bool checkP4; public FFReplicationStruct() { enabled = false; checkP1 = false; checkP2 = false; checkP3 = false; checkP4 = false; } public FFReplicationStruct(FFReplicationStruct o) { enabled = false; checkP1 = false; checkP2 = false; checkP3 = false; checkP4 = false; o.enabled = enabled; o.checkP1 = checkP1; o.checkP2 = checkP2; o.checkP3 = checkP3; o.checkP4 = checkP4; } public FFReplicationStruct(bool enabled, bool checkP1, bool checkP2, bool checkP3, bool checkP4) { this.enabled = false; this.checkP1 = false; this.checkP2 = false; this.checkP3 = false; this.checkP4 = false; this.enabled = enabled; this.checkP1 = checkP1; this.checkP2 = checkP2; this.checkP3 = checkP3; this.checkP4 = checkP4; } } public class ForceFailManager { public const int MAX_FF_GROUP_CNT = 4; private List playerGroups = new List(); public static ForceFailManager Current { get; private set; } public void AddPlayerToGroup(int playerSlotIndex, int checkGroupIndex) { if (checkGroupIndex < 0 || checkGroupIndex >= playerGroups.Count) { LegacyLogger.Error($"FFManager: check group index should be non-negative and less than {playerGroups.Count} - got {checkGroupIndex}"); } else { FFPlayerGroup fFPlayerGroup = playerGroups[checkGroupIndex]; fFPlayerGroup.SetPlayerInGroup(playerSlotIndex, inGroup: true); } } public void ResetSynced() { playerGroups.ForEach(delegate(FFPlayerGroup pg) { pg.ResetSynced(); }); } public void ResetUnSynced() { playerGroups.ForEach(delegate(FFPlayerGroup pg) { pg.ResetUnsynced(); }); } public void ResetGroupSynced(int groupIndex) { if (groupIndex < 0 || groupIndex >= playerGroups.Count) { LegacyLogger.Error($"FFManager: check group index should be non-negative and less than {playerGroups.Count} - got {groupIndex}"); } else { playerGroups[groupIndex].ResetSynced(); } } public void ToggleCheck(bool enabled) { playerGroups.ForEach(delegate(FFPlayerGroup pg) { pg.Toggle(enabled); }); } public bool IsCheckEnabled() { foreach (FFPlayerGroup playerGroup in playerGroups) { if (playerGroup.enabled && playerGroup.NumPlayersInGroup() > 0) { return true; } } return false; } public bool ToggleCheckOnGroup(int groupIndex, bool enabled) { if (groupIndex < 0 || groupIndex >= playerGroups.Count) { LegacyLogger.Error($"FFManager: group index should be non-negative and less than {playerGroups.Count} - got {groupIndex}"); return false; } playerGroups[groupIndex].Toggle(enabled); return true; } public void SetExpeditionFailedText(string text) { ((TMP_Text)MainMenuGuiLayer.Current.PageExpeditionFail.m_missionFailed_text).SetText(text, true); } public void ResetExpeditionFailedText() { string text = Text.Get(962u); ((TMP_Text)MainMenuGuiLayer.Current.PageExpeditionFail.m_missionFailed_text).SetText(text, true); } internal bool CheckLevelForceFailed() { bool result = false; foreach (FFPlayerGroup playerGroup in playerGroups) { if (!playerGroup.enabled) { continue; } bool flag = false; int num = 0; Enumerator enumerator2 = PlayerManager.PlayerAgentsInLevel.GetEnumerator(); while (enumerator2.MoveNext()) { PlayerAgent current2 = enumerator2.Current; if (playerGroup.PlayerInGroup(current2.PlayerSlotIndex)) { flag = ((Agent)current2).Alive || flag; num++; } } if (flag) { if (num == playerGroup.NumPlayersInGroup()) { continue; } result = true; break; } result = true; break; } return result; } public void Init() { } private void Setup() { for (int i = 0; i < 4; i++) { FFPlayerGroup fFPlayerGroup = FFPlayerGroup.Instantiate(); if (fFPlayerGroup != null) { playerGroups.Add(fFPlayerGroup); continue; } LegacyLogger.Error($"Instantiated player group num: {playerGroups.Count}"); break; } } private ForceFailManager() { LevelAPI.OnBuildStart += ResetUnSynced; LevelAPI.OnLevelCleanup += ResetUnSynced; LevelAPI.OnBuildStart += ResetExpeditionFailedText; LevelAPI.OnBuildDone += ResetExpeditionFailedText; EventAPI.OnManagersSetup += Setup; } static ForceFailManager() { Current = new ForceFailManager(); } } } namespace LEGACY.LegacyOverride.FogBeacon { public class LevelSpawnedFogBeacon { public static uint LSFB_ITEM_DB_ID { get; private set; } public static bool HasFogBeaconItemDBDefinition => LSFB_ITEM_DB_ID != 0; public string WorldEventObjectFilter => def?.WorldEventObjectFilter ?? string.Empty; public LevelSpawnedFogBeaconSettings def { get; private set; } public HeavyFogRepellerGlobalState GlobalState { get; private set; } public LG_PickupItem LG_PickupItem { get; private set; } public NavMarker NavMarker { get; private set; } public Vector3 Position { get { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) LG_PickupItem lG_PickupItem = LG_PickupItem; return (lG_PickupItem != null) ? ((Component)lG_PickupItem).transform.position : Vector3.zero; } } public Color NAV_MARKER_COLOR { get; } = new Color(1f, 0.75686276f, 0.14509805f); public static LevelSpawnedFogBeacon Instantiate(eDimensionIndex dimensionIndex, LG_LayerType layer, eLocalZoneIndex localIndex, LevelSpawnedFogBeaconSettings def) { //IL_0026: 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) //IL_0028: 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_007e: 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) if (!HasFogBeaconItemDBDefinition) { LegacyLogger.Error("LevelSpawnedFogBeaconManager: ItemDatablock Definition of vanilla Fog Repeller Turbine is not found..."); return null; } LG_Zone val = default(LG_Zone); if (!Builder.CurrentFloor.TryGetZoneByLocalIndex(dimensionIndex, layer, localIndex, ref val) || (Object)(object)val == (Object)null || def.AreaIndex < 0 || def.AreaIndex >= val.m_areas.Count) { LegacyLogger.Error($"LevelSpawnedFogBeacon: cannot find {(dimensionIndex, layer, localIndex)}, Area_{(ushort)(65 + def.AreaIndex)}"); return null; } AIG_CourseNode courseNode = val.m_areas[def.AreaIndex].m_courseNode; LevelSpawnedFogBeacon levelSpawnedFogBeacon = new LevelSpawnedFogBeacon(def, courseNode); levelSpawnedFogBeacon.def = def; return levelSpawnedFogBeacon; } internal void Destroy() { Object.Destroy((Object)(object)((Component)LG_PickupItem.m_root).gameObject); GlobalState = null; LG_PickupItem = null; def = null; } private LevelSpawnedFogBeacon(LevelSpawnedFogBeaconSettings def, AIG_CourseNode node) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: 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_01a9: Unknown result type (might be due to invalid IL or missing references) this.def = def; GameObject val = new GameObject($"LSBF_{def.WorldEventObjectFilter}-Area_{(ushort)(65 + def.AreaIndex)}"); val.transform.SetPositionAndRotation(def.Position.ToVector3(), Quaternion.identity); LG_PickupItem = LG_PickupItem.SpawnGenericPickupItem(val.transform); LG_PickupItem.SpawnNode = node; int count = ((Il2CppArrayBase>)(object)CarryItemWithGlobalStateManager.Current.m_carryItemGlobalStatesInstancesPerType)[0].Count; LG_PickupItem.SetupAsBigPickupItem(1, LSFB_ITEM_DB_ID, false, -1); CarryItemPickup_Core componentInChildren = ((Component)LG_PickupItem.m_root).GetComponentInChildren(); LG_PickupItem_Sync val2 = ((Il2CppObjectBase)componentInChildren.m_sync).Cast(); if ((Object)(object)val2 != (Object)null) { pPickupItemState state = val2.m_stateReplicator.State; ((pCourseNode)(ref state.placement.node)).Set(LG_PickupItem.SpawnNode); } Interact_Pickup_PickupItem val3 = ((Il2CppObjectBase)componentInChildren.m_interact).Cast(); ((Component)val3).gameObject.SetActive(false); iTerminalItem componentInChildren2 = ((Component)LG_PickupItem).GetComponentInChildren(); if (componentInChildren2 != null) { LG_LevelInteractionManager.DeregisterTerminalItem(componentInChildren2); } NavMarker = GuiManager.NavMarkerLayer.PrepareGenericMarker(((Component)LG_PickupItem).gameObject); if ((Object)(object)NavMarker != (Object)null) { NavMarker.SetColor(NAV_MARKER_COLOR); NavMarker.SetStyle((eNavMarkerStyle)14); NavMarker.SetVisible(false); } iCarryItemWithGlobalState val4 = default(iCarryItemWithGlobalState); if (!CarryItemWithGlobalStateManager.TryGetItemInstance((eCarryItemWithGlobalStateType)0, (byte)count, ref val4)) { LegacyLogger.Error("LevelSpawnedFogBeaconManager: Didn't find GlobalState of '" + def.WorldEventObjectFilter + "'"); return; } GlobalState = ((Il2CppObjectBase)val4).Cast(); FogRepeller_Sphere repellerSphere = GlobalState.m_repellerSphere; repellerSphere.GrowDuration = def.GrowDuration; repellerSphere.ShrinkDuration = def.ShrinkDuration; repellerSphere.Range = def.Range; HeavyFogRepellerGlobalState globalState = GlobalState; globalState.CallbackOnStateChange += Action.op_Implicit((Action)delegate(pCarryItemWithGlobalState_State oldState, pCarryItemWithGlobalState_State newState, bool isRecall) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //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) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected I4, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown eHeavyFogRepellerStatus val5 = (eHeavyFogRepellerStatus)newState.status; eHeavyFogRepellerStatus val6 = val5; eHeavyFogRepellerStatus val7 = val6; switch ((int)val7) { case 0: case 2: NavMarker.SetVisible(false); break; case 1: NavMarker.SetVisible(true); if (isRecall) { WardenObjectiveManager.CheckAndExecuteEventsOnTrigger(new WardenObjectiveEventData { Type = (eWardenObjectiveEventType)222, WorldEventObjectFilter = WorldEventObjectFilter, Enabled = true, Delay = 1.1f }, (eWardenObjectiveEventTrigger)0, true, 0f); } break; } }); } private static void FindFogTurbineItemDBID() { if (!HasFogBeaconItemDBDefinition) { LSFB_ITEM_DB_ID = ((GameDataBlockBase)(object)GameDataBlockBase.GetBlock("Carry_HeavyFogRepeller"))?.persistentID ?? 0; if (LSFB_ITEM_DB_ID == 0) { LegacyLogger.Error("LevelSpawnedFogBeaconManager: ItemDatablock Definition of vanilla Fog Repeller Turbine is not found..."); } } } static LevelSpawnedFogBeacon() { LSFB_ITEM_DB_ID = 0u; FindFogTurbineItemDBID(); LevelAPI.OnBuildStart += FindFogTurbineItemDBID; } } public class LevelSpawnedFogBeaconSettings { public int AreaIndex { get; set; } = 0; public float GrowDuration { get; set; } = 10f; public float ShrinkDuration { get; set; } = 10f; public float Range { get; set; } = 11f; public string WorldEventObjectFilter { get; set; } = string.Empty; public Vec3 Position { get; set; } = new Vec3(); } public class LevelSpawnedFogBeaconDefinition : GlobalZoneIndex { public List SpawnedBeaconsInZone { get; set; } = new List { new LevelSpawnedFogBeaconSettings() }; } public class LevelSpawnedFogBeaconManager : ZoneDefinitionManager { private Dictionary LSFBGlobalStatesSet = new Dictionary(); public static LevelSpawnedFogBeaconManager Current { get; } private Dictionary LevelSpawnedFogBeacons { get; } = new Dictionary(); protected override string DEFINITION_NAME => "LevelSpawnedFogBeacon"; private void Build(LevelSpawnedFogBeaconDefinition def) { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) foreach (LevelSpawnedFogBeaconSettings item in def.SpawnedBeaconsInZone) { if (item.WorldEventObjectFilter == null || item.WorldEventObjectFilter == string.Empty || LevelSpawnedFogBeacons.ContainsKey(item.WorldEventObjectFilter)) { LegacyLogger.Error("LevelSpawnedFogBeaconManager: WorldEventObjectFilter '" + item.WorldEventObjectFilter + "' is either unassigned or has already been assigned."); continue; } LevelSpawnedFogBeacon levelSpawnedFogBeacon = LevelSpawnedFogBeacon.Instantiate(((GlobalZoneIndex)def).DimensionIndex, ((GlobalZoneIndex)def).LayerType, ((GlobalZoneIndex)def).LocalIndex, item); if (levelSpawnedFogBeacon != null) { LevelSpawnedFogBeacons[item.WorldEventObjectFilter] = levelSpawnedFogBeacon; LSFBGlobalStatesSet[((Il2CppObjectBase)levelSpawnedFogBeacon.GlobalState).Pointer] = item; LegacyLogger.Debug($"LevelSpawnedFogBeaconManager: spawned '{item.WorldEventObjectFilter}' in {((GlobalZoneIndex)def).GlobalZoneIndexTuple()}, Area_{(ushort)(65 + item.AreaIndex)}"); } } } internal LevelSpawnedFogBeaconSettings GetLSFBDef(HeavyFogRepellerGlobalState h) { LevelSpawnedFogBeaconSettings value; return LSFBGlobalStatesSet.TryGetValue(((Il2CppObjectBase)h).Pointer, out value) ? value : null; } public void ToggleLSFBState(string worldEventgObjectFilter, bool enable) { //IL_0041: 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_0060: 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) if (!LevelSpawnedFogBeacons.TryGetValue(worldEventgObjectFilter, out var value)) { LegacyLogger.Error("ToggleLSFBState: '" + worldEventgObjectFilter + "' is not defined"); } else if (SNet.IsMaster) { value.GlobalState.AttemptInteract(new pCarryItemWithGlobalState_Interaction { type = (byte)((!enable) ? 1 : 0), owner = (eCarryItemWithGlobalStateOwner)2, staticPosition = value.Position }); } } private void Clear() { foreach (LevelSpawnedFogBeacon value in LevelSpawnedFogBeacons.Values) { value.Destroy(); } LSFBGlobalStatesSet.Clear(); LevelSpawnedFogBeacons.Clear(); } private void BuildLevelSpawnedFogBeacons() { if (base.definitions.ContainsKey(RundownManager.ActiveExpedition.LevelLayoutData)) { base.definitions[RundownManager.ActiveExpedition.LevelLayoutData].Definitions.ForEach(Build); } } private LevelSpawnedFogBeaconManager() { LevelAPI.OnBuildStart += Clear; LevelAPI.OnLevelCleanup += Clear; LevelAPI.OnBuildDone += BuildLevelSpawnedFogBeacons; } static LevelSpawnedFogBeaconManager() { Current = new LevelSpawnedFogBeaconManager(); } } public class RepellerSphereSetting { public bool InfiniteDuration { get; set; } = false; public float GrowDuration { get; set; } = 10f; public float ShrinkDuration { get; set; } = 10f; public float Range { get; set; } = 11f; } public class BigPickupFogBeaconSetting { public uint MainLevelLayout { get; set; } = 0u; public float TimeToPickup { get; set; } = 1f; public float TimeToPlace { get; set; } = 1f; public RepellerSphereSetting RSHold { get; set; } = new RepellerSphereSetting(); public RepellerSphereSetting RSPlaced { get; set; } = new RepellerSphereSetting(); } internal class BigPickupFogBeaconSettingManager { private Dictionary fogBeaconSettings = new Dictionary(); private LiveEditListener liveEditListener; private static readonly string CONFIG_PATH; public static readonly BigPickupFogBeaconSetting DEDFAULT_SETTING; public static BigPickupFogBeaconSettingManager Current { get; private set; } internal BigPickupFogBeaconSetting SettingForCurrentLevel { get; private set; } = DEDFAULT_SETTING; private void AddOverride(BigPickupFogBeaconSetting _override) { if (_override != null) { if (fogBeaconSettings.ContainsKey(_override.MainLevelLayout)) { LegacyLogger.Warning("Replaced MainLevelLayout {0}", _override.MainLevelLayout); fogBeaconSettings[_override.MainLevelLayout] = _override; } else { fogBeaconSettings.Add(_override.MainLevelLayout, _override); } } } public void Init() { //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Expected O, but got Unknown if (!Directory.Exists(CONFIG_PATH)) { Directory.CreateDirectory(CONFIG_PATH); StreamWriter streamWriter = File.CreateText(Path.Combine(CONFIG_PATH, "Template.json")); streamWriter.WriteLine(Json.Serialize(new BigPickupFogBeaconSetting())); streamWriter.Flush(); streamWriter.Close(); return; } foreach (string item in Directory.EnumerateFiles(CONFIG_PATH, "*.json", SearchOption.AllDirectories)) { Json.Load(item, out var config); AddOverride(config); } LevelAPI.OnBuildStart += UpdateSetting; liveEditListener = LiveEdit.CreateListener(CONFIG_PATH, "*.json", true); liveEditListener.FileChanged += new LiveEditEventHandler(FileChanged); } private void FileChanged(LiveEditEventArgs e) { LegacyLogger.Warning("LiveEdit File Changed: " + e.FullPath); LiveEdit.TryReadFileContent(e.FullPath, (Action)delegate(string content) { BigPickupFogBeaconSetting @override = Json.Deserialize(content); AddOverride(@override); if (GameStateManager.IsInExpedition) { UpdateSetting(); } }); } private void UpdateSetting() { uint levelLayoutData = RundownManager.ActiveExpedition.LevelLayoutData; SettingForCurrentLevel = (fogBeaconSettings.ContainsKey(levelLayoutData) ? fogBeaconSettings[levelLayoutData] : DEDFAULT_SETTING); LegacyLogger.Debug($"FogBeaconSettingManager: updated setting for level with main level layout id {levelLayoutData}"); } private BigPickupFogBeaconSettingManager() { } static BigPickupFogBeaconSettingManager() { CONFIG_PATH = Path.Combine(LegacyOverrideManagers.LEGACY_CONFIG_PATH, "FogBeaconSetting"); DEDFAULT_SETTING = new BigPickupFogBeaconSetting(); Current = new BigPickupFogBeaconSettingManager(); } } } namespace LEGACY.LegacyOverride.ExpeditionSuccessPage { public struct StateSync { public int index; public StateSync() { index = 0; } } public class SuccessPageCustomization { public string WorldEventObjectFilter { get; set; } = string.Empty; public LocalizedText PageHeader { get; set; } = null; public uint OverrideSuccessMusic { get; set; } = 0u; public bool SetAsDefaultCustomization { get; set; } = false; } public class SuccessPageCustomizationManager : GenericExpeditionDefinitionManager { public static SuccessPageCustomizationManager Current { get; } private StateReplicator StateReplicator { get; set; } protected override string DEFINITION_NAME => "ExpeditionSuccessPage"; public SuccessPageCustomization CurrentCustomization { get; private set; } public void ApplyCustomization(string WorldEventObjectFilter) { if (!base.definitions.ContainsKey(base.CurrentMainLevelLayout)) { LegacyLogger.Error($"SuccessPageCustomization: definition not found for main level layout {base.CurrentMainLevelLayout}"); return; } List definitions = base.definitions[base.CurrentMainLevelLayout].Definitions; int num = definitions.FindIndex((SuccessPageCustomization def) => def.WorldEventObjectFilter.Equals(WorldEventObjectFilter)); if (num == -1) { LegacyLogger.Error("SuccessPageCustomization: customization WorldEventObjectFilter '" + WorldEventObjectFilter + "' is not found"); return; } CurrentCustomization = definitions[num]; LegacyLogger.Debug("SuccessPageCustomization: customization with WorldEventObjectFilter '" + WorldEventObjectFilter + "' applied"); if (SNet.IsMaster) { StateReplicator?.SetState(new StateSync { index = num }); } } private void SetDefaultCustomization() { if (!base.definitions.ContainsKey(base.CurrentMainLevelLayout)) { LegacyLogger.Error($"SuccessPageCustomization: definition not found for main level layout {base.CurrentMainLevelLayout}"); return; } List definitions = base.definitions[base.CurrentMainLevelLayout].Definitions; int num = definitions.FindIndex((SuccessPageCustomization def) => def.SetAsDefaultCustomization); if (num != -1) { CurrentCustomization = definitions[num]; LegacyLogger.Debug("SuccessPageCustomization: default customization with WorldEventObjectFilter '" + CurrentCustomization.WorldEventObjectFilter + "' applied"); if (SNet.IsMaster) { StateReplicator?.SetState(new StateSync { index = num }); } } } private void OnStateChanged(StateSync oldState, StateSync newState, bool isRecall) { if (isRecall && base.definitions.TryGetValue(base.CurrentMainLevelLayout, out var value) && 0 <= newState.index && newState.index < value.Definitions.Count) { CurrentCustomization = value.Definitions[newState.index]; } } private void Clear() { CurrentCustomization = null; } private SuccessPageCustomizationManager() { LevelAPI.OnEnterLevel += SetDefaultCustomization; LevelAPI.OnBuildStart += Clear; LevelAPI.OnLevelCleanup += Clear; EventAPI.OnAssetsLoaded += delegate { uint num = EOSNetworking.AllotForeverReplicatorID(); if (num == 0) { LegacyLogger.Error("SuccessPageCustomizationManager: Cannot allot replicator!"); } else { StateReplicator = StateReplicator.Create(num, new StateSync { index = 0 }, (LifeTimeType)0, (IStateReplicatorHolder)null); StateReplicator.OnStateChanged += OnStateChanged; } }; } static SuccessPageCustomizationManager() { Current = new SuccessPageCustomizationManager(); } } } namespace LEGACY.LegacyOverride.EventScan { internal class EventScanComponent : MonoBehaviour { public const float UPDATE_INTERVAL = 0.3f; public const string VANILLA_CP_PREFAB_PATH = "Assets/AssetPrefabs/Complex/Generic/ChainedPuzzles/CP_Bioscan_sustained_RequireAll.prefab"; private float time = float.NaN; private float m_colorLerpDelta = 0f; private const float LERP_DURATION = 0.5f; public GameObject Cylinder => ((Component)((Component)this).gameObject.transform.GetChild(0).GetChild(0)).gameObject; public GameObject Visual => ((Component)((Component)this).gameObject.transform.GetChild(0).GetChild(1)).gameObject; public GameObject Information => ((Component)((Component)this).gameObject.transform.GetChild(0).GetChild(2)).gameObject; public GameObject TextMeshProGO => ((Component)Information.transform.GetChild(0)).gameObject; public Renderer VisualRenderer { get; private set; } public TextMeshPro DisplayText { get; private set; } private Vector3 Position => ((Component)this).gameObject.transform.position; public StateReplicator StateReplicator { get; private set; } public EventScanDefinition def { get; internal set; } public Color Color_Waiting { get; private set; } public Color Color_Active { get; private set; } public void Setup() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) if (def == null) { LegacyLogger.Error("EventScan Setup: assign a EventScanDefinition before calling Setup()!"); return; } ((Component)this).gameObject.transform.SetPositionAndRotation(def.Position.ToVector3(), Quaternion.identity); ((Component)this).gameObject.SetActiveRecursively(true); GameObject loadedAsset = AssetAPI.GetLoadedAsset("Assets/AssetPrefabs/Complex/Generic/ChainedPuzzles/CP_Bioscan_sustained_RequireAll.prefab"); if ((Object)(object)loadedAsset != (Object)null) { GameObject gameObject = ((Component)loadedAsset.transform.GetChild(0).GetChild(1)).gameObject; GameObject val = Object.Instantiate(gameObject.gameObject); val.transform.SetParent(((Component)this).gameObject.transform, false); val.transform.localScale = new Vector3(1f / def.Radius, 1f / def.Radius, 1f / def.Radius); DisplayText = val.GetComponentInChildren(); if ((Object)(object)DisplayText != (Object)null) { ((TMP_Text)DisplayText).SetText(LocalizedText.op_Implicit(def.DisplayText), true); ((TMP_Text)DisplayText).ForceMeshUpdate(false, false); } else { LegacyLogger.Error("EventScan: instantiation error - cannot find TMPPro from vanilla CP!"); } } else { LegacyLogger.Error("EventScan: instantiation error - cannot instantiate vanilla CP!"); } Vec3 waiting = def.ColorSetting.Waiting; Vec3 active = def.ColorSetting.Active; Color_Waiting = new Color(waiting.x, waiting.y, waiting.z); Color_Active = new Color(active.x, active.y, active.z); float num = 0.16216217f; ((Component)this).gameObject.transform.localScale = new Vector3(def.Radius, def.Radius, def.Radius); Transform transform = ((Component)this).gameObject.transform; transform.localPosition += Vector3.up * num; VisualRenderer = Visual.gameObject.GetComponentInChildren(); VisualRenderer.material.SetColor("_ColorA", Color_Waiting); uint num2 = EOSNetworking.AllotReplicatorID(); if (num2 == 0) { LegacyLogger.Error("EventScan: Replicator ID depleted, cannot setup"); return; } StateReplicator = StateReplicator.Create(num2, new EventScanStatus { Status = EventScanState.Waiting }, (LifeTimeType)1, (IStateReplicatorHolder)null); StateReplicator.OnStateChanged += OnStateChange; } private void OnStateChange(EventScanStatus oldState, EventScanStatus newState, bool isRecall) { LegacyLogger.Warning($"EventScan: {oldState.Status} => {newState.Status}"); switch (newState.Status) { case EventScanState.Disabled: { m_colorLerpDelta = 0f; TextMeshPro displayText2 = DisplayText; if (displayText2 != null) { ((Component)displayText2).gameObject.SetActive(false); } Cylinder.SetActive(false); CoroutineManager.BlinkOut(Visual, 0f); break; } case EventScanState.Waiting: if (!Visual.active) { CoroutineManager.BlinkIn(Visual, 0f); Cylinder.SetActive(true); TextMeshPro displayText3 = DisplayText; if (displayText3 != null) { ((Component)displayText3).gameObject.SetActive(true); } } if (!isRecall && oldState.Status == EventScanState.Active) { def.EventsOnDeactivate.ForEach(delegate(WardenObjectiveEventData e) { WardenObjectiveManager.CheckAndExecuteEventsOnTrigger(e, (eWardenObjectiveEventTrigger)0, true, 0f); }); } break; case EventScanState.Active: if (!Visual.active) { CoroutineManager.BlinkIn(Visual, 0f); Cylinder.SetActive(true); TextMeshPro displayText = DisplayText; if (displayText != null) { ((Component)displayText).gameObject.SetActive(true); } } if (!isRecall && oldState.Status == EventScanState.Waiting) { def.EventsOnActivate.ForEach(delegate(WardenObjectiveEventData e) { WardenObjectiveManager.CheckAndExecuteEventsOnTrigger(e, (eWardenObjectiveEventTrigger)0, true, 0f); }); } break; } } public void ChangeToState(EventScanState newState) { ChangedToStateUnsynced(newState); if (SNet.IsMaster) { StateReplicator.SetState(new EventScanStatus { Status = newState }); } } private void ChangedToStateUnsynced(EventScanState newState) { } private void Update() { //IL_004e: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Invalid comparison between Unknown and I4 //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) EventScanState status = StateReplicator.State.Status; if (status == EventScanState.Disabled) { return; } float num = Clock.Delta / 0.5f; if (status == EventScanState.Waiting) { num = 0f - num; } m_colorLerpDelta = Mathf.Clamp01(m_colorLerpDelta + num); Color val = Color.Lerp(Color_Waiting, Color_Active, Mathf.Pow(m_colorLerpDelta, 5f)); VisualRenderer.sharedMaterial.SetColor("_ColorA", val); if (!float.IsNaN(time) && Clock.Time < time + 0.3f) { return; } time = Clock.Time + 0.3f; if (def.ActiveCondition.RequiredPlayerCount == 0 && def.ActiveCondition.RequiredBigPickupIndices.Count == 0) { return; } bool flag = false; bool flag2 = false; Vector3 val2; if (def.ActiveCondition.RequiredPlayerCount > 0) { int num2 = 0; Enumerator enumerator = PlayerManager.PlayerAgentsInLevel.GetEnumerator(); while (enumerator.MoveNext()) { PlayerAgent current = enumerator.Current; val2 = Position - ((Agent)current).Position; if (((Vector3)(ref val2)).magnitude < def.Radius) { num2++; if (num2 >= def.ActiveCondition.RequiredPlayerCount) { flag = true; break; } } } } else { flag = true; } if (flag) { List requiredBigPickupIndices = def.ActiveCondition.RequiredBigPickupIndices; if (requiredBigPickupIndices.Count > 0) { int num3 = 0; foreach (int item in requiredBigPickupIndices) { CarryItemPickup_Core bigPickupItem = PuzzleReqItemManager.Current.GetBigPickupItem(item); if ((Object)(object)bigPickupItem == (Object)null) { num3++; continue; } pPickupItemState currentState = bigPickupItem.m_sync.GetCurrentState(); Vector3 zero = Vector3.zero; ePickupItemStatus status2 = currentState.status; ePickupItemStatus val3 = status2; if ((int)val3 != 0) { if ((int)val3 != 1) { LegacyLogger.Error($"Item has invalid state: {currentState.status}"); continue; } zero = ((Component)bigPickupItem.PickedUpByPlayer).transform.position; } else { zero = ((Component)bigPickupItem).transform.position; } val2 = Position - zero; if (((Vector3)(ref val2)).magnitude < def.Radius) { num3++; } } flag2 = num3 >= requiredBigPickupIndices.Count; } else { flag2 = true; } } switch (status) { case EventScanState.Waiting: if (flag && flag2) { ChangeToState(EventScanState.Active); } break; case EventScanState.Active: if (!flag || !flag2) { ChangeToState(EventScanState.Waiting); } break; } } private void OnDestroy() { def = null; VisualRenderer = null; DisplayText = null; StateReplicator = null; } static EventScanComponent() { ClassInjector.RegisterTypeInIl2Cpp(); } } public class ColorSetting { public Vec3 Waiting { get; set; } = new Vec3 { x = 0.5294f, y = 0.8078f, z = 0.9215f }; public Vec3 Active { get; set; } = new Vec3 { x = 1f, y = 0.7529f, z = 0.145f }; } public class ActiveCondition { public int RequiredPlayerCount { get; set; } = 0; public List RequiredBigPickupIndices { get; set; } = new List(); } public class EventScanDefinition { public string WorldEventObjectFilter { get; set; } = string.Empty; public Vec3 Position { get; set; } = new Vec3(); public float Radius { get; set; } = 3.2f; public ColorSetting ColorSetting { get; set; } = new ColorSetting(); public LocalizedText DisplayText { get; set; } = null; public ActiveCondition ActiveCondition { get; set; } = new ActiveCondition(); public List EventsOnActivate { get; set; } = new List(); public List EventsOnDeactivate { get; set; } = new List(); } internal class EventScanManager : GenericExpeditionDefinitionManager { private Dictionary> eventScans = new Dictionary>(); public static EventScanManager Current { get; private set; } protected override string DEFINITION_NAME => "EventScan"; private void BuildEventScan(EventScanDefinition def) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) Vector3 val = def.Position.ToVector3(); if (!(val == Vector3.zero)) { GameObject val2 = Object.Instantiate(Assets.EventScan); EventScanComponent eventScanComponent = val2.AddComponent(); eventScanComponent.def = def; eventScanComponent.Setup(); List list = null; if (eventScans.ContainsKey(def.WorldEventObjectFilter)) { list = eventScans[def.WorldEventObjectFilter]; } else { list = new List(); eventScans[def.WorldEventObjectFilter] = list; } list.Add(eventScanComponent); } } public void ToggleEventScanState(string WorldEventObjectFilter, bool active = true) { if (!eventScans.ContainsKey(WorldEventObjectFilter)) { LegacyLogger.Error("ToggleEventScanState: " + WorldEventObjectFilter + " does not correspond to any event scans!"); return; } foreach (EventScanComponent item in eventScans[WorldEventObjectFilter]) { if (!active && item.StateReplicator.State.Status != 0) { item.ChangeToState(EventScanState.Disabled); } else if (active && item.StateReplicator.State.Status == EventScanState.Disabled) { item.ChangeToState(EventScanState.Waiting); } } } private void Build() { if (base.definitions.ContainsKey(RundownManager.ActiveExpedition.LevelLayoutData)) { GenericExpeditionDefinition val = base.definitions[RundownManager.ActiveExpedition.LevelLayoutData]; val.Definitions.ForEach(BuildEventScan); } } private void Clear() { foreach (List value in eventScans.Values) { foreach (EventScanComponent item in value) { Object.Destroy((Object)(object)((Component)item).gameObject); } } eventScans.Clear(); } static EventScanManager() { Current = new EventScanManager(); } private EventScanManager() { LevelAPI.OnBuildDone += Build; LevelAPI.OnLevelCleanup += Clear; } } public enum EventScanState { Disabled, Waiting, Active } public struct EventScanStatus { public EventScanState Status; } } namespace LEGACY.LegacyOverride.EnemyTagger { public enum eEnemyTaggerState { Uninitialized, Inactive, Active_Warmup, Active_Tagging } public class EnemyTaggerComponent : MonoBehaviour { private const float INACTIVE_SOUND_UPDATE_INTERVAL = 4f; internal int MaxTagPerScan = 12; internal float TagInterval = 3f; internal float TagRadius = 12f; internal float WarmupTime = 3f; private eEnemyTaggerState CurrentState = eEnemyTaggerState.Uninitialized; private CellSoundPlayer m_sound = new CellSoundPlayer(); private List TaggableEnemies = new List(); private float UpdateTime = 0f; internal CarryItemPickup_Core Parent { get; set; } = null; internal PlayerAgent PickedByPlayer { get; set; } = null; internal Vector3 Position => ((Object)(object)Parent == (Object)null) ? Vector3.zero : (((Object)(object)PickedByPlayer == (Object)null) ? ((Component)Parent).transform.position : ((Component)PickedByPlayer).transform.position); public void ChangeState(eEnemyTaggerState newState) { if (CurrentState == newState) { return; } switch (newState) { case eEnemyTaggerState.Uninitialized: LegacyLogger.Error("Enemy Tagger changed to state 'uninitialized'?"); return; case eEnemyTaggerState.Inactive: UpdateTime = 0f; TaggableEnemies.Clear(); m_sound.Post(EVENTS.BULKHEAD_BUTTON_CLOSE, true); break; case eEnemyTaggerState.Active_Warmup: UpdateTime = 0f; m_sound.Post(EVENTS.BUTTONGENERICDEACTIVATE, true); break; case eEnemyTaggerState.Active_Tagging: if (CurrentState != eEnemyTaggerState.Active_Warmup) { UpdateTime = 0f; } break; default: LegacyLogger.Error($"Enemy Tagger: Undefined state {CurrentState}"); return; } CurrentState = newState; } private bool UpdateTaggableEnemies() { //IL_0068: 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_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) TaggableEnemies.Clear(); bool result = false; List reachableEnemiesInNodes = AIG_CourseGraph.GetReachableEnemiesInNodes(((Object)(object)PickedByPlayer == (Object)null) ? ((ItemInLevel)Parent).m_courseNode : ((Agent)PickedByPlayer).CourseNode, 2); Enumerator enumerator = reachableEnemiesInNodes.GetEnumerator(); while (enumerator.MoveNext()) { EnemyAgent current = enumerator.Current; if (!((Agent)current).Alive) { continue; } Vector3 val = ((Component)current).transform.position - Position; float magnitude = ((Vector3)(ref val)).magnitude; if (!(magnitude > TagRadius)) { result = true; if (!current.IsTagged) { TaggableEnemies.Add(current); } if (TaggableEnemies.Count >= MaxTagPerScan) { break; } } } return result; } private void StartTagging() { if (!(UpdateTime >= TagInterval)) { return; } if (SNet.IsMaster) { UpdateTaggableEnemies(); foreach (EnemyAgent taggableEnemy in TaggableEnemies) { ToolSyncManager.WantToTagEnemy(taggableEnemy); } } UpdateTime = 0f; } private void StopTagging() { if (UpdateTime >= 4f) { m_sound.Post(EVENTS.BUTTONGENERICDEACTIVATE, true); UpdateTime = 0f; } } private void Warmup() { if (UpdateTime >= WarmupTime) { ChangeState(eEnemyTaggerState.Active_Tagging); UpdateTime = TagInterval; } } private void Update() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) if (CurrentState == eEnemyTaggerState.Uninitialized) { return; } if ((Object)(object)Parent == (Object)null) { LegacyLogger.Error("EnemyTagger: null parent"); return; } UpdateTime += Time.deltaTime; m_sound.UpdatePosition(Position); switch (CurrentState) { case eEnemyTaggerState.Active_Warmup: Warmup(); break; case eEnemyTaggerState.Active_Tagging: StartTagging(); break; case eEnemyTaggerState.Inactive: StopTagging(); break; } } private void OnDestroy() { StopTagging(); TaggableEnemies.Clear(); TaggableEnemies = null; if (m_sound != null) { m_sound.Stop(); m_sound.Recycle(); m_sound = null; } Parent = null; } static EnemyTaggerComponent() { ClassInjector.RegisterTypeInIl2Cpp(); } } public class EnemyTaggerSetting { public uint MainLevelLayout { get; set; } = 0u; public float TimeToPickup { get; set; } = 1f; public float TimeToPlace { get; set; } = 1f; public float WarmupTime { get; set; } = 5f; public int MaxTagPerScan { get; set; } = 12; public float TagInterval { get; set; } = 3f; public float TagRadius { get; set; } = 12f; public bool TagWhenPlaced { get; set; } = true; public bool TagWhenHold { get; set; } = false; public bool UseVisual { get; set; } = false; } internal class EnemyTaggerSettingManager { public static readonly EnemyTaggerSettingManager Current; private Dictionary enemyTaggerSettingSettings = new Dictionary(); private LiveEditListener liveEditListener; private static readonly string CONFIG_PATH; private static readonly EnemyTaggerSetting DEFAULT; private List obsVisuals = new List(); internal EnemyTaggerSetting SettingForCurrentLevel { get; private set; } = DEFAULT; public IEnumerable OBSVisuals => obsVisuals; private void AddOverride(EnemyTaggerSetting _override) { if (_override != null) { if (enemyTaggerSettingSettings.ContainsKey(_override.MainLevelLayout)) { LegacyLogger.Warning("Replaced MainLevelLayout {0}", _override.MainLevelLayout); enemyTaggerSettingSettings[_override.MainLevelLayout] = _override; } else { enemyTaggerSettingSettings.Add(_override.MainLevelLayout, _override); } } } public void Init() { //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Expected O, but got Unknown if (!Directory.Exists(CONFIG_PATH)) { Directory.CreateDirectory(CONFIG_PATH); StreamWriter streamWriter = File.CreateText(Path.Combine(CONFIG_PATH, "Template.json")); streamWriter.WriteLine(Json.Serialize(new EnemyTaggerSetting())); streamWriter.Flush(); streamWriter.Close(); return; } foreach (string item in Directory.EnumerateFiles(CONFIG_PATH, "*.json", SearchOption.AllDirectories)) { Json.Load(item, out var config); AddOverride(config); } LevelAPI.OnBuildStart += UpdateSetting; liveEditListener = LiveEdit.CreateListener(CONFIG_PATH, "*.json", true); liveEditListener.FileChanged += new LiveEditEventHandler(FileChanged); } private void FileChanged(LiveEditEventArgs e) { LegacyLogger.Warning("LiveEdit File Changed: " + e.FullPath); LiveEdit.TryReadFileContent(e.FullPath, (Action)delegate(string content) { EnemyTaggerSetting @override = Json.Deserialize(content); AddOverride(@override); if (GameStateManager.IsInExpedition) { UpdateSetting(); } }); } private void UpdateSetting() { uint levelLayoutData = RundownManager.ActiveExpedition.LevelLayoutData; SettingForCurrentLevel = (enemyTaggerSettingSettings.ContainsKey(levelLayoutData) ? enemyTaggerSettingSettings[levelLayoutData] : DEFAULT); LegacyLogger.Debug($"EnemyTaggerSettingManager: updated setting for level with main level layout id {levelLayoutData}"); } public void SetupAsObserver(LG_PickupItem __instance) { //IL_014d: Unknown result type (might be due to invalid IL or missing references) EnemyTaggerSetting setting = SettingForCurrentLevel; CarryItemPickup_Core core = ((Component)__instance.m_root).GetComponentInChildren(); Interact_Pickup_PickupItem interact = ((Il2CppObjectBase)core.m_interact).Cast(); LG_PickupItem_Sync val = ((Il2CppObjectBase)core.m_sync).Cast(); EnemyTaggerComponent tagger = ((Component)core).gameObject.AddComponent(); tagger.Parent = core; ((Component)tagger).gameObject.SetActive(true); ((Interact_Timed)interact).InteractDuration = setting.TimeToPickup; tagger.MaxTagPerScan = setting.MaxTagPerScan; tagger.TagInterval = setting.TagInterval; tagger.TagRadius = setting.TagRadius; tagger.WarmupTime = setting.WarmupTime; GameObject obsVisual = null; if (setting.UseVisual) { obsVisual = Object.Instantiate(Assets.OBSVisual, ((Component)__instance).transform); obsVisual.transform.localScale = new Vector3(setting.TagRadius, setting.TagRadius, setting.TagRadius); obsVisual.SetActive(false); obsVisuals.Add(obsVisual); } val.OnSyncStateChange += Action.op_Implicit((Action)delegate(ePickupItemStatus status, pPickupPlacement placement, PlayerAgent playerAgent, bool isRecall) { //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_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Invalid comparison between Unknown and I4 //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) if ((int)status != 0) { if ((int)status == 1) { ((Component)tagger).gameObject.SetActive(true); tagger.PickedByPlayer = playerAgent; tagger.ChangeState((!setting.TagWhenHold) ? eEnemyTaggerState.Inactive : eEnemyTaggerState.Active_Warmup); ((Interact_Timed)interact).InteractDuration = setting.TimeToPlace; if ((Object)(object)obsVisual != (Object)null && obsVisual.active) { CoroutineManager.BlinkOut(obsVisual, 0f); } } } else { tagger.PickedByPlayer = null; tagger.ChangeState((!setting.TagWhenPlaced) ? eEnemyTaggerState.Inactive : eEnemyTaggerState.Active_Warmup); ((Interact_Timed)interact).InteractDuration = setting.TimeToPickup; if ((Object)(object)obsVisual != (Object)null) { obsVisual.gameObject.transform.SetPositionAndRotation(placement.position, placement.rotation); if (isRecall) { if (((ItemInLevel)core).CanWarp) { CoroutineManager.BlinkIn(obsVisual, tagger.WarmupTime); } } else if (!obsVisual.active && setting.TagWhenPlaced) { CoroutineManager.BlinkIn(obsVisual, tagger.WarmupTime); } } } }); } private void AddOBSVisualRenderers() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown foreach (GameObject oBSVisual in OBSVisuals) { Renderer componentInChildren = oBSVisual.GetComponentInChildren(); float @float = componentInChildren.material.GetFloat("_Intensity"); float behindWallIntensity = -1f; TSAManager.Current.RegisterPuzzleVisual(new PuzzleVisualWrapper { GO = oBSVisual, Renderer = componentInChildren, Intensity = @float, BehindWallIntensity = behindWallIntensity }); } } private void Clear() { obsVisuals.Clear(); } private EnemyTaggerSettingManager() { LevelAPI.OnBuildStart += Clear; LevelAPI.OnLevelCleanup += Clear; LevelAPI.OnEnterLevel += AddOBSVisualRenderers; } static EnemyTaggerSettingManager() { CONFIG_PATH = Path.Combine(LegacyOverrideManagers.LEGACY_CONFIG_PATH, "EnemyTaggerSetting"); DEFAULT = new EnemyTaggerSetting(); Current = new EnemyTaggerSettingManager(); } } } namespace LEGACY.LegacyOverride.ElevatorCargo { internal class ElevatorCargoOverrideManager { public static readonly ElevatorCargoOverrideManager Current; private Dictionary elevatorCargos = new Dictionary(); private LiveEditListener liveEditListener; private static readonly string CONFIG_PATH; private void AddOverride(LevelElevatorCargo _override) { if (_override != null) { if (elevatorCargos.ContainsKey(_override.MainLevelLayout)) { LegacyLogger.Warning("Replaced MainLevelLayout {0}", _override.MainLevelLayout); elevatorCargos[_override.MainLevelLayout] = _override; } else { elevatorCargos.Add(_override.MainLevelLayout, _override); } } } public void Init() { //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown if (!Directory.Exists(CONFIG_PATH)) { Directory.CreateDirectory(CONFIG_PATH); StreamWriter streamWriter = File.CreateText(Path.Combine(CONFIG_PATH, "Template.json")); streamWriter.WriteLine(Json.Serialize(new LevelElevatorCargo())); streamWriter.Flush(); streamWriter.Close(); return; } foreach (string item in Directory.EnumerateFiles(CONFIG_PATH, "*.json", SearchOption.AllDirectories)) { Json.Load(item, out var config); AddOverride(config); } liveEditListener = LiveEdit.CreateListener(CONFIG_PATH, "*.json", true); liveEditListener.FileChanged += new LiveEditEventHandler(FileChanged); } private void FileChanged(LiveEditEventArgs e) { LegacyLogger.Warning("LiveEdit File Changed: " + e.FullPath); LiveEdit.TryReadFileContent(e.FullPath, (Action)delegate(string content) { LevelElevatorCargo @override = Json.Deserialize(content); AddOverride(@override); }); } internal LevelElevatorCargo GetLevelElevatorCargoItems(uint MainLevelLayout) { return elevatorCargos.ContainsKey(MainLevelLayout) ? elevatorCargos[MainLevelLayout] : null; } private ElevatorCargoOverrideManager() { } static ElevatorCargoOverrideManager() { CONFIG_PATH = Path.Combine(LegacyOverrideManagers.LEGACY_CONFIG_PATH, "ElevatorCargoOverride"); Current = new ElevatorCargoOverrideManager(); } } public enum ItemType { Consumable, BigPickup } public class ElevatorCargoItem { public uint ItemID { get; set; } public ItemType ItemType { get; set; } } public class LevelElevatorCargo { public uint MainLevelLayout { get; set; } public bool ForceDisable { get; set; } = false; public List ElevatorCargoItems { get; set; } = new List(); } } namespace LEGACY.LegacyOverride.DummyVisual { public enum VisualTemplateType { SENSOR, SCAN } public class VisualGroup { [StructLayout(LayoutKind.Auto)] [CompilerGenerated] private struct <>c__DisplayClass22_0 { public List gos; } [CompilerGenerated] private sealed class d__23 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public List gos; public BlinkConfig conf; public float InitialDelay; public VisualGroup <>4__this; private List.Enumerator <>s__1; private GameObject 5__2; private bool 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__23(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>s__1 = default(List.Enumerator); 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (InitialDelay >= 0f) { <>2__current = (object)new WaitForSeconds(InitialDelay); <>1__state = 1; return true; } break; case 1: <>1__state = -1; break; case 2: <>1__state = -1; break; } <>s__1 = gos.GetEnumerator(); try { while (<>s__1.MoveNext()) { 5__2 = <>s__1.Current; 5__3 = 5__2.active; 5__2.SetActive(!5__3); 5__2 = null; } } finally { ((IDisposable)<>s__1).Dispose(); } <>s__1 = default(List.Enumerator); <>2__current = (object)new WaitForSeconds(conf.ShowHideTime); <>1__state = 2; return true; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__22 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public List gos; public DirectionalConfig conf; public float InitialDelay; public VisualGroup <>4__this; private <>c__DisplayClass22_0 <>8__1; private int 5__2; private int 5__3; private LinkedList 5__4; private LinkedListNode 5__5; private int 5__6; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__22(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = default(<>c__DisplayClass22_0); 5__4 = null; 5__5 = null; <>1__state = -2; } private bool MoveNext() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1.gos = gos; if (InitialDelay >= 0f) { <>2__current = (object)new WaitForSeconds(InitialDelay); <>1__state = 1; return true; } goto IL_0076; case 1: <>1__state = -1; goto IL_0076; case 2: { <>1__state = -1; 5__5 = null; break; } IL_0076: 5__2 = conf.WindowSize; 5__3 = -5__2 + 1; 5__4 = new LinkedList(); 5__4.AddFirst(5__3); break; } g__SetGOsInRange|22_0(0, <>8__1.gos.Count, false, ref <>8__1); for (5__5 = 5__4.First; 5__5 != null; 5__5 = 5__5.Next) { 5__6 = 5__5.Value; g__SetGOsInRange|22_0(5__6, 5__6 + 5__2, true, ref <>8__1); 5__5.Value = 5__6 + 1; if (5__5 == 5__4.First && 1 < 5__5.Value - conf.WindowInterval) { 5__4.AddFirst(5__3); } else if (5__5 == 5__4.Last && 5__5.Value >= <>8__1.gos.Count) { 5__4.RemoveLast(); } } <>2__current = (object)new WaitForSeconds(conf.UpdateInterval); <>1__state = 2; return true; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private List coroutines = new List(); public VisualGroupDefinition def { get; private set; } private List Visuals { get; } = new List(); public IEnumerable GameObjects => Visuals; public StateReplicator StateReplicator { get; private set; } private void OnStateChanged(VisualGroupState oldState, VisualGroupState newState, bool isRecall) { if (oldState.VisualAnimationType != newState.VisualAnimationType) { LegacyLogger.Debug($"VisualGroup OnStateChange: {oldState.VisualAnimationType} -> {newState.VisualAnimationType}"); } if (isRecall) { ChangeToStateUnsynced(newState); } } public void ChangeToState(VisualGroupState state) { ChangeToStateUnsynced(state); if (SNet.IsMaster) { StateReplicator.SetState(state); } } private void ChangeToStateUnsynced(VisualGroupState state) { coroutines.ForEach((Action)CoroutineManager.StopCoroutine); coroutines.Clear(); Coroutine val = null; switch (state.VisualAnimationType) { case VisualAnimationType.OFF: Visuals.ForEach(delegate(GameObject go) { go.SetActive(false); }); break; case VisualAnimationType.ON: Visuals.ForEach(delegate(GameObject go) { go.SetActive(true); }); break; case VisualAnimationType.DIRECTIONAL: case VisualAnimationType.REVERSE_DIRECTIONAL: { List gos = ((state.VisualAnimationType == VisualAnimationType.DIRECTIONAL) ? Visuals : Enumerable.Reverse(Visuals).ToList()); val = CoroutineManager.StartCoroutine(CollectionExtensions.WrapToIl2Cpp(Directional(gos, def.AnimationConfig.Directional, def.InitialPlayDelay)), (Action)null); coroutines.Add(val); break; } case VisualAnimationType.BLINK: val = CoroutineManager.StartCoroutine(CollectionExtensions.WrapToIl2Cpp(Blink(Visuals, def.AnimationConfig.Blink, def.InitialPlayDelay)), (Action)null); coroutines.Add(val); break; default: LegacyLogger.Error($"VisualGroup: Visual Type '{state.VisualAnimationType}' is undefined!"); break; } } private void BuildVisualGOs() { //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: 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_022d: Unknown result type (might be due to invalid IL or missing references) foreach (VisualSequence visualSequence in def.VisualSequences) { GameObject val = null; switch (def.VisualType) { case VisualTemplateType.SENSOR: val = Assets.DummySensor; break; case VisualTemplateType.SCAN: val = Assets.DummyScan; break; default: LegacyLogger.Error($"Build DummyVisual: VisualType {def.VisualType} is not implemented."); continue; } List list; switch (visualSequence.SequenceType) { case VSequenceType.DIRECTIONAL: list = visualSequence.DirectionalSequence.Generate(val); break; case VSequenceType.CIRCULAR: list = visualSequence.CircularSequence.Generate(val); break; default: LegacyLogger.Error($"BuildVisualGOs: VSequenceType {visualSequence.SequenceType} is not implemented"); continue; } foreach (GameObject item in list) { GameObject gameObject = ((Component)item.transform.GetChild(0).GetChild(0)).gameObject; gameObject.SetActive(def.DisplayCylinder); TextMeshPro componentInChildren = item.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { ((TMP_Text)componentInChildren).SetText(LocalizedText.op_Implicit(def.Text), true); ((TMP_Text)componentInChildren).ForceMeshUpdate(false, false); } float num = 0.16216217f; item.transform.localScale = new Vector3(visualSequence.VisualRadius, visualSequence.VisualRadius, visualSequence.VisualRadius); Transform transform = item.transform; transform.localPosition += Vector3.up * num; ((Component)item.transform.GetChild(0).GetChild(1)).gameObject.GetComponentInChildren().material.SetColor("_ColorA", new Color(visualSequence.VisualColor.x, visualSequence.VisualColor.y, visualSequence.VisualColor.z)); } Visuals.AddRange(list); } } private void DestroyVisualGOs() { Visuals.ForEach((Action)Object.Destroy); Visuals.Clear(); } internal void ResetupOnDef(VisualGroupDefinition def) { this.def = def; DestroyVisualGOs(); BuildVisualGOs(); ChangeToState(new VisualGroupState { VisualAnimationType = def.InitialAnimation }); } public bool Setup() { BuildVisualGOs(); uint num = EOSNetworking.AllotReplicatorID(); if (num == 0) { LegacyLogger.Error("VisualGroup Setup: cannot setup replicator"); return false; } StateReplicator = StateReplicator.Create(num, new VisualGroupState { VisualAnimationType = VisualAnimationType.OFF }, (LifeTimeType)1, (IStateReplicatorHolder)null); StateReplicator.OnStateChanged += OnStateChanged; LevelAPI.OnEnterLevel += OnEnterLevel; return true; } private void OnEnterLevel() { ChangeToState(new VisualGroupState { VisualAnimationType = def.InitialAnimation }); } [IteratorStateMachine(typeof(d__22))] private IEnumerator Directional(List gos, DirectionalConfig conf, float InitialDelay = 0f) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__22(0) { <>4__this = this, gos = gos, conf = conf, InitialDelay = InitialDelay }; } [IteratorStateMachine(typeof(d__23))] private IEnumerator Blink(List gos, BlinkConfig conf, float InitialDelay = 0f) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__23(0) { <>4__this = this, gos = gos, conf = conf, InitialDelay = InitialDelay }; } public void Destroy() { LevelAPI.OnEnterLevel -= OnEnterLevel; DestroyVisualGOs(); StateReplicator = null; } public VisualGroup(VisualGroupDefinition def) { this.def = def; } [CompilerGenerated] internal static void g__SetGOsInRange|22_0(int start, int end, bool active, ref <>c__DisplayClass22_0 P_3) { start = Math.Max(start, 0); end = Math.Min(end, P_3.gos.Count); for (int i = start; i < end; i++) { P_3.gos[i].SetActive(active); } } } public enum VSequenceType { DIRECTIONAL, CIRCULAR } public class VisualSequence { public float VisualRadius { get; set; } = 3.2f; public Vec3 VisualColor { get; set; } = new Vec3(); public VSequenceType SequenceType { get; set; } = VSequenceType.DIRECTIONAL; public DirectionalSequence DirectionalSequence { get; set; } = new DirectionalSequence(); public CircularSequence CircularSequence { get; set; } = new CircularSequence(); } public class VisualGroupDefinition { public string WorldEventObjectFilter { get; set; } = string.Empty; public VisualTemplateType VisualType { get; set; } = VisualTemplateType.SENSOR; public VisualAnimationType InitialAnimation { get; set; } = VisualAnimationType.OFF; public float InitialPlayDelay { get; set; } = 0f; public LocalizedText Text { get; set; } = null; public bool DisplayCylinder { get; set; } = false; public List VisualSequences { get; set; } = new List { new VisualSequence() }; public VisualAnimationConfig AnimationConfig { get; set; } = new VisualAnimationConfig(); } internal class VisualManager : GenericExpeditionDefinitionManager { public static VisualManager Current; protected override string DEFINITION_NAME => "DummyVisual"; private Dictionary Visuals { get; } = new Dictionary(); public void Build(VisualGroupDefinition def) { if (Visuals.ContainsKey(def.WorldEventObjectFilter)) { LegacyLogger.Error("Build DummyVisual: found duplicate WorldEventObjectFilter " + def.WorldEventObjectFilter + ", won't build!"); return; } VisualGroup visualGroup = new VisualGroup(def); if (visualGroup.Setup()) { Visuals[def.WorldEventObjectFilter] = visualGroup; } } public void ToggleVisualAnimationType(string worldEventObjectFilter, VisualAnimationType visualType) { if (!Visuals.TryGetValue(worldEventObjectFilter, out var value)) { LegacyLogger.Error("ToggleVisualAnimationType: Visual Sequence '" + worldEventObjectFilter + "' is not found"); return; } value.ChangeToState(new VisualGroupState { VisualAnimationType = visualType }); } private void Clear() { foreach (VisualGroup value in Visuals.Values) { value.Destroy(); } Visuals.Clear(); } private void OnBuildDone() { if (base.definitions.ContainsKey(RundownManager.ActiveExpedition.LevelLayoutData)) { base.definitions[RundownManager.ActiveExpedition.LevelLayoutData].Definitions.ForEach(Build); } } protected override void FileChanged(LiveEditEventArgs e) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Invalid comparison between Unknown and I4 base.FileChanged(e); if ((int)GameStateManager.CurrentStateName != 10 || !base.definitions.ContainsKey(base.CurrentMainLevelLayout)) { return; } List definitions = base.definitions[base.CurrentMainLevelLayout].Definitions; foreach (VisualGroupDefinition item in definitions) { if (Visuals.TryGetValue(item.WorldEventObjectFilter, out var value)) { LegacyLogger.Debug("Rebuilding visual group '" + item.WorldEventObjectFilter + "'"); value.ResetupOnDef(item); } } } private VisualManager() { LevelAPI.OnBuildDone += OnBuildDone; LevelAPI.OnBuildStart += Clear; LevelAPI.OnLevelCleanup += Clear; } static VisualManager() { Current = new VisualManager(); } } internal enum ToggleType { INSTANT, BLINK } internal static class ToggleFunctions { public static void Instant(GameObject go, bool active) { go.SetActive(active); } public static void Instant(IEnumerable gos, bool active) { foreach (GameObject go in gos) { Instant(go, active); } } public static void Blink(GameObject go, bool active) { if (active) { CoroutineManager.BlinkIn(go, 0f); } else { CoroutineManager.BlinkOut(go, 0f); } } public static void Blink(IEnumerable gos, bool active) { foreach (GameObject go in gos) { Blink(go, active); } } } public struct VisualGroupState { public VisualAnimationType VisualAnimationType; public VisualGroupState() { VisualAnimationType = VisualAnimationType.OFF; } } } namespace LEGACY.LegacyOverride.DummyVisual.VisualSequenceType { public class CircularSequence { public Vec3 Origin { get; set; } = new Vec3(); public Vec3 Rotation { get; set; } = new Vec3(); public float CircleRadius { get; set; } = 6.4f; public int Count { get; set; } = 1; public bool GenerateFullCircle { get; set; } = false; public float AngleDegreeInterval { get; set; } = 60f; public float ToRadian(float degrees) { return (float)((double)degrees * Math.PI / 180.0); } public List Generate(GameObject template) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_011a: 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) float num = (GenerateFullCircle ? (360f / (float)Count) : AngleDegreeInterval); List list = new List(); GameObject val = new GameObject(); val.transform.SetPositionAndRotation(Origin.ToVector3(), Quaternion.identity); Vector3 val3 = default(Vector3); for (int i = 0; i < Count; i++) { GameObject val2 = Object.Instantiate(template); float degrees = num * (float)i; float num2 = ToRadian(degrees); ((Vector3)(ref val3))..ctor(Origin.x + Mathf.Cos(num2) * CircleRadius, Origin.y, Origin.z + Mathf.Sin(num2) * CircleRadius); val2.transform.SetPositionAndRotation(val3, Quaternion.identity); val2.SetActiveRecursively(true); list.Add(val2); val2.transform.SetParent(val.transform); } Quaternion val4 = Rotation.ToQuaternion(); val.transform.SetPositionAndRotation(val.transform.position, val4); foreach (GameObject item in list) { item.transform.SetParent((Transform)null); } Object.Destroy((Object)(object)val); return list; } } public class DirectionalSequence { public Vec3 StartPosition { get; set; } = new Vec3(); public Vec3 Rotation { get; set; } = new Vec3(); public Vec3 ExtendDirection { get; set; } = new Vec3(); public float PlacementInterval { get; set; } = 6.4f; public int Count { get; set; } = 1; public List Generate(GameObject template) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0013: 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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //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_006c: Unknown result type (might be due to invalid IL or missing references) Vector3 val = StartPosition.ToVector3(); Quaternion val2 = Rotation.ToQuaternion(); Vector3 val3 = ExtendDirection.ToVector3(); Vector3 normalized = ((Vector3)(ref val3)).normalized; List list = new List(); for (int i = 0; i < Count; i++) { GameObject val4 = Object.Instantiate(template); val4.transform.SetPositionAndRotation(val, val2); val4.SetActiveRecursively(true); val += normalized * PlacementInterval; list.Add(val4); } return list; } } } namespace LEGACY.LegacyOverride.DummyVisual.VisualGOAnimation { public class VisualAnimationConfig { public DirectionalConfig Directional { get; set; } = new DirectionalConfig(); public BlinkConfig Blink { get; set; } = new BlinkConfig(); } public enum VisualAnimationType { OFF, ON, DIRECTIONAL, REVERSE_DIRECTIONAL, BLINK } } namespace LEGACY.LegacyOverride.DummyVisual.VisualGOAnimation.AnimationComp_Deprecated { internal class BlinkAnimation : MonoBehaviour { internal GameObject VisualGO; internal float ShowHideTime = 0f; internal bool ShowCylinder = false; private float NextUpdateTime = float.PositiveInfinity; private bool PlayAnimation = false; private GameObject Cylinder { get { GameObject visualGO = VisualGO; return (visualGO != null) ? ((Component)visualGO.transform.GetChild(0).GetChild(0)).gameObject : null; } } private GameObject Zone { get { GameObject visualGO = VisualGO; return (visualGO != null) ? ((Component)visualGO.transform.GetChild(0).GetChild(1)).gameObject : null; } } private GameObject Text { get { GameObject visualGO = VisualGO; return (visualGO != null) ? ((Component)visualGO.transform.GetChild(0).GetChild(2)).gameObject : null; } } internal void SetPlayAnimation(bool play) { PlayAnimation = play; if (play) { NextUpdateTime = Clock.Time + ShowHideTime; } else { NextUpdateTime = float.PositiveInfinity; } } private void Update() { if (!((Object)(object)VisualGO == (Object)null) && PlayAnimation && !(Clock.Time < NextUpdateTime)) { bool active = Zone.active; Zone.SetActive(!active); if (ShowCylinder) { Cylinder.SetActive(!active); } else { Cylinder.SetActive(false); } Text.SetActive(!active); NextUpdateTime = Clock.Time + ShowHideTime; } } private void OnDestroy() { VisualGO = null; } static BlinkAnimation() { ClassInjector.RegisterTypeInIl2Cpp(); } } internal class DirectionalAnimation : MonoBehaviour { internal GameObject VisualGO; internal float InitialDelay = 0f; internal float ShowHideTime = 0f; internal bool ShowCylinder = false; private float NextUpdateTime = float.PositiveInfinity; private bool PlayAnimation = false; private GameObject Cylinder { get { GameObject visualGO = VisualGO; return (visualGO != null) ? ((Component)visualGO.transform.GetChild(0).GetChild(0)).gameObject : null; } } private GameObject Zone { get { GameObject visualGO = VisualGO; return (visualGO != null) ? ((Component)visualGO.transform.GetChild(0).GetChild(1)).gameObject : null; } } private GameObject Text { get { GameObject visualGO = VisualGO; return (visualGO != null) ? ((Component)visualGO.transform.GetChild(0).GetChild(2)).gameObject : null; } } internal void SetPlayAnimation(bool play) { PlayAnimation = play; if (play) { NextUpdateTime = Clock.Time + InitialDelay; } else { NextUpdateTime = float.PositiveInfinity; } } private void Update() { if (!((Object)(object)VisualGO == (Object)null) && PlayAnimation && !(Clock.Time < NextUpdateTime)) { bool active = Zone.active; Zone.SetActive(!active); if (ShowCylinder) { Cylinder.SetActive(!active); } else { Cylinder.SetActive(false); } Text.SetActive(!active); NextUpdateTime = Clock.Time + ShowHideTime; } } private void OnDestroy() { VisualGO = null; } static DirectionalAnimation() { ClassInjector.RegisterTypeInIl2Cpp(); } } } namespace LEGACY.LegacyOverride.DummyVisual.VisualGOAnimation.AnimationConfig { public class BlinkConfig { public float ShowHideTime { get; set; } = 0.25f; } public class DirectionalConfig { public int WindowSize { get; set; } = 4; public int WindowInterval { get; set; } = 2; public float UpdateInterval { get; set; } = 0.125f; } } namespace LEGACY.ExtraEvents { internal static class LegacyExtraEvents { private class MyTextDatablock { public bool SkipLocalization { get; set; } = false; public bool MachineTranslation { get; set; } = false; public string English { get; set; } = string.Empty; public string Description { get; set; } = string.Empty; public int CharacterMetaData { get; set; } = 5; public int ExportVersion { get; set; } = 1; public int ImportVersion { get; set; } = 1; public string name { get; set; } = string.Empty; public bool internalEnabled { get; set; } = true; public string persistentID { get; set; } = string.Empty; public string datablock { get; set; } = "Text"; } internal enum EventType { CloseSecurityDoor_Custom = 100, SetTimerTitle = 102, AlertEnemiesInZone = 107, AlertEnemiesInArea = 108, Terminal_ShowTerminalInfoInZone = 130, Terminal_ToggleState = 131, KillEnemiesInArea = 140, KillEnemiesInZone = 141, KillEnemiesInDimension = 142, PlayGCEndSequence = 180, ChainedPuzzle_AddReqItem = 200, ChainedPuzzle_RemoveReqItem = 201, SpawnHibernate = 170, Info_ZoneHibernate = 250, Info_LevelHibernate = 251, Output_LevelHibernateSpawnEvent = 252, TP_WarpTeams = 160, TP_WarpPlayersInRange = 161, TP_WarpItemsInZone = 162, FF_ToggleFFCheck = 210, FF_AddPlayersInRangeToCheck = 211, FF_AddPlayersOutOfRangeToCheck = 212, FF_ToggleCheckOnGroup = 213, FF_Reset = 214, FF_ResetGroup = 215, FF_SetExpeditionFailedText = 216, FF_ResetExpeditionFailedText = 217, SetNavMarker = 220, ToggleDummyVisual = 221, ToggleLSFBState = 222, SaveCheckpoint = 223, SetSuccessPageCustomization = 224, ToggleCamaraShake = 225, PlayMusic = 260, StopMusic = 261, ToggleEventScanState = 270, ToggleSeamlessReload = 280 } [CompilerGenerated] private sealed class d__16 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public WardenObjectiveEventData e; public float currentDuration; private uint 5__1; private int 5__2; private CarryItemPickup_Core 5__3; private CP_Bioscan_Core 5__4; private CP_Cluster_Core 5__5; private float 5__6; private string 5__7; private float 5__8; private CP_PlayerScanner 5__9; private float 5__10; private float 5__11; private iWardenObjectiveItem[] 5__12; private string 5__13; private IEnumerator <>s__14; private iChainedPuzzleCore 5__15; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__16(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__3 = null; 5__4 = null; 5__5 = null; 5__7 = null; 5__9 = null; 5__12 = null; 5__13 = null; <>s__14 = null; 5__15 = null; <>1__state = -2; } private bool MoveNext() { //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_045d: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Expected O, but got Unknown //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Expected O, but got Unknown //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Expected O, but got Unknown //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_0446: Expected O, but got Unknown //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = e.ChainPuzzle; 5__2 = e.Count; 5__3 = PuzzleReqItemManager.Current.GetBigPickupItem(5__2); if ((Object)(object)5__3 == (Object)null) { LegacyLogger.Error($"AddReqItem: Cannot find BigPickup Item with index {5__2}"); return false; } 5__4 = PuzzleOverrideManager.Current.GetBioscanCore(5__1); 5__5 = PuzzleOverrideManager.Current.GetClusterCore(5__1); if ((Object)(object)5__4 != (Object)null) { 5__6 = Mathf.Max(e.Delay - currentDuration, 0f); if (5__6 > 0f) { <>2__current = (object)new WaitForSeconds(5__6); <>1__state = 1; return true; } goto IL_014f; } if ((Object)(object)5__5 != (Object)null) { 5__11 = Mathf.Max(e.Delay - currentDuration, 0f); if (5__11 > 0f) { <>2__current = (object)new WaitForSeconds(5__11); <>1__state = 3; return true; } goto IL_0457; } LegacyLogger.Error($"AddReqItem: cannot find puzzle core with index {5__1}"); return false; case 1: <>1__state = -1; goto IL_014f; case 2: <>1__state = -1; goto IL_0331; case 3: { <>1__state = -1; goto IL_0457; } IL_0457: WardenObjectiveManager.DisplayWardenIntel(e.Layer, e.WardenIntel); if (e.DialogueID != 0) { PlayerDialogManager.WantToStartDialog(e.DialogueID, -1, false, false); } if (e.SoundID != 0) { WardenObjectiveManager.Current.m_sound.Post(e.SoundID, true); 5__13 = ((Object)e.SoundSubtitle).ToString(); if (!string.IsNullOrWhiteSpace(5__13)) { GuiManager.PlayerLayer.ShowMultiLineSubtitle(5__13); } 5__13 = null; } 5__12 = (iWardenObjectiveItem[])(object)new iWardenObjectiveItem[1] { new iWardenObjectiveItem(((Il2CppObjectBase)5__3).Pointer) }; <>s__14 = ((Il2CppArrayBase)(object)5__5.m_childCores).GetEnumerator(); try { while (<>s__14.MoveNext()) { 5__15 = <>s__14.Current; 5__15.AddRequiredItems(Il2CppReferenceArray.op_Implicit(5__12)); 5__15 = null; } } finally { if (<>s__14 != null) { <>s__14.Dispose(); } } <>s__14 = null; LegacyLogger.Debug($"AddReqItem: puzzle override index: {5__1}"); LegacyLogger.Debug("Item name: " + ((Item)5__3).ItemDataBlock.publicName); 5__12 = null; break; IL_0331: if (5__9.m_scanProgression < e.Duration) { <>2__current = (object)new WaitForSeconds(5__10); <>1__state = 2; return true; } goto IL_035f; IL_035f: 5__9 = null; goto IL_0367; IL_014f: WardenObjectiveManager.DisplayWardenIntel(e.Layer, e.WardenIntel); if (e.DialogueID != 0) { PlayerDialogManager.WantToStartDialog(e.DialogueID, -1, false, false); } if (e.SoundID != 0) { WardenObjectiveManager.Current.m_sound.Post(e.SoundID, true); 5__7 = ((Object)e.SoundSubtitle).ToString(); if (!string.IsNullOrWhiteSpace(5__7)) { GuiManager.PlayerLayer.ShowMultiLineSubtitle(5__7); } 5__7 = null; } if ((double)e.Duration > 0.0 && (double)e.Duration < 1.0) { 5__8 = e.Duration; 5__9 = ((Il2CppObjectBase)5__4.m_playerScanner).TryCast(); if ((Object)(object)5__9 != (Object)null) { 5__10 = (((double)e.FogTransitionDuration > 0.0) ? e.FogTransitionDuration : 0.5f); LegacyLogger.Debug($"AddReqItem: item would be added on scan progression: {5__8}, progression check interval: {5__10} (seconds)"); goto IL_0331; } LegacyLogger.Error("AddReqItem: Failed to get scanner for the CP_Bioscan_Core"); goto IL_035f; } goto IL_0367; IL_0367: 5__4.AddRequiredItems(Il2CppReferenceArray.op_Implicit((iWardenObjectiveItem[])(object)new iWardenObjectiveItem[1] { new iWardenObjectiveItem(((Il2CppObjectBase)5__3).Pointer) })); LegacyLogger.Debug($"AddReqItem: puzzle override index: {5__1}"); LegacyLogger.Debug("Item name: " + ((Item)5__3).ItemDataBlock.publicName); break; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__20 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public WardenObjectiveEventData e; private float 5__1; private Color 5__2; private float