JhinMod.dll

Decompiled 2 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EmotesAPI;
using EntityStates;
using EntityStates.Commando;
using EntityStates.Commando.CommandoWeapon;
using EntityStates.GlobalSkills.LunarDetonator;
using EntityStates.GlobalSkills.LunarNeedle;
using EntityStates.Mage.Weapon;
using EntityStates.Railgunner.Scope;
using HG;
using HG.BlendableTypes;
using JetBrains.Annotations;
using JhinMod.Content;
using JhinMod.Content.Components;
using JhinMod.Content.UI;
using JhinMod.Modules;
using JhinMod.Modules.Characters;
using JhinMod.Modules.CustomProjectiles;
using JhinMod.Modules.SkillDefs;
using JhinMod.Modules.Survivors;
using JhinMod.SkillStates;
using JhinMod.SkillStates.BaseStates;
using JhinMod.SkillStates.Henry;
using On.EntityStates;
using On.EntityStates.GlobalSkills.LunarDetonator;
using On.EntityStates.Mage.Weapon;
using On.RoR2;
using On.RoR2.SurvivorMannequins;
using On.RoR2.UI;
using R2API;
using R2API.Utils;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.Achievements;
using RoR2.Audio;
using RoR2.ContentManagement;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.SurvivorMannequins;
using RoR2.UI;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("JhinMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("JhinMod")]
[assembly: AssemblyTitle("JhinMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: UnverifiableCode]
public class ProjectMaskGlitchFX : MonoBehaviour
{
	[SerializeField]
	public MeshRenderer maskRenderer;

	public float minimumStableTime = 2f;

	public float maximumStableTime = 15f;

	public float timeBetweenAttempts = 0.2f;

	public float maskFrameHoldMin = 0.1f;

	public float maskFrameHoldMax = 0.3f;

	public float maskFrameHoldTime = 0.2f;

	public float glitchFrameHoldMin = 0.1f;

	public float glitchFrameHoldMax = 0.3f;

	public float glitchFrameHoldTime = 0.2f;

	public float timeSinceTry;

	public float timeSinceMask;

	public float timeSinceGlitch;

	public float maskGlitchChance = 5f;

	public float maskGlitchMultipleChance = 30f;

	public int maskFrame = 0;

	public int glitchActive = 0;

	public List<int> possibleMaskFrames = new List<int> { 1, 2, 3 };

	private void Awake()
	{
	}

	private void Start()
	{
	}

	private void Update()
	{
		timeSinceTry += Time.deltaTime;
		timeSinceMask += Time.deltaTime;
		timeSinceGlitch += Time.deltaTime;
		if (!(timeSinceTry < timeBetweenAttempts))
		{
			if (maskFrame != 0 && timeSinceMask > maskFrameHoldTime)
			{
				RollMask(maskGlitchMultipleChance, maskFrame);
			}
			if (timeSinceMask > minimumStableTime && timeSinceMask > maskFrameHoldTime)
			{
				RollMask(maskGlitchChance);
			}
			if (glitchActive != 0 && timeSinceGlitch > glitchFrameHoldTime)
			{
				RollGlitchOverlay(maskGlitchMultipleChance);
			}
			if (timeSinceGlitch > minimumStableTime && timeSinceGlitch > glitchFrameHoldTime)
			{
				RollGlitchOverlay(maskGlitchChance);
			}
			timeSinceTry = 0f;
		}
	}

	public void RollMask(float chance, int avoidFrame = 0)
	{
		int num = Random.Range(0, 100);
		if ((float)num <= chance)
		{
			List<int> list = new List<int>(possibleMaskFrames);
			if (avoidFrame != 0)
			{
				list.Remove(avoidFrame);
			}
			int count = list.Count;
			int index = Random.Range(0, count);
			maskFrame = list[index];
			maskFrameHoldTime = Random.Range(maskFrameHoldMin, maskFrameHoldMax);
			timeSinceMask = 0f;
		}
		else
		{
			maskFrame = 0;
		}
		((Renderer)maskRenderer).materials[0].SetInt("_MaskFrame", maskFrame);
	}

	public void RollGlitchOverlay(float chance)
	{
		//IL_0052: 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)
		int num = Random.Range(0, 100);
		if ((float)num <= chance)
		{
			glitchActive = 1;
			float num2 = Random.Range(0f, 1f);
			float num3 = Random.Range(0f, 1f);
			((Renderer)maskRenderer).materials[0].SetVector("_GlitchOffset", Vector4.op_Implicit(new Vector2(num2, num3)));
			glitchFrameHoldTime = Random.Range(glitchFrameHoldMin, glitchFrameHoldMax);
			timeSinceGlitch = 0f;
		}
		else
		{
			glitchActive = 0;
		}
		((Renderer)maskRenderer).materials[0].SetInt("_GlitchActive", glitchActive);
	}
}
namespace JhinMod
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.seroronin.JhinMod", "JhinMod", "1.4.2")]
	[R2APISubmoduleDependency(new string[] { "PrefabAPI", "LanguageAPI", "SoundAPI", "UnlockableAPI" })]
	public class JhinPlugin : BaseUnityPlugin
	{
		public const string MODUID = "com.seroronin.JhinMod";

		public const string MODNAME = "JhinMod";

		public const string MODVERSION = "1.4.2";

		public const string DEVELOPER_PREFIX = "SERORONIN";

		public static JhinPlugin instance;

		public bool emoteSetup;

		public bool CustomEmotesActive = false;

		public static Dictionary<Transform, GameObject> playerLobbyModelFX = new Dictionary<Transform, GameObject>();

		private JhinAmmoUI ammoUI;

		private void Awake()
		{
			instance = this;
			Log.Init(((BaseUnityPlugin)this).Logger);
			Asset.Initialize();
			Config.ReadConfig();
			if (Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"))
			{
				Config.CreateRiskofOptionsCompat();
			}
			CustomEmotesActive = Chainloader.PluginInfos.ContainsKey("com.weliveinasociety.CustomEmotesAPI");
			Log.Warning(CustomEmotesActive ? "Emotes active" : "Emotes inactive");
			States.RegisterStates();
			Buffs.RegisterBuffs();
			Projectiles.RegisterProjectiles();
			Tokens.AddTokens();
			ItemDisplays.PopulateDisplays();
			new JhinSurvivor().Initialize();
			new ContentPacks().Initialize();
			Hook();
		}

		public void OnDestroy()
		{
			try
			{
				UnHooks();
			}
			catch (Exception ex)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)(ex.Message + " - " + ex.StackTrace));
			}
		}

		private void Hook()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//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
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Expected O, but got Unknown
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Expected O, but got Unknown
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Expected O, but got Unknown
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Expected O, but got Unknown
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Expected O, but got Unknown
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Expected O, but got Unknown
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Expected O, but got Unknown
			SurvivorMannequinSlotController.ApplyLoadoutToMannequinInstance += new hook_ApplyLoadoutToMannequinInstance(SurvivorMannequinSlotController_ApplyLoadoutToMannequinInstance);
			GlobalEventManager.OnHitEnemy += new hook_OnHitEnemy(GlobalEventManager_OnHitEnemy);
			HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_OnTakeDamage);
			CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats);
			HUD.Awake += new hook_Awake(HUD_Awake);
			HUD.onHudTargetChangedGlobal += HUD_onHudTargetChangedGlobal;
			BaseChargeBombState.OnEnter += new hook_OnEnter(SlicingMaelstrom_Charge_OnEnter);
			BaseChargeBombState.OnExit += new hook_OnExit(SlicingMaelstrom_Charge_OnExit);
			GhostUtilitySkillState.OnEnter += new hook_OnEnter(Shadowfade_OnEnter);
			GhostUtilitySkillState.OnExit += new hook_OnExit(Shadowfade_OnExit);
			Detonate.OnEnter += new hook_OnEnter(Ruin_OnEnter);
			FrozenState.OnEnter += new hook_OnEnter(FrozenState_OnEnter);
			FrozenState.OnExit += new hook_OnExit(FrozenState_OnExit);
			if (CustomEmotesActive)
			{
				CustomEmotesAPISupport.HookCustomEmoteAPI();
			}
		}

		private void UnHooks()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//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
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Expected O, but got Unknown
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Expected O, but got Unknown
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Expected O, but got Unknown
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Expected O, but got Unknown
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Expected O, but got Unknown
			SurvivorMannequinSlotController.ApplyLoadoutToMannequinInstance -= new hook_ApplyLoadoutToMannequinInstance(SurvivorMannequinSlotController_ApplyLoadoutToMannequinInstance);
			GlobalEventManager.OnHitEnemy -= new hook_OnHitEnemy(GlobalEventManager_OnHitEnemy);
			CharacterBody.RecalculateStats -= new hook_RecalculateStats(CharacterBody_RecalculateStats);
			HUD.Awake -= new hook_Awake(HUD_Awake);
			HUD.onHudTargetChangedGlobal -= HUD_onHudTargetChangedGlobal;
			BaseChargeBombState.OnEnter -= new hook_OnEnter(SlicingMaelstrom_Charge_OnEnter);
			BaseChargeBombState.OnExit -= new hook_OnExit(SlicingMaelstrom_Charge_OnExit);
			GhostUtilitySkillState.OnEnter -= new hook_OnEnter(Shadowfade_OnEnter);
			GhostUtilitySkillState.OnExit -= new hook_OnExit(Shadowfade_OnExit);
			Detonate.OnEnter -= new hook_OnEnter(Ruin_OnEnter);
			FrozenState.OnEnter -= new hook_OnEnter(FrozenState_OnEnter);
			FrozenState.OnExit -= new hook_OnExit(FrozenState_OnExit);
			if (CustomEmotesActive)
			{
				CustomEmotesAPISupport.UnhookCustomEmoteAPI();
			}
		}

		private void SurvivorMannequinSlotController_ApplyLoadoutToMannequinInstance(orig_ApplyLoadoutToMannequinInstance orig, SurvivorMannequinSlotController self)
		{
			//IL_002e: 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_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (!Object.op_Implicit((Object)(object)self.mannequinInstanceTransform))
			{
				return;
			}
			Transform mannequinInstanceTransform = self.mannequinInstanceTransform;
			BodyIndex bodyIndexFromSurvivorIndex = SurvivorCatalog.GetBodyIndexFromSurvivorIndex(self.currentSurvivorDef.survivorIndex);
			int skinIndex = (int)self.currentLoadout.bodyLoadoutManager.GetSkinIndex(bodyIndexFromSurvivorIndex);
			if (!((Object)((Component)mannequinInstanceTransform).gameObject).name.Contains("JhinDisplay"))
			{
				return;
			}
			if (playerLobbyModelFX.ContainsKey(self.mannequinInstanceTransform) && (Object)(object)playerLobbyModelFX[self.mannequinInstanceTransform] != (Object)null)
			{
				Object.Destroy((Object)(object)playerLobbyModelFX[self.mannequinInstanceTransform]);
				playerLobbyModelFX.Remove(self.mannequinInstanceTransform);
			}
			if (!playerLobbyModelFX.ContainsKey(self.mannequinInstanceTransform))
			{
				GameObject vFXDynamic = Helpers.GetVFXDynamic("ModelFX", skinIndex);
				if ((Object)(object)vFXDynamic != (Object)null)
				{
					GameObject val = Object.Instantiate<GameObject>(vFXDynamic, self.mannequinInstanceTransform);
					BindPairLocator component = val.GetComponent<BindPairLocator>();
					component.target = ((Component)self.mannequinInstanceTransform).gameObject;
					component.BindPairs();
					playerLobbyModelFX[self.mannequinInstanceTransform] = val;
				}
			}
		}

		private void GlobalEventManager_OnHitEnemy(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
		{
			orig.Invoke(self, damageInfo, victim);
			if (damageInfo.crit && Object.op_Implicit((Object)(object)damageInfo.attacker) && !damageInfo.rejected)
			{
				CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
				if (Object.op_Implicit((Object)(object)component) && component.baseNameToken == "SERORONIN_JHIN_BODY_NAME" && NetworkServer.active)
				{
					component.AddTimedBuff(Buffs.jhinCritMovespeedBuff, Config.passiveBuffDuration.Value);
				}
			}
		}

		private void HealthComponent_OnTakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo info)
		{
			//IL_0002: 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)
			if (DamageAPI.HasModdedDamageType(info, Buffs.JhinMarkDamage) && NetworkServer.active)
			{
				self.body.AddTimedBuff(Buffs.jhinMarkDebuff, Config.utilityMarkDuration.Value);
			}
			if (self.body.HasBuff(Buffs.jhinMarkDebuff) && DamageAPI.HasModdedDamageType(info, Buffs.JhinConsumeMarkDamage) && NetworkServer.active)
			{
				self.body.ClearTimedBuffs(Buffs.jhinMarkDebuff);
				self.body.AddTimedBuff(Buffs.Nullified, Config.utilityRootDuration.Value);
			}
			orig.Invoke(self, info);
		}

		private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self) && self.baseNameToken == "SERORONIN_JHIN_BODY_NAME")
			{
				float damage = self.damage;
				float attackSpeed = self.attackSpeed;
				float moveSpeed = self.moveSpeed;
				float num = self.baseAttackSpeed + self.levelAttackSpeed * self.level;
				float attakSpeedBonus = Mathf.Max(attackSpeed - num, 0f);
				float num2 = CalculateDamageBonus(damage, attakSpeedBonus, num);
				JhinStateController component = ((Component)self).GetComponent<JhinStateController>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.preModAtkSpeed = attackSpeed;
				}
				self.damage += num2;
				self.attackSpeed = num;
				if (self.HasBuff(Buffs.jhinCritMovespeedBuff))
				{
					float num3 = CalculateMovespeedBonus(moveSpeed, attakSpeedBonus, num);
					self.moveSpeed += num3;
				}
			}
		}

		public float CalculateDamageBonus(float damage, float attakSpeedBonus, float attackSpeedLocked)
		{
			float value = Config.passiveDamageConversion.Value;
			float num = attakSpeedBonus / attackSpeedLocked;
			return damage * (value * num);
		}

		public float CalculateMovespeedBonus(float movespeed, float attakSpeedBonus, float attackSpeedLocked)
		{
			float value = Config.passiveMovespeedConversion.Value;
			float num = attakSpeedBonus / attackSpeedLocked;
			return movespeed * (0.1f + value * num);
		}

		private void SlicingMaelstrom_Charge_OnEnter(orig_OnEnter orig, BaseChargeBombState self)
		{
			orig.Invoke(self);
			if (self is ChargeLunarSecondary)
			{
				JhinStateController component = ((EntityState)self).GetComponent<JhinStateController>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.PauseReload();
				}
			}
		}

		private void SlicingMaelstrom_Charge_OnExit(orig_OnExit orig, BaseChargeBombState self)
		{
			orig.Invoke(self);
			if (self is ChargeLunarSecondary)
			{
				JhinStateController component = ((EntityState)self).GetComponent<JhinStateController>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.StopReload();
				}
			}
		}

		private void Shadowfade_OnEnter(orig_OnEnter orig, GhostUtilitySkillState self)
		{
			JhinStateController component = ((EntityState)self).GetComponent<JhinStateController>();
			if ((Object)(object)component != (Object)null)
			{
				if (component.ammoCount != 0)
				{
					component.PauseReload();
				}
				GameObject modelFX = component.modelFX;
				if (Object.op_Implicit((Object)(object)modelFX))
				{
					modelFX.SetActive(false);
				}
				GameObject ultFX = component.ultFX;
				if (Object.op_Implicit((Object)(object)ultFX))
				{
					ultFX.SetActive(false);
				}
			}
			orig.Invoke(self);
		}

		private void Shadowfade_OnExit(orig_OnExit orig, GhostUtilitySkillState self)
		{
			JhinStateController component = ((EntityState)self).GetComponent<JhinStateController>();
			if ((Object)(object)component != (Object)null)
			{
				if (component.ammoCount != 0)
				{
					component.StopReload();
				}
				GameObject modelFX = component.modelFX;
				if (Object.op_Implicit((Object)(object)modelFX))
				{
					modelFX.SetActive(true);
				}
				GameObject ultFX = component.ultFX;
				if (Object.op_Implicit((Object)(object)ultFX))
				{
					ultFX.SetActive(true);
				}
			}
			orig.Invoke(self);
		}

		private void Ruin_OnEnter(orig_OnEnter orig, Detonate self)
		{
			JhinStateController component = ((EntityState)self).GetComponent<JhinStateController>();
			if ((Object)(object)component != (Object)null && component.ammoCount != 0)
			{
				component.StopReload();
			}
			orig.Invoke(self);
		}

		public void FrozenState_OnEnter(orig_OnEnter orig, FrozenState self)
		{
			orig.Invoke(self);
			JhinStateController component = ((EntityState)self).GetComponent<JhinStateController>();
			if (Object.op_Implicit((Object)(object)component))
			{
				component.PauseReload();
			}
		}

		public void FrozenState_OnExit(orig_OnExit orig, FrozenState self)
		{
			JhinStateController component = ((EntityState)self).GetComponent<JhinStateController>();
			if (Object.op_Implicit((Object)(object)component))
			{
				component.StopReload();
			}
			orig.Invoke(self);
		}

		private void CreateAmmoUI(HUD hud)
		{
			//IL_00aa: 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_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)ammoUI) && (Object)(object)hud != (Object)null && (Object)(object)hud.mainUIPanel != (Object)null)
			{
				ammoUI = hud.mainUIPanel.GetComponentInChildren<JhinAmmoUI>();
				if (!Object.op_Implicit((Object)(object)ammoUI))
				{
					GameObject val = Object.Instantiate<GameObject>(Asset.mainAssetBundle.LoadAsset<GameObject>("JhinAmmoUI"));
					ammoUI = val.AddComponent<JhinAmmoUI>();
					val.transform.SetParent(hud.mainUIPanel.transform);
					RectTransform component = val.GetComponent<RectTransform>();
					component.anchorMin = new Vector2(0.5f, 0.5f);
					component.anchorMax = new Vector2(0.5f, 0.5f);
					component.pivot = new Vector2(0.5f, 0.5f);
					component.sizeDelta = new Vector2(1f, 1f);
					component.anchoredPosition = new Vector2(530f, -355f);
					((Transform)component).localRotation = Quaternion.Euler(0f, 0f, 0f);
					((Transform)component).localScale = new Vector3(0.2f, 0.2f, 0.2f);
					val.gameObject.SetActive(false);
				}
			}
		}

		private void HUD_Awake(orig_Awake orig, HUD self)
		{
			CreateAmmoUI(self);
			orig.Invoke(self);
		}

		private void HUD_onHudTargetChangedGlobal(HUD obj)
		{
			if (Object.op_Implicit((Object)(object)obj) && Object.op_Implicit((Object)(object)obj.targetBodyObject) && Object.op_Implicit((Object)(object)ammoUI))
			{
				JhinStateController component = obj.targetBodyObject.GetComponent<JhinStateController>();
				SkillLocator component2 = obj.targetBodyObject.GetComponent<SkillLocator>();
				EntityStateMachine entityStateMachine = Helpers.GetEntityStateMachine(obj.targetBodyObject, "WeaponMode");
				if (Object.op_Implicit((Object)(object)component))
				{
					((Component)ammoUI).gameObject.SetActive(true);
					ammoUI.ammoComponent = component;
					ammoUI.skillLocator = component2;
					ammoUI.ultActiveStateMachine = entityStateMachine;
				}
				else
				{
					((Component)ammoUI).gameObject.SetActive(false);
					ammoUI.ammoComponent = null;
					ammoUI.skillLocator = null;
					ammoUI.ultActiveStateMachine = null;
				}
			}
		}
	}
	internal static class Log
	{
		internal static ManualLogSource _logSource;

		internal static void Init(ManualLogSource logSource)
		{
			_logSource = logSource;
		}

		internal static void Debug(object data)
		{
			_logSource.LogDebug(data);
		}

		internal static void Error(object data)
		{
			_logSource.LogError(data);
		}

		internal static void Fatal(object data)
		{
			_logSource.LogFatal(data);
		}

		internal static void Info(object data)
		{
			_logSource.LogInfo(data);
		}

		internal static void Message(object data)
		{
			_logSource.LogMessage(data);
		}

		internal static void Warning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
}
namespace JhinMod.SkillStates
{
	public class CurtainCall : BaseSkillState
	{
		public float duration = 10f;

		private JhinStateController jhinStateController;

		private EntityStateMachine ultStateMachine;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			jhinStateController = ((EntityState)this).GetComponent<JhinStateController>();
			ultStateMachine = Helpers.GetEntityStateMachine(((EntityState)this).gameObject, "WeaponMode");
			jhinStateController.StopReload(interrupt: true);
			jhinStateController.Reload(full: true);
			jhinStateController.isUlting = true;
			Helpers.PlaySound("UltCast", ((EntityState)this).gameObject);
			Helpers.PlaySound("UltMusic", ((EntityState)this).gameObject);
			ultStateMachine.SetNextState((EntityState)(object)new JhinWeaponUltActiveState());
		}

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

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority && jhinStateController.isUlting && !(((EntityState)this).fixedAge > duration))
			{
			}
		}

		protected virtual BaseWindDown GetNextState()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			return new BaseWindDown();
		}

		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)5;
		}
	}
	public class CurtainCallCancel : BaseSkillState
	{
		public float duration = 1f;

		private JhinStateController jhinStateController;

		private EntityStateMachine ultStateMachine;

		private bool wantsCancel;

		public override void OnEnter()
		{
			jhinStateController = ((EntityState)this).GetComponent<JhinStateController>();
			ultStateMachine = Helpers.GetEntityStateMachine(((EntityState)this).gameObject, "WeaponMode");
			if (ultStateMachine.state is JhinWeaponUltActiveState)
			{
				JhinWeaponUltActiveState jhinWeaponUltActiveState = ultStateMachine.state as JhinWeaponUltActiveState;
				jhinWeaponUltActiveState.duration = ((EntityState)jhinWeaponUltActiveState).fixedAge + jhinWeaponUltActiveState.exitDuration + 0.25f;
			}
		}

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

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

		protected virtual BaseWindDown GetNextState()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			return new BaseWindDown();
		}

		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)5;
		}
	}
	public class CurtainCallShoot : BaseSkillState
	{
		public static float damageCoefficient = Config.specialDamageCoefficient.Value;

		public static float procCoefficient = 1f;

		public static float baseDuration = 0.6f;

		public static float force = 800f;

		public static float recoil = 3f;

		public static float range = 256f;

		public static float projectileSpeed = 200f;

		public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/TracerGoldGat");

		private float duration;

		private float fireTime;

		private bool hasFired;

		private string muzzleString;

		public JhinStateController jhinStateController;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			jhinStateController = ((EntityState)this).GetComponent<JhinStateController>();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			fireTime = 0.2f * duration;
			((EntityState)this).characterBody.SetAimTimer(2f);
			muzzleString = "Muzzle";
			Helpers.PlaySound("UltLoadShot", ((EntityState)this).gameObject);
			if ((Object)(object)jhinStateController.ultFX != (Object)null)
			{
				Animator component = jhinStateController.ultFX.GetComponent<Animator>();
				if (Object.op_Implicit((Object)(object)component))
				{
					EntityState.PlayAnimationOnAnimator(component, "Base Layer", "Fire");
				}
			}
			((EntityState)this).PlayAnimation("UpperBody, Override", "CurtainCallAttack");
		}

		public virtual bool CheckCrit()
		{
			return ((BaseState)this).RollCrit();
		}

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

		private void Fire()
		{
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: 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_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			if (!hasFired)
			{
				hasFired = true;
				GameObject ultMissilePrefab = Projectiles.ultMissilePrefab;
				((EntityState)this).characterBody.AddSpreadBloom(1.5f);
				EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleString, false);
				Helpers.PlaySound("UltFire", ((EntityState)this).gameObject);
				if (((EntityState)this).isAuthority)
				{
					Ray aimRay = ((BaseState)this).GetAimRay();
					((BaseState)this).AddRecoil(-1f * recoil, -2f * recoil, -0.5f * recoil, 0.5f * recoil);
					FireProjectileInfo val = default(FireProjectileInfo);
					val.projectilePrefab = ultMissilePrefab;
					val.position = ((Ray)(ref aimRay)).origin;
					val.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction);
					val.owner = ((EntityState)this).gameObject;
					val.damage = ((EntityState)this).characterBody.damage * damageCoefficient;
					val.force = force;
					val.crit = CheckCrit();
					val.damageColorIndex = (DamageColorIndex)0;
					val.target = null;
					((FireProjectileInfo)(ref val)).speedOverride = projectileSpeed;
					((FireProjectileInfo)(ref val)).fuseOverride = -1f;
					val.damageTypeOverride = DamageTypeCombo.op_Implicit((DamageType)0);
					FireProjectileInfo val2 = val;
					ProjectileManager.instance.FireProjectile(val2);
				}
				jhinStateController.TakeAmmo(1);
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= fireTime)
			{
				Fire();
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		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;
		}
	}
	public class CurtainCallShootCrit : CurtainCallShoot
	{
		public override bool CheckCrit()
		{
			return true;
		}

		public override void OnExit()
		{
			jhinStateController.ultHasFiredLastShot = true;
			base.OnExit();
		}
	}
	public class DancingGrenade : BaseState
	{
		public static float baseDuration = 1f;

		public static float baseDelay = 0.25f;

		public static float projectileProcCoefficient = 1f;

		public static float projectileTravelSpeed = 40f;

		public static float projectileBounceRange = 25f;

		public static int maxBounceCount = 3;

		public static string attackSoundString;

		public float damageCoefficient;

		public float damageCoefficientOnBounceKill;

		private float duration;

		private float stopwatch;

		private Transform modelTransform;

		private JhinTracker tracker;

		private ChildLocator childLocator;

		private JhinStateController jhinStateController;

		private bool hasTriedToFire;

		private bool hasFired;

		private HurtBox initialOrbTarget;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			stopwatch = 0f;
			duration = baseDuration;
			damageCoefficient = Config.secondaryDamageCoefficient.Value;
			damageCoefficientOnBounceKill = Config.secondaryDamageBounceCoefficient.Value;
			modelTransform = ((EntityState)this).GetModelTransform();
			tracker = ((EntityState)this).GetComponent<JhinTracker>();
			childLocator = ((Component)modelTransform).GetComponent<ChildLocator>();
			jhinStateController = ((EntityState)this).GetComponent<JhinStateController>();
			jhinStateController.isAttacking = false;
			if (Object.op_Implicit((Object)(object)tracker) && ((EntityState)this).isAuthority)
			{
				initialOrbTarget = tracker.GetTrackingTarget();
			}
			if (jhinStateController.ammoCount != 0)
			{
				jhinStateController.StopReload(interrupt: true);
			}
			((EntityState)this).PlayAnimation("UpperBody, Override", "DancingGrenade");
			Helpers.PlaySound("QCast", ((EntityState)this).gameObject);
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			if (!hasFired && NetworkServer.active)
			{
				((EntityState)this).skillLocator.secondary.AddOneStock();
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			if (!hasTriedToFire && !hasFired && stopwatch > baseDelay)
			{
				FireOrbDancingGrenade();
			}
			if (stopwatch >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		private void FireOrbDancingGrenade()
		{
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkServer.active && !hasTriedToFire)
			{
				hasTriedToFire = true;
				ProjectileDancingGrenade projectileDancingGrenade = new ProjectileDancingGrenade();
				((LightningOrb)projectileDancingGrenade).targetsToFindPerBounce = 1;
				((LightningOrb)projectileDancingGrenade).damageValue = ((EntityState)this).characterBody.damage * damageCoefficient;
				((LightningOrb)projectileDancingGrenade).isCrit = Util.CheckRoll(((EntityState)this).characterBody.crit, ((EntityState)this).characterBody.master);
				((LightningOrb)projectileDancingGrenade).teamIndex = TeamComponent.GetObjectTeam(((EntityState)this).gameObject);
				((LightningOrb)projectileDancingGrenade).attacker = ((EntityState)this).gameObject;
				((LightningOrb)projectileDancingGrenade).procCoefficient = projectileProcCoefficient;
				((LightningOrb)projectileDancingGrenade).bouncesRemaining = maxBounceCount;
				((LightningOrb)projectileDancingGrenade).speed = projectileTravelSpeed;
				((LightningOrb)projectileDancingGrenade).bouncedObjects = new List<HealthComponent>();
				projectileDancingGrenade.deadObjects = new List<HealthComponent>();
				((LightningOrb)projectileDancingGrenade).range = projectileBounceRange;
				projectileDancingGrenade.damageCoefficientOnBounceKill = damageCoefficientOnBounceKill;
				HurtBox val = initialOrbTarget;
				if (Object.op_Implicit((Object)(object)val))
				{
					hasFired = true;
					Transform val2 = childLocator.FindChild("ShoulderR");
					((Orb)projectileDancingGrenade).origin = val2.position;
					((Orb)projectileDancingGrenade).target = val;
					OrbManager.instance.AddOrb((Orb)(object)projectileDancingGrenade);
				}
				Helpers.PlaySound("QFire", ((EntityState)this).gameObject);
			}
		}

		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;
		}

		public override void OnSerialize(NetworkWriter writer)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			NetworkExtensions.Write(writer, HurtBoxReference.FromHurtBox(initialOrbTarget));
		}

		public override void OnDeserialize(NetworkReader reader)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			HurtBoxReference val = NetworkExtensions.ReadHurtBoxReference(reader);
			initialOrbTarget = ((HurtBoxReference)(ref val)).ResolveHurtBox();
		}
	}
	public class DeadlyFlourish : BaseSkillState
	{
		public static float damageCoefficient = Config.utilityDamageCoefficient.Value;

		public static float procCoefficient = 1f;

		public static float baseDuration = 1.15f;

		public static float baseFireDelay = 0.75f;

		public static float force = 800f;

		public static float recoil = 3f;

		public static float range = 256f;

		public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/TracerGoldGat");

		private float duration;

		private float fireTime;

		private bool hasFired;

		private string muzzleString;

		private JhinStateController jhinStateController;

		public override void OnEnter()
		{
			//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)
			((BaseState)this).OnEnter();
			jhinStateController = ((EntityState)this).GetComponent<JhinStateController>();
			jhinStateController.isAttacking = false;
			if (jhinStateController.ammoCount != 0)
			{
				jhinStateController.StopReload(interrupt: true, 2f);
			}
			duration = baseDuration;
			fireTime = baseFireDelay;
			((BaseState)this).StartAimMode(duration, true);
			muzzleString = "Muzzle";
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterDirection.moveVector = ((EntityState)this).characterDirection.forward;
			}
			Helpers.PlaySound("WCast", ((EntityState)this).gameObject);
			((EntityState)this).PlayAnimation("FullBody, Override", "DeadlyFlourish");
		}

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

		private void Fire()
		{
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: 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_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: 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)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: 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_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: 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_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: 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)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Expected O, but got Unknown
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Expected O, but got Unknown
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			if (!hasFired)
			{
				hasFired = true;
				((EntityState)this).characterBody.AddSpreadBloom(1.5f);
				EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleString, false);
				if (((EntityState)this).isAuthority)
				{
					Ray aimRay = ((BaseState)this).GetAimRay();
					((BaseState)this).AddRecoil(-1f * recoil, -2f * recoil, -0.5f * recoil, 0.5f * recoil);
					Helpers.PlayVFXDynamic("DeadlyFlourishBeam", ((EntityState)this).gameObject, muzzleString, useAim: true, aimRay);
					Helpers.PlayVFXDynamic("DeadlyFlourishMuzzle", ((EntityState)this).gameObject, muzzleString, useAim: true, aimRay);
					new BulletAttack
					{
						bulletCount = 1u,
						aimVector = ((Ray)(ref aimRay)).direction,
						origin = ((Ray)(ref aimRay)).origin,
						damage = damageCoefficient * ((BaseState)this).damageStat,
						damageColorIndex = (DamageColorIndex)0,
						damageType = DamageTypeCombo.op_Implicit((DamageType)32),
						falloffModel = (FalloffModel)0,
						maxDistance = range,
						force = force,
						hitMask = CommonMasks.bullet,
						minSpread = 0f,
						maxSpread = 0f,
						isCrit = ((BaseState)this).RollCrit(),
						owner = ((EntityState)this).gameObject,
						muzzleName = muzzleString,
						smartCollision = false,
						procChainMask = default(ProcChainMask),
						procCoefficient = procCoefficient,
						radius = 1f,
						sniper = false,
						stopperMask = LayerMask.op_Implicit(0),
						weapon = null,
						tracerEffectPrefab = tracerEffectPrefab,
						spreadPitchScale = 0f,
						spreadYawScale = 0f,
						queryTriggerInteraction = (QueryTriggerInteraction)0,
						hitCallback = new HitCallback(BulletHitCallback),
						modifyOutgoingDamageCallback = new ModifyOutgoingDamageCallback(ModifyDamage),
						hitEffectPrefab = FirePistol2.hitEffectPrefab
					}.Fire();
				}
			}
		}

		private bool BulletHitCallback(BulletAttack bulletAttack, ref BulletHit hitInfo)
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			bool result = BulletAttack.defaultHitCallback.Invoke(bulletAttack, ref hitInfo);
			HealthComponent val = (Object.op_Implicit((Object)(object)hitInfo.hitHurtBox) ? hitInfo.hitHurtBox.healthComponent : null);
			if (Object.op_Implicit((Object)(object)val) && hitInfo.hitHurtBox.teamIndex != ((EntityState)this).teamComponent.teamIndex)
			{
				((EntityState)this).characterBody.AddTimedBuff(Buffs.jhinCritMovespeedBuff, Config.passiveBuffDuration.Value * Config.utilityBuffMultiplier.Value);
			}
			return result;
		}

		private void ModifyDamage(BulletAttack _bulletAttack, ref BulletHit hitInfo, DamageInfo damageInfo)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			DamageAPI.AddModdedDamageType(damageInfo, Buffs.JhinConsumeMarkDamage);
		}

		public override void FixedUpdate()
		{
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (!hasFired)
			{
				AimAnimator aimAnimator = ((EntityState)this).GetAimAnimator();
				if (Object.op_Implicit((Object)(object)aimAnimator))
				{
					aimAnimator.AimImmediate();
				}
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).inputBank))
				{
					((EntityState)this).characterDirection.moveVector = ((EntityState)this).inputBank.aimDirection;
				}
			}
			HandleMovements();
			if (((EntityState)this).fixedAge >= fireTime)
			{
				Fire();
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public virtual void HandleMovements()
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			if (!((EntityState)this).characterMotor.isGrounded)
			{
				((EntityState)this).characterMotor.moveDirection = ((EntityState)this).inputBank.moveVector;
			}
			else
			{
				((EntityState)this).characterMotor.moveDirection = Vector3.zero;
			}
		}

		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;
		}
	}
	public class WhisperPrimary : BaseSkillState
	{
		public static float damageCoefficient = Config.primaryDamageCoefficient.Value;

		public static float procCoefficient = 1f;

		public static float baseDuration = 2.57f;

		public static float baseFireDelayPercent = 0.1f;

		public static float force = 800f;

		public static float recoil = 3f;

		public static float range = 256f;

		public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/TracerGoldGat");

		private JhinStateController jhinStateController;

		private float duration;

		private float durationAnimation;

		private float fireTime;

		private bool hasFired;

		private bool isCrit;

		private string muzzleString;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			jhinStateController = ((EntityState)this).GetComponent<JhinStateController>();
			jhinStateController.timeSinceFire = 0f;
			jhinStateController.isAttacking = true;
			jhinStateController.ResetReload();
			Helpers.StopSound("PassiveCritSpin", ((EntityState)this).gameObject, null, "Jhin");
			Helpers.StopSound("PassiveCritMusic", ((EntityState)this).gameObject, null, "Jhin");
			((EntityState)this).characterBody.SetAimTimer(3f);
			int num = jhinStateController.ammoMax - (jhinStateController.ammoCount - 1);
			durationAnimation = baseDuration * (((EntityState)this).characterBody.baseAttackSpeed / ((EntityState)this).characterBody.attackSpeed);
			duration = 1f / ((EntityState)this).characterBody.attackSpeed;
			fireTime = baseFireDelayPercent * durationAnimation;
			muzzleString = "Muzzle";
			isCrit = ((BaseState)this).RollCrit();
			if (Config.primaryInstantShot.Value && num != 4)
			{
				fireTime = 0f;
			}
			else
			{
				Helpers.PlaySound((num == 4) ? "PassiveCritCast" : (isCrit ? "AttackCastCrit" : $"AttackCast{num}"), ((EntityState)this).gameObject, null, "", defaultToBase: true, "AttackCast1");
			}
			PlayFireAnimation();
		}

		public void PlayFireAnimation()
		{
			int num = jhinStateController.ammoMax - (jhinStateController.ammoCount - 1);
			Animator modelAnimator = ((EntityState)this).GetModelAnimator();
			float num2 = baseDuration / durationAnimation;
			float cycleOffset = (Config.primaryInstantShot.Value ? (5f / 32f * num2) : 0f);
			if (num == 4)
			{
				int layerIndex = modelAnimator.GetLayerIndex("UpperBody, Override");
				modelAnimator.SetLayerWeight(layerIndex, 0f);
				((EntityState)this).PlayAnimation("FullBody Passive Crit, Override", "AttackPassiveCrit", "ShootGun.playbackRate", durationAnimation, 0f);
			}
			else
			{
				PlayAnimationOnAnimatorCustom(modelAnimator, "UpperBody, Override", isCrit ? "AttackCrit" : $"Attack{num}", "ShootGun.playbackRate", durationAnimation, cycleOffset);
			}
		}

		protected static void PlayAnimationOnAnimatorCustom(Animator modelAnimator, string layerName, string animationStateName, string playbackRateParam, float duration, float cycleOffset)
		{
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			modelAnimator.speed = 1f;
			modelAnimator.Update(0f);
			int layerIndex = modelAnimator.GetLayerIndex(layerName);
			if (layerIndex >= 0)
			{
				modelAnimator.SetFloat(playbackRateParam, 1f);
				modelAnimator.PlayInFixedTime(animationStateName, layerIndex, cycleOffset);
				modelAnimator.Update(0f);
				AnimatorStateInfo currentAnimatorStateInfo = modelAnimator.GetCurrentAnimatorStateInfo(layerIndex);
				float length = ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).length;
				modelAnimator.SetFloat(playbackRateParam, length / duration);
			}
		}

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

		private void Fire()
		{
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			if (!hasFired)
			{
				hasFired = true;
				if (jhinStateController.ammoCount == 1)
				{
					isCrit = true;
					Animator modelAnimator = ((EntityState)this).GetModelAnimator();
					int layerIndex = modelAnimator.GetLayerIndex("UpperBody, Override");
					modelAnimator.SetLayerWeight(layerIndex, 1f);
				}
				((EntityState)this).characterBody.SetAimTimer(duration * 2f);
				((EntityState)this).characterBody.AddSpreadBloom(1.5f);
				DoFireEffects();
				((BaseState)this).AddRecoil(-1f * recoil, -2f * recoil, -0.5f * recoil, 0.5f * recoil);
				if (((EntityState)this).isAuthority)
				{
					Ray aimRay = ((BaseState)this).GetAimRay();
					BulletAttack val = GenerateBulletAttack(aimRay);
					val.Fire();
					OnFireBulletAuthority(aimRay);
				}
				jhinStateController.TakeAmmo(1);
				jhinStateController.isAttacking = false;
			}
		}

		protected BulletAttack GenerateBulletAttack(Ray aimRay)
		{
			//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_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: 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_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: 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_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: 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_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Expected O, but got Unknown
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Expected O, but got Unknown
			//IL_0135: Expected O, but got Unknown
			return new BulletAttack
			{
				aimVector = ((Ray)(ref aimRay)).direction,
				origin = ((Ray)(ref aimRay)).origin,
				owner = ((EntityState)this).gameObject,
				weapon = null,
				bulletCount = 1u,
				damage = ((BaseState)this).damageStat * damageCoefficient,
				damageColorIndex = (DamageColorIndex)0,
				damageType = DamageTypeCombo.op_Implicit((DamageType)0),
				falloffModel = (FalloffModel)1,
				force = force,
				HitEffectNormal = false,
				procChainMask = default(ProcChainMask),
				procCoefficient = CalculateProcCoefficient(),
				maxDistance = range,
				radius = 0.25f,
				isCrit = isCrit,
				muzzleName = muzzleString,
				minSpread = 0f,
				maxSpread = 0f,
				hitEffectPrefab = FirePistol2.hitEffectPrefab,
				smartCollision = false,
				sniper = false,
				spreadPitchScale = 0f,
				spreadYawScale = 0f,
				tracerEffectPrefab = tracerEffectPrefab,
				hitCallback = new HitCallback(BulletHitCallback),
				modifyOutgoingDamageCallback = new ModifyOutgoingDamageCallback(ModifyDamage)
			};
		}

		public virtual float CalculateProcCoefficient()
		{
			float num = procCoefficient;
			JhinStateController component = ((EntityState)this).GetComponent<JhinStateController>();
			CharacterBody component2 = ((EntityState)this).GetComponent<CharacterBody>();
			if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component2))
			{
				num *= component.preModAtkSpeed / (component2.baseAttackSpeed + component2.levelAttackSpeed * (component2.level - 1f));
			}
			return num;
		}

		public virtual bool CreateTracer(string tracerName, Ray aimRay, string fallback = "")
		{
			//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_0009: 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_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: 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_0182: Expected O, but got Unknown
			LayerMask defaultHitMask = BulletAttack.defaultHitMask;
			RaycastHit val = default(RaycastHit);
			Physics.SphereCast(((Ray)(ref aimRay)).origin, 0.25f, ((Ray)(ref aimRay)).direction, ref val, range, LayerMask.op_Implicit(defaultHitMask), (QueryTriggerInteraction)1);
			GameObject vFXDynamic = Helpers.GetVFXDynamic(tracerName, ((EntityState)this).gameObject);
			if ((Object)(object)vFXDynamic == (Object)null)
			{
				vFXDynamic = Helpers.GetVFXDynamic(fallback, ((EntityState)this).gameObject);
			}
			if ((Object)(object)vFXDynamic != (Object)null)
			{
				CustomTracer component = vFXDynamic.GetComponent<CustomTracer>();
				component.origin = ((Ray)(ref aimRay)).origin;
				component.target = (((Object)(object)((RaycastHit)(ref val)).collider != (Object)null) ? ((RaycastHit)(ref val)).point : (((Ray)(ref aimRay)).origin + ((Ray)(ref aimRay)).direction * range));
				component.projectileSpeed = 250f;
				component.maxDistance = (((Object)(object)((RaycastHit)(ref val)).collider != (Object)null) ? ((RaycastHit)(ref val)).distance : range);
				ModelLocator component2 = ((EntityState)this).gameObject.GetComponent<ModelLocator>();
				if (Object.op_Implicit((Object)(object)component2) && Object.op_Implicit((Object)(object)component2.modelTransform))
				{
					ChildLocator component3 = ((Component)component2.modelTransform).GetComponent<ChildLocator>();
					if (Object.op_Implicit((Object)(object)component3))
					{
						int num = component3.FindChildIndex(muzzleString);
						Transform val2 = component3.FindChild(num);
						if (Object.op_Implicit((Object)(object)val2))
						{
							EffectData val3 = new EffectData
							{
								origin = val2.position,
								rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction)
							};
							val3.SetChildLocatorTransformReference(((EntityState)this).gameObject, num);
							EffectManager.SpawnEffect(vFXDynamic, val3, false);
						}
					}
				}
				component.isActive = true;
				return true;
			}
			return false;
		}

		protected virtual void DoFireEffects()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			int num = jhinStateController.ammoMax - (jhinStateController.ammoCount - 1);
			Ray aimRay = ((BaseState)this).GetAimRay();
			Helpers.PlaySound((num == 4) ? "PassiveCritFire" : (isCrit ? "AttackCritFire" : $"AttackFire{num}"), ((EntityState)this).gameObject, null, "", defaultToBase: true, "AttackFire1");
			Helpers.PlayVFXDynamic((num == 4) ? "MuzzleFlashFourth" : "MuzzleFlash", ((EntityState)this).gameObject, muzzleString, useAim: true, aimRay, null, transmit: false, defaultToBase: true, "MuzzleFlash");
			CreateTracer((num == 4) ? "TracerFourth" : "Tracer", aimRay, "Tracer");
		}

		protected virtual void OnFireBulletAuthority(Ray aimRay)
		{
		}

		private bool BulletHitCallback(BulletAttack bulletAttack, ref BulletHit hitInfo)
		{
			bool result = BulletAttack.defaultHitCallback.Invoke(bulletAttack, ref hitInfo);
			HealthComponent val = (Object.op_Implicit((Object)(object)hitInfo.hitHurtBox) ? hitInfo.hitHurtBox.healthComponent : null);
			return result;
		}

		private void ModifyDamage(BulletAttack _bulletAttack, ref BulletHit hitInfo, DamageInfo damageInfo)
		{
			//IL_002b: 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_0089: Unknown result type (might be due to invalid IL or missing references)
			SkillLocator component = ((EntityState)this).GetComponent<SkillLocator>();
			if (Object.op_Implicit((Object)(object)component) && component.utility.cooldownRemaining < 4f)
			{
				DamageAPI.AddModdedDamageType(damageInfo, Buffs.JhinMarkDamage);
			}
			int num = jhinStateController.ammoMax - (jhinStateController.ammoCount - 1);
			HealthComponent val = (Object.op_Implicit((Object)(object)hitInfo.hitHurtBox) ? hitInfo.hitHurtBox.healthComponent : null);
			if (Object.op_Implicit((Object)(object)val) && hitInfo.hitHurtBox.teamIndex != ((EntityState)this).teamComponent.teamIndex && num == 4)
			{
				float num2 = val.missingCombinedHealth * Config.primaryExecuteMissingHealthPercentage.Value;
				float val2 = damageInfo.damage * Config.primaryExecuteDamageCap.Value;
				if (Config.primaryExecuteDamageCap.Value != 0f)
				{
					damageInfo.damage += Math.Min(num2, val2);
				}
				else
				{
					damageInfo.damage += num2;
				}
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= fireTime)
			{
				Fire();
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		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;
		}
	}
	public class WhisperReload : BaseState
	{
		private JhinStateController jhinStateController;

		public float duration;

		private bool hasReloaded;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			jhinStateController = ((EntityState)this).GetComponent<JhinStateController>();
			duration = jhinStateController.reloadTime;
			bool flag = jhinStateController.ammoCount == 0 && jhinStateController.timeSinceFire < 0.5f;
			((EntityState)this).PlayCrossfade("UpperBody, Override", flag ? "Reload_FromFireEmpty" : "Reload", "", duration, 0.2f);
			Helpers.PlaySound(flag ? "ReloadEmpty" : "Reload", ((EntityState)this).gameObject);
			Helpers.StopSound("PassiveCritSpin", ((EntityState)this).gameObject);
			Helpers.StopSound("PassiveCritMusic", ((EntityState)this).gameObject);
		}

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

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (jhinStateController.startedReload && ((EntityState)this).fixedAge >= duration)
			{
				PerformReload();
				((EntityState)this).outer.SetNextStateToMain();
			}
			if (((EntityState)this).isAuthority && !(((EntityState)this).fixedAge < duration))
			{
			}
		}

		private void PerformReload()
		{
			if (!hasReloaded)
			{
				hasReloaded = true;
				jhinStateController.Reload(full: true);
			}
		}

		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)0;
		}
	}
}
namespace JhinMod.SkillStates.Henry
{
	public class Roll : BaseSkillState
	{
		public static float duration = 0.5f;

		public static float initialSpeedCoefficient = 5f;

		public static float finalSpeedCoefficient = 2.5f;

		public static string dodgeSoundString = "JhinRoll";

		public static float dodgeFOV = DodgeState.dodgeFOV;

		private float rollSpeed;

		private Vector3 forwardDirection;

		private Animator animator;

		private Vector3 previousPosition;

		public override void OnEnter()
		{
			//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_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: 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_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: 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_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: 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_012c: 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)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			animator = ((EntityState)this).GetModelAnimator();
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				Vector3 val = ((((EntityState)this).inputBank.moveVector == Vector3.zero) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.moveVector);
				forwardDirection = ((Vector3)(ref val)).normalized;
			}
			Vector3 val2 = (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? ((EntityState)this).characterDirection.forward : forwardDirection);
			Vector3 val3 = Vector3.Cross(Vector3.up, val2);
			float num = Vector3.Dot(forwardDirection, val2);
			float num2 = Vector3.Dot(forwardDirection, val3);
			RecalculateRollSpeed();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterMotor.velocity.y = 0f;
				((EntityState)this).characterMotor.velocity = forwardDirection * rollSpeed;
			}
			Vector3 val4 = (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) ? ((EntityState)this).characterMotor.velocity : Vector3.zero);
			previousPosition = ((EntityState)this).transform.position - val4;
			((EntityState)this).PlayAnimation("FullBody, Override", "Roll", "Roll.playbackRate", duration, 0f);
			Util.PlaySound(dodgeSoundString, ((EntityState)this).gameObject);
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddTimedBuff(Buffs.armorBuff, 3f * duration);
				((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 0.5f * duration);
			}
		}

		private void RecalculateRollSpeed()
		{
			rollSpeed = ((BaseState)this).moveSpeedStat * Mathf.Lerp(initialSpeedCoefficient, finalSpeedCoefficient, ((EntityState)this).fixedAge / duration);
		}

		public override void FixedUpdate()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: 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_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			RecalculateRollSpeed();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterDirection.forward = forwardDirection;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams))
			{
				((EntityState)this).cameraTargetParams.fovOverride = Mathf.Lerp(dodgeFOV, 60f, ((EntityState)this).fixedAge / duration);
			}
			Vector3 val = ((EntityState)this).transform.position - previousPosition;
			Vector3 normalized = ((Vector3)(ref val)).normalized;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) && normalized != Vector3.zero)
			{
				Vector3 val2 = normalized * rollSpeed;
				float num = Mathf.Max(Vector3.Dot(val2, forwardDirection), 0f);
				val2 = forwardDirection * num;
				val2.y = 0f;
				((EntityState)this).characterMotor.velocity = val2;
			}
			previousPosition = ((EntityState)this).transform.position;
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams))
			{
				((EntityState)this).cameraTargetParams.fovOverride = -1f;
			}
			((EntityState)this).OnExit();
			((EntityState)this).characterMotor.disableAirControlUntilCollision = false;
		}

		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(forwardDirection);
		}

		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);
			forwardDirection = reader.ReadVector3();
		}
	}
	public class Shoot : BaseSkillState
	{
		public static float damageCoefficient = 4.2f;

		public static float procCoefficient = 1f;

		public static float baseDuration = 0.6f;

		public static float force = 800f;

		public static float recoil = 3f;

		public static float range = 256f;

		public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/TracerGoldGat");

		private float duration;

		private float fireTime;

		private bool hasFired;

		private string muzzleString;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = DeadlyFlourish.baseDuration / ((BaseState)this).attackSpeedStat;
			fireTime = 0.2f * duration;
			((EntityState)this).characterBody.SetAimTimer(2f);
			muzzleString = "Muzzle";
			((EntityState)this).PlayAnimation("UpperBody, Override", "Attack", "ShootGun.playbackRate", 1.8f, 0f);
		}

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

		private void Fire()
		{
			//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_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: 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)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			if (!hasFired)
			{
				hasFired = true;
				((EntityState)this).characterBody.AddSpreadBloom(1.5f);
				EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleString, false);
				Util.PlaySound("Play_Seroronin_Jhin_AttackCast", ((EntityState)this).gameObject);
				if (((EntityState)this).isAuthority)
				{
					Ray aimRay = ((BaseState)this).GetAimRay();
					((BaseState)this).AddRecoil(-1f * recoil, -2f * recoil, -0.5f * recoil, 0.5f * recoil);
					new BulletAttack
					{
						bulletCount = 1u,
						aimVector = ((Ray)(ref aimRay)).direction,
						origin = ((Ray)(ref aimRay)).origin,
						damage = damageCoefficient * ((BaseState)this).damageStat,
						damageColorIndex = (DamageColorIndex)0,
						damageType = DamageTypeCombo.op_Implicit((DamageType)0),
						falloffModel = (FalloffModel)1,
						maxDistance = range,
						force = force,
						hitMask = CommonMasks.bullet,
						minSpread = 0f,
						maxSpread = 0f,
						isCrit = ((BaseState)this).RollCrit(),
						owner = ((EntityState)this).gameObject,
						muzzleName = muzzleString,
						smartCollision = false,
						procChainMask = default(ProcChainMask),
						procCoefficient = procCoefficient,
						radius = 0.75f,
						sniper = false,
						stopperMask = CommonMasks.bullet,
						weapon = null,
						tracerEffectPrefab = tracerEffectPrefab,
						spreadPitchScale = 0f,
						spreadYawScale = 0f,
						queryTriggerInteraction = (QueryTriggerInteraction)0,
						hitEffectPrefab = FirePistol2.hitEffectPrefab
					}.Fire();
				}
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= fireTime)
			{
				Fire();
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		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;
		}
	}
	public class SlashCombo : BaseMeleeAttack
	{
		public override void OnEnter()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			hitboxName = "Sword";
			damageType = (DamageType)0;
			damageCoefficient = 2.8f;
			procCoefficient = 1f;
			pushForce = 300f;
			bonusForce = Vector3.zero;
			baseDuration = 1f;
			attackStartTime = 0.2f;
			attackEndTime = 0.4f;
			baseEarlyExitTime = 0.4f;
			hitStopDuration = 0.012f;
			attackRecoil = 0.5f;
			hitHopVelocity = 4f;
			swingSoundString = "JhinSwordSwing";
			hitSoundString = "";
			muzzleString = ((swingIndex % 2 == 0) ? "SwingLeft" : "SwingRight");
			swingEffectPrefab = Asset.swordSwingEffect;
			hitEffectPrefab = Asset.swordHitImpactEffect;
			impactSound = Asset.swordHitSoundEvent.index;
			base.OnEnter();
		}

		protected override void PlayAttackAnimation()
		{
			base.PlayAttackAnimation();
		}

		protected override void PlaySwingEffect()
		{
			base.PlaySwingEffect();
		}

		protected override void OnHitEnemyAuthority()
		{
			base.OnHitEnemyAuthority();
		}

		protected override void SetNextState()
		{
			int num = ((swingIndex == 0) ? 1 : 0);
			((EntityState)this).outer.SetNextState((EntityState)(object)new SlashCombo
			{
				swingIndex = num
			});
		}

		public override void OnExit()
		{
			base.OnExit();
		}
	}
	public class ThrowBomb : GenericProjectileBaseState
	{
		public static float BaseDuration = 0.65f;

		public static float BaseDelayDuration = 0.35f * BaseDuration;

		public static float DamageCoefficient = 1.6f;

		public override void OnEnter()
		{
			base.projectilePrefab = Projectiles.bombPrefab;
			base.attackSoundString = "JhinBombThrow";
			base.baseDuration = BaseDuration;
			base.baseDelayBeforeFiringProjectile = BaseDelayDuration;
			base.damageCoefficient = DamageCoefficient;
			base.force = 80f;
			base.recoilAmplitude = 0.1f;
			base.bloom = 10f;
			((GenericProjectileBaseState)this).OnEnter();
		}

		public override void FixedUpdate()
		{
			((GenericProjectileBaseState)this).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)1;
		}

		public override void PlayAnimation(float duration)
		{
			if (Object.op_Implicit((Object)(object)((EntityState)this).GetModelAnimator()))
			{
				((EntityState)this).PlayAnimation("Gesture, Override", "ThrowBomb", "ThrowBomb.playbackRate", base.duration, 0f);
			}
		}
	}
}
namespace JhinMod.SkillStates.BaseStates
{
	internal class AnimatedDeathState : GenericCharacterDeath
	{
		public override void FixedUpdate()
		{
			((GenericCharacterDeath)this).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)7;
		}

		public override void OnEnter()
		{
			((GenericCharacterDeath)this).OnEnter();
			Helpers.PlaySound("DeathSFX", ((EntityState)this).gameObject);
			Animator modelAnimator = ((EntityState)this).GetModelAnimator();
			if (Object.op_Implicit((Object)(object)modelAnimator))
			{
				modelAnimator.CrossFadeInFixedTime("Death", 0.1f);
			}
		}

		public override void OnExit()
		{
			((GenericCharacterDeath)this).OnExit();
		}
	}
	public class BaseMeleeAttack : BaseSkillState
	{
		public int swingIndex;

		protected string hitboxName = "Sword";

		protected DamageType damageType = (DamageType)0;

		protected float damageCoefficient = 3.5f;

		protected float procCoefficient = 1f;

		protected float pushForce = 300f;

		protected Vector3 bonusForce = Vector3.zero;

		protected float baseDuration = 1f;

		protected float attackStartTime = 0.2f;

		protected float attackEndTime = 0.4f;

		protected float baseEarlyExitTime = 0.4f;

		protected float hitStopDuration = 0.012f;

		protected float attackRecoil = 0.75f;

		protected float hitHopVelocity = 4f;

		protected bool cancelled = false;

		protected string swingSoundString = "";

		protected string hitSoundString = "";

		protected string muzzleString = "SwingCenter";

		protected GameObject swingEffectPrefab;

		protected GameObject hitEffectPrefab;

		protected NetworkSoundEventIndex impactSound;

		private float earlyExitTime;

		public float duration;

		private bool hasFired;

		private float hitPauseTimer;

		private OverlapAttack attack;

		protected bool inHitPause;

		private bool hasHopped;

		protected float stopwatch;

		protected Animator animator;

		private HitStopCachedState hitStopCachedState;

		private Vector3 storedVelocity;

		public override void OnEnter()
		{
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Expected O, but got Unknown
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			earlyExitTime = baseEarlyExitTime / ((BaseState)this).attackSpeedStat;
			hasFired = false;
			animator = ((EntityState)this).GetModelAnimator();
			((BaseState)this).StartAimMode(0.5f + duration, false);
			((EntityState)this).characterBody.outOfCombatStopwatch = 0f;
			animator.SetBool("attacking", true);
			HitBoxGroup hitBoxGroup = null;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == hitboxName);
			}
			PlayAttackAnimation();
			attack = new OverlapAttack();
			attack.damageType = DamageTypeCombo.op_Implicit(damageType);
			attack.attacker = ((EntityState)this).gameObject;
			attack.inflictor = ((EntityState)this).gameObject;
			attack.teamIndex = ((BaseState)this).GetTeam();
			attack.damage = damageCoefficient * ((BaseState)this).damageStat;
			attack.procCoefficient = procCoefficient;
			attack.hitEffectPrefab = hitEffectPrefab;
			attack.forceVector = bonusForce;
			attack.pushAwayForce = pushForce;
			attack.hitBoxGroup = hitBoxGroup;
			attack.isCrit = ((BaseState)this).RollCrit();
			attack.impactSound = impactSound;
		}

		protected virtual void PlayAttackAnimation()
		{
			((EntityState)this).PlayCrossfade("Gesture, Override", "Slash" + (1 + swingIndex), "Slash.playbackRate", duration, 0.05f);
		}

		public override void OnExit()
		{
			if (!hasFired && !cancelled)
			{
				FireAttack();
			}
			((EntityState)this).OnExit();
			animator.SetBool("attacking", false);
		}

		protected virtual void PlaySwingEffect()
		{
			EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, muzzleString, true);
		}

		protected virtual void OnHitEnemyAuthority()
		{
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			Util.PlaySound(hitSoundString, ((EntityState)this).gameObject);
			if (!hasHopped)
			{
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded && hitHopVelocity > 0f)
				{
					((BaseState)this).SmallHop(((EntityState)this).characterMotor, hitHopVelocity);
				}
				hasHopped = true;
			}
			if (!inHitPause && hitStopDuration > 0f)
			{
				storedVelocity = ((EntityState)this).characterMotor.velocity;
				hitStopCachedState = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, "Slash.playbackRate");
				hitPauseTimer = hitStopDuration / ((BaseState)this).attackSpeedStat;
				inHitPause = true;
			}
		}

		private void FireAttack()
		{
			if (!hasFired)
			{
				hasFired = true;
				Util.PlayAttackSpeedSound(swingSoundString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat);
				if (((EntityState)this).isAuthority)
				{
					PlaySwingEffect();
					((BaseState)this).AddRecoil(-1f * attackRecoil, -2f * attackRecoil, -0.5f * attackRecoil, 0.5f * attackRecoil);
				}
			}
			if (((EntityState)this).isAuthority && attack.Fire((List<HurtBox>)null))
			{
				OnHitEnemyAuthority();
			}
		}

		protected virtual void SetNextState()
		{
			int num = ((swingIndex == 0) ? 1 : 0);
			((EntityState)this).outer.SetNextState((EntityState)(object)new BaseMeleeAttack
			{
				swingIndex = num
			});
		}

		public override void FixedUpdate()
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			hitPauseTimer -= Time.fixedDeltaTime;
			if (hitPauseTimer <= 0f && inHitPause)
			{
				((BaseState)this).ConsumeHitStopCachedState(hitStopCachedState, ((EntityState)this).characterMotor, animator);
				inHitPause = false;
				((EntityState)this).characterMotor.velocity = storedVelocity;
			}
			if (!inHitPause)
			{
				stopwatch += Time.fixedDeltaTime;
			}
			else
			{
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
				{
					((EntityState)this).characterMotor.velocity = Vector3.zero;
				}
				if (Object.op_Implicit((Object)(object)animator))
				{
					animator.SetFloat("Swing.playbackRate", 0f);
				}
			}
			if (stopwatch >= duration * attackStartTime && stopwatch <= duration * attackEndTime)
			{
				FireAttack();
			}
			if (stopwatch >= duration - earlyExitTime && ((EntityState)this).isAuthority && ((EntityState)this).inputBank.skill1.down)
			{
				if (!hasFired)
				{
					FireAttack();
				}
				SetNextState();
			}
			else if (stopwatch >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		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;
		}

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

		public override void OnDeserialize(NetworkReader reader)
		{
			((BaseSkillState)this).OnDeserialize(reader);
			swingIndex = reader.ReadInt32();
		}
	}
	public class BaseTimedSkillState : BaseSkillState
	{
		public static float TimedBaseDuration;

		public static float TimedBaseCastStartTime;

		public static float TimedBaseCastEndTime;

		protected float duration;

		protected float castStartTime;

		protected float castEndTime;

		protected bool hasFired;

		protected bool isFiring;

		protected bool hasExited;

		protected virtual void InitDurationValues(float baseDuration, float baseCastStartTime, float baseCastEndTime = 1f)
		{
			TimedBaseDuration = baseDuration;
			TimedBaseCastStartTime = baseCastStartTime;
			TimedBaseCastEndTime = baseCastEndTime;
			duration = TimedBaseDuration / ((BaseState)this).attackSpeedStat;
			castStartTime = baseCastStartTime * duration;
			castEndTime = baseCastEndTime * duration;
		}

		protected virtual void OnCastEnter()
		{
		}

		protected virtual void OnCastFixedUpdate()
		{
		}

		protected virtual void OnCastUpdate()
		{
		}

		protected virtual void OnCastExit()
		{
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (!hasFired && ((EntityState)this).fixedAge > castStartTime)
			{
				hasFired = true;
				OnCastEnter();
			}
			bool flag = ((EntityState)this).fixedAge >= castStartTime;
			bool flag2 = ((EntityState)this).fixedAge >= castEndTime;
			isFiring = false;
			if ((flag && !flag2) || (flag && flag2 && !hasFired))
			{
				isFiring = true;
				OnCastFixedUpdate();
			}
			if (flag2 && !hasExited)
			{
				hasExited = true;
				OnCastExit();
			}
			if (((EntityState)this).fixedAge > duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void Update()
		{
			((EntityState)this).Update();
			if (isFiring)
			{
				OnCastUpdate();
			}
		}
	}
	public class ExampleTimedSkillState : BaseTimedSkillState
	{
		public static float SkillBaseDuration = 1.5f;

		public static float SkillStartTime = 0.2f;

		public static float SkillEndTime = 0.9f;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			InitDurationValues(SkillBaseDuration, SkillStartTime, SkillEndTime);
		}

		protected override void OnCastEnter()
		{
		}

		protected override void OnCastFixedUpdate()
		{
		}

		protected override void OnCastExit()
		{
		}
	}
	public class ExampleDelayedSkillState : BaseTimedSkillState
	{
		public static float SkillBaseDuration = 1.5f;

		public static float SkillStartTime = 0.2f;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			InitDurationValues(SkillBaseDuration, SkillStartTime);
		}

		protected override void OnCastEnter()
		{
		}
	}
	public class JhinWeaponMainState : BaseState
	{
		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
		}

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

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
		}
	}
	public class JhinWeaponPassiveCritReadyState : BaseState
	{
		[SerializeField]
		public SkillDef primaryOverrideSkillDef;

		protected JhinStateController jhinStateController;

		protected Animator animatorComponent;

		public override void OnEnter()
		{
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			jhinStateController = ((EntityState)this).GetComponent<JhinStateController>();
			animatorComponent = ((EntityState)this).GetModelAnimator();
			string text = "SERORONIN_JHIN_BODY_";
			primaryOverrideSkillDef = (SkillDef)(object)Skills.CreateSkillDef<JhinAmmoSkillDef>(new SkillDefInfo
			{
				skillName = text + "PRIMARY_WHISPER_NAME",
				skillNameToken = text + "PRIMARY_WHISPER_NAME",
				skillDescriptionToken = text + "PRIMARY_WHISPER_CRIT_DESCRIPTION",
				skillIcon = Asset.mainAssetBundle.LoadAsset<Sprite>("texPrimaryCritIcon"),
				activationState = new SerializableEntityStateType(typeof(WhisperPrimary)),
				activationStateMachineName = "Weapon",
				interruptPriority = (InterruptPriority)0,
				isCombatSkill = true,
				baseRechargeInterval = 0f,
				requiredStock = 0,
				stockToConsume = 0,
				cancelSprintingOnActivation = false,
				keywordTokens = new string[2] { "KEYWORD_AGILE", "KEYWORD_EXECUTING" }
			});
			Helpers.PlaySound("PassiveCritSpin", ((EntityState)this).gameObject);
			Helpers.PlaySound("PassiveCritMusic", ((EntityState)this).gameObject);
			if (Object.op_Implicit((Object)(object)animatorComponent))
			{
				int layerIndex = animatorComponent.GetLayerIndex("UpperBody Idle, Override");
				animatorComponent.SetLayerWeight(layerIndex, 1f);
			}
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator))
			{
				((EntityState)this).skillLocator.primary.SetSkillOverride((object)this, primaryOverrideSkillDef, (SkillOverridePriority)2);
			}
		}

		public override void OnExit()
		{
			Helpers.StopSound("PassiveCritSpin", ((EntityState)this).gameObject);
			Helpers.StopSound("PassiveCritMusic", ((EntityState)this).gameObject);
			if (Object.op_Implicit((Object)(object)animatorComponent))
			{
				int layerIndex = animatorComponent.GetLayerIndex("UpperBody Idle, Override");
				animatorComponent.SetLayerWeight(layerIndex, 0f);
			}
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator))
			{
				((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)this, primaryOverrideSkillDef, (SkillOverridePriority)2);
			}
			((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)0;
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
		}
	}
	public class JhinWeaponUltActiveState : BaseState
	{
		public float baseDuration = 10f;

		public float duration = 10f;

		public bool startedExit = false;

		public bool startedExitEffects = false;

		public float exitDuration = 0.5f;

		[SerializeField]
		public SkillDef primaryOverrideSkillDef;

		public SkillDef primaryOverrideCritSkillDef;

		public SkillDef specialCancelSkillDef;

		protected JhinStateController jhinStateController;

		protected Animator animatorComponent;

		public override void OnEnter()
		{
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0294: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			jhinStateController = ((EntityState)this).GetComponent<JhinStateController>();
			animatorComponent = ((EntityState)this).GetModelAnimator();
			string text = "SERORONIN";
			primaryOverrideSkillDef = Skills.CreateSkillDef(new SkillDefInfo
			{
				skillName = text + "_JHIN_BODY_SPECIAL_ULT_NAME",
				skillNameToken = text + "_JHIN_BODY_SPECIAL_ULT_NAME",
				skillDescriptionToken = text + "_JHIN_BODY_SPECIAL_ULT_SHOT_DESCRIPTION",
				skillIcon = Asset.mainAssetBundle.LoadAsset<Sprite>("texSpecialShotIcon"),
				activationState = new SerializableEntityStateType(typeof(CurtainCallShoot)),
				activationStateMachineName = "Weapon",
				baseMaxStock = 1,
				baseRechargeInterval = Config.specialCD.Value,
				beginSkillCooldownOnSkillEnd = false,
				canceledFromSprinting = false,
				forceSprintDuringState = false,
				fullRestockOnAssign = true,
				interruptPriority = (InterruptPriority)0,
				resetCooldownTimerOnUse = false,
				isCombatSkill = true,
				mustKeyPress = true,
				cancelSprintingOnActivation = true,
				rechargeStock = 0,
				requiredStock = 0,
				stockToConsume = 0
			});
			primaryOverrideCritSkillDef = Skills.CreateSkillDef(new SkillDefInfo
			{
				skillName = text + "_JHIN_BODY_SPECIAL_ULT_NAME",
				skillNameToken = text + "_JHIN_BODY_SPECIAL_ULT_NAME",
				skillDescriptionToken = text + "_JHIN_BODY_SPECIAL_ULT_SHOT_CRIT_DESCRIPTION",
				skillIcon = Asset.mainAssetBundle.LoadAsset<Sprite>("texSpecialShotCritIcon"),