Decompiled source of AdvancedWardenObjective v2.4.1

AdvancedWardenObjective.dll

Decompiled 28 minutes ago
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Text.RegularExpressions;
using AIGraph;
using AK;
using AWO.CustomFields;
using AWO.Jsons;
using AWO.Modules.TSL;
using AWO.Modules.WEE;
using AWO.Modules.WEE.Detours;
using AWO.Modules.WEE.Events;
using AWO.Modules.WEE.JsonInjects;
using AWO.Modules.WEE.Replicators;
using AWO.Modules.WOE;
using AWO.Sessions;
using AWO.Utils;
using Agents;
using AmorLib.API;
using AmorLib.Events;
using AmorLib.Networking.StateReplicators;
using AmorLib.Utils;
using AmorLib.Utils.Extensions;
using AmorLib.Utils.JsonElementConverters;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using BepInEx.Unity.IL2CPP.Hook;
using BepInEx.Unity.IL2CPP.Utils;
using BepInEx.Unity.IL2CPP.Utils.Collections;
using CellMenu;
using ChainedPuzzles;
using Enemies;
using Expedition;
using GTFO.API;
using GTFO.API.Extensions;
using GTFO.API.Utilities;
using GameData;
using HarmonyLib;
using Il2CppInterop.Runtime;
using Il2CppInterop.Runtime.Attributes;
using Il2CppInterop.Runtime.Injection;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppInterop.Runtime.Runtime;
using Il2CppJsonNet;
using Il2CppJsonNet.Linq;
using Il2CppSystem;
using Il2CppSystem.Collections.Generic;
using InjectLib.FieldInjection;
using InjectLib.JsonNETInjection;
using InjectLib.JsonNETInjection.Converter;
using InjectLib.JsonNETInjection.Handler;
using InjectLib.JsonNETInjection.Supports;
using LevelGeneration;
using Localization;
using Microsoft.CodeAnalysis;
using Player;
using PlayerCoverage;
using SNetwork;
using TMPro;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("AdvancedWardenObjective")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+2a1763ba7e7805886641a4091a6978cab2538bb0")]
[assembly: AssemblyProduct("AdvancedWardenObjective")]
[assembly: AssemblyTitle("AdvancedWardenObjective")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsUnmanagedAttribute : Attribute
	{
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace AWO
{
	internal static class Configuration
	{
		private static readonly ConfigFile Config;

		private static readonly ConfigEntry<bool> Config_VerboseEnabled;

		public static bool VerboseEnabled => Config_VerboseEnabled.Value;

		static Configuration()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			Config = new ConfigFile(Path.Combine(Paths.ConfigPath, "AWO.cfg"), true);
			string text = "General Settings";
			string text2 = "Enable Verbose Debug Logging";
			string text3 = "Prints some additional logs to the console, which may be useful for rundown devs";
			Config_VerboseEnabled = Config.Bind<bool>(text, text2, false, text3);
		}

		public static void Init()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			LiveEditListener val = LiveEdit.CreateListener(Paths.ConfigPath, "AWO.cfg", false);
			val.FileChanged += new LiveEditEventHandler(OnFileChanged);
			bool flag = default(bool);
			BepInExDebugLogInterpolatedStringHandler val2 = new BepInExDebugLogInterpolatedStringHandler(28, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Verbose logging is enabled: ");
				((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<bool>(VerboseEnabled);
			}
			Logger.Debug(val2);
		}

		private static void OnFileChanged(LiveEditEventArgs e)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			bool flag = default(bool);
			BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(21, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Config file changed: ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(e.FullPath);
			}
			Logger.Warn(val);
			Config.Reload();
		}
	}
	[BepInPlugin("GTFO.AWO", "AWO", "2.4.1")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	internal sealed class EntryPoint : BasePlugin
	{
		internal static class Coroutines
		{
			public static float CountdownStarted { get; set; }
		}

		internal static class TimerMods
		{
			public static float TimeModifier { get; set; }

			public static Color TimerColor { get; set; }

			public static float SpeedModifier { get; set; }

			public static LocaleText TimerTitleText { get; set; }

			public static LocaleText TimerBodyText { get; set; }
		}

		public static BlackoutState BlackoutState { get; private set; } = new BlackoutState();


		public static SessionRandReplicator SessionRand { get; private set; } = new SessionRandReplicator();


		public override void Load()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			Configuration.Init();
			WardenEventExt.Initialize();
			new Harmony("AWO.Harmony").PatchAll();
			AssetAPI.OnStartupAssetsLoaded += delegate
			{
				LevelFailUpdateState.AssetLoaded();
			};
			LevelAPI.OnBuildDone += OnBuildDone;
			LevelAPI.OnLevelCleanup += OnLevelCleanup;
			WOEventDataFields.Init();
			SerialLookupManager.Init();
			Logger.Info("AWO is done loading!");
		}

		private void OnBuildDone()
		{
			BlackoutState.Setup();
			SessionRand.Setup(1u, RundownManager.GetActiveExpeditionData().sessionSeed);
		}

		private void OnLevelCleanup()
		{
			WardenObjectiveManager.m_exitEventsTriggered = false;
			BlackoutState.Cleanup();
			SessionRand.Cleanup();
		}
	}
	internal static class Logger
	{
		private static readonly ManualLogSource MLS;

		private const string Dev = "Dev";

		static Logger()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			MLS = new ManualLogSource("AWO");
			Logger.Sources.Add((ILogSource)(object)MLS);
		}

		private static string Format(string module, object msg)
		{
			return $"[{module}] {msg}";
		}

		public static void Info(BepInExInfoLogInterpolatedStringHandler handler)
		{
			MLS.LogInfo(handler);
		}

		public static void Info(string str)
		{
			MLS.LogMessage((object)str);
		}

		public static void Info(string module, object data)
		{
			MLS.LogMessage((object)Format(module, data));
		}

		public static void Debug(BepInExDebugLogInterpolatedStringHandler handler)
		{
			MLS.LogDebug(handler);
		}

		public static void Debug(string str)
		{
			MLS.LogDebug((object)str);
		}

		public static void Debug(string module, object data)
		{
			MLS.LogDebug((object)Format(module, data));
		}

		public static void Error(BepInExErrorLogInterpolatedStringHandler handler)
		{
			MLS.LogError(handler);
		}

		public static void Error(string str)
		{
			MLS.LogError((object)str);
		}

		public static void Error(string module, object data)
		{
			MLS.LogError((object)Format(module, data));
		}

		public static void Warn(BepInExWarningLogInterpolatedStringHandler handler)
		{
			MLS.LogWarning(handler);
		}

		public static void Warn(string str)
		{
			MLS.LogWarning((object)str);
		}

		public static void Warn(string module, object data)
		{
			MLS.LogWarning((object)Format(module, data));
		}

		public static void Verbose(LogLevel level, string data)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Invalid comparison between Unknown and I4
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Invalid comparison between Unknown and I4
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Invalid comparison between Unknown and I4
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Invalid comparison between Unknown and I4
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Invalid comparison between Unknown and I4
			if (!Configuration.VerboseEnabled)
			{
				return;
			}
			if ((int)level <= 4)
			{
				if ((int)level != 2)
				{
					if ((int)level == 4)
					{
						Warn("Dev", data);
					}
				}
				else
				{
					Error("Dev", data);
				}
			}
			else if ((int)level != 16)
			{
				if ((int)level == 32)
				{
					Debug("Dev", data);
				}
			}
			else
			{
				Info("Dev", data);
			}
		}
	}
}
namespace AWO.Utils
{
	public static class NumberExtension
	{
		public static bool IsPrime(this int num)
		{
			if (num < 2)
			{
				return false;
			}
			if (num % 2 == 0)
			{
				return num == 2;
			}
			int num2 = (int)Math.Sqrt(num);
			for (int i = 3; i <= num2; i += 2)
			{
				if (num % i == 0)
				{
					return false;
				}
			}
			return true;
		}
	}
	public static class RandomExtensions
	{
		public static bool MeetProbability(this Random rand, float prob)
		{
			if (prob >= 1f)
			{
				return true;
			}
			if (prob <= 0f)
			{
				return false;
			}
			return prob >= rand.NextFloat();
		}

		public static float NextRange(this Random rand, float min, float max)
		{
			return rand.NextFloat() * (max - min) + min;
		}

		public static float NextFloat(this Random rand)
		{
			return rand.NextSingle();
		}
	}
}
namespace AWO.Sessions
{
	internal struct BlackoutStatus
	{
		public bool blackoutEnabled;
	}
	internal sealed class BlackoutState : IStateReplicatorHolder<BlackoutStatus>
	{
		public StateReplicator<BlackoutStatus>? Replicator { get; private set; }

		public bool BlackoutEnabled { get; private set; }

		public void Setup()
		{
			BlackoutEnabled = false;
			Replicator = StateReplicator<BlackoutStatus>.Create(1u, new BlackoutStatus
			{
				blackoutEnabled = false
			}, (LifeTimeType)1, (IStateReplicatorHolder<BlackoutStatus>)this);
		}

		public void Cleanup()
		{
			BlackoutEnabled = false;
			Replicator?.Unload();
		}

		public void SetEnabled(bool enabled)
		{
			Replicator?.SetState(new BlackoutStatus
			{
				blackoutEnabled = enabled
			});
		}

		public void OnStateChange(BlackoutStatus oldState, BlackoutStatus state, bool isRecall)
		{
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Invalid comparison between Unknown and I4
			//IL_0303: Unknown result type (might be due to invalid IL or missing references)
			//IL_0308: Unknown result type (might be due to invalid IL or missing references)
			//IL_030e: Invalid comparison between Unknown and I4
			if (oldState.blackoutEnabled == state.blackoutEnabled)
			{
				return;
			}
			bool flag = !state.blackoutEnabled;
			foreach (LG_LabDisplay item in LG_Objects.TrackedList<LG_LabDisplay>())
			{
				if ((Object)(object)((item != null) ? item.m_Text : null) != (Object)null)
				{
					((Behaviour)item.m_Text).enabled = flag;
				}
			}
			GUIX_VirtualSceneLink val = default(GUIX_VirtualSceneLink);
			foreach (LG_ComputerTerminal item2 in LG_Objects.TrackedList<LG_ComputerTerminal>())
			{
				if ((Object)(object)item2 == (Object)null)
				{
					continue;
				}
				item2.OnProximityExit();
				Interact_ComputerTerminal componentInChildren = ((Component)item2).GetComponentInChildren<Interact_ComputerTerminal>(true);
				if ((Object)(object)componentInChildren != (Object)null)
				{
					((Behaviour)componentInChildren).enabled = flag;
					((Interact_Base)componentInChildren).SetActive(flag);
				}
				if (GameObjectPlusExtensions.TryAndGetComponent<GUIX_VirtualSceneLink>(((Component)item2).gameObject, ref val) && (Object)(object)val.m_virtualScene != (Object)null)
				{
					((Component)val.m_virtualScene).gameObject.SetActive(flag);
				}
				if ((Object)(object)item2.m_text != (Object)null)
				{
					((Behaviour)item2.m_text).enabled = flag;
				}
				if (!flag)
				{
					PlayerAgent localInteractionSource = item2.m_localInteractionSource;
					if ((Object)(object)localInteractionSource != (Object)null && localInteractionSource.FPItemHolder.InTerminalTrigger)
					{
						item2.ExitFPSView();
					}
				}
			}
			foreach (LG_DoorButton item3 in LG_Objects.TrackedList<LG_DoorButton>())
			{
				if ((Object)(object)item3 == (Object)null)
				{
					continue;
				}
				((Component)item3.m_anim).gameObject.SetActive(flag);
				item3.m_enabled = flag;
				if (flag)
				{
					LG_WeakLock componentInChildren2 = ((Component)item3).GetComponentInChildren<LG_WeakLock>();
					if ((Object)(object)componentInChildren2 != (Object)null && (int)componentInChildren2.Status != 3)
					{
						item3.m_enabled = false;
					}
				}
			}
			foreach (LG_WeakLock item4 in LG_Objects.TrackedList<LG_WeakLock>())
			{
				if (!((Object)(object)item4 == (Object)null))
				{
					((Interact_Base)item4.m_intHack).m_isActive = flag;
					Transform val2 = ((Component)item4).transform.FindChild("HackableLock/SecurityLock/g_WeakLock/Security_Display_Locked") ?? ((Component)item4).transform.FindChild("HackableLock/Security_Display_Locked");
					if ((Object)(object)val2 != (Object)null)
					{
						((Component)val2).gameObject.active = flag;
					}
				}
			}
			foreach (LG_HSUActivator_Core item5 in LG_Objects.TrackedList<LG_HSUActivator_Core>())
			{
				if ((Object)(object)item5 == (Object)null || !item5.m_isWardenObjective || (int)item5.m_stateReplicator.State.status != 0)
				{
					continue;
				}
				item5.m_insertHSUInteraction.SetActive(flag);
				foreach (GameObject item6 in (Il2CppArrayBase<GameObject>)(object)item5.m_activateWhenActive)
				{
					item6.SetActive(flag);
				}
			}
			BlackoutEnabled = state.blackoutEnabled;
		}
	}
	internal enum LevelFailMode
	{
		Default,
		Never,
		AnyPlayerDown
	}
	internal struct LevelFailCheck
	{
		public LevelFailMode mode;
	}
	internal static class LevelFailUpdateState
	{
		public static StateReplicator<LevelFailCheck>? Replicator;

		public static bool LevelFailAllowed { get; private set; } = true;


		public static bool LevelFailWhenAnyPlayerDown { get; private set; } = false;


		internal static void AssetLoaded()
		{
			Replicator = StateReplicator<LevelFailCheck>.Create(1u, new LevelFailCheck
			{
				mode = LevelFailMode.Default
			}, (LifeTimeType)0, (IStateReplicatorHolder<LevelFailCheck>)null);
			Replicator.OnStateChanged += OnStateChanged;
			LevelAPI.OnLevelCleanup += LevelCleanup;
			LG_Factory.OnFactoryBuildStart += Action.op_Implicit((Action)delegate
			{
				Replicator?.ClearAllRecallSnapshot();
				Replicator?.SetState(new LevelFailCheck
				{
					mode = LevelFailMode.Default
				});
			});
		}

		private static void LevelCleanup()
		{
			SetFailAllowed(allowed: true);
		}

		public static void SetFailAllowed(bool allowed)
		{
			Replicator?.SetState(new LevelFailCheck
			{
				mode = ((!allowed) ? LevelFailMode.Never : LevelFailMode.Default)
			});
		}

		public static void SetFailWhenAnyPlayerDown(bool enabled)
		{
			Replicator?.SetState(new LevelFailCheck
			{
				mode = (enabled ? LevelFailMode.AnyPlayerDown : LevelFailMode.Default)
			});
		}

		private static void OnStateChanged(LevelFailCheck _, LevelFailCheck state, bool __)
		{
			switch (state.mode)
			{
			case LevelFailMode.Default:
				LevelFailAllowed = true;
				LevelFailWhenAnyPlayerDown = false;
				break;
			case LevelFailMode.Never:
				LevelFailAllowed = false;
				LevelFailWhenAnyPlayerDown = false;
				break;
			case LevelFailMode.AnyPlayerDown:
				LevelFailAllowed = true;
				LevelFailWhenAnyPlayerDown = true;
				break;
			}
		}
	}
	public static class LG_Objects
	{
		public static ImmutableDictionary<Type, HashSet<Component>> TrackedTypes { get; private set; }

		static LG_Objects()
		{
			TrackedTypes = ImmutableDictionary.CreateRange(new KeyValuePair<Type, HashSet<Component>>[5]
			{
				new KeyValuePair<Type, HashSet<Component>>(typeof(LG_ComputerTerminal), new HashSet<Component>()),
				new KeyValuePair<Type, HashSet<Component>>(typeof(LG_DoorButton), new HashSet<Component>()),
				new KeyValuePair<Type, HashSet<Component>>(typeof(LG_HSUActivator_Core), new HashSet<Component>()),
				new KeyValuePair<Type, HashSet<Component>>(typeof(LG_LabDisplay), new HashSet<Component>()),
				new KeyValuePair<Type, HashSet<Component>>(typeof(LG_WeakLock), new HashSet<Component>())
			});
			LevelAPI.OnLevelCleanup += Clear;
		}

		private static void Clear()
		{
			CollectionExtensions.ForEachValue<Type, HashSet<Component>>((IDictionary<Type, HashSet<Component>>)TrackedTypes, (Action<HashSet<Component>>)delegate(HashSet<Component> set)
			{
				set.Clear();
			});
		}

		public static IEnumerable<T> TrackedList<T>() where T : Component
		{
			if (TrackedTypes.TryGetValue(typeof(T), out HashSet<Component> value))
			{
				return value.Cast<T>();
			}
			return Enumerable.Empty<T>();
		}

		public static void AddToTrackedList(Component itemToAdd)
		{
			if (TrackedTypes.TryGetValue(((object)itemToAdd).GetType(), out HashSet<Component> value))
			{
				value.Add(itemToAdd);
			}
		}

		public static void RemoveFromTrackedList(Component itemToRemove)
		{
			if (TrackedTypes.TryGetValue(((object)itemToRemove).GetType(), out HashSet<Component> value))
			{
				value.Remove(itemToRemove);
			}
		}
	}
	public struct SessionRandState
	{
		public uint currentStep;
	}
	public sealed class SessionRandReplicator : IStateReplicatorHolder<SessionRandState>
	{
		public StateReplicator<SessionRandState>? Replicator { get; private set; }

		public int Seed { get; private set; }

		public uint Step { get; private set; }

		public uint State { get; private set; }

		public void Setup(uint id, int seed)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			Seed = seed;
			Step = 0u;
			State = (uint)Seed;
			bool flag = default(bool);
			BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(12, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("SessionSeed ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(Seed);
			}
			Logger.Info(val);
			Replicator = StateReplicator<SessionRandState>.Create(id, new SessionRandState
			{
				currentStep = Step
			}, (LifeTimeType)1, (IStateReplicatorHolder<SessionRandState>)this);
		}

		public void Cleanup()
		{
			Step = 0u;
			Replicator?.Unload();
		}

		public void SyncStep()
		{
			Replicator?.SetState(new SessionRandState
			{
				currentStep = Step
			});
		}

		public void OnStateChange(SessionRandState oldState, SessionRandState state, bool isRecall)
		{
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Expected O, but got Unknown
			if (state.currentStep == Step)
			{
				Logger.Verbose((LogLevel)32, $"No change in SessionRand step from received state, isRecall: {isRecall}");
				return;
			}
			if (state.currentStep < Step)
			{
				Logger.Verbose((LogLevel)4, $"SessionRand step cannot be lowered by received state, isRecall: {isRecall}");
				Replicator?.SetStateUnsynced(new SessionRandState
				{
					currentStep = Step
				});
				return;
			}
			bool flag = default(bool);
			BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(59, 3, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Jumping ahead from local step ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<uint>(Step);
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" to session step ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<uint>(state.currentStep);
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(", isRecall: ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<bool>(isRecall);
			}
			Logger.Debug(val);
			Step = state.currentStep;
			Jump(Step);
		}

		public uint Next()
		{
			Replicator?.SetStateUnsynced(new SessionRandState
			{
				currentStep = ++Step
			});
			uint num = (State += 2654435769u);
			num ^= num >> 16;
			num *= 569420461;
			num ^= num >> 15;
			num *= 1935289751;
			return num ^ (num >> 15);
		}

		public void Jump(ulong steps)
		{
			if (steps != 0)
			{
				State += (uint)(int)(steps * 2654435769u);
			}
		}

		public int NextInt()
		{
			return (int)(Next() & 0x7FFFFFFF);
		}

		public int NextInt(int max)
		{
			if (max <= 0)
			{
				throw new ArgumentOutOfRangeException("max", "max must be positive.");
			}
			return (int)(NextFloat() * (float)max);
		}

		public int NextInt(int min, int max)
		{
			if (min > max)
			{
				throw new ArgumentOutOfRangeException("min", "min must be less than or equal to max.");
			}
			return min + NextInt(max - min);
		}

		public float NextFloat()
		{
			return (float)Next() * 2.3283064E-10f;
		}
	}
}
namespace AWO.Sessions.Patches
{
	[HarmonyPatch]
	internal static class Patch_InteractionOnBlackout
	{
		[HarmonyPatch(typeof(LG_ComputerTerminal), "OnProximityEnter")]
		[HarmonyPatch(typeof(LG_ComputerTerminal), "OnProximityExit")]
		[HarmonyPatch(typeof(LG_DoorButton), "OnWeakLockUnlocked")]
		[HarmonyPrefix]
		private static bool Pre_ToggleInteraction()
		{
			return !EntryPoint.BlackoutState.BlackoutEnabled;
		}
	}
	[HarmonyPatch]
	internal static class Patch_LevelFailCheck
	{
		[HarmonyPatch(typeof(WardenObjectiveManager), "CheckExpeditionFailed")]
		[HarmonyPostfix]
		[HarmonyPriority(200)]
		[HarmonyWrapSafe]
		private static void Post_CheckLevelFail(ref bool __result)
		{
			if (!LevelFailUpdateState.LevelFailAllowed)
			{
				__result = false;
			}
			else if (LevelFailUpdateState.LevelFailWhenAnyPlayerDown && HasAnyDownedPlayer())
			{
				__result = true;
			}
		}

		private static bool HasAnyDownedPlayer()
		{
			Enumerator<PlayerAgent> enumerator = PlayerManager.PlayerAgentsInLevel.GetEnumerator();
			while (enumerator.MoveNext())
			{
				PlayerAgent current = enumerator.Current;
				if (!((Agent)current).Alive)
				{
					return true;
				}
			}
			return false;
		}
	}
	[HarmonyPatch]
	internal static class Patch_LG_ObjectsTrack
	{
		[CompilerGenerated]
		private sealed class <TargetMethods>d__0 : IEnumerable<MethodBase>, IEnumerable, IEnumerator<MethodBase>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private MethodBase <>2__current;

			private int <>l__initialThreadId;

			MethodBase IEnumerator<MethodBase>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <TargetMethods>d__0(int <>1__state)
			{
				this.<>1__state = <>1__state;
				<>l__initialThreadId = Environment.CurrentManagedThreadId;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = AccessTools.Method(typeof(LG_ComputerTerminal), "Setup", (Type[])null, (Type[])null);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					<>2__current = AccessTools.Method(typeof(LG_DoorButton), "Setup", (Type[])null, (Type[])null);
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -1;
					<>2__current = AccessTools.Method(typeof(LG_HSUActivator_Core), "Start", (Type[])null, (Type[])null);
					<>1__state = 3;
					return true;
				case 3:
					<>1__state = -1;
					<>2__current = AccessTools.Method(typeof(LG_LabDisplay), "GenerateText", new Type[2]
					{
						typeof(int),
						typeof(SubComplex)
					}, (Type[])null);
					<>1__state = 4;
					return true;
				case 4:
					<>1__state = -1;
					<>2__current = AccessTools.Method(typeof(LG_WeakLock), "Setup", (Type[])null, (Type[])null);
					<>1__state = 5;
					return true;
				case 5:
					<>1__state = -1;
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}

			[DebuggerHidden]
			IEnumerator<MethodBase> IEnumerable<MethodBase>.GetEnumerator()
			{
				if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
				{
					<>1__state = 0;
					return this;
				}
				return new <TargetMethods>d__0(0);
			}

			[DebuggerHidden]
			IEnumerator IEnumerable.GetEnumerator()
			{
				return ((IEnumerable<MethodBase>)this).GetEnumerator();
			}
		}

		[IteratorStateMachine(typeof(<TargetMethods>d__0))]
		[HarmonyTargetMethods]
		private static IEnumerable<MethodBase> TargetMethods()
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <TargetMethods>d__0(-2);
		}

		[HarmonyPostfix]
		private static void Post_TrackObject(Component __instance)
		{
			LG_Objects.AddToTrackedList(__instance);
		}
	}
}
namespace AWO.Modules.WOE
{
	[Obsolete]
	public static class WardenObjectiveExt
	{
		private static readonly Dictionary<eWardenObjectiveType, Type> _DTOTypes;

		private static readonly List<WOE_ContextBase> _ActiveContexts;

		static WardenObjectiveExt()
		{
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Expected O, but got Unknown
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Expected O, but got Unknown
			_DTOTypes = new Dictionary<eWardenObjectiveType, Type>();
			_ActiveContexts = new List<WOE_ContextBase>();
			IEnumerable<Type> enumerable = from x in typeof(WOE_ContextBase).Assembly.GetTypes()
				where !x.IsAbstract
				where x.IsAssignableTo(typeof(WOE_ContextBase))
				select x;
			bool flag = default(bool);
			foreach (Type item in enumerable)
			{
				WOE_ContextBase wOE_ContextBase = (WOE_ContextBase)Activator.CreateInstance(item);
				if (_DTOTypes.TryGetValue(wOE_ContextBase.TargetType, out Type _))
				{
					Logger.Error("Duplicate TargetType Detected!");
					BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(14, 2, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral("With '");
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(item.Name);
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral("' and '");
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(wOE_ContextBase.GetType().Name);
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral("'");
					}
					Logger.Error(val);
				}
				else if (!wOE_ContextBase.DataType.IsAssignableTo(typeof(WOE_DataBase)))
				{
					BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(41, 3, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(item.Name);
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" does not have valid ");
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("DataType");
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" (not derived from ");
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("WOE_DataBase");
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral(")");
					}
					Logger.Error(val);
				}
				else
				{
					_DTOTypes[wOE_ContextBase.TargetType] = item;
				}
			}
			WOEvents.OnSetup += ObjectiveSetup;
			LevelAPI.OnLevelCleanup += LevelCleanup;
		}

		internal static void Initialize()
		{
		}

		private static void ObjectiveSetup(LG_LayerType layer, int chainIndex)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			WardenObjectiveDataBlock val = default(WardenObjectiveDataBlock);
			Type value;
			if (!WardenObjectiveManager.TryGetWardenObjectiveDataForLayer(layer, chainIndex, ref val))
			{
				bool flag = default(bool);
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(44, 2, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<LG_LayerType>(layer);
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" Layer (CI: ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<int>(chainIndex);
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(") does not have ObjectiveData!!!");
				}
				Logger.Error(val2);
			}
			else if (_DTOTypes.TryGetValue(val.Type, out value))
			{
				WOE_ContextBase wOE_ContextBase = (WOE_ContextBase)Activator.CreateInstance(value);
				wOE_ContextBase.Setup(layer, chainIndex);
				_ActiveContexts.Add(wOE_ContextBase);
			}
		}

		private static void LevelCleanup()
		{
			foreach (WOE_ContextBase activeContext in _ActiveContexts)
			{
				activeContext.OnLevelCleanup();
			}
			_ActiveContexts.Clear();
		}
	}
	public delegate void SetupObjectiveDel(LG_LayerType layer, int chainIndex);
	[Obsolete]
	internal static class WOEvents
	{
		public static event SetupObjectiveDel? OnSetup;

		internal static void Invoke_OnSetup(LG_LayerType layer, int chainIndex)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			WOEvents.OnSetup?.Invoke(layer, chainIndex);
		}
	}
	[Obsolete]
	internal abstract class WOE_ContextBase
	{
		public abstract eWardenObjectiveType TargetType { get; }

		public abstract Type DataType { get; }

		protected WOE_DataBase? Data { get; private set; }

		protected LG_LayerType Layer { get; private set; }

		protected int ChainIndex { get; private set; }

		public void Setup(LG_LayerType layer, int chainIndex)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			Layer = layer;
			ChainIndex = chainIndex;
		}

		public virtual void OnSetup()
		{
		}

		public virtual void OnBuildDone()
		{
		}

		public virtual void OnBuildDoneLate()
		{
		}

		public virtual void OnLevelCleanup()
		{
		}
	}
	[Obsolete]
	internal abstract class WOE_DataBase
	{
		public uint ObjectiveID { get; set; }

		public WardenObjectiveDataBlock? GameData { get; set; }
	}
}
namespace AWO.Modules.WOE.Objectives.Uplinks
{
	[Obsolete]
	internal sealed class WOE_UplinkContext : WOE_ContextBase
	{
		public override eWardenObjectiveType TargetType => (eWardenObjectiveType)8;

		public override Type DataType => typeof(WOE_UplinkData);
	}
	[Obsolete]
	internal sealed class WOE_UplinkData : WOE_DataBase
	{
		public UplinkCodeBehaviour[] CodeBehaviours { get; set; } = Array.Empty<UplinkCodeBehaviour>();

	}
	internal sealed class UplinkCodeBehaviour
	{
		public bool ShowCodesOnTerminal { get; set; } = false;


		public bool ShowCodesOnHUD { get; set; } = true;


		public bool ShowCodeToOtherTerminal { get; set; } = true;


		public TerminalZoneSelectionData TerminalZone { get; set; } = new TerminalZoneSelectionData();


		public TerminalOutput[] StartOutputs { get; set; } = Array.Empty<TerminalOutput>();


		public TerminalOutput[] EndOutputs { get; set; } = Array.Empty<TerminalOutput>();


		public WardenObjectiveEventData[] EventsOnStart { get; set; } = Array.Empty<WardenObjectiveEventData>();


		public WardenObjectiveEventData[] EventsOnEnd { get; set; } = Array.Empty<WardenObjectiveEventData>();

	}
}
namespace AWO.Modules.WOE.Objectives.ReactorStartups
{
	[Obsolete]
	internal sealed class WOE_ReactorStartupContext : WOE_ContextBase
	{
		public override eWardenObjectiveType TargetType => (eWardenObjectiveType)1;

		public override Type DataType => typeof(WOE_ReactorStartupData);
	}
	internal enum ReactorWavePuzzleType
	{
		Default,
		CustomLock,
		UseCommand_OnMainTerminal,
		UseCommand_InZone,
		PowerGenerator_InZone
	}
	[Obsolete]
	internal sealed class WOE_ReactorStartupData : WOE_DataBase
	{
		public bool RemoveMainStartupCommand { get; set; } = false;


		public bool RemoveMainVerifyCommand { get; set; } = false;


		public ScriptedWaveData[] WaveDatas { get; set; } = Array.Empty<ScriptedWaveData>();


		public ReactorWavePuzzleData[] WavePuzzles { get; set; } = Array.Empty<ReactorWavePuzzleData>();

	}
	internal enum SettingWarpMode
	{
		Clamped,
		Repeat,
		PingPong
	}
	internal sealed class ScriptedWaveData
	{
		public float[] IntroDuration { get; set; } = Array.Empty<float>();


		public SettingWarpMode IntroDurationWarpMode { get; set; } = SettingWarpMode.Clamped;


		public float[] WaveDuration { get; set; } = Array.Empty<float>();


		public SettingWarpMode WaveDurationWarpMode { get; set; } = SettingWarpMode.Clamped;


		public string[][] WaveInstructions { get; set; } = Array.Empty<string[]>();


		public SettingWarpMode WaveInstructionsWarpMode { get; set; } = SettingWarpMode.Clamped;

	}
	internal sealed class ReactorWavePuzzleData
	{
		public ReactorWavePuzzleType Type { get; set; } = ReactorWavePuzzleType.Default;


		public bool ShowBeacon { get; set; } = false;


		public string BeaconText { get; set; } = "Auxiliary Terminal";


		public Color BeaconColor { get; set; } = Color.magenta;


		public string Command { get; set; } = "REACTOR_CONTINUE";


		public string CommandDescription { get; set; } = "CONTINUE REACTOR STARTUP PROCESS";


		public bool ForceJumpWaveWhenSolved { get; set; } = true;

	}
}
namespace AWO.Modules.WOE.Objectives.GenClusters
{
	[Obsolete]
	internal sealed class WOE_GenClusterContext : WOE_ContextBase
	{
		public override eWardenObjectiveType TargetType => (eWardenObjectiveType)9;

		public override Type DataType => typeof(int);
	}
}
namespace AWO.Modules.WOE.JsonInjects
{
	[Obsolete]
	internal class ObjectiveDataHandler : Il2CppJsonReferenceTypeHandler<WardenObjectiveDataBlock>
	{
		public override void OnRead(in Object result, in JToken jToken)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Invalid comparison between Unknown and I4
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Invalid comparison between Unknown and I4
			if ((int)jToken.Type == 1)
			{
				JObject val = (JObject)jToken;
				JToken val2 = default(JToken);
				if (val.TryGetValue("woeEnabled", ref val2) && (int)val2.Type == 9 && (bool)val2)
				{
					WardenObjectiveDataBlock val3 = ((Il2CppObjectBase)result).Cast<WardenObjectiveDataBlock>();
				}
			}
		}
	}
}
namespace AWO.Modules.WEE
{
	internal static class VanillaEventOvr
	{
		[CompilerGenerated]
		private sealed class <Handle>d__2 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public eWardenObjectiveEventType type;

			public WardenObjectiveEventData e;

			public float currentDuration;

			private float <delay>5__1;

			private int <reloadCount>5__2;

			private eWardenObjectiveEventType <>s__3;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <Handle>d__2(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0066: Unknown result type (might be due to invalid IL or missing references)
				//IL_0070: Expected O, but got Unknown
				//IL_0154: Unknown result type (might be due to invalid IL or missing references)
				//IL_0097: Unknown result type (might be due to invalid IL or missing references)
				//IL_009d: Expected O, but got Unknown
				//IL_00af: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
				//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
				//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
				//IL_01da: Unknown result type (might be due to invalid IL or missing references)
				//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ef: Expected I4, but got Unknown
				//IL_0214: Unknown result type (might be due to invalid IL or missing references)
				//IL_0200: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f5: Invalid comparison between Unknown and I4
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<delay>5__1 = Mathf.Max(e.Delay - currentDuration, 0f);
					if (<delay>5__1 > 0f)
					{
						<reloadCount>5__2 = CheckpointManager.CheckpointUsage;
						<>2__current = (object)new WaitForSeconds(<delay>5__1);
						<>1__state = 1;
						return true;
					}
					break;
				case 1:
					<>1__state = -1;
					if (<reloadCount>5__2 < CheckpointManager.CheckpointUsage)
					{
						bool flag = default(bool);
						BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(47, 1, ref flag);
						if (flag)
						{
							((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Delayed event ");
							((BepInExLogInterpolatedStringHandler)val).AppendFormatted<eWardenObjectiveEventType>(type);
							((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" aborted due to checkpoint reload");
						}
						Logger.Warn(val);
						return false;
					}
					break;
				}
				if (WorldEventManager.GetCondition(e.Condition.ConditionIndex) != e.Condition.IsTrue)
				{
					Logger.Verbose((LogLevel)32, $"Condition {e.Condition.ConditionIndex} is not met");
					return false;
				}
				WardenObjectiveManager.DisplayWardenIntel(e.Layer, e.WardenIntel);
				if (e.DialogueID != 0)
				{
					PlayerDialogManager.WantToStartDialog(e.DialogueID, -1, false, false);
				}
				if (e.SoundID != 0)
				{
					PlaySound(e);
				}
				if (SNet.IsMaster)
				{
					eWardenObjectiveEventType val2 = type;
					<>s__3 = val2;
					eWardenObjectiveEventType val3 = <>s__3;
					switch (val3 - 3)
					{
					default:
						if ((int)val3 == 16)
						{
							CoroutineManager.StartCoroutine(CollectionExtensions.WrapToIl2Cpp(SpawnEnemyOnPoint(e)), (Action)null);
						}
						break;
					case 1:
						ToggleDimensionLights(mode: true, e.DimensionIndex);
						break;
					case 0:
						ToggleDimensionLights(mode: false, e.DimensionIndex);
						break;
					case 2:
						break;
					}
				}
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <SpawnEnemyOnPoint>d__5 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public WardenObjectiveEventData e;

			private int <count>5__1;

			private Vector3 <pos>5__2;

			private LG_WorldEventObject <weObject>5__3;

			private AIG_CourseNode <courseNode>5__4;

			private AgentMode <mode>5__5;

			private float <interval>5__6;

			private WaitForSeconds <spawnInterval>5__7;

			private bool <>s__8;

			private int <i>5__9;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <SpawnEnemyOnPoint>d__5(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<weObject>5__3 = null;
				<courseNode>5__4 = null;
				<spawnInterval>5__7 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0080: Unknown result type (might be due to invalid IL or missing references)
				//IL_006e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0085: Unknown result type (might be due to invalid IL or missing references)
				//IL_0160: Unknown result type (might be due to invalid IL or missing references)
				//IL_016c: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
				//IL_0116: Unknown result type (might be due to invalid IL or missing references)
				//IL_0117: 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_014a: Expected O, but got Unknown
				//IL_010e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0112: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
				{
					<>1__state = -1;
					<count>5__1 = ((e.Count < 2) ? 1 : e.Count);
					<pos>5__2 = (WorldEventUtils.TryGetRandomWorldEventObjectFromFilter(e.WorldEventObjectFilter, (uint)Builder.SessionSeedRandom.Seed, ref <weObject>5__3) ? ((Component)<weObject>5__3).transform.position : e.Position);
					LG_WorldEventObject obj = <weObject>5__3;
					object obj2;
					if (obj == null)
					{
						obj2 = null;
					}
					else
					{
						LG_Area parentArea = obj.ParentArea;
						obj2 = ((parentArea != null) ? parentArea.m_courseNode : null);
					}
					if (obj2 == null)
					{
						obj2 = CourseNodeUtil.GetCourseNode(<pos>5__2);
					}
					<courseNode>5__4 = (AIG_CourseNode)obj2;
					if (<courseNode>5__4 == null)
					{
						Logger.Error("SpawnEnemyOnPoint", "Failed to find valid CourseNode from Position!");
						return false;
					}
					<>s__8 = e.Enabled;
					AgentMode val = ((!<>s__8) ? ((e.EnemyID != 20) ? ((AgentMode)4) : ((AgentMode)3)) : ((AgentMode)1));
					<mode>5__5 = val;
					<interval>5__6 = Math.Min(0.25f, 2f / (float)<count>5__1);
					<spawnInterval>5__7 = new WaitForSeconds(<interval>5__6);
					<i>5__9 = 0;
					break;
				}
				case 1:
					<>1__state = -1;
					<i>5__9++;
					break;
				}
				if (<i>5__9 < <count>5__1)
				{
					EnemyAgent.SpawnEnemy(e.EnemyID, <pos>5__2, <courseNode>5__4, <mode>5__5);
					<>2__current = <spawnInterval>5__7;
					<>1__state = 1;
					return true;
				}
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		internal static bool HasOverride(eWardenObjectiveEventType type, WardenObjectiveEventData e)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Invalid comparison between Unknown and I4
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Invalid comparison between Unknown and I4
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Invalid comparison between Unknown and I4
			bool flag = e.Position != Vector3.zero;
			if (type - 3 > 1)
			{
				if ((int)type != 5)
				{
					if ((int)type == 16)
					{
						return flag || e.Count > 0;
					}
					return false;
				}
				return flag;
			}
			return (int)e.DimensionIndex > 0;
		}

		internal static void HandleEvent(eWardenObjectiveEventType type, WardenObjectiveEventData e, float currentDuration)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			CoroutineManager.StartCoroutine(CollectionExtensions.WrapToIl2Cpp(Handle(type, e, currentDuration)), (Action)null);
		}

		[IteratorStateMachine(typeof(<Handle>d__2))]
		private static IEnumerator Handle(eWardenObjectiveEventType type, WardenObjectiveEventData e, float currentDuration)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <Handle>d__2(0)
			{
				type = type,
				e = e,
				currentDuration = currentDuration
			};
		}

		private static void PlaySound(WardenObjectiveEventData e)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Invalid comparison between Unknown and I4
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if ((int)e.Type != 5)
			{
				WardenObjectiveManager.Current.m_sound.Post(e.SoundID, true);
			}
			else
			{
				CellSoundPlayer val = new CellSoundPlayer();
				GameObjectPlusExtensions.PostWithCleanup(val, e.SoundID, e.Position, 1u);
			}
			string text = ((Object)e.SoundSubtitle).ToString();
			if (!string.IsNullOrWhiteSpace(text))
			{
				GuiManager.PlayerLayer.ShowMultiLineSubtitle(text);
			}
		}

		private static void ToggleDimensionLights(bool mode, eDimensionIndex dimension)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: 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_0033: Unknown result type (might be due to invalid IL or missing references)
			pEnvironmentInteraction val = default(pEnvironmentInteraction);
			val.EnvironmentStateChangeType = (EnvironmentStateChangeType)1;
			val.LightsEnabled = mode;
			val.DimensionIndex = dimension;
			pEnvironmentInteraction val2 = val;
			EnvironmentStateManager.LogEnvironmentState("VEO SetLightMode Attempt");
			EnvironmentStateManager.Current.AttemptInteract(val2);
		}

		[IteratorStateMachine(typeof(<SpawnEnemyOnPoint>d__5))]
		private static IEnumerator SpawnEnemyOnPoint(WardenObjectiveEventData e)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <SpawnEnemyOnPoint>d__5(0)
			{
				e = e
			};
		}
	}
	internal static class WardenEventExt
	{
		[CompilerGenerated]
		private sealed class <Expand>d__4 : IEnumerable<(eDimensionIndex, LG_LayerType, eLocalZoneIndex)>, IEnumerable, IEnumerator<(eDimensionIndex, LG_LayerType, eLocalZoneIndex)>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private (eDimensionIndex, LG_LayerType, eLocalZoneIndex) <>2__current;

			private int <>l__initialThreadId;

			private WEE_EventData e;

			public WEE_EventData <>3__e;

			private IEnumerator<eDimensionIndex> <>s__1;

			private eDimensionIndex <d>5__2;

			private IEnumerator<LG_LayerType> <>s__3;

			private LG_LayerType <l>5__4;

			private IEnumerator<eLocalZoneIndex> <>s__5;

			private eLocalZoneIndex <z>5__6;

			(eDimensionIndex, LG_LayerType, eLocalZoneIndex) IEnumerator<(eDimensionIndex, LG_LayerType, eLocalZoneIndex)>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <Expand>d__4(int <>1__state)
			{
				this.<>1__state = <>1__state;
				<>l__initialThreadId = Environment.CurrentManagedThreadId;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				int num = <>1__state;
				if ((uint)(num - -5) <= 2u || num == 1)
				{
					try
					{
						if ((uint)(num - -5) <= 1u || num == 1)
						{
							try
							{
								if (num == -5 || num == 1)
								{
									try
									{
									}
									finally
									{
										<>m__Finally3();
									}
								}
							}
							finally
							{
								<>m__Finally2();
							}
						}
					}
					finally
					{
						<>m__Finally1();
					}
				}
				<>s__1 = null;
				<>s__3 = null;
				<>s__5 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_005b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0060: Unknown result type (might be due to invalid IL or missing references)
				//IL_0098: Unknown result type (might be due to invalid IL or missing references)
				//IL_009d: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00df: 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_00eb: Unknown result type (might be due to invalid IL or missing references)
				try
				{
					int num = <>1__state;
					if (num != 0)
					{
						if (num != 1)
						{
							return false;
						}
						<>1__state = -5;
						goto IL_010d;
					}
					<>1__state = -1;
					<>s__1 = e.ArrayableDimension.Values.GetEnumerator();
					<>1__state = -3;
					goto IL_0146;
					IL_0146:
					if (<>s__1.MoveNext())
					{
						<d>5__2 = <>s__1.Current;
						<>s__3 = e.ArrayableLayer.Values.GetEnumerator();
						<>1__state = -4;
						goto IL_0128;
					}
					<>m__Finally1();
					<>s__1 = null;
					return false;
					IL_0128:
					if (<>s__3.MoveNext())
					{
						<l>5__4 = <>s__3.Current;
						<>s__5 = e.ArrayableZone.Values.GetEnumerator();
						<>1__state = -5;
						goto IL_010d;
					}
					<>m__Finally2();
					<>s__3 = null;
					goto IL_0146;
					IL_010d:
					if (<>s__5.MoveNext())
					{
						<z>5__6 = <>s__5.Current;
						<>2__current = (<d>5__2, <l>5__4, <z>5__6);
						<>1__state = 1;
						return true;
					}
					<>m__Finally3();
					<>s__5 = null;
					goto IL_0128;
				}
				catch
				{
					//try-fault
					((IDisposable)this).Dispose();
					throw;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			private void <>m__Finally1()
			{
				<>1__state = -1;
				if (<>s__1 != null)
				{
					<>s__1.Dispose();
				}
			}

			private void <>m__Finally2()
			{
				<>1__state = -3;
				if (<>s__3 != null)
				{
					<>s__3.Dispose();
				}
			}

			private void <>m__Finally3()
			{
				<>1__state = -4;
				if (<>s__5 != null)
				{
					<>s__5.Dispose();
				}
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}

			[DebuggerHidden]
			IEnumerator<(eDimensionIndex, LG_LayerType, eLocalZoneIndex)> IEnumerable<(eDimensionIndex, LG_LayerType, eLocalZoneIndex)>.GetEnumerator()
			{
				<Expand>d__4 <Expand>d__;
				if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
				{
					<>1__state = 0;
					<Expand>d__ = this;
				}
				else
				{
					<Expand>d__ = new <Expand>d__4(0);
				}
				<Expand>d__.e = <>3__e;
				return <Expand>d__;
			}

			[DebuggerHidden]
			IEnumerator IEnumerable.GetEnumerator()
			{
				return ((IEnumerable<(eDimensionIndex, LG_LayerType, eLocalZoneIndex)>)this).GetEnumerator();
			}
		}

		[CompilerGenerated]
		private sealed class <Handle>d__5 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public BaseEvent eventInstance;

			public WEE_EventData e;

			public float currentDuration;

			private float <delay>5__1;

			private int <reloadCount>5__2;

			private string <line>5__3;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <Handle>d__5(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<line>5__3 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0069: Unknown result type (might be due to invalid IL or missing references)
				//IL_0073: Expected O, but got Unknown
				//IL_015c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0167: Unknown result type (might be due to invalid IL or missing references)
				//IL_009a: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a0: Expected O, but got Unknown
				//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
				//IL_028a: Unknown result type (might be due to invalid IL or missing references)
				//IL_029f: Unknown result type (might be due to invalid IL or missing references)
				//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<delay>5__1 = Mathf.Max(e.Delay - currentDuration, 0f);
					if (<delay>5__1 > 0f)
					{
						<reloadCount>5__2 = CheckpointManager.CheckpointUsage;
						<>2__current = (object)new WaitForSeconds(<delay>5__1);
						<>1__state = 1;
						return true;
					}
					break;
				case 1:
					<>1__state = -1;
					if (<reloadCount>5__2 < CheckpointManager.CheckpointUsage)
					{
						bool flag = default(bool);
						BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(47, 1, ref flag);
						if (flag)
						{
							((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Delayed event ");
							((BepInExLogInterpolatedStringHandler)val).AppendFormatted<WEE_Type>(e.Type);
							((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" aborted due to checkpoint reload");
						}
						Logger.Warn(val);
						return false;
					}
					break;
				}
				if (WorldEventManager.GetCondition(e.Condition.ConditionIndex) != e.Condition.IsTrue)
				{
					Logger.Verbose((LogLevel)32, $"Condition {e.Condition.ConditionIndex} is not met");
					return false;
				}
				WardenObjectiveManager.DisplayWardenIntel(e.Layer, LocaleText.op_Implicit(e.WardenIntel));
				if (e.Type != WEE_Type.ForcePlayPlayerDialogue)
				{
					if (e.DialogueID != 0)
					{
						PlayerDialogManager.WantToStartDialog(e.DialogueID, -1, false, false);
					}
					if (e.SoundID != 0)
					{
						WardenObjectiveManager.Current.m_sound.Post(e.SoundID, true);
						<line>5__3 = LocaleText.op_Implicit(e.SoundSubtitle);
						if (!string.IsNullOrWhiteSpace(<line>5__3) && e.Type != WEE_Type.PlaySubtitles)
						{
							GuiManager.PlayerLayer.ShowMultiLineSubtitle(<line>5__3);
						}
						<line>5__3 = null;
					}
				}
				if (e.SubObjective.DoUpdate && e.Type != WEE_Type.MultiProgression)
				{
					WardenObjectiveManager.UpdateSyncCustomSubObjective(LocaleText.op_Implicit(e.SubObjective.CustomSubObjectiveHeader), LocaleText.op_Implicit(e.SubObjective.CustomSubObjective));
				}
				if (e.Fog.DoUpdate)
				{
					EnvironmentStateManager.AttemptStartFogTransition(e.Fog.FogSetting, e.Fog.FogTransitionDuration, e.DimensionIndex);
				}
				SafeInvoke.Invoke<WEE_EventData>((Action<WEE_EventData>)eventInstance.Trigger, e);
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		internal static readonly Dictionary<WEE_Type, BaseEvent> _EventsToTrigger;

		static WardenEventExt()
		{
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Expected O, but got Unknown
			_EventsToTrigger = new Dictionary<WEE_Type, BaseEvent>();
			IEnumerable<Type> enumerable = from x in AccessTools.GetTypesFromAssembly(Assembly.GetExecutingAssembly())
				where !x.IsAbstract
				where x.IsAssignableTo(typeof(BaseEvent))
				select x;
			bool flag = default(bool);
			foreach (Type item in enumerable)
			{
				BaseEvent baseEvent = (BaseEvent)Activator.CreateInstance(item);
				if (_EventsToTrigger.TryGetValue(baseEvent.EventType, out BaseEvent value))
				{
					Logger.Error("Duplicate EventType detected!");
					BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(14, 2, ref flag);
					if (flag)
					{
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral("With '");
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(value.Name);
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral("' and '");
						((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(baseEvent.Name);
						((BepInExLogInterpolatedStringHandler)val).AppendLiteral("'");
					}
					Logger.Error(val);
				}
				else
				{
					baseEvent.Setup();
					_EventsToTrigger[baseEvent.EventType] = baseEvent;
				}
			}
		}

		internal static void Initialize()
		{
			ClassInjector.RegisterTypeInIl2Cpp<OutsideDataReplicator>();
			ClassInjector.RegisterTypeInIl2Cpp<ScanPositionReplicator>();
			ClassInjector.RegisterTypeInIl2Cpp<ZoneLightReplicator>();
			JsonInjector.SetConverter<eWardenObjectiveEventType>((Il2CppJsonUnmanagedTypeConverter<eWardenObjectiveEventType>)new EventTypeConverter());
			JsonInjector.SetConverter<eDimensionIndex>((Il2CppJsonUnmanagedTypeConverter<eDimensionIndex>)new ArrayableFlatConverter<eDimensionIndex>());
			JsonInjector.SetConverter<LG_LayerType>((Il2CppJsonUnmanagedTypeConverter<LG_LayerType>)new ArrayableFlatConverter<LG_LayerType>());
			JsonInjector.SetConverter<eLocalZoneIndex>((Il2CppJsonUnmanagedTypeConverter<eLocalZoneIndex>)new ArrayableFlatConverter<eLocalZoneIndex>());
			JsonInjector.AddHandler<WardenObjectiveEventData>((Il2CppJsonReferenceTypeHandler<WardenObjectiveEventData>)(object)new EventDataHandler());
			JsonInjector.AddHandler<WorldEventFromSourceData>((Il2CppJsonReferenceTypeHandler<WorldEventFromSourceData>)(object)new TriggerDataHandler());
			WEE_EnumInjector.Inject();
			Detour_ExecuteEvent.Patch();
		}

		internal static void HandleEvent(WEE_Type type, WardenObjectiveEventData e, float currentDuration)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Expected O, but got Unknown
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: 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_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: 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)
			WEE_EventData wEEData = e.GetWEEData();
			bool flag = default(bool);
			if (wEEData == null)
			{
				BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(76, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("WardenEvent Type is Extension (");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<WEE_Type>(type);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("), but it's not registered to any dataholder!");
				}
				Logger.Error(val);
				return;
			}
			if (!_EventsToTrigger.TryGetValue(type, out BaseEvent value))
			{
				BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(31, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<WEE_Type>(type);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Event does not exist in lookup!");
				}
				Logger.Error(val);
				return;
			}
			List<(eDimensionIndex, LG_LayerType, eLocalZoneIndex)> list = Expand(wEEData).ToList();
			foreach (var (val2, layer, val3) in list)
			{
				if (!value.AllowArrayableGlobalIndex || list.Count == 1)
				{
					wEEData.DimensionIndex = val2;
					wEEData.Layer = layer;
					wEEData.LocalIndex = val3;
					CoroutineManager.StartCoroutine(CollectionExtensions.WrapToIl2Cpp(Handle(value, wEEData, currentDuration)), (Action)null);
					break;
				}
				CoroutineManager.StartCoroutine(CollectionExtensions.WrapToIl2Cpp(Handle(value, wEEData.Clone(val2, layer, val3), currentDuration)), (Action)null);
			}
		}

		[IteratorStateMachine(typeof(<Expand>d__4))]
		private static IEnumerable<(eDimensionIndex, LG_LayerType, eLocalZoneIndex)> Expand(WEE_EventData e)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <Expand>d__4(-2)
			{
				<>3__e = e
			};
		}

		[IteratorStateMachine(typeof(<Handle>d__5))]
		private static IEnumerator Handle(BaseEvent eventInstance, WEE_EventData e, float currentDuration)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <Handle>d__5(0)
			{
				eventInstance = eventInstance,
				e = e,
				currentDuration = currentDuration
			};
		}
	}
	internal static class WEE_EnumInjector
	{
		public const int ExtendedIndex = 10000;

		private static readonly Dictionary<string, object> _EventTypes;

		private static int _CurrentIndex;

		static WEE_EnumInjector()
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Expected O, but got Unknown
			_EventTypes = new Dictionary<string, object>();
			_CurrentIndex = 0;
			WEE_Type[] values = Enum.GetValues<WEE_Type>();
			bool flag = default(bool);
			for (int i = 0; i < values.Length; i++)
			{
				WEE_Type wEE_Type = values[i];
				string text = wEE_Type.ToString();
				AddEvent(text);
				BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(22, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Injecting EWOEvent: '");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(text);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("'");
				}
				Logger.Debug(val);
			}
		}

		private static void AddEvent(string name)
		{
			_EventTypes[name] = _CurrentIndex + 10000;
			_CurrentIndex++;
		}

		internal static void Inject()
		{
			EnumInjector.InjectEnumValues<eWardenObjectiveEventType>(_EventTypes);
		}
	}
	public sealed class WEE_EventData
	{
		public WEE_Type Type { get; set; }

		public WorldEventConditionPair Condition { get; set; } = new WorldEventConditionPair
		{
			ConditionIndex = -1,
			IsTrue = false
		};


		public eWardenObjectiveEventTrigger Trigger { get; set; } = (eWardenObjectiveEventTrigger)0;


		public uint ChainPuzzle { get; set; } = 0u;


		public bool UseStaticBioscanPoints { get; set; } = false;


		[JsonPropertyName("DimensionIndex")]
		public Arrayable<eDimensionIndex> ArrayableDimension { get; set; } = (eDimensionIndex)0;


		[JsonIgnore]
		public eDimensionIndex DimensionIndex { get; set; }

		[JsonPropertyName("Layer")]
		public Arrayable<LG_LayerType> ArrayableLayer { get; set; } = (LG_LayerType)0;


		[JsonIgnore]
		public LG_LayerType Layer { get; set; }

		[JsonPropertyName("LocalIndex")]
		public Arrayable<eLocalZoneIndex> ArrayableZone { get; set; } = (eLocalZoneIndex)0;


		[JsonIgnore]
		public eLocalZoneIndex LocalIndex { get; set; }

		public Vector3 Position { get; set; } = Vector3.zero;


		public float Delay { get; set; } = 0f;


		public float Duration { get; set; } = 0f;


		public LocaleText WardenIntel { get; set; } = LocaleText.Empty;


		public uint SoundID { get; set; } = 0u;


		public LocaleText SoundSubtitle { get; set; } = LocaleText.Empty;


		public uint DialogueID { get; set; } = 0u;


		public int Count { get; set; } = 0;


		public bool Enabled { get; set; } = true;


		public bool SpecialBool { get; set; } = false;


		public int SpecialNumber { get; set; } = -1;


		public LocaleText SpecialText { get; set; } = LocaleText.Empty;


		public string WorldEventObjectFilter
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return LocaleText.op_Implicit(SpecialText);
			}
			set
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				SpecialText = new LocaleText(value);
			}
		}

		public WEE_SubObjectiveData SubObjective { get; set; } = new WEE_SubObjectiveData();


		public WEE_UpdateFogData Fog { get; set; } = new WEE_UpdateFogData();


		public bool CleanUpEnemiesBehind { get; set; } = true;


		public WEE_ReactorEventData? Reactor { get; set; } = null;


		public WEE_CountdownData? Countdown { get; set; } = null;


		public WEE_ZoneLightData? SetZoneLight { get; set; } = null;


		public Arrayable<WEE_CleanupEnemiesData> CleanupEnemies { get; set; } = new WEE_CleanupEnemiesData();


		public Arrayable<WEE_SpawnHibernateData> SpawnHibernates { get; set; } = new Arrayable<WEE_SpawnHibernateData>();


		public Arrayable<WEE_SpawnScoutData> SpawnScouts { get; set; } = new Arrayable<WEE_SpawnScoutData>();


		public Arrayable<WEE_AddTerminalCommand> AddTerminalCommand { get; set; } = new Arrayable<WEE_AddTerminalCommand>();


		public Arrayable<WEE_AddTerminalCommand> AddCommand
		{
			private get
			{
				return AddTerminalCommand;
			}
			set
			{
				AddTerminalCommand = value;
			}
		}

		public Arrayable<WEE_HideTerminalCommand> HideTerminalCommand { get; set; } = new Arrayable<WEE_HideTerminalCommand>();


		public Arrayable<WEE_HideTerminalCommand> HideCommand
		{
			private get
			{
				return HideTerminalCommand;
			}
			set
			{
				HideTerminalCommand = value;
			}
		}

		public Arrayable<WEE_UnhideTerminalCommand> UnhideTerminalCommand { get; set; } = new Arrayable<WEE_UnhideTerminalCommand>();


		public Arrayable<WEE_UnhideTerminalCommand> UnhideCommand
		{
			private get
			{
				return UnhideTerminalCommand;
			}
			set
			{
				UnhideTerminalCommand = value;
			}
		}

		public WEE_NestedEvent? NestedEvent { get; set; } = null;


		public WEE_StartEventLoop? StartEventLoop { get; set; } = null;


		public WEE_StartEventLoop? EventLoop
		{
			private get
			{
				return StartEventLoop;
			}
			set
			{
				StartEventLoop = value;
			}
		}

		public WEE_TeleportPlayer? TeleportPlayer { get; set; } = null;


		public WEE_InfectPlayer? InfectPlayer { get; set; } = null;


		public WEE_DamagePlayer? DamagePlayer { get; set; } = null;


		public WEE_RevivePlayer? RevivePlayer { get; set; } = null;


		public WEE_AdjustTimer AdjustTimer { get; set; } = new WEE_AdjustTimer();


		public WEE_CountupData? Countup { get; set; } = null;


		public Arrayable<WEE_NavMarkerData> NavMarker { get; set; } = new WEE_NavMarkerData();


		public WEE_ShakeScreen? CameraShake { get; set; } = null;


		public WEE_StartPortalMachine? Portal { get; set; } = null;


		public WEE_SetSuccessScreen? SuccessScreen { get; set; } = null;


		public List<WEE_SubObjectiveData> MultiProgression { get; set; } = new List<WEE_SubObjectiveData>();


		public WEE_PlayWaveDistantRoar? WaveRoarSound { get; set; } = null;


		public WEE_CustomHudText? CustomHudText { get; set; } = null;


		public WEE_CustomHudText? CustomHud
		{
			private get
			{
				return CustomHudText;
			}
			set
			{
				CustomHudText = value;
			}
		}

		public WEE_SpecialHudTimer? SpecialHudTimer { get; set; } = new WEE_SpecialHudTimer();


		public WEE_SpecialHudTimer? SpecialHud
		{
			private get
			{
				return SpecialHudTimer;
			}
			set
			{
				SpecialHudTimer = value;
			}
		}

		public WEE_ForcePlayerDialogue? PlayerDialogue { get; set; } = null;


		public Arrayable<WEE_SetTerminalLog> SetTerminalLog { get; set; } = new Arrayable<WEE_SetTerminalLog>();


		public Arrayable<WEE_SetTerminalLog> TerminalLog
		{
			private get
			{
				return SetTerminalLog;
			}
			set
			{
				SetTerminalLog = value;
			}
		}

		public List<WEE_SetPocketItem> ObjectiveItems { get; set; } = new List<WEE_SetPocketItem>();


		public WEE_SetOutsideDimensionData? DimensionData { get; set; } = null;


		public ActiveEnemyWaveData? ActiveEnemyWave { get; set; } = null;


		public WEE_EventData Clone(eDimensionIndex dim, LG_LayerType layer, eLocalZoneIndex zone)
		{
			//IL_000e: 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_001e: Unknown result type (might be due to invalid IL or missing references)
			WEE_EventData wEE_EventData = (WEE_EventData)MemberwiseClone();
			wEE_EventData.DimensionIndex = dim;
			wEE_EventData.Layer = layer;
			wEE_EventData.LocalIndex = zone;
			return wEE_EventData;
		}
	}
	public sealed class WEE_SubObjectiveData
	{
		public bool DoUpdate { get; set; } = false;


		public LocaleText CustomSubObjectiveHeader { get; set; } = LocaleText.Empty;


		public LocaleText CustomSubObjective { get; set; } = LocaleText.Empty;


		public uint Index { get; set; } = 0u;


		public int Priority { get; set; } = 1;


		public LG_LayerType Layer { get; set; } = (LG_LayerType)0;


		public bool IsLayerIndependent { get; set; } = true;


		public LocaleText OverrideTag { get; set; } = LocaleText.Empty;

	}
	public sealed class WEE_UpdateFogData
	{
		public bool DoUpdate { get; set; } = false;


		public uint FogSetting { get; set; } = 0u;


		public float FogTransitionDuration { get; set; } = 0f;

	}
	public sealed class WEE_ReactorEventData
	{
		public enum WaveState
		{
			Intro,
			Wave,
			Verify,
			Idle
		}

		public WaveState State { get; set; } = WaveState.Intro;


		public int Wave { get; set; } = 1;


		public float Progress { get; set; } = 0f;

	}
	public sealed class WEE_CountdownData
	{
		public float Duration { get; set; } = 0f;


		public bool CanShowHours { get; set; } = true;


		public LocaleText TimerText { get; set; } = LocaleText.Empty;


		public LocaleText TitleText
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return TimerText;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				TimerText = value;
			}
		}

		public Color TimerColor { get; set; } = Color.red;


		public List<EventsOnTimerProgress> EventsOnProgress { get; set; } = new List<EventsOnTimerProgress>();


		public List<WardenObjectiveEventData> EventsOnDone { get; set; } = new List<WardenObjectiveEventData>();

	}
	public sealed class WEE_CleanupEnemiesData
	{
		public enum CleanUpType
		{
			Kill,
			Despawn
		}

		public CleanUpType Type { get; set; } = CleanUpType.Despawn;


		public int AreaIndex { get; set; } = -1;


		public int[] AreaBlacklist { get; set; } = Array.Empty<int>();


		public bool IncludeHibernate { get; set; } = true;


		public bool IncludeAggressive { get; set; } = true;


		public bool IncludeScout { get; set; } = true;


		public uint[] ExcludeEnemyID { get; set; } = Array.Empty<uint>();


		public uint[] IncludeOnlyID { get; set; } = Array.Empty<uint>();


		public void DoClear(AIG_CourseNode node)
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Expected I4, but got Unknown
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			if (!SNet.IsMaster || node == null || node.m_enemiesInNode == null)
			{
				return;
			}
			foreach (EnemyAgent item in node.m_enemiesInNode.ToArray())
			{
				AgentMode mode = ((AgentAI)item.AI).Mode;
				if ((mode - 1) switch
				{
					0 => IncludeAggressive, 
					2 => IncludeScout, 
					3 => IncludeHibernate, 
					_ => true, 
				} && !ExcludeEnemyID.Contains(item.EnemyDataID) && (IncludeOnlyID.Length == 0 || IncludeOnlyID.Contains(item.EnemyDataID)))
				{
					switch (Type)
					{
					case CleanUpType.Despawn:
						((Agent)item).m_replicator.Despawn();
						break;
					case CleanUpType.Kill:
						item.Damage.IsImortal = false;
						item.Damage.BulletDamage(((Dam_SyncedDamageBase)item.Damage).DamageMax, (Agent)null, default(Vector3), default(Vector3), default(Vector3), false, 0, 1f, 1f, 0u);
						break;
					}
				}
			}
		}
	}
	public sealed class WEE_ZoneLightData
	{
		public enum ModifierType : byte
		{
			RevertToOriginal,
			SetZoneLightData
		}

		public ModifierType Type { get; set; } = ModifierType.RevertToOriginal;


		public uint LightDataID { get; set; } = 0u;


		public float TransitionDuration { get; set; } = 0.5f;


		public int Seed { get; set; } = 0;


		public bool UseRandomSeed => Seed == 0;
	}
	public sealed class WEE_SpawnHibernateData
	{
		public int AreaIndex { get; set; } = -1;


		public int[] AreaBlacklist { get; set; } = Array.Empty<int>();


		public uint EnemyID { get; set; } = 0u;


		public int Count { get; set; } = 0;


		public Vector3 Position { get; set; } = Vector3.zero;


		public Vector3 Rotation { get; set; } = Vector3.zero;

	}
	public sealed class WEE_SpawnScoutData
	{
		public int AreaIndex { get; set; } = -1;


		public int[] AreaBlacklist { get; set; } = Array.Empty<int>();


		public eEnemyGroupType GroupType { get; set; }

		public eEnemyRoleDifficulty Difficulty { get; set; }

		public int Count { get; set; } = 0;

	}
	public sealed class WEE_AddTerminalCommand
	{
		public struct LocaleTerminalOutput
		{
			public TerminalLineType LineType { get; set; }

			public LocaleText Output { get; set; }

			public float Time { get; set; }

			public readonly TerminalOutput ToTerminalOutput()
			{
				//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_0008: 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_0015: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				//IL_002a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0038: Expected O, but got Unknown
				return new TerminalOutput
				{
					LineType = LineType,
					Output = LocaleText.op_Implicit(SerialLookupManager.ParseLocaleText(Output)),
					Time = Time
				};
			}
		}

		public int TerminalIndex { get; set; } = 0;


		public int CommandNumber { get; set; } = 6;


		public string Command { get; set; } = string.Empty;


		public LocaleText CommandDesc { get; set; } = LocaleText.Empty;


		public bool AutoIndentCommandDesc { get; set; } = false;


		public List<LocaleTerminalOutput> PostCommandOutputs { get; set; } = new List<LocaleTerminalOutput>();


		public List<WardenObjectiveEventData> CommandEvents { get; set; } = new List<WardenObjectiveEventData>();


		public bool ProgressWaitBeforeEvents { get; set; } = false;


		public TERM_CommandRule SpecialCommandRule { get; set; } = (TERM_CommandRule)0;

	}
	public sealed class WEE_HideTerminalCommand
	{
		public int TerminalIndex { get; set; } = 0;


		public TERM_Command CommandEnum { get; set; } = (TERM_Command)0;


		public int CommandNumber { get; set; } = 0;


		public bool DeleteCommand { get; set; } = false;

	}
	public sealed class WEE_UnhideTerminalCommand
	{
		public int TerminalIndex { get; set; } = 0;


		public TERM_Command CommandEnum { get; set; } = (TERM_Command)0;


		public int CommandNumber { get; set; } = 0;

	}
	public sealed class WEE_NestedEvent
	{
		public enum NestedMode : byte
		{
			ActivateAll,
			RandomAny,
			RandomWeighted
		}

		public struct EventsOnRandomWeight
		{
			public string DebugName { get; set; }

			public float Weight { get; set; }

			public int RepeatCount { get; set; }

			public bool IsInfinite { get; set; }

			public List<WardenObjectiveEventData> Events { get; set; }
		}

		public NestedMode Type { get; set; } = NestedMode.ActivateAll;


		public int MaxRandomEvents { get; set; } = -1;


		public bool AllowRepeatsInRandom { get; set; } = false;


		public List<WardenObjectiveEventData> EventsToActivate { get; set; } = new List<WardenObjectiveEventData>();


		public List<EventsOnRandomWeight> WheelOfEvents { get; set; } = new List<EventsOnRandomWeight>();

	}
	public sealed class WEE_StartEventLoop
	{
		public int LoopIndex { get; set; } = 0;


		public float LoopDelay { get; set; } = 1f;


		public int LoopCount { get; set; } = -1;


		public List<WardenObjectiveEventData> EventsToActivate { get; set; } = new List<WardenObjectiveEventData>();

	}
	public enum PlayerIndex : byte
	{
		P0,
		P1,
		P2,
		P3
	}
	public sealed class WEE_TeleportPlayer
	{
		public struct TeleportData
		{
			public PlayerIndex PlayerIndex { get; set; }

			[JsonPropertyName("DimensionIndex")]
			public eDimensionIndex Dimension { get; set; }

			public Vector3 Position { get; set; }

			public string WorldEventObjectFilter { get; set; }

			[JsonPropertyName("LookDirection")]
			public int LookDir { get; set; }

			[JsonPropertyName("LookDirectionV3")]
			public Vector3 LookDirV3 { get; set; }

			public bool PlayWarpAnimation { get; set; }

			[JsonPropertyName("FlashDuration")]
			public float Duration { get; set; }

			[JsonIgnore]
			public PlayerAgent Player { get; set; }

			[JsonIgnore]
			public eDimensionIndex LastDimension { get; set; }

			[JsonIgnore]
			public Vector3 LastPosition { get; set; }

			[JsonIgnore]
			public Vector3 LastLookDirV3 { get; set; }

			[JsonIgnore]
			public List<IWarpableObject> ItemsToWarp { get; set; }
		}

		public HashSet<PlayerIndex> PlayerFilter { get; set; } = new HashSet<PlayerIndex>();


		public bool PlayWarpAnimation { get; set; } = true;


		public bool SendBPUsToHost { get; set; } = false;


		public Vector3 Player0Position { get; set; } = Vector3.zero;


		public int P0LookDir { get; set; } = 0;


		public Vector3 Player1Position { get; set; } = Vector3.zero;


		public int P1LookDir { get; set; } = 0;


		public Vector3 Player2Position { get; set; } = Vector3.zero;


		public int P2LookDir { get; set; } = 0;


		public Vector3 Player3Position { get; set; } = Vector3.zero;


		public int P3LookDir { get; set; } = 0;


		public bool FlashTeleport { get; set; } = false;


		public bool WarpSentries { get; set; } = true;


		public bool WarpBigPickups { get; set; } = true;


		public bool SendBigPickupsToHost
		{
			get
			{
				return SendBPUsToHost;
			}
			set
			{
				SendBPUsToHost = value;
			}
		}

		public bool FullTeamOverflow { get; set; } = false;


		public List<TeleportData> TPData { get; set; } = new List<TeleportData>();

	}
	public sealed class WEE_InfectPlayer
	{
		public HashSet<PlayerIndex> PlayerFilter { get; set; } = new HashSet<PlayerIndex>
		{
			PlayerIndex.P0,
			PlayerIndex.P1,
			PlayerIndex.P2,
			PlayerIndex.P3
		};


		public bool FullTeamOverflow { get; set; } = true;


		public float InfectionAmount { get; set; } = 0f;


		public bool InfectOverTime { get; set; } = false;


		public float Interval { get; set; } = 1f;


		public bool UseZone { get; set; } = false;

	}
	public sealed class WEE_DamagePlayer
	{
		public HashSet<PlayerIndex> PlayerFilter { get; set; } = new HashSet<PlayerIndex>
		{
			PlayerIndex.P0,
			PlayerIndex.P1,
			PlayerIndex.P2,
			PlayerIndex.P3
		};


		public bool FullTeamOverflow { get; set; } = true;


		public float DamageAmount { get; set; } = 0f;


		public bool DamageOverTime { get; set; } = false;


		public float Interval { get; set; } = 1f;


		public bool UseZone { get; set; } = false;

	}
	public sealed class WEE_RevivePlayer
	{
		public HashSet<PlayerIndex> PlayerFilter { get; set; } = new HashSet<PlayerIndex>
		{
			PlayerIndex.P0,
			PlayerIndex.P1,
			PlayerIndex.P2,
			PlayerIndex.P3
		};


		public bool FullTeamOverflow { get; set; } = true;

	}
	public sealed class WEE_AdjustTimer
	{
		public float Duration { get; set; } = 0f;


		public float Speed { get; set; } = 0f;


		public bool UpdateTitleText { get; set; } = false;


		public LocaleText TitleText { get; set; } = LocaleText.Empty;


		public bool UpdateText { get; set; } = false;


		public bool UpdateBodyText
		{
			get
			{
				return UpdateText;
			}
			set
			{
				UpdateText = value;
			}
		}

		public LocaleText CustomText { get; set; } = LocaleText.Empty;


		public LocaleText BodyText
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return CustomText;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				CustomText = value;
			}
		}

		public bool UpdateColor { get; set; } = false;


		public Color TimerColor { get; set; } = Color.red;

	}
	public sealed class WEE_CountupData
	{
		public float Duration { get; set; } = 0f;


		public float StartValue { get; set; } = 0f;


		public float Speed { get; set; } = 1f;


		public LocaleText TimerText { get; set; } = LocaleText.Empty;


		public LocaleText TitleText
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return TimerText;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				TimerText = value;
			}
		}

		public LocaleText CustomText { get; set; } = LocaleText.Empty;


		public LocaleText BodyText
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return CustomText;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				CustomText = value;
			}
		}

		public Color TimerColor { get; set; } = Color.red;


		public int DecimalPoints { get; set; } = 0;


		public List<EventsOnTimerProgress> EventsOnProgress { get; set; } = new List<EventsOnTimerProgress>();


		public List<WardenObjectiveEventData> EventsOnDone { get; set; } = new List<WardenObjectiveEventData>();

	}
	public struct EventsOnTimerProgress
	{
		public float Progress { get; set; }

		public List<WardenObjectiveEventData> Events { get; set; }
	}
	public sealed class WEE_NavMarkerData
	{
		public int Index { get; set; } = 0;


		public NavMarkerOption Style { get; set; } = (NavMarkerOption)10;


		public LocaleText Title { get; set; } = LocaleText.Empty;


		public Color Color { get; set; } = new Color(0.701f, 0.435f, 0.964f, 1f);


		public bool UsePin { get; set; } = true;

	}
	public sealed class WEE_ShakeScreen
	{
		public float Radius { get; set; } = 0f;


		public float Duration { get; set; } = 0f;


		public float Amplitude { get; set; } = 0f;


		public float Frequency { get; set; } = 0f;


		public bool Directional { get; set; } = true;

	}
	public sealed class WEE_StartPortalMachine
	{
		public eDimensionIndex TargetDimension { get; set; } = (eDimensionIndex)1;


		public float TeleportDelay { get; set; } = 5f;


		public bool PreventPortalWarpTeamEvent { get; set; } = false;

	}
	public sealed class WEE_SetSuccessScreen
	{
		public enum ScreenType : byte
		{
			SetSuccessScreen,
			FlashFakeScreen
		}

		public ScreenType Type { get; set; } = ScreenType.SetSuccessScreen;


		public WinScreen CustomSuccessScreen { get; set; } = WinScreen.Empty;


		public eCM_MenuPage FakeEndScreen { get; set; } = (eCM_MenuPage)17;


		public uint OverrideMusic { get; set; } = 0u;

	}
	public sealed class WEE_PlayWaveDistantRoar
	{
		public enum WaveRoarSound : byte
		{
			Striker,
			Shooter,
			Birther,
			Shadow,
			Tank,
			Flyer,
			Immortal,
			Bullrush,
			Pouncer,
			Striker_Berserk,
			Shooter_Spread
		}

		public enum WaveRoarSize : byte
		{
			Small,
			Medium,
			Big
		}

		public WaveRoarSound RoarSound { get; set; } = WaveRoarSound.Striker;


		public WaveRoarSize RoarSize { get; set; } = WaveRoarSize.Small;


		public bool IsOutside { get; set; } = false;

	}
	public sealed class WEE_CustomHudText
	{
		public LocaleText Title { get; set; } = LocaleText.Empty;


		public LocaleText TitleText
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return Title;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				Title = value;
			}
		}

		public LocaleText Body { get; set; } = LocaleText.Empty;


		public LocaleText BodyText
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return Body;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				Body = value;
			}
		}
	}
	public sealed class WEE_SpecialHudTimer
	{
		public enum SpecialHudType : byte
		{
			StartTimer,
			StartIndexTimer,
			StartPersistent,
			StopIndex,
			StopAll
		}

		public float Duration { get; set; } = 0f;


		public SpecialHudType Type { get; set; } = SpecialHudType.StartTimer;


		public int Index { get; set; } = 0;


		public LocaleText Message { get; set; } = LocaleText.Empty;


		public ePUIMessageStyle Style { get; set; } = (ePUIMessageStyle)0;


		public int Priority { get; set; } = -2;


		public bool ShowTimeInProgressBar { get; set; } = true;


		public bool InvertProgress { get; set; } = false;


		public List<EventsOnTimerProgress> EventsOnProgress { get; set; } = new List<EventsOnTimerProgress>();


		public List<WardenObjectiveEventData> EventsOnDone { get; set; } = new List<WardenObjectiveEventData>();

	}
	public sealed class WEE_ForcePlayerDialogue
	{
		public enum DialogueType : byte
		{
			Closest,
			Specific,
			Random
		}

		public enum PlayerIntensityState : byte
		{
			Exploration,
			Stealth,
			Encounter,
			Combat
		}

		public DialogueType Type { get; set; } = DialogueType.Closest;


		public PlayerIndex CharacterID { get; set; } = PlayerIndex.P0;


		public PlayerIntensityState IntensityState { get; set; } = PlayerIntensityState.Exploration;

	}
	public sealed class WEE_SetTerminalLog
	{
		public enum LogEventType : byte
		{
			Add,
			Remove,
			Move
		}

		public int TerminalIndex { get; set; } = 0;


		public LogEventType Type { get; set; } = LogEventType.Add;


		public eDimensionIndex TargetDimensionIndex { get; set; } = (eDimensionIndex)0;


		public LG_LayerType TargetLayer { get; set; } = (LG_LayerType)0;


		public eLocalZoneIndex TargetLocalIndex { get; set; } = (eLocalZoneIndex)0;


		public int TargetTerminalIndex { get; set; } = 0;


		public string FileName { get; set; } = string.Empty;


		public LocaleText FileContent { get; set; } = LocaleText.Empty;


		public Language FileContentOriginalLanguage { get; set; } = (Language)1;


		public uint AttachedAudioFile { get; set; } = 0u;


		public int AttachedAudioByteSize { get; set; } = 0;


		public uint PlayerDialogToTriggerAfterAudio { get; set; } = 0u;


		public List<WardenObjectiveEventData> EventsOnFileRead { get; set; } = new List<WardenObjectiveEventData>();


		public bool TryGetTargetTerminal(out LG_ComputerTerminal targetTerm)
		{
			//IL_000a: 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)
			targetTerm = null;
			LG_Zone val = default(LG_Zone);
			if (!Builder.CurrentFloor.TryGetZoneByLocalIndex(TargetDimensionIndex, TargetLayer, TargetLocalIndex, ref val))
			{
				return false;
			}
			if (TargetTerminalIndex < 0 || TargetTerminalIndex >= val.TerminalsSpawnedInZone.Count)
			{
				return false;
			}
			targetTerm = val.TerminalsSpawnedInZone[TargetTerminalIndex];
			return (Object)(object)targetTerm != (Object)null;
		}
	}
	public sealed class WEE_SetPocketItem
	{
		public enum PlayerTagType : byte
		{
			Custom,
			Specific,
			Random,
			Closest
		}

		public int Index { get; set; } = 0;


		public int Count { get; set; } = 0;


		public bool IsOnTop { get; set; } = false;


		public LocaleText ItemName { get; set; } = LocaleText.Empty;


		public PlayerTagType TagType { get; set; } = PlayerTagType.Custom;


		public PlayerIndex PlayerIndex { get; set; } = PlayerIndex.P0;


		public string CustomTag { get; set; } = string.Empty;


		[JsonIgnore]
		public string? Tag { get; set; } = string.Empty;


		public bool ShouldRemove => Count < 1;

		private string LiveCount => (Count > 1) ? $"{Count} " : string.Empty;

		public string FormatString()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			return $"{LiveCount}{ItemName} <uppercase><color=#ffffff{MathUtil.ZeroOneRangeToHex(0.2f)}>[{Tag}]</color></uppercase>";
		}
	}
	public sealed class WEE_SetOutsideDimensionData
	{
		public bool IsOutside { get; set; } = true;


		public ValueBase LightAzimuth { get; set; } = ValueBase.Unchanged;


		public ValueBase LightElevation { get; set; } = ValueBase.Unchanged;


		public ValueBase LightIntensity { get; set; } = ValueBase.Unchanged;


		public ValueBase AmbientIntensity { get; set; } = ValueBase.Unchanged;


		public ValueBase ReflectionsIntensity { get; set; } = ValueBase.Unchanged;


		public ValueBase GodrayRange { get; set; } = ValueBase.Unchanged;


		public ValueBase GodrayExponent { get; set; } = ValueBase.Unchanged;


		public uint AtmosphereData { get; set; } = 0u;


		public ValueBase AtmosphereDensity { get; set; } = ValueBase.Unchanged;


		public ValueBase Exposure { get; set; } = ValueBase.Unchanged;


		public ValueBase AerialScale { get; set; } = ValueBase.Unchanged;


		public ValueBase MieScattering { get; set; } = ValueBase.Unchanged;


		public ValueBase MieG { get; set; } = ValueBase.Unchanged;


		public ValueBase MultipleScattering { get; set; } = ValueBase.Unchanged;


		public uint CloudsData { get; set; } = 0u;


		public ValueBase CloudsCoverage { get; set; } = ValueBase.Unchanged;


		public ValueBase CloudsDensity { get; set; } = ValueBase.Unchanged;


		public ValueBase CloudsSharpness { get; set; } = ValueBase.Unchanged;


		public ValueBase CloudsShadowOpacity { get; set; } = ValueBase.Unchanged;


		public ValueBase CloudsTimescale { get; set; } = ValueBase.Unchanged;


		public ValueBase CloudsCrawling { get; set; } = ValueBase.Unchanged;


		public ValueBase CloudsFade { get; set; } = ValueBase.Unchanged;


		public BoolBase Sandstorm { get; set; } = BoolBase.Unchanged;


		public ValueBase SandstormEdgeA { get; set; } = ValueBase.Unchanged;


		public ValueBase SandstormEdgeB { get; set; } = ValueBase.Unchanged;


		public ValueBase SandstormMinFog { get; set; } = ValueBase.Unchanged;

	}
	public enum WEE_Type
	{
		CloseSecurityDoor = 10000,
		LockSecurityDoor = 10001,
		SetDoorInteraction = 10002,
		TriggerSecurityDoorAlarm = 10003,
		SolveSecurityDoorAlarm = 10004,
		StartReactor = 10005,
		ModifyReactorWaveState = 10006,
		ForceCompleteReactor = 10007,
		ForceCompleteLevel = 10008,
		ForceFailLevel = 10009,
		Countdown = 10010,
		SetLevelFailCheckEnabled = 10011,
		SetLevelFailWhenAnyPlayerDowned = 10012,
		KillAllPlayers = 10013,
		KillPlayersInZone = 10014,
		SolveSingleObjectiveItem = 10015,
		SetLightDataInZone = 10016,
		AlertEnemiesInZone = 10017,
		CleanupEnemiesInZone = 10018,
		SpawnHibernateInZone = 10019,
		SpawnScoutInZone = 10020,
		SaveCheckpoint = 10021,
		MoveExtractionWorldPosition = 10022,
		SetBlackoutEnabled = 10023,
		AddTerminalCommand = 10024,
		HideTerminalCommand = 10025,
		UnhideTerminalCommand = 10026,
		AddChainPuzzleToSecurityDoor = 10027,
		SetActiveEnemyWave = 10028,
		NestedEvent = 20000,
		StartEventLoop = 20001,
		StopEventLoop = 20002,
		TeleportPlayer = 20003,
		InfectPlayer = 20004,
		DamagePlayer = 20005,
		RevivePlayer = 20006,
		AdjustAWOTimer = 20007,
		Countup = 20008,
		ForceCompleteChainPuzzle = 20009,
		SpawnNavMarker = 20010,
		ShakeScreen = 20011,
		StartPortalMachine = 20012,
		SetSuccessScreen = 20013,
		PlaySubtitles = 20014,
		MultiProgression = 20015,
		PlayWaveRoarSound = 20016,
		CustomHudText = 20017,
		SpecialHudTimer = 20018,
		ForcePlayPlayerDialogue = 20019,
		SetTerminalLog = 20020,
		SetPocketItem = 20021,
		DoInteractWeakDoorsInZone = 20022,
		ToggleInteractWeakDoorsInZone = 20023,
		PickupSentries = 20024,
		SetOutsideDimensionData = 20025
	}
}
namespace AWO.Modules.WEE.Replicators
{
	public struct OutsideDataState
	{
		public float duration;

		public bool revertToOriginal;

		public bool isOutside;

		public uint atmosphereData;

		public uint cloudsData;

		public bool sandstorm;

		public float[] fieldData;
	}
	public sealed class OutsideDataReplicator : MonoBehaviour, IStateReplicatorHolder<OutsideDataState>
	{
		[CompilerGenerated]
		private sealed class <OutsideTransition>d__14 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public OutsideDataState data;

			public bool isRecall;

			public OutsideDataReplicator <>4__this;

			private float <duration>5__1;

			private float[] <startValues>5__2;

			private float <startAzimuth>5__3;

			private float <startElevation>5__4;

			private float <endAzimuth>5__5;

			private float <endElevation>5__6;

			private bool <azimuthOnly>5__7;

			private bool <elevationOnly>5__8;

			private Vector3 <startDir>5__9;

			private Vector3 <endDir>5__10;

			private bool <slerpFlag>5__11;

			private float <time>5__12;

			private float <progress>5__13;

			private Vector3 <dir>5__14;

			private float <elDeg>5__15;

			private float <azDeg>5__16;

			private float <azimuth>5__17;

			private float <elevation>5__18;

			private int <i>5__19;

			private float <endValue>5__20;

			private float <value>5__21;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <OutsideTransition>d__14(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<startValues>5__2 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
				//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
				//IL_02b6: 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_01ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
				//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
				//IL_0231: Unknown result type (might be due to invalid IL or missing references)
				//IL_0236: Unknown result type (might be due to invalid IL or missing references)
				//IL_0248: 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)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					if (data.fieldData?.Length != _fieldMap.Length)
					{
						Logger.Error("OutsideDataReplicator", "Received fieldData does not match, aborting!");
						return false;
					}
					<duration>5__1 = (isRecall ? 0f : data.duration);
					data = (data.revertToOriginal ? <>4__this._origData : data);
					<>4__this.OutsideData.IsOutside = data.isOutside;
					<>4__this.OutsideData.AtmosphereData = ((data.atmosphereData != 0) ? data.atmosphereData : <>4__this.OutsideData.AtmosphereData);
					<>4__this.OutsideData.CloudsData = ((data.cloudsData != 0) ? data.cloudsData : <>4__this.OutsideData.CloudsData);
					<>4__this.OutsideData.Sandstorm = data.sandstorm;
					<startValues>5__2 = GetFieldArray(<>4__this.OutsideData);
					<startAzimuth>5__3 = <startValues>5__2[0];
					<startElevation>5__4 = <startValues>5__2[1];
					<endAzimuth>5__5 = data.fieldData[0];
					<endElevation>5__6 = data.fieldData[1];
					<azimuthOnly>5__7 = !float.IsNaN(<endAzimuth>5__5);
					<elevationOnly>5__8 = !float.IsNaN(<e