Decompiled source of R1Z1 Level v1.0.2

GTFOR1Z1Mod.dll

Decompiled 3 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AIGraph;
using Agents;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using CellMenu;
using Enemies;
using GTFO.API;
using GTFO.API.Utilities;
using GameData;
using HarmonyLib;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSystem.Collections.Generic;
using LevelGeneration;
using Microsoft.CodeAnalysis;
using Player;
using SNetwork;
using TMPro;
using UnityEngine;

[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("GTFOR1Z1Mod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Mod for the level R1Z1")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+8f7e09e32cf8778c25059e37aa5fb04ad17a3768")]
[assembly: AssemblyProduct("GTFOR1Z1Mod")]
[assembly: AssemblyTitle("GTFOR1Z1Mod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace GTFOR1Z1Mod
{
	public class AnticheatPatches
	{
		public static void FreecamPostfix(FreeflightCamera __instance)
		{
			__instance.m_moveSpeedCurr = 0f;
		}
	}
	public class CustomFailScreen
	{
		private static string FailPageText = string.Empty;

		public static void SetFailText(string text)
		{
			if (FailPageText == string.Empty)
			{
				FailPageText = ((TMP_Text)MainMenuGuiLayer.Current.PageExpeditionFail.m_missionFailed_text).m_text;
			}
			((TMP_Text)MainMenuGuiLayer.Current.PageExpeditionFail.m_missionFailed_text).m_text = text;
		}

		public static void RestoreFailText()
		{
			if (FailPageText != string.Empty)
			{
				((TMP_Text)MainMenuGuiLayer.Current.PageExpeditionFail.m_missionFailed_text).m_text = FailPageText;
				FailPageText = string.Empty;
			}
		}
	}
	[HarmonyPatch]
	public class CustomWardenEvents
	{
		private static Dictionary<int, Action<WardenObjectiveEventData>> customWardenEvents = new Dictionary<int, Action<WardenObjectiveEventData>>
		{
			{
				70,
				WardenEventProcessor.Event70
			},
			{
				71,
				WardenEventProcessor.Event71
			},
			{
				72,
				WardenEventProcessor.Event72
			},
			{
				73,
				WardenEventProcessor.Event73
			},
			{
				74,
				WardenEventProcessor.Event74
			}
		};

		[HarmonyPrefix]
		[HarmonyPatch(typeof(WorldEventManager), "ExecuteEvent", new Type[]
		{
			typeof(WardenObjectiveEventData),
			typeof(float)
		})]
		private static bool ExecuteEventPrefix(ref WardenObjectiveEventData eData, float currentDuration)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected I4, but got Unknown
			if (customWardenEvents.TryGetValue((int)eData.Type, out var value))
			{
				if (!CheckWardenEventCondition(eData))
				{
					return false;
				}
				float delay = eData.Delay;
				if (delay > 0f)
				{
					CoroutineDispatcher.StartCoroutine(ExecuteEventCoroutine(value, eData, delay));
				}
				else
				{
					ExecuteEvent(value, eData);
				}
				return false;
			}
			return true;
		}

		private static bool CheckWardenEventCondition(WardenObjectiveEventData eventData)
		{
			int conditionIndex = eventData.Condition.ConditionIndex;
			if (conditionIndex == -1)
			{
				return true;
			}
			bool isTrue = eventData.Condition.IsTrue;
			bool condition = WorldEventManager.GetCondition(conditionIndex);
			return isTrue == condition;
		}

		private static IEnumerator ExecuteEventCoroutine(Action<WardenObjectiveEventData> wardenAction, WardenObjectiveEventData eData, float delay)
		{
			yield return (object)new WaitForSeconds(delay);
			ExecuteEvent(wardenAction, eData);
		}

		private static void ExecuteEvent(Action<WardenObjectiveEventData> wardenAction, WardenObjectiveEventData eData)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			wardenAction(eData);
			WardenObjectiveManager.DisplayWardenIntel(eData.Layer, eData.WardenIntel);
		}
	}
	[HarmonyPatch]
	public class GlowstickPatches
	{
		[HarmonyPostfix]
		[HarmonyPatch(typeof(GlowstickInstance), "Setup")]
		private static void GlowstickSetup_Postfix(GlowstickInstance __instance)
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			if (((GameDataBlockBase<ItemDataBlock>)(object)((Item)__instance).ItemDataBlock).persistentID == 200)
			{
				Color lightColorTarget = default(Color);
				((Color)(ref lightColorTarget))..ctor(1f, 0.9f, 0f, 1f);
				__instance.m_LightColorTarget = lightColorTarget;
				__instance.s_lightRange = 80f;
				__instance.s_lightLifeTime = 15f;
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(GlowstickInstance), "Update")]
		private static void GlowstickUpdate_Postfix(GlowstickInstance __instance)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Invalid comparison between Unknown and I4
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			AIG_CourseNode val = default(AIG_CourseNode);
			if ((int)__instance.m_state != 2 || ((GameDataBlockBase<ItemDataBlock>)(object)((Item)__instance).ItemDataBlock).persistentID != 200 || !Dimension.TryGetCourseNodeFromPos(((Component)__instance).transform.position, ref val) || val.m_enemiesInNode._size == 0)
			{
				return;
			}
			Il2CppArrayBase<EnemyAgent> val2 = val.m_enemiesInNode.ToArray();
			foreach (EnemyAgent item in val2)
			{
				if (((GameDataBlockBase<EnemyDataBlock>)(object)item.EnemyData).persistentID == 47)
				{
					item.Damage.MeleeDamage(float.MaxValue, (Agent)null, ((Component)item).transform.position, Vector3.one, 0, 1f, 1f, 1f, 1f, false, (DamageNoiseLevel)0, 0u);
				}
				else
				{
					item.Damage.InstantDead(false);
				}
			}
		}
	}
	[BepInPlugin("com.giginss.r1z1", "Giginss's R1Z1 Mod", "1.0.0")]
	public class LevelPlugin : BasePlugin
	{
		public static ManualLogSource PluginLogger;

		public static Harmony _harmony = new Harmony("com.giginss.r1z1");

		private ConfigEntry<bool> anticheatEnabled;

		public override void Load()
		{
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Expected O, but got Unknown
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Expected O, but got Unknown
			PluginLogger = ((BasePlugin)this).Log;
			((BasePlugin)this).Log.LogInfo((object)"R1Z1 Level plugin loading...");
			anticheatEnabled = ((BasePlugin)this).Config.Bind<bool>("R1Z1", "Anticheat", true, "Basic anticheat to prevent people from peeking too much into the level.");
			if (anticheatEnabled.Value)
			{
				_harmony.Patch((MethodBase)typeof(FreeflightCamera).GetMethod("Update"), (HarmonyMethod)null, new HarmonyMethod(typeof(AnticheatPatches), "FreecamPostfix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
			}
			_harmony.PatchAll();
			ManualLogSource log = ((BasePlugin)this).Log;
			bool flag = default(bool);
			BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(40, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Patching successful with ");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(_harmony.GetPatchedMethods().Count());
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" total patches.");
			}
			log.LogInfo(val);
			((BasePlugin)this).Log.LogInfo((object)"R1Z1 Level plugin loaded.");
			LevelAPI.OnLevelCleanup += RemoveSpecialModidiers;
			LevelAPI.OnLevelCleanup += CustomFailScreen.RestoreFailText;
			LevelAPI.OnBuildDone += SetupPuzzleTerminals.SetupPuzzleTerminalPasswords;
		}

		private static void RemoveSpecialModidiers()
		{
			if (SNet.IsMaster)
			{
				Enumerator<PlayerAgent> enumerator = PlayerManager.PlayerAgentsInLevel.GetEnumerator();
				while (enumerator.MoveNext())
				{
					PlayerAgent current = enumerator.Current;
					AgentModifierManager.ClearAllModifiersOnAgent((Agent)(object)current);
				}
			}
		}
	}
	[HarmonyPatch]
	public class OverloadDimensionOverride
	{
		private static LayerBuildData overloadData;

		private static bool overrideIsMainDimension;

		[HarmonyPostfix]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		public static void MainDimPrefix(Dimension __instance, ref bool __result)
		{
			if (overrideIsMainDimension)
			{
				__result = true;
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(LG_Floor), "InjectJobs")]
		public static bool InjectJobsPrefix(LG_Floor __instance, eDimensionIndex dimensionIndex)
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Invalid comparison between Unknown and I4
			LevelPlugin.PluginLogger.LogInfo((object)"Inject Jobs called, attempting to remove overload from the list.");
			if (Builder.LayerBuildDatas.Count > 1)
			{
				for (int i = 0; i < Builder.LayerBuildDatas.Count; i++)
				{
					if ((int)Builder.LayerBuildDatas[i].m_type == 2)
					{
						overloadData = Builder.LayerBuildDatas[i];
						Builder.LayerBuildDatas.RemoveAt(i);
						LevelPlugin.PluginLogger.LogInfo((object)"Removed overload LayerBuildData.");
					}
				}
			}
			return true;
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(LG_Floor), "InjectJobs")]
		public static void InjectJobsPostfix(LG_Floor __instance, eDimensionIndex dimensionIndex)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Invalid comparison between Unknown and I4
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			Dimension val = default(Dimension);
			if (overloadData != null && (int)dimensionIndex == 1 && Dimension.GetDimension(dimensionIndex, ref val))
			{
				ManualLogSource pluginLogger = LevelPlugin.PluginLogger;
				bool flag = default(bool);
				BepInExInfoLogInterpolatedStringHandler val2 = new BepInExInfoLogInterpolatedStringHandler(52, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Adding back overload and attempting to spawn it in ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<eDimensionIndex>(dimensionIndex);
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(".");
				}
				pluginLogger.LogInfo(val2);
				Builder.LayerBuildDatas.Add(overloadData);
				overloadData = null;
				overrideIsMainDimension = true;
				__instance.BuildLayer(Builder.LayerBuildDatas.Count - 1, val);
				overrideIsMainDimension = false;
			}
		}
	}
	[HarmonyPatch]
	public class PageMapPatch
	{
		private static Dictionary<PlayerAgent, GameObject> visibilityCones = new Dictionary<PlayerAgent, GameObject>();

		[HarmonyPostfix]
		[HarmonyPatch(typeof(CM_PageMap), "UpdatePlayerData")]
		public static void SetMapVisualsPostfix(CM_PageMap __instance)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Invalid comparison between Unknown and I4
			PlayerAgent localPlayerAgentInLevel = PlayerManager.Current.m_localPlayerAgentInLevel;
			if (!((Object)(object)localPlayerAgentInLevel != (Object)null) || (int)((Agent)localPlayerAgentInLevel).DimensionIndex <= 0)
			{
				return;
			}
			__instance.SetMapDisconnetedTextIsActive(false);
			__instance.SetMapVisualsIsActive(true);
			Enumerator<SNet_Player> enumerator = SNet.Slots.SlottedPlayers.GetEnumerator();
			while (enumerator.MoveNext())
			{
				SNet_Player current = enumerator.Current;
				if (current.HasPlayerAgent)
				{
					__instance.UpdateNavMarker(current);
					__instance.UpdateMarker(current, current.PlayerSlotIndex());
				}
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(PlayerAgent), "Update")]
		public static void EditVisibilityConePostfix(PlayerAgent __instance)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Invalid comparison between Unknown and I4
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			if (__instance.m_isSetup && (int)((Agent)__instance).m_dimensionIndex > 0)
			{
				if (!visibilityCones.ContainsKey(__instance))
				{
					visibilityCones.Add(__instance, new GameObject());
				}
				GameObject val = visibilityCones[__instance];
				val.transform.rotation = __instance.m_mapVisibilityTrans.rotation;
				Vector3 position = __instance.m_mapVisibilityTrans.position;
				val.transform.localScale = __instance.m_mapVisibilityTrans.localScale;
				position.y -= ((Agent)__instance).Dimension.GroundY;
				val.transform.position = position;
				MapDetails.AddVisiblityCone(val.transform, (VisibilityLayer)((!((Agent)__instance).IsLocallyOwned) ? 1 : 0));
			}
		}
	}
	public class SetupPuzzleTerminals
	{
		private static readonly eDimensionIndex TargetDimension = (eDimensionIndex)2;

		private static readonly eLocalZoneIndex TargetZoneIndex = (eLocalZoneIndex)5;

		private static readonly Dictionary<string, string> HintToSolutionDict = new Dictionary<string, string>
		{
			{ "Two power cells. Two goals. Two great enemies guard the final gate.", "DOWNWARDS" },
			{ "The same layout, again and again. The hunt for the cube. The enemies vary.", "CRYPTOMNESIA" },
			{ "Your weapons empty. A world of glue. An inadvertent lockdown.", "RECKLESS" },
			{ "A forced reactor. The hardest challenge. The timer ticks down.", "RELEASE" },
			{ "A long trek. Enemies in pursuit. All in vain.", "VALIANT" },
			{ "The effort of a dead man. A microdrive gifted. Magnetism awaits.", "UNPLUGGED" },
			{ "Back and forth for an unstable Reactor. Chased to the end by 3 titans.", "ERROR" },
			{ "A cluster in fog. An arena for battle. The reactor warms up.", "ACCESS" },
			{ "An unkillable foe. The dimensions twist. No time for passwords.", "CHAOS" },
			{ "A sudden stop. An endless assault. A trojan deployed.", "AWOL" },
			{ "The objective corrupts. The 7 ids. Dive into the fog.", "???" },
			{ "A surge of enemies. A cradle reached. Carry it to the end.", "CRIB" },
			{ "Collect and collect. Making a long trek. The sphere in the darkness.", "PABULUM" },
			{ "An endless alarm, repeated again. A cell ferried, and a command to end.", "KDS DEEP" },
			{ "The lights unstable. A password to fix it. The room of an ally.", "FLUX" },
			{ "A reactor on, a reactor off. Two endless terrible titans. The fog steadily rises.", "POWER HUNGRY" },
			{ "Connection with your others. The coordinates obtained. Progress towards a better world.", "LINK" }
		};

		public static void SetupPuzzleTerminalPasswords()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			List<LG_ComputerTerminal> puzzleTerminals = GetPuzzleTerminals();
			if (puzzleTerminals.Count == 0)
			{
				ManualLogSource pluginLogger = LevelPlugin.PluginLogger;
				bool flag = default(bool);
				BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(26, 0, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("No puzzle terminals found.");
				}
				pluginLogger.LogError(val);
				return;
			}
			puzzleTerminals.RemoveAt(0);
			puzzleTerminals.RemoveAt(puzzleTerminals.Count - 1);
			Dictionary<string, string> dictionary = new Dictionary<string, string>(HintToSolutionDict);
			Random random = new Random(Builder.SessionSeedRandom.Seed);
			foreach (LG_ComputerTerminal item in puzzleTerminals)
			{
				if (dictionary.Count == 0)
				{
					break;
				}
				KeyValuePair<string, string> keyValuePair = dictionary.ElementAt(random.Next(0, dictionary.Count));
				dictionary.Remove(keyValuePair.Key);
				item.LockWithPassword(keyValuePair.Value, new string[1] { "<color=orange>" + keyValuePair.Key + "</color>" });
			}
		}

		private static List<LG_ComputerTerminal> GetPuzzleTerminals()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Expected O, but got Unknown
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			Dimension val = default(Dimension);
			bool flag = default(bool);
			if (!Dimension.GetDimension(TargetDimension, ref val))
			{
				ManualLogSource pluginLogger = LevelPlugin.PluginLogger;
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(31, 1, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("No dimension with index ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<eDimensionIndex>(TargetDimension);
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" found.");
				}
				pluginLogger.LogError(val2);
				return new List<LG_ComputerTerminal>();
			}
			LG_Zone val3 = val.MainLayer.m_zonesByLocalIndex[TargetZoneIndex];
			if ((Object)(object)val3 == (Object)null)
			{
				ManualLogSource pluginLogger2 = LevelPlugin.PluginLogger;
				BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(43, 2, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Dimension ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<eDimensionIndex>(TargetDimension);
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(" did not have a zone with index ");
					((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<eLocalZoneIndex>(TargetZoneIndex);
					((BepInExLogInterpolatedStringHandler)val2).AppendLiteral(".");
				}
				pluginLogger2.LogError(val2);
				return new List<LG_ComputerTerminal>();
			}
			List<LG_ComputerTerminal> list = new List<LG_ComputerTerminal>();
			Enumerator<LG_ComputerTerminal> enumerator = val3.TerminalsSpawnedInZone.GetEnumerator();
			while (enumerator.MoveNext())
			{
				LG_ComputerTerminal current = enumerator.Current;
				list.Add(current);
			}
			return list;
		}
	}
	public class WardenEventProcessor
	{
		private struct Event71Data
		{
			public eDimensionIndex startDimIndex;

			public LG_LayerType startLayer;

			public eLocalZoneIndex startZoneIndex;

			public eDimensionIndex targetDimIndex;

			public LG_LayerType targetLayer;

			public eLocalZoneIndex targetZoneIndex;

			public Event71Data(eDimensionIndex startDim, LG_LayerType initialLayer, eLocalZoneIndex startIndex, eDimensionIndex targetDim, LG_LayerType endLayer, eLocalZoneIndex zone)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				//IL_0009: Unknown result type (might be due to invalid IL or missing references)
				//IL_000a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: 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_0019: Unknown result type (might be due to invalid IL or missing references)
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0021: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: Unknown result type (might be due to invalid IL or missing references)
				//IL_0029: Unknown result type (might be due to invalid IL or missing references)
				startDimIndex = startDim;
				startLayer = initialLayer;
				startZoneIndex = startIndex;
				targetDimIndex = targetDim;
				targetLayer = endLayer;
				targetZoneIndex = zone;
			}
		}

		public static void Event70(WardenObjectiveEventData data)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: 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_00b4: 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)
			Dimension val = default(Dimension);
			if (Dimension.GetDimension(data.DimensionIndex, ref val))
			{
				PlayerAgent localPlayerAgent = PlayerManager.GetLocalPlayerAgent();
				Dimension val2 = default(Dimension);
				if (Dimension.GetDimension(((Agent)localPlayerAgent).DimensionIndex, ref val2))
				{
					LocalPlayerAgent val3 = (LocalPlayerAgent)(object)((localPlayerAgent is LocalPlayerAgent) ? localPlayerAgent : null);
					Vector3 val4 = (((Object)(object)val3 == (Object)null) ? ((Agent)localPlayerAgent).TargetLookDir : ((PlayerAgent)val3).FPSCamera.Forward);
					float num = val.GroundY - val2.GroundY;
					Vector3 val5 = default(Vector3);
					val5.x = ((Component)localPlayerAgent).transform.position.x;
					val5.y = ((Component)localPlayerAgent).transform.position.y + num;
					val5.z = ((Component)localPlayerAgent).transform.position.z;
					localPlayerAgent.RequestWarpToSync(data.DimensionIndex, val5, val4, (WarpOptions)0);
				}
			}
		}

		public static void Event71(WardenObjectiveEventData data)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			PlayerAgent localPlayerAgentInLevel = PlayerManager.Current.m_localPlayerAgentInLevel;
			CoroutineDispatcher.StartCoroutine(Event71Coroutine(new Event71Data(((Agent)localPlayerAgentInLevel).DimensionIndex, ((Agent)localPlayerAgentInLevel).CourseNode.LayerType, ((Agent)localPlayerAgentInLevel).CourseNode.m_zone.LocalIndex, data.DimensionIndex, data.Layer, data.LocalIndex)));
		}

		private static IEnumerator Event71Coroutine(Event71Data data)
		{
			GlobalZoneIndex start = new GlobalZoneIndex(data.startDimIndex, data.startLayer, data.startZoneIndex);
			GlobalZoneIndex target = new GlobalZoneIndex(data.targetDimIndex, data.targetLayer, data.targetZoneIndex);
			EnvironmentStateManager.AttemptSetExpeditionLightModeInZone(target, false, default(pLightSequenceData));
			EnvironmentStateManager.AttemptSetExpeditionLightModeInZone(start, false, default(pLightSequenceData));
			yield return (object)new WaitForSeconds(0.4f);
			EnvironmentStateManager.AttemptSetExpeditionLightModeInZone(start, true, default(pLightSequenceData));
			yield return (object)new WaitForSeconds(0.3f);
			EnvironmentStateManager.AttemptSetExpeditionLightModeInZone(start, false, default(pLightSequenceData));
			yield return (object)new WaitForSeconds(0.3f);
			EnvironmentStateManager.AttemptSetExpeditionLightModeInZone(start, true, default(pLightSequenceData));
			yield return (object)new WaitForSeconds(0.2f);
			EnvironmentStateManager.AttemptSetExpeditionLightModeInZone(start, false, default(pLightSequenceData));
			yield return (object)new WaitForSeconds(0.2f);
			EnvironmentStateManager.AttemptSetExpeditionLightModeInZone(start, true, default(pLightSequenceData));
			yield return (object)new WaitForSeconds(0.4f);
			EnvironmentStateManager.AttemptSetExpeditionLightModeInZone(start, false, default(pLightSequenceData));
			yield return (object)new WaitForSeconds(2f);
			EnvironmentStateManager.AttemptSetExpeditionLightModeInZone(target, true, default(pLightSequenceData));
			EnvironmentStateManager.AttemptSetExpeditionLightModeInZone(start, true, default(pLightSequenceData));
		}

		public static void Event72(WardenObjectiveEventData data)
		{
			if (SNet.IsMaster)
			{
				Enumerator<PlayerAgent> enumerator = PlayerManager.PlayerAgentsInLevel.GetEnumerator();
				while (enumerator.MoveNext())
				{
					PlayerAgent current = enumerator.Current;
					AgentModifierManager.AddModifierValue((Agent)(object)current, (AgentModifier)6, 0.75f, 0f);
					AgentModifierManager.AddModifierValue((Agent)(object)current, (AgentModifier)7, 0.75f, 0f);
					AgentModifierManager.AddModifierValue((Agent)(object)current, (AgentModifier)71, 2f, 0f);
					AgentModifierManager.AddModifierValue((Agent)(object)current, (AgentModifier)70, 2f, 0f);
				}
			}
		}

		public static void Event73(WardenObjectiveEventData data)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			if (SNet.IsMaster)
			{
				pInfection val = default(pInfection);
				val.effect = (pInfectionEffect)0;
				val.mode = (pInfectionMode)0;
				val.amount = 0f;
				Enumerator<PlayerAgent> enumerator = PlayerManager.PlayerAgentsInLevel.GetEnumerator();
				while (enumerator.MoveNext())
				{
					PlayerAgent current = enumerator.Current;
					PlayerBackpackManager.GiveAmmoToPlayer(current.Owner, 1f, 1f, 1f);
					current.Damage.ModifyInfection(val, true, true);
					((Dam_SyncedDamageBase)current.Damage).AddHealth(((Dam_SyncedDamageBase)current.Damage).HealthMax, (Agent)(object)current);
				}
			}
		}

		public static void Event74(WardenObjectiveEventData data)
		{
			CustomFailScreen.SetFailText(data.WorldEventObjectFilter);
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "GTFOR1Z1Mod";

		public const string PLUGIN_NAME = "GTFOR1Z1Mod";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}