Decompiled source of MightGuy v0.8.1

plugins/MightGuy/MightGuy.dll

Decompiled a day ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization.Json;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using ExtraSkillSlots;
using KinematicCharacterController;
using On.RoR2;
using On.RoR2.UI;
using R2API;
using R2API.Utils;
using Rewired;
using RoR2;
using RoR2.CameraModes;
using RoR2.ContentManagement;
using RoR2.Skills;
using RoR2.UI;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("MightGuy")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+f38781abce43a7173246949b0953c5bd98f0435e")]
[assembly: AssemblyProduct("MightGuy")]
[assembly: AssemblyTitle("MightGuy")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace MightGuyMod;

public static class Snd
{
	private sealed class Speaking
	{
		public float until;

		public int prio;

		public uint id;
	}

	private static readonly Dictionary<int, Speaking> speaking = new Dictionary<int, Speaking>();

	public static uint LastVoiceId;

	public static void Init()
	{
		string path = Path.Combine(Media.Assets, "Audio", "MightGuy.bnk");
		if (File.Exists(path))
		{
			SoundBanks.Add(File.ReadAllBytes(path));
		}
		else
		{
			Plugin.Log.LogWarning((object)"MIGHTGUY_AUDIO bank missing");
		}
	}

	public static uint Sfx(string key, GameObject at)
	{
		if (key != null && !key.StartsWith("S_"))
		{
			key = "S_" + key;
		}
		uint result = (Object.op_Implicit((Object)(object)at) ? AkSoundEngine.PostEvent("Play_MightGuy_" + key, at) : 0u);
		Combat.Trace?.Invoke("SFX Play_MightGuy_" + key + " playingId=" + result + " rt=" + Time.realtimeSinceStartup.ToString("0.000"));
		return result;
	}

	public static uint SfxAt(string key, Vector3 p)
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Expected O, but got Unknown
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = new GameObject("MightGuySfx");
		val.transform.position = p;
		Object.Destroy((Object)(object)val, 6f);
		return Sfx(key, val);
	}

	public static bool Voice(CharacterBody body, string key, float length, bool grunt = false, int prio = -1, bool log = false)
	{
		if (!Object.op_Implicit((Object)(object)body))
		{
			return false;
		}
		int instanceID = ((Object)body).GetInstanceID();
		float time = Time.time;
		if (prio < 0)
		{
			prio = ((!grunt) ? 1 : 0);
		}
		if (!speaking.TryGetValue(instanceID, out var value))
		{
			Dictionary<int, Speaking> dictionary = speaking;
			Speaking obj = new Speaking
			{
				until = -1f
			};
			value = obj;
			dictionary[instanceID] = obj;
		}
		if (time < value.until && prio <= value.prio)
		{
			if (log)
			{
				Plugin.Log.LogInfo((object)("MIGHTGUY_VOICE skip " + key + " busy prio=" + value.prio + " t=" + time.ToString("0.00")));
			}
			return false;
		}
		if (grunt && Random.value > 0.55f)
		{
			return false;
		}
		if (time < value.until && value.id != 0)
		{
			AkSoundEngine.StopPlayingID(value.id, 80);
		}
		bool flag = VoiceLoadout.Get(body) == VoiceLoadout.Lang.English;
		string text = "Play_MightGuy_" + (flag ? "VE_" : "V_") + key;
		uint num = AkSoundEngine.PostEvent(text, ((Component)body).gameObject, 1048576u, (EventCallback)null, (object)null);
		value.until = time + length;
		value.prio = prio;
		value.id = num;
		LastVoiceId = num;
		Combat.Trace?.Invoke("VOICE " + (flag ? "VE_" : "V_") + key + " playingId=" + num + " rt=" + Time.realtimeSinceStartup.ToString("0.000"));
		if (log)
		{
			Plugin.Log.LogInfo((object)("MIGHTGUY_VOICE post " + text + " id=" + num + " t=" + time.ToString("0.00")));
			VoiceProbe.Watch(body, text, num);
		}
		return num != 0;
	}

	public static bool Playing(uint id, out int ms)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Invalid comparison between Unknown and I4
		ms = 0;
		if (id != 0 && (int)AkSoundEngine.GetSourcePlayPosition(id, ref ms, true) == 1)
		{
			return ms > 0;
		}
		return false;
	}
}
public sealed class VoiceProbe : MonoBehaviour
{
	private sealed class W
	{
		public string ev;

		public uint id;

		public float postT;
	}

	private readonly List<W> watch = new List<W>();

	public static float GateSeconds = 15f;

	public float ShowerReadyAt;

	private uint showerPending;

	private float showerPendingUntil;

	private float showerLen;

	public bool ShowerBlocked
	{
		get
		{
			if (showerPending == 0)
			{
				return Time.time < ShowerReadyAt;
			}
			return true;
		}
	}

	public static VoiceProbe For(CharacterBody b)
	{
		if (!Object.op_Implicit((Object)(object)b))
		{
			return null;
		}
		return ((Component)b).GetComponent<VoiceProbe>() ?? ((Component)b).gameObject.AddComponent<VoiceProbe>();
	}

	public static void Watch(CharacterBody b, string ev, uint id)
	{
		VoiceProbe voiceProbe = For(b);
		if (Object.op_Implicit((Object)(object)voiceProbe) && id != 0)
		{
			voiceProbe.watch.Add(new W
			{
				ev = ev,
				id = id,
				postT = Time.time
			});
		}
	}

	public void ObserveShower(uint id, float len)
	{
		if (id != 0)
		{
			showerPending = id;
			showerPendingUntil = Time.time + 1f;
			showerLen = len;
		}
	}

	private void Update()
	{
		if (showerPending != 0)
		{
			if (Snd.Playing(showerPending, out var ms))
			{
				ShowerReadyAt = Time.time - (float)ms / 1000f + showerLen + GateSeconds;
				Plugin.Log.LogInfo((object)("MIGHTGUY_VOICE shower audible id=" + showerPending + " gateUntil=" + ShowerReadyAt.ToString("0.00") + " t=" + Time.time.ToString("0.00")));
				showerPending = 0u;
			}
			else if (Time.time > showerPendingUntil)
			{
				showerPending = 0u;
			}
		}
		for (int num = watch.Count - 1; num >= 0; num--)
		{
			W w = watch[num];
			if (Snd.Playing(w.id, out var ms2))
			{
				Plugin.Log.LogInfo((object)("MIGHTGUY_VOICE audible " + w.ev + " id=" + w.id + " posMs=" + ms2 + " t=" + Time.time.ToString("0.00")));
				watch.RemoveAt(num);
			}
			else if (Time.time - w.postT > 1.5f)
			{
				Plugin.Log.LogInfo((object)("MIGHTGUY_VOICE NOT_PLAYING " + w.ev + " id=" + w.id));
				watch.RemoveAt(num);
			}
		}
	}
}
public static class PrimaryVoice
{
	private sealed class St
	{
		public float last = -999f;

		public int target = -1;
	}

	private static readonly Dictionary<int, St> state = new Dictionary<int, St>();

	public static void Swing(CharacterBody body, int stage, int finisher, string key, float length)
	{
		if (!Object.op_Implicit((Object)(object)body))
		{
			return;
		}
		int instanceID = ((Object)body).GetInstanceID();
		if (!state.TryGetValue(instanceID, out var value))
		{
			value = (state[instanceID] = new St());
		}
		if (stage == 0)
		{
			value.target = ((!(Random.value < Tuning.PrimaryVoiceChance.Value)) ? (-1) : ((!(Random.value < 0.5f)) ? finisher : 0));
			Combat.Trace?.Invoke("PRIMARYVOICE string start plan=" + value.target);
		}
		if (value.target == stage)
		{
			value.target = -1;
			float num = Time.time - value.last;
			if (num < Tuning.PrimaryVoiceCooldown.Value)
			{
				Combat.Trace?.Invoke("PRIMARYVOICE cooldown skip age=" + num.ToString("0.0"));
			}
			else if (Snd.Voice(body, key, length))
			{
				value.last = Time.time;
				Combat.Trace?.Invoke("PRIMARYVOICE played " + key + " stage=" + stage);
			}
		}
	}
}
public sealed class GuyCamTurn : MonoBehaviour
{
	private static MethodInfo getData;

	private static MethodInfo setLook;

	private static bool failed;

	private CameraRigController rig;

	private Vector3 from;

	private Vector3 to;

	private float t0;

	private float dur;

	public static float CutHold = 0.08f;

	public static void Turn(CharacterBody b, Vector3 lookDir, float seconds)
	{
		//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ce: 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)
		if (failed || !Object.op_Implicit((Object)(object)b) || !b.hasEffectiveAuthority || (Object.op_Implicit((Object)(object)b.master) && !Object.op_Implicit((Object)(object)b.master.playerCharacterMasterController)))
		{
			return;
		}
		CameraRigController val = null;
		foreach (CameraRigController readOnlyInstances in CameraRigController.readOnlyInstancesList)
		{
			if (Object.op_Implicit((Object)(object)readOnlyInstances) && (Object)(object)readOnlyInstances.targetBody == (Object)(object)b && readOnlyInstances.localUserViewer != null)
			{
				val = readOnlyInstances;
				break;
			}
		}
		if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.sceneCam))
		{
			GuyCamTurn obj = ((Component)b).GetComponent<GuyCamTurn>() ?? ((Component)b).gameObject.AddComponent<GuyCamTurn>();
			obj.rig = val;
			obj.from = ((Component)val.sceneCam).transform.forward;
			obj.to = ((Vector3)(ref lookDir)).normalized;
			obj.t0 = Time.time;
			obj.dur = ((seconds <= 0f) ? 0f : Mathf.Max(0.05f, seconds));
			((Behaviour)obj).enabled = true;
		}
	}

	private static object Data(CameraRigController rig)
	{
		try
		{
			CameraModeBase cameraMode = rig.cameraMode;
			if (cameraMode == null)
			{
				return null;
			}
			if (getData == null)
			{
				getData = typeof(CameraModeBase).GetMethod("DebugGetInstanceData", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			}
			object obj = ((getData != null) ? getData.Invoke(cameraMode, new object[1] { rig }) : null);
			if (obj == null)
			{
				return null;
			}
			if (setLook == null)
			{
				setLook = obj.GetType().GetMethod("SetPitchYawFromLookVector", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			}
			return (setLook != null) ? obj : null;
		}
		catch (Exception ex)
		{
			failed = true;
			Plugin.Log.LogWarning((object)("MIGHTGUY_CAMTURN off: " + ex.Message));
			return null;
		}
	}

	private void LateUpdate()
	{
		//IL_006c: 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_0078: 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_008c: Unknown result type (might be due to invalid IL or missing references)
		if (!Object.op_Implicit((Object)(object)rig))
		{
			((Behaviour)this).enabled = false;
			return;
		}
		float num = ((dur <= 0f) ? 1f : Mathf.Clamp01((Time.time - t0) / dur));
		float num2 = num * num * (3f - 2f * num);
		object obj = Data(rig);
		if (obj == null)
		{
			((Behaviour)this).enabled = false;
			return;
		}
		Vector3 val = Vector3.Slerp(from, to, num2);
		try
		{
			setLook.Invoke(obj, new object[1] { val });
		}
		catch (Exception ex)
		{
			failed = true;
			Plugin.Log.LogWarning((object)("MIGHTGUY_CAMTURN off: " + ex.Message));
			((Behaviour)this).enabled = false;
			return;
		}
		if (num >= 1f && (dur > 0f || Time.time - t0 > CutHold))
		{
			((Behaviour)this).enabled = false;
		}
	}
}
public static class Combat
{
	public sealed class SpreadDealer : MonoBehaviour
	{
		public CharacterBody attacker;

		public Vector3 center;

		public float coef;

		public float proc;

		public float force;

		public float upward;

		public DamageType type;

		public bool crit;

		public string source;

		public DamageSource damageSource;

		public readonly List<HurtBox> targets = new List<HurtBox>();

		private void FixedUpdate()
		{
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: 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_006c: 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_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			int num = 0;
			while (targets.Count > 0 && num < PerStep)
			{
				HurtBox val = targets[0];
				targets.RemoveAt(0);
				if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.healthComponent) && val.healthComponent.alive && Object.op_Implicit((Object)(object)attacker))
				{
					num++;
					Vector3 val2 = Point(val, center);
					Vector3 val3 = val2 - center;
					val3.y = 0f;
					val3 = ((((Vector3)(ref val3)).sqrMagnitude < 0.01f) ? Vector3.up : ((Vector3)(ref val3)).normalized);
					Source = source;
					CharacterBody obj = attacker;
					float coefficient = coef;
					float num2 = proc;
					bool num3 = crit;
					Vector3 val4 = val3 + Vector3.up * upward;
					Deal(obj, val, val2, coefficient, num2, num3, ((Vector3)(ref val4)).normalized * force, type, null, (DamageColorIndex)0, damageSource);
				}
			}
			if (targets.Count == 0 || !Object.op_Implicit((Object)(object)attacker))
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}
	}

	public static Action<string> Trace;

	public static string Source = "";

	public static bool Big;

	private static readonly Collider[] buffer = (Collider[])(object)new Collider[512];

	public static float Tally;

	public static float TallyProc;

	public static int TallyHits;

	public static int PerStep = 6;

	private static readonly RaycastHit[] rayHits = (RaycastHit[])(object)new RaycastHit[32];

	public static bool Target(HurtBox hurt, CharacterBody attacker)
	{
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: 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_00ae: Unknown result type (might be due to invalid IL or missing references)
		if (!Object.op_Implicit((Object)(object)hurt) || !Object.op_Implicit((Object)(object)hurt.healthComponent) || !hurt.healthComponent.alive || !Object.op_Implicit((Object)(object)attacker) || !Object.op_Implicit((Object)(object)attacker.teamComponent) || (Object)(object)hurt.healthComponent == (Object)(object)attacker.healthComponent)
		{
			return false;
		}
		CharacterBody body = hurt.healthComponent.body;
		if (((Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.teamComponent)) ? body.teamComponent.teamIndex : hurt.teamIndex) == attacker.teamComponent.teamIndex || hurt.teamIndex == attacker.teamComponent.teamIndex)
		{
			return false;
		}
		return FriendlyFireManager.ShouldDirectHitProceed(hurt.healthComponent, attacker.teamComponent.teamIndex);
	}

	public static bool TargetBody(CharacterBody victim, CharacterBody attacker)
	{
		//IL_0058: 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_0068: Invalid comparison between I4 and Unknown
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		if (!Object.op_Implicit((Object)(object)victim) || !Object.op_Implicit((Object)(object)attacker) || (Object)(object)victim == (Object)(object)attacker || !Object.op_Implicit((Object)(object)victim.healthComponent) || !victim.healthComponent.alive || !Object.op_Implicit((Object)(object)attacker.teamComponent))
		{
			return false;
		}
		if (((!Object.op_Implicit((Object)(object)victim.teamComponent)) ? (-1) : ((int)victim.teamComponent.teamIndex)) == (int)attacker.teamComponent.teamIndex)
		{
			return false;
		}
		return FriendlyFireManager.ShouldDirectHitProceed(victim.healthComponent, attacker.teamComponent.teamIndex);
	}

	public static bool Visible(Vector3 a, Vector3 b)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		return !Physics.Linecast(a, b, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1);
	}

	public static Vector3 Point(HurtBox h, Vector3 from)
	{
		//IL_0031: 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_002a: 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)
		Collider val = (Object.op_Implicit((Object)(object)h) ? h.collider : null);
		if (!Object.op_Implicit((Object)(object)val))
		{
			if (!Object.op_Implicit((Object)(object)h))
			{
				return from;
			}
			return ((Component)h).transform.position;
		}
		return val.ClosestPoint(from);
	}

	public unsafe static bool Deal(CharacterBody attacker, HurtBox hurt, Vector3 position, float coefficient, float proc, bool crit, Vector3 force, DamageType type = (DamageType)0u, GameObject inflictor = null, DamageColorIndex color = (DamageColorIndex)0, DamageSource damageSource = (DamageSource)0)
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: 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_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: 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_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_006c: 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_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_007e: Unknown result type (might be due to invalid IL or missing references)
		//IL_007f: 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)
		//IL_0087: Expected O, but got Unknown
		//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0109: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkServer.active || !Target(hurt, attacker))
		{
			return false;
		}
		DamageInfo val = new DamageInfo
		{
			attacker = ((Component)attacker).gameObject,
			inflictor = (Object.op_Implicit((Object)(object)inflictor) ? inflictor : ((Component)attacker).gameObject),
			damage = attacker.damage * coefficient,
			crit = crit,
			position = position,
			force = force,
			procCoefficient = proc,
			damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit(type), (DamageTypeExtended)0, damageSource),
			damageColorIndex = color
		};
		HealthComponent healthComponent = hurt.healthComponent;
		float combinedHealth = healthComponent.combinedHealth;
		healthComponent.TakeDamage(val);
		if (!val.rejected)
		{
			Tally += combinedHealth - healthComponent.combinedHealth;
			TallyHits++;
			TallyProc += proc;
		}
		if (!val.rejected)
		{
			GlobalEventManager instance = GlobalEventManager.instance;
			if (instance != null)
			{
				instance.OnHitEnemy(val, ((Component)healthComponent).gameObject);
			}
			GlobalEventManager instance2 = GlobalEventManager.instance;
			if (instance2 != null)
			{
				instance2.OnHitAll(val, ((Component)healthComponent).gameObject);
			}
			try
			{
				MangaHit.OnHit(attacker, healthComponent, position, Source, Big);
			}
			catch (Exception ex)
			{
				Plugin.Log.LogWarning((object)("MIGHTGUY_MANGA " + ex.Message));
			}
		}
		if (Trace != null)
		{
			Trace("DAMAGE source=" + Source + " slot=" + ((object)(*(DamageSource*)(&damageSource))/*cast due to .constrained prefix*/).ToString() + " victim=" + (Object.op_Implicit((Object)(object)healthComponent.body) ? ((Object)healthComponent.body).name : ((Object)healthComponent).name) + " team=" + ((Object.op_Implicit((Object)(object)healthComponent.body) && Object.op_Implicit((Object)(object)healthComponent.body.teamComponent)) ? ((object)healthComponent.body.teamComponent.teamIndex/*cast due to .constrained prefix*/).ToString() : "?") + " coef=" + coefficient.ToString("0.00") + " loss=" + (combinedHealth - healthComponent.combinedHealth).ToString("0.0") + " rejected=" + val.rejected);
		}
		return !val.rejected;
	}

	public static int Capsule(CharacterBody attacker, Vector3 a, Vector3 b, float radius, List<HurtBox> into, HashSet<HealthComponent> exclude)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0001: 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)
		int num = Physics.OverlapCapsuleNonAlloc(a, b, radius, buffer, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)2);
		int num2 = 0;
		for (int i = 0; i < num; i++)
		{
			HurtBox component = ((Component)buffer[i]).GetComponent<HurtBox>();
			if (!Target(component, attacker) || exclude.Contains(component.healthComponent))
			{
				continue;
			}
			bool flag = false;
			foreach (HurtBox item in into)
			{
				if ((Object)(object)item.healthComponent == (Object)(object)component.healthComponent)
				{
					flag = true;
					break;
				}
			}
			if (!flag)
			{
				into.Add(component);
				num2++;
			}
		}
		return num2;
	}

	public static List<HurtBox> Around(CharacterBody attacker, Vector3 origin, float radius, bool sight = true)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: 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_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_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_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: 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)
		Dictionary<HealthComponent, HurtBox> dictionary = new Dictionary<HealthComponent, HurtBox>();
		int num = Physics.OverlapSphereNonAlloc(origin, radius, buffer, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)2);
		for (int i = 0; i < num; i++)
		{
			HurtBox component = ((Component)buffer[i]).GetComponent<HurtBox>();
			if (!Target(component, attacker))
			{
				continue;
			}
			Vector3 val = buffer[i].ClosestPoint(origin);
			Vector3 val2;
			if (sight)
			{
				val2 = val - origin;
				if (((Vector3)(ref val2)).sqrMagnitude > 0.25f && !Visible(origin, val))
				{
					continue;
				}
			}
			if (dictionary.TryGetValue(component.healthComponent, out var value))
			{
				val2 = Point(component, origin) - origin;
				float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude;
				val2 = Point(value, origin) - origin;
				if (!(sqrMagnitude < ((Vector3)(ref val2)).sqrMagnitude))
				{
					continue;
				}
			}
			dictionary[component.healthComponent] = component;
		}
		List<HurtBox> list = new List<HurtBox>(dictionary.Values);
		list.Sort(delegate(HurtBox x, HurtBox y)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: 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_0017: 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_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: 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)
			Vector3 val3 = Point(x, origin) - origin;
			float sqrMagnitude2 = ((Vector3)(ref val3)).sqrMagnitude;
			val3 = Point(y, origin) - origin;
			return sqrMagnitude2.CompareTo(((Vector3)(ref val3)).sqrMagnitude);
		});
		return list;
	}

	public static int Blast(CharacterBody attacker, Vector3 center, float radius, float coefficient, float proc, float force, DamageType type = (DamageType)0u, HashSet<HealthComponent> once = null, GameObject inflictor = null, float upward = 0.35f, DamageSource damageSource = (DamageSource)0, bool sight = true)
	{
		//IL_001b: 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_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_0053: 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_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: 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_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a2: 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_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 (!NetworkServer.active || !Object.op_Implicit((Object)(object)attacker))
		{
			return 0;
		}
		bool crit = attacker.RollCrit();
		int num = 0;
		foreach (HurtBox item in Around(attacker, center, radius, sight))
		{
			if (once == null || once.Add(item.healthComponent))
			{
				Vector3 val = Point(item, center);
				Vector3 val2 = val - center;
				val2.y = 0f;
				val2 = ((((Vector3)(ref val2)).sqrMagnitude < 0.01f) ? Vector3.up : ((Vector3)(ref val2)).normalized);
				Vector3 val3 = val2 + Vector3.up * upward;
				if (Deal(attacker, item, val, coefficient, proc, crit, ((Vector3)(ref val3)).normalized * force, type, inflictor, (DamageColorIndex)0, damageSource))
				{
					num++;
				}
			}
		}
		return num;
	}

	public static int BlastSpread(CharacterBody attacker, Vector3 center, float radius, float coefficient, float proc, float force, DamageType type = (DamageType)0u, float upward = 0.35f, string source = null, DamageSource damageSource = (DamageSource)0)
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_005a: 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_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkServer.active || !Object.op_Implicit((Object)(object)attacker))
		{
			return 0;
		}
		List<HurtBox> list = Around(attacker, center, radius);
		if (list.Count == 0)
		{
			return 0;
		}
		SpreadDealer spreadDealer = new GameObject("MightGuyBlastSpread").AddComponent<SpreadDealer>();
		spreadDealer.attacker = attacker;
		spreadDealer.center = center;
		spreadDealer.coef = coefficient;
		spreadDealer.proc = proc;
		spreadDealer.force = force;
		spreadDealer.type = type;
		spreadDealer.upward = upward;
		spreadDealer.crit = attacker.RollCrit();
		spreadDealer.source = source ?? Source;
		spreadDealer.damageSource = damageSource;
		spreadDealer.targets.AddRange(list);
		return list.Count;
	}

	public static bool AimHit(Ray ray, CharacterBody owner, float range, out RaycastHit best, bool entities = true)
	{
		//IL_0001: 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_0028: 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_0050: 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_00b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		best = default(RaycastHit);
		float num = float.MaxValue;
		int num2 = LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | (entities ? LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask) : 0);
		int num3 = Physics.RaycastNonAlloc(ray, rayHits, range, num2, (QueryTriggerInteraction)1);
		for (int i = 0; i < num3; i++)
		{
			RaycastHit val = rayHits[i];
			if (((RaycastHit)(ref val)).distance >= num || !Object.op_Implicit((Object)(object)((RaycastHit)(ref val)).collider))
			{
				continue;
			}
			HurtBox component = ((Component)((RaycastHit)(ref val)).collider).GetComponent<HurtBox>();
			if (Object.op_Implicit((Object)(object)component))
			{
				if (!Target(component, owner))
				{
					continue;
				}
			}
			else if (Object.op_Implicit((Object)(object)owner) && ((Component)((RaycastHit)(ref val)).collider).transform.IsChildOf(((Component)owner).gameObject.transform))
			{
				continue;
			}
			best = val;
			num = ((RaycastHit)(ref val)).distance;
		}
		return num < float.MaxValue;
	}

	public static int Box(CharacterBody attacker, Vector3 center, Vector3 half, Quaternion rot, Dictionary<HealthComponent, HurtBox> into)
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_000e: 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)
		into.Clear();
		int num = Physics.OverlapBoxNonAlloc(center, half, buffer, rot, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)2);
		for (int i = 0; i < num; i++)
		{
			HurtBox component = ((Component)buffer[i]).GetComponent<HurtBox>();
			if (Target(component, attacker) && (!into.ContainsKey(component.healthComponent) || component.isBullseye))
			{
				into[component.healthComponent] = component;
			}
		}
		return into.Count;
	}

	public static List<HurtBox> Cone(CharacterBody attacker, Vector3 origin, Vector3 dir, float range, float halfAngle, bool sight = false)
	{
		//IL_0008: 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_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: 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_003e: 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_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_0066: 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)
		List<HurtBox> list = new List<HurtBox>();
		dir = ((Vector3)(ref dir)).normalized;
		float num = Mathf.Cos(halfAngle * (MathF.PI / 180f));
		foreach (HurtBox item in Around(attacker, origin, range, sight))
		{
			Vector3 val = Point(item, origin) - origin;
			float magnitude = ((Vector3)(ref val)).magnitude;
			if (magnitude < 2.5f || Vector3.Dot(val / Mathf.Max(0.01f, magnitude), dir) >= num)
			{
				list.Add(item);
			}
		}
		return list;
	}

	public static List<HurtBox> Front(CharacterBody attacker, Vector3 origin, Vector3 fwd, float range, float halfAngle, float minUp, float maxUp)
	{
		//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_002a: 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_0035: 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_0044: 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_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: 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)
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ce: 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)
		List<HurtBox> list = new List<HurtBox>();
		fwd.y = 0f;
		fwd = ((Vector3)(ref fwd)).normalized;
		float num = Mathf.Cos(halfAngle * (MathF.PI / 180f));
		foreach (HurtBox item in Around(attacker, origin + Vector3.up * (minUp + maxUp) * 0.5f, Mathf.Sqrt(range * range + (maxUp - minUp) * (maxUp - minUp) * 0.25f), sight: false))
		{
			Vector3 val = Point(item, origin) - origin;
			float y = val.y;
			val.y = 0f;
			float magnitude = ((Vector3)(ref val)).magnitude;
			if (!(y < minUp) && !(y > maxUp) && !(magnitude > range) && (magnitude < 2f || Vector3.Dot(val / Mathf.Max(0.01f, magnitude), fwd) >= num))
			{
				list.Add(item);
			}
		}
		return list;
	}

	public static Vector3 Ground(Vector3 p, float down = 60f)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: 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_0038: 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)
		RaycastHit val = default(RaycastHit);
		if (!Physics.Raycast(p + Vector3.up * 3f, Vector3.down, ref val, down, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1))
		{
			return p;
		}
		return ((RaycastHit)(ref val)).point;
	}

	public static bool TryGround(Vector3 p, float down, out Vector3 g)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: 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_0044: 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_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)
		RaycastHit val = default(RaycastHit);
		if (Physics.Raycast(p + Vector3.up * 1.5f, Vector3.down, ref val, down, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1))
		{
			g = ((RaycastHit)(ref val)).point;
			return true;
		}
		g = p;
		return false;
	}

	public static bool IsHeavy(CharacterBody b)
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)b))
		{
			if (!b.isChampion && !b.isBoss && (int)b.hullClassification == 0 && (!Object.op_Implicit((Object)(object)b.characterMotor) || !(b.characterMotor.mass >= 300f)))
			{
				if (Object.op_Implicit((Object)(object)b.rigidbody))
				{
					return b.rigidbody.mass >= 300f;
				}
				return false;
			}
			return true;
		}
		return false;
	}

	public static float Mass(CharacterBody b)
	{
		if (!Object.op_Implicit((Object)(object)b.characterMotor))
		{
			if (!Object.op_Implicit((Object)(object)b.rigidbody))
			{
				return 100f;
			}
			return b.rigidbody.mass;
		}
		return b.characterMotor.mass;
	}
}
public sealed class Strike
{
	public string clip;

	public float s;

	public float hit;

	public float e;

	public float tail;

	public float hold;

	public float[] extra;

	public float carry;

	public float lift;

	public bool fin;

	public bool kick;

	public bool heavy;

	public string fx = "punch";

	public float reachMul = 1f;

	public float yaw;
}
public enum Chain : byte
{
	BaseGround,
	BaseAir,
	SeventhGround,
	SeventhAir,
	EighthGround,
	EighthAir
}
public static class Chains
{
	public static readonly Strike[][] All = new Strike[6][]
	{
		new Strike[5]
		{
			new Strike
			{
				clip = "cmb00",
				s = 0f,
				hit = 5f,
				e = 10f,
				tail = 22f
			},
			new Strike
			{
				clip = "cmb01",
				s = 0f,
				hit = 6f,
				e = 11f,
				tail = 22f
			},
			new Strike
			{
				clip = "cmb02",
				s = 0f,
				hit = 6f,
				e = 12f,
				tail = 26f,
				kick = true,
				fx = "kick"
			},
			new Strike
			{
				clip = "cmb04",
				s = 0f,
				hit = 8f,
				e = 13f,
				tail = 24f,
				carry = 4f
			},
			new Strike
			{
				clip = "cmb06",
				s = 0f,
				hit = 11f,
				e = 20f,
				tail = 38f,
				hold = 0.42f,
				fin = true,
				heavy = true,
				fx = "backfist"
			}
		},
		new Strike[4]
		{
			new Strike
			{
				clip = "cma00",
				s = 0f,
				hit = 5f,
				e = 9f,
				tail = 18f
			},
			new Strike
			{
				clip = "cma01",
				s = 0f,
				hit = 7f,
				e = 11f,
				tail = 22f,
				kick = true,
				fx = "kick"
			},
			new Strike
			{
				clip = "cma02",
				s = 0f,
				hit = 6f,
				e = 10f,
				tail = 20f
			},
			new Strike
			{
				clip = "cma03",
				s = 0f,
				hit = 14f,
				e = 20f,
				tail = 38f,
				fin = true,
				kick = true,
				fx = "spin",
				extra = new float[1] { 5f },
				reachMul = 1.25f
			}
		},
		new Strike[4]
		{
			new Strike
			{
				clip = "cmb12",
				s = 0f,
				hit = 6f,
				e = 10f,
				tail = 12f
			},
			new Strike
			{
				clip = "cmb12",
				s = 12f,
				hit = 19f,
				e = 22f,
				tail = 26f
			},
			new Strike
			{
				clip = "cmb14",
				s = 0f,
				hit = 7f,
				e = 11f,
				tail = 24f,
				kick = true,
				fx = "kick",
				lift = 6f
			},
			new Strike
			{
				clip = "cmb17",
				s = 14f,
				hit = 27f,
				e = 29f,
				tail = 31f,
				hold = 0.26f,
				fin = true,
				kick = true,
				heavy = true,
				fx = "heel"
			}
		},
		new Strike[3]
		{
			new Strike
			{
				clip = "cmb15",
				s = 0f,
				hit = 6f,
				e = 10f,
				tail = 16f,
				kick = true,
				fx = "kick"
			},
			new Strike
			{
				clip = "cmb13",
				s = 15f,
				hit = 24f,
				e = 28f,
				tail = 30f,
				kick = true,
				fx = "kick",
				lift = 5f
			},
			new Strike
			{
				clip = "cmb13",
				s = 30f,
				hit = 38f,
				e = 41f,
				tail = 55f,
				fin = true,
				kick = true,
				heavy = true,
				fx = "axe",
				reachMul = 1.2f
			}
		},
		new Strike[4]
		{
			new Strike
			{
				clip = "awsatk00",
				s = 0f,
				hit = 4f,
				e = 8f,
				tail = 16f,
				yaw = 12f
			},
			new Strike
			{
				clip = "awsatk01",
				s = 0f,
				hit = 12f,
				e = 16f,
				tail = 30f,
				kick = true,
				fx = "kick",
				carry = 9f,
				extra = new float[1] { 8f },
				yaw = 15f
			},
			new Strike
			{
				clip = "awsatk02",
				s = 0f,
				hit = 10f,
				e = 14f,
				tail = 22f,
				fx = "pressure",
				yaw = 30f
			},
			new Strike
			{
				clip = "awsatk03",
				s = 0f,
				hit = 15f,
				e = 20f,
				tail = 42f,
				hold = 0.2f,
				fin = true,
				heavy = true,
				fx = "airfist",
				extra = new float[1] { 5f },
				yaw = 22f
			}
		},
		new Strike[3]
		{
			new Strike
			{
				clip = "awsata00",
				s = 0f,
				hit = 4f,
				e = 8f,
				tail = 14f,
				yaw = 15f
			},
			new Strike
			{
				clip = "awsata01",
				s = 0f,
				hit = 5f,
				e = 9f,
				tail = 18f,
				kick = true,
				fx = "kick",
				yaw = 25f
			},
			new Strike
			{
				clip = "awsata02",
				s = 0f,
				hit = 37f,
				e = 41f,
				tail = 52f,
				fin = true,
				heavy = true,
				fx = "flurry",
				extra = new float[6] { 4f, 12f, 16f, 20f, 24f, 28f },
				yaw = 5f
			}
		}
	};

	public static bool Air(Chain c)
	{
		if (c != Chain.BaseAir && c != Chain.SeventhAir)
		{
			return c == Chain.EighthAir;
		}
		return true;
	}

	public static Chain Pick(GuyForm f, bool grounded)
	{
		switch (f)
		{
		default:
			if (!grounded)
			{
				return Chain.BaseAir;
			}
			return Chain.BaseGround;
		case GuyForm.Seventh:
			if (!grounded)
			{
				return Chain.SeventhAir;
			}
			return Chain.SeventhGround;
		case GuyForm.Eighth:
			if (!grounded)
			{
				return Chain.EighthAir;
			}
			return Chain.EighthGround;
		}
	}
}
public sealed class GuyComboMemory : MonoBehaviour
{
	public Chain chain;

	public int next;

	public float lastEnd = -9f;

	public static GuyComboMemory For(CharacterBody b)
	{
		return ((Component)b).GetComponent<GuyComboMemory>() ?? ((Component)b).gameObject.AddComponent<GuyComboMemory>();
	}

	public static void Reset(CharacterBody b)
	{
		if (Object.op_Implicit((Object)(object)b))
		{
			GuyComboMemory guyComboMemory = For(b);
			guyComboMemory.next = 0;
			guyComboMemory.lastEnd = -9f;
		}
	}
}
public sealed class GuyStrike : BaseSkillState
{
	public static float ChainAt = 0.7f;

	public static float BufferFrom = 0.2f;

	public static float ResetAfter = 0.75f;

	public static float YawFix = 1f;

	public int stage;

	public Chain chain;

	public bool chained;

	private Strike sp;

	private float duration;

	private float hitAge;

	private float enterFixed;

	private float yaw;

	private float pitch;

	private bool fired;

	private bool queued;

	private bool slowLifted;

	private bool grounded;

	private int extraFired;

	private Gesture gest;

	private OneClick click;

	private float Scale => Tuning.M1Speed.Value * ChainTime(chain) / Mathf.Max(0.1f, ((BaseState)this).attackSpeedStat);

	public static float ChainTime(Chain c)
	{
		if (c != Chain.EighthAir)
		{
			if ((int)c < 4)
			{
				if ((int)c < 2)
				{
					return 1f;
				}
				return Tuning.M1SeventhTime.Value;
			}
			return Tuning.M1EighthTime.Value;
		}
		return Tuning.M1EighthAirTime.Value;
	}

	public override void OnEnter()
	{
		//IL_00a4: 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_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_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_026c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0271: Unknown result type (might be due to invalid IL or missing references)
		//IL_0276: Unknown result type (might be due to invalid IL or missing references)
		//IL_0117: Unknown result type (might be due to invalid IL or missing references)
		//IL_011e: Unknown result type (might be due to invalid IL or missing references)
		//IL_010f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0102: Unknown result type (might be due to invalid IL or missing references)
		//IL_0114: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_05b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_05b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_05f1: Unknown result type (might be due to invalid IL or missing references)
		((BaseState)this).OnEnter();
		GuyFall.Protect(((EntityState)this).characterBody, 1.5f);
		if (((EntityState)this).isAuthority)
		{
			GuyComboMemory guyComboMemory = GuyComboMemory.For(((EntityState)this).characterBody);
			bool flag = Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).characterMotor.isGrounded;
			if (Time.time - guyComboMemory.lastEnd > ResetAfter || guyComboMemory.next == 0)
			{
				guyComboMemory.chain = Chains.Pick(GuyGates.Form(((EntityState)this).characterBody), flag);
				guyComboMemory.next = 0;
			}
			chain = guyComboMemory.chain;
			stage = guyComboMemory.next;
			Ray aimRay = ((BaseState)this).GetAimRay();
			Vector3 val = ((Ray)(ref aimRay)).direction;
			pitch = Mathf.Asin(Mathf.Clamp(val.y, -1f, 1f)) * 57.29578f;
			val.y = 0f;
			if (((Vector3)(ref val)).sqrMagnitude < 0.0001f)
			{
				val = (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? ((EntityState)this).characterDirection.forward : Vector3.forward);
			}
			yaw = Mathf.Atan2(val.x, val.z) * 57.29578f;
		}
		Strike[] array = Chains.All[(uint)chain];
		stage = Mathf.Clamp(stage, 0, array.Length - 1);
		sp = array[stage];
		float num = (sp.hit - sp.s) / 30f;
		float num2 = (sp.e - sp.hit) / 30f;
		hitAge = Mathf.Max(0.06f, num * 0.8f) * Scale;
		duration = hitAge + (Mathf.Max(0.1f, num2) + sp.hold * (sp.fin ? 1f : 0f) + 0.1f) * Scale;
		enterFixed = Time.fixedTime;
		click = new OneClick(chained);
		grounded = Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).characterMotor.isGrounded;
		if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
		{
			((EntityState)this).characterDirection.forward = Quaternion.Euler(0f, yaw, 0f) * Vector3.forward;
		}
		((EntityState)this).characterBody.SetAimTimer(duration + 0.5f);
		((BaseState)this).StartAimMode(duration + 0.3f, false);
		if (!Chains.Air(chain))
		{
			ComboSlow.Set(((EntityState)this).characterBody, duration);
		}
		CharVisual charVisual = CharVisual.Find(((EntityState)this).characterBody);
		if (Object.op_Implicit((Object)(object)charVisual) && Object.op_Implicit((Object)(object)charVisual.Anim) && TrackedReference.op_Implicit((TrackedReference)(object)charVisual.Anim[sp.clip]))
		{
			float num3 = hitAge + num2 * Scale * 0.95f;
			float num4 = (sp.tail - sp.e) / 30f / 1.5f * Scale;
			gest = new Gesture
			{
				clip = sp.clip,
				startF = sp.s,
				endF = sp.e,
				hitF = sp.hit,
				hitFrac = hitAge / num3,
				tailF = sp.tail,
				tailSeconds = num4,
				holdSeconds = sp.hold * Scale,
				playSeconds = num3,
				duration = num3 + sp.hold * Scale + num4 + 0.08f,
				fadeIn = Mathf.Min(0.06f, hitAge * 0.5f),
				fadeOut = 0.14f,
				fullBodyWhenStill = true,
				commit = sp.fin,
				yawDeg = sp.yaw * YawFix
			};
			gest.legsFrom = 0f;
			gest.legsUntil = num3 + sp.hold * Scale + num4 * 0.6f;
			charVisual.PlayGesture(gest, Mathf.Max(0.03f, Mathf.Min(0.08f * Scale, hitAge * 0.6f)));
			SpeedLines.Attach(charVisual, ((int)chain >= 4) ? GuyForm.Eighth : (((int)chain >= 2) ? GuyForm.Seventh : GuyForm.Base), hitAge + 0.14f);
		}
		Snd.Sfx(sp.heavy ? "SwingL" : (sp.kick ? "SwingK" : "SwingS"), ((EntityState)this).gameObject);
		if (sp.fin)
		{
			PrimaryVoice.Swing(((EntityState)this).characterBody, stage, stage, "Atk3", 0.7f);
		}
		else if (stage == 0)
		{
			PrimaryVoice.Swing(((EntityState)this).characterBody, 0, 9, "Atk1", 0.5f);
		}
		if (Chains.Air(chain) && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).isAuthority)
		{
			Vector3 velocity = ((EntityState)this).characterMotor.velocity;
			velocity.y = Mathf.Max(velocity.y, (sp.lift > 0f) ? sp.lift : 1.5f);
			((EntityState)this).characterMotor.velocity = velocity;
		}
	}

	public override void FixedUpdate()
	{
		//IL_0027: 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_03db: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0201: Unknown result type (might be due to invalid IL or missing references)
		//IL_0202: Unknown result type (might be due to invalid IL or missing references)
		//IL_0154: Unknown result type (might be due to invalid IL or missing references)
		//IL_0159: Unknown result type (might be due to invalid IL or missing references)
		//IL_015e: Unknown result type (might be due to invalid IL or missing references)
		//IL_016e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0183: Unknown result type (might be due to invalid IL or missing references)
		//IL_0188: Unknown result type (might be due to invalid IL or missing references)
		//IL_018b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0198: 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_00ba: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
		{
			Vector3 velocity = ((EntityState)this).characterMotor.velocity;
			if (Chains.Air(chain) && !((EntityState)this).characterMotor.isGrounded && ((EntityState)this).fixedAge < duration)
			{
				float value = Tuning.M1AirHang.Value;
				velocity.y += (0f - Physics.gravity.y) * (1f - value) * Time.fixedDeltaTime;
				if (sp.fx != "axe" && sp.fx != "flurry")
				{
					velocity.y = Mathf.Max(velocity.y, -3f);
				}
			}
			if (sp.fx == "axe" && ((EntityState)this).fixedAge >= hitAge * 0.7f && !((EntityState)this).characterMotor.isGrounded)
			{
				velocity.y = Mathf.Min(velocity.y, -24f);
			}
			if (sp.carry > 0f && ((EntityState)this).fixedAge < hitAge + 0.05f)
			{
				Vector3 val = Quaternion.Euler(0f, yaw, 0f) * Vector3.forward * sp.carry / Mathf.Max(0.3f, Scale);
				velocity.x = val.x;
				velocity.z = val.z;
			}
			if (sp.fx == "backfist" && grounded && ((EntityState)this).characterMotor.isGrounded && ((EntityState)this).fixedAge >= hitAge * 0.7f)
			{
				velocity.x = 0f;
				velocity.z = 0f;
			}
			((EntityState)this).characterMotor.velocity = velocity;
		}
		if (sp.extra != null)
		{
			while (extraFired < sp.extra.Length && ((EntityState)this).fixedAge >= Mathf.Max(0.02f, (sp.extra[extraFired] - sp.s) / 30f * 0.8f * Scale))
			{
				extraFired++;
				if (NetworkServer.active)
				{
					Hit(main: false, (sp.fx == "flurry") ? Tuning.M1FlurryExtra.Value : 0.45f);
				}
			}
		}
		if (!fired && ((EntityState)this).fixedAge >= hitAge)
		{
			fired = true;
			if (NetworkServer.active)
			{
				Hit(main: true, 1f);
			}
			if (sp.fin && gest != null)
			{
				gest.Pause(sp.heavy ? 0.07f : 0.045f);
			}
			GuyFx.StrikeFx(((EntityState)this).characterBody, sp, chain, yaw, pitch);
			if (((EntityState)this).isAuthority)
			{
				GuyComboMemory guyComboMemory = GuyComboMemory.For(((EntityState)this).characterBody);
				guyComboMemory.next = ((!sp.fin) ? (stage + 1) : 0);
				guyComboMemory.lastEnd = Time.time + Mathf.Max(0f, duration - ((EntityState)this).fixedAge);
				M1Gate.Set(((EntityState)this).characterBody, enterFixed + duration * ChainAt + Time.fixedDeltaTime * 1.5f);
			}
		}
		if (((EntityState)this).isAuthority && click.Queue(((EntityState)this).inputBank.skill1, ((EntityState)this).fixedAge > duration * BufferFrom))
		{
			queued = true;
		}
		if (((EntityState)this).isAuthority && fired)
		{
			if (((EntityState)this).characterBody.isSprinting && !sp.fin)
			{
				GuyComboMemory.For(((EntityState)this).characterBody).lastEnd = Time.time;
				((EntityState)this).outer.SetNextStateToMain();
				return;
			}
			if (!queued && !slowLifted && ((Vector3)(ref ((EntityState)this).inputBank.moveVector)).sqrMagnitude > 0.04f && !sp.fin)
			{
				slowLifted = true;
				ComboSlow.Set(((EntityState)this).characterBody, 0f);
			}
		}
		if (((EntityState)this).isAuthority && (((EntityState)this).fixedAge >= duration || (queued && fired && ((EntityState)this).fixedAge >= duration * ChainAt)))
		{
			GuyComboMemory.For(((EntityState)this).characterBody).lastEnd = Time.time;
			if (queued)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new GuyStrike
				{
					chained = true
				});
			}
			else
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}
	}

	private void Hit(bool main, float mul)
	{
		//IL_0017: 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_008a: Unknown result type (might be due to invalid IL or missing references)
		//IL_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: 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_00e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0163: Unknown result type (might be due to invalid IL or missing references)
		//IL_0168: 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_0175: Unknown result type (might be due to invalid IL or missing references)
		//IL_017a: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0258: Unknown result type (might be due to invalid IL or missing references)
		//IL_0341: Unknown result type (might be due to invalid IL or missing references)
		//IL_0346: Unknown result type (might be due to invalid IL or missing references)
		//IL_034b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0364: Unknown result type (might be due to invalid IL or missing references)
		//IL_036a: Unknown result type (might be due to invalid IL or missing references)
		//IL_036f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0492: Unknown result type (might be due to invalid IL or missing references)
		//IL_0498: Unknown result type (might be due to invalid IL or missing references)
		//IL_049d: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_04cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_04db: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_03dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_053b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0417: Unknown result type (might be due to invalid IL or missing references)
		//IL_0418: Unknown result type (might be due to invalid IL or missing references)
		//IL_0422: Unknown result type (might be due to invalid IL or missing references)
		//IL_0427: Unknown result type (might be due to invalid IL or missing references)
		//IL_042c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0430: Unknown result type (might be due to invalid IL or missing references)
		//IL_043f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0444: Unknown result type (might be due to invalid IL or missing references)
		//IL_077c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0781: Unknown result type (might be due to invalid IL or missing references)
		//IL_075b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0760: Unknown result type (might be due to invalid IL or missing references)
		//IL_0763: Unknown result type (might be due to invalid IL or missing references)
		//IL_076d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0772: Unknown result type (might be due to invalid IL or missing references)
		//IL_044b: Unknown result type (might be due to invalid IL or missing references)
		//IL_044c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0456: Unknown result type (might be due to invalid IL or missing references)
		//IL_045b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0460: Unknown result type (might be due to invalid IL or missing references)
		//IL_0464: Unknown result type (might be due to invalid IL or missing references)
		//IL_0473: Unknown result type (might be due to invalid IL or missing references)
		//IL_0478: Unknown result type (might be due to invalid IL or missing references)
		//IL_0786: 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_08b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_08bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_08bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_08c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_08c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_08f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0900: Unknown result type (might be due to invalid IL or missing references)
		//IL_0902: Unknown result type (might be due to invalid IL or missing references)
		//IL_0907: Unknown result type (might be due to invalid IL or missing references)
		//IL_07c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_07cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_07cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_07d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_07d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0576: Unknown result type (might be due to invalid IL or missing references)
		//IL_094a: Unknown result type (might be due to invalid IL or missing references)
		//IL_094f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0951: Unknown result type (might be due to invalid IL or missing references)
		//IL_0952: Unknown result type (might be due to invalid IL or missing references)
		//IL_0956: Unknown result type (might be due to invalid IL or missing references)
		//IL_0979: Unknown result type (might be due to invalid IL or missing references)
		//IL_097b: Unknown result type (might be due to invalid IL or missing references)
		//IL_097d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0984: Unknown result type (might be due to invalid IL or missing references)
		//IL_0989: Unknown result type (might be due to invalid IL or missing references)
		//IL_058c: Unknown result type (might be due to invalid IL or missing references)
		//IL_058f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0594: Unknown result type (might be due to invalid IL or missing references)
		//IL_0599: Unknown result type (might be due to invalid IL or missing references)
		//IL_0805: Unknown result type (might be due to invalid IL or missing references)
		//IL_0807: Unknown result type (might be due to invalid IL or missing references)
		//IL_081b: Unknown result type (might be due to invalid IL or missing references)
		//IL_081c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0826: Unknown result type (might be due to invalid IL or missing references)
		//IL_082b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0830: Unknown result type (might be due to invalid IL or missing references)
		//IL_0834: Unknown result type (might be due to invalid IL or missing references)
		//IL_083e: Unknown result type (might be due to invalid IL or missing references)
		//IL_086b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0872: Unknown result type (might be due to invalid IL or missing references)
		//IL_0874: Unknown result type (might be due to invalid IL or missing references)
		//IL_087a: Unknown result type (might be due to invalid IL or missing references)
		//IL_087f: Unknown result type (might be due to invalid IL or missing references)
		//IL_09c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_09c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_09dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_09de: Unknown result type (might be due to invalid IL or missing references)
		//IL_09e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_09ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_09f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_09f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a00: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a2d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a2f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a36: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a3b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a45: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a47: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a4e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a53: Unknown result type (might be due to invalid IL or missing references)
		//IL_0620: Unknown result type (might be due to invalid IL or missing references)
		//IL_0627: Unknown result type (might be due to invalid IL or missing references)
		//IL_06cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_06d4: Unknown result type (might be due to invalid IL or missing references)
		CharacterBody characterBody = ((EntityState)this).characterBody;
		Vector3 val = Quaternion.Euler(0f, yaw, 0f) * Vector3.forward;
		bool flag = Chains.Air(chain);
		Combat.Source = "M1." + chain.ToString() + "." + (stage + 1);
		Vector3 val2 = Quaternion.Euler(0f - Mathf.Clamp(pitch, -70f, 70f), yaw, 0f) * Vector3.forward;
		float num = Tuning.M1Reach.Value * sp.reachMul * (((int)chain >= 4) ? 1.2f : (((int)chain >= 2) ? 1.1f : 1f));
		Dictionary<HealthComponent, HurtBox> dictionary = new Dictionary<HealthComponent, HurtBox>();
		foreach (HurtBox item in Combat.Front(characterBody, characterBody.footPosition, val, num, 62f, flag ? (-3.5f) : (-1.2f), flag ? 4.5f : 3.2f))
		{
			dictionary[item.healthComponent] = item;
		}
		if (flag || Mathf.Abs(pitch) > 25f)
		{
			foreach (HurtBox item2 in Combat.Around(characterBody, characterBody.corePosition + val2 * num * 0.55f, num * 0.7f, sight: false))
			{
				if (!dictionary.ContainsKey(item2.healthComponent))
				{
					dictionary[item2.healthComponent] = item2;
				}
			}
		}
		if (flag && sp.fin && main)
		{
			foreach (HurtBox item3 in Combat.Cone(characterBody, characterBody.corePosition, val2, num * 1.7f, 45f, sight: true))
			{
				if (!dictionary.ContainsKey(item3.healthComponent))
				{
					dictionary[item3.healthComponent] = item3;
				}
			}
			foreach (HurtBox item4 in Combat.Around(characterBody, characterBody.corePosition, num * 0.9f, sight: false))
			{
				if (!dictionary.ContainsKey(item4.healthComponent))
				{
					dictionary[item4.healthComponent] = item4;
				}
			}
		}
		float num2 = (sp.fin ? Tuning.M1FinisherDamage.Value : Tuning.M1Damage.Value) * mul * (((int)chain >= 4) ? Tuning.M1EighthMul.Value : (((int)chain >= 2) ? Tuning.M1SeventhMul.Value : 1f));
		bool crit = characterBody.RollCrit();
		int num3 = 0;
		HurtBox val3 = null;
		float num4 = float.MaxValue;
		Vector3 val6;
		foreach (HurtBox value in dictionary.Values)
		{
			Vector3 val4 = Combat.Point(value, characterBody.corePosition);
			CharacterBody body = value.healthComponent.body;
			bool flag2 = Combat.IsHeavy(body);
			Vector3 val5 = val * 600f;
			if (main && sp.fin)
			{
				if (sp.fx == "axe" || sp.fx == "flurry")
				{
					val6 = val * 0.3f + Vector3.down;
					val5 = ((Vector3)(ref val6)).normalized * Tuning.M1Shove.Value;
				}
				else if (sp.fx == "spin" || sp.fx == "heel")
				{
					val6 = val + Vector3.up * 0.6f;
					val5 = ((Vector3)(ref val6)).normalized * Tuning.M1Shove.Value;
				}
				else
				{
					val6 = val + Vector3.up * 0.35f;
					val5 = ((Vector3)(ref val6)).normalized * Tuning.M1Shove.Value;
				}
			}
			else if (sp.lift > 0f && main)
			{
				val6 = val * 0.3f + Vector3.up;
				val5 = ((Vector3)(ref val6)).normalized * 1600f;
			}
			else if (flag)
			{
				val5 = (val2 * 0.5f + Vector3.up * 0.5f) * 500f;
			}
			Combat.Source = "M1." + chain.ToString() + "." + (stage + 1);
			Combat.Big = main && sp.fin;
			if (Combat.Deal(characterBody, value, val4, num2, Tuning.M1Proc.Value * (main ? 1f : 0.5f) * (((int)chain >= 4) ? Tuning.M1EighthProc.Value : 1f), crit, val5, (DamageType)0, null, (DamageColorIndex)0, (DamageSource)1))
			{
				num3++;
				val6 = val4 - characterBody.corePosition;
				float sqrMagnitude = ((Vector3)(ref val6)).sqrMagnitude;
				if (sqrMagnitude < num4)
				{
					num4 = sqrMagnitude;
					val3 = value;
				}
				if (main && sp.fin && !flag2 && value.healthComponent.alive && (sp.fx == "backfist" || sp.fx == "heel" || sp.fx == "spin"))
				{
					value.healthComponent.TakeDamageForce(val5 * 0.6f, true, true);
				}
				if (main && sp.fin && !flag2 && (sp.fx == "axe" || sp.fx == "flurry") && Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.characterMotor))
				{
					body.characterMotor.velocity = new Vector3(body.characterMotor.velocity.x * 0.3f, -22f, body.characterMotor.velocity.z * 0.3f);
				}
			}
		}
		Combat.Big = false;
		if (main && sp.fin && num3 > 0)
		{
			GuyGates.AddReady(characterBody, Tuning.ReadyPerFinisher.Value, "M1 finisher " + chain);
		}
		if (!main || !sp.fin)
		{
			return;
		}
		Vector3 val7 = (Object.op_Implicit((Object)(object)val3) ? Combat.Point(val3, characterBody.corePosition) : (characterBody.corePosition + val * num * 0.7f));
		if (sp.fx == "heel")
		{
			HashSet<HealthComponent> hashSet = new HashSet<HealthComponent>();
			if (Object.op_Implicit((Object)(object)val3))
			{
				hashSet.Add(val3.healthComponent);
			}
			List<HurtBox> list = new List<HurtBox>();
			Combat.Capsule(characterBody, val7, val7 + val * 9f, 2.4f, list, hashSet);
			foreach (HurtBox item5 in list)
			{
				Vector3 position = Combat.Point(item5, val7);
				float coefficient = num2 * 0.6f;
				val6 = val + Vector3.up * 0.3f;
				Combat.Deal(characterBody, item5, position, coefficient, 0.5f, crit, ((Vector3)(ref val6)).normalized * 1800f, (DamageType)0, null, (DamageColorIndex)0, (DamageSource)1);
			}
			Fx.Emit(GuyFx.PressureWave, val7, 1f, val7 + val * 9f, 7f);
		}
		else if (sp.fx == "axe")
		{
			Vector3 val8 = Combat.Ground(val7, 30f);
			Combat.Blast(characterBody, Vector3.Lerp(val7, val8, 0.6f), 4.5f, num2 * 0.5f, 0.5f, 1500f, (DamageType)0, null, null, -0.6f, (DamageSource)1, sight: false);
			Fx.Emit(GuyFx.PressureWave, val8, 0.7f, val8 + Vector3.up, 17f);
		}
		else
		{
			if (!(sp.fx == "airfist"))
			{
				return;
			}
			HashSet<HealthComponent> exclude = new HashSet<HealthComponent>();
			List<HurtBox> list2 = new List<HurtBox>();
			Vector3 corePosition = characterBody.corePosition;
			Vector3 val9 = val2;
			val9.y = Mathf.Clamp(val9.y, -0.3f, 0.5f);
			((Vector3)(ref val9)).Normalize();
			Combat.Capsule(characterBody, corePosition, corePosition + val9 * 16f, 2.6f, list2, exclude);
			foreach (HurtBox item6 in list2)
			{
				if (!dictionary.ContainsKey(item6.healthComponent))
				{
					Vector3 position2 = Combat.Point(item6, corePosition);
					float coefficient2 = num2 * 0.8f;
					val6 = val9 + Vector3.up * 0.25f;
					Combat.Deal(characterBody, item6, position2, coefficient2, 0.6f, crit, ((Vector3)(ref val6)).normalized * 2600f, (DamageType)0, null, (DamageColorIndex)0, (DamageSource)1);
				}
			}
			Fx.Emit(GuyFx.PressureWave, corePosition + val9 * 0.8f, 1.2f, corePosition + val9 * 16f, 8f);
		}
	}

	public override void OnExit()
	{
		if (!(((EntityState)this).outer.nextState is GuyStrike))
		{
			ComboSlow.Set(((EntityState)this).characterBody, 0f);
		}
		((EntityState)this).OnExit();
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		if (!fired)
		{
			if (((EntityState)this).fixedAge < hitAge)
			{
				return (InterruptPriority)2;
			}
			return (InterruptPriority)1;
		}
		return (InterruptPriority)0;
	}

	public override void OnSerialize(NetworkWriter w)
	{
		((BaseSkillState)this).OnSerialize(w);
		w.Write((byte)stage);
		w.Write((byte)chain);
		w.Write(yaw);
		w.Write(pitch);
	}

	public override void OnDeserialize(NetworkReader r)
	{
		((BaseSkillState)this).OnDeserialize(r);
		stage = r.ReadByte();
		chain = (Chain)r.ReadByte();
		yaw = r.ReadSingle();
		pitch = r.ReadSingle();
	}
}
public sealed class MightGuyDeath : GenericCharacterDeath
{
	public override void OnEnter()
	{
		//IL_0058: 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)
		((GenericCharacterDeath)this).OnEnter();
		CharVisual charVisual = CharVisual.Find(((EntityState)this).characterBody);
		Snd.Voice(((EntityState)this).characterBody, "Death", 3f, grunt: false, 3);
		if (Object.op_Implicit((Object)(object)charVisual))
		{
			try
			{
				Ragdoll.Spawn(charVisual, Object.op_Implicit((Object)(object)MightGuyRemoteMotion.For(((EntityState)this).characterBody)) ? MightGuyRemoteMotion.For(((EntityState)this).characterBody).Velocity : Vector3.zero);
				return;
			}
			catch (Exception ex)
			{
				Plugin.Log.LogWarning((object)("MIGHTGUY_RAGDOLL " + ex));
				return;
			}
		}
		Plugin.Log.LogWarning((object)"MIGHTGUY_RAGDOLL no visual");
	}

	public override void PlayDeathAnimation(float crossfadeDuration = 0.1f)
	{
	}
}
public static class Ragdoll
{
	private static readonly string[][] parts = new string[11][]
	{
		new string[2] { "pelvis", "" },
		new string[2] { "spine1", "pelvis" },
		new string[2] { "head", "spine1" },
		new string[2] { "l upperarm", "spine1" },
		new string[2] { "l forearm", "l upperarm" },
		new string[2] { "r upperarm", "spine1" },
		new string[2] { "r forearm", "r upperarm" },
		new string[2] { "l thigh", "pelvis" },
		new string[2] { "l calf", "l thigh" },
		new string[2] { "r thigh", "pelvis" },
		new string[2] { "r calf", "r thigh" }
	};

	private static readonly Queue<GameObject> corpses = new Queue<GameObject>();

	public static void Spawn(CharVisual v, Vector3 velocity)
	{
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0140: Unknown result type (might be due to invalid IL or missing references)
		//IL_0146: Unknown result type (might be due to invalid IL or missing references)
		//IL_014b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0155: Unknown result type (might be due to invalid IL or missing references)
		//IL_015a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0179: Unknown result type (might be due to invalid IL or missing references)
		//IL_0180: Expected O, but got Unknown
		//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f9: 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_0293: Unknown result type (might be due to invalid IL or missing references)
		//IL_0298: Unknown result type (might be due to invalid IL or missing references)
		//IL_029c: Unknown result type (might be due to invalid IL or missing references)
		//IL_028a: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02de: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_02be: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_0301: Unknown result type (might be due to invalid IL or missing references)
		//IL_0305: 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_0359: Unknown result type (might be due to invalid IL or missing references)
		//IL_035e: Unknown result type (might be due to invalid IL or missing references)
		//IL_036d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0375: Unknown result type (might be due to invalid IL or missing references)
		//IL_037a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0389: Unknown result type (might be due to invalid IL or missing references)
		//IL_0391: Unknown result type (might be due to invalid IL or missing references)
		//IL_0396: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a4: Unknown result type (might be due to invalid IL or missing references)
		Dictionary<string, Transform> dictionary = new Dictionary<string, Transform>();
		string[][] array = parts;
		foreach (string[] array2 in array)
		{
			Transform val = v.Bone(array2[0]);
			if (!Object.op_Implicit((Object)(object)val))
			{
				Plugin.Log.LogWarning((object)("MIGHTGUY_RAGDOLL missing bone " + array2[0]));
				return;
			}
			dictionary[array2[0]] = val;
		}
		Transform presentation = v.Presentation;
		presentation.SetParent((Transform)null, true);
		if (Object.op_Implicit((Object)(object)v.Anim))
		{
			v.Anim.Stop();
		}
		v.Dying = true;
		((Behaviour)v).enabled = false;
		if (Object.op_Implicit((Object)(object)v.Rig))
		{
			v.Rig.localPosition = Vector3.zero;
		}
		Dictionary<string, Rigidbody> dictionary2 = new Dictionary<string, Rigidbody>();
		array = parts;
		foreach (string[] array3 in array)
		{
			Transform val2 = dictionary[array3[0]];
			((Component)val2).gameObject.layer = LayerIndex.debris.intVal;
			Rigidbody val3 = ((Component)val2).gameObject.AddComponent<Rigidbody>();
			val3.mass = ((array3[0] == "pelvis" || array3[0] == "spine1") ? 8 : 3);
			val3.drag = 0.2f;
			val3.angularDrag = 0.8f;
			val3.velocity = velocity * 0.6f + Vector3.up * 1.5f;
			Transform val4 = null;
			foreach (Transform item in val2)
			{
				Transform val5 = item;
				if (val5.childCount > 0 || ((Object)val5).name.Contains("hand") || ((Object)val5).name.Contains("foot"))
				{
					val4 = val5;
					break;
				}
			}
			CapsuleCollider obj = ((Component)val2).gameObject.AddComponent<CapsuleCollider>();
			float num;
			Vector3 localPosition;
			if (!Object.op_Implicit((Object)(object)val4))
			{
				num = 0.18f;
			}
			else
			{
				localPosition = val4.localPosition;
				num = ((Vector3)(ref localPosition)).magnitude;
			}
			float num2 = num;
			float num3 = Mathf.Max(0.01f, val2.lossyScale.x);
			obj.radius = ((array3[0] == "pelvis" || array3[0] == "spine1") ? 0.13f : ((array3[0] == "head") ? 0.11f : 0.06f)) / num3;
			obj.height = Mathf.Max(obj.radius * 2f, num2);
			Vector3 val6;
			if (!Object.op_Implicit((Object)(object)val4))
			{
				val6 = Vector3.up;
			}
			else
			{
				localPosition = val4.localPosition;
				val6 = ((Vector3)(ref localPosition)).normalized;
			}
			Vector3 val7 = val6;
			obj.direction = ((!(Mathf.Abs(val7.x) > Mathf.Abs(val7.y))) ? ((Mathf.Abs(val7.y) > Mathf.Abs(val7.z)) ? 1 : 2) : ((!(Mathf.Abs(val7.x) > Mathf.Abs(val7.z))) ? 2 : 0));
			obj.center = val7 * num2 * 0.5f;
			dictionary2[array3[0]] = val3;
			if (array3[1] != "")
			{
				CharacterJoint obj2 = ((Component)val2).gameObject.AddComponent<CharacterJoint>();
				((Joint)obj2).connectedBody = dictionary2[array3[1]];
				obj2.enableProjection = true;
				SoftJointLimit lowTwistLimit = obj2.lowTwistLimit;
				((SoftJointLimit)(ref lowTwistLimit)).limit = -30f;
				obj2.lowTwistLimit = lowTwistLimit;
				SoftJointLimit highTwistLimit = obj2.highTwistLimit;
				((SoftJointLimit)(ref highTwistLimit)).limit = 30f;
				obj2.highTwistLimit = highTwistLimit;
				SoftJointLimit swing1Limit = obj2.swing1Limit;
				((SoftJointLimit)(ref swing1Limit)).limit = 45f;
				obj2.swing1Limit = swing1Limit;
			}
		}
		Collider[] componentsInChildren = ((Component)presentation).GetComponentsInChildren<Collider>();
		foreach (Collider val8 in componentsInChildren)
		{
			foreach (CharacterBody readOnlyInstances in CharacterBody.readOnlyInstancesList)
			{
				if (Object.op_Implicit((Object)(object)readOnlyInstances))
				{
					Collider[] componentsInChildren2 = ((Component)readOnlyInstances).GetComponentsInChildren<Collider>();
					foreach (Collider val9 in componentsInChildren2)
					{
						Physics.IgnoreCollision(val8, val9);
					}
				}
			}
		}
		corpses.Enqueue(((Component)presentation).gameObject);
		while (corpses.Count > 4)
		{
			GameObject val10 = corpses.Dequeue();
			if (Object.op_Implicit((Object)(object)val10))
			{
				Object.Destroy((Object)(object)val10);
			}
		}
		Object.Destroy((Object)(object)((Component)presentation).gameObject, 14f);
		Plugin.Log.LogInfo((object)"MIGHTGUY_RAGDOLL spawned");
	}
}
public sealed class BodyFlicker : BaseSkillState
{
	public const byte ModeEnemy = 0;

	public const byte ModeWall = 1;

	public const byte ModeGround = 2;

	public const byte ModeAir = 3;

	public Vector3 from;

	public Vector3 to;

	public Vector3 normal;

	public Vector3 face;

	public byte mode;

	public HurtBoxReference targetRef;

	public bool fromGround;

	public static float Vanish = 0.1f;

	public static float AirHold = 0.45f;

	public static float EnemySettle = 0.3f;

	public static float CamCutSeconds = 0f;

	public static bool CamTurnOn = true;

	private bool arrived;

	private bool shown;

	private bool vanished;

	private float hideUntil;

	private float pre;

	private GuyForm form;

	private HurtBox target;

	private ActionPlay preAct;

	private bool preWall;

	private Vector3 preN;

	private Vector3 preP;

	public static float Reach(GuyForm f)
	{
		return f switch
		{
			GuyForm.Seventh => Tuning.FlickerReach7.Value, 
			GuyForm.Eighth => Tuning.FlickerReach8.Value, 
			_ => Tuning.FlickerReach.Value, 
		};
	}

	public override void OnEnter()
	{
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_007a: Unknown result type (might be due to invalid IL or missing references)
		//IL_007f: Unknown result type (might be due to invalid IL or missing references)
		//IL_031d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0323: Unknown result type (might be due to invalid IL or missing references)
		//IL_0328: Unknown result type (might be due to invalid IL or missing references)
		//IL_032d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_017f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0184: Unknown result type (might be due to invalid IL or missing references)
		//IL_018b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0190: Unknown result type (might be due to invalid IL or missing references)
		//IL_0195: Unknown result type (might be due to invalid IL or missing references)
		//IL_019b: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0104: 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_01be: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b5: 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_012b: Unknown result type (might be due to invalid IL or missing references)
		((BaseState)this).OnEnter();
		form = GuyGates.Form(((EntityState)this).characterBody);
		GuyFall.Protect(((EntityState)this).characterBody, 2.5f);
		pre = Mathf.Clamp(Tuning.FlickerPrePose.Value, 0f, 0.4f);
		WallRun component = ((EntityState)this).GetComponent<WallRun>();
		preWall = Object.op_Implicit((Object)(object)component) && component.ViewRunning;
		if (preWall)
		{
			preN = component.ViewNormal;
			preP = component.ViewContact;
		}
		if (((EntityState)this).isAuthority)
		{
			Machines.StopWeapon(((EntityState)this).gameObject);
			GuyComboMemory.Reset(((EntityState)this).characterBody);
			if (Object.op_Implicit((Object)(object)component))
			{
				component.DetachForTeleport();
			}
			fromGround = Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).characterMotor.isGrounded;
			from = ((EntityState)this).characterBody.corePosition;
			Plan();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				Vector3 forward = Aim.Flat(to - from);
				if (((Vector3)(ref forward)).sqrMagnitude > 0.01f && !preWall)
				{
					((EntityState)this).characterDirection.forward = forward;
				}
			}
		}
		else
		{
			target = ((HurtBoxReference)(ref targetRef)).ResolveHurtBox();
		}
		CharVisual charVisual = CharVisual.Find(((EntityState)this).characterBody);
		if (Object.op_Implicit((Object)(object)charVisual) && pre > 0f)
		{
			if (preWall)
			{
				charVisual.Cling = true;
				charVisual.ClingNormal = preN;
				charVisual.ClingPoint = preP;
				Vector3 val = Vector3.ProjectOnPlane(Vector3.up, preN);
				charVisual.ClingFwd = ((((Vector3)(ref val)).sqrMagnitude > 0.01f) ? ((Vector3)(ref val)).normalized : Vector3.up);
				preAct = new ActionPlay
				{
					clip = "lan0",
					startF = 2f,
					endF = 5f,
					duration = pre * 0.6f,
					holdEnd = true
				};
			}
			else if (fromGround || (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).characterMotor.isGrounded))
			{
				preAct = new ActionPlay
				{
					clip = "skl1_atk1",
					startF = 64f,
					endF = 69f,
					duration = pre * 0.7f,
					holdEnd = true
				};
			}
			else
			{
				preAct = new ActionPlay
				{
					clip = "jmp1",
					startF = 3f,
					endF = 5f,
					duration = pre * 0.6f,
					holdEnd = true
				};
			}
			charVisual.PlayAction(preAct);
		}
		Snd.Sfx("SwingS", ((EntityState)this).gameObject);
		if (pre <= 0f)
		{
			Vanishing();
		}
		ManualLogSource log = Plugin.Log;
		string[] obj = new string[13]
		{
			"MIGHTGUY_FLICKER mode=",
			mode.ToString(),
			" d=",
			null,
			null,
			null,
			null,
			null,
			null,
			null,
			null,
			null,
			null
		};
		Vector3 val2 = to - from;
		obj[3] = ((Vector3)(ref val2)).magnitude.ToString("0.0");
		obj[4] = " form=";
		obj[5] = form.ToString();
		obj[6] = " auth=";
		obj[7] = ((EntityState)this).isAuthority.ToString();
		obj[8] = " pre=";
		obj[9] = pre.ToString("0.00");
		obj[10] = (preWall ? " wall" : (fromGround ? " ground" : " air"));
		obj[11] = " target=";
		obj[12] = ((Object.op_Implicit((Object)(object)target) && Object.op_Implicit((Object)(object)target.healthComponent) && Object.op_Implicit((Object)(object)target.healthComponent.body)) ? ((Object)target.healthComponent.body).name : "-");
		log.LogInfo((object)string.Concat(obj));
	}

	private void Vanishing()
	{
		//IL_008c: 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_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: 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_009a: 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_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ec: 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)
		if (vanished)
		{
			return;
		}
		vanished = true;
		CharVisual charVisual = CharVisual.Find(((EntityState)this).characterBody);
		if (Object.op_Implicit((Object)(object)charVisual))
		{
			if (preAct != null)
			{
				charVisual.EndAction(preAct);
			}
			preAct = null;
			if (preWall)
			{
				charVisual.Cling = false;
			}
		}
		GuyFx.Afterimage(((EntityState)this).characterBody, form, 0.3f);
		Vector3 val = ((((EntityState)this).isAuthority || ((Vector3)(ref from)).sqrMagnitude > 0.01f) ? from : ((EntityState)this).characterBody.corePosition);
		GuyFx.FlickerVanish(val, to - val, form, preWall ? preP : ((EntityState)this).characterBody.footPosition, fromGround || preWall);
		if (fromGround && form != GuyForm.Base)
		{
			GuyFx.Crack(((EntityState)this).characterBody.footPosition, Vector3.up, (form == GuyForm.Eighth) ? 6.5f : 4.2f);
		}
		hideUntil = Time.time + (((EntityState)this).isAuthority ? Vanish : 0.45f);
		if (Object.op_Implicit((Object)(object)charVisual))
		{
			charVisual.HideUntil = hideUntil;
		}
		Snd.Sfx("Dash", ((EntityState)this).gameObject);
	}

	private void Plan()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: 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_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: 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_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_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: 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_00f0: 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_03a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03af: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0286: Unknown result type (might be due to invalid IL or missing references)
		//IL_028b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0266: Unknown result type (might be due to invalid IL or missing references)
		//IL_026b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0271: Unknown result type (might be due to invalid IL or missing references)
		//IL_0276: Unknown result type (might be due to invalid IL or missing references)
		//IL_0143: Unknown result type (might be due to invalid IL or missing references)
		//IL_014a: Unknown result type (might be due to invalid IL or missing references)
		//IL_014f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0156: Unknown result type (might be due to invalid IL or missing references)
		//IL_0401: Unknown result type (might be due to invalid IL or missing references)
		//IL_0406: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02be: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0359: Unknown result type (might be due to invalid IL or missing references)
		//IL_0360: Unknown result type (might be due to invalid IL or missing references)
		//IL_036a: Unknown result type (might be due to invalid IL or missing references)
		//IL_036f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0374: Unknown result type (might be due to invalid IL or missing references)
		//IL_037c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0381: Unknown result type (might be due to invalid IL or missing references)
		//IL_0386: Unknown result type (might be due to invalid IL or missing references)
		//IL_038c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0391: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0301: Unknown result type (might be due to invalid IL or missing references)
		//IL_0303: Unknown result type (might be due to invalid IL or missing references)
		//IL_0309: Unknown result type (might be due to invalid IL or missing references)
		//IL_030e: 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_0344: Unknown result type (might be due to invalid IL or missing references)
		//IL_0349: Unknown result type (might be due to invalid IL or missing references)
		//IL_033b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0332: Unknown result type (might be due to invalid IL or missing references)
		Ray aimRay = ((BaseState)this).GetAimRay();
		float num = Reach(form);
		Vector3 corePosition = ((EntityState)this).characterBody.corePosition;
		float num2 = Mathf.Max(0f, Vector3.Dot(corePosition - ((Ray)(ref aimRay)).origin, ((Ray)(ref aimRay)).direction));
		float num3 = num + num2;
		float num4 = num3;
		RaycastHit val = default(RaycastHit);
		bool flag = false;
		RaycastHit[] array = Physics.RaycastAll(aimRay, num3, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1);
		for (int i = 0; i < array.Length; i++)
		{
			RaycastHit val2 = array[i];
			if (((RaycastHit)(ref val2)).distance > num2 - 0.3f && ((RaycastHit)(ref val2)).distance < num4)
			{
				num4 = ((RaycastHit)(ref val2)).distance;
				val = val2;
				flag = true;
			}
		}
		HurtBox val3 = null;
		float num5 = float.MaxValue;
		array = Physics.SphereCastAll(aimRay, 1.6f, num4 + 1f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)2);
		for (int i = 0; i < array.Length; i++)
		{
			RaycastHit val4 = array[i];
			HurtBox val5 = (Object.op_Implicit((Object)(object)((RaycastHit)(ref val4)).collider) ? ((Component)((RaycastHit)(ref val4)).collider).GetComponent<HurtBox>() : null);
			if (Combat.Target(val5, ((EntityState)this).characterBody))
			{
				float num6 = ((((RaycastHit)(ref val4)).distance <= 0f) ? Vector3.Dot(((Component)val5).transform.position - ((Ray)(ref aimRay)).origin, ((Ray)(ref aimRay)).direction) : ((RaycastHit)(ref val4)).distance);
				if (!(num6 < num2 - 0.5f) && num6 < num5)
				{
					num5 = num6;
					val3 = val5;
				}
			}
		}
		i