Yone.dll

Decompiled a day ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using EntityStates;
using EntityStates.Merc;
using KinematicCharacterController;
using On.RoR2;
using R2API;
using R2API.Utils;
using Rewired.ComponentControls.Effects;
using RoR2;
using RoR2.Navigation;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.Rendering.PostProcessing;
using UnityEngine.UI;

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

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("Yone.AssetBundle." + "Yone".ToLower() + "assets");
			MainAssetBundle = AssetBundle.LoadFromStream(stream);
		}
		using Stream stream2 = executingAssembly.GetManifestResourceStream("Yone.Yone.bnk");
		byte[] array = new byte[stream2.Length];
		stream2.Read(array, 0, array.Length);
		SoundBanks.Add(array);
	}
}
internal class Behaviour : NetworkBehaviour
{
	public float projDur = 0.25f;

	private CharacterBody body;

	public bool Q3;

	public Dictionary<HealthComponent, List<Highlight>> targets = new Dictionary<HealthComponent, List<Highlight>>();

	public float dashSpeed = 45f;

	public float pullRadius = 45f;

	public float backPos = -4f;

	public float forceMagnitude = -15000f;

	public float pullDur = 0.2f;

	public float dashDamageMult;

	public GameObject deathModel;

	public float dashAngle = 25f;

	private ParticleSystem[] Q3IdleParticles;

	private ParticleSystem[] SlashL;

	private ParticleSystem[] SlashR;

	private bool playingQ3;

	private uint ID;

	public PostProcessDuration pp;

	public DeathDamageTracker damageTracker;

	private static int kCmdCmdAddBuff;

	private void Awake()
	{
		body = ((Component)this).GetComponent<CharacterBody>();
	}

	private void Start()
	{
		damageTracker = ((Component)body.master).GetComponent<DeathDamageTracker>();
		if (!Object.op_Implicit((Object)(object)damageTracker))
		{
			damageTracker = ((Component)body.master).gameObject.AddComponent<DeathDamageTracker>();
		}
		damageTracker.Networkdamage = 0f;
		damageTracker.damageGoal = 0f;
		ChildLocator component = ((Component)body.modelLocator.modelTransform).GetComponent<ChildLocator>();
		Q3IdleParticles = ((Component)component.FindChild("Q3IdleEffect")).GetComponentsInChildren<ParticleSystem>();
		SlashL = ((Component)component.FindChild("SlashL")).GetComponentsInChildren<ParticleSystem>();
		SlashR = ((Component)component.FindChild("SlashR")).GetComponentsInChildren<ParticleSystem>();
	}

	public void PlaySlashEffect(bool right = false)
	{
		ParticleSystem[] array = (right ? SlashR : SlashL);
		ParticleSystem[] array2 = array;
		foreach (ParticleSystem val in array2)
		{
			val.Play();
		}
	}

	private void FixedUpdate()
	{
		if (body.GetBuffCount(Prefabs.QBuff) >= 2)
		{
			if (!playingQ3)
			{
				playingQ3 = true;
				ID = AkSoundEngine.PostEvent("Play_sfx_Yone_YoneQ3Ready_OnBuffActivate", ((Component)this).gameObject);
				ParticleSystem[] q3IdleParticles = Q3IdleParticles;
				foreach (ParticleSystem val in q3IdleParticles)
				{
					val.Play();
				}
			}
		}
		else if (playingQ3)
		{
			playingQ3 = false;
			AkSoundEngine.StopPlayingID(ID);
			AkSoundEngine.PostEvent("Play_sfx_Yone_YoneQ3Ready_OnBuffEnd", ((Component)this).gameObject);
			ParticleSystem[] q3IdleParticles2 = Q3IdleParticles;
			foreach (ParticleSystem val2 in q3IdleParticles2)
			{
				val2.Stop();
			}
		}
	}

	private void OnExit()
	{
		AkSoundEngine.StopPlayingID(ID);
	}

	[Command]
	public void CmdAddBuff()
	{
		if (NetworkServer.active)
		{
			int buffCount = body.GetBuffCount(Prefabs.QBuff);
			body.ClearTimedBuffs(Prefabs.QBuff);
			for (int i = 0; i < buffCount + 1; i++)
			{
				body.AddTimedBuff(Prefabs.QBuff, 6f);
			}
			if (buffCount + 1 < 2)
			{
			}
		}
	}

	private void UNetVersion()
	{
	}

	protected static void InvokeCmdCmdAddBuff(NetworkBehaviour obj, NetworkReader reader)
	{
		if (!NetworkServer.active)
		{
			Debug.LogError((object)"Command CmdAddBuff called on client.");
		}
		else
		{
			((Behaviour)(object)obj).CmdAddBuff();
		}
	}

	public void CallCmdAddBuff()
	{
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Expected O, but got Unknown
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		if (!NetworkClient.active)
		{
			Debug.LogError((object)"Command function CmdAddBuff called on server.");
			return;
		}
		if (((NetworkBehaviour)this).isServer)
		{
			CmdAddBuff();
			return;
		}
		NetworkWriter val = new NetworkWriter();
		val.Write((short)0);
		val.Write((short)5);
		val.WritePackedUInt32((uint)kCmdCmdAddBuff);
		val.Write(((Component)this).GetComponent<NetworkIdentity>().netId);
		((NetworkBehaviour)this).SendCommandInternal(val, 0, "CmdAddBuff");
	}

	static Behaviour()
	{
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Expected O, but got Unknown
		kCmdCmdAddBuff = -597618441;
		NetworkBehaviour.RegisterCommandDelegate(typeof(Behaviour), kCmdCmdAddBuff, new CmdDelegate(InvokeCmdCmdAddBuff));
		NetworkCRC.RegisterBehaviour("Behaviour", 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 DeathDamageTracker : NetworkBehaviour
{
	public bool dead;

	public float damageMult = MainPlugin.dmgThreshold.Value;

	public float damageGoal;

	[SyncVar]
	public float damage;

	public int rezAmount;

	public float Networkdamage
	{
		get
		{
			return damage;
		}
		[param: In]
		set
		{
			((NetworkBehaviour)this).SetSyncVar<float>(value, ref damage, 1u);
		}
	}

	private void OnEnable()
	{
		Stage.onStageStartGlobal += Stage_onStageStartGlobal;
	}

	private void OnDisable()
	{
		Stage.onStageStartGlobal -= Stage_onStageStartGlobal;
	}

	private void Stage_onStageStartGlobal(Stage obj)
	{
		rezAmount = 0;
		Networkdamage = 0f;
		damageGoal = 0f;
		dead = false;
	}

	private void UNetVersion()
	{
	}

	public override bool OnSerialize(NetworkWriter writer, bool forceAll)
	{
		if (forceAll)
		{
			writer.Write(damage);
			return true;
		}
		bool flag = false;
		if ((((NetworkBehaviour)this).syncVarDirtyBits & (true ? 1u : 0u)) != 0)
		{
			if (!flag)
			{
				writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits);
				flag = true;
			}
			writer.Write(damage);
		}
		if (!flag)
		{
			writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits);
		}
		return flag;
	}

	public override void OnDeserialize(NetworkReader reader, bool initialState)
	{
		if (initialState)
		{
			damage = reader.ReadSingle();
			return;
		}
		int num = (int)reader.ReadPackedUInt32();
		if (((uint)num & (true ? 1u : 0u)) != 0)
		{
			damage = reader.ReadSingle();
		}
	}
}
internal class DemonLineBehaviour : MonoBehaviour
{
	public LineRenderer line;

	public Transform target;

	private void Update()
	{
		//IL_0035: 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)
		((Renderer)line).enabled = Object.op_Implicit((Object)(object)target);
		if (((Renderer)line).enabled)
		{
			line.SetPosition(0, ((Component)this).transform.position);
			line.SetPosition(1, target.position);
		}
	}
}
[DefaultExecutionOrder(100)]
internal class ModelBehaviour : MonoBehaviour
{
	public bool dummy;

	private CharacterModel model;

	private Animator animator;

	private ChildLocator childLocator;

	private GameObject baseArmature;

	private GameObject skin19Armature;

	private GameObject skin55Armature;

	public bool qEffect;

	private RuntimeAnimatorController baseController => Assets.Load<RuntimeAnimatorController>(dummy ? "death" : (Object.op_Implicit((Object)(object)model.body) ? "animator" : "displayAnimator"));

	private RuntimeAnimatorController skin19Controller => Assets.Load<RuntimeAnimatorController>(dummy ? "skin19DeathAnimator" : (Object.op_Implicit((Object)(object)model.body) ? "skin19Animator" : "skin19DisplayAnimator"));

	private RuntimeAnimatorController skin55Controller => Assets.Load<RuntimeAnimatorController>(dummy ? "skin55DeathAnimator" : (Object.op_Implicit((Object)(object)model.body) ? "skin55Animator" : "skin55DisplayAnimator"));

	private void Awake()
	{
		model = ((Component)this).GetComponent<CharacterModel>();
		animator = ((Component)this).GetComponent<Animator>();
		childLocator = ((Component)this).GetComponent<ChildLocator>();
		baseArmature = ((Component)childLocator.FindChild("baseArmature")).gameObject;
		skin19Armature = ((Component)childLocator.FindChild("skin19Armature")).gameObject;
		skin55Armature = ((Component)childLocator.FindChild("skin55Armature")).gameObject;
	}

	private void Start()
	{
		SetSkin();
	}

	private void FixedUpdate()
	{
		SetSkin();
	}

	private void SetSkin()
	{
		if (baseArmature.activeInHierarchy)
		{
			if ((Object)(object)animator.runtimeAnimatorController != (Object)(object)baseController)
			{
				baseArmature.transform.SetAsFirstSibling();
				animator.runtimeAnimatorController = baseController;
			}
		}
		else if (skin19Armature.activeInHierarchy)
		{
			if ((Object)(object)animator.runtimeAnimatorController != (Object)(object)skin19Controller)
			{
				skin19Armature.transform.SetAsFirstSibling();
				animator.runtimeAnimatorController = skin19Controller;
			}
		}
		else if ((Object)(object)animator.runtimeAnimatorController != (Object)(object)skin55Controller)
		{
			skin55Armature.transform.SetAsFirstSibling();
			animator.runtimeAnimatorController = skin55Controller;
		}
	}

	public void QEffect()
	{
		qEffect = true;
	}
}
internal class ParticleScale : MonoBehaviour
{
	public float scale = 1f;

	private ParticleSystem[] particles;

	private DestroyOnTimer timer;

	private void Awake()
	{
		particles = ((Component)this).GetComponentsInChildren<ParticleSystem>();
		timer = ((Component)this).GetComponent<DestroyOnTimer>();
	}

	private void Start()
	{
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		ParticleSystem[] array = particles;
		foreach (ParticleSystem val in array)
		{
			MainModule main = val.main;
			((MainModule)(ref main)).simulationSpeed = ((MainModule)(ref main)).simulationSpeed * scale;
		}
		DestroyOnTimer obj = timer;
		obj.duration /= scale;
	}
}
internal class ProjectileFollow : MonoBehaviour
{
	private ProjectileController controller;

	private ProjectileSimple simple;

	private Behaviour behaviour;

	private void Awake()
	{
		controller = ((Component)this).GetComponent<ProjectileController>();
		simple = ((Component)this).GetComponent<ProjectileSimple>();
	}

	private void Start()
	{
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		behaviour = controller.owner.GetComponent<Behaviour>();
		if (Object.op_Implicit((Object)(object)behaviour))
		{
			Transform parent = ((Component)controller.owner.GetComponent<CharacterBody>().modelLocator.modelTransform).GetComponent<ChildLocator>().FindChild("projectileMuzzle");
			((Component)this).transform.parent = parent;
			((Component)this).transform.localPosition = Vector3.zero;
		}
	}

	private void FixedUpdate()
	{
		if (Object.op_Implicit((Object)(object)behaviour) && Object.op_Implicit((Object)(object)((Component)this).transform.parent) && !behaviour.Q3)
		{
			((Component)this).transform.parent = null;
			((Behaviour)simple).enabled = true;
		}
	}
}
internal class SoundPlayer : MonoBehaviour
{
	public string startSoundID;

	public string endSoundID;

	private uint ID;

	private void Start()
	{
		ID = AkSoundEngine.PostEvent(startSoundID, ((Component)this).gameObject);
	}

	private void OnDisable()
	{
		AkSoundEngine.StopPlayingID(ID);
		AkSoundEngine.PostEvent(endSoundID, ((Component)this).gameObject);
	}
}
internal class VignetteOT : MonoBehaviour
{
	public PostProcessProfile profile;

	private Vignette vignette;

	private float speed;

	public bool reset;

	public bool pause;

	private void Start()
	{
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Expected O, but got Unknown
		vignette = (Vignette)profile.settings[3];
		((ParameterOverride<float>)(object)vignette.intensity).value = 0.346f;
		speed = 0.055400003f;
	}

	private void FixedUpdate()
	{
		if (pause)
		{
			pause = false;
			FloatParameter intensity = vignette.intensity;
			((ParameterOverride<float>)(object)intensity).value = ((ParameterOverride<float>)(object)intensity).value + speed * Time.fixedDeltaTime;
		}
		if (reset)
		{
			reset = false;
			((ParameterOverride<float>)(object)vignette.intensity).value = 0.346f;
		}
	}
}
internal class Hook
{
	internal static void Hooks()
	{
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0024: Expected O, but got Unknown
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Expected O, but got Unknown
		GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt;
		CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats);
		CharacterDeathBehavior.OnDeath += new hook_OnDeath(CharacterDeathBehavior_OnDeath);
	}

	private static void CharacterDeathBehavior_OnDeath(orig_OnDeath orig, CharacterDeathBehavior self)
	{
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Expected O, but got Unknown
		CharacterBody component = ((Component)self).GetComponent<CharacterBody>();
		if (Object.op_Implicit((Object)(object)component) && component.baseNameToken == "YONE_NAME")
		{
			if (Util.HasEffectiveAuthority(((Component)self).gameObject))
			{
				if (Object.op_Implicit((Object)(object)self.deathStateMachine))
				{
					self.deathStateMachine.SetNextState(EntityStateCatalog.InstantiateState(ref self.deathState));
				}
				EntityStateMachine[] idleStateMachine = self.idleStateMachine;
				for (int i = 0; i < idleStateMachine.Length; i++)
				{
					idleStateMachine[i].SetNextState((EntityState)new Idle());
				}
			}
		}
		else
		{
			orig.Invoke(self);
		}
	}

	private static void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self)
	{
		orig.Invoke(self);
		if (self.baseNameToken == "YONE_NAME")
		{
			self.crit *= 1.5f;
			float num = Util.Remap(self.attackSpeed, 1f, 2.5f, 1f, 0.5f);
			self.skillLocator.secondaryBonusStockSkill.cooldownScale = self.skillLocator.secondaryBonusStockSkill.cooldownScale * num;
			self.skillLocator.specialBonusStockSkill.cooldownScale = self.skillLocator.specialBonusStockSkill.cooldownScale * num;
		}
	}

	private static void GlobalEventManager_onServerDamageDealt(DamageReport damageReport)
	{
		//IL_00a0: 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_0173: Unknown result type (might be due to invalid IL or missing references)
		//IL_0131: 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_0200: Unknown result type (might be due to invalid IL or missing references)
		//IL_0207: Unknown result type (might be due to invalid IL or missing references)
		//IL_020e: 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) || !Object.op_Implicit((Object)(object)damageReport.attackerMaster))
		{
			return;
		}
		if (damageReport.damageInfo.procCoefficient > 0f && Object.op_Implicit((Object)(object)damageReport.attackerMaster))
		{
			DeathDamageTracker component = ((Component)damageReport.attackerMaster).GetComponent<DeathDamageTracker>();
			if (Object.op_Implicit((Object)(object)component) && component.dead)
			{
				component.Networkdamage = component.damage + damageReport.damageDealt;
			}
		}
		if (DamageAPI.HasModdedDamageType(damageReport.damageInfo, Prefabs.swipe) && Object.op_Implicit((Object)(object)damageReport.attackerBody))
		{
			float num = ((!damageReport.damageInfo.crit) ? 1 : 2);
			damageReport.attackerBody.healthComponent.AddBarrier(damageReport.damageDealt * 0.15f * num);
		}
		if (DamageAPI.HasModdedDamageType(damageReport.damageInfo, Prefabs.bleed))
		{
			HealthComponent healthComponent = damageReport.attackerBody.healthComponent;
			healthComponent.Heal(3f + healthComponent.fullHealth * 0.01f, default(ProcChainMask), true);
			DotController.InflictDot(((Component)damageReport.victim).gameObject, damageReport.attacker, (DotIndex)0, 3f, 1f, (uint?)null);
		}
		if (DamageAPI.HasModdedDamageType(damageReport.damageInfo, Prefabs.knockup))
		{
			float num2 = 0f;
			RigidbodyMotor component2 = ((Component)damageReport.victim).GetComponent<RigidbodyMotor>();
			if (Object.op_Implicit((Object)(object)damageReport.victim.body.characterMotor))
			{
				num2 = damageReport.victim.body.characterMotor.mass;
			}
			else if (Object.op_Implicit((Object)(object)component2))
			{
				num2 = component2.mass;
			}
			float num3 = ((num2 >= 250f) ? 18 : 8);
			damageReport.victim.TakeDamageForce(Vector3.up * num2 * num3, false, false);
		}
	}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.Dragonyck.Yone", "Yone", "1.0.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[NetworkCompatibility(/*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.*/)]
public class MainPlugin : BaseUnityPlugin
{
	public const string MODUID = "com.Dragonyck.Yone";

	public const string MODNAME = "Yone";

	public const string VERSION = "1.0.0";

	public const string SURVIVORNAME = "Yone";

	public const string SURVIVORNAMEKEY = "YONE";

	public static GameObject characterPrefab;

	public static readonly Color characterColor = Color32.op_Implicit(new Color32((byte)222, (byte)20, (byte)24, byte.MaxValue));

	internal const bool melee = true;

	internal static ConfigEntry<float> dmgThreshold;

	internal static ConfigEntry<float> dmgThresholdMult;

	private void Awake()
	{
		dmgThreshold = ((BaseUnityPlugin)this).Config.Bind<float>("Spirit Walk", "Damage Threshold", 30f, (ConfigDescription)null);
		dmgThresholdMult = ((BaseUnityPlugin)this).Config.Bind<float>("Spirit Walk", "Damage Threshold Multiplier", 1.5f, (ConfigDescription)null);
		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_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cd: Expected O, but got Unknown
		//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0109: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: 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_013f: Expected O, but got Unknown
		//IL_0166: Unknown result type (might be due to invalid IL or missing references)
		//IL_0177: Unknown result type (might be due to invalid IL or missing references)
		//IL_0188: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b8: 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_0237: Unknown result type (might be due to invalid IL or missing references)
		//IL_0368: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_043d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0442: Unknown result type (might be due to invalid IL or missing references)
		//IL_046f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0474: Unknown result type (might be due to invalid IL or missing references)
		//IL_0520: Unknown result type (might be due to invalid IL or missing references)
		//IL_0540: Unknown result type (might be due to invalid IL or missing references)
		//IL_054d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0628: Unknown result type (might be due to invalid IL or missing references)
		//IL_0645: Unknown result type (might be due to invalid IL or missing references)
		//IL_0662: Unknown result type (might be due to invalid IL or missing references)
		//IL_06e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_06ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_0725: Unknown result type (might be due to invalid IL or missing references)
		//IL_072a: Unknown result type (might be due to invalid IL or missing references)
		//IL_07c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_082c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0840: Unknown result type (might be due to invalid IL or missing references)
		//IL_0858: Unknown result type (might be due to invalid IL or missing references)
		//IL_085e: Unknown result type (might be due to invalid IL or missing references)
		//IL_086f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0894: Unknown result type (might be due to invalid IL or missing references)
		//IL_08a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_099a: Unknown result type (might be due to invalid IL or missing references)
		//IL_099f: Unknown result type (might be due to invalid IL or missing references)
		//IL_09c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_09c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_09fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_09ff: 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, "YoneBody", true);
		characterPrefab.AddComponent<Behaviour>();
		characterPrefab.GetComponent<NetworkIdentity>().localPlayerAuthority = true;
		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>("YoneMdl");
		val2.AddComponent<AnimationEvents>().soundCenter = val2;
		val2.AddComponent<ModelBehaviour>();
		GameObject val3 = new GameObject("ModelBase");
		val3.transform.parent = characterPrefab.transform;
		val3.transform.localPosition = new Vector3(0f, -0.94f, 0f);
		val3.transform.localRotation = Quaternion.identity;
		val3.transform.localScale = new Vector3(1f, 1f, 1f);
		GameObject val4 = new GameObject("AimOrigin");
		val4.transform.parent = val3.transform;
		val4.transform.localPosition = new Vector3(0f, 1.4f, 0f);
		val4.transform.localRotation = Quaternion.identity;
		val4.transform.localScale = Vector3.one;
		Transform transform = val2.transform;
		transform.parent = val3.transform;
		transform.localPosition = Vector3.zero;
		transform.localScale = Vector3.one;
		transform.localRotation = Quaternion.identity;
		CharacterDirection component = characterPrefab.GetComponent<CharacterDirection>();
		component.targetTransform = val3.transform;
		component.modelAnimator = val2.GetComponentInChildren<Animator>();
		component.turnSpeed = 720f;
		CharacterBody component2 = characterPrefab.GetComponent<CharacterBody>();
		((Object)component2).name = "YoneBody";
		component2.baseNameToken = "YONE_NAME";
		component2.subtitleNameToken = "YONE_SUBTITLE";
		component2.bodyFlags = (BodyFlags)16;
		component2.rootMotionInMainState = false;
		component2.mainRootSpeed = 0f;
		component2.baseMaxHealth = 95f;
		component2.levelMaxHealth = 28f;
		component2.baseRegen = 1.2f;
		component2.levelRegen = 0.66f;
		component2.baseMaxShield = 0f;
		component2.levelMaxShield = 0f;
		component2.baseMoveSpeed = 7f;
		component2.levelMoveSpeed = 0f;
		component2.baseAcceleration = 110f;
		component2.baseJumpPower = 15f;
		component2.levelJumpPower = 0f;
		component2.baseDamage = 14f;
		component2.levelDamage = 3.25f;
		component2.baseAttackSpeed = 1f;
		component2.levelAttackSpeed = 0f;
		component2.baseCrit = 1f;
		component2.levelCrit = 0f;
		component2.baseArmor = 10f;
		component2.levelArmor = 1.33f;
		component2.baseJumpCount = 1;
		component2.sprintingSpeedMultiplier = 1.45f;
		component2.wasLucky = false;
		component2.hideCrosshair = false;
		component2.aimOriginTransform = val4.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 = 160f;
		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 = val3.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 val5 = val2.AddComponent<CharacterModel>();
		SkinnedMeshRenderer[] componentsInChildren = val2.GetComponentsInChildren<SkinnedMeshRenderer>();
		List<RendererInfo> list = new List<RendererInfo>();
		foreach (SkinnedMeshRenderer val6 in componentsInChildren)
		{
			((Renderer)val6).material = Utils.InstantiateMaterial(((Renderer)val6).material.mainTexture);
			list.Add(new RendererInfo
			{
				renderer = (Renderer)(object)val6,
				defaultMaterial = ((Renderer)val6).material,
				defaultShadowCastingMode = (ShadowCastingMode)1,
				ignoreOverlays = false
			});
			if (((Object)val6).name != "base")
			{
				((Component)val6).gameObject.SetActive(false);
			}
		}
		RendererInfo[] array = list.ToArray();
		val5.body = component2;
		val5.baseRendererInfos = array;
		val5.autoPopulateLightInfos = true;
		val5.invisibilityCount = 0;
		val5.temporaryOverlays = new List<TemporaryOverlayInstance>();
		val5.mainSkinnedMeshRenderer = componentsInChildren[0];
		LanguageAPI.Add("YONEBODY_DEFAULT_SKIN_NAME", "Default");
		LanguageAPI.Add("YONEBODY_SKIN19_NAME", "Dawnbringer");
		LanguageAPI.Add("YONEBODY_SKIN55_NAME", "High Noon");
		ModelSkinController val7 = val2.AddComponent<ModelSkinController>();
		val7.skins = (SkinDef[])(object)new SkinDef[3]
		{
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "YONEBODY_DEFAULT_SKIN_NAME", "base", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "YONEBODY_SKIN19_NAME", "skin19", array)),
			Skins.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(componentsInChildren, val2, "YONEBODY_SKIN55_NAME", "skin55", array))
		};
		Prefabs.deathDummy = Prefabs.Instantiate(val2, "DeathDummy");
		Collider[] componentsInChildren2 = Prefabs.deathDummy.GetComponentsInChildren<Collider>(true);
		foreach (Collider val8 in componentsInChildren2)
		{
			((Component)val8).gameObject.SetActive(false);
		}
		Prefabs.deathDummy.GetComponent<Animator>().runtimeAnimatorController = Assets.Load<RuntimeAnimatorController>("death");
		Object.Instantiate<GameObject>(Assets.Load<GameObject>("DummyIdleEffect"), Prefabs.deathDummy.transform.position, Quaternion.identity, Prefabs.deathDummy.transform);
		Transform val9 = Prefabs.deathDummy.GetComponent<ChildLocator>().FindChild("center");
		GameObject val10 = Object.Instantiate<GameObject>(Assets.Load<GameObject>("DemonLine"), val9.position, Quaternion.identity, val9);
		Prefabs.deathDummy.AddComponent<DemonLineBehaviour>().line = val10.GetComponent<LineRenderer>();
		Prefabs.deathDummy.GetComponent<ModelBehaviour>().dummy = true;
		Collider[] componentsInChildren3 = val2.GetComponentsInChildren<Collider>(true);
		HurtBoxGroup val11 = val2.AddComponent<HurtBoxGroup>();
		List<HurtBox> list2 = new List<HurtBox>();
		Collider[] array2 = componentsInChildren3;
		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(4.5f, 5f, 8f), new Vector3(0f, 1.2f, 3.5f));
		Utils.CreateHitbox("Dash", val2.transform, default(Vector3), new Vector3(0f, 1.2f, 4f));
		Utils.CreateHitbox("Swipe", val2.transform, new Vector3(12f, 12f, 16f), new Vector3(0f, 1.2f, 6.5f));
		KinematicCharacterMotor component9 = characterPrefab.GetComponent<KinematicCharacterMotor>();
		component9.CharacterController = (ICharacterController)(object)component4;
		component9.playerCharacter = true;
		characterPrefab.GetComponent<Interactor>().maxInteractionDistance = 3f;
		characterPrefab.GetComponent<InteractionDriver>().highlightInteractor = true;
		SfxLocator component10 = characterPrefab.GetComponent<SfxLocator>();
		component10.deathSound = "Play_ui_player_death";
		component10.barkSound = "";
		component10.openSound = "";
		component10.landingSound = "Play_char_land";
		component10.fallDamageSound = "Play_char_land_fall_damage";
		component10.aliveLoopStart = "";
		component10.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 component11 = ((Component)component2).GetComponent<EntityStateMachine>();
		component11.mainStateType = new SerializableEntityStateType(typeof(CharacterMain));
		CharacterDeathBehavior component12 = characterPrefab.GetComponent<CharacterDeathBehavior>();
		component12.deathStateMachine = Utils.NewStateMachine<Idle>(characterPrefab, "Death");
		component12.deathState = new SerializableEntityStateType(typeof(DeathState));
		component12.bypassDeathLayerChange = true;
		NetworkStateMachine component13 = ((Component)component2).GetComponent<NetworkStateMachine>();
		component13.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("YONE_NAME", "Yone");
		LanguageAPI.Add("YONE_DESCRIPTION", text);
		LanguageAPI.Add("YONE_SUBTITLE", "Unforgotten");
		LanguageAPI.Add("YONE_OUTRO", text2);
		LanguageAPI.Add("YONE_FAIL", text3);
		SurvivorDef val = ScriptableObject.CreateInstance<SurvivorDef>();
		val.cachedName = "YONE_NAME";
		val.unlockableDef = null;
		val.descriptionToken = "YONE_DESCRIPTION";
		val.primaryColor = characterColor;
		val.bodyPrefab = characterPrefab;
		val.displayPrefab = Utils.NewDisplayModel(((Component)characterPrefab.GetComponent<ModelLocator>().modelBaseTransform).gameObject, "YoneDisplay");
		val.outroFlavorToken = "YONE_OUTRO";
		val.desiredSortPosition = 22f;
		val.mainEndingEscapeFailureFlavorToken = "YONE_FAIL";
		ContentAddition.AddSurvivorDef(val);
		SkillSetup();
		GameObject val2 = PrefabAPI.InstantiateClone(Prefabs.Load<GameObject>("RoR2/Base/Merc/MercMonsterMaster.prefab"), "YoneMaster", 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)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Unknown result type (might be due to invalid IL or missing references)
		bool flag = default(bool);
		ContentAddition.AddEntityState<Primary>(ref flag);
		ContentAddition.AddEntityState<Secondary>(ref flag);
		ContentAddition.AddEntityState<Utility>(ref flag);
		ContentAddition.AddEntityState<UtilityDash>(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);
		ContentAddition.AddEntityState<DeathState>(ref flag);
		ContentAddition.AddEntityState<DeathDash>(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("YONE_PASSIVE_NAME", "Way of the Hunter");
		LanguageAPI.Add("YONE_PASSIVE_DESCRIPTION", "Yone gains <style=cIsDamage>1.5x critical chance</style>.");
		component.passiveSkill.enabled = true;
		component.passiveSkill.skillNameToken = "YONE_PASSIVE_NAME";
		component.passiveSkill.skillDescriptionToken = "YONE_PASSIVE_DESCRIPTION";
		component.passiveSkill.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("yonepassive");
		LanguageAPI.Add("YONE_PASSIVE2_NAME", "Spirit Walk");
		LanguageAPI.Add("YONE_PASSIVE2_DESCRIPTION", "When Yone dies, his spirit leaves his body, allowing him to move freely for <style=cIsUtility>10s</style>. If Yone deals at least <style=cIsDamage>" + dmgThreshold.Value * 100f + " % damage</style> while in spirit form, he is <style=cIsHealth>revived</style>. The threshold increases after every revival, resetting upon entering a new stage.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Idle), "Weapon", 0, 0f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: true, (InterruptPriority)0, isCombatSkill: true, mustKeyPress: false, cancelSprintingOnActivation: true, 0, 0, 0, Assets.MainAssetBundle.LoadAsset<Sprite>("yonee"), "YONE_PASSIVE2_DESCRIPTION", "YONE_PASSIVE2_NAME", Array.Empty<string>());
		Utils.NewGenericSkill(characterPrefab, skill);
	}

	private void PrimarySetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("YONE_M1", "Steel Slash");
		LanguageAPI.Add("YONE_M1_DESCRIPTION", "Yone slashes enemies in front of him for <style=cIsDamage>120% damage</style>, and every second slash inflicts <style=cIsHealth>bleed</style> and <style=cIsHealth>heals 3 +1% health</style>.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(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>("yonee2"), "YONE_M1_DESCRIPTION", "YONE_M1", Array.Empty<string>());
		component.primary = Utils.NewGenericSkill(characterPrefab, skill);
	}

	private void SecondarySetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("YONE_M2", "Spirit Thrust");
		LanguageAPI.Add("YONE_M2_DESCRIPTION", "Yone thrusts forward, dealing <style=cIsDamage>240% damage</style> and gaining a stack of Resolve, up to a max of <style=cIsUtility>2</style>. At full Resolve stacks, he instead dashes a short distance, slashing all enemies for <style=cIsDamage>300% damage</style> and sending an airslash a short distance dealing the same amount. The airslash knocks enemies airborne.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Secondary), "Weapon", 1, 4f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("yoneq"), "YONE_M2_DESCRIPTION", "YONE_M2", Array.Empty<string>());
		component.secondary = Utils.NewGenericSkill(characterPrefab, skill);
	}

	private void UtilitySetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("YONE_UTIL", "Soul Unbound");
		LanguageAPI.Add("YONE_UTIL_DESCRIPTION", "Yone channels for up to <style=cIsUtility>1.2s</style>, then blinks forward, slashing all enemies in his path for <style=cIsDamage>300%-1200% damage</style>, <style=cIsUtility>dragging</style> and <style=cIsDamage>stunning</style> them.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Utility), "Body", 1, 16f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("yoner"), "YONE_UTIL_DESCRIPTION", "YONE_UTIL", Array.Empty<string>());
		component.utility = Utils.NewGenericSkill(characterPrefab, skill);
	}

	private void SpecialSetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("YONE_SPEC", "Fate Sealed");
		LanguageAPI.Add("YONE_SPEC_DESCRIPTION", "Yone cleaves a wide area in front of him, dealing <style=cIsDamage>400% damage</style> to each enemy and gaining <style=cIsHealing>15%</style> of the damage dealt as a <style=cIsHealing>temporary barrier</style> for each enemy hit. Gain <style=cIsHealing>double</style> on critical hits.");
		SkillDef skill = Utils.NewSkillDef<SkillDef>(typeof(Special), "Weapon", 1, 8f, beginSkillCooldownOnSkillEnd: true, canceledFromSprinting: false, fullRestockOnAssign: false, (InterruptPriority)1, isCombatSkill: true, mustKeyPress: true, cancelSprintingOnActivation: false, 1, 1, 1, Assets.MainAssetBundle.LoadAsset<Sprite>("yonew"), "YONE_SPEC_DESCRIPTION", "YONE_SPEC", Array.Empty<string>());
		component.special = Utils.NewGenericSkill(characterPrefab, skill);
	}
}
internal class Prefabs
{
	internal static GameObject basicHitEffect;

	internal static GameObject basicRedHitEffect;

	internal static GameObject Q1HitEffect;

	internal static GameObject Q3HitEffect;

	internal static GameObject RHitEffect;

	internal static GameObject SwipeHitEffect;

	internal static GameObject Q3IdleEffect;

	internal static GameObject Q3ProjectileGhost;

	internal static GameObject Q3Projectile;

	internal static GameObject deathDummy;

	internal static GameObject slashEffectR;

	internal static GameObject slashEffectL;

	internal static GameObject Q3Slash;

	internal static GameObject WideSlash;

	internal static GameObject DashHitSelf;

	internal static GameObject DashHit;

	internal static GameObject demonPP;

	internal static GameObject hudIndicator;

	internal static Material demonOverlay;

	internal static Material dashOverlay;

	internal static BuffDef QBuff;

	internal static ModdedDamageType bleed;

	internal static ModdedDamageType knockup;

	internal static ModdedDamageType swipe;

	internal static GameObject QSlash { get; set; }

	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_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: 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_0058: Expected O, but got Unknown
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c2: Expected O, but got Unknown
		//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_015e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0165: Expected O, but got Unknown
		//IL_0180: Unknown result type (might be due to invalid IL or missing references)
		//IL_018a: Expected O, but got Unknown
		//IL_0194: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e2: Expected O, but got Unknown
		//IL_020d: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_047d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0514: Unknown result type (might be due to invalid IL or missing references)
		//IL_0537: Unknown result type (might be due to invalid IL or missing references)
		//IL_0566: Unknown result type (might be due to invalid IL or missing references)
		//IL_0570: Unknown result type (might be due to invalid IL or missing references)
		//IL_0580: Unknown result type (might be due to invalid IL or missing references)
		//IL_05d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_06a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_06ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_06b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_06b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_06c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_06cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_07be: Unknown result type (might be due to invalid IL or missing references)
		bleed = DamageAPI.ReserveDamageType();
		knockup = DamageAPI.ReserveDamageType();
		swipe = DamageAPI.ReserveDamageType();
		hudIndicator = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("DemonIndicator"), "DemonHUDIndicator");
		PostProcessProfile val = Load<PostProcessProfile>("RoR2/Base/title/PostProcessing/ppLocalDoppelganger.asset");
		demonPP = PrefabAPI.InstantiateClone(new GameObject("ViendPP"), "ViendPP", false);
		demonPP.layer = 20;
		PostProcessVolume val2 = demonPP.AddComponent<PostProcessVolume>();
		val2.profile = Object.Instantiate<PostProcessProfile>(val);
		val2.sharedProfile = val2.profile;
		val2.weight = 1f;
		val2.priority = 99f;
		val2.isGlobal = true;
		ColorGrading val3 = (ColorGrading)val2.profile.settings[1];
		((ParameterOverride)val3.tint).overrideState = false;
		((ParameterOverride)val3.colorFilter).overrideState = true;
		((ParameterOverride<Color>)(object)val3.colorFilter).value = Color32.op_Implicit(new Color32((byte)28, (byte)69, (byte)97, byte.MaxValue));
		((ParameterOverride<float>)(object)val3.mixerRedOutRedIn).value = 300f;
		PostProcessDuration val4 = demonPP.AddComponent<PostProcessDuration>();
		val4.ppVolume = val2;
		val4.ppWeightCurve = AnimationCurve.Linear(0f, 0.15f, 1f, 1f);
		val4.maxDuration = 10f;
		val4.destroyOnEnd = false;
		Vignette val5 = (Vignette)val2.profile.settings[3];
		((ParameterOverride<float>)(object)val5.intensity).value = 1f;
		demonOverlay = new Material(Load<Material>("RoR2/Base/ArmorReductionOnHit/matPulverizedOverlay.mat"));
		demonOverlay.SetColor("_TintColor", Color.red);
		demonOverlay.SetTexture("_MainTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/texCloudCaustic2.png"));
		demonOverlay.SetTexture("_RemapTex", (Texture)(object)Load<Texture2D>("RoR2/DLC1/Common/ColorRamps/texRampBottledChaos.png"));
		dashOverlay = new Material(demonOverlay);
		dashOverlay.SetTexture("_RemapTex", (Texture)(object)Load<Texture2D>("RoR2/Base/Common/ColorRamps/texRampLunarWardDecal.png"));
		QBuff = Utils.NewBuffDef("Resolve", stack: true, hidden: false, Assets.Load<Sprite>("qbuff"), MainPlugin.characterColor);
		WideSlash = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("WideSlash"), "WideSlashEffect", false);
		Utils.RegisterEffect(WideSlash, 0.39f, "", particleScale: true);
		DashHitSelf = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("DashHitSelf"), "DashHitSelf", false);
		Utils.RegisterEffect(DashHitSelf, 0.85f);
		DashHit = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("DashHit"), "DashHit", false);
		Utils.RegisterEffect(DashHit, 0.5f);
		QSlash = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("QSlash"), "QSlashEffect", false);
		Utils.RegisterEffect(QSlash, 0.86f);
		Q3Slash = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("Q3Slash"), "Q3SlashEffect", false);
		Utils.RegisterEffect(Q3Slash, 0.65f);
		slashEffectR = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("SlashR"), "SlashEffectR", false);
		Utils.RegisterEffect(slashEffectR, 0.38f, "", particleScale: true);
		slashEffectL = PrefabAPI.InstantiateClone(Assets.Load<GameObject>("SlashL"), "SlashEffectL", false);
		Utils.RegisterEffect(slashEffectL, 0.38f, "", particleScale: true);
		basicHitEffect = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Common/VFX/OmniImpactVFX.prefab"), "BasicHitEffect", false);
		Utils.RegisterEffect(basicHitEffect, -1f, "Play_sfx_Yone_YoneBasicAttack_OnHit");
		basicRedHitEffect = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Common/VFX/OmniImpactVFXSlash.prefab"), "BasicRedHitEffect", false);
		Utils.RecolorEffect(basicRedHitEffect, Color.red);
		Utils.RegisterEffect(basicRedHitEffect, -1f, "Play_sfx_Yone_YoneBasicAttack2_OnHit");
		Q1HitEffect = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Common/VFX/OmniImpactVFXSlash.prefab"), "Q1HitEffect", false);
		Utils.RegisterEffect(Q1HitEffect, -1f, "Play_sfx_Yone_YoneQ_hit");
		Q3HitEffect = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Huntress/OmniImpactVFXHuntress.prefab"), "Q3HitEffect", false);
		Utils.RegisterEffect(Q3HitEffect, -1f, "Play_sfx_Yone_YoneQ_hit");
		RHitEffect = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Bandit2/Bandit2SlashBlade.prefab"), "RHitEffect", false);
		Utils.RecolorEffect(RHitEffect, Color.red);
		Utils.RegisterEffect(RHitEffect, -1f);
		Q3IdleEffect = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/DLC2/Halcyonite/WhirlWindHalcyoniteVortexVFX.prefab"), "Q3IdleEffect", false);
		SoundPlayer soundPlayer = Q3IdleEffect.AddComponent<SoundPlayer>();
		soundPlayer.startSoundID = "Play_sfx_Yone_YoneQ3Ready_OnBuffActivate";
		soundPlayer.endSoundID = "Play_sfx_Yone_YoneQ3Ready_OnBuffEnd";
		ParticleSystemRenderer[] componentsInChildren = Q3IdleEffect.GetComponentsInChildren<ParticleSystemRenderer>();
		((Component)componentsInChildren[0]).gameObject.SetActive(false);
		((Component)componentsInChildren[1]).gameObject.SetActive(false);
		((Component)componentsInChildren[2]).transform.localPosition = Vector3.zero;
		((Component)componentsInChildren[2]).transform.localScale = new Vector3(0.15f, 0.15f, 1.2f);
		SwipeHitEffect = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Junk/Bandit/OmniImpactExecuteBandit.prefab"), "SwipeHitEffect", false);
		SwipeHitEffect.transform.localScale = Vector3.one * 0.5f;
		Utils.RecolorEffect(SwipeHitEffect, Color.red);
		Utils.RegisterEffect(SwipeHitEffect, -1f, "Play_sfx_Yone_YoneW_hit");
		Q3ProjectileGhost = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/DLC1/PrimarySkillShuriken/ShurikenGhost.prefab"), "ShifterFreezingWaveGhost", false);
		Transform child = Q3ProjectileGhost.transform.GetChild(0);
		child.localScale = Vector3.one;
		child.localRotation = Quaternion.Euler(0f, -90f, 0f);
		Object.Destroy((Object)(object)Q3ProjectileGhost.GetComponentInChildren<SetRandomRotation>());
		Object.Destroy((Object)(object)Q3ProjectileGhost.GetComponentInChildren<RotateAroundAxis>(true));
		EnumerableExtensions.ForEachTry<MeshRenderer>((IEnumerable<MeshRenderer>)Q3ProjectileGhost.GetComponentsInChildren<MeshRenderer>(), (Action<MeshRenderer>)delegate(MeshRenderer x)
		{
			((Renderer)x).enabled = false;
		}, (IDictionary<MeshRenderer, Exception>)null);
		EnumerableExtensions.ForEachTry<TrailRenderer>((IEnumerable<TrailRenderer>)Q3ProjectileGhost.GetComponentsInChildren<TrailRenderer>(), (Action<TrailRenderer>)delegate(TrailRenderer x)
		{
			((Renderer)x).enabled = false;
		}, (IDictionary<TrailRenderer, Exception>)null);
		ParticleSystemRenderer[] componentsInChildren2 = Q3ProjectileGhost.GetComponentsInChildren<ParticleSystemRenderer>();
		((Renderer)componentsInChildren2[0]).material = Load<Material>("RoR2/Base/Huntress/matHuntressSwingTrail.mat");
		ParticleSystem component = ((Component)componentsInChildren2[0]).GetComponent<ParticleSystem>();
		MainModule main = component.main;
		MinMaxCurve startRotation = ((MainModule)(ref main)).startRotation;
		((MinMaxCurve)(ref startRotation)).constant = 0f;
		RotationOverLifetimeModule rotationOverLifetime = component.rotationOverLifetime;
		((RotationOverLifetimeModule)(ref rotationOverLifetime)).enabled = false;
		Q3Projectile = PrefabAPI.InstantiateClone(Load<GameObject>("RoR2/Base/Commando/FMJRamping.prefab"), "ShifterFreezingWaveProjectile", true);
		Q3Projectile.AddComponent<ProjectileFollow>();
		ProjectileSimple component2 = Q3Projectile.GetComponent<ProjectileSimple>();
		component2.desiredForwardSpeed = 40f;
		((Behaviour)component2).enabled = false;
		component2.updateAfterFiring = true;
		ProjectileController component3 = Q3Projectile.GetComponent<ProjectileController>();
		component3.ghostPrefab = Q3ProjectileGhost;
		component3.flightSoundLoop = null;
		Object.Destroy((Object)(object)Q3Projectile.GetComponent<ProjectileOverlapAttack>());
		ProjectileOverlapAttack val6 = Q3Projectile.AddComponent<ProjectileOverlapAttack>();
		val6.impactEffect = Q3HitEffect;
		val6.damageCoefficient = 1f;
		val6.overlapProcCoefficient = 1f;
		val6.fireFrequency = 60f;
		val6.resetInterval = -1f;
		val6.resetTimer = 0f;
		val6.fireTimer = 0f;
		Q3Projectile.AddComponent<ModdedDamageTypeHolderComponent>().Add(knockup);
		ContentAddition.AddProjectile(Q3Projectile);
	}

	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 GameObject Instantiate(GameObject obj, string name, bool registerNetwork = false)
	{
		return PrefabAPI.InstantiateClone(obj, name, registerNetwork);
	}
}
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();
	}
}
internal class DeathState : GenericCharacterMain
{
	private float duration = 10f;

	private Behaviour behaviour;

	public Vector3 startingPos;

	private DeathDamageTracker damageTracker;

	private bool warningPlayed;

	private uint ID;

	private Vector3 dir;

	private float speed;

	private float speedMult;

	private float dashDur = 0.15f;

	private TemporaryOverlayInstance overlay;

	private GameObject pp;

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

	private GameObject indicatorObject;

	private Image indicator;

	private float dmgGoal;

	public override void OnEnter()
	{
		//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_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
		((GenericCharacterMain)this).OnEnter();
		behaviour = ((EntityState)this).GetComponent<Behaviour>();
		behaviour.deathModel = Object.Instantiate<GameObject>(Prefabs.deathDummy, ((EntityState)this).characterBody.footPosition, Quaternion.LookRotation(((EntityState)this).characterDirection.forward));
		ModelSkinController component = behaviour.deathModel.GetComponent<ModelSkinController>();
		component.ApplySkin((int)((EntityState)this).characterBody.skinIndex);
		behaviour.deathModel.GetComponent<DemonLineBehaviour>().target = ((BaseState)this).FindModelChild("center");
		startingPos = ((EntityState)this).characterBody.footPosition;
		((Behaviour)((EntityState)this).characterDirection).enabled = true;
		dir = ((EntityState)this).characterDirection.forward;
		((Behaviour)((EntityState)this).characterBody).enabled = true;
		GenericSkill[] components = ((EntityState)this).gameObject.GetComponents<GenericSkill>();
		foreach (GenericSkill val in components)
		{
			((Behaviour)val).enabled = true;
		}
		((EntityState)this).GetComponent<SetStateOnHurt>().canBeFrozen = false;
		damageTracker = behaviour.damageTracker;
		damageTracker.dead = true;
		damageTracker.Networkdamage = 0f;
		damageTracker.damageGoal = (((EntityState)this).characterBody.baseDamage + ((EntityState)this).characterBody.levelDamage * (((EntityState)this).characterBody.level - 1f)) * damageTracker.damageMult * Util.Remap(((BaseState)this).critStat, 1f, 100f, 1f, 2f) * Math.Max(1f, MainPlugin.dmgThresholdMult.Value * (float)damageTracker.rezAmount);
		AkSoundEngine.PostEvent("Play_sfx_Yone_YoneE_cast", ((EntityState)this).gameObject);
		ID = AkSoundEngine.PostEvent("Play_sfx_Yone_YoneE_beam_buffactivate", ((EntityState)this).gameObject);
		speed = 8f / dashDur;
		Transform modelTransform = ((EntityState)this).modelLocator.modelTransform;
		overlay = TemporaryOverlayManager.AddOverlay(((Component)modelTransform).gameObject);
		overlay.destroyComponentOnEnd = true;
		overlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
		overlay.animateShaderAlpha = true;
		overlay.originalMaterial = Prefabs.demonOverlay;
		overlay.duration = duration;
		overlay.AddToCharacterModel(((Component)modelTransform).GetComponent<CharacterModel>());
		if (((EntityState)this).isAuthority)
		{
			pp = Object.Instantiate<GameObject>(Prefabs.demonPP);
			behaviour.pp = pp.GetComponent<PostProcessDuration>();
			CrosshairManager val2 = CrosshairManager.instancesList.Find((CrosshairManager x) => (Object)(object)x.crosshairHudElement.targetBodyObject == (Object)(object)((EntityState)this).gameObject);
			if (Object.op_Implicit((Object)(object)val2))
			{
				indicatorObject = Object.Instantiate<GameObject>(Prefabs.hudIndicator, (Transform)(object)val2.container);
				indicatorObject.transform.localPosition = Vector3.zero;
				indicator = indicatorObject.GetComponentsInChildren<Image>()[1];
			}
		}
	}

	public override void FixedUpdate()
	{
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: 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_00b7: 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_00c1: 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_013e: Unknown result type (might be due to invalid IL or missing references)
		((GenericCharacterMain)this).FixedUpdate();
		dmgGoal = Mathf.Clamp01(damageTracker.damage / damageTracker.damageGoal);
		if (Object.op_Implicit((Object)(object)indicator))
		{
			indicator.fillAmount = dmgGoal;
		}
		speedMult = Math.Max(((EntityState)this).characterBody.moveSpeed / ((EntityState)this).characterBody.baseMoveSpeed, 1f);
		if (((EntityState)this).fixedAge <= dashDur)
		{
			CharacterMotor characterMotor = ((EntityState)this).characterMotor;
			characterMotor.rootMotion += dir * speed * speedMult * Time.fixedDeltaTime;
		}
		if (((EntityState)this).fixedAge >= 8f && !warningPlayed)
		{
			warningPlayed = true;
			AkSoundEngine.PostEvent("Play_sfx_Yone_YoneE_warning_cast", ((EntityState)this).gameObject);
		}
		if ((((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) || dmgGoal >= 1f)
		{
			((EntityState)this).outer.SetNextState((EntityState)(object)new DeathDash
			{
				startingPos = startingPos
			});
		}
	}

	public override void OnExit()
	{
		AkSoundEngine.StopPlayingID(ID);
		AkSoundEngine.PostEvent("Play_sfx_Yone_YoneE_sheath", ((EntityState)this).gameObject);
		if (Object.op_Implicit((Object)(object)indicatorObject))
		{
			EntityState.Destroy((Object)(object)indicatorObject);
		}
		overlay.Destroy();
		((GenericCharacterMain)this).OnExit();
	}
}
internal class DeathDash : BaseState
{
	private float duration = 0.55f;

	private Behaviour behaviour;

	public Vector3 startingPos;

	public Vector3 dir;

	private float distance;

	public bool revive;

	private int layer;

	private DeathDamageTracker damageTracker;

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

	public override void OnEnter()
	{
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: 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)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_008f: Unknown result type (might be due to invalid IL or missing references)
		((BaseState)this).OnEnter();
		behaviour = ((EntityState)this).GetComponent<Behaviour>();
		damageTracker = behaviour.damageTracker;
		startingPos += Vector3.up;
		Vector3 val = startingPos - ((EntityState)this).characterBody.footPosition;
		dir = ((Vector3)(ref val)).normalized;
		distance = Vector3.Distance(((EntityState)this).characterBody.footPosition, startingPos);
		((Behaviour)((EntityState)this).characterDirection).enabled = false;
		((EntityState)this).characterDirection.forward = dir;
		layer = ((EntityState)this).gameObject.layer;
		((EntityState)this).gameObject.layer = LayerIndex.noCollision.intVal;
		((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers();
		((EntityState)this).PlayAnimation("Body", "DeathDash", "Special", duration, 0f);
		if (Object.op_Implicit((Object)(object)behaviour.pp))
		{
			behaviour.pp.ppWeightCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
			behaviour.pp.stopwatch = 0f;
			behaviour.pp.maxDuration = duration;
		}
		revive = damageTracker.damage >= damageTracker.damageGoal;
		if (revive)
		{
			damageTracker.rezAmount++;
			damageTracker.dead = false;
		}
	}

	public override void FixedUpdate()
	{
		//IL_000a: 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_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: 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_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0105: Unknown result type (might be due to invalid IL or missing references)
		//IL_010f: Expected O, but got Unknown
		((EntityState)this).FixedUpdate();
		Vector3 val = startingPos - ((EntityState)this).characterBody.footPosition;
		dir = ((Vector3)(ref val)).normalized;
		float num = distance / duration;
		((EntityState)this).characterMotor.velocity = Vector3.zero;
		CharacterMotor characterMotor = ((EntityState)this).characterMotor;
		characterMotor.rootMotion += dir * num * Time.fixedDeltaTime;
		if (((EntityState)this).fixedAge >= duration && Object.op_Implicit((Object)(object)behaviour) && Object.op_Implicit((Object)(object)behaviour.deathModel))
		{
			EntityState.Destroy((Object)(object)behaviour.deathModel);
		}
		if (((EntityState)this).fixedAge >= duration)
		{
			if (revive && NetworkServer.active)
			{
				Respawn();
			}
			else if (((EntityState)this).isAuthority)
			{
				((EntityState)this).GetComponent<EntityStateMachine>().SetNextState((EntityState)new GenericCharacterDeath());
				((EntityState)this).outer.SetNextStateToMain();
			}
		}
	}

	public void Respawn()
	{
		//IL_000d: 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_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).characterBody.master.Respawn(startingPos, Quaternion.Euler(0f, Random.Range(0f, 360f), 0f), true);
		if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody.master.bodyInstanceObject))
		{
			EntityStateMachine[] components = ((EntityState)this).characterBody.master.bodyInstanceObject.GetComponents<EntityStateMachine>();
			foreach (EntityStateMachine val in components)
			{
				val.initialStateType = val.mainStateType;
			}
		}
	}

	public override void OnExit()
	{
		if (Object.op_Implicit((Object)(object)behaviour.pp))
		{
			EntityState.Destroy((Object)(object)((Component)behaviour.pp).gameObject);
		}
		((Component)((BaseState)this).FindModelChild("eyeTrailL")).gameObject.SetActive(false);
		((Component)((BaseState)this).FindModelChild("eyeTrailR")).gameObject.SetActive(false);
		if (!revive)
		{
			ILifeBehavior[] components = ((EntityState)this).gameObject.GetComponents<ILifeBehavior>();
			for (int i = 0; i < components.Length; i++)
			{
				components[i].OnDeathStart();
			}
			Transform modelTransform = ((EntityState)this).modelLocator.modelTransform;
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				components = ((Component)modelTransform).GetComponents<ILifeBehavior>();
				for (int j = 0; j < components.Length; j++)
				{
					components[j].OnDeathStart();
				}
			}
		}
		((EntityState)this).gameObject.layer = layer;
		((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers();
		((Behaviour)((EntityState)this).characterDirection).enabled = true;
		AkSoundEngine.PostEvent("Play_sfx_Yone_YoneE_deactivate", ((EntityState)this).gameObject);
		((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)7;
	}
}
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;

	public Animator animator;

	public bool Q3;

	public virtual float additionalExitTime => 0f;

	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 crossfade => true;

	public virtual bool additive => false;

	public virtual bool rootMotionWhileHitting => false;

	public virtual string swingSound => "";

	public virtual DamageType damageType => (DamageType)0;

	public virtual DamageColorIndex damageColor => (DamageColorIndex)0;

	public virtual Vector3 bonusForce => Vector3.zero;

	public virtual GameObject hitEffectPrefab => null;

	public virtual float attackSpeedScaling => Math.Min(((BaseState)this).attackSpeedStat, 6f);

	public virtual bool muzzle => true;

	public virtual bool emptyLayers => false;

	public override void OnEnter()
	{
		//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
		((BaseState)this).OnEnter();
		Q3 = ((EntityState)this).characterBody.GetBuffCount(Prefabs.QBuff) >= 2;
		attackDuration = baseAttackDuration / attackSpeedScaling;
		hitPauseDuration = GroundLight.hitPauseDuration / attackSpeedScaling;
		hopVelocity = baseHopVelocity / attackSpeedScaling;
		animator = ((EntityState)this).GetModelAnimator();
		animator.SetFloat(hitBoxActiveParameter, 0f);
		animator.SetFloat("Curve2", 0f);
		animator.SetBool("SkillOver", false);
		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))
		{
			if (emptyLayers)
			{
				((EntityState)this).PlayAnimation("Additive, Override", "BufferEmpty");
				((EntityState)this).PlayAnimation("Gesture, Override", "BufferEmpty");
				((EntityState)this).PlayAnimation("FullBody, Override", "BufferEmpty");
			}
			PlayAnim();
		}
	}

	public virtual void PlayAnim()
	{
		if (additive)
		{
			((EntityState)this).PlayAnimation("Additive, Override", "BufferEmpty");
			((EntityState)this).PlayAnimation("Additive, Override", animationStateName, animParameter, attackDuration, 0f);
		}
		if (crossfade)
		{
			((EntityState)this).PlayCrossfade(layerName, animationStateName, animParameter, attackDuration, 0.12f);
		}
		else
		{
			((EntityState)this).PlayAnimation(layerName, animationStateName, animParameter, attackDuration, 0f);
		}
	}

	public override void OnExit()
	{
		animator.SetBool("SkillOver", true);
		((EntityState)this).OnExit();
	}

	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 virtual Vector3 forwardCharacterDirection()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_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 Utils.GetForwardDirection(rootMotionDirection());
	}

	public virtual void SetForwardDirection()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).characterDirection.forward = forwardCharacterDirection();
	}

	public override void FixedUpdate()
	{
		//IL_0030: 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_00f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fe: 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_0110: 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_011a: 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)
				{
					isInHitPause = true;
				}
			}
			if (animator.GetFloat(hitBoxActiveParameter) > 0.1f && rootMotion && !isInHitPause)
			{
				Vector3 val = rootMotionDirection();
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				characterMotor.rootMotion += val * rootMotionSpeed * Time.fixedDeltaTime;
				SetForwardDirection();
			}
			if (hitPauseTimer >= hitPauseDuration && isInHitPause)
			{
				isInHitPause = false;
				animator.speed = 1f;
			}
			if (!isInHitPause)
			{
				stopwatch += Time.fixedDeltaTime;
			}
			else
			{
				hitPauseTimer += Time.fixedDeltaTime;
				animator.speed = 0f;
			}
			if (stopwatch >= attackDuration * earlyExitDurationPercentage)
			{
				if (((EntityState)this).inputBank.skill1.down)
				{
					SetState();
				}
				if (stopwatch >= attackDuration + additionalExitTime)
				{
					BaseSkillState val2 = StateOverride();
					if (val2 != null)
					{
						((EntityState)this).outer.SetNextState((EntityState)(object)val2);
					}
					else
					{
						((EntityState)this).outer.SetNextStateToMain();
					}
					return;
				}
			}
		}
		if (animator.GetFloat(hitBoxActiveParameter) >= 0.1f && !hasSwung)
		{
			hasSwung = true;
			AkSoundEngine.PostEvent(swingSound, ((EntityState)this).gameObject);
			PlayVFX();
		}
	}

	public virtual void PlayVFX()
	{
		//IL_0082: 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)
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)swingEffectPrefab) && !Utility.IsNullOrWhiteSpace(swingMuzzle))
		{
			ParticleScale component = swingEffectPrefab.GetComponent<ParticleScale>();
			if (Object.op_Implicit((Object)(object)component))
			{
				component.scale = attackSpeedScaling;
			}
			if (muzzle)
			{
				EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, swingMuzzle, false);
			}
			else
			{
				EffectManager.SimpleEffect(swingEffectPrefab, ((BaseState)this).FindModelChild(swingMuzzle).position, Quaternion.LookRotation(((EntityState)this).characterDirection.forward), false);
			}
		}
	}

	public bool FireMeleeAttack(OverlapAttack attack, Animator animator, string mecanimHitboxActiveParameter, float forceMagnitude, Vector3 bonusForce)
	{
		//IL_0042: 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_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		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 Primary : MeleeSkillState
{
	public int attackIndex = 1;

	private int layer;

	private Behaviour behaviour;

	private bool finisher => attackIndex == 2;

	public override float baseAttackDuration => 0.5f;

	public override float earlyExitDurationPercentage => finisher ? 0.95f : 0.85f;

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

	public override string animationStateName => "Attack" + attackIndex;

	public override string hitBoxGroupName => "Slash";

	public override float forceMagnitude => 250f;

	public override float damageCoefficient => 1.2f;

	public override string swingSound => finisher ? "Play_sfx_Yone_YoneBasicAttack2_swipe" : "Play_sfx_Yone_YoneBasicAttack_OnCast";

	public override float baseHopVelocity => 6f;

	public override GameObject hitEffectPrefab => finisher ? Prefabs.basicRedHitEffect : Prefabs.basicHitEffect;

	public override bool crossfade => true;

	public override bool additive => true;

	public override string swingMuzzle => finisher ? "slashRMuzzle" : "slashLMuzzle";

	public override GameObject swingEffectPrefab => finisher ? Prefabs.slashEffectR : Prefabs.slashEffectL;

	public override DamageType damageType => DamageTypeCombo.op_Implicit(DamageTypeCombo.GenericPrimary);

	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 PlayVFX()
	{
		behaviour.PlaySlashEffect(finisher);
	}

	public override void OnEnter()
	{
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		base.OnEnter();
		behaviour = ((EntityState)this).GetComponent<Behaviour>();
		if (attackIndex == 2)
		{
			DamageAPI.AddModdedDamageType(overlapAttack, Prefabs.bleed);
			layer = ((EntityState)this).gameObject.layer;
			((EntityState)this).gameObject.layer = LayerIndex.GetAppropriateFakeLayerForTeam(((EntityState)this).teamComponent.teamIndex).intVal;
			((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers();
		}
	}

	public override void OnExit()
	{
		if (attackIndex == 2)
		{
			((EntityState)this).gameObject.layer = layer;
			((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers();
		}
		base.OnExit();
	}

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

	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 : MeleeSkillState
{
	private bool addedBuff;

	private AimRequest request;

	private Behaviour behaviour;

	private bool firedProj;

	private Transform modelTransform;

	public override float additionalExitTime => 0.2f / ((BaseState)this).attackSpeedStat;

	public override float baseAttackDuration => Q3 ? 0.65f : 0.35f;

	public override string layerName => Q3 ? "Body" : "Gesture, Override";

	public override string animParameter => "M2";

	public override string animationStateName => Q3 ? "Q3" : "Q1";

	public override string hitBoxGroupName => "Slash";

	public override bool emptyLayers => Q3;

	public override float damageCoefficient => Q3 ? 3f : 2.4f;

	public override string swingSound => Q3 ? "Play_sfx_Yone_YoneQ3_OnCast" : "Play_sfx_Yone_YoneQ_OnCast";

	public override float baseHopVelocity => 6f;

	public override GameObject hitEffectPrefab => Q3 ? Prefabs.Q3HitEffect : Prefabs.Q1HitEffect;

	public override float attackSpeedScaling => 1f;

	private string skinMuzzle => ((EntityState)this).characterBody.skinIndex switch
	{
		0u => "", 
		1u => "skin19", 
		2u => "skin55", 
		_ => "", 
	};

	public override string swingMuzzle => Q3 ? "Q3Muzzle" : (skinMuzzle + "QMuzzle");

	public override GameObject swingEffectPrefab => Q3 ? Prefabs.Q3Slash : Prefabs.QSlash;

	public override bool rootMotion => Q3;

	public override bool rootMotionWhileHitting => true;

	public override float rootMotionSpeed => 38f * (((BaseState)this).moveSpeedStat / ((EntityState)this).characterBody.baseMoveSpeed);

	public override DamageType damageType => DamageTypeCombo.op_Implicit(DamageTypeCombo.GenericSecondary);

	public override Vector3 rootMotionDirection()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000a: 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)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		Ray aimRay = ((BaseState)this).GetAimRay();
		return ((Ray)(ref aimRay)).direction;
	}

	public override void SetForwardDirection()
	{
		if (!Q3)
		{
			base.SetForwardDirection();
		}
	}

	public override void OnEnter()
	{
		//IL_00a1: 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_0036: Unknown result type (might be due to invalid IL or missing references)
		base.OnEnter();
		modelTransform = ((EntityState)this).modelLocator.modelTransform;
		behaviour = ((EntityState)this).GetComponent<Behaviour>();
		if (Q3)
		{
			DamageAPI.AddModdedDamageType(overlapAttack, Prefabs.knockup);
			Prefabs.Q3Projectile.GetComponent<ProjectileSimple>().lifetime = attackDuration + ((EntityState)this).GetComponent<Behaviour>().projDur;
			request = ((EntityState)this).cameraTargetParams.RequestAimType((AimType)2);
			behaviour.Q3 = true;
			((EntityState)this).modelLocator.autoUpdateModelTransform = false;
		}
		((Behaviour)((EntityState)this).characterDirection).enabled = false;
		((EntityState)this).characterDirection.forward = Utils.GetForwardDirection(rootMotionDirection());
	}

	public override void PlayAnim()
	{
		if (!Q3)
		{
			base.PlayAnim();
		}
		else
		{
			((EntityState)this).PlayAnimation(layerName, animationStateName, animParameter, attackDuration / 2f, 0f);
		}
	}

	public override void Update()
	{
		//IL_000f: 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)
		((EntityState)this).Update();
		modelTransform.forward = rootMotionDirection();
		modelTransform.position = ((EntityState)this).modelLocator.modelBaseTransform.position;
	}

	public override void FixedUpdate()
	{
		base.FixedUpdate();
		if (((EntityState)this).isAuthority && Q3 && !firedProj && animator.GetFloat("Curve") >= 0.11f)
		{
			firedProj = true;
		}
		if (!Q3)
		{
			animator.SetFloat("move", (float)((!((BaseState)this).isGrounded) ? 1 : (animator.GetBool("isMoving") ? 1 : 0)), 0.1f, Time.fixedDeltaTime);
		}
		if (!addedBuff && hasHit)
		{
			addedBuff = true;
			((EntityState)this).GetComponent<Behaviour>().CallCmdAddBuff();
		}
	}

	public override void OnExit()
	{
		((EntityState)this).modelLocator.autoUpdateModelTransform = true;
		((Behaviour)((EntityState)this).characterDirection).enabled = true;
		behaviour.Q3 = false;
		if (Q3)
		{
			request.Dispose();
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.ClearTimedBuffs(Prefabs.QBuff);
			}
		}
		base.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 : MeleeSkillState
{
	public override float baseAttackDuration => 0.35f;

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

	public override string animParameter => "Special";

	public override string animationStateName => "Swipe";

	public override string hitBoxGroupName => "Swipe";

	public override float forceMagnitude => 2250f;

	public override float damageCoefficient => 4f;

	public override string swingSound => "Play_sfx_Yone_YoneW_OnCast";

	public override float baseHopVelocity => 6f;

	public override GameObject hitEffectPrefab => Prefabs.SwipeHitEffect;

	public override string swingMuzzle => "base";

	public override GameObject swingEffectPrefab => Prefabs.WideSlash;

	public override DamageType damageType => DamageTypeCombo.op_Implicit(DamageTypeCombo.GenericSpecial);

	public override bool muzzle => false;

	public override void OnEnter()
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		base.OnEnter();
		DamageAPI.AddModdedDamageType(overlapAttack, Prefabs.swipe);
	}

	public override void FixedUpdate()
	{
		base.FixedUpdate();
	}

	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 Utility : BaseSkillState
{
	private float duration;

	private float baseDuration = 1.2f;

	private float stopwatch;

	private Dictionary<HealthComponent, List<Highlight>> targets = new Dictionary<HealthComponent, List<Highlight>>();

	private Behaviour behaviour;

	private Vector3 dir;

	private float speedMult;

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		behaviour = ((EntityState)this).GetComponent<Behaviour>();
		duration = baseDuration / ((BaseState)this).attackSpeedStat;
		((EntityState)this).GetModelAnimator().SetBool("SkillOver", false);
		((EntityState)this).PlayAnimation("Additive, Override", "BufferEmpty");
		((EntityState)this).PlayAnimation("Gesture, Override", "BufferEmpty");
		((EntityState)this).PlayAnimation("FullBody, Override", "BufferEmpty");
		((EntityState)this).PlayAnimation("Body", "Ult", "Utility", duration, 0f);
		if (NetworkServer.active)
		{
		}
		AkSoundEngine.PostEvent("Play_sfx_Yone_YoneR_OnCast", ((EntityState)this).gameObject);
		Transform modelTransform = ((EntityState)this).modelLocator.modelTransform;
		TemporaryOverlayInstance val = TemporaryOverlayManager.AddOverlay(((Component)modelTransform).gameObject);
		val.destroyComponentOnEnd = true;
		val.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
		val.animateShaderAlpha = true;
		val.originalMaterial = Prefabs.dashOverlay;
		val.duration = duration;
		val.AddToCharacterModel(((Component)modelTransform).GetComponent<CharacterModel>());
	}

	public override void Update()
	{
		//IL_000e: 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)
		((EntityState)this).Update();
		((EntityState)this).characterMotor.velocity = Vector3.zero;
	}

	public override void FixedUpdate()
	{
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_0102: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).FixedUpdate();
		speedMult = Math.Max(((EntityState)this).characterBody.moveSpeed / ((EntityState)this).characterBody.baseMoveSpeed, 1f);
		behaviour.dashDamageMult = Mathf.Clamp01(((EntityState)this).fixedAge / duration);
		stopwatch += Time.fixedDeltaTime;
		((EntityState)this).characterDirection.forward = Vector3.Lerp(((EntityState)this).characterDirection.forward, dir, 5f * Time.fixedDeltaTime);
		if (stopwatch >= 0.1f)
		{
			stopwatch = 0f;
			Search();
		}
		if ((((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) || (targets.Count > 0 && !((EntityState)this).inputBank.skill3.down))
		{
			((EntityState)this).outer.SetNextState((EntityState)(object)new UtilityDash
			{
				dir = dir,
				speedMult = speedMult
			});
		}
	}

	private void Search()
	{
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_006c: 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_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a6: Expected O, but got Unknown
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bd: 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_0180: Unknown result type (might be due to invalid IL or missing references)
		//IL_0183: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bd: 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_01e0: Unknown result type (might be due to invalid IL or missing references)
		EnumerableExtensions.ForEachTry<KeyValuePair<HealthComponent, List<Highlight>>>((IEnumerable<KeyValuePair<HealthComponent, List<Highlight>>>)targets, (Action<KeyValuePair<HealthComponent, List<Highlight>>>)delegate(KeyValuePair<HealthComponent, List<Highlight>> x)
		{
			x.Value.ForEach(delegate(Highlight y)
			{
				EntityState.Destroy((Object)(object)y);
			});
		}, (IDictionary<KeyValuePair<HealthComponent, List<Highlight>>, Exception>)null);
		targets.Clear();
		Ray aimRay = ((BaseState)this).GetAimRay();
		dir = ((Ray)(ref aimRay)).direction;
		BullseyeSearch val = new BullseyeSearch
		{
			searchOrigin = ((Ray)(ref aimRay)).origin,
			searchDirection = ((Ray)(ref aimRay)).direction,
			maxDistanceFilter = 45f * speedMult,
			maxAngleFilter = behaviour.dashAngle,
			sortMode = (SortMode)3,
			filterByDistinctEntity = true,
			filterByLoS = true
		};
		val.teamMaskFilter = TeamMask.allButNeutral;
		((TeamMask)(ref val.teamMaskFilter)).RemoveTeam(TeamComponent.GetObjectTeam(((EntityState)this).gameObject));
		val.RefreshCandidates();
		IEnumerable<HurtBox> results = val.GetResults();
		foreach (HurtBox item in results)
		{
			if (!Object.op_Implicit((Object)(object)item.healthComponent) || !item.healthComponent.alive || !Object.op_Implicit((Object)(object)item.healthComponent.body.modelLocator.modelTransform))
			{
				continue;
			}
			CharacterModel component = ((Component)item.healthComponent.body.modelLocator.modelTransform).GetComponent<CharacterModel>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				continue;
			}
			List<Highlight> list = new List<Highlight>();
			RendererInfo[] baseRendererInfos = component.baseRendererInfos;
			foreach (RendererInfo val2 in baseRendererInfos)
			{
				if (!val2.ignoreOverlays)
				{
					Highlight val3 = ((Component)item.healthComponent.body.modelLocator.modelTransform).gameObject.AddComponent<Highlight>();
					val3.CustomColor = MainPlugin.characterColor;
					val3.highlightColor = (HighlightColor)3;
					val3.isOn = true;
					val3.strength = 1f;
					val3.targetRenderer = val2.renderer;
					list.Add(val3);
				}
			}
			targets.Add(item.healthComponent, list);
		}
		behaviour.targets = targets;
	}

	public override void OnExit()
	{
		if (NetworkServer.active)
		{
		}
		((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)7;
	}
}
internal class UtilityDash : BaseSkillState
{
	private float duration = 0.09f;

	public Vector3 dir;

	private int layer;

	private float speed;

	public float speedMult;

	public override void OnSerialize(NetworkWriter writer)
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		((BaseSkillState)this).OnSerialize(writer);
		writer.Write(dir);
		writer.Write((byte)speedMult);
	}

	public override void OnDeserialize(NetworkReader reader)
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		((BaseSkillState)this).OnDeserialize(reader);
		dir = reader.ReadVector3();
		speedMult = (int)reader.ReadByte();
	}

	public override void OnEnter()
	{
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		((BaseState)this).OnEnter();
		((EntityState)this).GetModelAnimator().SetBool("SkillOver", true);
		layer = ((EntityState)this).gameObject.layer;
		((EntityState)this).gameObject.layer = LayerIndex.GetAppropriateFakeLayerForTeam(((EntityState)this).teamComponent.teamIndex).intVal;
		((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers();
		AkSoundEngine.PostEvent("Play_sfx_Yone_YoneR_cast_dash", ((EntityState)this).gameObject);
		speed = 45f / duration;
		((Behaviour)((EntityState)this).characterDirection).enabled = false;
		((EntityState)this).characterDirection.forward = dir;
		EffectManager.SimpleMuzzleFlash(Prefabs.DashHitSelf, ((EntityState)this).gameObject, "base", false);
	}

	public override void FixedUpdate()
	{
		//IL_000e: 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_001f: 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_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).FixedUpdate();
		((EntityState)this).characterMotor.velocity = Vector3.zero;
		CharacterMotor characterMotor = ((EntityState)this).characterMotor;
		characterMotor.rootMotion += dir * speed * speedMult * Time.fixedDeltaTime;
		if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
		{
			((EntityState)this).outer.SetNextState((EntityState)(object)new UtilityEnd
			{
				dir = dir
			});
		}
	}

	public override void OnExit()
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		((Behaviour)((EntityState)this).characterDirection).enabled = true;
		((EntityState)this).characterMotor.velocity = Vector3.zero;
		((EntityState)this).gameObject.layer = layer;
		((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers();
		((EntityState)this).OnExit();
	}

	public override InterruptPriority