Zed.dll

Decompiled 4 hours ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using EntityStates;
using EntityStates.Merc;
using JetBrains.Annotations;
using KinematicCharacterController;
using R2API;
using R2API.Utils;
using Rewired.ComponentControls.Effects;
using RoR2;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;

[assembly: AssemblyCompany("Zed")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyProduct("Zed")]
[assembly: AssemblyTitle("Zed")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: CompilationRelaxations(8)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Zed;

internal class Assets
{
	public static AssetBundle MainAssetBundle;

	public static T Load<T>(string name) where T : Object
	{
		return MainAssetBundle.LoadAsset<T>(name);
	}

	public static void PopulateAssets()
	{
		Assembly executingAssembly = Assembly.GetExecutingAssembly();
		if ((Object)(object)MainAssetBundle == (Object)null)
		{
			using Stream stream = executingAssembly.GetManifestResourceStream("Zed.AssetBundle." + "Zed".ToLower() + "assets");
			MainAssetBundle = AssetBundle.LoadFromStream(stream);
		}
		using Stream stream2 = executingAssembly.GetManifestResourceStream("Zed.Zed.bnk");
		byte[] array = new byte[stream2.Length];
		stream2.Read(array, 0, array.Length);
		SoundBanks.Add(array);
	}
}
internal class DamageAccumulator : MonoBehaviour
{
	public GameObject owner;

	public float accumulatedDamage;

	private HealthComponent health;

	private float stopwatch;

	private float markTime = 3f;

	private bool damaged;

	private void Start()
	{
		health = ((Component)this).GetComponent<HealthComponent>();
	}

	private void FixedUpdate()
	{
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: 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_0060: 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_0079: 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_0090: 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_009a: 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_00a2: Expected O, but got Unknown
		//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		if (!damaged)
		{
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= markTime)
			{
				damaged = true;
				DamageInfo val = new DamageInfo
				{
					attacker = owner,
					inflictor = owner,
					damage = accumulatedDamage * 0.55f,
					crit = false,
					procCoefficient = 0f,
					position = health.body.corePosition,
					damageColorIndex = (DamageColorIndex)5
				};
				DamageAPI.AddModdedDamageType(val, Prefabs.execute);
				health.TakeDamage(val);
				EffectManager.SimpleEffect(Prefabs.ultHitEffect, health.body.corePosition, Quaternion.identity, true);
				Object.Destroy((Object)(object)this);
			}
		}
	}
}
internal class ObjectSoundPlayer : MonoBehaviour
{
	public uint enableSound = 0u;

	public uint disableSound = 0u;

	private void OnEnable()
	{
		if (enableSound != 0)
		{
			AkSoundEngine.PostEvent(enableSound, ((Component)this).gameObject);
		}
	}

	private void OnDisable()
	{
		if (disableSound != 0)
		{
			AkSoundEngine.PostEvent(disableSound, ((Component)this).gameObject);
		}
	}
}
internal class ParticleOnStartAndEnd : MonoBehaviour
{
	public GameObject startEffectPrefab = Prefabs.shadowSpawnEffect;

	public GameObject endEffectPrefab = Prefabs.shadowDespawnEffect;

	private void Start()
	{
		EffectManager.SimpleMuzzleFlash(startEffectPrefab, ((Component)this).gameObject, "base", false);
	}

	private void OnDisable()
	{
		//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)
		EffectManager.SimpleEffect(endEffectPrefab, ((Component)this).transform.position, Quaternion.identity, false);
	}
}
internal class ProjectileDebug : MonoBehaviour
{
	public float duration = 0.5f;

	public float stopwatch;

	private void FixedUpdate()
	{
		stopwatch += Time.fixedDeltaTime;
		if (stopwatch >= duration)
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}

	private void OnDisable()
	{
		//IL_0011: 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)
		Debug.LogWarning((object)Vector3.Distance(((Component)this).GetComponent<ProjectileController>().owner.GetComponent<InputBankTest>().aimOrigin, ((Component)this).transform.position));
	}
}
internal class ZedTracker : HuntressTracker
{
	public Indicator ultIndicator;

	private float stopwatch;

	private void Awake()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Expected O, but got Unknown
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Expected O, but got Unknown
		base.indicator = new Indicator(((Component)this).gameObject, Prefabs.indicator);
		ultIndicator = new Indicator(((Component)this).gameObject, Prefabs.ultIndicator);
		ultIndicator.active = false;
	}

	public void UpdateIndicator(Transform target)
	{
		ultIndicator.targetTransform = target;
		ultIndicator.active = true;
	}

	private void FixedUpdate()
	{
		((HuntressTracker)this).FixedUpdate();
		if (ultIndicator.active)
		{
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= 3f)
			{
				ultIndicator.active = false;
				stopwatch = 0f;
			}
		}
		base.indicator.active = base.characterBody.skillLocator.special.CanExecute();
	}
}
internal class ZedBehaviour : NetworkBehaviour
{
	public GameObject primaryShadow;

	public GameObject secondaryShadow;

	public List<GameObject> shadows = new List<GameObject>();

	public float shadowDistance = 15f;

	public Animator animator;

	public PrintController printController;

	public bool canExecute = true;

	private SkillLocator skillLocator;

	public float maxRadius = 5f;

	private static int kCmdCmdRepositionShadow;

	private static int kRpcRpcRepositionShadow;

	private static int kRpcRpcCooldownReduction;

	private void Awake()
	{
		skillLocator = ((Component)this).GetComponent<SkillLocator>();
	}

	public void PrintOut()
	{
		printController.printCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
		((Behaviour)printController).enabled = true;
	}

	public void PrintIn()
	{
		printController.printCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);
		((Behaviour)printController).enabled = true;
	}

	[Command]
	public void CmdRepositionShadow(int shadowIndex, Vector3 position)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		CallRpcRepositionShadow(shadowIndex, position);
	}

	[ClientRpc]
	public void RpcRepositionShadow(int shadowIndex, Vector3 position)
	{
		//IL_003c: 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_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
		if (shadowIndex == 0)
		{
			primaryShadow.transform.position = position;
			AkSoundEngine.PostEvent(Sounds.Play_sfx_Zed_ZedW2_OnCast, ((Component)this).gameObject);
		}
		else
		{
			secondaryShadow.transform.position = position;
			AkSoundEngine.PostEvent(Sounds.Play_sfx_Zed_ZedR2_OnCast, ((Component)this).gameObject);
		}
		if (Object.op_Implicit((Object)(object)animator))
		{
			Utils.AnimatorPlayAnimation(animator, "Body", "ForceIdleIn");
		}
		Transform val = ((Component)animator).GetComponent<ChildLocator>().FindChild("base");
		GameObject val2 = Object.Instantiate<GameObject>(Prefabs.shadowSpawnEffect, val.position, Quaternion.identity, val);
		val2.transform.localRotation = Quaternion.identity;
		GameObject val3 = ((shadowIndex == 0) ? primaryShadow : secondaryShadow);
		val = val3.GetComponent<ChildLocator>().FindChild("base");
		val2 = Object.Instantiate<GameObject>(Prefabs.shadowSpawnEffect, val.position, Quaternion.identity, val);
		val2.transform.localRotation = Quaternion.identity;
	}

	[ClientRpc]
	public void RpcCooldownReduction()
	{
		if (Object.op_Implicit((Object)(object)skillLocator) && Util.HasEffectiveAuthority(((Component)this).gameObject))
		{
			skillLocator.utility.Recharge(0.5f);
		}
	}

	private void UNetVersion()
	{
	}

	protected static void InvokeCmdCmdRepositionShadow(NetworkBehaviour obj, NetworkReader reader)
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkServer.active)
		{
			Debug.LogError((object)"Command CmdRepositionShadow called on client.");
		}
		else
		{
			((ZedBehaviour)(object)obj).CmdRepositionShadow((int)reader.ReadPackedUInt32(), reader.ReadVector3());
		}
	}

	public void CallCmdRepositionShadow(int shadowIndex, Vector3 position)
	{
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Expected O, but got Unknown
		//IL_005c: 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_0026: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkClient.active)
		{
			Debug.LogError((object)"Command function CmdRepositionShadow called on server.");
			return;
		}
		if (((NetworkBehaviour)this).isServer)
		{
			CmdRepositionShadow(shadowIndex, position);
			return;
		}
		NetworkWriter val = new NetworkWriter();
		val.Write((short)0);
		val.Write((short)5);
		val.WritePackedUInt32((uint)kCmdCmdRepositionShadow);
		val.Write(((Component)this).GetComponent<NetworkIdentity>().netId);
		val.WritePackedUInt32((uint)shadowIndex);
		val.Write(position);
		((NetworkBehaviour)this).SendCommandInternal(val, 0, "CmdRepositionShadow");
	}

	protected static void InvokeRpcRpcRepositionShadow(NetworkBehaviour obj, NetworkReader reader)
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkClient.active)
		{
			Debug.LogError((object)"RPC RpcRepositionShadow called on server.");
		}
		else
		{
			((ZedBehaviour)(object)obj).RpcRepositionShadow((int)reader.ReadPackedUInt32(), reader.ReadVector3());
		}
	}

	protected static void InvokeRpcRpcCooldownReduction(NetworkBehaviour obj, NetworkReader reader)
	{
		if (!NetworkClient.active)
		{
			Debug.LogError((object)"RPC RpcCooldownReduction called on server.");
		}
		else
		{
			((ZedBehaviour)(object)obj).RpcCooldownReduction();
		}
	}

	public void CallRpcRepositionShadow(int shadowIndex, Vector3 position)
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Expected O, but got Unknown
		//IL_0041: 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)
		if (!NetworkServer.active)
		{
			Debug.LogError((object)"RPC Function RpcRepositionShadow called on client.");
			return;
		}
		NetworkWriter val = new NetworkWriter();
		val.Write((short)0);
		val.Write((short)2);
		val.WritePackedUInt32((uint)kRpcRpcRepositionShadow);
		val.Write(((Component)this).GetComponent<NetworkIdentity>().netId);
		val.WritePackedUInt32((uint)shadowIndex);
		val.Write(position);
		((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcRepositionShadow");
	}

	public void CallRpcCooldownReduction()
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Expected O, but got Unknown
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkServer.active)
		{
			Debug.LogError((object)"RPC Function RpcCooldownReduction called on client.");
			return;
		}
		NetworkWriter val = new NetworkWriter();
		val.Write((short)0);
		val.Write((short)2);
		val.WritePackedUInt32((uint)kRpcRpcCooldownReduction);
		val.Write(((Component)this).GetComponent<NetworkIdentity>().netId);
		((NetworkBehaviour)this).SendRPCInternal(val, 0, "RpcCooldownReduction");
	}

	static ZedBehaviour()
	{
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Expected O, but got Unknown
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Expected O, but got Unknown
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Expected O, but got Unknown
		kCmdCmdRepositionShadow = 692436032;
		NetworkBehaviour.RegisterCommandDelegate(typeof(ZedBehaviour), kCmdCmdRepositionShadow, new CmdDelegate(InvokeCmdCmdRepositionShadow));
		kRpcRpcRepositionShadow = 321745942;
		NetworkBehaviour.RegisterRpcDelegate(typeof(ZedBehaviour), kRpcRpcRepositionShadow, new CmdDelegate(InvokeRpcRpcRepositionShadow));
		kRpcRpcCooldownReduction = 1213588238;
		NetworkBehaviour.RegisterRpcDelegate(typeof(ZedBehaviour), kRpcRpcCooldownReduction, new CmdDelegate(InvokeRpcRpcCooldownReduction));
		NetworkCRC.RegisterBehaviour("ZedBehaviour", 0);
	}

	public override bool OnSerialize(NetworkWriter writer, bool forceAll)
	{
		bool result = default(bool);
		return result;
	}

	public override void OnDeserialize(NetworkReader reader, bool initialState)
	{
	}
}
internal class Hook
{
	internal static void Hooks()
	{
		GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt;
		GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal;
	}

	private static void GlobalEventManager_onCharacterDeathGlobal(DamageReport damageReport)
	{
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)damageReport.victim) && Object.op_Implicit((Object)(object)damageReport.victim.body) && DamageAPI.HasModdedDamageType(damageReport.damageInfo, Prefabs.execute))
		{
			EffectManager.SimpleEffect(Prefabs.ultExecuteEffect, damageReport.victim.body.corePosition, Quaternion.identity, true);
		}
	}

	private static void GlobalEventManager_onServerDamageDealt(DamageReport damageReport)
	{
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d2: Invalid comparison between Unknown and I4
		//IL_0220: Unknown result type (might be due to invalid IL or missing references)
		//IL_0225: Unknown result type (might be due to invalid IL or missing references)
		//IL_022c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0231: Unknown result type (might be due to invalid IL or missing references)
		//IL_0236: Unknown result type (might be due to invalid IL or missing references)
		//IL_0247: 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_025f: 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_0278: Unknown result type (might be due to invalid IL or missing references)
		//IL_027d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0284: Unknown result type (might be due to invalid IL or missing references)
		//IL_0291: Expected O, but got Unknown
		//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_02af: 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_0322: Unknown result type (might be due to invalid IL or missing references)
		//IL_032c: Invalid comparison between Unknown and I4
		//IL_037a: Unknown result type (might be due to invalid IL or missing references)
		//IL_037f: 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_038b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0390: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b2: 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_03d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03de: Unknown result type (might be due to invalid IL or missing references)
		//IL_03eb: Expected O, but got Unknown
		//IL_0404: Unknown result type (might be due to invalid IL or missing references)
		//IL_0409: Unknown result type (might be due to invalid IL or missing references)
		if (!Object.op_Implicit((Object)(object)damageReport.victim) || !Object.op_Implicit((Object)(object)damageReport.attacker) || !Object.op_Implicit((Object)(object)damageReport.attackerBody))
		{
			return;
		}
		DamageAccumulator[] components = ((Component)damageReport.victim).GetComponents<DamageAccumulator>();
		if (components != null && components.Length != 0)
		{
			DamageAccumulator[] array = components;
			foreach (DamageAccumulator damageAccumulator in array)
			{
				if ((Object)(object)damageAccumulator.owner == (Object)(object)damageReport.attacker)
				{
					damageAccumulator.accumulatedDamage += damageReport.damageDealt;
					break;
				}
			}
		}
		bool flag = damageReport.attackerBody.baseNameToken == "ZED_NAME";
		bool flag2 = (int)DamageTypeCombo.op_Implicit(damageReport.damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)64)) > 0;
		if (flag && flag2)
		{
			ZedBehaviour component = damageReport.attacker.GetComponent<ZedBehaviour>();
			if (Object.op_Implicit((Object)(object)component))
			{
				component.CallRpcCooldownReduction();
			}
		}
		if (!(damageReport.victim.combinedHealth <= damageReport.victim.fullCombinedHealth * 0.5f))
		{
			return;
		}
		bool flag3 = false;
		foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances)
		{
			if (Object.op_Implicit((Object)(object)instance.master))
			{
				CharacterBody body = instance.master.GetBody();
				if (Object.op_Implicit((Object)(object)body) && body.baseNameToken == "ZED_NAME")
				{
					flag3 = true;
					break;
				}
			}
		}
		if (!flag3)
		{
			return;
		}
		if (flag && flag2 && !damageReport.victimBody.HasBuff(Prefabs.passiveUnavailable))
		{
			damageReport.victimBody.AddTimedBuff(Prefabs.passiveUnavailable, 30f);
			if (damageReport.victimBody.HasBuff(Prefabs.passiveAvailable))
			{
				damageReport.victimBody.RemoveBuff(Prefabs.passiveAvailable);
			}
			DamageInfo val = new DamageInfo
			{
				position = damageReport.victimBody.corePosition,
				attacker = ((Component)damageReport.attackerBody).gameObject,
				inflictor = ((Component)damageReport.attackerBody).gameObject,
				crit = false,
				damage = damageReport.victim.fullCombinedHealth * 0.1f,
				damageColorIndex = (DamageColorIndex)3,
				rejected = false,
				procCoefficient = 0f
			};
			damageReport.victim.TakeDamage(val);
			EffectManager.SimpleEffect(Prefabs.critEffect, damageReport.victimBody.corePosition, Quaternion.identity, true);
		}
		if (!damageReport.victimBody.HasBuff(Prefabs.passiveAvailable) && !damageReport.victimBody.HasBuff(Prefabs.passiveUnavailable))
		{
			damageReport.victimBody.AddBuff(Prefabs.passiveAvailable);
		}
		else if (flag && !damageReport.victimBody.HasBuff(Prefabs.passiveUnavailable) && (int)DamageTypeCombo.op_Implicit(damageReport.damageInfo.damageType) == 262144)
		{
			if (damageReport.victimBody.HasBuff(Prefabs.passiveAvailable))
			{
				damageReport.victimBody.RemoveBuff(Prefabs.passiveAvailable);
			}
			damageReport.victimBody.AddTimedBuff(Prefabs.passiveUnavailable, 30f);
			DamageInfo val2 = new DamageInfo
			{
				position = damageReport.victimBody.corePosition,
				attacker = ((Component)damageReport.attackerBody).gameObject,
				inflictor = ((Component)damageReport.attackerBody).gameObject,
				crit = false,
				damage = damageReport.victim.fullCombinedHealth * 0.1f,
				damageColorIndex = (DamageColorIndex)3,
				rejected = false,
				procCoefficient = 0f
			};
			damageReport.victim.TakeDamage(val2);
			EffectManager.SimpleEffect(Prefabs.critEffect, damageReport.victimBody.corePosition, Quaternion.identity, true);
		}
	}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.Dragonyck.Zed", "Zed", "1.0.0")]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class MainPlugin : BaseUnityPlugin
{
	public const string MODUID = "com.Dragonyck.Zed";

	public const string MODNAME = "Zed";

	public const string VERSION = "1.0.0";

	public const string SURVIVORNAME = "Zed";

	public const string SURVIVORNAMEKEY = "ZED";

	public static GameObject characterPrefab;

	public static GameObject shadowPrefab;

	public static readonly Color characterColor = Color32.op_Implicit(new Color32((byte)123, (byte)32, (byte)33, byte.MaxValue));

	private void Awake()
	{
		Assets.PopulateAssets();
		Prefabs.CreatePrefabs();
		CreatePrefab();
		RegisterStates();
		RegisterCharacter();
		Hook.Hooks();
	}

	internal static void CreatePrefab()
	{
		//IL_0006: 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_0147: Unknown result type (might be due to invalid IL or missing references)
		//IL_014e: Expected O, but got Unknown
		//IL_017b: Unknown result type (might be due to invalid IL or missing references)
		//IL_018d: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ae: 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_01c5: Expected O, but got Unknown
		//IL_01ef: 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_0213: Unknown result type (might be due to invalid IL or missing references)
		//IL_0237: Unknown result type (might be due to invalid IL or missing references)
		//IL_0244: Unknown result type (might be due to invalid IL or missing references)
		//IL_0251: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f6: 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_0435: Unknown result type (might be due to invalid IL or missing references)
		//IL_04cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_04fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0502: Unknown result type (might be due to invalid IL or missing references)
		//IL_05af: Unknown result type (might be due to invalid IL or missing references)
		//IL_05cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_05dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0748: Unknown result type (might be due to invalid IL or missing references)
		//IL_0765: Unknown result type (might be due to invalid IL or missing references)
		//IL_0782: Unknown result type (might be due to invalid IL or missing references)
		//IL_079f: Unknown result type (might be due to invalid IL or missing references)
		//IL_07bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_07d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_07f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0813: 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_084e: Unknown result type (might be due to invalid IL or missing references)
		//IL_086c: Unknown result type (might be due to invalid IL or missing references)
		//IL_088a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0926: Unknown result type (might be due to invalid IL or missing references)
		//IL_0930: Expected O, but got Unknown
		//IL_0948: Unknown result type (might be due to invalid IL or missing references)
		//IL_094d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a57: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ac2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ad6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0aec: Unknown result type (might be due to invalid IL or missing references)
		//IL_0af6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0afb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b05: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bf7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bfc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c1f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c24: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c52: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c57: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Merc/MercBody.prefab").WaitForCompletion();
		characterPrefab = PrefabAPI.InstantiateClone(val, "ZedBody", true);
		characterPrefab.GetComponent<NetworkIdentity>().localPlayerAuthority = true;
		ZedBehaviour zedBehaviour = characterPrefab.AddComponent<ZedBehaviour>();
		((HuntressTracker)characterPrefab.AddComponent<ZedTracker>()).maxTrackingDistance = 30f;
		Object.Destroy((Object)(object)((Component)characterPrefab.transform.Find("ModelBase")).gameObject);
		Object.Destroy((Object)(object)((Component)characterPrefab.transform.Find("CameraPivot")).gameObject);
		Object.Destroy((Object)(object)((Component)characterPrefab.transform.Find("AimOrigin")).gameObject);
		GameObject val2 = Assets.MainAssetBundle.LoadAsset<GameObject>("zedMdl");
		zedBehaviour.animator = val2.GetComponent<Animator>();
		PrintController val3 = val2.AddComponent<PrintController>();
		((Behaviour)val3).enabled = false;
		val3.printTime = 0.45f;
		val3.disableWhenFinished = true;
		val3.startingPrintHeight = 7.4f;
		val3.maxPrintHeight = 1.75f;
		val3.startingPrintBias = 1f;
		val3.maxPrintBias = 0f;
		val3.printCurve = AnimationCurve.Linear(0f, 1f, 1f, 0f);
		zedBehaviour.printController = val3;
		GameObject val4 = new GameObject("ModelBase");
		val4.transform.parent = characterPrefab.transform;
		val4.transform.localPosition = new Vector3(0f, -0.94f, 0f);
		val4.transform.localRotation = Quaternion.identity;
		val4.transform.localScale = new Vector3(1f, 1f, 1f);
		GameObject val5 = new GameObject("AimOrigin");
		val5.transform.parent = val4.transform;
		val5.transform.localPosition = new Vector3(0f, 1.2f, 0f);
		val5.transform.localRotation = Quaternion.identity;
		val5.transform.localScale = Vector3.one;
		Transform transform = val2.transform;
		transform.parent = val4.transform;
		transform.localPosition = Vector3.zero;
		transform.localScale = Vector3.one;
		transform.localRotation = Quaternion.identity;
		CharacterDirection component = characterPrefab.GetComponent<CharacterDirection>();
		component.targetTransform = val4.transform;
		component.modelAnimator = val2.GetComponentInChildren<Animator>();
		component.turnSpeed = 720f;
		CharacterBody component2 = characterPrefab.GetComponent<CharacterBody>();
		((Object)component2).name = "ZedBody";
		component2.baseNameToken = "ZED_NAME";
		component2.subtitleNameToken = "ZED_SUBTITLE";
		component2.bodyFlags = (BodyFlags)16;
		component2.rootMotionInMainState = false;
		component2.mainRootSpeed = 0f;
		component2.baseMaxHealth = 110f;
		component2.levelMaxHealth = 35f;
		component2.baseRegen = 1.5f;
		component2.levelRegen = 0.2f;
		component2.baseMaxShield = 0f;
		component2.levelMaxShield = 0f;
		component2.baseMoveSpeed = 7f;
		component2.levelMoveSpeed = 0f;
		component2.baseAcceleration = 110f;
		component2.baseJumpPower = 15f;
		component2.levelJumpPower = 0f;
		component2.baseDamage = 12f;
		component2.levelDamage = 2.4f;
		component2.baseAttackSpeed = 1f;
		component2.levelAttackSpeed = 0f;
		component2.baseCrit = 1f;
		component2.levelCrit = 0f;
		component2.baseArmor = 0f;
		component2.levelArmor = 0f;
		component2.baseJumpCount = 1;
		component2.sprintingSpeedMultiplier = 1.45f;
		component2.wasLucky = false;
		component2.hideCrosshair = false;
		component2.aimOriginTransform = val5.transform;
		component2.hullClassification = (HullClassification)0;
		component2.portraitIcon = (Texture)(object)Assets.MainAssetBundle.LoadAsset<Sprite>("portrait").texture;
		component2.isChampion = false;
		component2.currentVehicle = null;
		component2.skinIndex = 0u;
		component2.bodyColor = characterColor;
		HealthComponent component3 = characterPrefab.GetComponent<HealthComponent>();
		component3.health = component2.baseMaxHealth;
		component3.shield = 0f;
		component3.barrier = 0f;
		CharacterMotor component4 = characterPrefab.GetComponent<CharacterMotor>();
		component4.walkSpeedPenaltyCoefficient = 1f;
		component4.characterDirection = component;
		component4.muteWalkMotion = false;
		component4.mass = 100f;
		component4.airControl = 0.25f;
		component4.disableAirControlUntilCollision = false;
		component4.generateParametersOnAwake = true;
		InputBankTest component5 = characterPrefab.GetComponent<InputBankTest>();
		component5.moveVector = Vector3.zero;
		CameraTargetParams component6 = characterPrefab.GetComponent<CameraTargetParams>();
		component6.cameraParams = val.GetComponent<CameraTargetParams>().cameraParams;
		component6.cameraPivotTransform = null;
		component6.recoil = Vector2.zero;
		component6.dontRaycastToPivot = false;
		ModelLocator component7 = characterPrefab.GetComponent<ModelLocator>();
		component7.modelTransform = transform;
		component7.modelBaseTransform = val4.transform;
		component7.dontReleaseModelOnDeath = false;
		component7.autoUpdateModelTransform = true;
		component7.dontDetatchFromParent = false;
		component7.noCorpse = false;
		component7.normalizeToFloor = false;
		component7.preserveModel = false;
		ChildLocator component8 = val2.GetComponent<ChildLocator>();
		CharacterModel val6 = val2.AddComponent<CharacterModel>();
		SkinnedMeshRenderer[] componentsInChildren = val2.GetComponentsInChildren<SkinnedMeshRenderer>();
		List<RendererInfo> list = new List<RendererInfo>();
		foreach (SkinnedMeshRenderer val7 in componentsInChildren)
		{
			((Renderer)val7).material = Utils.InstantiateMaterial(((Renderer)val7).material.mainTexture);
			list.Add(new RendererInfo
			{
				renderer = (Renderer)(object)val7,
				defaultMaterial = ((Renderer)val7).material,
				defaultShadowCastingMode = (ShadowCastingMode)1,
				ignoreOverlays = false
			});
			if (((Object)val7).name != "base")
			{
				((Component)val7).gameObject.SetActive(false);
			}
		}
		RendererInfo[] array = list.ToArray();
		val6.body = component2;
		val6.baseRendererInfos = array;
		val6.autoPopulateLightInfos = true;
		val6.invisibilityCount = 0;
		val6.temporaryOverlays = new List<TemporaryOverlayInstance>();
		val6.mainSkinnedMeshRenderer = componentsInChildren[0];
		LanguageAPI.Add("ZEDBODY_DEFAULT_SKIN_NAME", "Default");
		LanguageAPI.Add("ZEDBODY_SKIN01_NAME", "Shockblade");
		LanguageAPI.Add("ZEDBODY_SKIN02_NAME", "SKT T1");
		LanguageAPI.Add("ZEDBODY_SKIN03_NAME", "PROJECT");
		LanguageAPI.Add("ZEDBODY_SKIN10_NAME", "Worlds");
		LanguageAPI.Add("ZEDBODY_SKIN11_NAME", "Death Sworn");
		LanguageAPI.Add("ZEDBODY_SKIN13_NAME", "Galaxy Slayer");
		LanguageAPI.Add("ZEDBODY_SKIN15_NAME", "PsyOps");
		LanguageAPI.Add("ZEDBODY_SKIN30_NAME", "Prestige PROJECT");
		LanguageAPI.Add("ZEDBODY_SKIN31_NAME", "Debonair");
		LanguageAPI.Add("ZEDBODY_SKIN38_NAME", "Empyrean");
		LanguageAPI.Add("ZEDBODY_SKIN49_NAME", "Immortal Journey");
		ModelSkinController val8 = val2.AddComponent<ModelSkinController>();
		val8.skins = (SkinDef[])(object)new SkinDef[12]
		{
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "ZEDBODY_DEFAULT_SKIN_NAME", "base", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "ZEDBODY_SKIN01_NAME", "skin01", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "ZEDBODY_SKIN02_NAME", "skin02", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "ZEDBODY_SKIN03_NAME", "skin03", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "ZEDBODY_SKIN10_NAME", "skin10", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "ZEDBODY_SKIN11_NAME", "skin11", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "ZEDBODY_SKIN13_NAME", "skin13", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "ZEDBODY_SKIN15_NAME", "skin15", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "ZEDBODY_SKIN30_NAME", "skin30", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "ZEDBODY_SKIN31_NAME", "skin31", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "ZEDBODY_SKIN38_NAME", "skin38", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "ZEDBODY_SKIN49_NAME", "skin49", array))
		};
		shadowPrefab = PrefabAPI.InstantiateClone(val2, "Shadow", false);
		Collider[] componentsInChildren2 = shadowPrefab.GetComponentsInChildren<Collider>();
		foreach (Collider val9 in componentsInChildren2)
		{
			Object.Destroy((Object)(object)val9);
		}
		shadowPrefab.GetComponent<Animator>().runtimeAnimatorController = Assets.Load<RuntimeAnimatorController>("shadowAnimator");
		CharacterModel component9 = shadowPrefab.GetComponent<CharacterModel>();
		for (int k = 0; k < component9.baseRendererInfos.Length; k++)
		{
			Renderer renderer = component9.baseRendererInfos[k].renderer;
			renderer.material = new Material(renderer.material);
			renderer.material.SetColor("_Color", Color32.op_Implicit(new Color32((byte)100, (byte)100, (byte)100, byte.MaxValue)));
		}
		component9.body = null;
		((Behaviour)component9).enabled = false;
		shadowPrefab.AddComponent<DestroyOnTimer>();
		ObjectSoundPlayer objectSoundPlayer = shadowPrefab.AddComponent<ObjectSoundPlayer>();
		objectSoundPlayer.enableSound = Sounds.Play_sfx_Zed_ZedWShadowBuff_OnBuffActivate;
		objectSoundPlayer.disableSound = Sounds.Play_sfx_Zed_ZedWShadowBuff_OnBuffActivate;
		shadowPrefab.AddComponent<ParticleOnStartAndEnd>();
		ParticleSystem[] componentsInChildren3 = shadowPrefab.GetComponentsInChildren<ParticleSystem>(true);
		foreach (ParticleSystem val10 in componentsInChildren3)
		{
			((Component)val10).gameObject.SetActive(true);
		}
		Collider[] componentsInChildren4 = val2.GetComponentsInChildren<Collider>();
		HurtBoxGroup val11 = val2.AddComponent<HurtBoxGroup>();
		List<HurtBox> list2 = new List<HurtBox>();
		Collider[] array2 = componentsInChildren4;
		foreach (Collider val12 in array2)
		{
			HurtBox val13 = ((Component)val12).gameObject.AddComponent<HurtBox>();
			((Component)val13).gameObject.layer = LayerIndex.entityPrecise.intVal;
			val13.healthComponent = component3;
			val13.isBullseye = true;
			val13.damageModifier = (DamageModifier)0;
			val13.hurtBoxGroup = val11;
			val13.indexInGroup = 0;
			val11.mainHurtBox = val13;
			val11.bullseyeCount = 1;
			list2.Add(val13);
		}
		val11.hurtBoxes = list2.ToArray();
		Utils.CreateHitbox("Slash", val2.transform, new Vector3(5f, 5f, 7.5f), new Vector3(0f, 1f, 2f));
		Utils.CreateHitbox("Spin", val2.transform, Vector3.one * 12f, Vector3.up * 1f);
		KinematicCharacterMotor component10 = characterPrefab.GetComponent<KinematicCharacterMotor>();
		component10.CharacterController = (ICharacterController)(object)component4;
		component10.playerCharacter = true;
		characterPrefab.GetComponent<Interactor>().maxInteractionDistance = 3f;
		characterPrefab.GetComponent<InteractionDriver>().highlightInteractor = true;
		SfxLocator component11 = characterPrefab.GetComponent<SfxLocator>();
		component11.deathSound = "Play_ui_player_death";
		component11.barkSound = "";
		component11.openSound = "";
		component11.landingSound = "Play_char_land";
		component11.fallDamageSound = "Play_char_land_fall_damage";
		component11.aliveLoopStart = "";
		component11.aliveLoopStop = "";
		characterPrefab.GetComponent<Rigidbody>().mass = component4.mass;
		FootstepHandler val14 = val2.AddComponent<FootstepHandler>();
		val14.baseFootstepString = "Play_player_footstep";
		val14.sprintFootstepOverrideString = "";
		val14.enableFootstepDust = true;
		val14.footstepDustPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/VFX/GenericFootstepDust.prefab").WaitForCompletion();
		EntityStateMachine component12 = ((Component)component2).GetComponent<EntityStateMachine>();
		component12.mainStateType = new SerializableEntityStateType(typeof(CharacterMain));
		CharacterDeathBehavior component13 = characterPrefab.GetComponent<CharacterDeathBehavior>();
		component13.deathStateMachine = characterPrefab.GetComponent<EntityStateMachine>();
		component13.deathState = new SerializableEntityStateType(typeof(GenericCharacterDeath));
		Utils.NewStateMachine<Idle>(characterPrefab, "Shadow");
		Utils.NewStateMachine<Idle>(characterPrefab, "Shadow2");
		NetworkStateMachine component14 = ((Component)component2).GetComponent<NetworkStateMachine>();
		component14.stateMachines = ((Component)component2).GetComponents<EntityStateMachine>();
		ContentAddition.AddBody(characterPrefab);
	}

	private void RegisterCharacter()
	{
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		string text = " <style=cSub>\r\n\r\n< ! > \r\n\r\n< ! > \r\n\r\n< ! > \r\n\r\n< ! > \r\n\r\n";
		string text2 = "..and so he left.";
		string text3 = "..and so he vanished.";
		string text4 = "";
		LanguageAPI.Add("ZED_NAME", "Zed");
		LanguageAPI.Add("ZED_DESCRIPTION", text);
		LanguageAPI.Add("ZED_SUBTITLE", "Master of Shadows");
		LanguageAPI.Add("ZED_OUTRO", text2);
		LanguageAPI.Add("ZED_FAIL", text3);
		SurvivorDef val = ScriptableObject.CreateInstance<SurvivorDef>();
		val.cachedName = "ZED_NAME";
		val.unlockableDef = null;
		val.descriptionToken = "ZED_DESCRIPTION";
		val.primaryColor = characterColor;
		val.bodyPrefab = characterPrefab;
		val.displayPrefab = Utils.NewDisplayModel(((Component)characterPrefab.GetComponent<ModelLocator>().modelBaseTransform).gameObject, "ZedDisplay");
		val.outroFlavorToken = "ZED_OUTRO";
		val.desiredSortPosition = 22f;
		val.mainEndingEscapeFailureFlavorToken = "ZED_FAIL";
		ContentAddition.AddSurvivorDef(val);
		SkillSetup();
		GameObject val2 = PrefabAPI.InstantiateClone(Prefabs.Load<GameObject>("RoR2/Base/Merc/MercMonsterMaster.prefab"), "ZedMaster", true);
		ContentAddition.AddMaster(val2);
		CharacterMaster component = val2.GetComponent<CharacterMaster>();
		component.bodyPrefab = characterPrefab;
	}

	private void RegisterStates()
	{
		//IL_0003: 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_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: 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_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		bool flag = default(bool);
		ContentAddition.AddEntityState<Primary>(ref flag);
		ContentAddition.AddEntityState<Primary2>(ref flag);
		ContentAddition.AddEntityState<Secondary>(ref flag);
		ContentAddition.AddEntityState<Utility>(ref flag);
		ContentAddition.AddEntityState<UtilityEnd>(ref flag);
		ContentAddition.AddEntityState<Special>(ref flag);
		ContentAddition.AddEntityState<CharacterMain>(ref flag);
		ContentAddition.AddEntityState<MeleeSkillState>(ref flag);
		ContentAddition.AddEntityState<BasicMeleeSkillState>(ref flag);
	}

	private void SkillSetup()
	{
		GenericSkill[] componentsInChildren = characterPrefab.GetComponentsInChildren<GenericSkill>();
		foreach (GenericSkill val in componentsInChildren)
		{
			Object.DestroyImmediate((Object)(object)val);
		}
		PassiveSetup();
		PrimarySetup();
		SecondarySetup();
		UtilitySetup();
		SpecialSetup();
	}

	private void PassiveSetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("ZED_PASSIVE_NAME", "Contempt for the Weak");
		LanguageAPI.Add("ZED_PASSIVE_DESCRIPTION", "Zed's <style=cIsDamage>Razor Claw</style> hits against targets below <style=cIsHealth>50% maximum health</style> are empowered to deal <style=cIsDamage>10%</style> of the target's <style=cIsHealth>maximum health</style> as bonus damage.");
		component.passiveSkill.enabled = true;
		component.passiveSkill.skillNameToken = "ZED_PASSIVE_NAME";
		component.passiveSkill.skillDescriptionToken = "ZED_PASSIVE_DESCRIPTION";
		component.passiveSkill.icon = Prefabs.passive;
	}

	private void PrimarySetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("ZED_M1", "Razor Claw");
		LanguageAPI.Add("ZED_M1_DESCRIPTION", "Zed performs a combo of slashes, dealing <style=cIsDamage>200%/225%/250%/300%</style>, finishing with a <style=cKeywordName>Shadow Slash</style><style=cSub>");
		LanguageAPI.Add("ZED_M1-2", "Shadow Slash");
		LanguageAPI.Add("ZED_M1-2_DESCRIPTION", "<style=cKeywordName>Shadow Slash</style><style=cSub>Instantly inflicts <style=cIsDamage>Contempt for the Weak</style> if its damage is enough to lower the target's <style=cIsHealth>maximum health</style> below <style=cIsHealth>50%</style>. <style=cEvent>Shadows</style> mirror this ability, inflicting <style=cIsDamage>slow</style> on hit. Successful hits recharge <style=cIsDamage>Living Shadow</style> cooldown by <style=cIsUtility>0.5s</style>.");
		SkillDef skill = Utils.NewSkillDef<ZedSkillDef>(typeof(Primary), "Weapon", 0, 0f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: true, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: false, 0, 0, 0, Assets.MainAssetBundle.LoadAsset<Sprite>("primary"), "ZED_M1_DESCRIPTION", "ZED_M1", new string[1] { "ZED_M1-2_DESCRIPTION" });
		component.primary = Utils.NewGenericSkill(characterPrefab, skill);
	}

	private void SecondarySetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("ZED_M2", "Razor Shuriken");
		LanguageAPI.Add("ZED_M2_DESCRIPTION", "Zed throws a <style=cIsDamage>piercing</style> shuriken in the target direction that deals <style=cIsDamage>420% damage</style>, shadows mirror this ability.");
		SkillDef skill = Utils.NewSkillDef<ZedSkillDef>(typeof(Secondary), "Weapon", 1, 3f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("secondary"), "ZED_M2_DESCRIPTION", "ZED_M2", Array.Empty<string>());
		component.secondary = Utils.NewGenericSkill(characterPrefab, skill);
	}

	private void UtilitySetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("ZED_UTIL", "Living Shadow");
		LanguageAPI.Add("ZED_UTIL_DESCRIPTION", "Zed creates a <style=cEvent>Shadow</style> <style=cIsDamage>15m</style> in the target direction, remaining there for <style=cIsUtility>5.25s</style>. Can be recast to swap places with it.");
		SkillDef skill = Utils.NewSkillDef<ZedSkillDef>(typeof(Utility), "Shadow", 1, 7f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)0, isCombatSkill: false, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("utility"), "ZED_UTIL_DESCRIPTION", "ZED_UTIL", Array.Empty<string>());
		component.utility = Utils.NewGenericSkill(characterPrefab, skill);
	}

	private void SpecialSetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("ZED_SPEC", "Death Mark");
		LanguageAPI.Add("ZED_SPEC_KEYWORD", "<style=cKeywordName>Marked for Death</style><style=cSub>Stores <style=cIsDamage>55%</style> of the damage received, and <style=cIsDamage>inflicts</style>  it at the end of its duration.");
		LanguageAPI.Add("ZED_SPEC_DESCRIPTION", "Zed becomes <style=cIsDamage>untargetable</style> and dashes toward the target, dealing <style=cIsDamage>200% damage</style> and rendering it <style=cKeywordName>Marked for Death</style><style=cSub> for <style=cIsUtility>3s</style>. Zed also spawns a <style=cEvent>Shadow</style> at his casting position for <style=cIsUtility>9s</style>, recasting this ability allows Zed to swap places with it.");
		SkillDef skill = Utils.NewSkillDef<ZedSkillDef>(typeof(Special), "Shadow2", 1, 8f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("special"), "ZED_SPEC_DESCRIPTION", "ZED_SPEC", new string[1] { "ZED_SPEC_KEYWORD" });
		component.special = Utils.NewGenericSkill(characterPrefab, skill);
	}
}
internal class Prefabs
{
	internal static GameObject shurikenGhost;

	internal static GameObject shuriken;

	internal static GameObject hitEffect;

	internal static GameObject critEffect;

	internal static GameObject spinHitEffect;

	internal static GameObject spinEffect;

	internal static GameObject spinEffectShadow;

	internal static GameObject slashEffect;

	internal static GameObject thrustEffect;

	internal static GameObject shurikenHitEffect;

	internal static GameObject ultHitEffect;

	internal static GameObject ultExecuteEffect;

	internal static GameObject ultInflictEffect;

	internal static GameObject ultSpawnEffect;

	internal static GameObject shadowDespawnEffect;

	internal static GameObject indicator;

	internal static GameObject ultIndicator;

	internal static BuffDef passiveAvailable;

	internal static BuffDef passiveUnavailable;

	internal static BuffDef mark;

	internal static Sprite passive;

	internal static ModdedDamageType execute;

	internal static GameObject shadowSpawnEffect { get; set; }

	internal static T Load<T>(string path)
	{
		//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)
		return Addressables.LoadAssetAsync<T>((object)path).WaitForCompletion();
	}

	internal static GameObject Instantiate(string path, string name, bool registerNetwork = false)
	{
		return PrefabAPI.InstantiateClone(Load<GameObject>(path), name, registerNetwork);
	}

	internal static void CreatePrefabs()
	{
		//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_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e6: Expected O, but got Unknown
		//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_019f: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a9: Expected O, but got Unknown
		//IL_01b6: 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_02b6: Expected O, but got Unknown
		//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
		execute = DamageAPI.ReserveDamageType();
		passive = Assets.MainAssetBundle.LoadAsset<Sprite>("passive");
		passiveAvailable = Utils.NewBuffDef("Contempt for the Weak", stack: false, hidden: false, passive, Color.white);
		passiveUnavailable = Utils.NewBuffDef("Contempt for the Weak", stack: false, hidden: false, passive, Color.red);
		mark = Utils.NewBuffDef("Death Mark", stack: false, hidden: false, Assets.MainAssetBundle.LoadAsset<Sprite>("shadowninja_r2"), Color.white);
		mark.isDebuff = true;
		hitEffect = Instantiate("RoR2/Base/Loader/OmniImpactVFXLoaderLightning.prefab", "HitEffect");
		Object.Destroy((Object)(object)hitEffect.GetComponent<OmniEffect>());
		ParticleSystemRenderer[] componentsInChildren = hitEffect.GetComponentsInChildren<ParticleSystemRenderer>(true);
		foreach (ParticleSystemRenderer val in componentsInChildren)
		{
			((Component)val).gameObject.SetActive(true);
			((Renderer)val).material = new Material(((Renderer)val).material);
			((Renderer)val).material.SetColor("_TintColor", Color32.op_Implicit(new Color32((byte)200, (byte)0, (byte)0, byte.MaxValue)));
			((Renderer)val).material.DisableKeyword("VERTEXCOLOR");
		}
		Utils.RegisterEffect(hitEffect, -1f, "Play_sfx_Zed_ZedBasicAttack_OnHit");
		spinHitEffect = Instantiate("RoR2/Base/Merc/OmniImpactVFXSlashMerc.prefab", "SpinHitEffect");
		Object.Destroy((Object)(object)spinHitEffect.GetComponent<OmniEffect>());
		ParticleSystemRenderer[] componentsInChildren2 = spinHitEffect.GetComponentsInChildren<ParticleSystemRenderer>(true);
		foreach (ParticleSystemRenderer val2 in componentsInChildren2)
		{
			((Component)val2).gameObject.SetActive(true);
			((Renderer)val2).material = new Material(((Renderer)val2).material);
			((Renderer)val2).material.SetColor("_TintColor", Color.red);
			((Renderer)val2).material.SetTexture("_RemapTex", (Texture)(object)Load<Texture2D>("RoR2/DLC1/VoidRaidCrab/texVoidRaidCrabTripleBeamDecalRamp.png"));
		}
		Utils.RegisterEffect(spinHitEffect, -1f, "Play_sfx_Zed_ZedE_hit");
		critEffect = Instantiate("RoR2/Base/Commando/OmniExplosionVFXFMJ.prefab", "CritHitEffect");
		Object.Destroy((Object)(object)critEffect.GetComponent<OmniEffect>());
		ParticleSystemRenderer[] componentsInChildren3 = critEffect.GetComponentsInChildren<ParticleSystemRenderer>(true);
		foreach (ParticleSystemRenderer val3 in componentsInChildren3)
		{
			string name = ((Object)val3).name;
			((Component)val3).gameObject.SetActive(name != "Unscaled Flames" && name != "Chunks (1)");
			if (name == "Dash, Bright")
			{
				((Renderer)val3).material = Load<Material>("RoR2/DLC1/VoidSurvivor/matVoidSurvivorSuppressBeamBillboard.mat");
				continue;
			}
			((Renderer)val3).material = new Material(((Renderer)val3).material);
			((Renderer)val3).material.SetColor("_TintColor", Color.red);
			((Renderer)val3).material.SetTexture("_RemapTex", (Texture)(object)Load<Texture2D>("RoR2/DLC1/VoidRaidCrab/texVoidRaidCrabTripleBeamDecalRamp.png"));
		}
		Utils.RegisterEffect(critEffect, -1f);
		indicator = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("Indicator"), "Indicator", false);
		Utils.AddRotationComponent(((Component)indicator.transform.GetChild(0)).gameObject, -140f, (RotationAxis)2);
		ultIndicator = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("ultIndicator"), "UltIndicator", false);
		GameObject val4 = Assets.Load<GameObject>("spinEffect");
		spinEffect = PrefabAPI.InstantiateClone(val4, "SpinEffect", false);
		Utils.RegisterEffect(spinEffect, 0.7f);
		spinEffectShadow = PrefabAPI.InstantiateClone(val4, "SpinEffect", false);
		spinEffectShadow.AddComponent<DestroyOnTimer>().duration = 0.7f;
		slashEffect = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("slashFX"), "SlashEffect", false);
		Utils.RegisterEffect(slashEffect, 0.35f, "", applyScale: true);
		thrustEffect = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("thrustEffect"), "ThrustEffect", false);
		Utils.RegisterEffect(thrustEffect, 0.31f, "", applyScale: true);
		shurikenHitEffect = Instantiate("RoR2/DLC1/PrimarySkillShuriken/ShurikenImpact.prefab", "ShurikenHitEffect");
		Utils.RegisterEffect(shurikenHitEffect, -1f, "Play_sfx_Zed_ZedShurikenMisOne_hit");
		ultInflictEffect = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("ultInflict"), "UltInflictEffect", false);
		ultInflictEffect.AddComponent<DestroyOnTimer>().duration = 3.35f;
		ultSpawnEffect = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("zedSpawn"), "UltSpawnEffect", false);
		Utils.RegisterEffect(ultSpawnEffect, 0.9f);
		shadowSpawnEffect = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("shadowSpawn"), "ShadowSpawnEffect", false);
		shadowSpawnEffect.AddComponent<DestroyOnTimer>().duration = 0.9f;
		shadowDespawnEffect = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("shadowDespawn"), "ShadowDespawnEffect", false);
		Utils.RegisterEffect(shadowDespawnEffect, 0.9f);
		ultHitEffect = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("ultHit"), "UltHitEffect", false);
		Utils.RegisterEffect(ultHitEffect, 0.55f, "Play_sfx_Zed_ZedUltExecute_buffdeactivate");
		ultExecuteEffect = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("executeHit"), "UltExecuteEffect", false);
		Utils.RegisterEffect(ultExecuteEffect, 0.75f, "Play_sfx_Zed_ZedUlt_hit");
		shurikenGhost = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("shuriken"), "ShurikenProjectileGhost", false);
		shurikenGhost.AddComponent<ProjectileGhostController>();
		ChildLocator component = shurikenGhost.GetComponent<ChildLocator>();
		Utils.AddScaleComponent(((Component)component.FindChild("scaler")).gameObject, 0.1f);
		Utils.AddRotationComponent(((Component)component.FindChild("shurikenR")).gameObject, 45f, (RotationAxis)2);
		Utils.AddRotationComponent(((Component)component.FindChild("shurikenL")).gameObject, -45f, (RotationAxis)2);
		shuriken = Instantiate("RoR2/Base/Commando/FMJRamping.prefab", "ShurikenProjectile", registerNetwork: true);
		ProjectileController component2 = shuriken.GetComponent<ProjectileController>();
		component2.ghostPrefab = shurikenGhost;
		component2.startSound = "Play_sfx_Zed_ZedQMissile_OnMissileLaunch";
		shuriken.GetComponent<ProjectileSimple>().lifetime = 0.4f;
		Object.Destroy((Object)(object)shuriken.GetComponent<ProjectileOverlapAttack>());
		ProjectileOverlapAttack val5 = shuriken.AddComponent<ProjectileOverlapAttack>();
		val5.impactEffect = shurikenHitEffect;
		val5.ScaleVelocitySource = shuriken.GetComponent<Rigidbody>();
		val5.damageCoefficient = 1f;
		ContentAddition.AddProjectile(shuriken);
	}
}
internal class BasicMeleeSkillState : BaseSkillState
{
	private float duration = 0.2f;

	private Vector3 dir;

	private OverlapAttack attack;

	private float damageCoefficient = 4.2f;

	private GameObject hitEffectPrefab = null;

	private bool parried;

	public Animator animator;

	private uint ID;

	private string hitboxGroupName = "";

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		animator = ((EntityState)this).GetModelAnimator();
		if (!animator.GetBool("slide"))
		{
			((BaseState)this).StartAimMode(1f, true);
		}
		((EntityState)this).PlayAnimation("LeftArm, Override", "MeleeAttack");
		AkSoundEngine.PostEvent(ID, ((EntityState)this).gameObject);
		attack = ((BaseState)this).InitMeleeOverlap(damageCoefficient, hitEffectPrefab, ((EntityState)this).GetModelTransform(), hitboxGroupName);
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).isAuthority)
		{
			attack.Fire((List<HurtBox>)null);
		}
		if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	public override void OnExit()
	{
		((EntityState)this).OnExit();
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)1;
	}
}
internal class CharacterMain : GenericCharacterMain
{
	public override void FixedUpdate()
	{
		((GenericCharacterMain)this).FixedUpdate();
		((BaseCharacterMain)this).modelAnimator.SetBool("inCombat", ((EntityState)this).characterBody.outOfCombat);
	}
}
internal class MeleeSkillState : BaseSkillState
{
	public float attackDuration;

	private bool hopped;

	private bool hasSwung;

	public bool isInHitPause;

	public float hitPauseDuration;

	public float hopVelocity;

	public float hitPauseTimer;

	public float stopwatch;

	public HitStopCachedState hitStopCachedState;

	public OverlapAttack overlapAttack;

	public bool hasHit;

	private bool hasAnimParameter;

	private float attackSpeedScaling;

	public Animator animator;

	public virtual float baseAttackDuration => 0f;

	public virtual float earlyExitDurationPercentage => 0f;

	public virtual float damageCoefficient => 0f;

	public virtual float forceMagnitude => 440f;

	public virtual float rootMotionSpeed => 25f;

	public virtual float baseHopVelocity => 4f;

	public virtual string layerName => "Gesture, Override";

	public virtual string animationStateName => "";

	public virtual string animParameter => "M1";

	public virtual string hitBoxGroupName => "";

	public virtual string hitBoxActiveParameter => "Curve";

	public virtual string swingMuzzle => "";

	public virtual GameObject swingEffectPrefab => null;

	public virtual bool hopOnHit => true;

	public virtual bool rootMotion => false;

	public virtual bool rootMotionWhileHitting => false;

	public virtual uint swingSound => 0u;

	public virtual DamageType damageType => (DamageType)0;

	public virtual DamageColorIndex damageColor => (DamageColorIndex)0;

	public virtual Vector3 bonusForce => Vector3.zero;

	public virtual GameObject hitEffectPrefab => null;

	public override void OnEnter()
	{
		//IL_00b4: 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)
		((BaseState)this).OnEnter();
		attackSpeedScaling = Math.Min(((BaseState)this).attackSpeedStat, 5.95f);
		attackDuration = baseAttackDuration / attackSpeedScaling;
		hitPauseDuration = GroundLight.hitPauseDuration / attackSpeedScaling;
		hopVelocity = baseHopVelocity / attackSpeedScaling;
		animator = ((EntityState)this).GetModelAnimator();
		animator.SetFloat(hitBoxActiveParameter, 0f);
		overlapAttack = ((BaseState)this).InitMeleeOverlap(damageCoefficient, hitEffectPrefab, ((EntityState)this).GetModelTransform(), hitBoxGroupName);
		overlapAttack.pushAwayForce = 1f;
		overlapAttack.damageType = DamageTypeCombo.op_Implicit(damageType);
		hasAnimParameter = !Utility.IsNullOrWhiteSpace(animParameter);
		if (hasAnimParameter && !Utility.IsNullOrWhiteSpace(animationStateName))
		{
			((EntityState)this).PlayAnimation(layerName, animationStateName, animParameter, attackDuration, 0f);
		}
	}

	public virtual Vector3 rootMotionDirection()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		return ((EntityState)this).characterDirection.forward;
	}

	public override void FixedUpdate()
	{
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_010c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0111: Unknown result type (might be due to invalid IL or missing references)
		//IL_0115: Unknown result type (might be due to invalid IL or missing references)
		//IL_0121: Unknown result type (might be due to invalid IL or missing references)
		//IL_0134: Unknown result type (might be due to invalid IL or missing references)
		//IL_0139: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: 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_0150: 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_017b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).isAuthority)
		{
			bool flag = FireMeleeAttack(overlapAttack, animator, hitBoxActiveParameter, forceMagnitude, bonusForce);
			hasHit = flag;
			if (hasHit)
			{
				if (hopOnHit && !((EntityState)this).characterMotor.isGrounded && !hopped)
				{
					((BaseState)this).SmallHop(((EntityState)this).characterMotor, hopVelocity);
					hopped = true;
				}
				if (!rootMotionWhileHitting && !isInHitPause && hasAnimParameter)
				{
					hitStopCachedState = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, animParameter);
					isInHitPause = true;
				}
			}
			if (animator.GetFloat(hitBoxActiveParameter) > 0.1f && rootMotion && !isInHitPause)
			{
				Vector3 val = rootMotionDirection();
				Vector3 val2 = default(Vector3);
				((Vector3)(ref val2))..ctor(val.x, 0f, val.z);
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				characterMotor.rootMotion += val2 * rootMotionSpeed * Time.fixedDeltaTime;
			}
			if (hitPauseTimer >= hitPauseDuration && isInHitPause)
			{
				((BaseState)this).ConsumeHitStopCachedState(hitStopCachedState, ((EntityState)this).characterMotor, animator);
				isInHitPause = false;
				animator.speed = 1f;
			}
			if (!isInHitPause)
			{
				stopwatch += Time.fixedDeltaTime;
			}
			else
			{
				hitPauseTimer += Time.fixedDeltaTime;
				((EntityState)this).characterMotor.velocity = Vector3.zero;
				animator.speed = 0f;
			}
			if (stopwatch >= attackDuration * earlyExitDurationPercentage)
			{
				if (((EntityState)this).inputBank.skill1.down)
				{
					SetState();
				}
				if (stopwatch >= attackDuration)
				{
					BaseSkillState val3 = StateOverride();
					if (val3 != null)
					{
						((EntityState)this).outer.SetNextState((EntityState)(object)val3);
					}
					else
					{
						((EntityState)this).outer.SetNextStateToMain();
					}
					return;
				}
			}
		}
		if (animator.GetFloat(hitBoxActiveParameter) >= 0.11f && !hasSwung)
		{
			hasSwung = true;
			AkSoundEngine.PostEvent(swingSound, ((EntityState)this).gameObject);
			if (Object.op_Implicit((Object)(object)swingEffectPrefab) && !Utility.IsNullOrWhiteSpace(swingMuzzle))
			{
				EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, swingMuzzle, false);
			}
		}
	}

	public bool FireMeleeAttack(OverlapAttack attack, Animator animator, string mecanimHitboxActiveParameter, float forceMagnitude, Vector3 bonusForce)
	{
		//IL_0050: 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_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: 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)
		bool result = false;
		if (Object.op_Implicit((Object)(object)animator) && animator.GetFloat(mecanimHitboxActiveParameter) > 0.1f)
		{
			attack.forceVector = (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? ((EntityState)this).characterDirection.forward : (((EntityState)this).transform.forward * forceMagnitude + bonusForce));
			result = attack.Fire((List<HurtBox>)null);
		}
		return result;
	}

	public virtual void SetState()
	{
	}

	public virtual BaseSkillState StateOverride()
	{
		return null;
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)1;
	}
}
internal class Primary2 : MeleeSkillState
{
	private ZedBehaviour behaviour;

	private bool hasFired;

	public override string animationStateName => "Spin";

	public override float baseAttackDuration => 0.6f;

	public override GameObject hitEffectPrefab => Prefabs.spinHitEffect;

	public override string hitBoxGroupName => "Spin";

	public override float baseHopVelocity => 9f;

	public override float damageCoefficient => 2.45f;

	public override uint swingSound => Sounds.Play_sfx_Zed_ZedE_cast;

	public override DamageType damageType => (DamageType)64;

	public override void OnEnter()
	{
		base.OnEnter();
		behaviour = ((EntityState)this).GetComponent<ZedBehaviour>();
		if (behaviour.shadows.Count <= 0)
		{
			return;
		}
		foreach (GameObject shadow in behaviour.shadows)
		{
			if (Object.op_Implicit((Object)(object)shadow))
			{
				AkSoundEngine.PostEvent(Sounds.Play_sfx_Zed_ZedE_cast, shadow);
				Utils.PlayAnimation(shadow, layerName, animationStateName, animParameter, attackDuration);
			}
		}
	}

	public override void FixedUpdate()
	{
		//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_009b: 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_00a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: 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_00ca: 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_00e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f3: 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_00fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0101: Unknown result type (might be due to invalid IL or missing references)
		//IL_0106: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0116: Unknown result type (might be due to invalid IL or missing references)
		//IL_011c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0121: Unknown result type (might be due to invalid IL or missing references)
		//IL_0126: Unknown result type (might be due to invalid IL or missing references)
		base.FixedUpdate();
		if (!((EntityState)this).isAuthority || hasFired || !(animator.GetFloat("Curve") >= 0.11f))
		{
			return;
		}
		hasFired = true;
		if (behaviour.shadows.Count <= 0)
		{
			return;
		}
		foreach (GameObject shadow in behaviour.shadows)
		{
			if (Object.op_Implicit((Object)(object)shadow))
			{
				new BlastAttack
				{
					position = shadow.transform.position,
					radius = 8f,
					attacker = ((EntityState)this).gameObject,
					inflictor = ((EntityState)this).gameObject,
					attackerFiltering = (AttackerFiltering)2,
					baseDamage = ((BaseState)this).damageStat * damageCoefficient,
					crit = overlapAttack.isCrit,
					falloffModel = (FalloffModel)0,
					damageType = DamageTypeCombo.op_Implicit(damageType),
					procCoefficient = 1f,
					impactEffect = EffectCatalog.FindEffectIndexFromPrefab(Prefabs.spinHitEffect)
				}.Fire();
			}
		}
	}
}
internal class Primary : MeleeSkillState
{
	public int attackIndex = 1;

	private bool spawnEffect = true;

	private ZedBehaviour behaviour;

	private bool hasFired;

	public override float baseAttackDuration => (attackIndex == 4) ? 0.65f : 0.5f;

	public override float earlyExitDurationPercentage => 0.82f;

	public override string animationStateName => (attackIndex == 4) ? "Spin" : ("Attack" + attackIndex);

	public override string hitBoxGroupName => (attackIndex == 4) ? "Spin" : "Slash";

	public override float damageCoefficient => (attackIndex == 4) ? 3f : (2f + (float)attackIndex * 0.25f);

	public override uint swingSound => (attackIndex == 4) ? Sounds.Play_sfx_Zed_ZedE_cast : Sounds.Play_sfx_Zed_ZedBasicAttack_OnCast;

	public override float baseHopVelocity => (attackIndex == 4) ? 9 : 4;

	public override GameObject hitEffectPrefab => (attackIndex == 4) ? Prefabs.spinHitEffect : Prefabs.hitEffect;

	public override string swingMuzzle => "swingMuzzle" + attackIndex;

	public override GameObject swingEffectPrefab
	{
		get
		{
			switch (attackIndex)
			{
			case 1:
			case 2:
				return Prefabs.slashEffect;
			case 3:
				return Prefabs.thrustEffect;
			case 4:
				return Prefabs.spinEffect;
			default:
				return null;
			}
		}
	}

	public override DamageType damageType => (DamageType)((attackIndex == 4) ? 64 : 262144);

	public override void OnSerialize(NetworkWriter writer)
	{
		((BaseSkillState)this).OnSerialize(writer);
		writer.Write(attackIndex);
	}

	public override void OnDeserialize(NetworkReader reader)
	{
		((BaseSkillState)this).OnDeserialize(reader);
		attackIndex = reader.ReadInt32();
	}

	public override void OnEnter()
	{
		base.OnEnter();
		behaviour = ((EntityState)this).GetComponent<ZedBehaviour>();
		if (attackIndex != 4 || behaviour.shadows.Count <= 0)
		{
			return;
		}
		foreach (GameObject shadow in behaviour.shadows)
		{
			if (Object.op_Implicit((Object)(object)shadow))
			{
				AkSoundEngine.PostEvent(Sounds.Play_sfx_Zed_ZedE_cast, shadow);
				Utils.PlayAnimation(shadow, layerName, animationStateName, animParameter, attackDuration);
			}
		}
	}

	public override void SetState()
	{
		if (attackIndex != 4)
		{
			Primary primary = new Primary();
			primary.attackIndex = attackIndex + 1;
			((EntityState)this).outer.SetNextState((EntityState)(object)primary);
		}
	}

	public override void FixedUpdate()
	{
		//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: 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_00eb: 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_0100: Unknown result type (might be due to invalid IL or missing references)
		//IL_010c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0118: Unknown result type (might be due to invalid IL or missing references)
		//IL_011a: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0132: 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_0145: 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_014c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0152: Unknown result type (might be due to invalid IL or missing references)
		//IL_0153: Unknown result type (might be due to invalid IL or missing references)
		//IL_0158: Unknown result type (might be due to invalid IL or missing references)
		//IL_015d: 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_016f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0174: Unknown result type (might be due to invalid IL or missing references)
		//IL_0179: 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_0189: Unknown result type (might be due to invalid IL or missing references)
		base.FixedUpdate();
		if (attackIndex == 4 && !hasFired && animator.GetFloat("Curve") >= 0.11f)
		{
			hasFired = true;
			if (behaviour.shadows.Count > 0)
			{
				foreach (GameObject shadow in behaviour.shadows)
				{
					if (Object.op_Implicit((Object)(object)shadow))
					{
						Transform val = shadow.GetComponent<ChildLocator>().FindChild(swingMuzzle);
						GameObject val2 = Object.Instantiate<GameObject>(Prefabs.spinEffectShadow, val.position, Quaternion.identity, val);
						val2.transform.localRotation = Quaternion.identity;
						if (((EntityState)this).isAuthority)
						{
							new BlastAttack
							{
								position = shadow.transform.position,
								radius = 8f,
								attacker = ((EntityState)this).gameObject,
								inflictor = ((EntityState)this).gameObject,
								attackerFiltering = (AttackerFiltering)2,
								baseDamage = ((BaseState)this).damageStat * damageCoefficient,
								crit = overlapAttack.isCrit,
								falloffModel = (FalloffModel)0,
								damageType = DamageTypeCombo.op_Implicit((DamageType)(damageType | 8)),
								procCoefficient = 1f,
								teamIndex = ((EntityState)this).teamComponent.teamIndex,
								impactEffect = EffectCatalog.FindEffectIndexFromPrefab(Prefabs.spinHitEffect)
							}.Fire();
						}
					}
				}
			}
		}
		if (spawnEffect && animator.GetFloat("Curve") >= 0.11f)
		{
			spawnEffect = false;
		}
	}

	public override void OnExit()
	{
		((EntityState)this).OnExit();
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)1;
	}
}
internal class Secondary : BaseSkillState
{
	private float duration;

	private float baseDuration = 0.55f;

	private Animator animator;

	private bool hasFired;

	private float damageCoefficient = 4.2f;

	private ZedBehaviour behaviour;

	public override void OnEnter()
	{
		//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c9: 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)
		((BaseState)this).OnEnter();
		behaviour = ((EntityState)this).GetComponent<ZedBehaviour>();
		duration = baseDuration / ((BaseState)this).attackSpeedStat;
		animator = ((EntityState)this).GetModelAnimator();
		animator.SetFloat("Curve", 0f);
		((EntityState)this).PlayAnimation("Gesture, Override", "Shuriken", "M2", duration, 0f);
		if (behaviour.shadows.Count > 0)
		{
			foreach (GameObject shadow in behaviour.shadows)
			{
				if (Object.op_Implicit((Object)(object)shadow))
				{
					AkSoundEngine.PostEvent(Sounds.Play_sfx_Zed_ZedQ_OnCast, shadow);
					Transform transform = shadow.transform;
					Ray aimRay = ((BaseState)this).GetAimRay();
					transform.forward = Utils.GetForwardDirection(((Ray)(ref aimRay)).direction);
					Utils.PlayAnimation(shadow, "Gesture, Override", "Shuriken", "M2", duration);
				}
			}
		}
		AkSoundEngine.PostEvent(Sounds.Play_sfx_Zed_ZedQ_OnCast, ((EntityState)this).gameObject);
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (animator.GetFloat("Curve") > 0.1f && !hasFired)
		{
			hasFired = true;
			Fire();
		}
		if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	private void Fire()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: 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_00a8: 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_00b0: 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_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: 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 (!((EntityState)this).isAuthority)
		{
			return;
		}
		Ray aimRay = ((BaseState)this).GetAimRay();
		FireProjectile(((Ray)(ref aimRay)).origin, ((Ray)(ref aimRay)).direction);
		RaycastHit val = default(RaycastHit);
		bool flag = Physics.Raycast(aimRay, ref val, 48f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask));
		if (behaviour.shadows.Count <= 0)
		{
			return;
		}
		foreach (GameObject shadow in behaviour.shadows)
		{
			if (Object.op_Implicit((Object)(object)shadow))
			{
				Vector3 position = shadow.GetComponent<ChildLocator>().FindChild("shurikenMuzzle").position;
				Vector3 dir;
				if (!flag)
				{
					dir = ((Ray)(ref aimRay)).direction;
				}
				else
				{
					Vector3 val2 = ((RaycastHit)(ref val)).point - position;
					dir = ((Vector3)(ref val2)).normalized;
				}
				FireProjectile(position, dir);
			}
		}
	}

	private void FireProjectile(Vector3 pos, Vector3 dir)
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		ProjectileManager.instance.FireProjectile(Prefabs.shuriken, pos, Util.QuaternionSafeLookRotation(dir), ((EntityState)this).gameObject, ((BaseState)this).damageStat * damageCoefficient, 125f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f);
	}

	public override void OnExit()
	{
		((EntityState)this).OnExit();
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)2;
	}
}
internal class Special : BaseSkillState
{
	private float transitionDuration = 0.45f;

	private float dashDuration = 0.35f;

	private float duration = 9f;

	private ZedBehaviour behaviour;

	private ZedTracker tracker;

	private HurtBox target;

	private float targetRadius;

	private Vector3 targetPos;

	private bool dashStopped;

	private Vector3 startPos;

	private AnimationCurve curve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);

	private HurtBoxGroup hurtBoxGroup;

	private int collidableLayers;

	private CharacterModel characterModel;

	private bool transitionOver;

	private GameObject shadow;

	private EntityStateMachine bodyMachine;

	private AimRequest request;

	private Vector3 castingPos;

	private bool skipped;

	public override void OnEnter()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a2: 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_00bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: 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_00e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_012e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0133: Unknown result type (might be due to invalid IL or missing references)
		//IL_0137: Unknown result type (might be due to invalid IL or missing references)
		//IL_013c: 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_01a8: 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_01c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0115: Expected O, but got Unknown
		//IL_023e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0249: Unknown result type (might be due to invalid IL or missing references)
		//IL_024e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0253: Unknown result type (might be due to invalid IL or missing references)
		//IL_0256: Unknown result type (might be due to invalid IL or missing references)
		//IL_025b: Unknown result type (might be due to invalid IL or missing references)
		((BaseState)this).OnEnter();
		castingPos = ((EntityState)this).transform.position;
		behaviour = ((EntityState)this).GetComponent<ZedBehaviour>();
		behaviour.PrintOut();
		behaviour.canExecute = false;
		tracker = ((EntityState)this).GetComponent<ZedTracker>();
		target = ((HuntressTracker)tracker).trackingTarget;
		if (!Object.op_Implicit((Object)(object)target))
		{
			skipped = true;
			((EntityState)this).skillLocator.special.AddOneStock();
			((EntityState)this).outer.SetNextStateToMain();
			return;
		}
		Vector3 position = ((Component)target).transform.position;
		Vector3 val = ((EntityState)this).transform.position - ((Component)target).transform.position;
		targetPos = position + ((Vector3)(ref val)).normalized * 1f * targetRadius;
		bodyMachine = ((EntityState)this).GetComponent<EntityStateMachine>();
		if (((EntityState)this).isAuthority)
		{
			bodyMachine.SetNextState((EntityState)new Idle());
		}
		float maxRadius = behaviour.maxRadius;
		Bounds bounds = target.collider.bounds;
		val = ((Bounds)(ref bounds)).size;
		targetRadius = Math.Min(maxRadius, ((Vector3)(ref val)).magnitude);
		startPos = ((EntityState)this).transform.position;
		hurtBoxGroup = ((Component)((EntityState)this).GetModelTransform()).GetComponent<HurtBoxGroup>();
		int hurtBoxesDeactivatorCounter = hurtBoxGroup.hurtBoxesDeactivatorCounter + 1;
		hurtBoxGroup.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter;
		characterModel = ((Component)hurtBoxGroup).GetComponent<CharacterModel>();
		collidableLayers = LayerMask.op_Implicit(((BaseCharacterController)((EntityState)this).characterMotor).Motor.CollidableLayers);
		((BaseCharacterController)((EntityState)this).characterMotor).Motor.CollidableLayers = LayerMask.op_Implicit(0);
		((EntityState)this).characterMotor.useGravity = false;
		((EntityState)this).characterMotor.isFlying = true;
		((EntityState)this).PlayAnimation("Body", "Special", "Special", transitionDuration, 0f);
		if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams))
		{
			request = ((EntityState)this).cameraTargetParams.RequestAimType((AimType)2);
		}
		CharacterDirection characterDirection = ((EntityState)this).characterDirection;
		val = ((Component)target).transform.position - ((EntityState)this).transform.position;
		characterDirection.forward = Utils.GetForwardDirection(((Vector3)(ref val)).normalized);
		AkSoundEngine.PostEvent(Sounds.Play_sfx_Zed_ZedR_OnCast, ((EntityState)this).gameObject);
	}

	public override void FixedUpdate()
	{
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: 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_00b8: 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_00bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0136: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Unknown result type (might be due to invalid IL or missing references)
		//IL_0151: 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_015b: 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_0163: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_021e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0224: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0505: Unknown result type (might be due to invalid IL or missing references)
		//IL_0507: Unknown result type (might be due to invalid IL or missing references)
		//IL_0511: Unknown result type (might be due to invalid IL or missing references)
		//IL_0516: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d4: 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_038e: Unknown result type (might be due to invalid IL or missing references)
		//IL_039a: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b8: 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_03d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_03da: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e7: Expected O, but got Unknown
		//IL_040a: Unknown result type (might be due to invalid IL or missing references)
		//IL_040f: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).FixedUpdate();
		if (skipped)
		{
			return;
		}
		if (!transitionOver && ((EntityState)this).fixedAge >= transitionDuration && Object.op_Implicit((Object)(object)target))
		{
			transitionOver = true;
			((EntityState)this).fixedAge = 0f;
			CharacterModel obj = characterModel;
			obj.invisibilityCount++;
			GameObject shadowPrefab = MainPlugin.shadowPrefab;
			Vector3 val = castingPos;
			Vector3 val2;
			Vector3 val3;
			if (!Object.op_Implicit((Object)(object)target))
			{
				val2 = ((EntityState)this).characterDirection.forward;
			}
			else
			{
				val3 = ((Component)target).transform.position - ((EntityState)this).transform.position;
				val2 = Utils.GetForwardDirection(((Vector3)(ref val3)).normalized);
			}
			shadow = Object.Instantiate<GameObject>(shadowPrefab, val, Util.QuaternionSafeLookRotation(val2));
			shadow.GetComponent<DestroyOnTimer>().duration = duration;
			shadow.GetComponent<ModelSkinController>().ApplySkin((int)((EntityState)this).characterBody.skinIndex);
			behaviour.shadows.Add(shadow);
			behaviour.secondaryShadow = shadow;
			GameObject ultInflictEffect = Prefabs.ultInflictEffect;
			Vector3 position = ((Component)target).transform.position;
			val3 = ((EntityState)this).transform.position - ((Component)target).transform.position;
			Object.Instantiate<GameObject>(ultInflictEffect, position, Util.QuaternionSafeLookRotation(((Vector3)(ref val3)).normalized), ((Component)target).transform);
		}
		if (Object.op_Implicit((Object)(object)target) && target.healthComponent.alive)
		{
			if (!dashStopped && transitionOver)
			{
				((EntityState)this).characterMotor.velocity = Vector3.zero;
				float num = curve.Evaluate(((EntityState)this).fixedAge / dashDuration);
				((BaseCharacterController)((EntityState)this).characterMotor).Motor.SetPosition(Vector3.Lerp(startPos, targetPos, num), true);
			}
			if (((EntityState)this).fixedAge > dashDuration && ((EntityState)this).transform.position == targetPos && !dashStopped)
			{
				dashStopped = true;
				behaviour.canExecute = true;
				AkSoundEngine.PostEvent(Sounds.Play_sfx_Zed_ZedUltExecute_buffactiavte, ((Component)target).gameObject);
				AkSoundEngine.PostEvent(Sounds.Play_sfx_Zed_ZedPBAOE_buffactivate, ((Component)target).gameObject);
				behaviour.PrintIn();
				((EntityState)this).PlayAnimation("Gesture, Override", "Attack1", "M1", dashDuration, 0f);
				((EntityState)this).fixedAge = 0f;
				((BaseCharacterController)((EntityState)this).characterMotor).Motor.CollidableLayers = LayerMask.op_Implicit(collidableLayers);
				((EntityState)this).characterMotor.useGravity = true;
				((EntityState)this).characterMotor.isFlying = false;
				int hurtBoxesDeactivatorCounter = hurtBoxGroup.hurtBoxesDeactivatorCounter - 1;
				hurtBoxGroup.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter;
				CharacterModel obj2 = characterModel;
				obj2.invisibilityCount--;
				tracker.UpdateIndicator(((Component)target).transform);
				if (NetworkServer.active)
				{
					target.healthComponent.body.AddTimedBuff(Prefabs.mark, 3f);
					((Component)target.healthComponent).gameObject.AddComponent<DamageAccumulator>().owner = ((EntityState)this).gameObject;
					DamageInfo val4 = new DamageInfo
					{
						attacker = ((EntityState)this).gameObject,
						inflictor = ((EntityState)this).gameObject,
						damage = ((BaseState)this).damageStat * 2f,
						crit = ((BaseState)this).RollCrit(),
						position = ((Component)target).transform.position,
						procCoefficient = 1f
					};
					target.healthComponent.TakeDamage(val4);
					EffectManager.SimpleEffect(Prefabs.hitEffect, ((Component)target).transform.position, Quaternion.identity, true);
				}
				request.Dispose();
				if (((EntityState)this).isAuthority)
				{
					bodyMachine.SetNextStateToMain();
				}
			}
		}
		else if (((EntityState)this).isAuthority && !dashStopped)
		{
			((EntityState)this).skillLocator.special.AddOneStock();
			((EntityState)this).outer.SetNextStateToMain();
		}
		if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)shadow) && dashStopped && ((EntityState)this).fixedAge >= 0.25f && ((EntityState)this).inputBank.skill4.down)
		{
			Vector3 position2 = shadow.transform.position;
			behaviour.CallCmdRepositionShadow(1, ((EntityState)this).transform.position);
			((BaseState)this).SmallHop(((EntityState)this).characterMotor, 0f);
			TeleportHelper.TeleportGameObject(((EntityState)this).gameObject, position2 + Vector3.up * 0.55f);
			((EntityState)this).outer.SetNextStateToMain();
		}
		if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	public override void OnExit()
	{
		//IL_0070: 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)
		if (!skipped && !dashStopped)
		{
			behaviour.PrintIn();
			request.Dispose();
			if (((EntityState)this).isAuthority)
			{
				bodyMachine.SetNextStateToMain();
			}
			behaviour.canExecute = true;
			((BaseCharacterController)((EntityState)this).characterMotor).Motor.CollidableLayers = LayerMask.op_Implicit(collidableLayers);
			((EntityState)this).characterMotor.useGravity = true;
			((EntityState)this).characterMotor.isFlying = false;
			int hurtBoxesDeactivatorCounter = hurtBoxGroup.hurtBoxesDeactivatorCounter - 1;
			hurtBoxGroup.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter;
			CharacterModel obj = characterModel;
			obj.invisibilityCount--;
		}
		((EntityState)this).OnExit();
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)1;
	}
}
internal class Utility : BaseSkillState
{
	private float duration = 5.25f;

	private ZedBehaviour behaviour;

	private bool tp;

	private GameObject shadow;

	public override void OnEnter()
	{
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: 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_0074: 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_0083: 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_0089: 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_00d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d7: 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_00b4: 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_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
		((BaseState)this).OnEnter();
		behaviour = ((EntityState)this).GetComponent<ZedBehaviour>();
		((EntityState)this).PlayAnimation("Gesture, Override", "Shadow", "Utility", 0.35f, 0f);
		float shadowDistance = behaviour.shadowDistance;
		Ray aimRay = ((BaseState)this).GetAimRay();
		Vector3 direction = ((Ray)(ref aimRay)).direction;
		Vector3 val = ((EntityState)this).transform.position + direction * shadowDistance;
		RaycastHit val2 = default(RaycastHit);
		if (Physics.Raycast(new Ray(((EntityState)this).characterBody.corePosition + -direction * 2f, direction), ref val2, shadowDistance + 2f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)))
		{
			val = ((RaycastHit)(ref val2)).point + -direction * 0.55f;
		}
		shadow = Object.Instantiate<GameObject>(MainPlugin.shadowPrefab, val, Util.QuaternionSafeLookRotation(direction));
		shadow.GetComponent<DestroyOnTimer>().duration