Decompiled source of Sector 11 v3.1.2

plugins/ExtraSettings.dll

Decompiled 4 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text.Json;
using AIGraph;
using AK;
using Agents;
using AssetShards;
using BepInEx;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using BepInEx.Unity.IL2CPP.UnityEngine;
using BepInEx.Unity.IL2CPP.Utils;
using CellMenu;
using ChainedPuzzles;
using Enemies;
using Expedition;
using ExtraSetting.Managers;
using ExtraSettings.ConfigFiles;
using ExtraSettings.GameScripts;
using ExtraSettings.Managers;
using ExtraSettings.Patches;
using ExtraSettings.PluginInfo;
using ExtraSettings.StructFiles;
using FX_EffectSystem;
using GTFO.API;
using GameData;
using Gear;
using HarmonyLib;
using Il2CppInterop.Runtime;
using Il2CppInterop.Runtime.Injection;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSystem;
using Il2CppSystem.Collections.Generic;
using LevelGeneration;
using Localization;
using MTFO.Managers;
using Player;
using ReactorLightsOff.GameScripts;
using ReactorLightsOff.Patches;
using SNetwork;
using TMPro;
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;
using UnityEngine.SceneManagement;
using UnityEngine.Video;

[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 = "")]
[assembly: AssemblyCompany("ExtraSettings")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ExtraSettings")]
[assembly: AssemblyTitle("ExtraSettings")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace ExtraSetting.StructFiles
{
	public static class OpenDoorEventSync
	{
		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct OpenDoorSycnEvent
		{
			public LG_SecurityDoor TargetedSecurityDoor;
		}
	}
}
namespace ExtraSetting.Managers
{
	public static class SyncingManager
	{
		public static List<TimedUnlockDoorsListCollection> TimedDoorsCollection = new List<TimedUnlockDoorsListCollection>();

		public static List<PortalCommandTerminalCollection> PortalTerminalCollection = new List<PortalCommandTerminalCollection>();

		public static List<LG_SecurityDoor_Locks> OpenDoorOnScanCompleteCollection = new List<LG_SecurityDoor_Locks>();

		public static List<HackSecurityDoorCollection> HackDoorCollection = new List<HackSecurityDoorCollection>();

		public static List<ReactorBackDoorListCollection> ReactorBackdoorTerminalsCollection = new List<ReactorBackDoorListCollection>();

		public static List<TerminalAlarmDoorListCollection> TerminalAlarmCollection = new List<TerminalAlarmDoorListCollection>();

		public static List<LightsOffObjectiveCollection> LightsOffObjectiveCollection = new List<LightsOffObjectiveCollection>();

		public static List<CorruptedReactorTerminalCollection> CorruptedReactorTerminalCollections = new List<CorruptedReactorTerminalCollection>();

		public static List<UplinkReactorTerminalCollection> uplinkReactorTerminalCollections = new List<UplinkReactorTerminalCollection>();

		public static List<TerminalLatePaswords> TerminalsNeedingPasswords = new List<TerminalLatePaswords>();

		public static void GetSyncedRandomNumber(ulong x, int MaxNumber)
		{
		}

		public static void SyncElevator(ulong x, PublicStructClass.ElevatorSync Packet)
		{
			GetBackToElevatorController.Current.OnClientReceived(x, Packet);
		}

		public static void SyncElevatorComplete(ulong x, PublicStructClass.DummyStruct Packet)
		{
			GetBackToElevatorController.Current.CompleteExpedition(x, Packet);
		}

		public static void SynElevatorCountdownTimer(ulong x, PublicStructClass.TimeSync Packet)
		{
			GetBackToElevatorController.Current.UpdateGUIClient(x, Packet);
		}

		public static void SpawnElevator(ulong x, PublicStructClass.DummyStruct Packet)
		{
			//IL_009e: 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_0072: Unknown result type (might be due to invalid IL or missing references)
			GetBackToElevatorController component = ((Component)ElevatorRide.Cage).gameObject.GetComponent<GetBackToElevatorController>();
			((Component)ElevatorRide.Cage).gameObject.SetActive(true);
			ElevatorRide.Cage.ActivateWinCondition();
			if (component.m_ConnectedData.IsForwardExtract)
			{
				((Component)ElevatorRide.Cage).gameObject.transform.position = component.m_ConnectedData.ElevatorPositionForForwardExtract;
				((Component)ElevatorRide.Cage).gameObject.transform.eulerAngles = component.m_ConnectedData.ElevatorRotationForForwardExtract;
			}
			else
			{
				((Component)ElevatorRide.Cage).gameObject.transform.position = new Vector3(0f, -0.3527f, 5.7345f);
			}
			ElevatorRide.Cage.m_animator.Play("ElevatorLanding_Dropoff");
			PluginSetup.logSource.LogDebug((object)"SPAWN ELEVATOR RECEIVED");
		}

		public static void ConvertAndTriggerEvent(WardenEventDataConfig ConfigSettings, WardenEventGenericWave WaveSettings)
		{
			//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_0022: 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_002f: 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_003c: 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_0049: 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_0061: 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_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: 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_00b9: 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_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: 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_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: 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_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Expected O, but got Unknown
			//IL_01ba: Expected O, but got Unknown
			//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_01f3: Expected O, but got Unknown
			WardenObjectiveEventData val = new WardenObjectiveEventData
			{
				WorldEventObjectFilter = ConfigSettings.WorldEventObjectFilter,
				Condition = ConfigSettings.Condition,
				Trigger = ConfigSettings.Trigger,
				Type = ConfigSettings.Type,
				DimensionIndex = ConfigSettings.DimensionIndex,
				Layer = ConfigSettings.Layer,
				LocalIndex = ConfigSettings.LocalIndex,
				CustomSubObjectiveHeader = LocalizedText.op_Implicit(ConfigSettings.CustomSubObjectiveHeader),
				CustomSubObjective = LocalizedText.op_Implicit(ConfigSettings.CustomSubObjective),
				Delay = ConfigSettings.Delay,
				Duration = ConfigSettings.Duration,
				ClearDimension = ConfigSettings.ClearDimension,
				SoundID = ConfigSettings.SoundID,
				SoundSubtitle = LocalizedText.op_Implicit(ConfigSettings.SoundSubtitle),
				DialogueID = ConfigSettings.DialogueID,
				FogSetting = ConfigSettings.FogSetting,
				FogTransitionDuration = ConfigSettings.FogTransitionDuration,
				EnemyID = ConfigSettings.EnemyID,
				Position = ConfigSettings.Position,
				Count = ConfigSettings.Count,
				Enabled = ConfigSettings.Enabled,
				ChainPuzzle = ConfigSettings.ChainPuzzle,
				UseStaticBioscanPoints = ConfigSettings.UseStaticBioscanPoints,
				TerminalCommand = ConfigSettings.TerminalCommand,
				TerminalCommandRule = ConfigSettings.TerminalCommandRule,
				EnemyWaveData = new GenericEnemyWaveData
				{
					WaveSettings = WaveSettings.WaveSettings,
					WavePopulation = WaveSettings.WavePopulation,
					AreaDistance = WaveSettings.AreaDistance,
					SpawnDelay = WaveSettings.SpawnDelay,
					TriggerAlarm = WaveSettings.TriggerAlarm,
					IntelMessage = LocalizedText.op_Implicit(WaveSettings.IntelMessage)
				}
			};
			if (ConfigSettings.WardenIntel != 0)
			{
				val.WardenIntel = LocalizedText.op_Implicit(ConfigSettings.WardenIntel);
			}
			else
			{
				val.WardenIntel = new LocalizedText
				{
					UntranslatedText = ConfigSettings.WardenIntelString
				};
			}
			WardenObjectiveManager.CheckAndExecuteEventsOnTrigger(val, (eWardenObjectiveEventTrigger)0, true, 0f);
		}

		public static string GetGameObjectPath(Transform transform)
		{
			string text = ((Object)transform).name;
			while ((Object)(object)transform.parent != (Object)null)
			{
				transform = transform.parent;
				text = ((Object)transform).name + "/" + text;
			}
			return text;
		}

		public static void SyncBoostersWithOthers(int CharacterIndex, int BoosterEffectModifier, float amount)
		{
			if ((Object)(object)PlayerManager.PlayerAgentsInLevel[CharacterIndex] != (Object)(object)PlayerManager.GetLocalPlayerAgent())
			{
				AgentModifierManager.AddModifierValue((Agent)(object)PlayerManager.PlayerAgentsInLevel[CharacterIndex], (AgentModifier)BoosterEffectModifier, amount, 0f);
				PluginSetup.logSource.LogDebug((object)$"Syncing Booster Effect with player agent: {PlayerManager.PlayerAgentsInLevel[CharacterIndex].PlayerName} || With effect: {(object)(AgentModifier)BoosterEffectModifier} || Amount: {amount} || Relative Percentage {AgentModifierManager.DecimalPercantageToTraitPercentage(amount)} ");
			}
		}

		public static void ReloadModdedContentOnCheckpointLoad()
		{
			Il2CppArrayBase<CustomFogSphereHandler> val = Object.FindObjectsOfType<CustomFogSphereHandler>();
			Il2CppArrayBase<RandomTerminalUplinkScript> val2 = Object.FindObjectsOfType<RandomTerminalUplinkScript>();
			if (val.Length > 0)
			{
				foreach (CustomFogSphereHandler item in val)
				{
					item.OnCheckPointReload();
				}
			}
			if (val2.Length > 0)
			{
				foreach (RandomTerminalUplinkScript item2 in val2)
				{
					item2.OnCheckPointReset();
				}
			}
			if (Object.op_Implicit((Object)(object)((Component)ElevatorRide.Cage).gameObject.GetComponent<GetBackToElevatorController>()))
			{
				((Component)ElevatorRide.Cage).gameObject.GetComponent<GetBackToElevatorController>().OnCheckPointReset();
			}
			if (TimedDoorsCollection.Count > 0)
			{
				for (int i = 0; i < TimedDoorsCollection.Count; i++)
				{
					((Component)TimedDoorsCollection[i].TimedUnlockDoorTerminal).gameObject.GetComponent<TimedDoorUnlock>().ResetOnCheckPoint(TimedDoorsCollection[i].TimedDoorTimer);
					PluginSetup.logSource.LogDebug((object)"Detected TimedDoor: Setting it back up again!");
				}
			}
			if (PortalTerminalCollection.Count > 0)
			{
				for (int j = 0; j < PortalTerminalCollection.Count; j++)
				{
					((Component)PortalTerminalCollection[j].CommandTerminal).gameObject.GetComponent<TerminalCommandTeleporter>().OnCheckPointReload();
					PluginSetup.logSource.LogDebug((object)"Detected PortalCommand: Setting it back up again!");
				}
			}
			if (HackDoorCollection.Count > 0)
			{
				for (int k = 0; k < HackDoorCollection.Count; k++)
				{
					((Component)HackDoorCollection[k].HackSecurityDoorLock.m_door).gameObject.GetComponent<HackSecurityDoorScript>().OnCheckPointReload();
					PluginSetup.logSource.LogDebug((object)"Detected a HackSecurityDoor: Setting it up again!");
				}
			}
			if (TerminalAlarmCollection.Count > 0)
			{
				for (int l = 0; l < TerminalAlarmCollection.Count; l++)
				{
					((Component)TerminalAlarmCollection[l].TerminalAlarmMainTerminal).gameObject.GetComponent<TerminalAlarm>().OnCheckPointReload();
					PluginSetup.logSource.LogDebug((object)"Detected a TerminalAlarm: Setting it up again!");
				}
			}
			if (LightsOffObjectiveCollection.Count > 0)
			{
				for (int m = 0; m < LightsOffObjectiveCollection.Count; m++)
				{
					((Component)LightsOffObjectiveCollection[m].LightsOffTerminal).gameObject.GetComponent<LightsOnTerminalScript>().OnCheckPointReset();
					PluginSetup.logSource.LogDebug((object)"Detected a LightsOffObjeciveTerminal: Setting it up again!");
				}
			}
			if (uplinkReactorTerminalCollections.Count > 0)
			{
				for (int n = 0; n < uplinkReactorTerminalCollections.Count; n++)
				{
					((Component)uplinkReactorTerminalCollections[n].UplinkTerminal).gameObject.GetComponent<UplinkTerminalReactorScript>().OnCheckPointReload();
					PluginSetup.logSource.LogDebug((object)"Detected a UplinkReactorTerminalEvent: Setting it up again!");
				}
			}
			if (CorruptedReactorTerminalCollections.Count > 0)
			{
				for (int num = 0; num < CorruptedReactorTerminalCollections.Count; num++)
				{
					((Component)CorruptedReactorTerminalCollections[num].CorruptedTerminal).gameObject.GetComponent<CorruptedTerminalDummyScript>().OnCheckPointLoaded();
					PluginSetup.logSource.LogDebug((object)"Detected a CorruptedReactorTerminalEvent: Setting it up again!");
				}
			}
		}

		public static void UnlockDoor(LG_SecurityDoor DoorToUnlock)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Invalid comparison between Unknown and I4
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Invalid comparison between Unknown and I4
			//IL_0033: 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)
			if ((int)DoorToUnlock.LastStatus != 10 || (int)DoorToUnlock.LastStatus != 16)
			{
				DoorToUnlock.m_sync.AttemptDoorInteraction((eDoorInteractionType)5, 0f, 0f, default(Vector3), (Agent)null);
			}
		}

		public static void OpenDoor(LG_SecurityDoor DoorToOpen)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Invalid comparison between Unknown and I4
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Invalid comparison between Unknown and I4
			//IL_0033: 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)
			if ((int)DoorToOpen.LastStatus != 10 || (int)DoorToOpen.LastStatus != 16)
			{
				DoorToOpen.m_sync.AttemptDoorInteraction((eDoorInteractionType)0, 0f, 0f, default(Vector3), (Agent)null);
			}
		}

		public static void IncreaseEnemyObjectiveCount(ulong x, EnemyCounterSync.EnemySync Packet)
		{
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Unknown result type (might be due to invalid IL or missing references)
			ES_Dead_CommonEnter_Postfix.NumberOfEnemiesKilled = Packet.CounterBeforeIncrease;
			ES_Dead_CommonEnter_Postfix.NumberOfEnemiesKilled++;
			if (HunterEnemyObjectiveSetup.HuntedEnemiesInfo[EnemyAgent_Setup_Postfix.HuntedEnemyIndexStatic].ShowWardenIntel)
			{
				GuiManager.PlayerLayer.m_wardenIntel.ShowSubObjectiveMessage("", $"<color=red>ENEMY KILLED: NUMBER KILLED: </color><color=orange>{ES_Dead_CommonEnter_Postfix.NumberOfEnemiesKilled}</color><color=red>: NUMBER OF KILLS NEEDED: </color><color=orange>{HunterEnemyObjectiveSetup.HuntedEnemiesInfo[EnemyAgent_Setup_Postfix.HuntedEnemyIndexStatic].numberOfKillsNeeded}</color>", false, 200f, 5f, (Action)null);
			}
			if (HunterEnemyObjectiveSetup.HuntedEnemiesInfo[EnemyAgent_Setup_Postfix.HuntedEnemyIndexStatic].showCustomProgressionMessage)
			{
				GuiManager.PlayerLayer.WardenObjectives.SetCustomSubText((Func<string>)(object)Object.op_Implicit("Hunting Objective"), (Func<string>)(object)Object.op_Implicit($"{HunterEnemyObjectiveSetup.HuntedEnemiesInfo[EnemyAgent_Setup_Postfix.HuntedEnemyIndexStatic].ProgressionMessage}: <color=orange>{ES_Dead_CommonEnter_Postfix.NumberOfEnemiesKilled}</color>/{HunterEnemyObjectiveSetup.HuntedEnemiesInfo[EnemyAgent_Setup_Postfix.HuntedEnemyIndexStatic].numberOfKillsNeeded}"));
			}
			if (HunterEnemyObjectiveSetup.HuntedEnemiesInfo[EnemyAgent_Setup_Postfix.HuntedEnemyIndexStatic].UseEventsOnKills && HunterEnemyObjectiveSetup.HuntedEnemiesInfo[EnemyAgent_Setup_Postfix.HuntedEnemyIndexStatic].EventsOnKills.Count > 0)
			{
				for (int i = 0; i < HunterEnemyObjectiveSetup.HuntedEnemiesInfo[EnemyAgent_Setup_Postfix.HuntedEnemyIndexStatic].EventsOnKills.Count; i++)
				{
					if (ES_Dead_CommonEnter_Postfix.NumberOfEnemiesKilled != HunterEnemyObjectiveSetup.HuntedEnemiesInfo[EnemyAgent_Setup_Postfix.HuntedEnemyIndexStatic].EventsOnKills[i].KillRequirement)
					{
						continue;
					}
					foreach (WardenEventDataConfig item in HunterEnemyObjectiveSetup.HuntedEnemiesInfo[EnemyAgent_Setup_Postfix.HuntedEnemyIndexStatic].EventsOnKills[i].EventsInfo)
					{
						ConvertAndTriggerEvent(item, item.EnemyWaveData);
					}
				}
			}
			if (ES_Dead_CommonEnter_Postfix.NumberOfEnemiesKilled >= HunterEnemyObjectiveSetup.HuntedEnemiesInfo[EnemyAgent_Setup_Postfix.HuntedEnemyIndexStatic].numberOfKillsNeeded && HunterEnemyObjectiveSetup.HuntedEnemiesInfo[EnemyAgent_Setup_Postfix.HuntedEnemyIndexStatic].CompleteObjective)
			{
				pWardenObjectiveInteraction val = default(pWardenObjectiveInteraction);
				val.type = (eWardenObjectiveInteractionType)2;
				val.inLayer = (LG_LayerType)(byte)Packet.LG_Layer;
				pWardenObjectiveInteraction val2 = val;
				WardenObjectiveManager.Current.AttemptInteract(val2);
			}
			PluginSetup.logSource.LogDebug((object)$"SYNCINGMANAGER: IncreaseEnemyObjectiveCount: NumberKilled: {ES_Dead_CommonEnter_Postfix.NumberOfEnemiesKilled}");
		}

		public static void IncreaseTerminalPowerZoneIndex(ulong x, PublicStructClass.LightsOnTerminalObjectiveStruct Packet)
		{
			//IL_011e: 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_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			if (CustomLightsOnObjectiveConfigSetup.LightsOnInfo[Builder_BuildDone_Postfix.LightsOffStaticIndex].IsObjective)
			{
				Builder_BuildDone_Postfix.NumberOfLightsOffObjective++;
				GuiManager.PlayerLayer.m_wardenIntel.ShowSubObjectiveMessage("", $"<color=red>ZONE REPAIRED! NUMBER OF ZONES REPAIRED: </color><color=orange>{Builder_BuildDone_Postfix.NumberOfLightsOffObjective}</color>/<color=orange>{CustomLightsOnObjectiveConfigSetup.LightsOnInfo[Builder_BuildDone_Postfix.LightsOffStaticIndex].ObjectiveAmountNeeded}</color>", false, 200f, 5f, (Action)null);
				if (CustomLightsOnObjectiveConfigSetup.LightsOnInfo[Builder_BuildDone_Postfix.LightsOffStaticIndex].HaveCustomProgressionMessage)
				{
					GuiManager.PlayerLayer.WardenObjectives.SetCustomSubText((Func<string>)(object)Object.op_Implicit(""), (Func<string>)(object)Object.op_Implicit($"{CustomLightsOnObjectiveConfigSetup.LightsOnInfo[Builder_BuildDone_Postfix.LightsOffStaticIndex].CustomProgressionMessage} <color=orange>{Builder_BuildDone_Postfix.NumberOfLightsOffObjective}</color> / <color=orange>{CustomLightsOnObjectiveConfigSetup.LightsOnInfo[Builder_BuildDone_Postfix.LightsOffStaticIndex].ObjectiveAmountNeeded}</color>"));
				}
				if (Builder_BuildDone_Postfix.NumberOfLightsOffObjective >= CustomLightsOnObjectiveConfigSetup.LightsOnInfo[Builder_BuildDone_Postfix.LightsOffStaticIndex].ObjectiveAmountNeeded)
				{
					pWardenObjectiveInteraction val = default(pWardenObjectiveInteraction);
					val.type = (eWardenObjectiveInteractionType)2;
					val.inLayer = (LG_LayerType)(byte)Packet.TargetedLayer;
					pWardenObjectiveInteraction val2 = val;
					WardenObjectiveManager.Current.AttemptInteract(val2);
				}
				PluginSetup.logSource.LogDebug((object)"SYNCINGMANAGER: INCREASELIGHTSONTERMINALOBJECTIVE");
			}
			else
			{
				PluginSetup.logSource.LogWarning((object)"WARNING: SYNCINGMANAGER INCREASELIGHTSONTERMINALOBJECTIVE HAS BEEN CALLED BUT IS NOT COUNTED! IS THIS INTENTIONAL? IF NOT, SET 'IsObjective' TO TRUE");
			}
		}

		public static void RandomTerminalSync(ulong x, PublicStructClass.RandomTerminalAlarmSync Packet)
		{
			LG_Zone val = default(LG_Zone);
			Builder.CurrentFloor.TryGetZoneByLocalIndex((eDimensionIndex)Packet.TerminalDimension, (LG_LayerType)(byte)Packet.TerminalLayerType, (eLocalZoneIndex)Packet.TerminalZoneIndex, ref val);
			LG_Zone val2 = default(LG_Zone);
			Builder.CurrentFloor.TryGetZoneByLocalIndex((eDimensionIndex)Packet.VerificationTerminalDimension, (LG_LayerType)(byte)Packet.VerificationTerminalLayerType, (eLocalZoneIndex)Packet.TerminalZoneIndex, ref val2);
			LG_Zone val3 = default(LG_Zone);
			Builder.CurrentFloor.TryGetZoneByLocalIndex((eDimensionIndex)Packet.DoorDimension, (LG_LayerType)(byte)Packet.DoorLayerType, (eLocalZoneIndex)Packet.DoorZoneIndex, ref val3);
			PluginSetup.logSource.LogDebug((object)"SYNCINGMANAGER: Syncing TerminalAlarm Selection");
		}

		public static void SyncTerminalOutput(ulong x, PublicStructClass.OutputSyncStruct Packet)
		{
			LG_Zone val = default(LG_Zone);
			Builder.CurrentFloor.TryGetZoneByLocalIndex((eDimensionIndex)Packet.TerminalDimension, (LG_LayerType)(byte)Packet.TerminalLayer, (eLocalZoneIndex)Packet.TerminalZoneIndex, ref val);
			if (Object.op_Implicit((Object)(object)((Component)val.TerminalsSpawnedInZone[Packet.TerminalIndex]).gameObject.GetComponent<TerminalAlarm>()) && Packet.isTerminalAlarm)
			{
				((Component)val.TerminalsSpawnedInZone[Packet.TerminalIndex]).gameObject.GetComponent<TerminalAlarm>().SyncOutput();
			}
			if (Object.op_Implicit((Object)(object)((Component)val.TerminalsSpawnedInZone[Packet.TerminalIndex]).gameObject.GetComponent<TimedDoorUnlock>()) && Packet.isTimedDoorUnlock)
			{
				((Component)val.TerminalsSpawnedInZone[Packet.TerminalIndex]).gameObject.GetComponent<TimedDoorUnlock>().SyncOutput();
			}
			if (Object.op_Implicit((Object)(object)((Component)val.TerminalsSpawnedInZone[Packet.TerminalIndex]).gameObject.GetComponent<LightsOnTerminalScript>()) && Packet.isLightsOnObjective)
			{
				if (Packet.isVerificationOutput)
				{
					((Component)val.TerminalsSpawnedInZone[Packet.TerminalIndex]).gameObject.GetComponent<LightsOnTerminalScript>().SyncVerifyOutput();
				}
				else
				{
					((Component)val.TerminalsSpawnedInZone[Packet.TerminalIndex]).gameObject.GetComponent<LightsOnTerminalScript>().SyncOutput();
				}
			}
		}
	}
}
namespace ReactorLightsOff.Patches
{
	public static class GameStateManager_Update_Postfix
	{
		public static List<SNet_Player> PlayersInLobby = new List<SNet_Player>();

		[HarmonyPatch(typeof(GameStateManager), "Update")]
		public static void Postfix()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Invalid comparison between Unknown and I4
			if ((int)GameStateManager.CurrentStateName == 5)
			{
				if (PlayersInLobby.Count > 0)
				{
					PlayersInLobby.Clear();
					PluginSetup.logSource.LogDebug((object)$"Removing players | Count: {PlayersInLobby.Count}");
				}
				LG_SecurityDoor_Locks_SetupForChainedPuzzle_Postfix.HackDoorOpenActive = false;
				LG_SecurityDoor_Locks_SetupForChainedPuzzle_Postfix.OpenDoorOnScanComplete = false;
				LG_DimensionPortal_Setup_Postfix.CanAddTerminal = false;
				Builder_BuildDone_Postfix.TimedUnlockActive = false;
				GS_InLevel_Enter_Postfix.IntervalActive = false;
				LG_PowerGenerator_Core_Setup_Postfix.ReactorActive = false;
				LG_WardenObjective_OnBuildDone_Postfix.ShowTimer = false;
				LG_WardenObjective_OnBuildDone_Postfix.StartMalfunction = false;
				LG_WardenObjective_OnBuildDone_Postfix.CreateLightCollection = false;
				Builder_Build_Postfix.MovableScansActive = false;
				Builder_Build_Postfix.RandomizedScansActive = false;
				Builder_Build_Postfix.TerminalAlarmActive = false;
				Builder_Build_Postfix.CustomReactorPlacementActive = false;
				Builder_BuildDone_Postfix.TemperatureZoneActive = false;
				LG_SecurityDoor_Locks_SetupForChainedPuzzle_Postfix.ChangeExtractionScan = false;
				MWS_Charge_Enter_Postfix.MeleeSlowedDown = false;
				BulletWeapon_Update_Postfix.ReloadSlowedDown = false;
				ResetManager.HasCheckpointBeenCalledGlobal = false;
				Builder_BuildDone_Postfix.LightsOffObjectiveActive = false;
				LG_PopulateFunctionMarkersInZoneJob_TriggerFunctionBuilder_Postfix.IsFirstTime = true;
				Builder_Build_Postfix.CustomPrefabsActive = false;
				Builder_Build_Postfix.CustomReactorActive = false;
				Builder_Build_Postfix.RandomTerminalUplinksActive = false;
				LG_Distribute_WardenObjective_Build_Prefix.IsFirstTime = true;
				LG_PopulateFunctionMarkersInZoneJob_TriggerFunctionBuilder_Postfix.isFirstTimeHiding = true;
				LG_WardenObjective_OnBuildDone_Postfix.BackupMalfunctionTimer = 0f;
				ES_Dead_CommonEnter_Postfix.NumberOfEnemiesKilled = 0;
				EnemyAgent_Setup_Postfix.HuntedEnemyIndexStatic = 0;
				LG_WardenObjective_OnBuildDone_Postfix.ReactorIndexStatic = 0;
				LG_WardenObjective_Reactor_Update_Postfix.NumberOfGeneratorsDone = 0;
				LG_WardenObjective_Reactor_Update_Postfix.NumberOfTerminalsDone = 0;
				LG_WardenObjective_Reactor_Update_Postfix.ReactorWaveIndexStatic = 0;
				Builder_Build_Postfix.MovableScanIndexStatic = 0;
				Builder_Build_Postfix.RandomizedScansStaticIndex = 0;
				Builder_Build_Postfix.TerminalAlarmStaticIndex = 0;
				Builder_Build_Postfix.CustomReactorStaticIndex = 0;
				Builder_BuildDone_Postfix.TemperatureZoneStaticIndex = 0;
				LG_WardenObjective_Reactor_Update_Postfix.NumberOfTerminalGathersDone = 0;
				LG_WardenObjective_Reactor_Update_Postfix.ReactorWaveTerminalGatherIndexStatic = 0;
				LG_WardenObjective_Reactor_Update_Postfix.ReactorWaveCorruptedUplinkIndexStatic = 0;
				BulletWeapon_Update_Postfix.SavedMultiplierSlowDown = 0f;
				MWS_Charge_Enter_Postfix.SlowedDownMeleeMultiplier = 0f;
				LG_WardenObjective_Reactor_Update_Postfix.NumberOfCorruptedTerminalsDone = 0;
				Builder_BuildDone_Postfix.NumberOfLightsOffObjective = 0;
				Builder_BuildDone_Postfix.LightsOffStaticIndex = 0;
				ChainedPuzzleInstance_SetupMovement_Postfix.ScanCreationIndex = 0;
				LG_WardenObjective_Reactor_Update_Postfix.NumberOfHSUInsertsDone = 0;
				LG_WardenObjective_Reactor_Update_Postfix.ReactorHSUInstertStaticIndex = 0;
				Builder_Build_Postfix.CustomPrefabStaticIndex = 0;
				Builder_Build_Postfix.CustomDisinfectStationIndex = 0;
				Builder_Build_Postfix.CustomReactorIndex = 0;
				Builder_Build_Postfix.RandomTerminalUplinkIndex = 0;
				LG_SecurityDoor_Locks_SetupForChainedPuzzle_Postfix.NewExtractionScan = null;
				LG_SecurityDoor_Locks_SetupForChainedPuzzle_Postfix.NewExtractionMarker = null;
				if (SyncingManager.TerminalsNeedingPasswords.Count > 0)
				{
					SyncingManager.TerminalsNeedingPasswords.Clear();
				}
				if (EnemyAgent_Setup_Postfix.AllEnemies.Count > 0)
				{
					EnemyAgent_Setup_Postfix.AllEnemies.Clear();
				}
				if (LG_PowerGenerator_Core_Setup_Postfix.PowerGeneratorsInLevel.Count > 0)
				{
					LG_PowerGenerator_Core_Setup_Postfix.PowerGeneratorsInLevel.Clear();
				}
				if (SyncingManager.TimedDoorsCollection.Count > 0)
				{
					SyncingManager.TimedDoorsCollection.Clear();
				}
				if (SyncingManager.PortalTerminalCollection.Count > 0)
				{
					SyncingManager.PortalTerminalCollection.Clear();
				}
				if (SyncingManager.HackDoorCollection.Count > 0)
				{
					SyncingManager.HackDoorCollection.Clear();
				}
				if (SyncingManager.TerminalAlarmCollection.Count > 0)
				{
					SyncingManager.TerminalAlarmCollection.Clear();
				}
				if (SyncingManager.LightsOffObjectiveCollection.Count > 0)
				{
					SyncingManager.LightsOffObjectiveCollection.Clear();
				}
				if (SyncingManager.ReactorBackdoorTerminalsCollection.Count > 0)
				{
					SyncingManager.ReactorBackdoorTerminalsCollection.Clear();
				}
				if (SyncingManager.uplinkReactorTerminalCollections.Count > 0)
				{
					SyncingManager.uplinkReactorTerminalCollections.Clear();
				}
				if (SyncingManager.CorruptedReactorTerminalCollections.Count > 0)
				{
					SyncingManager.CorruptedReactorTerminalCollections.Clear();
				}
			}
		}
	}
	public static class LG_DimensionPortal_Setup_Postfix
	{
		public static int TerminalPortalIndexStatic;

		public static bool CanAddTerminal;

		[HarmonyPatch(typeof(LG_DimensionPortal), "Setup")]
		public static void Postfix(LG_DimensionPortal __instance)
		{
			//IL_007c: 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_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_029b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < TerminalPortalCommandConfigSetup.PortalInfo.Count; i++)
			{
				if (TerminalPortalCommandConfigSetup.PortalInfo[i].internalEnabled && TerminalPortalCommandConfigSetup.PortalInfo[i].LevelID == RundownManager.ActiveExpedition.LevelLayoutData)
				{
					TerminalPortalIndexStatic = i;
					CanAddTerminal = true;
				}
			}
			LG_Zone val = default(LG_Zone);
			for (int j = 0; j < TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo.Count; j++)
			{
				if (CanAddTerminal && __instance.SpawnNode.m_zone.LocalIndex == TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].PortalZoneIndex && __instance.SpawnNode.m_zone.Layer.m_type == TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].PortalLayerType && __instance.SpawnNode.m_dimension.DimensionIndex == TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].PortalDimensionIndex)
				{
					Builder.Current.m_currentFloor.TryGetZoneByLocalIndex(TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].TerminalDimensionIndex, TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].TerminalLayer, TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].TerminalZoneIndex, ref val);
					((Component)val.TerminalsSpawnedInZone[TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].TerminalIndex]).gameObject.AddComponent<TerminalCommandTeleporter>().Setup(__instance, val.TerminalsSpawnedInZone[TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].TerminalIndex], TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].TerminalCommand, TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].TerminalDescription, TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].ChainedPuzzleID, TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].AddTerminalCommand, TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].TargetedDimensionIndex, TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].TargetedDimensionZoneIndex);
				}
			}
			PluginSetup.logSource.LogDebug((object)$"Portal_{__instance.m_serialNumber} is being setup");
		}
	}
}
namespace ReactorLightsOff.GameScripts
{
	public class TerminalCommandTeleporter : MonoBehaviour
	{
		public LG_ComputerTerminal Terminal;

		public LG_DimensionPortal Portal;

		public List<WardenObjectiveEventData> WardenEvents;

		public ChainedPuzzleInstance chainedPuzzleToActivate;

		public ChainedPuzzleDataBlock ChainedPuzzleData;

		public bool IsFirstTime;

		public bool noChainedPuzzle;

		public bool HasBeenReset;

		public bool AddedTerminalCommand;

		public void Setup(LG_DimensionPortal ConnectedPortal, LG_ComputerTerminal ConnectedTerminal, string Command, string CommandDescription, uint ChainedPuzzleID, bool AddTerminalCommand, eDimensionIndex TargetedDimensionIndex = 1, eLocalZoneIndex TargetedDimensionZone = 0)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: 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_0042: 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_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Expected O, but got Unknown
			Portal = ConnectedPortal;
			Terminal = ConnectedTerminal;
			HasBeenReset = false;
			AddedTerminalCommand = AddTerminalCommand;
			Portal.m_targetDimension = TargetedDimensionIndex;
			Portal.m_targetZone = TargetedDimensionZone;
			if (!AddTerminalCommand)
			{
				return;
			}
			SyncingManager.PortalTerminalCollection.Add(new PortalCommandTerminalCollection
			{
				CommandChainedPuzzleID = ChainedPuzzleID,
				CommandPortal = ConnectedPortal,
				CommandTerminal = ConnectedTerminal,
				TerminalCommand = Command,
				TerminalCommandDescription = CommandDescription
			});
			PluginSetup.logSource.LogDebug((object)$"Adding to the PortalCommandCollection: Count: {SyncingManager.PortalTerminalCollection.Count}");
			if (ChainedPuzzleID != 0)
			{
				ChainedPuzzleData = GameDataBlockBase<ChainedPuzzleDataBlock>.GetBlock(ChainedPuzzleID);
				chainedPuzzleToActivate = ChainedPuzzleManager.CreatePuzzleInstance(ChainedPuzzleData, Terminal.SpawnNode.m_area, Terminal.m_wardenObjectiveSecurityScanAlign.position, ((Component)Terminal).transform);
				chainedPuzzleToActivate.OnPuzzleSolved += Action.op_Implicit((Action)delegate
				{
					//IL_0075: Unknown result type (might be due to invalid IL or missing references)
					//IL_007a: Unknown result type (might be due to invalid IL or missing references)
					//IL_008f: Unknown result type (might be due to invalid IL or missing references)
					//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
					GuiManager.PlayerLayer.m_wardenIntel.ShowSubObjectiveMessage("", $"<color=orange>PORTAL_{Portal.m_serialNumber}</color><color=red> IS STARTING UP IN </color><color=orange>ZONE_{Portal.SpawnNode.m_zone.NavInfo.Number}</color>", false, 200f, 4.5f, (Action)null);
					pDimensionPortalState state = Portal.m_stateReplicator.State;
					state.isSequenceIncomplete = false;
					Portal.m_targetDimension = TargetedDimensionIndex;
					Portal.m_targetZone = TargetedDimensionZone;
					Portal.PortalKeyInsertSequenceDone();
					Debug.Log(Object.op_Implicit("Starting portal insert sequence"));
				});
				noChainedPuzzle = false;
			}
			else if (ChainedPuzzleID == 0)
			{
				noChainedPuzzle = true;
			}
			Terminal.m_command.AddCommand((TERM_Command)42, Command, new LocalizedText
			{
				UntranslatedText = CommandDescription
			}, (TERM_CommandRule)0);
			IsFirstTime = true;
			Terminal.AddLine($"<color=yellow>MAINTENANCE TERMINAL FOR PORTAL_{Portal.m_serialNumber}</color>", true);
			Debug.LogError(Object.op_Implicit($"Setting up Terminal_{ConnectedTerminal.m_serialNumber}: Portal - {ConnectedPortal.PublicName}_{ConnectedPortal.m_serialNumber}: Command - {Command}: Command Description - {CommandDescription}: ChainedPuzzleID - {ChainedPuzzleID}: IsFirstTime - {IsFirstTime}: noChainedPuzzle - {noChainedPuzzle}"));
		}

		public void OnCheckPointReload()
		{
			IsFirstTime = true;
			HasBeenReset = true;
			PluginSetup.logSource.LogDebug((object)"ONCHECKPOINTRELOAD: PORTAL RESET:");
		}

		public void Update()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Invalid comparison between Unknown and I4
			if (HasBeenReset && (int)GameStateManager.CurrentStateName == 10 && AddedTerminalCommand)
			{
				Terminal.AddLine($"<color=yellow>PORTAL MAINTENANCE TERMINAL FOR PORTAL_{Portal.m_serialNumber}</color>", true);
				PluginSetup.logSource.LogDebug((object)"ONCHECKPOINTLOADED: PORTAL LATE SETUP");
				HasBeenReset = false;
			}
			if (!AddedTerminalCommand || !Terminal.CommandIsUsed((TERM_Command)42) || !Terminal.m_hasInteractingPlayer || !IsFirstTime)
			{
				return;
			}
			Terminal.m_command.AddOutput((TerminalLineType)4, "Processing Command...", 3.5f, (TerminalSoundType)0, (TerminalSoundType)0);
			if (!noChainedPuzzle)
			{
				Terminal.m_command.AddOutput((TerminalLineType)4, "<color=yellow>Biometric Scan Required</color>", 3.5f, (TerminalSoundType)0, (TerminalSoundType)0);
				Terminal.m_command.AddOutputEmptyLine(0f);
				Terminal.m_command.OnEndOfQueue = Action.op_Implicit((Action)delegate
				{
					chainedPuzzleToActivate.AttemptInteract((eChainedPuzzleInteraction)0);
					Debug.Log(Object.op_Implicit("Starting chainedpuzzle"));
				});
			}
			else if (noChainedPuzzle)
			{
				Terminal.m_command.AddOutput((TerminalLineType)4, "Preparing Portal For Startup", 3.5f, (TerminalSoundType)0, (TerminalSoundType)0);
				Terminal.m_command.AddOutputEmptyLine(0f);
				Terminal.m_command.OnEndOfQueue = Action.op_Implicit((Action)delegate
				{
					GuiManager.PlayerLayer.m_wardenIntel.ShowSubObjectiveMessage("", $"<color=yellow>PORTAL_{Portal.m_serialNumber}</color><color=red> IS STARTING UP IN </color><color=yellow>ZONE_{Portal.SpawnNode.m_zone.NavInfo.Number}</color>", false, 200f, 4.5f, (Action)null);
					Portal.PortalKeyInsertSequenceDone();
					Debug.Log(Object.op_Implicit("Starting portal insert sequence"));
				});
			}
			IsFirstTime = false;
		}
	}
}
namespace ExtraSettings.StructFiles
{
	public static class EnemyCounterSync
	{
		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct EnemySync
		{
			public int CounterBeforeIncrease;

			public int LG_Layer;
		}
	}
	public static class PublicStructClass
	{
		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct DoorChangeStruct
		{
			public int ChainedPuzzleID;

			public bool CheckPointChanged;

			public int CheckPointID;

			public int DoorZoneIndex;

			public int DoorLayerType;

			public int DoorDimensionIndex;
		}

		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct DummyStruct
		{
		}

		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct ElevatorSync
		{
			public bool TimerStarted;
		}

		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct SecurityTokenStruct
		{
			public int DoorZoneIndex;

			public int DoorLayer;

			public int DoorDimensionIndex;

			public int CurrentCount;

			public int CurrentLayout;

			public int CollectedOrbIndex;
		}

		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct CodeSyncTerminalAlarm
		{
			public string VerificationCode;
		}

		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct TimeSync
		{
			public float Time;

			public bool TimerActive;

			public int Minutes;

			public int Seconds;

			public bool KillAll;
		}

		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct BoosterSync
		{
			public int BoosterEffectModifierInt;

			public int CharacterIndex;

			public float BoosterEffectAmount;
		}

		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct RandomTerminalSyncReactor
		{
			public int TerminalIndex;
		}

		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct LightsOnTerminalObjectiveStruct
		{
			public int TargetedLayer;
		}

		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct SyncingNumber
		{
			public int SyncingNumberReturned;
		}

		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct OutputSyncStruct
		{
			public int TerminalZoneIndex;

			public int TerminalLayer;

			public int TerminalDimension;

			public int TerminalIndex;

			public bool isTerminalAlarm;

			public bool isTimedDoorUnlock;

			public bool isLightsOnObjective;

			public bool isVerificationOutput;
		}

		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct RandomTerminalAlarmSync
		{
			public int TerminalIndex;

			public int TerminalZoneIndex;

			public int TerminalLayerType;

			public int TerminalDimension;

			public int VerificationTerminalZoneIndex;

			public int VerificationTerminalLayerType;

			public int VerificationTerminalDimension;

			public int VerificationTerminalIndex;

			public int DoorZoneIndex;

			public int DoorLayerType;

			public int DoorDimension;

			public int LoopFirstIndex;

			public int LoopSecondIndex;
		}
	}
}
namespace ExtraSettings.PluginInfo
{
	[BepInPlugin("com.Breezy.ExtraSettings", "ExtraSettings", "1.0.0")]
	[BepInProcess("GTFO.exe")]
	public class PluginSetup : BasePlugin
	{
		public static bool m_RepairGeomorph = true;

		public static ManualLogSource logSource;

		public override void Load()
		{
			logSource = ((BasePlugin)this).Log;
			if (!Directory.Exists(Path.Combine(ConfigManager.CustomPath, "ExtraSettings")))
			{
				Directory.CreateDirectory(Path.Combine(ConfigManager.CustomPath, "ExtraSettings"));
			}
			HackDoorConfigSetup.Load();
			OpenDoorOnScanCompleteConfigSetup.Load();
			TerminalPortalCommandConfigSetup.Load();
			CustomReactorEventsConfigSetup.Load();
			EnemyPlayerHearBeatConfigSetup.Load();
			TimedUnlockDoorsConfigSetup.Load();
			HunterEnemyObjectiveSetup.Load();
			CustomMovableScanPositions.Load();
			RandomAlarmConfigSetup.Load();
			TerminalAlarmConfigSetup.Load();
			CustomReactorPlacementConfigSetup.Load();
			TemperatureZoneConfigSetup.Load();
			CustomLightsOnObjectiveConfigSetup.Load();
			CustomEnemySpawnPositionsConfigSetup.Load();
			TimedExpeditionConfigSetup.Load();
			CustomPrefabsConfigSetup.Load();
			RandomTerminalUplinksConfigSetup.Load();
			SpecializedCharactersConfigSetup.Load();
			ReactorInAnyZoneConfigSetup.Load();
			CustomGearConfigSetup.Load();
			CustomSpawnCapSetup.Load();
			CustomSpawnPointSetup.Load();
			CustomExtractionSetup.Load();
			TokenConfigSetup.Load();
			CustomPouncerDataSetup.Load();
			GetBackToElevatorConfigSetup.Load();
			OxygenEnvironmentSetup.Load();
			AssetShardManager.OnStartupAssetsLoaded += Action.op_Implicit((Action)delegate
			{
				RepairGeomorph(ignoreSetup: true, SetupGondola: false);
			});
			Harmony.CreateAndPatchAll(typeof(StartGame_Awake_Postfix), (string)null);
		}

		public static void RepairGeomorph(bool ignoreSetup, bool SetupGondola)
		{
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			if (m_RepairGeomorph && !ignoreSetup)
			{
				AssetShardManager.LoadShardAsync((AssetBundleName)3, (AssetBundleShard)18, (Action<AsyncOperation>)null, (LoadSceneMode)1);
				GameObject val = ((Il2CppObjectBase)AssetAPI.GetLoadedAsset("Assets/MyPrefabs/Geomorphs/ServiceGeos/Gardens_Hub_MC_01_Activator.prefab")).TryCast<GameObject>();
				logSource.LogError((object)((Object)val).name);
				Transform val2 = val.transform.FindChild("AreaA/EnvProps/ActivatorPlatform/ActivatorAlign");
				logSource.LogError((object)((Object)val2).name);
				string text = "DataExtractorDevice_DataSphere";
				LG_HSUActivator_Core[] array = ((IEnumerable<Object>)Object.FindObjectsOfTypeAll(Il2CppType.From(typeof(LG_HSUActivator_Core)))).Select((Object x) => ((Il2CppObjectBase)x).Cast<LG_HSUActivator_Core>()).ToArray();
				logSource.LogError((object)array.Length);
				LG_HSUActivator_Core[] array2 = array;
				foreach (LG_HSUActivator_Core val3 in array2)
				{
					if (((Object)val3).name == text)
					{
						LG_HSUActivator_Core val4 = Object.Instantiate<LG_HSUActivator_Core>(val3);
						((Component)val4).gameObject.transform.parent = val2;
						((Component)val4).gameObject.transform.position = val2.position;
						((Component)val4).gameObject.transform.eulerAngles = val2.eulerAngles;
						logSource.LogDebug((object)"Fixing Activator Geo");
					}
				}
				m_RepairGeomorph = false;
			}
			if (ignoreSetup)
			{
				AssetShardManager.LoadShardAsync((AssetBundleName)3, (AssetBundleShard)18, (Action<AsyncOperation>)null, (LoadSceneMode)1);
				logSource.LogError((object)"Ignoring setup, just loading shard!");
			}
			if (SetupGondola)
			{
				GameObject val5 = ((Il2CppObjectBase)AssetAPI.GetLoadedAsset("Assets/MyPrefabs/Geomorphs/TechGeomorphs/Tech_I_MC_Gondola.prefab")).TryCast<GameObject>();
				((Component)val5.transform.FindChild("Anim_Gondola/Gondola/Trigger")).gameObject.AddComponent<MovingPlatformScript>();
			}
		}

		public static void OnStartupAssetsLoad()
		{
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			string text = "assets/bundledassets/testbundle/introclip.mp4";
			logSource.LogError((object)LoadBNK(File.ReadAllBytes(ConfigManager.CustomPath + "\\HopeSound.bnk"), out var bnkID));
			logSource.LogError((object)bnkID);
			ClassInjector.RegisterTypeInIl2Cpp<AudioPlayerOnStartup>();
			MainMenuGuiLayer.Current.PageIntro.m_step = (CM_IntroStep)1;
			MainMenuGuiLayer.Current.PageIntro.m_bgScare1.clip = ((Il2CppObjectBase)AssetAPI.GetLoadedAsset(text)).TryCast<VideoClip>();
			((Component)MainMenuGuiLayer.Current.PageIntro.m_bgScare1).gameObject.active = true;
			((Component)MainMenuGuiLayer.Current.PageIntro.m_bgScare1).gameObject.transform.localPosition = new Vector3(0f, 0f, 0f);
			((Component)MainMenuGuiLayer.Current.PageIntro.m_bgScare1).transform.localScale = new Vector3(1.6f, 1.35f, 1f);
			MainMenuGuiLayer.Current.PageIntro.m_bgScare1.loopPointReached = PluginSetup.AddListener<EventHandler, Action<VideoPlayer>>(MainMenuGuiLayer.Current.PageIntro.m_bgScare1.loopPointReached, (Action<VideoPlayer>)onVideoEnd);
			MainMenuGuiLayer.Current.PageIntro.m_bgScare1.Play();
			((Component)MainMenuGuiLayer.Current.PageIntro.m_bgScare1).gameObject.AddComponent<AudioPlayerOnStartup>().StartAudio();
		}

		public static bool LoadBNK(byte[] bytes, out uint bnkID)
		{
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Invalid comparison between Unknown and I4
			try
			{
				uint num = (uint)bytes.Length;
				GCHandle gCHandle = GCHandle.Alloc(bytes, GCHandleType.Pinned);
				IntPtr intPtr = gCHandle.AddrOfPinnedObject();
				if ((intPtr.ToInt64() & 0xF) != 0)
				{
					byte[] array = new byte[(long)bytes.Length + 16L];
					IntPtr intPtr2 = GCHandle.Alloc(array, GCHandleType.Pinned).AddrOfPinnedObject();
					int destinationIndex = 0;
					if ((intPtr2.ToInt64() & 0xF) != 0)
					{
						long num2 = (intPtr2.ToInt64() + 15) & -16;
						destinationIndex = (int)(num2 - intPtr2.ToInt64());
						intPtr2 = new IntPtr(num2);
					}
					Array.Copy(bytes, 0, array, destinationIndex, bytes.Length);
					intPtr = intPtr2;
					gCHandle.Free();
				}
				return (int)AkSoundEngine.LoadBank(intPtr, num, ref bnkID) == 1;
			}
			catch (Exception)
			{
				bnkID = 0u;
				return false;
			}
		}

		public static void onVideoEnd(VideoPlayer player)
		{
			CM_PageBase.s_sound.Stop();
			((Component)player).gameObject.active = false;
			MainMenuGuiLayer.Current.PageIntro.OnSkip();
		}

		public static T1 AddListener<T1, T2>(T1 orig, T2 newDelegate) where T1 : Delegate where T2 : Delegate
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			return ((Delegate)(object)orig == (Delegate)null) ? DelegateSupport.ConvertDelegate<T1>((Delegate)newDelegate) : ((Il2CppObjectBase)Delegate.Combine((Delegate)(object)orig, (Delegate)DelegateSupport.ConvertDelegate<T1>((Delegate)newDelegate))).TryCast<T1>();
		}
	}
	public static class HackDoorConfigSetup
	{
		public static List<HackSecurityDoorConfig> SecurityInfo;

		public static string name { get; } = "HackSecurityDoor.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				SecurityInfo = JsonSerializer.Deserialize<List<HackSecurityDoorConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				SecurityInfo = new List<HackSecurityDoorConfig>();
				SecurityInfo.Add(new HackSecurityDoorConfig());
				string contents = JsonSerializer.Serialize(SecurityInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class OpenDoorOnScanCompleteConfigSetup
	{
		public static List<OpenDoorOnScanCompleteConfig> SecurityDoorInfo;

		public static string name { get; } = "OpenSecurityDoor.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				SecurityDoorInfo = JsonSerializer.Deserialize<List<OpenDoorOnScanCompleteConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				SecurityDoorInfo = new List<OpenDoorOnScanCompleteConfig>();
				SecurityDoorInfo.Add(new OpenDoorOnScanCompleteConfig());
				string contents = JsonSerializer.Serialize(SecurityDoorInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class TerminalPortalCommandConfigSetup
	{
		public static List<TerminalPortalConfigMain> PortalInfo;

		public static string name { get; } = "PortalTerminalCommand.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				PortalInfo = JsonSerializer.Deserialize<List<TerminalPortalConfigMain>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				PortalInfo = new List<TerminalPortalConfigMain>();
				PortalInfo.Add(new TerminalPortalConfigMain());
				string contents = JsonSerializer.Serialize(PortalInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class EnemyPlayerHearBeatConfigSetup
	{
		public static List<EnemyStaminaProximityConfig> EnemyInfo;

		public static string name { get; } = "EnemyProximity.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				EnemyInfo = JsonSerializer.Deserialize<List<EnemyStaminaProximityConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				EnemyInfo = new List<EnemyStaminaProximityConfig>();
				EnemyInfo.Add(new EnemyStaminaProximityConfig());
				string contents = JsonSerializer.Serialize(EnemyInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class TimedUnlockDoorsConfigSetup
	{
		public static List<TimedDoorUnlockConfig> TimedDoorsInfo;

		public static string name { get; } = "TimedUnlockDoors.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				TimedDoorsInfo = JsonSerializer.Deserialize<List<TimedDoorUnlockConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				TimedDoorsInfo = new List<TimedDoorUnlockConfig>();
				TimedDoorsInfo.Add(new TimedDoorUnlockConfig());
				string contents = JsonSerializer.Serialize(TimedDoorsInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class CustomReactorEventsConfigSetup
	{
		public static List<CustomReactorEventsConfig> ReactorInfo;

		public static string name { get; } = "ReactorEvents.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				ReactorInfo = JsonSerializer.Deserialize<List<CustomReactorEventsConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				ReactorInfo = new List<CustomReactorEventsConfig>();
				ReactorInfo.Add(new CustomReactorEventsConfig());
				string contents = JsonSerializer.Serialize(ReactorInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class HunterEnemyObjectiveSetup
	{
		public static List<HunterMainConfig> HuntedEnemiesInfo;

		public static string name { get; } = "HuntingEnemyObjective.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				HuntedEnemiesInfo = JsonSerializer.Deserialize<List<HunterMainConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				HuntedEnemiesInfo = new List<HunterMainConfig>();
				HuntedEnemiesInfo.Add(new HunterMainConfig());
				string contents = JsonSerializer.Serialize(HuntedEnemiesInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class CustomMovableScanPositions
	{
		public static List<CustomScanPositionsMainConfig> ChainedPuzzleInfo;

		public static string name { get; } = "MovableScans.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				ChainedPuzzleInfo = JsonSerializer.Deserialize<List<CustomScanPositionsMainConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				ChainedPuzzleInfo = new List<CustomScanPositionsMainConfig>();
				ChainedPuzzleInfo.Add(new CustomScanPositionsMainConfig());
				string contents = JsonSerializer.Serialize(ChainedPuzzleInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class CustomLightsOnObjectiveConfigSetup
	{
		public static List<LightsOnObjectiveMainConfig> LightsOnInfo;

		public static string name { get; } = "PowerAllZones.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				LightsOnInfo = JsonSerializer.Deserialize<List<LightsOnObjectiveMainConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				LightsOnInfo = new List<LightsOnObjectiveMainConfig>();
				LightsOnInfo.Add(new LightsOnObjectiveMainConfig());
				string contents = JsonSerializer.Serialize(LightsOnInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class RandomAlarmConfigSetup
	{
		public static List<RandomAlarmMainConfig> RandomizedDoorsInfo;

		public static string name { get; } = "RandomChainedPuzzles.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				RandomizedDoorsInfo = JsonSerializer.Deserialize<List<RandomAlarmMainConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				RandomizedDoorsInfo = new List<RandomAlarmMainConfig>();
				RandomizedDoorsInfo.Add(new RandomAlarmMainConfig());
				string contents = JsonSerializer.Serialize(RandomizedDoorsInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class TerminalAlarmConfigSetup
	{
		public static List<TerminalAlarmMainConfig> TerminalAlarmsInfo;

		public static string name { get; } = "TerminalAlarm.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				TerminalAlarmsInfo = JsonSerializer.Deserialize<List<TerminalAlarmMainConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				TerminalAlarmsInfo = new List<TerminalAlarmMainConfig>();
				TerminalAlarmsInfo.Add(new TerminalAlarmMainConfig());
				string contents = JsonSerializer.Serialize(TerminalAlarmsInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class CustomReactorPlacementConfigSetup
	{
		public static List<CustomReactorsMainConfig> CustomReactorInfo;

		public static string name { get; } = "ReactorPlacements.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				CustomReactorInfo = JsonSerializer.Deserialize<List<CustomReactorsMainConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				CustomReactorInfo = new List<CustomReactorsMainConfig>();
				CustomReactorInfo.Add(new CustomReactorsMainConfig());
				string contents = JsonSerializer.Serialize(CustomReactorInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class TemperatureZoneConfigSetup
	{
		public static List<TemperatureZoneMainConfig> TemperatureInfo;

		public static string name { get; } = "Temperature.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				TemperatureInfo = JsonSerializer.Deserialize<List<TemperatureZoneMainConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				TemperatureInfo = new List<TemperatureZoneMainConfig>();
				TemperatureInfo.Add(new TemperatureZoneMainConfig());
				string contents = JsonSerializer.Serialize(TemperatureInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class CustomEnemySpawnPositionsConfigSetup
	{
		public static List<CustomEnemySpawnPositionsMain> EnemySpawnPositions;

		public static string name { get; } = "CustomEnemySpawns.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				EnemySpawnPositions = JsonSerializer.Deserialize<List<CustomEnemySpawnPositionsMain>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				EnemySpawnPositions = new List<CustomEnemySpawnPositionsMain>();
				EnemySpawnPositions.Add(new CustomEnemySpawnPositionsMain());
				string contents = JsonSerializer.Serialize(EnemySpawnPositions, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class TimedExpeditionConfigSetup
	{
		public static List<TimedExpeditionMainConfig> TimerSettingsMain;

		public static string name { get; } = "TimedExpeditions.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				TimerSettingsMain = JsonSerializer.Deserialize<List<TimedExpeditionMainConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				TimerSettingsMain = new List<TimedExpeditionMainConfig>();
				TimerSettingsMain.Add(new TimedExpeditionMainConfig());
				string contents = JsonSerializer.Serialize(TimerSettingsMain, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class CustomPrefabsConfigSetup
	{
		public static List<CustomPrefabConfigMain> CustomPrefabInfo;

		public static string name { get; } = "CustomPrefabs.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				CustomPrefabInfo = JsonSerializer.Deserialize<List<CustomPrefabConfigMain>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				CustomPrefabInfo = new List<CustomPrefabConfigMain>();
				CustomPrefabInfo.Add(new CustomPrefabConfigMain());
				string contents = JsonSerializer.Serialize(CustomPrefabInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class RandomTerminalUplinksConfigSetup
	{
		public static List<RandomTerminalUplinksMainConfig> TerminalUplinksInfo;

		public static string name { get; } = "RandomUplinks.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				TerminalUplinksInfo = JsonSerializer.Deserialize<List<RandomTerminalUplinksMainConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				TerminalUplinksInfo = new List<RandomTerminalUplinksMainConfig>();
				TerminalUplinksInfo.Add(new RandomTerminalUplinksMainConfig());
				string contents = JsonSerializer.Serialize(TerminalUplinksInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class SpecializedCharactersConfigSetup
	{
		public static List<SpecializedCharacters> CharacterInfos;

		public static string name { get; } = "SpecializedCharacters.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				CharacterInfos = JsonSerializer.Deserialize<List<SpecializedCharacters>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
		}
	}
	public static class ReactorInAnyZoneConfigSetup
	{
		public static List<ReactorCustomZone> CustomReactors;

		public static string name { get; } = "ReactorAnyZone.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				CustomReactors = JsonSerializer.Deserialize<List<ReactorCustomZone>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				CustomReactors = new List<ReactorCustomZone>();
				CustomReactors.Add(new ReactorCustomZone());
				string contents = JsonSerializer.Serialize(CustomReactors, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class CustomGearConfigSetup
	{
		public static List<PublicGearModifier> GearInfos;

		public static string name { get; } = "CustomGear.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				GearInfos = JsonSerializer.Deserialize<List<PublicGearModifier>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				GearInfos = new List<PublicGearModifier>();
				GearInfos.Add(new PublicGearModifier());
				string contents = JsonSerializer.Serialize(GearInfos, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class CustomSpawnCapSetup
	{
		public static List<CustomEnemySpawnCap> SpawnCapInfo;

		public static string name { get; } = "EnemyCost.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				SpawnCapInfo = JsonSerializer.Deserialize<List<CustomEnemySpawnCap>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				SpawnCapInfo = new List<CustomEnemySpawnCap>();
				SpawnCapInfo.Add(new CustomEnemySpawnCap());
				string contents = JsonSerializer.Serialize(SpawnCapInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class CustomSpawnPointSetup
	{
		public static List<CharacterSpawnPointMain> CharacterSpawnInfos;

		public static string name { get; } = "CustomSpawnPoints.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				CharacterSpawnInfos = JsonSerializer.Deserialize<List<CharacterSpawnPointMain>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				CharacterSpawnInfos = new List<CharacterSpawnPointMain>();
				CharacterSpawnInfos.Add(new CharacterSpawnPointMain());
				string contents = JsonSerializer.Serialize(CharacterSpawnInfos, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class CustomExtractionSetup
	{
		public static List<ExitSpawnPointOverride> ExtractionPoints;

		public static string name { get; } = "ExtractionPoint.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				ExtractionPoints = JsonSerializer.Deserialize<List<ExitSpawnPointOverride>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				ExtractionPoints = new List<ExitSpawnPointOverride>();
				ExtractionPoints.Add(new ExitSpawnPointOverride());
				string contents = JsonSerializer.Serialize(ExtractionPoints, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class TokenConfigSetup
	{
		public static List<TriggersTokensMain> TokenInfos;

		public static string name { get; } = "ExtraSecurityScans.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				TokenInfos = JsonSerializer.Deserialize<List<TriggersTokensMain>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				TokenInfos = new List<TriggersTokensMain>();
				TokenInfos.Add(new TriggersTokensMain());
				string contents = JsonSerializer.Serialize(TokenInfos, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class CustomPouncerDataSetup
	{
		public static List<PouncerConfigData> PouncerInfos;

		public static string name { get; } = "PouncerCustom.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				PouncerInfos = JsonSerializer.Deserialize<List<PouncerConfigData>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
		}
	}
	public static class GetBackToElevatorConfigSetup
	{
		public static List<BackToElevatorMainConfig> ElevatorInfos;

		public static string name { get; } = "Elevator.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				ElevatorInfos = JsonSerializer.Deserialize<List<BackToElevatorMainConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
		}
	}
	public static class OxygenEnvironmentSetup
	{
		public static List<OxygenConfigMain> OxygenSettings;

		public static string name { get; } = "Oxygen.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				OxygenSettings = JsonSerializer.Deserialize<List<OxygenConfigMain>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
		}
	}
	public static class StartGame_Awake_Postfix
	{
		public static Dictionary<string, Shader> ShaderDictionary = new Dictionary<string, Shader>();

		public static Dictionary<uint, PouncerDataContainer> PouncerDataDictionary = new Dictionary<uint, PouncerDataContainer>();

		public static void FindPouncerData()
		{
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_01db: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_026d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0277: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_033f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0349: Unknown result type (might be due to invalid IL or missing references)
			//IL_034e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0493: Unknown result type (might be due to invalid IL or missing references)
			foreach (EnemyDataBlock allBlock in GameDataBlockBase<EnemyDataBlock>.GetAllBlocks())
			{
				if (CustomPouncerDataSetup.PouncerInfos.Count <= 0)
				{
					continue;
				}
				foreach (PouncerConfigData pouncerInfo in CustomPouncerDataSetup.PouncerInfos)
				{
					if (pouncerInfo.EnemyId == ((GameDataBlockBase<EnemyDataBlock>)(object)allBlock).persistentID && pouncerInfo.internalEnabled && !PouncerDataDictionary.ContainsKey(pouncerInfo.EnemyId))
					{
						PouncerDataContainer val = ((Il2CppObjectBase)ScriptableObject.CreateInstance(typeof(PouncerDataContainer).ToString())).TryCast<PouncerDataContainer>();
						((Object)val).name = $"{((GameDataBlockBase<EnemyDataBlock>)(object)allBlock).name}_{pouncerInfo.EnemyId}";
						val.m_DashCooldown = new Vector2(pouncerInfo.PouncerData.DashCoolDown.Min, pouncerInfo.PouncerData.DashCoolDown.Max);
						val.DashMaxTime = pouncerInfo.PouncerData.DashMaxTime;
						val.ChargeDuration = pouncerInfo.PouncerData.ChargeDuration;
						val.ConsumeDuration = pouncerInfo.PouncerData.ConsumeDuration;
						val.DashEndPhaseDistance = 6f;
						val.DashEndAnimationLength = 1f;
						val.ChargeStaggerDamageThreshold = pouncerInfo.PouncerData.ChargeStaggerDamageThreshold;
						val.DashStaggerDamageThreshold = pouncerInfo.PouncerData.DashStaggerDamageThreshold;
						val.StaggerDuration = pouncerInfo.PouncerData.StaggerDuration;
						val.FaceToTargetDuringProwlingDistance = 16.5f;
						val.StaggerLeadsToAfterHeld = true;
						val.EnableOffMeshLinkDash = false;
						val.LOSRequiredForDash = pouncerInfo.PouncerData.LOSRequiredForDash;
						val.DashStaggerUsesHeavyHitreaction = true;
						val.Enable1PConsumeVFX = true;
						val.Enable3PConsumeVFX = true;
						DamageShapeData damageShapeData = default(DamageShapeData);
						damageShapeData.Radius = 6.6f;
						damageShapeData.Angle = 210.1f;
						val.DamageShapeData = damageShapeData;
						PouncerSoundData pouncerSoundData = default(PouncerSoundData);
						pouncerSoundData.AttackCharge = 2040824805u;
						pouncerSoundData.AttackHit = 1034385728u;
						pouncerSoundData.AttackMiss = 1149851817u;
						pouncerSoundData.DashStart = 3726964003u;
						pouncerSoundData.HeldIdle = 376939216u;
						pouncerSoundData.HeldSpitOut = 2870456237u;
						pouncerSoundData.IdleGrowl = 3799706438u;
						pouncerSoundData.TentacleLoop = 3217748688u;
						val.PouncerSoundData = pouncerSoundData;
						MovementModificationData dashMovementModifier = val.DashMovementModifier;
						dashMovementModifier.SpeedModifier = pouncerInfo.PouncerData.DashMovementModifier.SpeedModifier;
						dashMovementModifier.AccelerationModifier = pouncerInfo.PouncerData.DashMovementModifier.AccelerationModifier;
						val.DashMovementModifier = dashMovementModifier;
						HeldPathingData combatStatePathingData = val.CombatStatePathingData;
						combatStatePathingData.RecursiveReachableNodeSearch = true;
						combatStatePathingData.DstChangeRate = pouncerInfo.PouncerData.CombatPathing.DistanceChangeRate;
						combatStatePathingData.TryToKeepDistance = pouncerInfo.PouncerData.CombatPathing.TryToKeepDistance;
						combatStatePathingData.MovementModifier.AccelerationModifier = pouncerInfo.PouncerData.CombatPathing.SpeedModificationData.AccelerationModifier;
						combatStatePathingData.MovementModifier.SpeedModifier = pouncerInfo.PouncerData.CombatPathing.SpeedModificationData.SpeedModifier;
						val.CombatStatePathingData = combatStatePathingData;
						HeldStateData heldStateData = val.HeldStateData;
						heldStateData.ValidatePlayerDimension = true;
						heldStateData.PathingData.RecursiveReachableNodeSearch = true;
						heldStateData.AfterHeldRunAwayDuration = pouncerInfo.PouncerData.HeldData.AfterHeldRunAwayDuration;
						heldStateData.DamageOnStartHolding = pouncerInfo.PouncerData.HeldData.DamageOnStartHolding;
						heldStateData.DamageToPlayerPerSecond = pouncerInfo.PouncerData.HeldData.DamageToPlayerPerSecond;
						heldStateData.HeldStartAnimationDuration = pouncerInfo.PouncerData.HeldData.HeldStartAnimationDuration;
						heldStateData.MaxHeldDuration = pouncerInfo.PouncerData.HeldData.MaxHeldDuration;
						heldStateData.SpitOutStateDuration = pouncerInfo.PouncerData.HeldData.SpitOutStateDuration;
						heldStateData.PathingData.DstChangeRate = pouncerInfo.PouncerData.HeldData.PathingData.DistanceChangeRate;
						heldStateData.PathingData.TryToKeepDistance = pouncerInfo.PouncerData.HeldData.PathingData.TryToKeepDistance;
						heldStateData.PathingData.MovementModifier.AccelerationModifier = pouncerInfo.PouncerData.HeldData.PathingData.SpeedModificationData.AccelerationModifier;
						heldStateData.PathingData.MovementModifier.SpeedModifier = pouncerInfo.PouncerData.HeldData.PathingData.SpeedModificationData.SpeedModifier;
						val.HeldStateData = heldStateData;
						PouncerDataDictionary.Add(pouncerInfo.EnemyId, val);
						PluginSetup.logSource.LogDebug((object)$"Creating a data container for custom pouncer ID {pouncerInfo.EnemyId}");
					}
				}
			}
		}

		public static void AttachShadersToObject()
		{
			//IL_0bcc: Unknown result type (might be due to invalid IL or missing references)
			//IL_06bc: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < CustomPrefabsConfigSetup.CustomPrefabInfo.Count; i++)
			{
				if (CustomPrefabsConfigSetup.CustomPrefabInfo[i].ShaderPathsForDictionary.Count > 0)
				{
					foreach (ShaderDictionaryFind item in CustomPrefabsConfigSetup.CustomPrefabInfo[i].ShaderPathsForDictionary)
					{
						ShaderDictionary.Add(item.KeyWord, Shader.Find(item.ShaderPath));
						PluginSetup.logSource.LogDebug((object)("Adding Shader: " + item.ShaderPath + " With keyword: " + item.KeyWord));
					}
				}
				if (CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart.Count <= 0)
				{
					continue;
				}
				for (int j = 0; j < CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart.Count; j++)
				{
					GameObject val = ((Il2CppObjectBase)AssetAPI.GetLoadedAsset(CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].PrefabPath)).TryCast<GameObject>();
					val.layer = CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].LayerType;
					if (CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].AutomateShaders)
					{
						foreach (Renderer componentsInChild in val.GetComponentsInChildren<Renderer>())
						{
							foreach (Material item2 in (Il2CppArrayBase<Material>)(object)componentsInChild.materials)
							{
								if (!CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].NamesToExludeFromAutomation.Contains(((Object)item2.shader).name))
								{
									item2.shader = Shader.Find(((Object)item2.shader).name);
									PluginSetup.logSource.LogDebug((object)("Adding shader with name: " + ((Object)item2.shader).name + " to " + ((Object)((Component)componentsInChild).gameObject).name));
								}
							}
						}
					}
					if (CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo.Count > 0)
					{
						for (int k = 0; k < CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo.Count; k++)
						{
							ShaderDictionary.TryGetValue(CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].ShaderName, out var value);
							if (CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].ApplyToAll)
							{
								foreach (Renderer componentsInChild2 in ((Component)val.transform.FindChild(CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].ChildPath)).GetComponentsInChildren<Renderer>())
								{
									if (!CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].NamesToExlude.Contains(((Object)((Component)componentsInChild2).gameObject).name))
									{
										((Il2CppArrayBase<Material>)(object)componentsInChild2.materials)[CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].MaterialIndex].shader = value;
										PluginSetup.logSource.LogDebug((object)("Adding shader with name: " + ((Object)value).name + " to " + ((Object)((Component)componentsInChild2).gameObject).name));
									}
									else
									{
										PluginSetup.logSource.LogDebug((object)("Detecting that the object is excluded! Object Name: " + ((Object)((Component)componentsInChild2).gameObject).name));
									}
								}
							}
							else if (CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].UsingMeshRenderer)
							{
								((Il2CppArrayBase<Material>)(object)((Renderer)((Component)val.transform.FindChild(CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].ChildPath)).gameObject.GetComponent<MeshRenderer>()).materials)[CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].MaterialIndex].shader = value;
								PluginSetup.logSource.LogDebug((object)("Adding shader with name: " + ((Object)value).name + " To Child: " + CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].ChildPath + " Attached to CreatedPrefab: " + ((Object)val).name));
							}
							if (CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].PropertyEdits.Count <= 0)
							{
								continue;
							}
							foreach (ShaderPropertiesEdit propertyEdit in CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].PropertyEdits)
							{
								if (propertyEdit.IsColor && ((Il2CppArrayBase<Material>)(object)((Renderer)((Component)val.transform.FindChild(CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].ChildPath)).gameObject.GetComponent<MeshRenderer>()).materials)[CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].MaterialIndex].HasProperty(propertyEdit.PropertyToEdit))
								{
									((Il2CppArrayBase<Material>)(object)((Renderer)((Component)val.transform.FindChild(CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].ChildPath)).gameObject.GetComponent<MeshRenderer>()).materials)[CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].MaterialIndex].SetColor(propertyEdit.PropertyToEdit, propertyEdit.ColorValue);
									PluginSetup.logSource.LogDebug((object)("Overriding color property: " + propertyEdit.PropertyToEdit));
								}
								if (propertyEdit.IsFloat && ((Il2CppArrayBase<Material>)(object)((Renderer)((Component)val.transform.FindChild(CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].ChildPath)).gameObject.GetComponent<MeshRenderer>()).materials)[CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].MaterialIndex].HasProperty(propertyEdit.PropertyToEdit))
								{
									((Il2CppArrayBase<Material>)(object)((Renderer)((Component)val.transform.FindChild(CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].ChildPath)).gameObject.GetComponent<MeshRenderer>()).materials)[CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].MaterialIndex].SetFloat(propertyEdit.PropertyToEdit, propertyEdit.FloatValue);
									PluginSetup.logSource.LogDebug((object)("Overriding float property: " + propertyEdit.PropertyToEdit));
								}
								if (propertyEdit.IsBool && ((Il2CppArrayBase<Material>)(object)((Renderer)((Component)val.transform.FindChild(CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].ChildPath)).gameObject.GetComponent<MeshRenderer>()).materials)[CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].MaterialIndex].HasProperty(propertyEdit.PropertyToEdit))
								{
									MaterialExtensions.SetKeywordEnabled(((Il2CppArrayBase<Material>)(object)((Renderer)((Component)val.transform.FindChild(CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].ChildPath)).gameObject.GetComponent<MeshRenderer>()).materials)[CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].MaterialIndex], propertyEdit.PropertyToEdit, propertyEdit.BoolValue);
									PluginSetup.logSource.LogDebug((object)("Overriding bool property: " + propertyEdit.PropertyToEdit));
								}
							}
						}
					}
					if (!CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].isGeomorph)
					{
						continue;
					}
					if (CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].AddGeomorphComponent)
					{
						LG_Geomorph val2 = val.AddComponent<LG_Geomorph>();
						val2.m_geoPrefab = val;
						val2.m_goShapeType = (LG_GeomorphShapeType)0;
						val2.m_plugs = new List<LG_Plug>();
						val2.m_prefabSpawners = new Il2CppReferenceArray<LG_PrefabSpawner>(0L);
						val2.m_areas = new Il2CppReferenceArray<LG_Area>(0L);
						val2.m_randomSelectors = new Il2CppReferenceArray<LG_RandomSelectorBase>(0L);
						PluginSetup.logSource.LogWarning((object)("Attaching geomorph and geomorphnodevolume to GameObject: " + ((Object)val).name));
					}
					for (int l = 0; l < CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].Areas.Count; l++)
					{
						GameObject gameObject = ((Component)val.transform.FindChild(CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].Areas[l].ChildPathForArea)).gameObject;
						if (CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].Areas[l].AddAreaComponent)
						{
							gameObject.gameObject.AddComponent<LG_Area>();
						}
						((Component)gameObject.gameObject.transform.FindChild(CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].Areas[l].AIGraphSourcePath)).gameObject.AddComponent<LG_AreaAIGraphSource>();
						if (CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].Areas[l].GatePaths.Length != 0)
						{
							for (int m = 0; m < CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].Areas[l].GatePaths.Length; m++)
							{
								LG_Plug val3 = ((Component)gameObject.gameObject.transform.FindChild(CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].Areas[l].GatePaths[m])).gameObject.AddComponent<LG_Plug>();
								((LG_ZoneExpander)val3).m_subComplex = CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].Areas[l].SubComplexTypeForGates;
								PluginSetup.logSource.LogWarning((object)("Adding gate to ChildPath: " + CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].Areas[l].GatePaths[m]));
							}
						}
						if (CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].Areas[l].Markers.Count <= 0)
						{
							continue;
						}
						foreach (MarkerInfo marker in CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].Areas[l].Markers)
						{
							switch (marker.MarkerType)
							{
							case 1:
							{
								MiningRefineryMarkerProducer val6 = ((Component)gameObject.gameObject.transform.FindChild(marker.MarkerPath)).gameObject.AddComponent<MiningRefineryMarkerProducer>();
								val6.m_markerDataBlockID = marker.MarkerPersistentID;
								PluginSetup.logSource.LogWarning((object)"Adding MiningRefineryMarker");
								break;
							}
							case 2:
							{
								TechDataCenterMarkerProducer val5 = ((Component)gameObject.gameObject.transform.FindChild(marker.MarkerPath)).gameObject.AddComponent<TechDataCenterMarkerProducer>();
								val5.m_markerDataBlockID = marker.MarkerPersistentID;
								PluginSetup.logSource.LogWarning((object)"Adding TechDataCenterMarker");
								break;
							}
							case 3:
							{
								ServiceFloodwaysMarkerProducer val4 = ((Component)gameObject.gameObject.transform.FindChild(marker.MarkerPath)).gameObject.AddComponent<ServiceFloodwaysMarkerProducer>();
								val4.m_markerDataBlockID = marker.MarkerPersistentID;
								PluginSetup.logSource.LogWarning((object)"Adding ServiceFloodwaysMarker");
								break;
							}
							}
						}
					}
				}
			}
		}

		[HarmonyPatch(typeof(StartMainGame), "Awake")]
		public static void Postfix()
		{
			AssetAPI.OnAssetBundlesLoaded += delegate
			{
				AttachShadersToObject();
			};
			AssetShardManager.OnEnemyAssetsLoaded += Action.op_Implicit((Action)delegate
			{
				FindPouncerData();
			});
			Harmony.CreateAndPatchAll(typeof(LG_SecurityDoor_Locks_SetupForChainedPuzzle_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(LG_DimensionPortal_Setup_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(Builder_BuildDone_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(LG_WardenObjective_OnBuildDone_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(LG_WardenObjective_Reactor_Update_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(LG_PowerGenerator_Core_Setup_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(LG_PowerGenerator_Core_SyncStatusChanged_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(ES_Dead_CommonEnter_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(PlayerAgent_Update_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(ChainedPuzzleInstance_SetupMovement_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(Builder_Build_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(EnemyAgent_Setup_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(ResetManager), (string)null);
			Harmony.CreateAndPatchAll(typeof(CP_BasicMovable_UpdateMovementRoutine_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(CP_PlayerScanner_StopScan_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(GS_InLevel_Enter_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(GameStateManager_Update_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(LG_ComputerTerminalCommandInterpreter_ReceiveCommand_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(BulletWeapon_UnWield_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(BulletWeapon_Update_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(MWS_Charge_Exit_Postifx), (string)null);
			Harmony.CreateAndPatchAll(typeof(MWS_Charge_Enter_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(ElevatorShaftLanding_OnBuildDone_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(OnCheckPointSavedManager), (string)null);
			Harmony.CreateAndPatchAll(typeof(LG_PopulateFunctionMarkersInZoneJob_TriggerFunctionBuilder_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(LG_Distribute_WardenObjective_Build_Prefix), (string)null);
			Harmony.CreateAndPatchAll(typeof(BioGearSetup), (string)null);
			Harmony.CreateAndPatchAll(typeof(BulletWeapon_UpdateAmmoStatus_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(BulletWeapon_Fire_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(Snet_SessionHub_OnJoin_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(Snet_SessionHub_OnLeave_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(LG_WardenObjective_Reactor_Start_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(PlayerAgent_Setup_Postfix), (string)null);
			Harmony.Cr

plugins/Sector 11/ExtraSettings.dll

Decompiled 4 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text.Json;
using AIGraph;
using AK;
using Agents;
using AssetShards;
using BepInEx;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using BepInEx.Unity.IL2CPP.UnityEngine;
using BepInEx.Unity.IL2CPP.Utils;
using CellMenu;
using ChainedPuzzles;
using Enemies;
using Expedition;
using ExtraSetting.Managers;
using ExtraSettings.ConfigFiles;
using ExtraSettings.GameScripts;
using ExtraSettings.Managers;
using ExtraSettings.Patches;
using ExtraSettings.PluginInfo;
using ExtraSettings.StructFiles;
using FX_EffectSystem;
using GTFO.API;
using GameData;
using Gear;
using HarmonyLib;
using Il2CppInterop.Runtime;
using Il2CppInterop.Runtime.Injection;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSystem;
using Il2CppSystem.Collections.Generic;
using LevelGeneration;
using Localization;
using MTFO.Managers;
using Player;
using ReactorLightsOff.GameScripts;
using ReactorLightsOff.Patches;
using SNetwork;
using TMPro;
using UnityEngine;
using UnityEngine.Rendering.PostProcessing;
using UnityEngine.SceneManagement;
using UnityEngine.Video;

[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 = "")]
[assembly: AssemblyCompany("ExtraSettings")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ExtraSettings")]
[assembly: AssemblyTitle("ExtraSettings")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace ExtraSetting.StructFiles
{
	public static class OpenDoorEventSync
	{
		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct OpenDoorSycnEvent
		{
			public LG_SecurityDoor TargetedSecurityDoor;
		}
	}
}
namespace ExtraSetting.Managers
{
	public static class SyncingManager
	{
		public static List<TimedUnlockDoorsListCollection> TimedDoorsCollection = new List<TimedUnlockDoorsListCollection>();

		public static List<PortalCommandTerminalCollection> PortalTerminalCollection = new List<PortalCommandTerminalCollection>();

		public static List<LG_SecurityDoor_Locks> OpenDoorOnScanCompleteCollection = new List<LG_SecurityDoor_Locks>();

		public static List<HackSecurityDoorCollection> HackDoorCollection = new List<HackSecurityDoorCollection>();

		public static List<ReactorBackDoorListCollection> ReactorBackdoorTerminalsCollection = new List<ReactorBackDoorListCollection>();

		public static List<TerminalAlarmDoorListCollection> TerminalAlarmCollection = new List<TerminalAlarmDoorListCollection>();

		public static List<LightsOffObjectiveCollection> LightsOffObjectiveCollection = new List<LightsOffObjectiveCollection>();

		public static List<CorruptedReactorTerminalCollection> CorruptedReactorTerminalCollections = new List<CorruptedReactorTerminalCollection>();

		public static List<UplinkReactorTerminalCollection> uplinkReactorTerminalCollections = new List<UplinkReactorTerminalCollection>();

		public static List<TerminalLatePaswords> TerminalsNeedingPasswords = new List<TerminalLatePaswords>();

		public static void GetSyncedRandomNumber(ulong x, int MaxNumber)
		{
		}

		public static void SyncElevator(ulong x, PublicStructClass.ElevatorSync Packet)
		{
			GetBackToElevatorController.Current.OnClientReceived(x, Packet);
		}

		public static void SyncElevatorComplete(ulong x, PublicStructClass.DummyStruct Packet)
		{
			GetBackToElevatorController.Current.CompleteExpedition(x, Packet);
		}

		public static void SynElevatorCountdownTimer(ulong x, PublicStructClass.TimeSync Packet)
		{
			GetBackToElevatorController.Current.UpdateGUIClient(x, Packet);
		}

		public static void SpawnElevator(ulong x, PublicStructClass.DummyStruct Packet)
		{
			//IL_009e: 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_0072: Unknown result type (might be due to invalid IL or missing references)
			GetBackToElevatorController component = ((Component)ElevatorRide.Cage).gameObject.GetComponent<GetBackToElevatorController>();
			((Component)ElevatorRide.Cage).gameObject.SetActive(true);
			ElevatorRide.Cage.ActivateWinCondition();
			if (component.m_ConnectedData.IsForwardExtract)
			{
				((Component)ElevatorRide.Cage).gameObject.transform.position = component.m_ConnectedData.ElevatorPositionForForwardExtract;
				((Component)ElevatorRide.Cage).gameObject.transform.eulerAngles = component.m_ConnectedData.ElevatorRotationForForwardExtract;
			}
			else
			{
				((Component)ElevatorRide.Cage).gameObject.transform.position = new Vector3(0f, -0.3527f, 5.7345f);
			}
			ElevatorRide.Cage.m_animator.Play("ElevatorLanding_Dropoff");
			PluginSetup.logSource.LogDebug((object)"SPAWN ELEVATOR RECEIVED");
		}

		public static void ConvertAndTriggerEvent(WardenEventDataConfig ConfigSettings, WardenEventGenericWave WaveSettings)
		{
			//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_0022: 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_002f: 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_003c: 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_0049: 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_0061: 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_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: 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_00b9: 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_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: 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_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: 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_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Expected O, but got Unknown
			//IL_01ba: Expected O, but got Unknown
			//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_01f3: Expected O, but got Unknown
			WardenObjectiveEventData val = new WardenObjectiveEventData
			{
				WorldEventObjectFilter = ConfigSettings.WorldEventObjectFilter,
				Condition = ConfigSettings.Condition,
				Trigger = ConfigSettings.Trigger,
				Type = ConfigSettings.Type,
				DimensionIndex = ConfigSettings.DimensionIndex,
				Layer = ConfigSettings.Layer,
				LocalIndex = ConfigSettings.LocalIndex,
				CustomSubObjectiveHeader = LocalizedText.op_Implicit(ConfigSettings.CustomSubObjectiveHeader),
				CustomSubObjective = LocalizedText.op_Implicit(ConfigSettings.CustomSubObjective),
				Delay = ConfigSettings.Delay,
				Duration = ConfigSettings.Duration,
				ClearDimension = ConfigSettings.ClearDimension,
				SoundID = ConfigSettings.SoundID,
				SoundSubtitle = LocalizedText.op_Implicit(ConfigSettings.SoundSubtitle),
				DialogueID = ConfigSettings.DialogueID,
				FogSetting = ConfigSettings.FogSetting,
				FogTransitionDuration = ConfigSettings.FogTransitionDuration,
				EnemyID = ConfigSettings.EnemyID,
				Position = ConfigSettings.Position,
				Count = ConfigSettings.Count,
				Enabled = ConfigSettings.Enabled,
				ChainPuzzle = ConfigSettings.ChainPuzzle,
				UseStaticBioscanPoints = ConfigSettings.UseStaticBioscanPoints,
				TerminalCommand = ConfigSettings.TerminalCommand,
				TerminalCommandRule = ConfigSettings.TerminalCommandRule,
				EnemyWaveData = new GenericEnemyWaveData
				{
					WaveSettings = WaveSettings.WaveSettings,
					WavePopulation = WaveSettings.WavePopulation,
					AreaDistance = WaveSettings.AreaDistance,
					SpawnDelay = WaveSettings.SpawnDelay,
					TriggerAlarm = WaveSettings.TriggerAlarm,
					IntelMessage = LocalizedText.op_Implicit(WaveSettings.IntelMessage)
				}
			};
			if (ConfigSettings.WardenIntel != 0)
			{
				val.WardenIntel = LocalizedText.op_Implicit(ConfigSettings.WardenIntel);
			}
			else
			{
				val.WardenIntel = new LocalizedText
				{
					UntranslatedText = ConfigSettings.WardenIntelString
				};
			}
			WardenObjectiveManager.CheckAndExecuteEventsOnTrigger(val, (eWardenObjectiveEventTrigger)0, true, 0f);
		}

		public static string GetGameObjectPath(Transform transform)
		{
			string text = ((Object)transform).name;
			while ((Object)(object)transform.parent != (Object)null)
			{
				transform = transform.parent;
				text = ((Object)transform).name + "/" + text;
			}
			return text;
		}

		public static void SyncBoostersWithOthers(int CharacterIndex, int BoosterEffectModifier, float amount)
		{
			if ((Object)(object)PlayerManager.PlayerAgentsInLevel[CharacterIndex] != (Object)(object)PlayerManager.GetLocalPlayerAgent())
			{
				AgentModifierManager.AddModifierValue((Agent)(object)PlayerManager.PlayerAgentsInLevel[CharacterIndex], (AgentModifier)BoosterEffectModifier, amount, 0f);
				PluginSetup.logSource.LogDebug((object)$"Syncing Booster Effect with player agent: {PlayerManager.PlayerAgentsInLevel[CharacterIndex].PlayerName} || With effect: {(object)(AgentModifier)BoosterEffectModifier} || Amount: {amount} || Relative Percentage {AgentModifierManager.DecimalPercantageToTraitPercentage(amount)} ");
			}
		}

		public static void ReloadModdedContentOnCheckpointLoad()
		{
			Il2CppArrayBase<CustomFogSphereHandler> val = Object.FindObjectsOfType<CustomFogSphereHandler>();
			Il2CppArrayBase<RandomTerminalUplinkScript> val2 = Object.FindObjectsOfType<RandomTerminalUplinkScript>();
			if (val.Length > 0)
			{
				foreach (CustomFogSphereHandler item in val)
				{
					item.OnCheckPointReload();
				}
			}
			if (val2.Length > 0)
			{
				foreach (RandomTerminalUplinkScript item2 in val2)
				{
					item2.OnCheckPointReset();
				}
			}
			if (Object.op_Implicit((Object)(object)((Component)ElevatorRide.Cage).gameObject.GetComponent<GetBackToElevatorController>()))
			{
				((Component)ElevatorRide.Cage).gameObject.GetComponent<GetBackToElevatorController>().OnCheckPointReset();
			}
			if (TimedDoorsCollection.Count > 0)
			{
				for (int i = 0; i < TimedDoorsCollection.Count; i++)
				{
					((Component)TimedDoorsCollection[i].TimedUnlockDoorTerminal).gameObject.GetComponent<TimedDoorUnlock>().ResetOnCheckPoint(TimedDoorsCollection[i].TimedDoorTimer);
					PluginSetup.logSource.LogDebug((object)"Detected TimedDoor: Setting it back up again!");
				}
			}
			if (PortalTerminalCollection.Count > 0)
			{
				for (int j = 0; j < PortalTerminalCollection.Count; j++)
				{
					((Component)PortalTerminalCollection[j].CommandTerminal).gameObject.GetComponent<TerminalCommandTeleporter>().OnCheckPointReload();
					PluginSetup.logSource.LogDebug((object)"Detected PortalCommand: Setting it back up again!");
				}
			}
			if (HackDoorCollection.Count > 0)
			{
				for (int k = 0; k < HackDoorCollection.Count; k++)
				{
					((Component)HackDoorCollection[k].HackSecurityDoorLock.m_door).gameObject.GetComponent<HackSecurityDoorScript>().OnCheckPointReload();
					PluginSetup.logSource.LogDebug((object)"Detected a HackSecurityDoor: Setting it up again!");
				}
			}
			if (TerminalAlarmCollection.Count > 0)
			{
				for (int l = 0; l < TerminalAlarmCollection.Count; l++)
				{
					((Component)TerminalAlarmCollection[l].TerminalAlarmMainTerminal).gameObject.GetComponent<TerminalAlarm>().OnCheckPointReload();
					PluginSetup.logSource.LogDebug((object)"Detected a TerminalAlarm: Setting it up again!");
				}
			}
			if (LightsOffObjectiveCollection.Count > 0)
			{
				for (int m = 0; m < LightsOffObjectiveCollection.Count; m++)
				{
					((Component)LightsOffObjectiveCollection[m].LightsOffTerminal).gameObject.GetComponent<LightsOnTerminalScript>().OnCheckPointReset();
					PluginSetup.logSource.LogDebug((object)"Detected a LightsOffObjeciveTerminal: Setting it up again!");
				}
			}
			if (uplinkReactorTerminalCollections.Count > 0)
			{
				for (int n = 0; n < uplinkReactorTerminalCollections.Count; n++)
				{
					((Component)uplinkReactorTerminalCollections[n].UplinkTerminal).gameObject.GetComponent<UplinkTerminalReactorScript>().OnCheckPointReload();
					PluginSetup.logSource.LogDebug((object)"Detected a UplinkReactorTerminalEvent: Setting it up again!");
				}
			}
			if (CorruptedReactorTerminalCollections.Count > 0)
			{
				for (int num = 0; num < CorruptedReactorTerminalCollections.Count; num++)
				{
					((Component)CorruptedReactorTerminalCollections[num].CorruptedTerminal).gameObject.GetComponent<CorruptedTerminalDummyScript>().OnCheckPointLoaded();
					PluginSetup.logSource.LogDebug((object)"Detected a CorruptedReactorTerminalEvent: Setting it up again!");
				}
			}
		}

		public static void UnlockDoor(LG_SecurityDoor DoorToUnlock)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Invalid comparison between Unknown and I4
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Invalid comparison between Unknown and I4
			//IL_0033: 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)
			if ((int)DoorToUnlock.LastStatus != 10 || (int)DoorToUnlock.LastStatus != 16)
			{
				DoorToUnlock.m_sync.AttemptDoorInteraction((eDoorInteractionType)5, 0f, 0f, default(Vector3), (Agent)null);
			}
		}

		public static void OpenDoor(LG_SecurityDoor DoorToOpen)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Invalid comparison between Unknown and I4
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Invalid comparison between Unknown and I4
			//IL_0033: 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)
			if ((int)DoorToOpen.LastStatus != 10 || (int)DoorToOpen.LastStatus != 16)
			{
				DoorToOpen.m_sync.AttemptDoorInteraction((eDoorInteractionType)0, 0f, 0f, default(Vector3), (Agent)null);
			}
		}

		public static void IncreaseEnemyObjectiveCount(ulong x, EnemyCounterSync.EnemySync Packet)
		{
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Unknown result type (might be due to invalid IL or missing references)
			ES_Dead_CommonEnter_Postfix.NumberOfEnemiesKilled = Packet.CounterBeforeIncrease;
			ES_Dead_CommonEnter_Postfix.NumberOfEnemiesKilled++;
			if (HunterEnemyObjectiveSetup.HuntedEnemiesInfo[EnemyAgent_Setup_Postfix.HuntedEnemyIndexStatic].ShowWardenIntel)
			{
				GuiManager.PlayerLayer.m_wardenIntel.ShowSubObjectiveMessage("", $"<color=red>ENEMY KILLED: NUMBER KILLED: </color><color=orange>{ES_Dead_CommonEnter_Postfix.NumberOfEnemiesKilled}</color><color=red>: NUMBER OF KILLS NEEDED: </color><color=orange>{HunterEnemyObjectiveSetup.HuntedEnemiesInfo[EnemyAgent_Setup_Postfix.HuntedEnemyIndexStatic].numberOfKillsNeeded}</color>", false, 200f, 5f, (Action)null);
			}
			if (HunterEnemyObjectiveSetup.HuntedEnemiesInfo[EnemyAgent_Setup_Postfix.HuntedEnemyIndexStatic].showCustomProgressionMessage)
			{
				GuiManager.PlayerLayer.WardenObjectives.SetCustomSubText((Func<string>)(object)Object.op_Implicit("Hunting Objective"), (Func<string>)(object)Object.op_Implicit($"{HunterEnemyObjectiveSetup.HuntedEnemiesInfo[EnemyAgent_Setup_Postfix.HuntedEnemyIndexStatic].ProgressionMessage}: <color=orange>{ES_Dead_CommonEnter_Postfix.NumberOfEnemiesKilled}</color>/{HunterEnemyObjectiveSetup.HuntedEnemiesInfo[EnemyAgent_Setup_Postfix.HuntedEnemyIndexStatic].numberOfKillsNeeded}"));
			}
			if (HunterEnemyObjectiveSetup.HuntedEnemiesInfo[EnemyAgent_Setup_Postfix.HuntedEnemyIndexStatic].UseEventsOnKills && HunterEnemyObjectiveSetup.HuntedEnemiesInfo[EnemyAgent_Setup_Postfix.HuntedEnemyIndexStatic].EventsOnKills.Count > 0)
			{
				for (int i = 0; i < HunterEnemyObjectiveSetup.HuntedEnemiesInfo[EnemyAgent_Setup_Postfix.HuntedEnemyIndexStatic].EventsOnKills.Count; i++)
				{
					if (ES_Dead_CommonEnter_Postfix.NumberOfEnemiesKilled != HunterEnemyObjectiveSetup.HuntedEnemiesInfo[EnemyAgent_Setup_Postfix.HuntedEnemyIndexStatic].EventsOnKills[i].KillRequirement)
					{
						continue;
					}
					foreach (WardenEventDataConfig item in HunterEnemyObjectiveSetup.HuntedEnemiesInfo[EnemyAgent_Setup_Postfix.HuntedEnemyIndexStatic].EventsOnKills[i].EventsInfo)
					{
						ConvertAndTriggerEvent(item, item.EnemyWaveData);
					}
				}
			}
			if (ES_Dead_CommonEnter_Postfix.NumberOfEnemiesKilled >= HunterEnemyObjectiveSetup.HuntedEnemiesInfo[EnemyAgent_Setup_Postfix.HuntedEnemyIndexStatic].numberOfKillsNeeded && HunterEnemyObjectiveSetup.HuntedEnemiesInfo[EnemyAgent_Setup_Postfix.HuntedEnemyIndexStatic].CompleteObjective)
			{
				pWardenObjectiveInteraction val = default(pWardenObjectiveInteraction);
				val.type = (eWardenObjectiveInteractionType)2;
				val.inLayer = (LG_LayerType)(byte)Packet.LG_Layer;
				pWardenObjectiveInteraction val2 = val;
				WardenObjectiveManager.Current.AttemptInteract(val2);
			}
			PluginSetup.logSource.LogDebug((object)$"SYNCINGMANAGER: IncreaseEnemyObjectiveCount: NumberKilled: {ES_Dead_CommonEnter_Postfix.NumberOfEnemiesKilled}");
		}

		public static void IncreaseTerminalPowerZoneIndex(ulong x, PublicStructClass.LightsOnTerminalObjectiveStruct Packet)
		{
			//IL_011e: 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_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			if (CustomLightsOnObjectiveConfigSetup.LightsOnInfo[Builder_BuildDone_Postfix.LightsOffStaticIndex].IsObjective)
			{
				Builder_BuildDone_Postfix.NumberOfLightsOffObjective++;
				GuiManager.PlayerLayer.m_wardenIntel.ShowSubObjectiveMessage("", $"<color=red>ZONE REPAIRED! NUMBER OF ZONES REPAIRED: </color><color=orange>{Builder_BuildDone_Postfix.NumberOfLightsOffObjective}</color>/<color=orange>{CustomLightsOnObjectiveConfigSetup.LightsOnInfo[Builder_BuildDone_Postfix.LightsOffStaticIndex].ObjectiveAmountNeeded}</color>", false, 200f, 5f, (Action)null);
				if (CustomLightsOnObjectiveConfigSetup.LightsOnInfo[Builder_BuildDone_Postfix.LightsOffStaticIndex].HaveCustomProgressionMessage)
				{
					GuiManager.PlayerLayer.WardenObjectives.SetCustomSubText((Func<string>)(object)Object.op_Implicit(""), (Func<string>)(object)Object.op_Implicit($"{CustomLightsOnObjectiveConfigSetup.LightsOnInfo[Builder_BuildDone_Postfix.LightsOffStaticIndex].CustomProgressionMessage} <color=orange>{Builder_BuildDone_Postfix.NumberOfLightsOffObjective}</color> / <color=orange>{CustomLightsOnObjectiveConfigSetup.LightsOnInfo[Builder_BuildDone_Postfix.LightsOffStaticIndex].ObjectiveAmountNeeded}</color>"));
				}
				if (Builder_BuildDone_Postfix.NumberOfLightsOffObjective >= CustomLightsOnObjectiveConfigSetup.LightsOnInfo[Builder_BuildDone_Postfix.LightsOffStaticIndex].ObjectiveAmountNeeded)
				{
					pWardenObjectiveInteraction val = default(pWardenObjectiveInteraction);
					val.type = (eWardenObjectiveInteractionType)2;
					val.inLayer = (LG_LayerType)(byte)Packet.TargetedLayer;
					pWardenObjectiveInteraction val2 = val;
					WardenObjectiveManager.Current.AttemptInteract(val2);
				}
				PluginSetup.logSource.LogDebug((object)"SYNCINGMANAGER: INCREASELIGHTSONTERMINALOBJECTIVE");
			}
			else
			{
				PluginSetup.logSource.LogWarning((object)"WARNING: SYNCINGMANAGER INCREASELIGHTSONTERMINALOBJECTIVE HAS BEEN CALLED BUT IS NOT COUNTED! IS THIS INTENTIONAL? IF NOT, SET 'IsObjective' TO TRUE");
			}
		}

		public static void RandomTerminalSync(ulong x, PublicStructClass.RandomTerminalAlarmSync Packet)
		{
			LG_Zone val = default(LG_Zone);
			Builder.CurrentFloor.TryGetZoneByLocalIndex((eDimensionIndex)Packet.TerminalDimension, (LG_LayerType)(byte)Packet.TerminalLayerType, (eLocalZoneIndex)Packet.TerminalZoneIndex, ref val);
			LG_Zone val2 = default(LG_Zone);
			Builder.CurrentFloor.TryGetZoneByLocalIndex((eDimensionIndex)Packet.VerificationTerminalDimension, (LG_LayerType)(byte)Packet.VerificationTerminalLayerType, (eLocalZoneIndex)Packet.TerminalZoneIndex, ref val2);
			LG_Zone val3 = default(LG_Zone);
			Builder.CurrentFloor.TryGetZoneByLocalIndex((eDimensionIndex)Packet.DoorDimension, (LG_LayerType)(byte)Packet.DoorLayerType, (eLocalZoneIndex)Packet.DoorZoneIndex, ref val3);
			PluginSetup.logSource.LogDebug((object)"SYNCINGMANAGER: Syncing TerminalAlarm Selection");
		}

		public static void SyncTerminalOutput(ulong x, PublicStructClass.OutputSyncStruct Packet)
		{
			LG_Zone val = default(LG_Zone);
			Builder.CurrentFloor.TryGetZoneByLocalIndex((eDimensionIndex)Packet.TerminalDimension, (LG_LayerType)(byte)Packet.TerminalLayer, (eLocalZoneIndex)Packet.TerminalZoneIndex, ref val);
			if (Object.op_Implicit((Object)(object)((Component)val.TerminalsSpawnedInZone[Packet.TerminalIndex]).gameObject.GetComponent<TerminalAlarm>()) && Packet.isTerminalAlarm)
			{
				((Component)val.TerminalsSpawnedInZone[Packet.TerminalIndex]).gameObject.GetComponent<TerminalAlarm>().SyncOutput();
			}
			if (Object.op_Implicit((Object)(object)((Component)val.TerminalsSpawnedInZone[Packet.TerminalIndex]).gameObject.GetComponent<TimedDoorUnlock>()) && Packet.isTimedDoorUnlock)
			{
				((Component)val.TerminalsSpawnedInZone[Packet.TerminalIndex]).gameObject.GetComponent<TimedDoorUnlock>().SyncOutput();
			}
			if (Object.op_Implicit((Object)(object)((Component)val.TerminalsSpawnedInZone[Packet.TerminalIndex]).gameObject.GetComponent<LightsOnTerminalScript>()) && Packet.isLightsOnObjective)
			{
				if (Packet.isVerificationOutput)
				{
					((Component)val.TerminalsSpawnedInZone[Packet.TerminalIndex]).gameObject.GetComponent<LightsOnTerminalScript>().SyncVerifyOutput();
				}
				else
				{
					((Component)val.TerminalsSpawnedInZone[Packet.TerminalIndex]).gameObject.GetComponent<LightsOnTerminalScript>().SyncOutput();
				}
			}
		}
	}
}
namespace ReactorLightsOff.Patches
{
	public static class GameStateManager_Update_Postfix
	{
		public static List<SNet_Player> PlayersInLobby = new List<SNet_Player>();

		[HarmonyPatch(typeof(GameStateManager), "Update")]
		public static void Postfix()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Invalid comparison between Unknown and I4
			if ((int)GameStateManager.CurrentStateName == 5)
			{
				if (PlayersInLobby.Count > 0)
				{
					PlayersInLobby.Clear();
					PluginSetup.logSource.LogDebug((object)$"Removing players | Count: {PlayersInLobby.Count}");
				}
				LG_SecurityDoor_Locks_SetupForChainedPuzzle_Postfix.HackDoorOpenActive = false;
				LG_SecurityDoor_Locks_SetupForChainedPuzzle_Postfix.OpenDoorOnScanComplete = false;
				LG_DimensionPortal_Setup_Postfix.CanAddTerminal = false;
				Builder_BuildDone_Postfix.TimedUnlockActive = false;
				GS_InLevel_Enter_Postfix.IntervalActive = false;
				LG_PowerGenerator_Core_Setup_Postfix.ReactorActive = false;
				LG_WardenObjective_OnBuildDone_Postfix.ShowTimer = false;
				LG_WardenObjective_OnBuildDone_Postfix.StartMalfunction = false;
				LG_WardenObjective_OnBuildDone_Postfix.CreateLightCollection = false;
				Builder_Build_Postfix.MovableScansActive = false;
				Builder_Build_Postfix.RandomizedScansActive = false;
				Builder_Build_Postfix.TerminalAlarmActive = false;
				Builder_Build_Postfix.CustomReactorPlacementActive = false;
				Builder_BuildDone_Postfix.TemperatureZoneActive = false;
				LG_SecurityDoor_Locks_SetupForChainedPuzzle_Postfix.ChangeExtractionScan = false;
				MWS_Charge_Enter_Postfix.MeleeSlowedDown = false;
				BulletWeapon_Update_Postfix.ReloadSlowedDown = false;
				ResetManager.HasCheckpointBeenCalledGlobal = false;
				Builder_BuildDone_Postfix.LightsOffObjectiveActive = false;
				LG_PopulateFunctionMarkersInZoneJob_TriggerFunctionBuilder_Postfix.IsFirstTime = true;
				Builder_Build_Postfix.CustomPrefabsActive = false;
				Builder_Build_Postfix.CustomReactorActive = false;
				Builder_Build_Postfix.RandomTerminalUplinksActive = false;
				LG_Distribute_WardenObjective_Build_Prefix.IsFirstTime = true;
				LG_PopulateFunctionMarkersInZoneJob_TriggerFunctionBuilder_Postfix.isFirstTimeHiding = true;
				LG_WardenObjective_OnBuildDone_Postfix.BackupMalfunctionTimer = 0f;
				ES_Dead_CommonEnter_Postfix.NumberOfEnemiesKilled = 0;
				EnemyAgent_Setup_Postfix.HuntedEnemyIndexStatic = 0;
				LG_WardenObjective_OnBuildDone_Postfix.ReactorIndexStatic = 0;
				LG_WardenObjective_Reactor_Update_Postfix.NumberOfGeneratorsDone = 0;
				LG_WardenObjective_Reactor_Update_Postfix.NumberOfTerminalsDone = 0;
				LG_WardenObjective_Reactor_Update_Postfix.ReactorWaveIndexStatic = 0;
				Builder_Build_Postfix.MovableScanIndexStatic = 0;
				Builder_Build_Postfix.RandomizedScansStaticIndex = 0;
				Builder_Build_Postfix.TerminalAlarmStaticIndex = 0;
				Builder_Build_Postfix.CustomReactorStaticIndex = 0;
				Builder_BuildDone_Postfix.TemperatureZoneStaticIndex = 0;
				LG_WardenObjective_Reactor_Update_Postfix.NumberOfTerminalGathersDone = 0;
				LG_WardenObjective_Reactor_Update_Postfix.ReactorWaveTerminalGatherIndexStatic = 0;
				LG_WardenObjective_Reactor_Update_Postfix.ReactorWaveCorruptedUplinkIndexStatic = 0;
				BulletWeapon_Update_Postfix.SavedMultiplierSlowDown = 0f;
				MWS_Charge_Enter_Postfix.SlowedDownMeleeMultiplier = 0f;
				LG_WardenObjective_Reactor_Update_Postfix.NumberOfCorruptedTerminalsDone = 0;
				Builder_BuildDone_Postfix.NumberOfLightsOffObjective = 0;
				Builder_BuildDone_Postfix.LightsOffStaticIndex = 0;
				ChainedPuzzleInstance_SetupMovement_Postfix.ScanCreationIndex = 0;
				LG_WardenObjective_Reactor_Update_Postfix.NumberOfHSUInsertsDone = 0;
				LG_WardenObjective_Reactor_Update_Postfix.ReactorHSUInstertStaticIndex = 0;
				Builder_Build_Postfix.CustomPrefabStaticIndex = 0;
				Builder_Build_Postfix.CustomDisinfectStationIndex = 0;
				Builder_Build_Postfix.CustomReactorIndex = 0;
				Builder_Build_Postfix.RandomTerminalUplinkIndex = 0;
				LG_SecurityDoor_Locks_SetupForChainedPuzzle_Postfix.NewExtractionScan = null;
				LG_SecurityDoor_Locks_SetupForChainedPuzzle_Postfix.NewExtractionMarker = null;
				if (SyncingManager.TerminalsNeedingPasswords.Count > 0)
				{
					SyncingManager.TerminalsNeedingPasswords.Clear();
				}
				if (EnemyAgent_Setup_Postfix.AllEnemies.Count > 0)
				{
					EnemyAgent_Setup_Postfix.AllEnemies.Clear();
				}
				if (LG_PowerGenerator_Core_Setup_Postfix.PowerGeneratorsInLevel.Count > 0)
				{
					LG_PowerGenerator_Core_Setup_Postfix.PowerGeneratorsInLevel.Clear();
				}
				if (SyncingManager.TimedDoorsCollection.Count > 0)
				{
					SyncingManager.TimedDoorsCollection.Clear();
				}
				if (SyncingManager.PortalTerminalCollection.Count > 0)
				{
					SyncingManager.PortalTerminalCollection.Clear();
				}
				if (SyncingManager.HackDoorCollection.Count > 0)
				{
					SyncingManager.HackDoorCollection.Clear();
				}
				if (SyncingManager.TerminalAlarmCollection.Count > 0)
				{
					SyncingManager.TerminalAlarmCollection.Clear();
				}
				if (SyncingManager.LightsOffObjectiveCollection.Count > 0)
				{
					SyncingManager.LightsOffObjectiveCollection.Clear();
				}
				if (SyncingManager.ReactorBackdoorTerminalsCollection.Count > 0)
				{
					SyncingManager.ReactorBackdoorTerminalsCollection.Clear();
				}
				if (SyncingManager.uplinkReactorTerminalCollections.Count > 0)
				{
					SyncingManager.uplinkReactorTerminalCollections.Clear();
				}
				if (SyncingManager.CorruptedReactorTerminalCollections.Count > 0)
				{
					SyncingManager.CorruptedReactorTerminalCollections.Clear();
				}
			}
		}
	}
	public static class LG_DimensionPortal_Setup_Postfix
	{
		public static int TerminalPortalIndexStatic;

		public static bool CanAddTerminal;

		[HarmonyPatch(typeof(LG_DimensionPortal), "Setup")]
		public static void Postfix(LG_DimensionPortal __instance)
		{
			//IL_007c: 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_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_029b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < TerminalPortalCommandConfigSetup.PortalInfo.Count; i++)
			{
				if (TerminalPortalCommandConfigSetup.PortalInfo[i].internalEnabled && TerminalPortalCommandConfigSetup.PortalInfo[i].LevelID == RundownManager.ActiveExpedition.LevelLayoutData)
				{
					TerminalPortalIndexStatic = i;
					CanAddTerminal = true;
				}
			}
			LG_Zone val = default(LG_Zone);
			for (int j = 0; j < TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo.Count; j++)
			{
				if (CanAddTerminal && __instance.SpawnNode.m_zone.LocalIndex == TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].PortalZoneIndex && __instance.SpawnNode.m_zone.Layer.m_type == TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].PortalLayerType && __instance.SpawnNode.m_dimension.DimensionIndex == TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].PortalDimensionIndex)
				{
					Builder.Current.m_currentFloor.TryGetZoneByLocalIndex(TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].TerminalDimensionIndex, TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].TerminalLayer, TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].TerminalZoneIndex, ref val);
					((Component)val.TerminalsSpawnedInZone[TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].TerminalIndex]).gameObject.AddComponent<TerminalCommandTeleporter>().Setup(__instance, val.TerminalsSpawnedInZone[TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].TerminalIndex], TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].TerminalCommand, TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].TerminalDescription, TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].ChainedPuzzleID, TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].AddTerminalCommand, TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].TargetedDimensionIndex, TerminalPortalCommandConfigSetup.PortalInfo[TerminalPortalIndexStatic].PortalInfo[j].TargetedDimensionZoneIndex);
				}
			}
			PluginSetup.logSource.LogDebug((object)$"Portal_{__instance.m_serialNumber} is being setup");
		}
	}
}
namespace ReactorLightsOff.GameScripts
{
	public class TerminalCommandTeleporter : MonoBehaviour
	{
		public LG_ComputerTerminal Terminal;

		public LG_DimensionPortal Portal;

		public List<WardenObjectiveEventData> WardenEvents;

		public ChainedPuzzleInstance chainedPuzzleToActivate;

		public ChainedPuzzleDataBlock ChainedPuzzleData;

		public bool IsFirstTime;

		public bool noChainedPuzzle;

		public bool HasBeenReset;

		public bool AddedTerminalCommand;

		public void Setup(LG_DimensionPortal ConnectedPortal, LG_ComputerTerminal ConnectedTerminal, string Command, string CommandDescription, uint ChainedPuzzleID, bool AddTerminalCommand, eDimensionIndex TargetedDimensionIndex = 1, eLocalZoneIndex TargetedDimensionZone = 0)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: 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_0042: 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_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Expected O, but got Unknown
			Portal = ConnectedPortal;
			Terminal = ConnectedTerminal;
			HasBeenReset = false;
			AddedTerminalCommand = AddTerminalCommand;
			Portal.m_targetDimension = TargetedDimensionIndex;
			Portal.m_targetZone = TargetedDimensionZone;
			if (!AddTerminalCommand)
			{
				return;
			}
			SyncingManager.PortalTerminalCollection.Add(new PortalCommandTerminalCollection
			{
				CommandChainedPuzzleID = ChainedPuzzleID,
				CommandPortal = ConnectedPortal,
				CommandTerminal = ConnectedTerminal,
				TerminalCommand = Command,
				TerminalCommandDescription = CommandDescription
			});
			PluginSetup.logSource.LogDebug((object)$"Adding to the PortalCommandCollection: Count: {SyncingManager.PortalTerminalCollection.Count}");
			if (ChainedPuzzleID != 0)
			{
				ChainedPuzzleData = GameDataBlockBase<ChainedPuzzleDataBlock>.GetBlock(ChainedPuzzleID);
				chainedPuzzleToActivate = ChainedPuzzleManager.CreatePuzzleInstance(ChainedPuzzleData, Terminal.SpawnNode.m_area, Terminal.m_wardenObjectiveSecurityScanAlign.position, ((Component)Terminal).transform);
				chainedPuzzleToActivate.OnPuzzleSolved += Action.op_Implicit((Action)delegate
				{
					//IL_0075: Unknown result type (might be due to invalid IL or missing references)
					//IL_007a: Unknown result type (might be due to invalid IL or missing references)
					//IL_008f: Unknown result type (might be due to invalid IL or missing references)
					//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
					GuiManager.PlayerLayer.m_wardenIntel.ShowSubObjectiveMessage("", $"<color=orange>PORTAL_{Portal.m_serialNumber}</color><color=red> IS STARTING UP IN </color><color=orange>ZONE_{Portal.SpawnNode.m_zone.NavInfo.Number}</color>", false, 200f, 4.5f, (Action)null);
					pDimensionPortalState state = Portal.m_stateReplicator.State;
					state.isSequenceIncomplete = false;
					Portal.m_targetDimension = TargetedDimensionIndex;
					Portal.m_targetZone = TargetedDimensionZone;
					Portal.PortalKeyInsertSequenceDone();
					Debug.Log(Object.op_Implicit("Starting portal insert sequence"));
				});
				noChainedPuzzle = false;
			}
			else if (ChainedPuzzleID == 0)
			{
				noChainedPuzzle = true;
			}
			Terminal.m_command.AddCommand((TERM_Command)42, Command, new LocalizedText
			{
				UntranslatedText = CommandDescription
			}, (TERM_CommandRule)0);
			IsFirstTime = true;
			Terminal.AddLine($"<color=yellow>MAINTENANCE TERMINAL FOR PORTAL_{Portal.m_serialNumber}</color>", true);
			Debug.LogError(Object.op_Implicit($"Setting up Terminal_{ConnectedTerminal.m_serialNumber}: Portal - {ConnectedPortal.PublicName}_{ConnectedPortal.m_serialNumber}: Command - {Command}: Command Description - {CommandDescription}: ChainedPuzzleID - {ChainedPuzzleID}: IsFirstTime - {IsFirstTime}: noChainedPuzzle - {noChainedPuzzle}"));
		}

		public void OnCheckPointReload()
		{
			IsFirstTime = true;
			HasBeenReset = true;
			PluginSetup.logSource.LogDebug((object)"ONCHECKPOINTRELOAD: PORTAL RESET:");
		}

		public void Update()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Invalid comparison between Unknown and I4
			if (HasBeenReset && (int)GameStateManager.CurrentStateName == 10 && AddedTerminalCommand)
			{
				Terminal.AddLine($"<color=yellow>PORTAL MAINTENANCE TERMINAL FOR PORTAL_{Portal.m_serialNumber}</color>", true);
				PluginSetup.logSource.LogDebug((object)"ONCHECKPOINTLOADED: PORTAL LATE SETUP");
				HasBeenReset = false;
			}
			if (!AddedTerminalCommand || !Terminal.CommandIsUsed((TERM_Command)42) || !Terminal.m_hasInteractingPlayer || !IsFirstTime)
			{
				return;
			}
			Terminal.m_command.AddOutput((TerminalLineType)4, "Processing Command...", 3.5f, (TerminalSoundType)0, (TerminalSoundType)0);
			if (!noChainedPuzzle)
			{
				Terminal.m_command.AddOutput((TerminalLineType)4, "<color=yellow>Biometric Scan Required</color>", 3.5f, (TerminalSoundType)0, (TerminalSoundType)0);
				Terminal.m_command.AddOutputEmptyLine(0f);
				Terminal.m_command.OnEndOfQueue = Action.op_Implicit((Action)delegate
				{
					chainedPuzzleToActivate.AttemptInteract((eChainedPuzzleInteraction)0);
					Debug.Log(Object.op_Implicit("Starting chainedpuzzle"));
				});
			}
			else if (noChainedPuzzle)
			{
				Terminal.m_command.AddOutput((TerminalLineType)4, "Preparing Portal For Startup", 3.5f, (TerminalSoundType)0, (TerminalSoundType)0);
				Terminal.m_command.AddOutputEmptyLine(0f);
				Terminal.m_command.OnEndOfQueue = Action.op_Implicit((Action)delegate
				{
					GuiManager.PlayerLayer.m_wardenIntel.ShowSubObjectiveMessage("", $"<color=yellow>PORTAL_{Portal.m_serialNumber}</color><color=red> IS STARTING UP IN </color><color=yellow>ZONE_{Portal.SpawnNode.m_zone.NavInfo.Number}</color>", false, 200f, 4.5f, (Action)null);
					Portal.PortalKeyInsertSequenceDone();
					Debug.Log(Object.op_Implicit("Starting portal insert sequence"));
				});
			}
			IsFirstTime = false;
		}
	}
}
namespace ExtraSettings.StructFiles
{
	public static class EnemyCounterSync
	{
		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct EnemySync
		{
			public int CounterBeforeIncrease;

			public int LG_Layer;
		}
	}
	public static class PublicStructClass
	{
		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct DoorChangeStruct
		{
			public int ChainedPuzzleID;

			public bool CheckPointChanged;

			public int CheckPointID;

			public int DoorZoneIndex;

			public int DoorLayerType;

			public int DoorDimensionIndex;
		}

		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct DummyStruct
		{
		}

		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct ElevatorSync
		{
			public bool TimerStarted;
		}

		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct SecurityTokenStruct
		{
			public int DoorZoneIndex;

			public int DoorLayer;

			public int DoorDimensionIndex;

			public int CurrentCount;

			public int CurrentLayout;

			public int CollectedOrbIndex;
		}

		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct CodeSyncTerminalAlarm
		{
			public string VerificationCode;
		}

		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct TimeSync
		{
			public float Time;

			public bool TimerActive;

			public int Minutes;

			public int Seconds;

			public bool KillAll;
		}

		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct BoosterSync
		{
			public int BoosterEffectModifierInt;

			public int CharacterIndex;

			public float BoosterEffectAmount;
		}

		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct RandomTerminalSyncReactor
		{
			public int TerminalIndex;
		}

		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct LightsOnTerminalObjectiveStruct
		{
			public int TargetedLayer;
		}

		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct SyncingNumber
		{
			public int SyncingNumberReturned;
		}

		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct OutputSyncStruct
		{
			public int TerminalZoneIndex;

			public int TerminalLayer;

			public int TerminalDimension;

			public int TerminalIndex;

			public bool isTerminalAlarm;

			public bool isTimedDoorUnlock;

			public bool isLightsOnObjective;

			public bool isVerificationOutput;
		}

		[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
		public struct RandomTerminalAlarmSync
		{
			public int TerminalIndex;

			public int TerminalZoneIndex;

			public int TerminalLayerType;

			public int TerminalDimension;

			public int VerificationTerminalZoneIndex;

			public int VerificationTerminalLayerType;

			public int VerificationTerminalDimension;

			public int VerificationTerminalIndex;

			public int DoorZoneIndex;

			public int DoorLayerType;

			public int DoorDimension;

			public int LoopFirstIndex;

			public int LoopSecondIndex;
		}
	}
}
namespace ExtraSettings.PluginInfo
{
	[BepInPlugin("com.Breezy.ExtraSettings", "ExtraSettings", "1.0.0")]
	[BepInProcess("GTFO.exe")]
	public class PluginSetup : BasePlugin
	{
		public static bool m_RepairGeomorph = true;

		public static ManualLogSource logSource;

		public override void Load()
		{
			logSource = ((BasePlugin)this).Log;
			if (!Directory.Exists(Path.Combine(ConfigManager.CustomPath, "ExtraSettings")))
			{
				Directory.CreateDirectory(Path.Combine(ConfigManager.CustomPath, "ExtraSettings"));
			}
			HackDoorConfigSetup.Load();
			OpenDoorOnScanCompleteConfigSetup.Load();
			TerminalPortalCommandConfigSetup.Load();
			CustomReactorEventsConfigSetup.Load();
			EnemyPlayerHearBeatConfigSetup.Load();
			TimedUnlockDoorsConfigSetup.Load();
			HunterEnemyObjectiveSetup.Load();
			CustomMovableScanPositions.Load();
			RandomAlarmConfigSetup.Load();
			TerminalAlarmConfigSetup.Load();
			CustomReactorPlacementConfigSetup.Load();
			TemperatureZoneConfigSetup.Load();
			CustomLightsOnObjectiveConfigSetup.Load();
			CustomEnemySpawnPositionsConfigSetup.Load();
			TimedExpeditionConfigSetup.Load();
			CustomPrefabsConfigSetup.Load();
			RandomTerminalUplinksConfigSetup.Load();
			SpecializedCharactersConfigSetup.Load();
			ReactorInAnyZoneConfigSetup.Load();
			CustomGearConfigSetup.Load();
			CustomSpawnCapSetup.Load();
			CustomSpawnPointSetup.Load();
			CustomExtractionSetup.Load();
			TokenConfigSetup.Load();
			CustomPouncerDataSetup.Load();
			GetBackToElevatorConfigSetup.Load();
			OxygenEnvironmentSetup.Load();
			AssetShardManager.OnStartupAssetsLoaded += Action.op_Implicit((Action)delegate
			{
				RepairGeomorph(ignoreSetup: true, SetupGondola: false);
			});
			Harmony.CreateAndPatchAll(typeof(StartGame_Awake_Postfix), (string)null);
		}

		public static void RepairGeomorph(bool ignoreSetup, bool SetupGondola)
		{
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			if (m_RepairGeomorph && !ignoreSetup)
			{
				AssetShardManager.LoadShardAsync((AssetBundleName)3, (AssetBundleShard)18, (Action<AsyncOperation>)null, (LoadSceneMode)1);
				GameObject val = ((Il2CppObjectBase)AssetAPI.GetLoadedAsset("Assets/MyPrefabs/Geomorphs/ServiceGeos/Gardens_Hub_MC_01_Activator.prefab")).TryCast<GameObject>();
				logSource.LogError((object)((Object)val).name);
				Transform val2 = val.transform.FindChild("AreaA/EnvProps/ActivatorPlatform/ActivatorAlign");
				logSource.LogError((object)((Object)val2).name);
				string text = "DataExtractorDevice_DataSphere";
				LG_HSUActivator_Core[] array = ((IEnumerable<Object>)Object.FindObjectsOfTypeAll(Il2CppType.From(typeof(LG_HSUActivator_Core)))).Select((Object x) => ((Il2CppObjectBase)x).Cast<LG_HSUActivator_Core>()).ToArray();
				logSource.LogError((object)array.Length);
				LG_HSUActivator_Core[] array2 = array;
				foreach (LG_HSUActivator_Core val3 in array2)
				{
					if (((Object)val3).name == text)
					{
						LG_HSUActivator_Core val4 = Object.Instantiate<LG_HSUActivator_Core>(val3);
						((Component)val4).gameObject.transform.parent = val2;
						((Component)val4).gameObject.transform.position = val2.position;
						((Component)val4).gameObject.transform.eulerAngles = val2.eulerAngles;
						logSource.LogDebug((object)"Fixing Activator Geo");
					}
				}
				m_RepairGeomorph = false;
			}
			if (ignoreSetup)
			{
				AssetShardManager.LoadShardAsync((AssetBundleName)3, (AssetBundleShard)18, (Action<AsyncOperation>)null, (LoadSceneMode)1);
				logSource.LogError((object)"Ignoring setup, just loading shard!");
			}
			if (SetupGondola)
			{
				GameObject val5 = ((Il2CppObjectBase)AssetAPI.GetLoadedAsset("Assets/MyPrefabs/Geomorphs/TechGeomorphs/Tech_I_MC_Gondola.prefab")).TryCast<GameObject>();
				((Component)val5.transform.FindChild("Anim_Gondola/Gondola/Trigger")).gameObject.AddComponent<MovingPlatformScript>();
			}
		}

		public static void OnStartupAssetsLoad()
		{
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			string text = "assets/bundledassets/testbundle/introclip.mp4";
			logSource.LogError((object)LoadBNK(File.ReadAllBytes(ConfigManager.CustomPath + "\\HopeSound.bnk"), out var bnkID));
			logSource.LogError((object)bnkID);
			ClassInjector.RegisterTypeInIl2Cpp<AudioPlayerOnStartup>();
			MainMenuGuiLayer.Current.PageIntro.m_step = (CM_IntroStep)1;
			MainMenuGuiLayer.Current.PageIntro.m_bgScare1.clip = ((Il2CppObjectBase)AssetAPI.GetLoadedAsset(text)).TryCast<VideoClip>();
			((Component)MainMenuGuiLayer.Current.PageIntro.m_bgScare1).gameObject.active = true;
			((Component)MainMenuGuiLayer.Current.PageIntro.m_bgScare1).gameObject.transform.localPosition = new Vector3(0f, 0f, 0f);
			((Component)MainMenuGuiLayer.Current.PageIntro.m_bgScare1).transform.localScale = new Vector3(1.6f, 1.35f, 1f);
			MainMenuGuiLayer.Current.PageIntro.m_bgScare1.loopPointReached = PluginSetup.AddListener<EventHandler, Action<VideoPlayer>>(MainMenuGuiLayer.Current.PageIntro.m_bgScare1.loopPointReached, (Action<VideoPlayer>)onVideoEnd);
			MainMenuGuiLayer.Current.PageIntro.m_bgScare1.Play();
			((Component)MainMenuGuiLayer.Current.PageIntro.m_bgScare1).gameObject.AddComponent<AudioPlayerOnStartup>().StartAudio();
		}

		public static bool LoadBNK(byte[] bytes, out uint bnkID)
		{
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Invalid comparison between Unknown and I4
			try
			{
				uint num = (uint)bytes.Length;
				GCHandle gCHandle = GCHandle.Alloc(bytes, GCHandleType.Pinned);
				IntPtr intPtr = gCHandle.AddrOfPinnedObject();
				if ((intPtr.ToInt64() & 0xF) != 0)
				{
					byte[] array = new byte[(long)bytes.Length + 16L];
					IntPtr intPtr2 = GCHandle.Alloc(array, GCHandleType.Pinned).AddrOfPinnedObject();
					int destinationIndex = 0;
					if ((intPtr2.ToInt64() & 0xF) != 0)
					{
						long num2 = (intPtr2.ToInt64() + 15) & -16;
						destinationIndex = (int)(num2 - intPtr2.ToInt64());
						intPtr2 = new IntPtr(num2);
					}
					Array.Copy(bytes, 0, array, destinationIndex, bytes.Length);
					intPtr = intPtr2;
					gCHandle.Free();
				}
				return (int)AkSoundEngine.LoadBank(intPtr, num, ref bnkID) == 1;
			}
			catch (Exception)
			{
				bnkID = 0u;
				return false;
			}
		}

		public static void onVideoEnd(VideoPlayer player)
		{
			CM_PageBase.s_sound.Stop();
			((Component)player).gameObject.active = false;
			MainMenuGuiLayer.Current.PageIntro.OnSkip();
		}

		public static T1 AddListener<T1, T2>(T1 orig, T2 newDelegate) where T1 : Delegate where T2 : Delegate
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			return ((Delegate)(object)orig == (Delegate)null) ? DelegateSupport.ConvertDelegate<T1>((Delegate)newDelegate) : ((Il2CppObjectBase)Delegate.Combine((Delegate)(object)orig, (Delegate)DelegateSupport.ConvertDelegate<T1>((Delegate)newDelegate))).TryCast<T1>();
		}
	}
	public static class HackDoorConfigSetup
	{
		public static List<HackSecurityDoorConfig> SecurityInfo;

		public static string name { get; } = "HackSecurityDoor.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				SecurityInfo = JsonSerializer.Deserialize<List<HackSecurityDoorConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				SecurityInfo = new List<HackSecurityDoorConfig>();
				SecurityInfo.Add(new HackSecurityDoorConfig());
				string contents = JsonSerializer.Serialize(SecurityInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class OpenDoorOnScanCompleteConfigSetup
	{
		public static List<OpenDoorOnScanCompleteConfig> SecurityDoorInfo;

		public static string name { get; } = "OpenSecurityDoor.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				SecurityDoorInfo = JsonSerializer.Deserialize<List<OpenDoorOnScanCompleteConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				SecurityDoorInfo = new List<OpenDoorOnScanCompleteConfig>();
				SecurityDoorInfo.Add(new OpenDoorOnScanCompleteConfig());
				string contents = JsonSerializer.Serialize(SecurityDoorInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class TerminalPortalCommandConfigSetup
	{
		public static List<TerminalPortalConfigMain> PortalInfo;

		public static string name { get; } = "PortalTerminalCommand.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				PortalInfo = JsonSerializer.Deserialize<List<TerminalPortalConfigMain>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				PortalInfo = new List<TerminalPortalConfigMain>();
				PortalInfo.Add(new TerminalPortalConfigMain());
				string contents = JsonSerializer.Serialize(PortalInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class EnemyPlayerHearBeatConfigSetup
	{
		public static List<EnemyStaminaProximityConfig> EnemyInfo;

		public static string name { get; } = "EnemyProximity.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				EnemyInfo = JsonSerializer.Deserialize<List<EnemyStaminaProximityConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				EnemyInfo = new List<EnemyStaminaProximityConfig>();
				EnemyInfo.Add(new EnemyStaminaProximityConfig());
				string contents = JsonSerializer.Serialize(EnemyInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class TimedUnlockDoorsConfigSetup
	{
		public static List<TimedDoorUnlockConfig> TimedDoorsInfo;

		public static string name { get; } = "TimedUnlockDoors.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				TimedDoorsInfo = JsonSerializer.Deserialize<List<TimedDoorUnlockConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				TimedDoorsInfo = new List<TimedDoorUnlockConfig>();
				TimedDoorsInfo.Add(new TimedDoorUnlockConfig());
				string contents = JsonSerializer.Serialize(TimedDoorsInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class CustomReactorEventsConfigSetup
	{
		public static List<CustomReactorEventsConfig> ReactorInfo;

		public static string name { get; } = "ReactorEvents.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				ReactorInfo = JsonSerializer.Deserialize<List<CustomReactorEventsConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				ReactorInfo = new List<CustomReactorEventsConfig>();
				ReactorInfo.Add(new CustomReactorEventsConfig());
				string contents = JsonSerializer.Serialize(ReactorInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class HunterEnemyObjectiveSetup
	{
		public static List<HunterMainConfig> HuntedEnemiesInfo;

		public static string name { get; } = "HuntingEnemyObjective.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				HuntedEnemiesInfo = JsonSerializer.Deserialize<List<HunterMainConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				HuntedEnemiesInfo = new List<HunterMainConfig>();
				HuntedEnemiesInfo.Add(new HunterMainConfig());
				string contents = JsonSerializer.Serialize(HuntedEnemiesInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class CustomMovableScanPositions
	{
		public static List<CustomScanPositionsMainConfig> ChainedPuzzleInfo;

		public static string name { get; } = "MovableScans.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				ChainedPuzzleInfo = JsonSerializer.Deserialize<List<CustomScanPositionsMainConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				ChainedPuzzleInfo = new List<CustomScanPositionsMainConfig>();
				ChainedPuzzleInfo.Add(new CustomScanPositionsMainConfig());
				string contents = JsonSerializer.Serialize(ChainedPuzzleInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class CustomLightsOnObjectiveConfigSetup
	{
		public static List<LightsOnObjectiveMainConfig> LightsOnInfo;

		public static string name { get; } = "PowerAllZones.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				LightsOnInfo = JsonSerializer.Deserialize<List<LightsOnObjectiveMainConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				LightsOnInfo = new List<LightsOnObjectiveMainConfig>();
				LightsOnInfo.Add(new LightsOnObjectiveMainConfig());
				string contents = JsonSerializer.Serialize(LightsOnInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class RandomAlarmConfigSetup
	{
		public static List<RandomAlarmMainConfig> RandomizedDoorsInfo;

		public static string name { get; } = "RandomChainedPuzzles.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				RandomizedDoorsInfo = JsonSerializer.Deserialize<List<RandomAlarmMainConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				RandomizedDoorsInfo = new List<RandomAlarmMainConfig>();
				RandomizedDoorsInfo.Add(new RandomAlarmMainConfig());
				string contents = JsonSerializer.Serialize(RandomizedDoorsInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class TerminalAlarmConfigSetup
	{
		public static List<TerminalAlarmMainConfig> TerminalAlarmsInfo;

		public static string name { get; } = "TerminalAlarm.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				TerminalAlarmsInfo = JsonSerializer.Deserialize<List<TerminalAlarmMainConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				TerminalAlarmsInfo = new List<TerminalAlarmMainConfig>();
				TerminalAlarmsInfo.Add(new TerminalAlarmMainConfig());
				string contents = JsonSerializer.Serialize(TerminalAlarmsInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class CustomReactorPlacementConfigSetup
	{
		public static List<CustomReactorsMainConfig> CustomReactorInfo;

		public static string name { get; } = "ReactorPlacements.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				CustomReactorInfo = JsonSerializer.Deserialize<List<CustomReactorsMainConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				CustomReactorInfo = new List<CustomReactorsMainConfig>();
				CustomReactorInfo.Add(new CustomReactorsMainConfig());
				string contents = JsonSerializer.Serialize(CustomReactorInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class TemperatureZoneConfigSetup
	{
		public static List<TemperatureZoneMainConfig> TemperatureInfo;

		public static string name { get; } = "Temperature.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				TemperatureInfo = JsonSerializer.Deserialize<List<TemperatureZoneMainConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				TemperatureInfo = new List<TemperatureZoneMainConfig>();
				TemperatureInfo.Add(new TemperatureZoneMainConfig());
				string contents = JsonSerializer.Serialize(TemperatureInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class CustomEnemySpawnPositionsConfigSetup
	{
		public static List<CustomEnemySpawnPositionsMain> EnemySpawnPositions;

		public static string name { get; } = "CustomEnemySpawns.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				EnemySpawnPositions = JsonSerializer.Deserialize<List<CustomEnemySpawnPositionsMain>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				EnemySpawnPositions = new List<CustomEnemySpawnPositionsMain>();
				EnemySpawnPositions.Add(new CustomEnemySpawnPositionsMain());
				string contents = JsonSerializer.Serialize(EnemySpawnPositions, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class TimedExpeditionConfigSetup
	{
		public static List<TimedExpeditionMainConfig> TimerSettingsMain;

		public static string name { get; } = "TimedExpeditions.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				TimerSettingsMain = JsonSerializer.Deserialize<List<TimedExpeditionMainConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				TimerSettingsMain = new List<TimedExpeditionMainConfig>();
				TimerSettingsMain.Add(new TimedExpeditionMainConfig());
				string contents = JsonSerializer.Serialize(TimerSettingsMain, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class CustomPrefabsConfigSetup
	{
		public static List<CustomPrefabConfigMain> CustomPrefabInfo;

		public static string name { get; } = "CustomPrefabs.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				CustomPrefabInfo = JsonSerializer.Deserialize<List<CustomPrefabConfigMain>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				CustomPrefabInfo = new List<CustomPrefabConfigMain>();
				CustomPrefabInfo.Add(new CustomPrefabConfigMain());
				string contents = JsonSerializer.Serialize(CustomPrefabInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class RandomTerminalUplinksConfigSetup
	{
		public static List<RandomTerminalUplinksMainConfig> TerminalUplinksInfo;

		public static string name { get; } = "RandomUplinks.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				TerminalUplinksInfo = JsonSerializer.Deserialize<List<RandomTerminalUplinksMainConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				TerminalUplinksInfo = new List<RandomTerminalUplinksMainConfig>();
				TerminalUplinksInfo.Add(new RandomTerminalUplinksMainConfig());
				string contents = JsonSerializer.Serialize(TerminalUplinksInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class SpecializedCharactersConfigSetup
	{
		public static List<SpecializedCharacters> CharacterInfos;

		public static string name { get; } = "SpecializedCharacters.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				CharacterInfos = JsonSerializer.Deserialize<List<SpecializedCharacters>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
		}
	}
	public static class ReactorInAnyZoneConfigSetup
	{
		public static List<ReactorCustomZone> CustomReactors;

		public static string name { get; } = "ReactorAnyZone.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				CustomReactors = JsonSerializer.Deserialize<List<ReactorCustomZone>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				CustomReactors = new List<ReactorCustomZone>();
				CustomReactors.Add(new ReactorCustomZone());
				string contents = JsonSerializer.Serialize(CustomReactors, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class CustomGearConfigSetup
	{
		public static List<PublicGearModifier> GearInfos;

		public static string name { get; } = "CustomGear.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				GearInfos = JsonSerializer.Deserialize<List<PublicGearModifier>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				GearInfos = new List<PublicGearModifier>();
				GearInfos.Add(new PublicGearModifier());
				string contents = JsonSerializer.Serialize(GearInfos, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class CustomSpawnCapSetup
	{
		public static List<CustomEnemySpawnCap> SpawnCapInfo;

		public static string name { get; } = "EnemyCost.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				SpawnCapInfo = JsonSerializer.Deserialize<List<CustomEnemySpawnCap>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				SpawnCapInfo = new List<CustomEnemySpawnCap>();
				SpawnCapInfo.Add(new CustomEnemySpawnCap());
				string contents = JsonSerializer.Serialize(SpawnCapInfo, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class CustomSpawnPointSetup
	{
		public static List<CharacterSpawnPointMain> CharacterSpawnInfos;

		public static string name { get; } = "CustomSpawnPoints.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				CharacterSpawnInfos = JsonSerializer.Deserialize<List<CharacterSpawnPointMain>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				CharacterSpawnInfos = new List<CharacterSpawnPointMain>();
				CharacterSpawnInfos.Add(new CharacterSpawnPointMain());
				string contents = JsonSerializer.Serialize(CharacterSpawnInfos, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class CustomExtractionSetup
	{
		public static List<ExitSpawnPointOverride> ExtractionPoints;

		public static string name { get; } = "ExtractionPoint.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				ExtractionPoints = JsonSerializer.Deserialize<List<ExitSpawnPointOverride>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				ExtractionPoints = new List<ExitSpawnPointOverride>();
				ExtractionPoints.Add(new ExitSpawnPointOverride());
				string contents = JsonSerializer.Serialize(ExtractionPoints, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class TokenConfigSetup
	{
		public static List<TriggersTokensMain> TokenInfos;

		public static string name { get; } = "ExtraSecurityScans.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				TokenInfos = JsonSerializer.Deserialize<List<TriggersTokensMain>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
			else
			{
				TokenInfos = new List<TriggersTokensMain>();
				TokenInfos.Add(new TriggersTokensMain());
				string contents = JsonSerializer.Serialize(TokenInfos, new JsonSerializerOptions
				{
					IncludeFields = true,
					WriteIndented = true,
					AllowTrailingCommas = true,
					ReadCommentHandling = JsonCommentHandling.Skip
				});
				File.WriteAllText(path, contents);
				PluginSetup.logSource.LogWarning((object)(name + " Has Been Created Successfully!"));
			}
		}
	}
	public static class CustomPouncerDataSetup
	{
		public static List<PouncerConfigData> PouncerInfos;

		public static string name { get; } = "PouncerCustom.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				PouncerInfos = JsonSerializer.Deserialize<List<PouncerConfigData>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
		}
	}
	public static class GetBackToElevatorConfigSetup
	{
		public static List<BackToElevatorMainConfig> ElevatorInfos;

		public static string name { get; } = "Elevator.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				ElevatorInfos = JsonSerializer.Deserialize<List<BackToElevatorMainConfig>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
		}
	}
	public static class OxygenEnvironmentSetup
	{
		public static List<OxygenConfigMain> OxygenSettings;

		public static string name { get; } = "Oxygen.json";


		public static void Load()
		{
			string path = Path.Combine(ConfigManager.CustomPath, "ExtraSettings", name);
			if (File.Exists(path))
			{
				OxygenSettings = JsonSerializer.Deserialize<List<OxygenConfigMain>>(File.ReadAllText(path), new JsonSerializerOptions
				{
					ReadCommentHandling = JsonCommentHandling.Skip,
					PropertyNameCaseInsensitive = true,
					IncludeFields = true
				});
				PluginSetup.logSource.LogDebug((object)(name + " Has Loaded Successfully!"));
			}
		}
	}
	public static class StartGame_Awake_Postfix
	{
		public static Dictionary<string, Shader> ShaderDictionary = new Dictionary<string, Shader>();

		public static Dictionary<uint, PouncerDataContainer> PouncerDataDictionary = new Dictionary<uint, PouncerDataContainer>();

		public static void FindPouncerData()
		{
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_01db: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_026d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0277: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_033f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0349: Unknown result type (might be due to invalid IL or missing references)
			//IL_034e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0493: Unknown result type (might be due to invalid IL or missing references)
			foreach (EnemyDataBlock allBlock in GameDataBlockBase<EnemyDataBlock>.GetAllBlocks())
			{
				if (CustomPouncerDataSetup.PouncerInfos.Count <= 0)
				{
					continue;
				}
				foreach (PouncerConfigData pouncerInfo in CustomPouncerDataSetup.PouncerInfos)
				{
					if (pouncerInfo.EnemyId == ((GameDataBlockBase<EnemyDataBlock>)(object)allBlock).persistentID && pouncerInfo.internalEnabled && !PouncerDataDictionary.ContainsKey(pouncerInfo.EnemyId))
					{
						PouncerDataContainer val = ((Il2CppObjectBase)ScriptableObject.CreateInstance(typeof(PouncerDataContainer).ToString())).TryCast<PouncerDataContainer>();
						((Object)val).name = $"{((GameDataBlockBase<EnemyDataBlock>)(object)allBlock).name}_{pouncerInfo.EnemyId}";
						val.m_DashCooldown = new Vector2(pouncerInfo.PouncerData.DashCoolDown.Min, pouncerInfo.PouncerData.DashCoolDown.Max);
						val.DashMaxTime = pouncerInfo.PouncerData.DashMaxTime;
						val.ChargeDuration = pouncerInfo.PouncerData.ChargeDuration;
						val.ConsumeDuration = pouncerInfo.PouncerData.ConsumeDuration;
						val.DashEndPhaseDistance = 6f;
						val.DashEndAnimationLength = 1f;
						val.ChargeStaggerDamageThreshold = pouncerInfo.PouncerData.ChargeStaggerDamageThreshold;
						val.DashStaggerDamageThreshold = pouncerInfo.PouncerData.DashStaggerDamageThreshold;
						val.StaggerDuration = pouncerInfo.PouncerData.StaggerDuration;
						val.FaceToTargetDuringProwlingDistance = 16.5f;
						val.StaggerLeadsToAfterHeld = true;
						val.EnableOffMeshLinkDash = false;
						val.LOSRequiredForDash = pouncerInfo.PouncerData.LOSRequiredForDash;
						val.DashStaggerUsesHeavyHitreaction = true;
						val.Enable1PConsumeVFX = true;
						val.Enable3PConsumeVFX = true;
						DamageShapeData damageShapeData = default(DamageShapeData);
						damageShapeData.Radius = 6.6f;
						damageShapeData.Angle = 210.1f;
						val.DamageShapeData = damageShapeData;
						PouncerSoundData pouncerSoundData = default(PouncerSoundData);
						pouncerSoundData.AttackCharge = 2040824805u;
						pouncerSoundData.AttackHit = 1034385728u;
						pouncerSoundData.AttackMiss = 1149851817u;
						pouncerSoundData.DashStart = 3726964003u;
						pouncerSoundData.HeldIdle = 376939216u;
						pouncerSoundData.HeldSpitOut = 2870456237u;
						pouncerSoundData.IdleGrowl = 3799706438u;
						pouncerSoundData.TentacleLoop = 3217748688u;
						val.PouncerSoundData = pouncerSoundData;
						MovementModificationData dashMovementModifier = val.DashMovementModifier;
						dashMovementModifier.SpeedModifier = pouncerInfo.PouncerData.DashMovementModifier.SpeedModifier;
						dashMovementModifier.AccelerationModifier = pouncerInfo.PouncerData.DashMovementModifier.AccelerationModifier;
						val.DashMovementModifier = dashMovementModifier;
						HeldPathingData combatStatePathingData = val.CombatStatePathingData;
						combatStatePathingData.RecursiveReachableNodeSearch = true;
						combatStatePathingData.DstChangeRate = pouncerInfo.PouncerData.CombatPathing.DistanceChangeRate;
						combatStatePathingData.TryToKeepDistance = pouncerInfo.PouncerData.CombatPathing.TryToKeepDistance;
						combatStatePathingData.MovementModifier.AccelerationModifier = pouncerInfo.PouncerData.CombatPathing.SpeedModificationData.AccelerationModifier;
						combatStatePathingData.MovementModifier.SpeedModifier = pouncerInfo.PouncerData.CombatPathing.SpeedModificationData.SpeedModifier;
						val.CombatStatePathingData = combatStatePathingData;
						HeldStateData heldStateData = val.HeldStateData;
						heldStateData.ValidatePlayerDimension = true;
						heldStateData.PathingData.RecursiveReachableNodeSearch = true;
						heldStateData.AfterHeldRunAwayDuration = pouncerInfo.PouncerData.HeldData.AfterHeldRunAwayDuration;
						heldStateData.DamageOnStartHolding = pouncerInfo.PouncerData.HeldData.DamageOnStartHolding;
						heldStateData.DamageToPlayerPerSecond = pouncerInfo.PouncerData.HeldData.DamageToPlayerPerSecond;
						heldStateData.HeldStartAnimationDuration = pouncerInfo.PouncerData.HeldData.HeldStartAnimationDuration;
						heldStateData.MaxHeldDuration = pouncerInfo.PouncerData.HeldData.MaxHeldDuration;
						heldStateData.SpitOutStateDuration = pouncerInfo.PouncerData.HeldData.SpitOutStateDuration;
						heldStateData.PathingData.DstChangeRate = pouncerInfo.PouncerData.HeldData.PathingData.DistanceChangeRate;
						heldStateData.PathingData.TryToKeepDistance = pouncerInfo.PouncerData.HeldData.PathingData.TryToKeepDistance;
						heldStateData.PathingData.MovementModifier.AccelerationModifier = pouncerInfo.PouncerData.HeldData.PathingData.SpeedModificationData.AccelerationModifier;
						heldStateData.PathingData.MovementModifier.SpeedModifier = pouncerInfo.PouncerData.HeldData.PathingData.SpeedModificationData.SpeedModifier;
						val.HeldStateData = heldStateData;
						PouncerDataDictionary.Add(pouncerInfo.EnemyId, val);
						PluginSetup.logSource.LogDebug((object)$"Creating a data container for custom pouncer ID {pouncerInfo.EnemyId}");
					}
				}
			}
		}

		public static void AttachShadersToObject()
		{
			//IL_0bcc: Unknown result type (might be due to invalid IL or missing references)
			//IL_06bc: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < CustomPrefabsConfigSetup.CustomPrefabInfo.Count; i++)
			{
				if (CustomPrefabsConfigSetup.CustomPrefabInfo[i].ShaderPathsForDictionary.Count > 0)
				{
					foreach (ShaderDictionaryFind item in CustomPrefabsConfigSetup.CustomPrefabInfo[i].ShaderPathsForDictionary)
					{
						ShaderDictionary.Add(item.KeyWord, Shader.Find(item.ShaderPath));
						PluginSetup.logSource.LogDebug((object)("Adding Shader: " + item.ShaderPath + " With keyword: " + item.KeyWord));
					}
				}
				if (CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart.Count <= 0)
				{
					continue;
				}
				for (int j = 0; j < CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart.Count; j++)
				{
					GameObject val = ((Il2CppObjectBase)AssetAPI.GetLoadedAsset(CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].PrefabPath)).TryCast<GameObject>();
					val.layer = CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].LayerType;
					if (CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].AutomateShaders)
					{
						foreach (Renderer componentsInChild in val.GetComponentsInChildren<Renderer>())
						{
							foreach (Material item2 in (Il2CppArrayBase<Material>)(object)componentsInChild.materials)
							{
								if (!CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].NamesToExludeFromAutomation.Contains(((Object)item2.shader).name))
								{
									item2.shader = Shader.Find(((Object)item2.shader).name);
									PluginSetup.logSource.LogDebug((object)("Adding shader with name: " + ((Object)item2.shader).name + " to " + ((Object)((Component)componentsInChild).gameObject).name));
								}
							}
						}
					}
					if (CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo.Count > 0)
					{
						for (int k = 0; k < CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo.Count; k++)
						{
							ShaderDictionary.TryGetValue(CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].ShaderName, out var value);
							if (CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].ApplyToAll)
							{
								foreach (Renderer componentsInChild2 in ((Component)val.transform.FindChild(CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].ChildPath)).GetComponentsInChildren<Renderer>())
								{
									if (!CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].NamesToExlude.Contains(((Object)((Component)componentsInChild2).gameObject).name))
									{
										((Il2CppArrayBase<Material>)(object)componentsInChild2.materials)[CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].MaterialIndex].shader = value;
										PluginSetup.logSource.LogDebug((object)("Adding shader with name: " + ((Object)value).name + " to " + ((Object)((Component)componentsInChild2).gameObject).name));
									}
									else
									{
										PluginSetup.logSource.LogDebug((object)("Detecting that the object is excluded! Object Name: " + ((Object)((Component)componentsInChild2).gameObject).name));
									}
								}
							}
							else if (CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].UsingMeshRenderer)
							{
								((Il2CppArrayBase<Material>)(object)((Renderer)((Component)val.transform.FindChild(CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].ChildPath)).gameObject.GetComponent<MeshRenderer>()).materials)[CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].MaterialIndex].shader = value;
								PluginSetup.logSource.LogDebug((object)("Adding shader with name: " + ((Object)value).name + " To Child: " + CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].ChildPath + " Attached to CreatedPrefab: " + ((Object)val).name));
							}
							if (CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].PropertyEdits.Count <= 0)
							{
								continue;
							}
							foreach (ShaderPropertiesEdit propertyEdit in CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].PropertyEdits)
							{
								if (propertyEdit.IsColor && ((Il2CppArrayBase<Material>)(object)((Renderer)((Component)val.transform.FindChild(CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].ChildPath)).gameObject.GetComponent<MeshRenderer>()).materials)[CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].MaterialIndex].HasProperty(propertyEdit.PropertyToEdit))
								{
									((Il2CppArrayBase<Material>)(object)((Renderer)((Component)val.transform.FindChild(CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].ChildPath)).gameObject.GetComponent<MeshRenderer>()).materials)[CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].MaterialIndex].SetColor(propertyEdit.PropertyToEdit, propertyEdit.ColorValue);
									PluginSetup.logSource.LogDebug((object)("Overriding color property: " + propertyEdit.PropertyToEdit));
								}
								if (propertyEdit.IsFloat && ((Il2CppArrayBase<Material>)(object)((Renderer)((Component)val.transform.FindChild(CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].ChildPath)).gameObject.GetComponent<MeshRenderer>()).materials)[CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].MaterialIndex].HasProperty(propertyEdit.PropertyToEdit))
								{
									((Il2CppArrayBase<Material>)(object)((Renderer)((Component)val.transform.FindChild(CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].ChildPath)).gameObject.GetComponent<MeshRenderer>()).materials)[CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].MaterialIndex].SetFloat(propertyEdit.PropertyToEdit, propertyEdit.FloatValue);
									PluginSetup.logSource.LogDebug((object)("Overriding float property: " + propertyEdit.PropertyToEdit));
								}
								if (propertyEdit.IsBool && ((Il2CppArrayBase<Material>)(object)((Renderer)((Component)val.transform.FindChild(CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].ChildPath)).gameObject.GetComponent<MeshRenderer>()).materials)[CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].MaterialIndex].HasProperty(propertyEdit.PropertyToEdit))
								{
									MaterialExtensions.SetKeywordEnabled(((Il2CppArrayBase<Material>)(object)((Renderer)((Component)val.transform.FindChild(CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].ChildPath)).gameObject.GetComponent<MeshRenderer>()).materials)[CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].ShaderInfo[k].MaterialIndex], propertyEdit.PropertyToEdit, propertyEdit.BoolValue);
									PluginSetup.logSource.LogDebug((object)("Overriding bool property: " + propertyEdit.PropertyToEdit));
								}
							}
						}
					}
					if (!CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].isGeomorph)
					{
						continue;
					}
					if (CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].AddGeomorphComponent)
					{
						LG_Geomorph val2 = val.AddComponent<LG_Geomorph>();
						val2.m_geoPrefab = val;
						val2.m_goShapeType = (LG_GeomorphShapeType)0;
						val2.m_plugs = new List<LG_Plug>();
						val2.m_prefabSpawners = new Il2CppReferenceArray<LG_PrefabSpawner>(0L);
						val2.m_areas = new Il2CppReferenceArray<LG_Area>(0L);
						val2.m_randomSelectors = new Il2CppReferenceArray<LG_RandomSelectorBase>(0L);
						PluginSetup.logSource.LogWarning((object)("Attaching geomorph and geomorphnodevolume to GameObject: " + ((Object)val).name));
					}
					for (int l = 0; l < CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].Areas.Count; l++)
					{
						GameObject gameObject = ((Component)val.transform.FindChild(CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].Areas[l].ChildPathForArea)).gameObject;
						if (CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].Areas[l].AddAreaComponent)
						{
							gameObject.gameObject.AddComponent<LG_Area>();
						}
						((Component)gameObject.gameObject.transform.FindChild(CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].Areas[l].AIGraphSourcePath)).gameObject.AddComponent<LG_AreaAIGraphSource>();
						if (CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].Areas[l].GatePaths.Length != 0)
						{
							for (int m = 0; m < CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].Areas[l].GatePaths.Length; m++)
							{
								LG_Plug val3 = ((Component)gameObject.gameObject.transform.FindChild(CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].Areas[l].GatePaths[m])).gameObject.AddComponent<LG_Plug>();
								((LG_ZoneExpander)val3).m_subComplex = CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].Areas[l].SubComplexTypeForGates;
								PluginSetup.logSource.LogWarning((object)("Adding gate to ChildPath: " + CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].Areas[l].GatePaths[m]));
							}
						}
						if (CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].Areas[l].Markers.Count <= 0)
						{
							continue;
						}
						foreach (MarkerInfo marker in CustomPrefabsConfigSetup.CustomPrefabInfo[i].OnGameStart[j].Areas[l].Markers)
						{
							switch (marker.MarkerType)
							{
							case 1:
							{
								MiningRefineryMarkerProducer val6 = ((Component)gameObject.gameObject.transform.FindChild(marker.MarkerPath)).gameObject.AddComponent<MiningRefineryMarkerProducer>();
								val6.m_markerDataBlockID = marker.MarkerPersistentID;
								PluginSetup.logSource.LogWarning((object)"Adding MiningRefineryMarker");
								break;
							}
							case 2:
							{
								TechDataCenterMarkerProducer val5 = ((Component)gameObject.gameObject.transform.FindChild(marker.MarkerPath)).gameObject.AddComponent<TechDataCenterMarkerProducer>();
								val5.m_markerDataBlockID = marker.MarkerPersistentID;
								PluginSetup.logSource.LogWarning((object)"Adding TechDataCenterMarker");
								break;
							}
							case 3:
							{
								ServiceFloodwaysMarkerProducer val4 = ((Component)gameObject.gameObject.transform.FindChild(marker.MarkerPath)).gameObject.AddComponent<ServiceFloodwaysMarkerProducer>();
								val4.m_markerDataBlockID = marker.MarkerPersistentID;
								PluginSetup.logSource.LogWarning((object)"Adding ServiceFloodwaysMarker");
								break;
							}
							}
						}
					}
				}
			}
		}

		[HarmonyPatch(typeof(StartMainGame), "Awake")]
		public static void Postfix()
		{
			AssetAPI.OnAssetBundlesLoaded += delegate
			{
				AttachShadersToObject();
			};
			AssetShardManager.OnEnemyAssetsLoaded += Action.op_Implicit((Action)delegate
			{
				FindPouncerData();
			});
			Harmony.CreateAndPatchAll(typeof(LG_SecurityDoor_Locks_SetupForChainedPuzzle_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(LG_DimensionPortal_Setup_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(Builder_BuildDone_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(LG_WardenObjective_OnBuildDone_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(LG_WardenObjective_Reactor_Update_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(LG_PowerGenerator_Core_Setup_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(LG_PowerGenerator_Core_SyncStatusChanged_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(ES_Dead_CommonEnter_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(PlayerAgent_Update_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(ChainedPuzzleInstance_SetupMovement_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(Builder_Build_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(EnemyAgent_Setup_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(ResetManager), (string)null);
			Harmony.CreateAndPatchAll(typeof(CP_BasicMovable_UpdateMovementRoutine_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(CP_PlayerScanner_StopScan_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(GS_InLevel_Enter_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(GameStateManager_Update_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(LG_ComputerTerminalCommandInterpreter_ReceiveCommand_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(BulletWeapon_UnWield_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(BulletWeapon_Update_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(MWS_Charge_Exit_Postifx), (string)null);
			Harmony.CreateAndPatchAll(typeof(MWS_Charge_Enter_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(ElevatorShaftLanding_OnBuildDone_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(OnCheckPointSavedManager), (string)null);
			Harmony.CreateAndPatchAll(typeof(LG_PopulateFunctionMarkersInZoneJob_TriggerFunctionBuilder_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(LG_Distribute_WardenObjective_Build_Prefix), (string)null);
			Harmony.CreateAndPatchAll(typeof(BioGearSetup), (string)null);
			Harmony.CreateAndPatchAll(typeof(BulletWeapon_UpdateAmmoStatus_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(BulletWeapon_Fire_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(Snet_SessionHub_OnJoin_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(Snet_SessionHub_OnLeave_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(LG_WardenObjective_Reactor_Start_Postfix), (string)null);
			Harmony.CreateAndPatchAll(typeof(PlayerAgent_Setup_Postfix), (string)null);
			Harmony.Cr