Decompiled source of Zombified Initiative v0.9.3

Zombified_Initiative.dll

Decompiled a year ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using Agents;
using BepInEx;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using BepInEx.Unity.IL2CPP.Utils.Collections;
using Enemies;
using GTFO.API;
using GameData;
using HarmonyLib;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSystem;
using Il2CppSystem.Collections.Generic;
using Il2CppSystem.Reflection;
using LevelGeneration;
using Localization;
using Microsoft.CodeAnalysis;
using Player;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("Zombified_Initiative")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Zombified_Initiative")]
[assembly: AssemblyTitle("Zombified_Initiative")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[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 ZombifiedInitiative
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("org.bepinex.plugins.zombified-initiative", "Zombified Initiative", "0.9.3")]
	public class ZombifiedInitiative : BasePlugin
	{
		public class Initiative : MonoBehaviour
		{
			private enum Bot
			{
				DAUDA,
				HACKETT,
				BISHOP,
				WOODS
			}

			private Dictionary<Bot, string> botNameMapping = new Dictionary<Bot, string>
			{
				{
					Bot.DAUDA,
					"Dauda"
				},
				{
					Bot.HACKETT,
					"Hackett"
				},
				{
					Bot.BISHOP,
					"Bishop"
				},
				{
					Bot.WOODS,
					"Woods"
				}
			};

			public static ManualLogSource Log;

			public static Dictionary<string, PlayerAIBot> BotTable = new Dictionary<string, PlayerAIBot>();

			public List<PlayerAgent> _plrs;

			public static PUI_CommunicationMenu _menu;

			public static CommunicationNode zombmenu;

			public static CommunicationNode bot1menu;

			public static CommunicationNode bot2menu;

			public static CommunicationNode bot3menu;

			public static CommunicationNode bot4menu;

			public static int _highlightedMenuButtonIndex = 0;

			public static float _manualActionsPriority = 5f;

			public static float _manualActionsHaste = 1f;

			public static bool _preventAutoPickups = true;

			public static bool _preventAutoUses = true;

			public static bool _preventManual = false;

			public static bool _debug = true;

			public static bool _menuadded = false;

			public void Awake()
			{
				BotTable.Clear();
			}

			public static void AddZombifiedText()
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				//IL_000c: Expected O, but got Unknown
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0013: Expected O, but got Unknown
				//IL_0013: 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_0025: Expected O, but got Unknown
				//IL_0025: Unknown result type (might be due to invalid IL or missing references)
				//IL_0031: Expected O, but got Unknown
				//IL_0031: 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_003d: Expected O, but got Unknown
				//IL_003d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0044: Expected O, but got Unknown
				//IL_0044: Unknown result type (might be due to invalid IL or missing references)
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0056: Expected O, but got Unknown
				//IL_0056: Unknown result type (might be due to invalid IL or missing references)
				//IL_0062: Expected O, but got Unknown
				//IL_0062: Unknown result type (might be due to invalid IL or missing references)
				//IL_0067: Unknown result type (might be due to invalid IL or missing references)
				//IL_006e: Expected O, but got Unknown
				//IL_006e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0075: Expected O, but got Unknown
				//IL_0075: Unknown result type (might be due to invalid IL or missing references)
				//IL_007c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0087: Expected O, but got Unknown
				//IL_0087: Unknown result type (might be due to invalid IL or missing references)
				//IL_0093: Expected O, but got Unknown
				//IL_0093: 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_009f: Expected O, but got Unknown
				//IL_009f: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a6: Expected O, but got Unknown
				//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b8: Expected O, but got Unknown
				//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c4: Expected O, but got Unknown
				//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d0: Expected O, but got Unknown
				//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d7: Expected O, but got Unknown
				//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00de: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e9: Expected O, but got Unknown
				//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f6: Expected O, but got Unknown
				//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
				//IL_0102: Expected O, but got Unknown
				//IL_0102: Unknown result type (might be due to invalid IL or missing references)
				//IL_0109: Expected O, but got Unknown
				//IL_0109: Unknown result type (might be due to invalid IL or missing references)
				//IL_0110: Unknown result type (might be due to invalid IL or missing references)
				//IL_011b: Expected O, but got Unknown
				//IL_011b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0128: Expected O, but got Unknown
				//IL_0128: Unknown result type (might be due to invalid IL or missing references)
				//IL_012d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0134: Expected O, but got Unknown
				//IL_0134: Unknown result type (might be due to invalid IL or missing references)
				//IL_013b: Expected O, but got Unknown
				//IL_013b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0142: Unknown result type (might be due to invalid IL or missing references)
				//IL_014d: Expected O, but got Unknown
				//IL_014d: Unknown result type (might be due to invalid IL or missing references)
				//IL_015a: Expected O, but got Unknown
				//IL_015a: Unknown result type (might be due to invalid IL or missing references)
				//IL_015f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0166: Expected O, but got Unknown
				//IL_0166: Unknown result type (might be due to invalid IL or missing references)
				//IL_016d: Expected O, but got Unknown
				//IL_016d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0174: Unknown result type (might be due to invalid IL or missing references)
				//IL_017f: Expected O, but got Unknown
				//IL_017f: Unknown result type (might be due to invalid IL or missing references)
				//IL_018c: Expected O, but got Unknown
				//IL_018c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0191: Unknown result type (might be due to invalid IL or missing references)
				//IL_0198: Expected O, but got Unknown
				//IL_0198: Unknown result type (might be due to invalid IL or missing references)
				//IL_019f: Expected O, but got Unknown
				//IL_019f: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b1: Expected O, but got Unknown
				//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
				//IL_01be: Expected O, but got Unknown
				//IL_01be: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ca: Expected O, but got Unknown
				//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d1: Expected O, but got Unknown
				//IL_01d1: 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_01e3: Expected O, but got Unknown
				//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f0: Expected O, but got Unknown
				//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
				//IL_01fc: Expected O, but got Unknown
				//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
				//IL_0203: Expected O, but got Unknown
				//IL_0203: Unknown result type (might be due to invalid IL or missing references)
				//IL_020a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0215: Expected O, but got Unknown
				//IL_0215: Unknown result type (might be due to invalid IL or missing references)
				//IL_0222: Expected O, but got Unknown
				//IL_0222: Unknown result type (might be due to invalid IL or missing references)
				//IL_0227: Unknown result type (might be due to invalid IL or missing references)
				//IL_022e: Expected O, but got Unknown
				//IL_022e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0235: Expected O, but got Unknown
				//IL_0235: Unknown result type (might be due to invalid IL or missing references)
				//IL_023c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0247: Expected O, but got Unknown
				//IL_0247: Unknown result type (might be due to invalid IL or missing references)
				//IL_0254: Expected O, but got Unknown
				//IL_0254: Unknown result type (might be due to invalid IL or missing references)
				//IL_0259: Unknown result type (might be due to invalid IL or missing references)
				//IL_0260: Expected O, but got Unknown
				//IL_0260: Unknown result type (might be due to invalid IL or missing references)
				//IL_0267: Expected O, but got Unknown
				//IL_0267: Unknown result type (might be due to invalid IL or missing references)
				//IL_026e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0279: Expected O, but got Unknown
				//IL_0279: Unknown result type (might be due to invalid IL or missing references)
				//IL_0286: Expected O, but got Unknown
				//IL_0286: Unknown result type (might be due to invalid IL or missing references)
				//IL_028b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0292: Expected O, but got Unknown
				//IL_0292: Unknown result type (might be due to invalid IL or missing references)
				//IL_0299: Expected O, but got Unknown
				//IL_0299: Unknown result type (might be due to invalid IL or missing references)
				//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
				//IL_02ab: Expected O, but got Unknown
				//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
				//IL_02b8: Expected O, but got Unknown
				//IL_02b8: Unknown result type (might be due to invalid IL or missing references)
				//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
				//IL_02c4: Expected O, but got Unknown
				//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
				//IL_02cb: Expected O, but got Unknown
				//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
				//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
				//IL_02dd: Expected O, but got Unknown
				//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
				//IL_02ea: Expected O, but got Unknown
				//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
				//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_02f6: Expected O, but got Unknown
				//IL_02f6: Unknown result type (might be due to invalid IL or missing references)
				//IL_02fd: Expected O, but got Unknown
				//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
				//IL_0304: Unknown result type (might be due to invalid IL or missing references)
				//IL_030f: Expected O, but got Unknown
				//IL_030f: Unknown result type (might be due to invalid IL or missing references)
				//IL_031c: Expected O, but got Unknown
				//IL_031c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0321: Unknown result type (might be due to invalid IL or missing references)
				//IL_0328: Expected O, but got Unknown
				//IL_0328: Unknown result type (might be due to invalid IL or missing references)
				//IL_032f: Expected O, but got Unknown
				//IL_032f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0336: Unknown result type (might be due to invalid IL or missing references)
				//IL_0341: Expected O, but got Unknown
				//IL_0341: Unknown result type (might be due to invalid IL or missing references)
				//IL_034e: Expected O, but got Unknown
				//IL_034e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0353: Unknown result type (might be due to invalid IL or missing references)
				//IL_035a: Expected O, but got Unknown
				//IL_035a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0361: Expected O, but got Unknown
				//IL_0361: Unknown result type (might be due to invalid IL or missing references)
				//IL_0368: Unknown result type (might be due to invalid IL or missing references)
				//IL_0373: Expected O, but got Unknown
				//IL_0373: Unknown result type (might be due to invalid IL or missing references)
				//IL_0380: Expected O, but got Unknown
				//IL_0380: Unknown result type (might be due to invalid IL or missing references)
				//IL_0385: Unknown result type (might be due to invalid IL or missing references)
				//IL_038c: Expected O, but got Unknown
				//IL_038c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0393: Expected O, but got Unknown
				//IL_0393: Unknown result type (might be due to invalid IL or missing references)
				//IL_039a: Unknown result type (might be due to invalid IL or missing references)
				//IL_03a5: Expected O, but got Unknown
				//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
				//IL_03b2: Expected O, but got Unknown
				//IL_03b2: Unknown result type (might be due to invalid IL or missing references)
				//IL_03b7: Unknown result type (might be due to invalid IL or missing references)
				//IL_03be: Expected O, but got Unknown
				//IL_03be: Unknown result type (might be due to invalid IL or missing references)
				//IL_03c5: Expected O, but got Unknown
				//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
				//IL_03cc: Unknown result type (might be due to invalid IL or missing references)
				//IL_03d7: Expected O, but got Unknown
				//IL_03d7: Unknown result type (might be due to invalid IL or missing references)
				//IL_03e4: Expected O, but got Unknown
				//IL_03e4: Unknown result type (might be due to invalid IL or missing references)
				//IL_03e9: Unknown result type (might be due to invalid IL or missing references)
				//IL_03f0: Expected O, but got Unknown
				//IL_03f0: Unknown result type (might be due to invalid IL or missing references)
				//IL_03f7: Expected O, but got Unknown
				//IL_03f7: Unknown result type (might be due to invalid IL or missing references)
				//IL_03fe: Unknown result type (might be due to invalid IL or missing references)
				//IL_0409: Expected O, but got Unknown
				//IL_0409: Unknown result type (might be due to invalid IL or missing references)
				//IL_0416: Expected O, but got Unknown
				//IL_0507: Unknown result type (might be due to invalid IL or missing references)
				//IL_0543: Unknown result type (might be due to invalid IL or missing references)
				//IL_057f: Unknown result type (might be due to invalid IL or missing references)
				//IL_05bb: Unknown result type (might be due to invalid IL or missing references)
				//IL_05f8: Unknown result type (might be due to invalid IL or missing references)
				//IL_0635: Unknown result type (might be due to invalid IL or missing references)
				//IL_0672: Unknown result type (might be due to invalid IL or missing references)
				//IL_06af: Unknown result type (might be due to invalid IL or missing references)
				//IL_06ec: Unknown result type (might be due to invalid IL or missing references)
				//IL_0729: Unknown result type (might be due to invalid IL or missing references)
				//IL_0766: Unknown result type (might be due to invalid IL or missing references)
				//IL_07a3: Unknown result type (might be due to invalid IL or missing references)
				//IL_07e0: Unknown result type (might be due to invalid IL or missing references)
				//IL_081d: Unknown result type (might be due to invalid IL or missing references)
				//IL_085a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0897: Unknown result type (might be due to invalid IL or missing references)
				//IL_08d4: Unknown result type (might be due to invalid IL or missing references)
				//IL_0911: Unknown result type (might be due to invalid IL or missing references)
				//IL_094e: Unknown result type (might be due to invalid IL or missing references)
				//IL_098b: Unknown result type (might be due to invalid IL or missing references)
				//IL_09c8: Unknown result type (might be due to invalid IL or missing references)
				TextDataBlock val = new TextDataBlock();
				((GameDataBlockBase<TextDataBlock>)val).persistentID = 0u;
				((GameDataBlockBase<TextDataBlock>)val).internalEnabled = true;
				val.SkipLocalization = true;
				((GameDataBlockBase<TextDataBlock>)val).name = "zombtext1";
				val.English = "Zombified Initiative";
				TextDataBlock val2 = val;
				TextDataBlock val3 = new TextDataBlock();
				((GameDataBlockBase<TextDataBlock>)val3).persistentID = 0u;
				((GameDataBlockBase<TextDataBlock>)val3).internalEnabled = true;
				val3.SkipLocalization = true;
				((GameDataBlockBase<TextDataBlock>)val3).name = "zombtext2";
				val3.English = "AllBots attack my target";
				TextDataBlock val4 = val3;
				TextDataBlock val5 = new TextDataBlock();
				((GameDataBlockBase<TextDataBlock>)val5).persistentID = 0u;
				((GameDataBlockBase<TextDataBlock>)val5).internalEnabled = true;
				val5.SkipLocalization = true;
				((GameDataBlockBase<TextDataBlock>)val5).name = "zombtext3";
				val5.English = "AllBots toggle resource pickups";
				TextDataBlock val6 = val5;
				TextDataBlock val7 = new TextDataBlock();
				((GameDataBlockBase<TextDataBlock>)val7).persistentID = 0u;
				((GameDataBlockBase<TextDataBlock>)val7).internalEnabled = true;
				val7.SkipLocalization = true;
				((GameDataBlockBase<TextDataBlock>)val7).name = "zombtext4";
				val7.English = "AllBots clear command queue";
				TextDataBlock val8 = val7;
				TextDataBlock val9 = new TextDataBlock();
				((GameDataBlockBase<TextDataBlock>)val9).persistentID = 0u;
				((GameDataBlockBase<TextDataBlock>)val9).internalEnabled = true;
				val9.SkipLocalization = true;
				((GameDataBlockBase<TextDataBlock>)val9).name = "zombtext5";
				val9.English = "AllBots toggle resource auto use";
				TextDataBlock val10 = val9;
				TextDataBlock val11 = new TextDataBlock();
				((GameDataBlockBase<TextDataBlock>)val11).persistentID = 0u;
				((GameDataBlockBase<TextDataBlock>)val11).internalEnabled = true;
				val11.SkipLocalization = true;
				((GameDataBlockBase<TextDataBlock>)val11).name = "zombtext6";
				val11.English = "Woods";
				TextDataBlock val12 = val11;
				TextDataBlock val13 = new TextDataBlock();
				((GameDataBlockBase<TextDataBlock>)val13).persistentID = 0u;
				((GameDataBlockBase<TextDataBlock>)val13).internalEnabled = true;
				val13.SkipLocalization = true;
				((GameDataBlockBase<TextDataBlock>)val13).name = "zombtext7";
				val13.English = "Dauda";
				TextDataBlock val14 = val13;
				TextDataBlock val15 = new TextDataBlock();
				((GameDataBlockBase<TextDataBlock>)val15).persistentID = 0u;
				((GameDataBlockBase<TextDataBlock>)val15).internalEnabled = true;
				val15.SkipLocalization = true;
				((GameDataBlockBase<TextDataBlock>)val15).name = "zombtext8";
				val15.English = "Hackett";
				TextDataBlock val16 = val15;
				TextDataBlock val17 = new TextDataBlock();
				((GameDataBlockBase<TextDataBlock>)val17).persistentID = 0u;
				((GameDataBlockBase<TextDataBlock>)val17).internalEnabled = true;
				val17.SkipLocalization = true;
				((GameDataBlockBase<TextDataBlock>)val17).name = "zombtext9";
				val17.English = "Bishop";
				TextDataBlock val18 = val17;
				TextDataBlock val19 = new TextDataBlock();
				((GameDataBlockBase<TextDataBlock>)val19).persistentID = 0u;
				((GameDataBlockBase<TextDataBlock>)val19).internalEnabled = true;
				val19.SkipLocalization = true;
				((GameDataBlockBase<TextDataBlock>)val19).name = "zombtext10";
				val19.English = "Woods attack my target";
				TextDataBlock val20 = val19;
				TextDataBlock val21 = new TextDataBlock();
				((GameDataBlockBase<TextDataBlock>)val21).persistentID = 0u;
				((GameDataBlockBase<TextDataBlock>)val21).internalEnabled = true;
				val21.SkipLocalization = true;
				((GameDataBlockBase<TextDataBlock>)val21).name = "zombtext11";
				val21.English = "Woods pickup resource under my aim";
				TextDataBlock val22 = val21;
				TextDataBlock val23 = new TextDataBlock();
				((GameDataBlockBase<TextDataBlock>)val23).persistentID = 0u;
				((GameDataBlockBase<TextDataBlock>)val23).internalEnabled = true;
				val23.SkipLocalization = true;
				((GameDataBlockBase<TextDataBlock>)val23).name = "zombtext12";
				val23.English = "Woods supply resource (aimed or me)";
				TextDataBlock val24 = val23;
				TextDataBlock val25 = new TextDataBlock();
				((GameDataBlockBase<TextDataBlock>)val25).persistentID = 0u;
				((GameDataBlockBase<TextDataBlock>)val25).internalEnabled = true;
				val25.SkipLocalization = true;
				((GameDataBlockBase<TextDataBlock>)val25).name = "zombtext13";
				val25.English = "Dauda attack my target";
				TextDataBlock val26 = val25;
				TextDataBlock val27 = new TextDataBlock();
				((GameDataBlockBase<TextDataBlock>)val27).persistentID = 0u;
				((GameDataBlockBase<TextDataBlock>)val27).internalEnabled = true;
				val27.SkipLocalization = true;
				((GameDataBlockBase<TextDataBlock>)val27).name = "zombtext14";
				val27.English = "Dauda pickup resource under my aim";
				TextDataBlock val28 = val27;
				TextDataBlock val29 = new TextDataBlock();
				((GameDataBlockBase<TextDataBlock>)val29).persistentID = 0u;
				((GameDataBlockBase<TextDataBlock>)val29).internalEnabled = true;
				val29.SkipLocalization = true;
				((GameDataBlockBase<TextDataBlock>)val29).name = "zombtext15";
				val29.English = "Dauda supply resource (aimed or me)";
				TextDataBlock val30 = val29;
				TextDataBlock val31 = new TextDataBlock();
				((GameDataBlockBase<TextDataBlock>)val31).persistentID = 0u;
				((GameDataBlockBase<TextDataBlock>)val31).internalEnabled = true;
				val31.SkipLocalization = true;
				((GameDataBlockBase<TextDataBlock>)val31).name = "zombtext16";
				val31.English = "Hackett attack my target";
				TextDataBlock val32 = val31;
				TextDataBlock val33 = new TextDataBlock();
				((GameDataBlockBase<TextDataBlock>)val33).persistentID = 0u;
				((GameDataBlockBase<TextDataBlock>)val33).internalEnabled = true;
				val33.SkipLocalization = true;
				((GameDataBlockBase<TextDataBlock>)val33).name = "zombtext17";
				val33.English = "Hackett pickup resource under my aim";
				TextDataBlock val34 = val33;
				TextDataBlock val35 = new TextDataBlock();
				((GameDataBlockBase<TextDataBlock>)val35).persistentID = 0u;
				((GameDataBlockBase<TextDataBlock>)val35).internalEnabled = true;
				val35.SkipLocalization = true;
				((GameDataBlockBase<TextDataBlock>)val35).name = "zombtext18";
				val35.English = "Hackett supply resource (aimed or me)";
				TextDataBlock val36 = val35;
				TextDataBlock val37 = new TextDataBlock();
				((GameDataBlockBase<TextDataBlock>)val37).persistentID = 0u;
				((GameDataBlockBase<TextDataBlock>)val37).internalEnabled = true;
				val37.SkipLocalization = true;
				((GameDataBlockBase<TextDataBlock>)val37).name = "zombtext19";
				val37.English = "Bishop attack my target";
				TextDataBlock val38 = val37;
				TextDataBlock val39 = new TextDataBlock();
				((GameDataBlockBase<TextDataBlock>)val39).persistentID = 0u;
				((GameDataBlockBase<TextDataBlock>)val39).internalEnabled = true;
				val39.SkipLocalization = true;
				((GameDataBlockBase<TextDataBlock>)val39).name = "zombtext20";
				val39.English = "Bishop pickup resource under my aim";
				TextDataBlock val40 = val39;
				TextDataBlock val41 = new TextDataBlock();
				((GameDataBlockBase<TextDataBlock>)val41).persistentID = 0u;
				((GameDataBlockBase<TextDataBlock>)val41).internalEnabled = true;
				val41.SkipLocalization = true;
				((GameDataBlockBase<TextDataBlock>)val41).name = "zombtext21";
				val41.English = "Bishop supply resource (aimed or me)";
				TextDataBlock val42 = val41;
				GameDataBlockBase<TextDataBlock>.AddBlock(val2, -1);
				GameDataBlockBase<TextDataBlock>.AddBlock(val4, -1);
				GameDataBlockBase<TextDataBlock>.AddBlock(val6, -1);
				GameDataBlockBase<TextDataBlock>.AddBlock(val8, -1);
				GameDataBlockBase<TextDataBlock>.AddBlock(val10, -1);
				GameDataBlockBase<TextDataBlock>.AddBlock(val12, -1);
				GameDataBlockBase<TextDataBlock>.AddBlock(val14, -1);
				GameDataBlockBase<TextDataBlock>.AddBlock(val16, -1);
				GameDataBlockBase<TextDataBlock>.AddBlock(val18, -1);
				GameDataBlockBase<TextDataBlock>.AddBlock(val20, -1);
				GameDataBlockBase<TextDataBlock>.AddBlock(val22, -1);
				GameDataBlockBase<TextDataBlock>.AddBlock(val24, -1);
				GameDataBlockBase<TextDataBlock>.AddBlock(val26, -1);
				GameDataBlockBase<TextDataBlock>.AddBlock(val28, -1);
				GameDataBlockBase<TextDataBlock>.AddBlock(val30, -1);
				GameDataBlockBase<TextDataBlock>.AddBlock(val32, -1);
				GameDataBlockBase<TextDataBlock>.AddBlock(val34, -1);
				GameDataBlockBase<TextDataBlock>.AddBlock(val36, -1);
				GameDataBlockBase<TextDataBlock>.AddBlock(val38, -1);
				GameDataBlockBase<TextDataBlock>.AddBlock(val40, -1);
				GameDataBlockBase<TextDataBlock>.AddBlock(val42, -1);
				GameDataTextLocalizationService val43 = ((Il2CppObjectBase)Text.TextLocalizationService).TryCast<GameDataTextLocalizationService>();
				if (!val43.m_texts.ContainsKey(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext1")))
				{
					val43.m_texts.Add(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext1"), val2.GetText(val43.CurrentLanguage, false));
				}
				if (!val43.m_texts.ContainsKey(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext2")))
				{
					val43.m_texts.Add(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext2"), val4.GetText(val43.CurrentLanguage, false));
				}
				if (!val43.m_texts.ContainsKey(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext3")))
				{
					val43.m_texts.Add(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext3"), val6.GetText(val43.CurrentLanguage, false));
				}
				if (!val43.m_texts.ContainsKey(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext4")))
				{
					val43.m_texts.Add(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext4"), val8.GetText(val43.CurrentLanguage, false));
				}
				if (!val43.m_texts.ContainsKey(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext5")))
				{
					val43.m_texts.Add(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext5"), val10.GetText(val43.CurrentLanguage, false));
				}
				if (!val43.m_texts.ContainsKey(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext6")))
				{
					val43.m_texts.Add(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext6"), val12.GetText(val43.CurrentLanguage, false));
				}
				if (!val43.m_texts.ContainsKey(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext7")))
				{
					val43.m_texts.Add(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext7"), val14.GetText(val43.CurrentLanguage, false));
				}
				if (!val43.m_texts.ContainsKey(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext8")))
				{
					val43.m_texts.Add(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext8"), val16.GetText(val43.CurrentLanguage, false));
				}
				if (!val43.m_texts.ContainsKey(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext9")))
				{
					val43.m_texts.Add(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext9"), val18.GetText(val43.CurrentLanguage, false));
				}
				if (!val43.m_texts.ContainsKey(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext10")))
				{
					val43.m_texts.Add(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext10"), val20.GetText(val43.CurrentLanguage, false));
				}
				if (!val43.m_texts.ContainsKey(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext11")))
				{
					val43.m_texts.Add(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext11"), val22.GetText(val43.CurrentLanguage, false));
				}
				if (!val43.m_texts.ContainsKey(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext12")))
				{
					val43.m_texts.Add(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext12"), val24.GetText(val43.CurrentLanguage, false));
				}
				if (!val43.m_texts.ContainsKey(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext13")))
				{
					val43.m_texts.Add(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext13"), val26.GetText(val43.CurrentLanguage, false));
				}
				if (!val43.m_texts.ContainsKey(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext14")))
				{
					val43.m_texts.Add(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext14"), val28.GetText(val43.CurrentLanguage, false));
				}
				if (!val43.m_texts.ContainsKey(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext15")))
				{
					val43.m_texts.Add(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext15"), val30.GetText(val43.CurrentLanguage, false));
				}
				if (!val43.m_texts.ContainsKey(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext16")))
				{
					val43.m_texts.Add(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext16"), val32.GetText(val43.CurrentLanguage, false));
				}
				if (!val43.m_texts.ContainsKey(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext17")))
				{
					val43.m_texts.Add(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext17"), val34.GetText(val43.CurrentLanguage, false));
				}
				if (!val43.m_texts.ContainsKey(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext18")))
				{
					val43.m_texts.Add(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext18"), val36.GetText(val43.CurrentLanguage, false));
				}
				if (!val43.m_texts.ContainsKey(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext19")))
				{
					val43.m_texts.Add(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext19"), val38.GetText(val43.CurrentLanguage, false));
				}
				if (!val43.m_texts.ContainsKey(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext20")))
				{
					val43.m_texts.Add(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext20"), val40.GetText(val43.CurrentLanguage, false));
				}
				if (!val43.m_texts.ContainsKey(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext21")))
				{
					val43.m_texts.Add(GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext21"), val42.GetText(val43.CurrentLanguage, false));
				}
			}

			public void Initialize()
			{
				CoroutineManager.StartCoroutine(CollectionExtensions.WrapToIl2Cpp(FindBots()), (Action)null);
				if (!_menuadded)
				{
					AddZombifiedMenu();
					_menuadded = true;
				}
			}

			private void Update()
			{
				if (Input.GetKeyDown((KeyCode)108))
				{
					SwitchDebug();
				}
				if (Input.GetKeyDown((KeyCode)112))
				{
					PreventManualActions();
				}
				if (Input.GetKeyDown((KeyCode)106))
				{
					_preventAutoPickups = !_preventAutoPickups;
					Print("Automatic resource pickups " + (_preventAutoPickups ? "disabled" : "enabled"));
				}
				if (Input.GetKeyDown((KeyCode)107))
				{
					_preventAutoUses = !_preventAutoUses;
					Print("Automatic resource uses " + (_preventAutoUses ? "disabled" : "enabled"));
				}
				if (_preventAutoPickups)
				{
					PreventAutoResourcePickups();
				}
				if (_preventAutoUses)
				{
					PreventAutoResourceUses();
				}
				if (Input.GetKey((KeyCode)56))
				{
					SendBot("Dauda");
				}
				if (Input.GetKey((KeyCode)57))
				{
					SendBot("Hackett");
				}
				if (Input.GetKey((KeyCode)48))
				{
					SendBot("Bishop");
				}
				if (Input.GetKey((KeyCode)287))
				{
					SendBot("Woods");
				}
				static void SendBot(string bot)
				{
					if (Input.GetMouseButtonDown(2))
					{
						EnemyAgent monsterUnderPlayerAim = GetMonsterUnderPlayerAim();
						if ((Object)(object)monsterUnderPlayerAim != (Object)null)
						{
							SendBotToKillEnemy(bot, (Agent)(object)monsterUnderPlayerAim, (StanceEnum)3, (AttackMeansEnum)31, (PostureEnum)1);
						}
					}
					if (Input.GetKeyDown((KeyCode)117))
					{
						ItemInLevel itemUnderPlayerAim = GetItemUnderPlayerAim();
						if ((Object)(object)itemUnderPlayerAim != (Object)null)
						{
							SendBotToPickupItem(bot, itemUnderPlayerAim);
						}
					}
					if (Input.GetKeyDown((KeyCode)105))
					{
						SendBotToShareResourcePack(bot, GetHumanUnderPlayerAim());
					}
				}
			}

			private IEnumerator FindBots()
			{
				while (true)
				{
					BotTable.Clear();
					_plrs = PlayerManager.PlayerAgentsInLevel;
					Enumerator<PlayerAgent> enumerator = _plrs.GetEnumerator();
					while (enumerator.MoveNext())
					{
						PlayerAgent current = enumerator.Current;
						if (current.Owner.IsBot)
						{
							string playerName = current.PlayerName;
							PlayerAIBot component = ((Component)current).gameObject.GetComponent<PlayerAIBot>();
							BotTable[playerName] = component;
						}
					}
					Print("bots found: " + BotTable.Count);
					yield return (object)new WaitForSeconds(2f);
					if ((Object)(object)_menu != (Object)null && !_menu.m_root.activeInHierarchy)
					{
						RebuildZombifiedMenu();
					}
					yield return (object)new WaitForSeconds(1f);
				}
			}

			public void FindMenu()
			{
				_menu = Object.FindObjectOfType<PUI_CommunicationMenu>();
				Print("Found menu");
			}

			public static void AddZombifiedMenu()
			{
				//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
				//IL_0100: Expected O, but got Unknown
				//IL_0113: Unknown result type (might be due to invalid IL or missing references)
				//IL_011d: Expected O, but got Unknown
				//IL_0128: Unknown result type (might be due to invalid IL or missing references)
				//IL_0132: Expected O, but got Unknown
				//IL_013d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0147: Expected O, but got Unknown
				//IL_0152: Unknown result type (might be due to invalid IL or missing references)
				//IL_015c: Expected O, but got Unknown
				//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c4: Expected O, but got Unknown
				//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e2: Expected O, but got Unknown
				//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f8: Expected O, but got Unknown
				//IL_0204: Unknown result type (might be due to invalid IL or missing references)
				//IL_020e: Expected O, but got Unknown
				//IL_0258: Unknown result type (might be due to invalid IL or missing references)
				//IL_025f: Expected O, but got Unknown
				//IL_0273: Unknown result type (might be due to invalid IL or missing references)
				//IL_027d: Expected O, but got Unknown
				//IL_0289: Unknown result type (might be due to invalid IL or missing references)
				//IL_0293: Expected O, but got Unknown
				//IL_029f: Unknown result type (might be due to invalid IL or missing references)
				//IL_02a9: Expected O, but got Unknown
				//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
				//IL_02fa: Expected O, but got Unknown
				//IL_030e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0318: Expected O, but got Unknown
				//IL_0324: Unknown result type (might be due to invalid IL or missing references)
				//IL_032e: Expected O, but got Unknown
				//IL_033a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0344: Expected O, but got Unknown
				//IL_038e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0395: Expected O, but got Unknown
				//IL_03a9: Unknown result type (might be due to invalid IL or missing references)
				//IL_03b3: Expected O, but got Unknown
				//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
				//IL_03c9: Expected O, but got Unknown
				//IL_03d5: Unknown result type (might be due to invalid IL or missing references)
				//IL_03df: Expected O, but got Unknown
				uint blockID = GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext1");
				uint blockID2 = GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext2");
				uint blockID3 = GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext3");
				uint blockID4 = GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext4");
				uint blockID5 = GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext5");
				uint blockID6 = GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext6");
				uint blockID7 = GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext7");
				uint blockID8 = GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext8");
				uint blockID9 = GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext9");
				uint blockID10 = GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext10");
				uint blockID11 = GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext11");
				uint blockID12 = GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext12");
				uint blockID13 = GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext13");
				uint blockID14 = GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext14");
				uint blockID15 = GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext15");
				uint blockID16 = GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext16");
				uint blockID17 = GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext17");
				uint blockID18 = GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext18");
				uint blockID19 = GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext19");
				uint blockID20 = GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext20");
				uint blockID21 = GameDataBlockBase<TextDataBlock>.GetBlockID("zombtext21");
				CommunicationNode val = new CommunicationNode(blockID, (ScriptType)0, (List<CommunicationNode>)null, (Sprite)null);
				val.IsLastNode = false;
				val.m_ChildNodes.Add(new CommunicationNode(blockID2, (ScriptType)0, (List<CommunicationNode>)null, (Sprite)null));
				val.m_ChildNodes.Add(new CommunicationNode(blockID3, (ScriptType)0, (List<CommunicationNode>)null, (Sprite)null));
				val.m_ChildNodes.Add(new CommunicationNode(blockID4, (ScriptType)0, (List<CommunicationNode>)null, (Sprite)null));
				val.m_ChildNodes.Add(new CommunicationNode(blockID5, (ScriptType)0, (List<CommunicationNode>)null, (Sprite)null));
				val.m_ChildNodes[0].DialogID = 314u;
				val.m_ChildNodes[1].DialogID = 314u;
				val.m_ChildNodes[2].DialogID = 314u;
				val.m_ChildNodes[3].DialogID = 314u;
				CommunicationNode val2 = new CommunicationNode(blockID6, (ScriptType)0, (List<CommunicationNode>)null, (Sprite)null);
				val2.IsLastNode = false;
				val2.m_ChildNodes.Add(new CommunicationNode(blockID10, (ScriptType)0, (List<CommunicationNode>)null, (Sprite)null));
				val2.m_ChildNodes.Add(new CommunicationNode(blockID11, (ScriptType)0, (List<CommunicationNode>)null, (Sprite)null));
				val2.m_ChildNodes.Add(new CommunicationNode(blockID12, (ScriptType)0, (List<CommunicationNode>)null, (Sprite)null));
				val2.m_ChildNodes[0].DialogID = 314u;
				val2.m_ChildNodes[1].DialogID = 314u;
				val2.m_ChildNodes[2].DialogID = 314u;
				CommunicationNode val3 = new CommunicationNode(blockID7, (ScriptType)0, (List<CommunicationNode>)null, (Sprite)null);
				val3.IsLastNode = false;
				val3.m_ChildNodes.Add(new CommunicationNode(blockID13, (ScriptType)0, (List<CommunicationNode>)null, (Sprite)null));
				val3.m_ChildNodes.Add(new CommunicationNode(blockID14, (ScriptType)0, (List<CommunicationNode>)null, (Sprite)null));
				val3.m_ChildNodes.Add(new CommunicationNode(blockID15, (ScriptType)0, (List<CommunicationNode>)null, (Sprite)null));
				val3.m_ChildNodes[0].DialogID = 314u;
				val3.m_ChildNodes[1].DialogID = 314u;
				val3.m_ChildNodes[2].DialogID = 314u;
				CommunicationNode val4 = new CommunicationNode(blockID8, (ScriptType)0, (List<CommunicationNode>)null, (Sprite)null);
				val4.IsLastNode = false;
				val4.m_ChildNodes.Add(new CommunicationNode(blockID16, (ScriptType)0, (List<CommunicationNode>)null, (Sprite)null));
				val4.m_ChildNodes.Add(new CommunicationNode(blockID17, (ScriptType)0, (List<CommunicationNode>)null, (Sprite)null));
				val4.m_ChildNodes.Add(new CommunicationNode(blockID18, (ScriptType)0, (List<CommunicationNode>)null, (Sprite)null));
				val4.m_ChildNodes[0].DialogID = 314u;
				val4.m_ChildNodes[1].DialogID = 314u;
				val4.m_ChildNodes[2].DialogID = 314u;
				CommunicationNode val5 = new CommunicationNode(blockID9, (ScriptType)0, (List<CommunicationNode>)null, (Sprite)null);
				val5.IsLastNode = false;
				val5.m_ChildNodes.Add(new CommunicationNode(blockID19, (ScriptType)0, (List<CommunicationNode>)null, (Sprite)null));
				val5.m_ChildNodes.Add(new CommunicationNode(blockID20, (ScriptType)0, (List<CommunicationNode>)null, (Sprite)null));
				val5.m_ChildNodes.Add(new CommunicationNode(blockID21, (ScriptType)0, (List<CommunicationNode>)null, (Sprite)null));
				val5.m_ChildNodes[0].DialogID = 314u;
				val5.m_ChildNodes[1].DialogID = 314u;
				val5.m_ChildNodes[2].DialogID = 314u;
				val.m_ChildNodes.Add(val2);
				val.m_ChildNodes.Add(val3);
				val.m_ChildNodes.Add(val4);
				val.m_ChildNodes.Add(val5);
				_menu.m_menu.CurrentNode.ChildNodes[5].m_ChildNodes.Add(val);
			}

			public static void RebuildZombifiedMenu()
			{
				int num = 0;
				_ = bot1menu;
				for (int i = 0; i < _menu.m_menu.CurrentNode.ChildNodes[5].m_ChildNodes.Count; i++)
				{
					if (GameDataBlockBase<TextDataBlock>.GetBlock(_menu.m_menu.CurrentNode.ChildNodes[5].m_ChildNodes[i].TextId).English == "Zombified Initiative")
					{
						num = i;
					}
				}
				for (int j = 0; j < _menu.m_menu.CurrentNode.ChildNodes[5].m_ChildNodes[num].m_ChildNodes.Count; j++)
				{
					_menu.m_menu.CurrentNode.ChildNodes[5].m_ChildNodes[num].m_ChildNodes[j].IsLastNode = true;
					if (BotTable.ContainsKey(GameDataBlockBase<TextDataBlock>.GetBlock(_menu.m_menu.CurrentNode.ChildNodes[5].m_ChildNodes[num].m_ChildNodes[j].TextId).English))
					{
						_menu.m_menu.CurrentNode.ChildNodes[5].m_ChildNodes[num].m_ChildNodes[j].IsLastNode = false;
					}
				}
			}

			public void PreventManualActions()
			{
				List<PlayerBotActionBase> list = new List<PlayerBotActionBase>();
				float num = _manualActionsHaste - 0.01f;
				foreach (KeyValuePair<string, PlayerAIBot> item in BotTable)
				{
					Enumerator<PlayerBotActionBase> enumerator2 = item.Value.Actions.GetEnumerator();
					while (enumerator2.MoveNext())
					{
						PlayerBotActionBase current2 = enumerator2.Current;
						if (((MemberInfo)((Object)current2).GetIl2CppType()).Name == "PlayerBotActionAttack" && ((Il2CppObjectBase)current2.DescBase).Cast<Descriptor>().Haste > num)
						{
							list.Add(current2);
						}
						else if (((MemberInfo)((Object)current2).GetIl2CppType()).Name == "PlayerBotActionCollectItem" && ((Il2CppObjectBase)current2.DescBase).Cast<Descriptor>().Haste > num)
						{
							list.Add(current2);
						}
						else if (((MemberInfo)((Object)current2).GetIl2CppType()).Name == "PlayerBotActionShareResourcePack" && ((Il2CppObjectBase)current2.DescBase).Cast<Descriptor>().Haste > num)
						{
							list.Add(current2);
						}
					}
					foreach (PlayerBotActionBase item2 in list)
					{
						item.Value.StopAction(item2.DescBase);
						Print(item.Value.Agent.PlayerName + "'s manual actions were cancelled");
					}
					list.Clear();
				}
				_preventManual = false;
			}

			private void PreventAutoResourcePickups()
			{
				List<PlayerBotActionBase> list = new List<PlayerBotActionBase>();
				_ = _manualActionsHaste;
				foreach (KeyValuePair<string, PlayerAIBot> item in BotTable)
				{
					Enumerator<PlayerBotActionBase> enumerator2 = item.Value.Actions.GetEnumerator();
					while (enumerator2.MoveNext())
					{
						PlayerBotActionBase current2 = enumerator2.Current;
						if (((MemberInfo)((Object)current2).GetIl2CppType()).Name == "PlayerBotActionCollectItem")
						{
							Descriptor obj = ((Il2CppObjectBase)current2.DescBase).Cast<Descriptor>();
							bool flag = obj.TargetItem.PublicName == "Disinfect Pack";
							bool flag2 = obj.TargetItem.PublicName == "MediPack";
							bool flag3 = obj.TargetItem.PublicName == "Ammo Pack";
							bool flag4 = obj.TargetItem.PublicName == "Tool Refill Pack" || flag3 || flag2 || flag;
							if (obj.Haste < _manualActionsHaste && flag4)
							{
								list.Add(current2);
							}
						}
					}
					foreach (PlayerBotActionBase item2 in list)
					{
						item.Value.StopAction(item2.DescBase);
					}
					list.Clear();
				}
			}

			private void PreventAutoResourceUses()
			{
				List<PlayerBotActionBase> list = new List<PlayerBotActionBase>();
				_ = _manualActionsHaste;
				foreach (KeyValuePair<string, PlayerAIBot> item in BotTable)
				{
					Enumerator<PlayerBotActionBase> enumerator2 = item.Value.Actions.GetEnumerator();
					while (enumerator2.MoveNext())
					{
						PlayerBotActionBase current2 = enumerator2.Current;
						if (((MemberInfo)((Object)current2).GetIl2CppType()).Name == "PlayerBotActionShareResourcePack" && ((Il2CppObjectBase)current2.DescBase).Cast<Descriptor>().Haste < _manualActionsHaste)
						{
							list.Add(current2);
						}
					}
					foreach (PlayerBotActionBase item2 in list)
					{
						item.Value.StopAction(item2.DescBase);
					}
					list.Clear();
				}
			}

			public static EnemyAgent GetMonsterUnderPlayerAim()
			{
				return GetComponentUnderPlayerAim((EnemyAgent enemy) => "Found monster: " + ((GameDataBlockBase<EnemyDataBlock>)(object)enemy.EnemyData).name, raycastAll: false);
			}

			public static void SendBotToKillEnemy(string chosenBot, Agent enemy, StanceEnum stance, AttackMeansEnum means, PostureEnum posture)
			{
				//IL_0018: Unknown result type (might be due to invalid IL or missing references)
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				//IL_0025: Unknown result type (might be due to invalid IL or missing references)
				//IL_002b: Unknown result type (might be due to invalid IL or missing references)
				//IL_002c: 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)
				//IL_003a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0045: Unknown result type (might be due to invalid IL or missing references)
				//IL_006a: Expected O, but got Unknown
				PlayerAIBot val = BotTable[chosenBot];
				if (!((Object)(object)val == (Object)null))
				{
					ExecuteBotAction(val, (Descriptor)new Descriptor(val)
					{
						Stance = stance,
						Means = means,
						Posture = posture,
						TargetAgent = enemy,
						Prio = _manualActionsPriority,
						Haste = _manualActionsHaste
					}, "Added kill enemy action to " + val.Agent.PlayerName);
				}
			}

			public static ItemInLevel GetItemUnderPlayerAim()
			{
				return GetComponentUnderPlayerAim((ItemInLevel item) => "Found item: " + ((Item)item).PublicName);
			}

			public static void SendBotToPickupItem(string chosenBot, ItemInLevel item)
			{
				//IL_0018: Unknown result type (might be due to invalid IL or missing references)
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Unknown result type (might be due to invalid IL or missing references)
				//IL_0037: Unknown result type (might be due to invalid IL or missing references)
				//IL_0041: Unknown result type (might be due to invalid IL or missing references)
				//IL_004c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: Expected O, but got Unknown
				PlayerAIBot val = BotTable[chosenBot];
				if (!((Object)(object)val == (Object)null))
				{
					ExecuteBotAction(val, (Descriptor)new Descriptor(val)
					{
						TargetItem = (Item)(object)item,
						TargetContainer = item.container,
						TargetPosition = ((Component)item).transform.position,
						Prio = _manualActionsPriority,
						Haste = _manualActionsHaste
					}, "Added collect item action to " + val.Agent.PlayerName);
				}
			}

			public static PlayerAgent GetHumanUnderPlayerAim()
			{
				PlayerAIBot componentUnderPlayerAim = GetComponentUnderPlayerAim((PlayerAIBot bot) => "Found bot: " + bot.Agent.PlayerName);
				if ((Object)(object)componentUnderPlayerAim != (Object)null)
				{
					return componentUnderPlayerAim.Agent;
				}
				PlayerAgent componentUnderPlayerAim2 = GetComponentUnderPlayerAim((PlayerAgent player) => "Found other player: " + player.PlayerName);
				if ((Object)(object)componentUnderPlayerAim2 != (Object)null)
				{
					return componentUnderPlayerAim2;
				}
				PlayerAgent localPlayerAgent = PlayerManager.GetLocalPlayerAgent();
				Print("Found local player: " + localPlayerAgent.PlayerName);
				return localPlayerAgent;
			}

			public static void SendBotToShareResourcePack(string chosenBot, PlayerAgent human)
			{
				//IL_0054: Unknown result type (might be due to invalid IL or missing references)
				//IL_0059: Unknown result type (might be due to invalid IL or missing references)
				//IL_0060: Unknown result type (might be due to invalid IL or missing references)
				//IL_0067: Unknown result type (might be due to invalid IL or missing references)
				//IL_0072: Unknown result type (might be due to invalid IL or missing references)
				//IL_0097: Expected O, but got Unknown
				PlayerAIBot val = BotTable[chosenBot];
				if (!((Object)(object)val == (Object)null))
				{
					BackpackItem val2 = null;
					if (val.Backpack.HasBackpackItem((InventorySlot)4) && val.Backpack.TryGetBackpackItem((InventorySlot)4, ref val2))
					{
						ItemEquippable val3 = ((Il2CppObjectBase)val2.Instance).Cast<ItemEquippable>();
						val.Inventory.DoEquipItem(val3);
						ExecuteBotAction(val, (Descriptor)new Descriptor(val)
						{
							Receiver = human,
							Item = val3,
							Prio = _manualActionsPriority,
							Haste = _manualActionsHaste
						}, "Added share resource action to " + val.Agent.PlayerName);
					}
				}
			}

			public static void ExecuteBotAction(PlayerAIBot bot, Descriptor descriptor, string message)
			{
				bot.StartAction(descriptor);
				Print(message);
			}

			public static T GetComponentUnderPlayerAim<T>(Func<T, string> message, bool raycastAll = true) where T : class
			{
				//IL_0063: Unknown result type (might be due to invalid IL or missing references)
				//IL_0068: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: 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)
				if (raycastAll)
				{
					foreach (RaycastHit item in (Il2CppArrayBase<RaycastHit>)(object)RaycastHits())
					{
						RaycastHit current = item;
						T componentInParent = ((Component)((RaycastHit)(ref current)).collider).GetComponentInParent<T>();
						if (componentInParent != null)
						{
							Print(message(componentInParent));
							return componentInParent;
						}
					}
				}
				else
				{
					RaycastHit? val = RaycastHit();
					if (val.HasValue)
					{
						RaycastHit value = val.Value;
						T componentInParent2 = ((Component)((RaycastHit)(ref value)).collider).GetComponentInParent<T>();
						if (componentInParent2 == null)
						{
							return null;
						}
						Print(message(componentInParent2));
						return componentInParent2;
					}
				}
				return null;
			}

			public static RaycastHit? RaycastHit()
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				//IL_000a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0018: Unknown result type (might be due to invalid IL or missing references)
				RaycastHit value = default(RaycastHit);
				if (Physics.Raycast(Camera.current.ScreenPointToRay(Input.mousePosition), ref value))
				{
					return value;
				}
				return null;
			}

			public static Il2CppStructArray<RaycastHit> RaycastHits()
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				//IL_000a: Unknown result type (might be due to invalid IL or missing references)
				return Physics.RaycastAll(Camera.current.ScreenPointToRay(Input.mousePosition));
			}

			public static void SwitchDebug()
			{
				_debug = !_debug;
				Print("Debug log " + (_debug ? "enabled" : "disabled"), forced: true);
			}

			public static void Print(string text, bool forced = false)
			{
				if (_debug || forced)
				{
					Log.LogInfo((object)text);
				}
			}
		}

		[HarmonyPatch]
		public class ZombifiedPatches
		{
			[HarmonyPrefix]
			[HarmonyPatch(typeof(CommunicationMenu), "PlayConfirmSound")]
			public static void PlayConfirmSound(CommunicationMenu __instance)
			{
				CommunicationNode currentNode = Initiative._menu.m_menu.CurrentNode;
				if (!currentNode.IsLastNode)
				{
					return;
				}
				string english = GameDataBlockBase<TextDataBlock>.GetBlock(currentNode.TextId).English;
				Initiative.Log.LogDebug((object)("teksti on " + english));
				string text = english.Split(new char[1] { ' ' })[0].Trim();
				string text2 = english.Substring(text.Length).Trim();
				Initiative.Log.LogDebug((object)("teksti on " + english + ", who on " + text + " ja wha on " + text2));
				if (text2 == "attack my target")
				{
					EnemyAgent monsterUnderPlayerAim = Initiative.GetMonsterUnderPlayerAim();
					if ((Object)(object)monsterUnderPlayerAim != (Object)null)
					{
						if (text == "AllBots")
						{
							Initiative.Log.LogInfo((object)"all bots attack");
							foreach (KeyValuePair<string, PlayerAIBot> item in Initiative.BotTable)
							{
								Initiative.SendBotToKillEnemy(item.Key, (Agent)(object)monsterUnderPlayerAim, (StanceEnum)3, (AttackMeansEnum)31, (PostureEnum)1);
							}
						}
						else
						{
							Initiative.Log.LogInfo((object)("bot" + text + " attack"));
							Initiative.SendBotToKillEnemy(text, (Agent)(object)monsterUnderPlayerAim, (StanceEnum)3, (AttackMeansEnum)31, (PostureEnum)1);
						}
					}
				}
				if (text2 == "toggle resource pickups")
				{
					Initiative.Log.LogInfo((object)"toggle resource pickups");
					Initiative._preventAutoPickups = !Initiative._preventAutoPickups;
				}
				if (text2 == "toggle resource auto use")
				{
					Initiative.Log.LogInfo((object)"toggle resource auto use");
					Initiative._preventAutoUses = !Initiative._preventAutoUses;
				}
				if (text2 == "clear command queue")
				{
					Initiative.Log.LogInfo((object)"clear command queue");
					Initiative._preventManual = true;
				}
				if (text2 == "pickup resource under my aim")
				{
					Initiative.Log.LogInfo((object)("bot " + text + " pickup resource"));
					ItemInLevel itemUnderPlayerAim = Initiative.GetItemUnderPlayerAim();
					if ((Object)(object)itemUnderPlayerAim != (Object)null)
					{
						Initiative.SendBotToPickupItem(text, itemUnderPlayerAim);
					}
				}
				if (text2 == "supply resource (aimed or me)")
				{
					Initiative.Log.LogInfo((object)("bot " + text + " share resource"));
					Initiative.SendBotToShareResourcePack(text, Initiative.GetHumanUnderPlayerAim());
				}
			}
		}

		public override void Load()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			new Harmony("Initiative").PatchAll();
			Initiative @object = ((BasePlugin)this).AddComponent<Initiative>();
			EventAPI.OnManagersSetup += Initiative.AddZombifiedText;
			EventAPI.OnExpeditionStarted += @object.FindMenu;
			EventAPI.OnExpeditionStarted += @object.Initialize;
			Initiative.Log = ((BasePlugin)this).Log;
		}
	}
}