Decompiled source of HostToolkit v1.2.4

HostToolkit.dll

Decompiled 22 minutes ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using ExitGames.Client.Photon;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Photon.Pun;
using Photon.Realtime;
using Platforms;
using Steamworks;
using Steamworks.Data;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.InputSystem;
using UnityEngine.Networking;
using UnityEngine.Rendering;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Yanyan_mod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyCopyright("© 2026 Yanyan_mod. All rights reserved.")]
[assembly: AssemblyDescription("仅房主管理房间使用,客户端无效。Host only: for the room host to manage the room. It has no effect on clients.")]
[assembly: AssemblyFileVersion("1.2.4.0")]
[assembly: AssemblyInformationalVersion("1.2.4")]
[assembly: AssemblyProduct("HostToolkit - 仅房主管理房间使用,客户端无效 / Host only, no effect on clients")]
[assembly: AssemblyTitle("HostToolkit (仅房主管理房间使用,客户端无效 / Host-only room management, no effect on clients)")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.2.4.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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 HostToolkit
{
	internal static class Act
	{
		public const byte EvReq = 148;

		internal static Player ReplyTo;

		public const byte EvFun = 151;

		private static bool Local => !Net.Multiplayer || PhotonNetwork.IsMasterClient;

		private static void Send(string op, params object[] a)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			if (Net.InRoom && PhotonNetwork.MasterClient != null)
			{
				object[] obj = new object[2] { op, a };
				RaiseEventOptions val = new RaiseEventOptions();
				val.TargetActors = new int[1] { PhotonNetwork.MasterClient.ActorNumber };
				PhotonNetwork.RaiseEvent((byte)148, (object)obj, val, SendOptions.SendReliable);
			}
		}

		public static bool CanTarget(PlayerAvatar p)
		{
			if (!Object.op_Implicit((Object)(object)p))
			{
				return false;
			}
			if (!Net.Multiplayer || p.isLocal)
			{
				return true;
			}
			return Net.CanTarget(Net.MySid, Net.SidOf(p));
		}

		public static bool CanTargetSid(string sid)
		{
			return !Net.Multiplayer || Net.CanTarget(Net.MySid, sid);
		}

		public static void Teleport(PlayerAvatar p, Vector3 pos)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if (CanTarget(p))
			{
				if (!Local && p.isLocal)
				{
					Admin.TeleportSelf(pos);
					return;
				}
				if (Local)
				{
					Admin.Teleport(p, pos);
					return;
				}
				Send("tp", Net.SidOf(p), pos);
			}
		}

		public static void Kill(PlayerAvatar p)
		{
			Player1("kill", p, Admin.Kill);
		}

		public static bool CanAid(PlayerAvatar p)
		{
			if (!Object.op_Implicit((Object)(object)p))
			{
				return false;
			}
			if (!Net.Multiplayer || p.isLocal)
			{
				return true;
			}
			return Net.CanRevive(Net.MySid, Net.SidOf(p));
		}

		public static void Revive(PlayerAvatar p)
		{
			Aid1("revive", p, Admin.Revive);
		}

		public static void Heal(PlayerAvatar p)
		{
			Aid1("heal", p, Admin.HealFull);
		}

		private static void Aid1(string op, PlayerAvatar p, Action<PlayerAvatar> fn)
		{
			if (CanAid(p))
			{
				if (Local)
				{
					fn(p);
					return;
				}
				Send(op, Net.SidOf(p));
			}
		}

		private static void Player1(string op, PlayerAvatar p, Action<PlayerAvatar> fn)
		{
			if (CanTarget(p))
			{
				if (Local)
				{
					fn(p);
					return;
				}
				Send(op, Net.SidOf(p));
			}
		}

		public static void SetFlag(int set, PlayerAvatar p, bool on)
		{
			if (CanTarget(p))
			{
				if (Local)
				{
					Admin.SetFlag(Admin.SetAt(set), p, on);
					return;
				}
				Send("flag", set, Net.SidOf(p), on);
			}
		}

		public static void Screamer(PlayerAvatar p, bool on)
		{
			if (!CanTarget(p))
			{
				return;
			}
			if (Local)
			{
				if (on)
				{
					Admin.ScreamerOn(p);
				}
				else
				{
					Admin.ScreamerOff(p);
				}
			}
			else
			{
				Send("scream", Net.SidOf(p), on);
			}
		}

		public static void FireWeapon(int kind, Vector3 origin, Vector3 dir)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: 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_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)
			if (Local)
			{
				Fire.FireAt(kind, origin, dir, Admin.Me);
				return;
			}
			Fire.FireAt(kind, origin, dir, Admin.Me, visualOnly: true);
			Send("fire", kind, origin, dir);
		}

		public static void Kick(PlayerAvatar p)
		{
			Player val = Net.PlayerOf(p);
			if (val != null && !val.IsLocal && CanTarget(p))
			{
				if (Local)
				{
					Net.Kick(val);
				}
				else
				{
					Send("kick", Net.SidOf(p));
				}
				Ui.Toast(L.F("已踢出 {0}", p.playerName));
			}
		}

		public static void Ban(string sid, string name)
		{
			if (!string.IsNullOrEmpty(sid) && CanTargetSid(sid) && !(sid == Net.MySid))
			{
				if (Local)
				{
					Net.BanAny(sid, name);
					return;
				}
				Send("ban", sid, name ?? "?");
				Ui.Toast(L.F("已永久封禁 {0}", name));
			}
		}

		public static void Global(int bit, bool on)
		{
			switch (bit)
			{
			case 1:
				Self.ZeroG = on;
				break;
			case 2:
				Self.InfEnergy = on;
				break;
			}
			if (Local)
			{
				Sync.SetFlag(bit, on);
				return;
			}
			Send("g", bit, on);
		}

		public static void TruckLock(bool on)
		{
			if (Local)
			{
				Net.SetTruckLocked(on);
			}
			else
			{
				Send("truck", on);
			}
			Ui.Toast(on ? L.T("卡车已锁定") : L.T("卡车已解锁"));
		}

		public static void RoomOpen(bool open)
		{
			if (Local)
			{
				Ui.SetRoomOpen(open);
				return;
			}
			Send("room", open);
		}

		public static void NextLevel()
		{
			if (Local)
			{
				if (Object.op_Implicit((Object)(object)RunManager.instance))
				{
					RunManager.instance.ChangeLevel(true, false, (ChangeLevelType)0);
				}
			}
			else
			{
				Send("next");
			}
		}

		public static void GotoLevel(string levelName, int number)
		{
			if (Local)
			{
				ToastResult(Lvl.GoByName(levelName, number));
				return;
			}
			Send("lvl", levelName, number);
		}

		public static void ReloadLevel(int number)
		{
			if (Local)
			{
				ToastResult(Lvl.Reload(number));
				return;
			}
			Send("lvlre", number);
		}

		private static void ToastResult(string err)
		{
			if (!string.IsNullOrEmpty(err))
			{
				Ui.Toast(err);
			}
		}

		public static void KillAllEnemies()
		{
			if (Local)
			{
				Ui.Toast(L.F("秒杀了 {0} 只怪", Admin.KillAllEnemies()));
			}
			else
			{
				Send("killall");
			}
		}

		public static void ReviveEnemies()
		{
			if (Local)
			{
				Ui.Toast(L.F("复活了 {0} 只怪", Admin.ReviveEnemies()));
			}
			else
			{
				Send("reviveall");
			}
		}

		public static void ActivateExtraction(ExtractionPoint ep)
		{
			if (!Admin.CanActivateExtraction(ep))
			{
				Ui.Toast(L.T("现在不能激活这个提交点(同一时间只能激活一个)"));
			}
			else
			{
				ep.OnClick();
			}
		}

		public static void SpawnEnemy(EnemySetup s, Vector3 pos)
		{
			//IL_003d: 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)
			if (Object.op_Implicit((Object)(object)s))
			{
				if (Local)
				{
					Admin.SpawnEnemy(s, pos);
					return;
				}
				Send("spawnE", ((Object)s).name, pos);
			}
		}

		public static void SpawnValuable(PrefabRef r, Vector3 pos)
		{
			//IL_0038: 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)
			if (r != null)
			{
				if (Local)
				{
					Admin.SpawnValuable(r, pos);
					return;
				}
				Send("spawnV", ((PrefabRef<GameObject>)(object)r).ResourcePath, pos);
			}
		}

		public static void SpawnItem(Item it, Vector3 pos)
		{
			//IL_003d: 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)
			if (Object.op_Implicit((Object)(object)it))
			{
				if (Local)
				{
					Admin.SpawnItem(it, pos);
					return;
				}
				Send("spawnI", ((Object)it).name, pos);
			}
		}

		public static void SpawnToken(int rarity, Vector3 pos)
		{
			//IL_002d: 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)
			if (Local)
			{
				Admin.SpawnTokenBox(rarity, pos);
				return;
			}
			Send("spawnT", rarity, pos);
		}

		public static void Upgrade(string shortName, int amount)
		{
			if (!string.IsNullOrEmpty(shortName) && amount != 0)
			{
				if (Local)
				{
					Admin.ApplyUpgrade(Net.MySid, shortName, amount);
					return;
				}
				Send("upg", Net.MySid, shortName, amount);
			}
		}

		public static void SetMoney(int amount)
		{
			if (Local)
			{
				Admin.SetMoney(amount);
				return;
			}
			Send("money", amount);
		}

		private static int ViewOf(PhysGrabObject p)
		{
			return (Object.op_Implicit((Object)(object)p) && Object.op_Implicit((Object)(object)p.photonView)) ? p.photonView.ViewID : 0;
		}

		private static int ViewOf(EnemyParent ep)
		{
			return (Object.op_Implicit((Object)(object)ep) && Object.op_Implicit((Object)(object)ep.Enemy) && Object.op_Implicit((Object)(object)ep.Enemy.PhotonView)) ? ep.Enemy.PhotonView.ViewID : 0;
		}

		public static void MoveObject(PhysGrabObject p, Vector3 pos)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			if (Local)
			{
				Admin.MoveObject(p, pos);
			}
			else if (ViewOf(p) != 0)
			{
				Send("omove", ViewOf(p), pos);
			}
		}

		public static void DestroyObject(PhysGrabObject p)
		{
			if (Local)
			{
				Admin.DestroyObject(p);
			}
			else if (ViewOf(p) != 0)
			{
				Send("odestroy", ViewOf(p));
			}
		}

		public static void MoveEnemy(EnemyParent ep, Vector3 pos)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			Enemy1("emove", ep, pos);
		}

		public static void KillEnemy(EnemyParent ep)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			Enemy1("ekill", ep, Vector3.zero);
		}

		public static void RemoveEnemy(EnemyParent ep)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			Enemy1("eremove", ep, Vector3.zero);
		}

		private static void Enemy1(string op, EnemyParent ep, Vector3 pos)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)ep))
			{
				if (Local)
				{
					RunEnemy(op, ep, pos);
				}
				else if (ViewOf(ep) != 0)
				{
					Send(op, ViewOf(ep), pos);
				}
			}
		}

		private static void RunEnemy(string op, EnemyParent ep, Vector3 pos)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			switch (op)
			{
			case "emove":
				Admin.MoveEnemy(ep, pos);
				break;
			case "ekill":
				Admin.KillEnemy(ep);
				break;
			case "eremove":
				Admin.RemoveEnemy(ep);
				break;
			}
		}

		internal static void SendFun(int flags, Vector3 o, Vector3 d, int edges, float rr, float vr, int gk, string pullKey, string meleeName, string throwName, Vector3 myPos, Vector3 myVel, bool reliable)
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Expected O, but got Unknown
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			if (!Net.InRoom || PhotonNetwork.MasterClient == null)
			{
				return;
			}
			object[] obj = new object[12]
			{
				flags,
				o,
				d,
				edges,
				rr,
				vr,
				gk,
				pullKey ?? "",
				meleeName ?? "",
				throwName ?? "",
				myPos,
				myVel
			};
			RaiseEventOptions val = new RaiseEventOptions();
			val.TargetActors = new int[1] { PhotonNetwork.MasterClient.ActorNumber };
			PhotonNetwork.RaiseEvent((byte)151, (object)obj, val, (edges != 0 || reliable) ? SendOptions.SendReliable : SendOptions.SendUnreliable);
			try
			{
				PhotonNetwork.SendAllOutgoingCommands();
			}
			catch
			{
			}
		}

		internal static void OnFunEvent(EventData ev)
		{
			if (!Net.InRoom || !PhotonNetwork.IsMasterClient)
			{
				return;
			}
			Player player = PhotonNetwork.CurrentRoom.GetPlayer(ev.Sender, false);
			if (player != null && !player.IsLocal)
			{
				string text = Net.SidOf(player);
				PlayerAvatar val = Net.AvatarOf(player);
				if (string.IsNullOrEmpty(text) && Object.op_Implicit((Object)(object)val))
				{
					text = val.steamID;
				}
				if (!string.IsNullOrEmpty(text) && (!Object.op_Implicit((Object)(object)val) || string.IsNullOrEmpty(val.steamID) || !(val.steamID != text)) && Net.RoleOf(text) >= Role.CoOwner && ev.CustomData is object[] a)
				{
					Fun.OnRemote(text, a);
				}
			}
		}

		public static void OnEvent(EventData ev)
		{
			if (ev.Code != 148 || !Net.InRoom || !PhotonNetwork.IsMasterClient)
			{
				return;
			}
			Player player = PhotonNetwork.CurrentRoom.GetPlayer(ev.Sender, false);
			if (player == null || player.IsLocal)
			{
				return;
			}
			string text = Net.SidOf(player);
			PlayerAvatar val = Net.AvatarOf(player);
			if (string.IsNullOrEmpty(text) || (Object.op_Implicit((Object)(object)val) && !string.IsNullOrEmpty(val.steamID) && val.steamID != text) || Net.RoleOf(text) < Role.CoOwner || !(ev.CustomData is object[] array) || array.Length < 2 || array.Length > 4 || !(array[0] is string { Length: <=16 } text2))
			{
				return;
			}
			object[] array2 = (array[1] as object[]) ?? new object[0];
			if (array2.Length > 8)
			{
				return;
			}
			ReplyTo = player;
			try
			{
				Exec(text, text2, array2);
			}
			catch (Exception ex)
			{
				Plugin.Log.LogWarning((object)("[HostToolkit] 执行请求 " + text2 + " 出错: " + ex.Message));
			}
			finally
			{
				ReplyTo = null;
			}
		}

		private static string S(object[] a, int i)
		{
			return (i < a.Length) ? (a[i] as string) : null;
		}

		private static bool B(object[] a, int i)
		{
			bool flag = default(bool);
			int num;
			if (i < a.Length)
			{
				object obj = a[i];
				if (obj is bool)
				{
					flag = (bool)obj;
					num = 1;
				}
				else
				{
					num = 0;
				}
			}
			else
			{
				num = 0;
			}
			return (byte)((uint)num & (flag ? 1u : 0u)) != 0;
		}

		private static int I(object[] a, int i)
		{
			return (i < a.Length && a[i] is int num) ? num : 0;
		}

		private static Vector3 V(object[] a, int i)
		{
			//IL_0014: 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_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: 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_009e: 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_007d: Unknown result type (might be due to invalid IL or missing references)
			if (i < a.Length)
			{
				object obj = a[i];
				Vector3 val = default(Vector3);
				int num;
				if (obj is Vector3)
				{
					val = (Vector3)obj;
					num = 1;
				}
				else
				{
					num = 0;
				}
				if (num != 0)
				{
					return (float.IsNaN(val.x) || float.IsNaN(val.y) || float.IsNaN(val.z) || Mathf.Abs(val.x) > 10000f || Mathf.Abs(val.y) > 10000f || Mathf.Abs(val.z) > 10000f) ? Vector3.zero : val;
				}
			}
			return Vector3.zero;
		}

		private static PlayerAvatar Target(string actor, string sid)
		{
			if (string.IsNullOrEmpty(sid) || !Net.CanTarget(actor, sid))
			{
				return null;
			}
			return ((IEnumerable<PlayerAvatar>)Admin.Players()).FirstOrDefault((Func<PlayerAvatar, bool>)((PlayerAvatar p) => Net.SidOf(p) == sid));
		}

		private static PlayerAvatar TargetAid(string actor, string sid)
		{
			if (string.IsNullOrEmpty(sid) || !Net.CanRevive(actor, sid))
			{
				return null;
			}
			return ((IEnumerable<PlayerAvatar>)Admin.Players()).FirstOrDefault((Func<PlayerAvatar, bool>)((PlayerAvatar p) => Net.SidOf(p) == sid));
		}

		private static void Exec(string actor, string op, object[] a)
		{
			//IL_0915: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa8: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05af: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0871: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a21: Unknown result type (might be due to invalid IL or missing references)
			switch (op)
			{
			case "tp":
			{
				PlayerAvatar a2;
				if (Object.op_Implicit((Object)(object)(a2 = Target(actor, S(a, 0)))))
				{
					Admin.Teleport(a2, V(a, 1));
				}
				break;
			}
			case "kill":
			{
				PlayerAvatar a2;
				if (Object.op_Implicit((Object)(object)(a2 = Target(actor, S(a, 0)))))
				{
					Admin.Kill(a2);
				}
				break;
			}
			case "revive":
			{
				PlayerAvatar a2;
				if (Object.op_Implicit((Object)(object)(a2 = TargetAid(actor, S(a, 0)))))
				{
					Admin.Revive(a2);
					Watchdog.QueueHeal(S(a, 0));
				}
				break;
			}
			case "heal":
			{
				PlayerAvatar a2;
				if (Object.op_Implicit((Object)(object)(a2 = TargetAid(actor, S(a, 0)))))
				{
					Admin.HealFull(a2);
				}
				break;
			}
			case "fire":
				if (Fire.AllowFrom(actor))
				{
					PlayerAvatar shooter = ((IEnumerable<PlayerAvatar>)Admin.Players()).FirstOrDefault((Func<PlayerAvatar, bool>)((PlayerAvatar p) => Net.SidOf(p) == actor));
					Fire.FireAt(I(a, 0), V(a, 1), V(a, 2), shooter);
				}
				break;
			case "flag":
			{
				int num = I(a, 0);
				PlayerAvatar a2;
				if (num >= 0 && num < 12 && num != 7 && Object.op_Implicit((Object)(object)(a2 = Target(actor, S(a, 1)))))
				{
					Admin.SetFlag(Admin.SetAt(num), a2, B(a, 2), actor);
				}
				break;
			}
			case "scream":
			{
				PlayerAvatar a2;
				if (Object.op_Implicit((Object)(object)(a2 = Target(actor, S(a, 0)))))
				{
					if (B(a, 1))
					{
						Admin.ScreamerOn(a2);
					}
					else
					{
						Admin.ScreamerOff(a2);
					}
				}
				break;
			}
			case "kick":
			{
				string text4 = S(a, 0);
				if (text4 != actor && Net.CanTarget(actor, text4))
				{
					Net.Kick(Net.PlayerBySid(text4));
				}
				break;
			}
			case "ban":
			{
				string text3 = S(a, 0);
				if (text3 != actor && Net.CanTarget(actor, text3))
				{
					Net.BanAny(text3, S(a, 1));
				}
				break;
			}
			case "g":
				Sync.SetFlag(I(a, 0), B(a, 1));
				break;
			case "truck":
				Net.SetTruckLocked(B(a, 0));
				break;
			case "room":
				Ui.SetRoomOpen(B(a, 0));
				break;
			case "next":
				if (Net.TruckLocked)
				{
					Ui.Toast(L.T("先关掉「锁定卡车」再强制发车"));
				}
				else if (Object.op_Implicit((Object)(object)RunManager.instance))
				{
					RunManager.instance.ChangeLevel(true, false, (ChangeLevelType)0);
				}
				break;
			case "lvl":
				ToastResult(Lvl.GoByName(S(a, 0), I(a, 1)));
				break;
			case "lvlre":
				ToastResult(Lvl.Reload(I(a, 0)));
				break;
			case "killall":
				Ui.Toast(L.F("秒杀了 {0} 只怪", Admin.KillAllEnemies()));
				break;
			case "reviveall":
				Ui.Toast(L.F("复活了 {0} 只怪", Admin.ReviveEnemies()));
				break;
			case "spawnE":
			{
				EnemySetup val6 = ((IEnumerable<EnemySetup>)Admin.AllEnemySetups()).FirstOrDefault((Func<EnemySetup, bool>)((EnemySetup x) => Object.op_Implicit((Object)(object)x) && ((Object)x).name == S(a, 0)));
				if (Object.op_Implicit((Object)(object)val6))
				{
					Admin.SpawnEnemy(val6, V(a, 1));
				}
				break;
			}
			case "spawnV":
			{
				PrefabRef val5 = ((IEnumerable<PrefabRef>)Admin.ValuablePrefabs()).FirstOrDefault((Func<PrefabRef, bool>)((PrefabRef x) => ((PrefabRef<GameObject>)(object)x).ResourcePath == S(a, 0)));
				if (val5 != null)
				{
					Admin.SpawnValuable(val5, V(a, 1));
				}
				break;
			}
			case "spawnI":
			{
				Item val4 = ((IEnumerable<Item>)Admin.Items()).FirstOrDefault((Func<Item, bool>)((Item x) => Object.op_Implicit((Object)(object)x) && ((Object)x).name == S(a, 0)));
				if (Object.op_Implicit((Object)(object)val4))
				{
					Admin.SpawnItem(val4, V(a, 1));
				}
				break;
			}
			case "spawnT":
				Admin.SpawnTokenBox(I(a, 0), V(a, 1));
				break;
			case "upg":
			{
				string text = S(a, 0);
				string text2 = S(a, 1);
				if (text == actor && !string.IsNullOrEmpty(text2) && text2.Length < 32)
				{
					Admin.ApplyUpgrade(text, text2, Mathf.Clamp(I(a, 2), -100, 100));
				}
				break;
			}
			case "money":
				Admin.SetMoney(I(a, 0));
				break;
			case "omove":
			case "odestroy":
			{
				PhotonView val2 = PhotonView.Find(I(a, 0));
				PhysGrabObject val3 = (Object.op_Implicit((Object)(object)val2) ? ((Component)val2).GetComponent<PhysGrabObject>() : null);
				if (!Object.op_Implicit((Object)(object)val3) || Object.op_Implicit((Object)(object)((Component)val3).GetComponent<PlayerTumble>()) || Object.op_Implicit((Object)(object)((Component)val3).GetComponent<PlayerDeathHead>()))
				{
					break;
				}
				if (op == "omove")
				{
					Admin.MoveObject(val3, V(a, 1));
					if (Object.op_Implicit((Object)(object)((Component)val3).GetComponent<ValuableObject>()))
					{
						val3.OverrideIndestructible(3f);
					}
				}
				else
				{
					Admin.DestroyObject(val3);
				}
				break;
			}
			case "emove":
			case "ekill":
			case "eremove":
			{
				int id = I(a, 0);
				EnemyParent val = ((IEnumerable<EnemyParent>)Admin.LevelEnemies()).FirstOrDefault((Func<EnemyParent, bool>)((EnemyParent e) => ViewOf(e) == id));
				if (Object.op_Implicit((Object)(object)val))
				{
					RunEnemy(op, val, V(a, 1));
				}
				break;
			}
			}
		}
	}
	internal static class Admin
	{
		private sealed class LoopState
		{
			public int Phase;

			public float Next;
		}

		private sealed class Screamer
		{
			public string Target;

			public EnemyParent Enemy;

			public float DestroyAt = -1f;

			public float NextTp;
		}

		private sealed class PendingSpawn
		{
			public EnemyParent Ep;

			public Vector3 Pos;

			public float Until;

			public float HoldUntil = -1f;
		}

		public static readonly HashSet<string> VoidLoop = new HashSet<string>();

		public static readonly HashSet<string> TumbleLoop = new HashSet<string>();

		public static readonly HashSet<string> DeathLoop = new HashSet<string>();

		public static readonly HashSet<string> God = new HashSet<string>();

		public static readonly HashSet<string> NoAggro = new HashSet<string>();

		public static readonly HashSet<string> Stamina = new HashSet<string>();

		public static readonly HashSet<string> PinFront = new HashSet<string>();

		public static readonly HashSet<string> FxTranq = new HashSet<string>();

		public static readonly HashSet<string> FxRoll = new HashSet<string>();

		public static readonly HashSet<string> FxZap = new HashSet<string>();

		public static readonly HashSet<string> FxBlast = new HashSet<string>();

		private static float _nextPin;

		private static readonly Dictionary<string, string> PinOwner = new Dictionary<string, string>();

		private static readonly HashSet<string> _naNow = new HashSet<string>();

		private static readonly HashSet<string> _naApplied = new HashSet<string>();

		private static float _nextNa;

		private static readonly Dictionary<string, LoopState> _voidSt = new Dictionary<string, LoopState>();

		private static readonly Dictionary<string, LoopState> _deathSt = new Dictionary<string, LoopState>();

		private static readonly Dictionary<string, float> _healT = new Dictionary<string, float>();

		private static readonly List<Screamer> _screamers = new List<Screamer>();

		private static float _nextTick;

		private static float _nextValuables;

		private static List<ValuableObject> _valCache = new List<ValuableObject>();

		private static float _valCacheT;

		internal static bool AllowDeath;

		private static List<PhysGrabCart> _carts = new List<PhysGrabCart>();

		private static float _cartsT;

		private static readonly List<EnemySetup> _knownSetups = new List<EnemySetup>();

		private static float _setupRetry;

		private static readonly Dictionary<EnemyParent, Vector3> _spawnAt = new Dictionary<EnemyParent, Vector3>();

		private static List<EnemySetup> _setupCache;

		private static EnemyDirector _setupDirector;

		private static readonly List<PendingSpawn> _pending = new List<PendingSpawn>();

		private static List<PrefabRef> _valPrefabs;

		private static List<Item> _items;

		private static float _itemsRetryAt;

		public static readonly string[] SpawnGroupNames = new string[5] { "远程武器", "近战", "医疗包", "升级道具", "道具" };

		private static readonly Dictionary<string, string> _priceCache = new Dictionary<string, string>();

		private static readonly Dictionary<string, float> _fxT = new Dictionary<string, float>();

		private static float _objT;

		private static List<ValuableObject> _objVal = new List<ValuableObject>();

		private static List<ItemAttributes> _objItem = new List<ItemAttributes>();

		public static readonly string[] TokenNames = new string[4] { "普通代币箱", "罕见代币箱", "稀有代币箱", "超稀有代币箱" };

		public static bool ValuablesWeightless => Sync.Get(4);

		public static bool ValuablesIndestructible => Sync.Get(8);

		public static PlayerAvatar Me => PlayerAvatar.instance;

		public static HashSet<string> SetAt(int i)
		{
			return i switch
			{
				0 => VoidLoop, 
				1 => TumbleLoop, 
				2 => DeathLoop, 
				3 => God, 
				4 => NoAggro, 
				5 => Stamina, 
				8 => FxTranq, 
				9 => FxRoll, 
				10 => FxZap, 
				11 => FxBlast, 
				_ => PinFront, 
			};
		}

		public static int IndexOf(HashSet<string> set)
		{
			for (int i = 0; i < 12; i++)
			{
				if (i != 7 && SetAt(i) == set)
				{
					return i;
				}
			}
			return -1;
		}

		public static void ResetAll()
		{
			VoidLoop.Clear();
			TumbleLoop.Clear();
			DeathLoop.Clear();
			God.Clear();
			NoAggro.Clear();
			Stamina.Clear();
			PinFront.Clear();
			FxTranq.Clear();
			FxRoll.Clear();
			FxZap.Clear();
			FxBlast.Clear();
			PinOwner.Clear();
			_voidSt.Clear();
			_deathSt.Clear();
			_healT.Clear();
			_screamers.Clear();
			_pending.Clear();
			_spawnAt.Clear();
			_naNow.Clear();
			_naApplied.Clear();
			_cartsT = 0f;
		}

		public static List<PlayerAvatar> Players()
		{
			List<PlayerAvatar> list = new List<PlayerAvatar>();
			if (!Object.op_Implicit((Object)(object)GameDirector.instance))
			{
				return list;
			}
			foreach (PlayerAvatar player in GameDirector.instance.PlayerList)
			{
				if (Object.op_Implicit((Object)(object)player))
				{
					list.Add(player);
				}
			}
			return list;
		}

		public static Vector3 MyFront(float dist = 2f)
		{
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: 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_00c7: 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_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: 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_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: 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_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			Camera val = Esp.GameCam();
			Transform val2 = (Object.op_Implicit((Object)(object)val) ? ((Component)val).transform : (Object.op_Implicit((Object)(object)Me) ? ((Component)Me).transform : null));
			if (!Object.op_Implicit((Object)(object)val2))
			{
				return Vector3.zero;
			}
			Vector3 forward = val2.forward;
			forward.y = 0f;
			if (((Vector3)(ref forward)).sqrMagnitude < 0.01f)
			{
				forward = Vector3.forward;
			}
			((Vector3)(ref forward)).Normalize();
			Vector3 val3 = (Object.op_Implicit((Object)(object)Me) ? ((Component)Me).transform.position : val2.position);
			Vector3 val4 = val3 + forward * dist;
			RaycastHit val5 = default(RaycastHit);
			if (Physics.Raycast(val3 + Vector3.up * 1f, forward, ref val5, dist, LayerMask.GetMask(new string[1] { "Default" }), (QueryTriggerInteraction)1))
			{
				val4 = val3 + forward * Mathf.Max(0.5f, ((RaycastHit)(ref val5)).distance - 0.5f);
			}
			return val4 + Vector3.up * 0.2f;
		}

		public static Vector3 FrontOf(PlayerAvatar a, float dist)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: 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_0031: 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)
			Vector3 forward = ((Component)a).transform.forward;
			forward.y = 0f;
			if (((Vector3)(ref forward)).sqrMagnitude < 0.01f)
			{
				forward = Vector3.forward;
			}
			return ((Component)a).transform.position + ((Vector3)(ref forward)).normalized * dist + Vector3.up * 0.2f;
		}

		public static Vector3? TruckPos()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)TruckSafetySpawnPoint.instance))
			{
				return ((Component)TruckSafetySpawnPoint.instance).transform.position + Vector3.up * 0.3f;
			}
			if (Object.op_Implicit((Object)(object)LevelGenerator.Instance) && Object.op_Implicit((Object)(object)LevelGenerator.Instance.LevelPathTruck))
			{
				return ((Component)LevelGenerator.Instance.LevelPathTruck).transform.position + Vector3.up * 0.3f;
			}
			return null;
		}

		public static List<ExtractionPoint> Extractions()
		{
			List<ExtractionPoint> list = new List<ExtractionPoint>();
			if (!Object.op_Implicit((Object)(object)RoundDirector.instance) || RoundDirector.instance.extractionPointList == null)
			{
				return list;
			}
			foreach (GameObject extractionPoint in RoundDirector.instance.extractionPointList)
			{
				ExtractionPoint val = (Object.op_Implicit((Object)(object)extractionPoint) ? extractionPoint.GetComponent<ExtractionPoint>() : null);
				if (Object.op_Implicit((Object)(object)val))
				{
					list.Add(val);
				}
			}
			return list;
		}

		public static int ExtractionStatus(ExtractionPoint ep)
		{
			//IL_0014: 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_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Invalid comparison between Unknown and I4
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Invalid comparison between Unknown and I4
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Invalid comparison between Unknown and I4
			if (!Object.op_Implicit((Object)(object)ep))
			{
				return 0;
			}
			State currentState = ep.currentState;
			State val = currentState;
			if ((int)val > 1)
			{
				if ((int)val == 7 || (int)val == 9)
				{
					return 2;
				}
				return 1;
			}
			return 0;
		}

		public static string ExtractionStatusName(ExtractionPoint ep)
		{
			return L.T(ExtractionStatus(ep) switch
			{
				1 => "已激活", 
				2 => "已提交", 
				_ => "未激活", 
			});
		}

		public static string ExtractionLabel(int n, ExtractionPoint ep)
		{
			return L.F("提交点 {0}", n) + " " + ExtractionStatusName(ep);
		}

		public static bool CanActivateExtraction(ExtractionPoint ep)
		{
			return Object.op_Implicit((Object)(object)ep) && Object.op_Implicit((Object)(object)RoundDirector.instance) && !RoundDirector.instance.extractionPointActive && ExtractionStatus(ep) == 0 && !ep.isLocked;
		}

		public static bool EnemySpawnAllowed()
		{
			try
			{
				return Object.op_Implicit((Object)(object)RunManager.instance) && Object.op_Implicit((Object)(object)LevelGenerator.Instance) && LevelGenerator.Instance.Generated && LevelGenerator.Instance.NavMeshReady && Object.op_Implicit((Object)(object)EnemyDirector.instance);
			}
			catch
			{
				return false;
			}
		}

		public static List<PhysGrabCart> Carts()
		{
			if (Time.unscaledTime >= _cartsT || _carts.Exists((PhysGrabCart c) => !Object.op_Implicit((Object)(object)c)))
			{
				_cartsT = Time.unscaledTime + 1f;
				_carts = (from c in Object.FindObjectsByType<PhysGrabCart>((FindObjectsSortMode)0)
					where Object.op_Implicit((Object)(object)c)
					select c).ToList();
			}
			return _carts;
		}

		public static Vector3 ExtractionFront(ExtractionPoint ep)
		{
			//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_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_0026: 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_0035: 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_003d: Unknown result type (might be due to invalid IL or missing references)
			return ((Component)ep).transform.position + ((Component)ep).transform.forward * 1.5f + Vector3.up * 0.5f;
		}

		public static Vector3 CartSide(PhysGrabCart c)
		{
			//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_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_0026: 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_0035: 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_003d: Unknown result type (might be due to invalid IL or missing references)
			return ((Component)c).transform.position + ((Component)c).transform.right * 1.3f + Vector3.up * 0.5f;
		}

		public static Vector3 VoidPos()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = (Vector3)(((??)TruckPos()) ?? (Object.op_Implicit((Object)(object)Me) ? ((Component)Me).transform.position : Vector3.zero));
			return val + Vector3.down * 120f;
		}

		public static void Teleport(PlayerAvatar a, Vector3 pos)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: 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_005d: 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)
			if (Object.op_Implicit((Object)(object)a) && !a.deadSet)
			{
				Quaternion rotation = ((Component)a).transform.rotation;
				if (a.isTumbling && Object.op_Implicit((Object)(object)a.tumble) && Object.op_Implicit((Object)(object)a.tumble.physGrabObject))
				{
					a.tumble.physGrabObject.Teleport(pos, rotation);
				}
				else
				{
					a.Spawn(pos, rotation, false);
				}
			}
		}

		public static void TeleportSelf(Vector3 pos)
		{
			//IL_0039: 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_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: 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_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			PlayerAvatar instance = PlayerAvatar.instance;
			PlayerController instance2 = PlayerController.instance;
			if (Object.op_Implicit((Object)(object)instance) && !instance.deadSet && Object.op_Implicit((Object)(object)instance2))
			{
				((Component)instance2).transform.position = pos;
				if (Object.op_Implicit((Object)(object)instance2.rb))
				{
					instance2.rb.position = pos;
					instance2.rb.linearVelocity = Vector3.zero;
				}
				((Component)instance).transform.position = pos;
				instance.clientPosition = pos;
				instance.clientPositionCurrent = pos;
				if (Object.op_Implicit((Object)(object)instance.playerAvatarVisuals))
				{
					instance.playerAvatarVisuals.visualPosition = pos;
				}
				if (instance.isTumbling && Object.op_Implicit((Object)(object)instance.tumble) && Object.op_Implicit((Object)(object)instance.tumble.physGrabObject))
				{
					instance.tumble.physGrabObject.Teleport(pos, ((Component)instance).transform.rotation);
				}
			}
		}

		public static void Kill(PlayerAvatar a)
		{
			if (!Object.op_Implicit((Object)(object)a) || a.deadSet)
			{
				return;
			}
			AllowDeath = true;
			try
			{
				a.PlayerDeath(-1);
			}
			finally
			{
				AllowDeath = false;
			}
		}

		public static void Revive(PlayerAvatar a)
		{
			if (Object.op_Implicit((Object)(object)a) && a.deadSet && Object.op_Implicit((Object)(object)a.playerDeathHead))
			{
				a.playerDeathHead.inExtractionPoint = true;
				if (a.playerDeathHead.triggered)
				{
					a.playerDeathHead.Revive();
				}
				else
				{
					a.Revive(false);
				}
			}
		}

		public static void HealFull(PlayerAvatar a)
		{
			if (Object.op_Implicit((Object)(object)a) && !a.deadSet && Object.op_Implicit((Object)(object)a.playerHealth))
			{
				int num = a.playerHealth.maxHealth - a.playerHealth.health;
				if (num > 0)
				{
					a.playerHealth.HealOther(num, true);
				}
			}
		}

		public static void SetFlag(HashSet<string> set, PlayerAvatar a, bool on, string byActor = null)
		{
			//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
			string text = Net.SidOf(a);
			if (string.IsNullOrEmpty(text))
			{
				return;
			}
			if (on)
			{
				set.Add(text);
			}
			else
			{
				set.Remove(text);
			}
			if (set == PinFront)
			{
				if (on)
				{
					PinOwner[text] = (string.IsNullOrEmpty(byActor) ? Net.MySid : byActor);
				}
				else
				{
					PinOwner.Remove(text);
				}
			}
			Player val = Net.PlayerOf(a);
			if (set == Stamina)
			{
				Net.SendCmd(val, "stam", on);
				if (on && !a.isLocal && !Net.HasMod(val))
				{
					Ui.Toast(L.F("{0} 没装本模组,无限体力对他无效", a.playerName));
				}
			}
			else if (set == God)
			{
				Net.SendCmd(val, "god", on);
			}
			else if (set == NoAggro && !on && Object.op_Implicit((Object)(object)EnemyDirector.instance))
			{
				EnemyDirector.instance.debugNoVision.Remove(text);
			}
			else if ((set == FxTranq || set == FxRoll || set == FxZap) && !on)
			{
				if (set == FxTranq && SemiFunc.IsMultiplayer() && Object.op_Implicit((Object)(object)a.photonView))
				{
					a.photonView.RPC("OverridePupilSizeActivateRPC", (RpcTarget)0, new object[8] { false, 1f, 0, 1f, 1f, 5f, 0.5f, 0.1f });
				}
				if (Object.op_Implicit((Object)(object)a.tumble) && !FxHoldsTumble(text))
				{
					a.tumble.tumbleOverrideTimer = 0f;
					a.tumble.TumbleSet(false, false, false);
				}
			}
			else if ((set == TumbleLoop || set == PinFront) && !on && Object.op_Implicit((Object)(object)a.tumble) && !FxHoldsTumble(text))
			{
				a.tumble.tumbleOverrideTimer = 0f;
				a.tumble.TumbleSet(false, false, false);
			}
			else if (set == VoidLoop && !on)
			{
				_voidSt.Remove(text);
				Vector3? val2 = TruckPos();
				if (val2.HasValue)
				{
					Teleport(a, val2.Value);
				}
			}
			else if (set == DeathLoop && !on)
			{
				_deathSt.Remove(text);
				Revive(a);
			}
		}

		public static bool Has(HashSet<string> set, PlayerAvatar a)
		{
			return set.Contains(Net.SidOf(a));
		}

		public static EnemySetup FindEnemySetup(string key)
		{
			foreach (EnemySetup item in AllEnemySetups())
			{
				if (((Object)item).name.IndexOf(key, StringComparison.OrdinalIgnoreCase) >= 0)
				{
					return item;
				}
			}
			return null;
		}

		public static List<EnemySetup> AllEnemySetups()
		{
			EnemyDirector instance = EnemyDirector.instance;
			if (_setupCache != null && (Object)(object)_setupDirector == (Object)(object)instance && (_setupCache.Count > 0 || Time.unscaledTime < _setupRetry))
			{
				return _setupCache;
			}
			List<EnemySetup> list = new List<EnemySetup>();
			IEnumerable<EnemySetup> enumerable = _knownSetups.Where((EnemySetup s) => Object.op_Implicit((Object)(object)s));
			if (Object.op_Implicit((Object)(object)instance))
			{
				enumerable = enumerable.Concat(instance.enemiesDifficulty1).Concat(instance.enemiesDifficulty2).Concat(instance.enemiesDifficulty3);
			}
			try
			{
				enumerable = enumerable.Concat(Resources.FindObjectsOfTypeAll<EnemySetup>());
			}
			catch
			{
			}
			Dictionary<string, EnemySetup> dictionary = new Dictionary<string, EnemySetup>();
			List<string> list2 = new List<string>();
			foreach (EnemySetup item in enumerable.ToList())
			{
				if (Object.op_Implicit((Object)(object)item) && item.spawnObjects != null && item.spawnObjects.Count != 0 && !item.spawnObjects.Any((PrefabRef p) => p == null || !((PrefabRef<GameObject>)(object)p).IsValid()))
				{
					string text = Names.EnemySetupOf(item);
					if (!dictionary.TryGetValue(text, out var value))
					{
						dictionary[text] = item;
						list2.Add(text);
					}
					else if (item.spawnObjects.Count < value.spawnObjects.Count)
					{
						dictionary[text] = item;
					}
				}
			}
			foreach (string item2 in list2)
			{
				list.Add(dictionary[item2]);
			}
			list.Sort((EnemySetup a, EnemySetup b) => string.Compare(Names.EnemySetupOf(a), Names.EnemySetupOf(b), StringComparison.CurrentCulture));
			_setupCache = list;
			_setupDirector = instance;
			_setupRetry = Time.unscaledTime + 3f;
			_knownSetups.Clear();
			_knownSetups.AddRange(list);
			return list;
		}

		public static bool EnemySpawnPre(Enemy enemy)
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			EnemyParent val = (Object.op_Implicit((Object)(object)enemy) ? enemy.EnemyParent : null);
			if (!Object.op_Implicit((Object)(object)val) || !_spawnAt.TryGetValue(val, out var value))
			{
				return true;
			}
			_spawnAt.Remove(val);
			enemy.EnemyTeleported(value);
			val.firstSpawnPointUsed = true;
			return false;
		}

		public static void ClearNameCache()
		{
			_setupCache = null;
			_valPrefabs = null;
			_items = null;
			_priceCache.Clear();
		}

		private static void PendingTick()
		{
			//IL_00cd: 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_00f0: Unknown result type (might be due to invalid IL or missing references)
			for (int num = _pending.Count - 1; num >= 0; num--)
			{
				PendingSpawn pendingSpawn = _pending[num];
				if (!Object.op_Implicit((Object)(object)pendingSpawn.Ep) || Time.time > pendingSpawn.Until)
				{
					_pending.RemoveAt(num);
				}
				else if (!pendingSpawn.Ep.Spawned)
				{
					pendingSpawn.Ep.DespawnedTimer = Mathf.Min(pendingSpawn.Ep.DespawnedTimer, 0.2f);
				}
				else
				{
					if (pendingSpawn.HoldUntil < 0f)
					{
						pendingSpawn.HoldUntil = Time.time + 1.5f;
					}
					Enemy enemy = pendingSpawn.Ep.Enemy;
					if (Object.op_Implicit((Object)(object)enemy) && Vector3.Distance(((Component)enemy).transform.position, pendingSpawn.Pos) > 0.8f)
					{
						enemy.EnemyTeleported(pendingSpawn.Pos);
					}
					if (Time.time > pendingSpawn.HoldUntil)
					{
						_pending.RemoveAt(num);
					}
				}
			}
		}

		public static string EnemySetupName(EnemySetup s)
		{
			return Names.EnemySetupOf(s);
		}

		public static void ScreamerOn(PlayerAvatar a)
		{
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			string sid = Net.SidOf(a);
			if (!Object.op_Implicit((Object)(object)a) || a.deadSet || _screamers.Any((Screamer s) => s.Target == sid && s.DestroyAt < 0f))
			{
				return;
			}
			EnemySetup val = FindEnemySetup("Upscream");
			if (!Object.op_Implicit((Object)(object)val))
			{
				Ui.Toast(L.T("没找到尖啸者(Upscream)"));
				return;
			}
			List<EnemyParent> list = SpawnEnemy(val, FrontOf(a, 0.5f));
			foreach (EnemyParent item in list)
			{
				_screamers.Add(new Screamer
				{
					Target = sid,
					Enemy = item
				});
			}
			Ui.Toast(L.F("尖啸者已锁定 {0}", a.playerName));
		}

		public static void ScreamerOff(PlayerAvatar a)
		{
			string text = Net.SidOf(a);
			foreach (Screamer screamer in _screamers)
			{
				if (screamer.Target == text && screamer.DestroyAt < 0f)
				{
					KillScreamer(screamer);
				}
			}
		}

		public static bool HasScreamer(PlayerAvatar a)
		{
			return Sync.Has(7, Net.SidOf(a));
		}

		public static bool HasScreamerSid(string sid)
		{
			return _screamers.Any((Screamer s) => s.Target == sid && s.DestroyAt < 0f);
		}

		public static IEnumerable<string> ScreamerSids()
		{
			return (from s in _screamers
				where s.DestroyAt < 0f
				select s.Target).Distinct();
		}

		private static void KillScreamer(Screamer s)
		{
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			s.DestroyAt = Time.time + 2f;
			try
			{
				if (Object.op_Implicit((Object)(object)s.Enemy) && Object.op_Implicit((Object)(object)s.Enemy.Enemy) && s.Enemy.Enemy.HasHealth)
				{
					s.Enemy.Enemy.Health.Hurt(999999, Vector3.up);
				}
			}
			catch
			{
			}
		}

		private static void ScreamerTick()
		{
			//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_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			for (int num = _screamers.Count - 1; num >= 0; num--)
			{
				Screamer screamer = _screamers[num];
				if (!Object.op_Implicit((Object)(object)screamer.Enemy))
				{
					_screamers.RemoveAt(num);
				}
				else if (screamer.DestroyAt >= 0f)
				{
					if (Time.time >= screamer.DestroyAt)
					{
						DestroyEnemy(screamer.Enemy);
						_screamers.RemoveAt(num);
					}
				}
				else
				{
					PlayerAvatar val = SemiFunc.PlayerGetFromSteamID(screamer.Target);
					if (!Object.op_Implicit((Object)(object)val) || val.deadSet)
					{
						KillScreamer(screamer);
					}
					else
					{
						EnemyParent enemy = screamer.Enemy;
						enemy.SpawnedTimerPause(5f);
						Enemy enemy2 = enemy.Enemy;
						if (Object.op_Implicit((Object)(object)enemy2))
						{
							Vector3 val2 = FrontOf(val, 0.5f);
							if (Time.time >= screamer.NextTp && Vector3.Distance(((Component)enemy2).transform.position, val2) > 1f)
							{
								screamer.NextTp = Time.time + 0.15f;
								enemy2.EnemyTeleported(val2);
							}
							try
							{
								enemy2.SetChaseTarget(val);
							}
							catch
							{
							}
						}
					}
				}
			}
		}

		private static void DestroyEnemy(EnemyParent ep)
		{
			if (Object.op_Implicit((Object)(object)ep))
			{
				if (Object.op_Implicit((Object)(object)EnemyDirector.instance))
				{
					EnemyDirector.instance.enemiesSpawned.Remove(ep);
				}
				if (SemiFunc.IsMultiplayer())
				{
					PhotonNetwork.Destroy(((Component)ep).gameObject);
				}
				else
				{
					Object.Destroy((Object)(object)((Component)ep).gameObject);
				}
			}
		}

		public static List<EnemyParent> SpawnEnemy(EnemySetup setup, Vector3 pos)
		{
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: 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_00ef: 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)
			List<EnemyParent> list = new List<EnemyParent>();
			if (!EnemySpawnAllowed())
			{
				Ui.Toast(L.T("场景还没加载完,稍后再刷怪"));
				return list;
			}
			foreach (PrefabRef spawnObject in setup.spawnObjects)
			{
				GameObject val = (SemiFunc.IsMultiplayer() ? PhotonNetwork.InstantiateRoomObject(((PrefabRef<GameObject>)(object)spawnObject).ResourcePath, pos, Quaternion.identity, (byte)0, EnemyFloaterHalloweenState.SpawnData(spawnObject)) : Object.Instantiate<GameObject>(((PrefabRef<GameObject>)(object)spawnObject).Prefab, pos, Quaternion.identity));
				EnemyParent val2 = (Object.op_Implicit((Object)(object)val) ? val.GetComponent<EnemyParent>() : null);
				if (Object.op_Implicit((Object)(object)val2))
				{
					val2.SetupDone = true;
					Enemy componentInChildren = val.GetComponentInChildren<Enemy>();
					if (componentInChildren != null)
					{
						componentInChildren.EnemyTeleported(pos);
					}
					val2.firstSpawnPointUsed = true;
					_spawnAt[val2] = pos;
					list.Add(val2);
					_pending.Add(new PendingSpawn
					{
						Ep = val2,
						Pos = pos,
						Until = Time.time + 15f
					});
				}
			}
			return list;
		}

		public static Vector3 RandomLevelPoint()
		{
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: 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_005a: 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)
			List<LevelPoint> list = SemiFunc.LevelPointsGetAll();
			if (list != null)
			{
				list = list.Where((LevelPoint p) => Object.op_Implicit((Object)(object)p) && (!Object.op_Implicit((Object)(object)p.Room) || !p.Room.Truck)).ToList();
			}
			if (list == null || list.Count == 0)
			{
				return MyFront(3f);
			}
			return ((Component)list[Random.Range(0, list.Count)]).transform.position;
		}

		public static int KillAllEnemies()
		{
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			int num = 0;
			if (!Object.op_Implicit((Object)(object)EnemyDirector.instance))
			{
				return 0;
			}
			foreach (EnemyParent ep in EnemyDirector.instance.enemiesSpawned.ToList())
			{
				if (Object.op_Implicit((Object)(object)ep) && !_screamers.Any((Screamer s) => (Object)(object)s.Enemy == (Object)(object)ep))
				{
					if (ep.Spawned && Object.op_Implicit((Object)(object)ep.Enemy) && ep.Enemy.HasHealth && !ep.Enemy.Health.dead)
					{
						ep.Enemy.Health.Hurt(999999, Vector3.up);
						num++;
					}
					else if (!ep.Spawned || (Object.op_Implicit((Object)(object)ep.Enemy) && ep.Enemy.HasHealth && ep.Enemy.Health.dead))
					{
						DestroyEnemy(ep);
						num++;
					}
				}
			}
			return num;
		}

		public static int ReviveEnemies()
		{
			int num = 0;
			if (!Object.op_Implicit((Object)(object)EnemyDirector.instance))
			{
				return 0;
			}
			foreach (EnemyParent ep in EnemyDirector.instance.enemiesSpawned)
			{
				if (Object.op_Implicit((Object)(object)ep) && !ep.Spawned && !_screamers.Any((Screamer s) => (Object)(object)s.Enemy == (Object)(object)ep))
				{
					ep.DespawnedTimerSet(0.5f, false);
					num++;
				}
			}
			return num;
		}

		public static List<PrefabRef> ValuablePrefabs()
		{
			if (_valPrefabs != null && _valPrefabs.Count > 0)
			{
				return _valPrefabs;
			}
			_valPrefabs = new List<PrefabRef>();
			HashSet<string> hashSet = new HashSet<string>();
			if (!Object.op_Implicit((Object)(object)RunManager.instance))
			{
				return _valPrefabs;
			}
			foreach (Level level in RunManager.instance.levels)
			{
				if (!Object.op_Implicit((Object)(object)level) || level.ValuablePresets == null)
				{
					continue;
				}
				foreach (LevelValuables valuablePreset in level.ValuablePresets)
				{
					if (!Object.op_Implicit((Object)(object)valuablePreset))
					{
						continue;
					}
					foreach (PrefabRef item in valuablePreset.tiny.Concat(valuablePreset.small).Concat(valuablePreset.medium).Concat(valuablePreset.big)
						.Concat(valuablePreset.wide)
						.Concat(valuablePreset.tall)
						.Concat(valuablePreset.veryTall))
					{
						if (item != null && ((PrefabRef<GameObject>)(object)item).IsValid() && !string.IsNullOrEmpty(((PrefabRef<GameObject>)(object)item).ResourcePath) && hashSet.Add(((PrefabRef<GameObject>)(object)item).PrefabName))
						{
							_valPrefabs.Add(item);
						}
					}
				}
			}
			_valPrefabs.Sort((PrefabRef a, PrefabRef b) => string.Compare(ValuableName(a), ValuableName(b), StringComparison.Ordinal));
			return _valPrefabs;
		}

		public static string ValuableName(PrefabRef r)
		{
			return Names.ValuableOf(((PrefabRef<GameObject>)(object)r).PrefabName);
		}

		private static IEnumerable<Item> ItemSource()
		{
			StatsManager instance = StatsManager.instance;
			if (instance.itemDictionary.Count > 0)
			{
				return instance.itemDictionary.Values;
			}
			if (Time.unscaledTime < _itemsRetryAt)
			{
				return (IEnumerable<Item>)(object)new Item[0];
			}
			_itemsRetryAt = Time.unscaledTime + 2f;
			try
			{
				return (from x in Resources.LoadAll<Item>(instance.folderPath)
					where Object.op_Implicit((Object)(object)x) && !string.IsNullOrEmpty(((Object)x).name)
					group x by ((Object)x).name into g
					select g.First()).ToList();
			}
			catch
			{
				return (IEnumerable<Item>)(object)new Item[0];
			}
		}

		public static List<Item> Items()
		{
			if (_items != null && _items.Count > 0)
			{
				return _items;
			}
			_items = new List<Item>();
			if (!Object.op_Implicit((Object)(object)StatsManager.instance))
			{
				return _items;
			}
			foreach (Item item in ItemSource())
			{
				if (Object.op_Implicit((Object)(object)item) && !item.disabled && item.prefab != null && ((PrefabRef<GameObject>)(object)item.prefab).IsValid() && !string.IsNullOrEmpty(((PrefabRef<GameObject>)(object)item.prefab).ResourcePath))
				{
					_items.Add(item);
				}
			}
			_items.Sort((Item a, Item b) => string.Compare(ItemName(a), ItemName(b), StringComparison.Ordinal));
			return _items;
		}

		public static string ItemName(Item it)
		{
			return Names.ItemOf(it);
		}

		public static int SpawnGroup(Item it)
		{
			//IL_0014: 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_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: 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_0040: Expected I4, but got Unknown
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Invalid comparison between Unknown and I4
			if (!Object.op_Implicit((Object)(object)it))
			{
				return 4;
			}
			itemType itemType = it.itemType;
			itemType val = itemType;
			switch (val - 3)
			{
			default:
				if ((int)val != 15)
				{
					break;
				}
				goto case 6;
			case 6:
				return 0;
			case 4:
				return 1;
			case 5:
				return 2;
			case 0:
			case 1:
				return 3;
			case 2:
			case 3:
				break;
			}
			return 4;
		}

		public static string ValuablePrice(PrefabRef r)
		{
			if (r == null)
			{
				return "";
			}
			string text = ((PrefabRef<GameObject>)(object)r).ResourcePath ?? "";
			if (_priceCache.TryGetValue(text, out var value))
			{
				return value;
			}
			string text2 = "";
			bool flag = false;
			try
			{
				flag = Object.op_Implicit((Object)(object)RunManager.instance);
				if (flag)
				{
					GameObject prefab = ((PrefabRef<GameObject>)(object)r).Prefab;
					ValuableObject val = (Object.op_Implicit((Object)(object)prefab) ? prefab.GetComponent<ValuableObject>() : null);
					text2 = ((!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)val.valuePreset)) ? "" : ("$" + Mathf.RoundToInt(val.valuePreset.valueMin) + " ~ $" + Mathf.RoundToInt(val.valuePreset.valueMax)));
				}
			}
			catch
			{
				flag = false;
			}
			if (flag && !string.IsNullOrEmpty(text))
			{
				_priceCache[text] = text2;
			}
			return text2;
		}

		public static string ValuablePriceCached(PrefabRef r)
		{
			if (r == null)
			{
				return "";
			}
			string value;
			return _priceCache.TryGetValue(((PrefabRef<GameObject>)(object)r).ResourcePath ?? "", out value) ? value : "";
		}

		public static void SpawnValuable(PrefabRef r, Vector3 pos)
		{
			//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_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)
			GameObject val = (SemiFunc.IsMultiplayer() ? PhotonNetwork.InstantiateRoomObject(((PrefabRef<GameObject>)(object)r).ResourcePath, pos, Quaternion.identity, (byte)0, (object[])null) : Object.Instantiate<GameObject>(((PrefabRef<GameObject>)(object)r).Prefab, pos, Quaternion.identity));
			ValuableObject val2 = (Object.op_Implicit((Object)(object)val) ? val.GetComponent<ValuableObject>() : null);
			if (Object.op_Implicit((Object)(object)val2))
			{
				val2.DollarValueSetLogic();
			}
		}

		public static void SpawnItem(Item it, Vector3 pos)
		{
			//IL_0033: 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_0016: 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)
			if (SemiFunc.IsMultiplayer())
			{
				PhotonNetwork.InstantiateRoomObject(((PrefabRef<GameObject>)(object)it.prefab).ResourcePath, pos, Quaternion.identity, (byte)0, (object[])null);
			}
			else
			{
				Object.Instantiate<GameObject>(((PrefabRef<GameObject>)(object)it.prefab).Prefab, pos, Quaternion.identity);
			}
		}

		public static Vector3 Scatter(Vector3 c, int i, int n)
		{
			//IL_0034: 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_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: 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_0062: Unknown result type (might be due to invalid IL or missing references)
			if (n <= 1)
			{
				return c;
			}
			float num = (float)i / (float)n * MathF.PI * 2f;
			float num2 = 0.4f + 0.15f * (float)(i / 8);
			return c + new Vector3(Mathf.Cos(num) * num2, 0.3f + 0.25f * (float)(i % 3), Mathf.Sin(num) * num2);
		}

		public static void Tick()
		{
			if ((Net.Multiplayer && !PhotonNetwork.IsMasterClient) || !SemiFunc.LevelGenDone())
			{
				return;
			}
			World.Tick();
			PendingTick();
			ScreamerTick();
			if (PinFront.Count > 0 && Time.time >= _nextPin)
			{
				_nextPin = Time.time + 0.05f;
				PinTick();
			}
			if (Time.time >= _nextValuables)
			{
				_nextValuables = Time.time + 0.25f;
				ValuablesTick();
			}
			if (Time.time < _nextTick)
			{
				return;
			}
			_nextTick = Time.time + 0.1f;
			_naNow.Clear();
			foreach (PlayerAvatar item in Players())
			{
				string text = Net.SidOf(item);
				if (string.IsNullOrEmpty(text))
				{
					continue;
				}
				bool flag = item.isLocal && Self.NoAggro;
				bool flag2 = Sync.RemoteOf(item)?.NoAggro ?? false;
				bool flag3 = NoAggro.Contains(text) || flag2 || flag;
				string text2 = (string.IsNullOrEmpty(item.steamID) ? text : item.steamID);
				if (flag3)
				{
					_naNow.Add(text2);
					if (Object.op_Implicit((Object)(object)EnemyDirector.instance) && !EnemyDirector.instance.debugNoVision.Contains(text2))
					{
						EnemyDirector.instance.debugNoVision.Add(text2);
						Plugin.Log.LogInfo((object)("[HostToolkit] 怪物无视:" + item.playerName + " 已加入名单(" + text2 + ")"));
					}
				}
				if (God.Contains(text))
				{
					GodTick(item, text);
				}
				if (TumbleLoop.Contains(text) && !item.deadSet && Object.op_Implicit((Object)(object)item.tumble))
				{
					item.tumble.OverrideTumbleHold(1f);
					if (!item.tumble.isTumbling)
					{
						item.tumble.TumbleSet(true, false, false);
					}
				}
				if (VoidLoop.Contains(text))
				{
					VoidTick(item, text);
				}
				if (DeathLoop.Contains(text))
				{
					DeathTick(item, text);
				}
				FxTick(item, text);
			}
			NoAggroTick();
		}

		private static void NoAggroTick()
		{
			//IL_0239: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0240: Unknown result type (might be due to invalid IL or missing references)
			//IL_0243: Invalid comparison between Unknown and I4
			//IL_0245: Unknown result type (might be due to invalid IL or missing references)
			//IL_0248: Invalid comparison between Unknown and I4
			//IL_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Invalid comparison between Unknown and I4
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Invalid comparison between Unknown and I4
			EnemyDirector instance = EnemyDirector.instance;
			if (!Object.op_Implicit((Object)(object)instance))
			{
				return;
			}
			if (_naApplied.Count > 0)
			{
				foreach (string item2 in _naApplied.ToList())
				{
					if (!_naNow.Contains(item2))
					{
						instance.debugNoVision.Remove(item2);
						_naApplied.Remove(item2);
					}
				}
			}
			foreach (string item3 in _naNow)
			{
				_naApplied.Add(item3);
			}
			if (_naNow.Count == 0 || Time.time < _nextNa)
			{
				return;
			}
			_nextNa = Time.time + 0.3f;
			foreach (EnemyParent item4 in instance.enemiesSpawned)
			{
				if (!Object.op_Implicit((Object)(object)item4) || !Object.op_Implicit((Object)(object)item4.Enemy))
				{
					continue;
				}
				Enemy enemy = item4.Enemy;
				PlayerAvatar targetPlayerAvatar = enemy.TargetPlayerAvatar;
				if (!Object.op_Implicit((Object)(object)targetPlayerAvatar))
				{
					continue;
				}
				string item = (string.IsNullOrEmpty(targetPlayerAvatar.steamID) ? Net.SidOf(targetPlayerAvatar) : targetPlayerAvatar.steamID);
				if (!_naNow.Contains(item))
				{
					continue;
				}
				enemy.DisableChase(0.6f);
				if (enemy.HasVision && Object.op_Implicit((Object)(object)enemy.Vision))
				{
					enemy.Vision.DisableTimer = 0.6f;
					if (Object.op_Implicit((Object)(object)targetPlayerAvatar.photonView))
					{
						enemy.Vision.VisionTriggered[targetPlayerAvatar.photonView.ViewID] = false;
					}
				}
				enemy.TargetPlayerAvatar = null;
				enemy.TargetPlayerViewID = 0;
				EnemyState currentState = enemy.CurrentState;
				if ((int)currentState == 4 || (int)currentState == 3 || (int)currentState == 5 || (int)currentState == 6)
				{
					enemy.CurrentState = (EnemyState)2;
				}
			}
		}

		private static bool FxDue(string key, float every)
		{
			if (_fxT.TryGetValue(key, out var value) && Time.time < value)
			{
				return false;
			}
			_fxT[key] = Time.time + every;
			return true;
		}

		private static bool FxHoldsTumble(string sid)
		{
			return TumbleLoop.Contains(sid) || PinFront.Contains(sid) || FxTranq.Contains(sid) || FxRoll.Contains(sid) || FxZap.Contains(sid);
		}

		private static void FxTick(PlayerAvatar a, string sid)
		{
			//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02db: Unknown result type (might be due to invalid IL or missing references)
			//IL_030a: Unknown result type (might be due to invalid IL or missing references)
			//IL_030f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0313: Unknown result type (might be due to invalid IL or missing references)
			//IL_035f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0366: Unknown result type (might be due to invalid IL or missing references)
			//IL_0348: Unknown result type (might be due to invalid IL or missing references)
			//IL_034f: Unknown result type (might be due to invalid IL or missing references)
			//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_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0240: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0266: Unknown result type (might be due to invalid IL or missing references)
			//IL_026d: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			bool flag = FxTranq.Contains(sid);
			bool flag2 = FxRoll.Contains(sid);
			bool flag3 = FxZap.Contains(sid);
			bool flag4 = FxBlast.Contains(sid);
			if (!(flag || flag2 || flag3 || flag4) || a.deadSet || !Object.op_Implicit((Object)(object)a.tumble))
			{
				return;
			}
			PlayerTumble tumble = a.tumble;
			if (flag || flag2 || flag3)
			{
				tumble.OverrideTumbleHold(1f);
				if (!tumble.isTumbling)
				{
					tumble.TumbleSet(true, false, false);
				}
			}
			if (flag)
			{
				tumble.TumbleStunTime(0.4f);
				if (SemiFunc.IsMultiplayer() && Object.op_Implicit((Object)(object)a.photonView) && FxDue("p" + sid, 0.2f))
				{
					a.photonView.RPC("OverridePupilSizeActivateRPC", (RpcTarget)0, new object[8] { true, 3f, 4, 1f, 1f, 5f, 0.5f, 0.35f });
				}
			}
			if (flag2 && tumble.isTumbling)
			{
				PhysGrabObject physGrabObject = tumble.physGrabObject;
				Rigidbody val = (Object.op_Implicit((Object)(object)physGrabObject) ? physGrabObject.rb : null);
				if (Object.op_Implicit((Object)(object)val) && !val.isKinematic)
				{
					Vector3 forward = ((Component)a).transform.forward;
					if (Object.op_Implicit((Object)(object)a.localCamera))
					{
						forward = a.localCamera.GetOverrideTransform().forward;
					}
					forward.y = 0f;
					if (((Vector3)(ref forward)).sqrMagnitude < 0.01f)
					{
						forward = Vector3.forward;
					}
					((Vector3)(ref forward)).Normalize();
					float num = Mathf.Max(val.mass, 0.1f);
					Vector3 val2 = Vector3.Cross(Vector3.up, forward);
					val.angularVelocity = ((Vector3)(ref val2)).normalized * 6f * Mathf.Clamp(3f / num, 1f, 10f) / num;
					tumble.OverrideDisableLookAtCamera(0.5f);
				}
			}
			if (flag3)
			{
				tumble.TumbleStunTime(0.4f);
				if (FxDue("z" + sid, 0.5f))
				{
					tumble.TumbleForce(Random.insideUnitSphere * 6f);
					tumble.TumbleTorque(Random.onUnitSphere * 6f);
				}
			}
			if (flag4 && FxDue("b" + sid, 0.7f))
			{
				Vector3 onUnitSphere = Random.onUnitSphere;
				onUnitSphere.y = Mathf.Abs(onUnitSphere.y) * 0.5f + 0.3f;
				((Vector3)(ref onUnitSphere)).Normalize();
				if (tumble.isTumbling)
				{
					tumble.TumbleForce(onUnitSphere * 12f);
				}
				else
				{
					a.ForceImpulse(onUnitSphere * 10f);
				}
			}
		}

		private static void PinTick()
		{
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: 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_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			List<PlayerAvatar> list = Players();
			foreach (PlayerAvatar item in list)
			{
				string text = Net.SidOf(item);
				if (item.isLocal || item.deadSet || !Object.op_Implicit((Object)(object)item.tumble) || string.IsNullOrEmpty(text) || !PinFront.Contains(text))
				{
					continue;
				}
				PlayerAvatar val = null;
				if (PinOwner.TryGetValue(text, out var osid) && !string.IsNullOrEmpty(osid) && osid != Net.MySid)
				{
					val = ((IEnumerable<PlayerAvatar>)list).FirstOrDefault((Func<PlayerAvatar, bool>)((PlayerAvatar p) => Net.SidOf(p) == osid));
				}
				if ((Object)(object)val == (Object)(object)item)
				{
					continue;
				}
				if (!Object.op_Implicit((Object)(object)val))
				{
					val = Me;
				}
				if (!Object.op_Implicit((Object)(object)val) || val.deadSet)
				{
					continue;
				}
				Vector3 val2 = FrontOfAvatar(val, 1f) + Vector3.up * 0.2f;
				item.tumble.OverrideTumbleHold(1f);
				if (!item.isTumbling)
				{
					item.tumble.TumbleSet(true, false, false);
					if (Vector3.Distance(((Component)item).transform.position, val2) > 0.6f)
					{
						item.Spawn(val2, ((Component)item).transform.rotation, false);
					}
					continue;
				}
				PhysGrabObject physGrabObject = item.tumble.physGrabObject;
				if (Object.op_Implicit((Object)(object)physGrabObject))
				{
					if (Vector3.Distance(((Component)physGrabObject).transform.position, val2) > 0.35f)
					{
						physGrabObject.Teleport(val2, ((Component)physGrabObject).transform.rotation);
					}
					if (Object.op_Implicit((Object)(object)physGrabObject.rb) && !physGrabObject.rb.isKinematic)
					{
						physGrabObject.rb.linearVelocity = Vector3.zero;
					}
				}
			}
		}

		public static Vector3 FrontOfAvatar(PlayerAvatar av, float dist)
		{
			//IL_000f: 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_0032: 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_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: 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_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)av))
			{
				return Vector3.zero;
			}
			if (av.isLocal)
			{
				return MyFront(dist);
			}
			Vector3 val = av.clientCameraRotation * Vector3.forward;
			val.y = 0f;
			if (((Vector3)(ref val)).sqrMagnitude < 0.01f)
			{
				val = ((Component)av).transform.forward;
				val.y = 0f;
			}
			if (((Vector3)(ref val)).sqrMagnitude < 0.01f)
			{
				val = Vector3.forward;
			}
			((Vector3)(ref val)).Normalize();
			return ((Component)av).transform.position + val * dist;
		}

		private static void RefreshObjects()
		{
			if (!(Time.unscaledTime < _objT))
			{
				_objT = Time.unscaledTime + 1f;
				_objVal = (from v in Object.FindObjectsByType<ValuableObject>((FindObjectsSortMode)0)
					where Object.op_Implicit((Object)(object)v) && ((Component)v).gameObject.activeInHierarchy && Object.op_Implicit((Object)(object)v.physGrabObject)
					select v).ToList();
				_objItem = (from i in Object.FindObjectsByType<ItemAttributes>((FindObjectsSortMode)0)
					where Object.op_Implicit((Object)(object)i) && ((Component)i).gameObject.activeInHierarchy && Object.op_Implicit((Object)(object)i.physGrabObject) && !Object.op_Implicit((Object)(object)((Component)i).GetComponent<PhysGrabCart>()) && !World.IsHelperDrone(i.physGrabObject)
					select i).ToList();
			}
		}

		public static List<ValuableObject> LevelValuables()
		{
			RefreshObjects();
			return _objVal.Where((ValuableObject v) => Object.op_Implicit((Object)(object)v)).ToList();
		}

		public static List<CosmeticWorldObject> LevelTokenBoxes()
		{
			if (!Object.op_Implicit((Object)(object)RoundDirector.instance) || RoundDirector.instance.cosmeticWorldObjects == null)
			{
				return new List<CosmeticWorldObject>();
			}
			return RoundDirector.instance.cosmeticWorldObjects.Where((CosmeticWorldObject c) => Object.op_Implicit((Object)(object)c) && ((Component)c).gameObject.activeInHierarchy && Object.op_Implicit((Object)(object)c.physGrabObject)).ToList();
		}

		public static string TokenName(Rarity r)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected I4, but got Unknown
			int num = Mathf.Clamp((int)r, 0, TokenNames.Length - 1);
			return L.T(TokenNames[num]);
		}

		public static List<CosmeticWorldObjectSetup> TokenSetups()
		{
			if (!Object.op_Implicit((Object)(object)ValuableDirector.instance) || ValuableDirector.instance.cosmeticWorldObjectSetups == null)
			{
				return new List<CosmeticWorldObjectSetup>();
			}
			return ValuableDirector.instance.cosmeticWorldObjectSetups.Where((CosmeticWorldObjectSetup s) => s != null && s.prefab != null && ((PrefabRef<GameObject>)(object)s.prefab).IsValid() && !string.IsNullOrEmpty(((PrefabRef<GameObject>)(object)s.prefab).ResourcePath)).ToList();
		}

		public static void SpawnTokenBox(int rarity, Vector3 pos)
		{
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			CosmeticWorldObjectSetup val = ((IEnumerable<CosmeticWorldObjectSetup>)TokenSetups()).FirstOrDefault((Func<CosmeticWorldObjectSetup, bool>)((CosmeticWorldObjectSetup x) => (int)x.rarity == rarity));
			if (val != null)
			{
				if (SemiFunc.IsMultiplayer())
				{
					PhotonNetwork.InstantiateRoomObject(((PrefabRef<GameObject>)(object)val.prefab).ResourcePath, pos, Quaternion.identity, (byte)0, (object[])null);
				}
				else
				{
					Object.Instantiate<GameObject>(((PrefabRef<GameObject>)(object)val.prefab).Prefab, pos, Quaternion.identity);
				}
			}
		}

		public static void ApplyUpgrade(string sid, string shortName, int amount)
		{
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			PunManager instance = PunManager.instance;
			StatsManager instance2 = StatsManager.instance;
			if (Object.op_Implicit((Object)(object)instance) && Object.op_Implicit((Object)(object)instance2) && !string.IsNullOrEmpty(sid) && instance2.dictionaryOfDictionaries.ContainsKey("playerUpgrade" + shortName))
			{
				if (SemiFunc.IsMultiplayer())
				{
					instance.photonView.RPC("TesterUpgradeCommandRPC", (RpcTarget)0, new object[3] { sid, shortName, amount });
				}
				else
				{
					instance.TesterUpgradeCommandRPC(sid, shortName, amount, default(PhotonMessageInfo));
				}
			}
		}

		public static int GetMoney()
		{
			return SemiFunc.StatGetRunCurrency();
		}

		public static void SetMoney(int amount)
		{
			SemiFunc.StatSetRunCurrency(Mathf.Max(0, amount));
		}

		public static void AddToken(int rarity)
		{
			if (Object.op_Implicit((Object)(object)MetaManager.instance))
			{
				MetaManager.instance.CosmeticTokenAdd((Rarity)rarity);
			}
		}

		public static void RemoveToken()
		{
			if (Object.op_Implicit((Object)(object)MetaManager.instance))
			{
				MetaManager.instance.CosmeticTokenRemove();
			}
		}

		public static void ClearAllTokens()
		{
			if (Object.op_Implicit((Object)(object)MetaManager.instance))
			{
				MetaManager.instance.cosmeticTokens.Clear();
				MetaManager.instance.Save();
			}
		}

		public static void UnlockAllCosmetics()
		{
			if (Object.op_Implicit((Object)(object)MetaManager.instance))
			{
				MetaManager.instance.CosmeticUnlockAll();
			}
		}

		public static void ResetCosmetics()
		{
			if (Object.op_Implicit((Object)(object)MetaManager.instance))
			{
				MetaManager.instance.cosmeticUnlocks.Clear();
				MetaManager.instance.Save();
			}
		}

		public static int GetTokenCount()
		{
			return Object.op_Implicit((Object)(object)MetaManager.instance) ? MetaManager.instance.cosmeticTokens.Count : 0;
		}

		public static int GetUnlockedCount()
		{
			return Object.op_Implicit((Object)(object)MetaManager.instance) ? MetaManager.instance.cosmeticUnlocks.Count : 0;
		}

		public static int GetTotalCosmeticsCount()
		{
			return Object.op_Implicit((Object)(object)MetaManager.instance) ? MetaManager.instance.cosmeticAssets.Count : 0;
		}

		public static List<ItemAttributes> LevelItems()
		{
			RefreshObjects();
			return _objItem.Where((ItemAttributes i) => Object.op_Implicit((Object)(object)i)).ToList();
		}

		public static List<EnemyParent> LevelEnemies()
		{
			if (!Object.op_Implicit((Object)(object)EnemyDirector.instance))
			{
				return new List<EnemyParent>();
			}
			return EnemyDirector.instance.enemiesSpawned.Where((EnemyParent e) => Object.op_Implicit((Object)(object)e) && e.Spawned && Object.op_Implicit((Object)(object)e.Enemy)).ToList();
		}

		public static void MoveObject(PhysGrabObject p, Vector3 pos)
		{
			//IL_0012: 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_004d: 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)
			if (Object.op_Implicit((Object)(object)p))
			{
				p.Teleport(pos, ((Component)p).transform.rotation);
				if (Object.op_Implicit((Object)(object)p.rb) && !p.rb.isKinematic)
				{
					p.rb.linearVelocity = Vector3.zero;
					p.rb.angularVelocity = Vector3.zero;
				}
			}
		}

		public static void DestroyObject(PhysGrabObject p)
		{
			if (Object.op_Implicit((Object)(object)p))
			{
				p.DestroyPhysGrabObject();
				_objT = 0f;
			}
		}

		public static void MoveEnemy(EnemyParent ep, Vector3 pos)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)ep) && Object.op_Implicit((Object)(object)ep.Enemy))
			{
				ep.Enemy.EnemyTeleported(pos);
			}
		}

		public static void KillEnemy(EnemyParent ep)
		{
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)ep) && Object.op_Implicit((Object)(object)ep.Enemy) && ep.Enemy.HasHealth && !ep.Enemy.Health.dead)
			{
				ep.Enemy.Health.Hurt(999999, Vector3.up);
			}
		}

		public static void RemoveEnemy(EnemyParent ep)
		{
			_screamers.RemoveAll((Screamer s) => (Object)(object)s.Enemy == (Object)(object)ep);
			DestroyEnemy(ep);
		}

		private static void GodTick(PlayerAvatar a, string sid)
		{
			float value;
			if (a.deadSet)
			{
				if (!DeathLoop.Contains(sid) && !VoidLoop.Contains(sid))
				{
					Revive(a);
				}
			}
			else if (Object.op_Implicit((Object)(object)a.playerHealth) && a.playerHealth.health < a.playerHealth.maxHealth && (!_healT.TryGetValue(sid, out value) || Time.time >= value))
			{
				_healT[sid] = Time.time + 0.5f;
				a.playerHealth.HealOther(a.playerHealth.maxHealth - a.playerHealth.health, false);
			}
		}

		private static void VoidTick(PlayerAvatar a, string sid)
		{
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: 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_00a3: 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_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)
			if (!_voidSt.TryGetValue(sid, out var value))
			{
				value = new LoopState();
				_voidSt[sid] = value;
			}
			if (Time.time < value.Next)
			{
				return;
			}
			Vector3? val = TruckPos();
			if (!val.HasValue)
			{
				return;
			}
			if (a.deadSet)
			{
				if (Object.op_Implicit((Object)(object)a.playerDeathHead) && Object.op_Implicit((Object)(object)a.playerDeathHead.physGrabObject))
				{
					a.playerDeathHead.physGrabObject.Teleport(val.Value + Vector3.up * 0.5f, Quaternion.identity);
				}
				Revive(a);
				value.Phase = 1;
				value.Next = Time.time + 2f;
			}
			else if (value.Phase == 0)
			{
				Teleport(a, VoidPos());
				value.Phase = 1;
				value.Next = Time.time + 2.5f;
			}
			else
			{
				Teleport(a, val.Value);
				value.Phase = 0;
				value.Next = Time.time + 1.5f;
			}
		}

		private static void DeathTick(PlayerAvatar a, string sid)
		{
			if (!_deathSt.TryGetValue(sid, out var value))
			{
				value = new LoopState();
				_deathSt[sid] = value;
			}
			if (!(Time.time < value.Next))
			{
				value.Next = Time.time + 0.5f;
				if (!a.deadSet)
				{
					Kill(a);
				}
				else
				{
					Revive(a);
				}
			}
		}

		private static void ValuablesTick()
		{
			if (!ValuablesWeightless && !ValuablesIndestructible)
			{
				return;
			}
			if (Time.time > _valCacheT)
			{
				_valCacheT = Time.time + 2f;
				_valCache = Object.FindObjectsByType<ValuableObject>((FindObjectsSortMode)0).ToList();
			}
			foreach (ValuableObject item in _valCache)
			{
				if (Object.op_Implicit((Object)(object)item) && Object.op_Implicit((Object)(object)item.physGrabObject))
				{
					if (ValuablesWeightless)
					{
						item.physGrabObject.OverrideMass(0.25f, 0.5f);
					}
					if (ValuablesIndestructible)
					{
						item.physGrabObject.OverrideIndestructible(0.5f);
					}
				}
			}
		}
	}
	internal static class Cn
	{
		private static readonly string[] LevelPrefixes = new string[5] { "manor", "wizard", "arctic", "desert", "museum" };

		private static readonly string[] Raw = new string[356]
		{
			"Animal Crate=动物箱", "3D Printer=3D打印机", "Barrel=桶", "Big Sample=大样本", "Bonsai=盆景", "Calculator=计算器", "Camera=相机", "Centrifuge=离心机", "Coffee Cup=咖啡杯", "Computer=电脑",
			"Creature Leg=怪物腿", "Cryo Pod=冷冻舱", "Eraser=橡皮擦", "Fan=风扇", "Fire Extinguisher=灭火器", "Flamethrower=火焰喷射器", "Flashlight=手电筒", "Guitar=吉他", "HDD=硬盘", "Heavy Water=重水",
			"Ice Block=冰块", "Ice Block Bug=冰封虫子", "Ice Saw=冰锯", "Icepick=冰镐", "Jackhammer=风钻", "Keycard=门禁卡", "Laptop=笔记本电脑", "Petri dish=培养皿", "Phone=电话", "Pill=药丸",
			"Pills=药片", "Propane Tank=丙烷罐", "Sample=样本", "Sample Cooler=样本冷藏箱", "Sample Cooler Wide=宽样本冷藏箱", "Sample Six Pack=六联样本", "Scale=秤", "Science Station=科研工作站", "Server Rack=服务器机柜", "Smartwatch=智能手表",
			"Smart Watch=智能手表", "Snow Bike=雪地摩托", "Stapler=订书机", "Uranium Petri Dish=铀培养皿", "Usb stick=U盘", "VHS=录像带", "Baby Head=婴儿头", "Big Crate=大箱子", "Blue Potion=蓝色药水", "Bookshelf=书架",
			"Boombox=手提音响", "Bottle=瓶子", "Broom=扫帚", "Broom Only=扫帚", "Car=玩具车", "Chomp Book=咬人书", "Clown=小丑像", "Coffin=棺材", "Coin=硬币", "Crown=王冠",
			"Crystal=水晶", "Crystal Ball=水晶球", "Cubic Tower=方块塔", "Culture=培养皿样本", "Cup=杯子", "Backpack=背包", "Banjo=班卓琴", "Bird Cage=鸟笼", "Cowboy action figure=牛仔手办", "Cowboy boot trophy=牛仔靴奖杯",
			"Distilery=蒸馏器", "Distillery=蒸馏器", "Energy Crystal Chunk=能量水晶块", "Explosive Tower=炸药塔", "Fluffy Buddy=毛绒伙伴", "Fossil=化石", "Gold Bar=金条", "Golden Coin=金币", "Golden Horse Shoe=金马蹄铁", "Golden Shovel=金铲子",
			"Golden Wheel=金轮子", "Golden lock=金锁", "Golfcart=高尔夫球车", "Harmonica=口琴", "Horse on wheels=轮子木马", "Lighter=打火机", "Lunch box=饭盒", "Magnet=磁铁", "Mineral case=矿石盒", "Mouth Harp=口簧琴",
			"Pan Flute=排箫", "Popcorn stand=爆米花机", "Post card=明信片", "Rattlesnake=响尾蛇", "Rocking Chair=摇椅", "Shooting Cowboy=射击牛仔", "Sippy cup=吸管杯", "Snake in a can=罐头蛇", "Snow globe=雪花球", "Suitcase=手提箱",
			"Zero Grav crystal=零重力水晶", "Dinosaur=恐龙", "Doll=玩偶", "Dragon Skull=龙头骨", "Emerald Bracelet=祖母绿手镯", "Eye Ball=眼球", "Eye of Orpigox=奥皮戈克斯之眼", "Fish=鱼", "Forever Fire=永恒之火", "Fortune Card=命运卡",
			"Frog=青蛙", "Gem Burger=宝石汉堡", "Globe=地球仪", "Goblet=高脚杯", "Goblin Arm=哥布林手臂", "Golden Pumpkin Big=大金南瓜", "Golden Pumpkin Medium=中金南瓜", "Golden Pumpkin Small=小金南瓜", "Golden Statue=金雕像", "Gramophone=留声机",
			"Grandfather Clock=落地钟", "Handface=手脸雕像", "Harp=竖琴", "Horse=马雕像", "Kettle=水壶", "Levitation Potion=漂浮药水", "Love Orb=爱心宝珠", "Love Potion=爱情药水", "Magic Want=魔杖", "Magic Wand=魔杖",
			"Magnifying Glass=放大镜", "Diamond Display=钻石展柜", "Instrument=乐器", "Map=地图", "Marble Table=大理石桌", "Money=钱袋", "Music Box=音乐盒", "Ocarina=陶笛", "Old Camera=老式相机", "Painting=油画",
			"Piano=钢琴", "Pocket Watch=怀表", "Radio=收音机", "Scream Doll=尖叫娃娃", "Ship in a bottle=瓶中船", "Telescope=望远镜", "Television=电视机", "Toy Monkey=玩具猴", "Trophy=奖杯", "Uranium Mug=铀杯",
			"Uranium Plate=铀盘", "Vase=花瓶", "Vase Big=大花瓶", "Vase Chunky=粗花瓶", "Vase Small=小花瓶", "Banana Bow=香蕉弓", "Blender=搅拌机", "Cocktail=鸡尾酒", "Cool brain=酷炫大脑", "Cube ball=方块球",
			"Cubic Sculpture=方块雕塑", "Egg=彩蛋", "Flesh Blob=肉块", "GoldFish=金鱼", "GoldTooth=金牙", "Golden Swirl=金漩涡", "Gumball=扭蛋机", "MonkeyBox=猴子盒", "Pacifier=奶嘴", "PimpleGuy=痘痘人",
			"Plane=飞机模型", "RubenDoll=鲁本玩偶", "SilverFish=银鱼", "Tall Guy=高个子雕像", "Teeth Bot=牙齿机器人", "Toast=吐司", "Tooth=牙齿", "Traffic Light=红绿灯", "Tray=托盘", "Uranium Mug Deluxe=豪华铀杯",
			"Vinyl=黑胶唱片", "Wire Figure=铁丝人", "Worm=蠕虫", "duck man=鸭子人", "ladybug=瓢虫", "Milk=牛奶", "Pendant=吊坠", "Poison Chalice=毒圣杯", "RACING Barrel=赛车油桶", "Red Mushroom=红蘑菇",
			"Saw Blade=锯片", "Sextant=六分仪", "Spider Potion=蜘蛛药水", "Star Wand=星星魔杖", "Sword=剑", "Tentacle=触手", "Troll Finger=巨魔手指", "Unicorn Horn=独角兽角", "Alchemy Station=炼金台", "Bird Skull=鸟头骨",
			"Bug=虫子", "Cauldron Box=坩埚箱", "Cube of Knowledge=知识魔方", "Diamond=钻石", "Dumgolfs Staff=邓高夫法杖", "Forever Candle=永恒蜡烛", "Gem Box=宝石盒", "Glowing Jar=发光罐", "Goblin Head=哥布林头", "Golden Cauldron=金坩埚",
			"Griffin Statue=狮鹫雕像", "Master Potion=大师药水", "Power Crystal=能量水晶", "Small Gem=小宝石", "Small Potion=小药水", "Staff=法杖", "Time Glass=沙漏", "Small Arctic Golld=小金块", "Small Arctic Camera=小相机", "Small Arctic=小样本",
			"Golld=金块", "Battery=电池", "Cannon=大炮", "Cart Cannon=推车大炮", "Cart Laser=推车激光炮", "Cart Medium=推车", "Cart Small=小推车", "Drone Battery=充电无人机", "Drone Feather=羽毛无人机", "Drone Heal=治疗无人机",
			"Drone Indestructible=无敌无人机", "Drone Torque=扭矩无人机", "Drone Zero Gravity=零重力无人机", "Duck Bucket=鸭子桶", "Extendable Ladder=伸缩梯", "Extraction Tracker=提交点追踪器", "Grenade=手雷", "Grenade Duct Taped=胶带手雷", "Grenade Explosive=手雷", "Grenade Human=人肉手雷",
			"Grenade Shockwave=冲击波手雷", "Grenade Stun=眩晕手雷", "Gun=枪", "Gun Handgun=手枪", "Gun Laser=激光枪", "Gun Revolver=左轮手枪", "Revolver=左轮手枪", "Gun Shockwave=冲击波枪", "Gun Shotgun=霰弹枪", "Shotgun=霰弹枪",
			"Gun Stun=眩晕枪", "Gun Tranq=麻醉枪", "Health Pack Large=大医疗包", "Health Pack Medium=中医疗包", "Health Pack Small=小医疗包", "Hidey Box=躲藏箱", "Laser Cannon=激光炮", "Leaf Blower=吹叶机", "LeafBlower=吹叶机", "Light=灯",
			"Melee Baseball Bat=棒球棍", "Melee Frying Pan=平底锅", "Melee Inflatable Hammer=充气锤", "Melee Sledge Hammer=大锤", "Melee Sledgehammer=大锤", "Melee Stun Baton=电棍", "Stun Baton=电棍", "Melee Sword=剑", "Melee Whip=鞭子", "Mine=地雷",
			"Mine Explosive=爆炸地雷", "Mine Shockwave=冲击波地雷", "Mine Stun=眩晕地雷", "Orb=宝珠", "Orb Battery=充电宝珠", "Orb Feather=羽毛宝珠", "Orb Heal=治疗宝珠", "Orb Indestructible=无敌宝珠", "Orb Magnet=磁力宝珠", "Orb Torque=扭矩宝珠",
			"Orb Zero Gravity=零重力宝珠", "Phase Bridge=相位桥", "ReviveItem=复活道具", "Rubber Duck=橡皮鸭", "Saw=电锯", "Shockwave=冲击波", "Staff Torque=扭矩法杖", "Torque Staff=扭矩法杖", "Staff Void=虚空法杖", "Void Staff=虚空法杖",
			"Staff Zero Gravity=零重力法杖", "Zero Gravity Staff=零重力法杖", "Tracker=追踪器", "Valuable Tracker=贵重物品追踪器", "Upgrade Death Head Battery=升级·死亡头电量", "Upgrade Map Player Count=升级·地图显示人数", "Upgrade Player Crouch Rest=升级·蹲下回体", "Upgrade Player Energy=升级·体力", "Upgrade Player Extra Jump=升级·额外跳跃", "Upgrade Player Grab Range=升级·抓取距离",
			"Upgrade Player Grab Strength=升级·抓取力量", "Upgrade Player Grab Throw=升级·投掷力量", "Upgrade Player Health=升级·生命", "Upgrade Player Sprint Speed=升级·冲刺速度", "Upgrade Player Tumble Climb=升级·翻滚攀爬", "Upgrade Player Tumble Launch=升级·翻滚冲刺", "Upgrade Player Tumble Wings=升级·翻滚之翼", "Valuable Box=贵重物品箱", "Vehicle Scooter=滑板车", "Vehicle Semiscooter=电动滑板车",
			"Vehicle Semiscooter Small=小电动滑板车", "WalkieTalkie=对讲机", "WalkieBox=对讲机箱", "WalkieTalkieBox=对讲机箱", "Box=贵重物品箱", "Legless=无腿雕像", "Stun Baton Variant=电棍", "Power Crystal=能量水晶", "Animal=野兽", "Bang=爆炸怪",
			"Bangy=爆炸怪", "Beamer=激光怪", "Birthday Boy=生日男孩", "Bomb Thrower=掷弹怪", "Bowtie=领结", "Ceiling Eye=天花板之眼", "Duck=鸭子", "Elsa=冰霜女", "Floater=漂浮怪", "Gnome=侏儒",
			"Head=猎头者", "Head Grabber=抱头怪", "Headman=猎头者", "Heart Hugger=抱心怪", "Hidden=潜伏者", "Hunter=猎人", "Mentalist=读心者", "Oogly=欧格利", "Robe