Decompiled source of broken ass link v0.0.2

LinkMod.dll

Decompiled 16 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EmotesAPI;
using EntityStates;
using EntityStates.Commando;
using ExtraSkillSlots;
using HG;
using HG.BlendableTypes;
using LinkMod.Content.Link;
using LinkMod.Modules;
using LinkMod.Modules.Characters;
using LinkMod.Modules.Networking.Miscellaneous;
using LinkMod.Modules.Networking.OnHitProjectile;
using LinkMod.Modules.Survivors;
using LinkMod.SkillStates;
using LinkMod.SkillStates.Link;
using LinkMod.SkillStates.Link.Boomerang;
using LinkMod.SkillStates.Link.BowAndArrow;
using LinkMod.SkillStates.Link.DekuNut;
using LinkMod.SkillStates.Link.GenericItemStates;
using LinkMod.SkillStates.Link.GoddessSpells;
using LinkMod.SkillStates.Link.Hookshot;
using LinkMod.SkillStates.Link.HylianShield;
using LinkMod.SkillStates.Link.MasterSwordPrimary;
using LinkMod.SkillStates.Link.MasterSwordSpinAttack;
using LinkMod.SkillStates.Link.RuneBomb;
using LinkMod.SkillStates.Link.StandardBomb;
using LinkMod.SkillStates.Link.SuperBomb;
using LinkMod.SkillStates.Link.SwapLoadout;
using On.RoR2;
using On.RoR2.UI;
using R2API;
using R2API.Networking;
using R2API.Networking.Interfaces;
using R2API.Utils;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.Achievements;
using RoR2.CharacterAI;
using RoR2.ContentManagement;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.ResourceManagement.AsyncOperations;
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("LinkMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+601d2a99315b3b39c746818fdd46ebdb399b7a0f")]
[assembly: AssemblyProduct("LinkMod")]
[assembly: AssemblyTitle("LinkMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: UnverifiableCode]
namespace LinkMod
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[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.PopcornFactory.LoZ-LinkMod", "LoZ-LinkMod", "0.0.2")]
	public class LinkPlugin : BaseUnityPlugin
	{
		public const string MODUID = "com.PopcornFactory.LoZ-LinkMod";

		public const string MODNAME = "LoZ-LinkMod";

		public const string MODVERSION = "0.0.2";

		public const string DEVELOPER_PREFIX = "POPCORN";

		public static LinkPlugin instance;

		public static bool emotesAvailable = false;

		public static bool riskUIEnabled = false;

		public static Dictionary<string, CharacterMaster> summonCharacterMaster = new Dictionary<string, CharacterMaster>();

		private void Awake()
		{
			instance = this;
			if (Chainloader.PluginInfos.ContainsKey("bubbet.riskui"))
			{
				riskUIEnabled = true;
			}
			Log.Init(((BaseUnityPlugin)this).Logger);
			Assets.Initialize();
			Config.ReadConfig();
			if (Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"))
			{
				Config.SetupRiskOfOptions();
			}
			States.RegisterStates();
			Buffs.RegisterBuffs();
			Projectiles.RegisterProjectiles();
			Tokens.AddTokens();
			ItemDisplays.PopulateDisplays();
			new Link().Initialize();
			new RuneBomb().Initialize();
			new ContentPacks().Initialize();
			Hook();
			SetupNetworkMessages();
		}

		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_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Expected O, but got Unknown
			CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats);
			CharacterModel.Start += new hook_Start(CharacterModel_Start);
			HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage);
			CharacterModel.UpdateOverlays += new hook_UpdateOverlays(CharacterModel_UpdateOverlays);
			if (Chainloader.PluginInfos.ContainsKey("com.weliveinasociety.CustomEmotesAPI"))
			{
				emotesAvailable = true;
				SurvivorCatalog.Init += new hook_Init(SurvivorCatalog_Init);
			}
		}

		private void SetupNetworkMessages()
		{
			NetworkingAPI.RegisterMessageType<ServerForceFallStateNetworkRequest>();
			NetworkingAPI.RegisterMessageType<ServerForceShieldBlockSuccessAnimNetworkRequest>();
			NetworkingAPI.RegisterMessageType<ServerForceDownstabRecoveryNetworkRequest>();
			NetworkingAPI.RegisterMessageType<RuneBombSpawnNetworkRequest>();
			NetworkingAPI.RegisterMessageType<RuneBombDestroyNetworkRequest>();
		}

		private void SurvivorCatalog_Init(orig_Init orig)
		{
			orig.Invoke();
			foreach (SurvivorDef allSurvivorDef in SurvivorCatalog.allSurvivorDefs)
			{
				if (((Object)allSurvivorDef.bodyPrefab).name == "LinkBody")
				{
					CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, Assets.mainAssetBundle.LoadAsset<GameObject>("LinkHumanoid"), 0, true);
				}
			}
		}

		private static bool DetermineDirectionOfAttackIsWithinRange(CharacterBody attacker, CharacterBody linkVictim)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: 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_0039: 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)
			Vector3 aimDirection = linkVictim.inputBank.aimDirection;
			Vector3 normalized = ((Vector3)(ref aimDirection)).normalized;
			Vector3 val = attacker.transform.position - linkVictim.transform.position;
			val = ((Vector3)(ref val)).normalized;
			if (Vector3.Dot(normalized, val) > 0.5f)
			{
				return true;
			}
			return false;
		}

		private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
		{
			//IL_0166: 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_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_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: 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_00b7: 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_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: 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_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: 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_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Expected O, but got Unknown
			if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body) && Object.op_Implicit((Object)(object)damageInfo.attacker))
			{
				CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
				CharacterBody body = self.body;
				if (Object.op_Implicit((Object)(object)component) && body.baseNameToken == "POPCORN_LINK_BODY_NAME")
				{
					LinkController component2 = ((Component)body).GetComponent<LinkController>();
					if (component2.isShielding && self.body.HasBuff(Buffs.HylianShieldBuff) && DetermineDirectionOfAttackIsWithinRange(component, body))
					{
						NetMessageExtensions.Send((INetMessage)(object)new ServerForceShieldBlockSuccessAnimNetworkRequest(body.masterObjectId), (NetworkDestination)1);
						damageInfo.rejected = true;
						damageInfo.canRejectForce = false;
						damageInfo.force *= 2f;
						EffectData val = new EffectData
						{
							origin = damageInfo.position,
							rotation = Util.QuaternionSafeLookRotation((damageInfo.force != Vector3.zero) ? damageInfo.force : Random.onUnitSphere)
						};
						EffectManager.SpawnEffect(AssetReferences.bearEffectPrefab, val, true);
					}
				}
				if (self.body.baseNameToken == "POPCORN_RUNE_BOMB_BODY_NAME")
				{
					damageInfo.rejected = true;
					Vector3 val2 = ((Component)self).transform.position - damageInfo.attacker.transform.position + Vector3.up;
					damageInfo.force = ((Vector3)(ref val2)).normalized * Config.bombRecieveForce.Value;
					damageInfo.canRejectForce = false;
				}
			}
			orig.Invoke(self, damageInfo);
		}

		private void CharacterModel_Start(orig_Start orig, CharacterModel self)
		{
			orig.Invoke(self);
			if (!((Object)((Component)self).gameObject).name.Contains("LinkDisplay"))
			{
				return;
			}
			LinkRandomIdleAnimController component = ((Component)self).gameObject.GetComponent<LinkRandomIdleAnimController>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				ChildLocator component2 = ((Component)self).gameObject.GetComponent<ChildLocator>();
				if (Object.op_Implicit((Object)(object)component2))
				{
					component = ((Component)self).gameObject.AddComponent<LinkRandomIdleAnimController>();
				}
			}
			else
			{
				component.rerollAnim();
			}
		}

		private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self))
			{
				if (self.HasBuff(Buffs.SpinAttackSlowDebuff))
				{
					self.moveSpeed *= Config.moveSpeedPenaltySpinAttack.Value;
					self.armor += Config.armorSpinAttack.Value;
				}
				if (self.HasBuff(Buffs.HylianShieldBuff))
				{
					self.moveSpeed *= 0.6f;
					self.armor += 30f;
					self.jumpPower *= 0.7f;
					self.maxJumpCount = 1;
				}
			}
		}

		private void CharacterModel_UpdateOverlays(orig_UpdateOverlays orig, CharacterModel self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body))
			{
				LinkController component = ((Component)self.body).GetComponent<LinkController>();
				if (Object.op_Implicit((Object)(object)component))
				{
					LiterallyGarbageOverlayFunction(Assets.chargingOverlay, component.isCharging, self);
					LiterallyGarbageOverlayFunction(Assets.chargedOverlay, component.isCharged, self);
				}
			}
		}

		private void LiterallyGarbageOverlayFunction(Material overlayMaterial, bool condition, CharacterModel model)
		{
			if (model.activeOverlayCount < CharacterModel.maxOverlays && condition)
			{
				Material[] currentOverlays = model.currentOverlays;
				int activeOverlayCount = model.activeOverlayCount;
				model.activeOverlayCount = activeOverlayCount + 1;
				currentOverlays[activeOverlayCount] = overlayMaterial;
			}
		}
	}
	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 LinkMod.SkillStates
{
	public class Roll : BaseSkillState
	{
		public static float duration = 0.3f;

		public static float initialSpeedCoefficient = 4.5f;

		public static float finalSpeedCoefficient = 1.5f;

		public static string dodgeSoundString = "LinkRoll";

		public static float dodgeFOV = DodgeState.dodgeFOV;

		private float rollSpeed;

		private Vector3 forwardDirection;

		private Animator animator;

		private Vector3 previousPosition;

		public override void OnEnter()
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: 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_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_00fc: 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_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			((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;
			}
			RecalculateRollSpeed();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				float y = ((EntityState)this).characterMotor.velocity.y;
				((EntityState)this).characterMotor.velocity = forwardDirection * rollSpeed;
				((EntityState)this).characterMotor.velocity.y = y;
			}
			Vector3 val2 = (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) ? ((EntityState)this).characterMotor.velocity : Vector3.zero);
			previousPosition = ((EntityState)this).transform.position - val2;
			animator.SetFloat("Roll.playbackRate", 1.5f);
			((EntityState)this).PlayAnimation("FullBody, Override", "Roll", "Roll.playbackRate", duration, 0f);
			Util.PlaySound(dodgeSoundString, ((EntityState)this).gameObject);
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 0.9f * 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_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: 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_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: 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;
				float y = ((EntityState)this).characterMotor.velocity.y;
				((EntityState)this).characterMotor.velocity = val2;
				((EntityState)this).characterMotor.velocity.y = y / 2f;
			}
			previousPosition = ((EntityState)this).transform.position;
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			((EntityState)this).characterMotor.disableAirControlUntilCollision = false;
		}

		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 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();
		}
	}
}
namespace LinkMod.SkillStates.Link
{
	internal class LinkCharacterMain : GenericCharacterMain
	{
		private EntityStateMachine weaponStateMachine;

		private LinkController linkController;

		public override void OnEnter()
		{
			((GenericCharacterMain)this).OnEnter();
			weaponStateMachine = EntityStateMachine.FindByCustomName(((EntityState)this).gameObject, "Weapon");
			linkController = ((EntityState)this).gameObject.GetComponent<LinkController>();
		}

		public override void ProcessJump()
		{
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Expected O, but got Unknown
			((GenericCharacterMain)this).ProcessJump();
			if (Object.op_Implicit((Object)(object)linkController))
			{
				if (((BaseCharacterMain)this).hasCharacterMotor && ((BaseCharacterMain)this).hasInputBank && ((EntityState)this).isAuthority && !linkController.isShielding)
				{
					bool flag = ((EntityState)this).inputBank.jump.down && ((EntityState)this).characterMotor.velocity.y < 0f && !((EntityState)this).characterMotor.isGrounded;
					bool flag2 = ((object)weaponStateMachine.state).GetType() == typeof(ParasailOn);
					if (flag && !flag2)
					{
						weaponStateMachine.SetNextState((EntityState)(object)new ParasailOn());
					}
					if (!flag && flag2)
					{
						weaponStateMachine.SetNextState((EntityState)new Idle());
					}
				}
			}
			else
			{
				linkController = ((EntityState)this).gameObject.GetComponent<LinkController>();
			}
		}

		public override void OnExit()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)weaponStateMachine))
			{
				weaponStateMachine.SetNextState((EntityState)new Idle());
			}
			((GenericCharacterMain)this).OnExit();
		}
	}
	internal class LinkSpawnState : BaseSkillState
	{
		public float spawnDuration = 4f;

		public float unsheatheTime = 0.63f;

		public bool unsheathed;

		internal LinkController linkController;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			unsheathed = false;
			ChildLocator componentInChildren = ((EntityState)this).gameObject.GetComponentInChildren<ChildLocator>();
			linkController = ((EntityState)this).gameObject.GetComponent<LinkController>();
			linkController.SetSheathed();
			Transform val = componentInChildren.FindChild("ParasailSpawn");
			Animator component = ((Component)val).GetComponent<Animator>();
			((EntityState)this).GetModelAnimator().SetBool("isSpawn", true);
			component.SetBool("enableSpawn", true);
		}

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

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge > spawnDuration * unsheatheTime && !unsheathed)
			{
				linkController.SetUnsheathed();
				unsheathed = true;
			}
			if (((EntityState)this).fixedAge > spawnDuration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}
	}
	public class ParasailOn : BaseState
	{
		private Transform parasailTransform;

		private Animator parasailAnim;

		private Animator linkAnim;

		private LinkController linkCon;

		private static float slowestDescent = -3f;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			linkCon = ((EntityState)this).gameObject.GetComponent<LinkController>();
			linkCon.SetSheathed();
			parasailTransform = ((BaseState)this).FindModelChild("ParasailObj");
			parasailAnim = ((Component)parasailTransform).GetComponent<Animator>();
			linkAnim = ((EntityState)this).GetModelAnimator();
			parasailAnim.SetBool("isOpen", true);
			linkAnim.SetBool("isGliding", true);
			((EntityState)this).PlayCrossfade("FullBody, Override", "Gliding", 0.15f);
		}

		public override void FixedUpdate()
		{
			//IL_0086: 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)
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority)
			{
				float num = ((EntityState)this).characterMotor.velocity.y / 1.5f;
				if (num > slowestDescent)
				{
					num = slowestDescent;
				}
				num = Mathf.MoveTowards(num, Config.glideSpeed.Value, Config.glideAcceleration.Value * Time.fixedDeltaTime);
				((EntityState)this).characterMotor.velocity = new Vector3(((EntityState)this).characterMotor.velocity.x, num, ((EntityState)this).characterMotor.velocity.z);
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			parasailAnim.SetBool("isOpen", false);
			linkAnim.SetBool("isGliding", false);
			((EntityState)this).PlayAnimation("FullBody, Override", "BufferEmpty");
			linkCon.SetUnsheathed();
		}

		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;
		}
	}
}
namespace LinkMod.SkillStates.Link.SwapLoadout
{
	internal class SwapArrowLoadout : BaseSkillState
	{
		internal LinkController linkController;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			linkController = ((EntityState)this).gameObject.GetComponent<LinkController>();
			if (linkController.selectedLoadout == LinkController.SelectedLoadout.ARROW)
			{
				linkController.selectedLoadout = LinkController.SelectedLoadout.ARROW;
				((EntityState)this).outer.SetNextStateToMain();
				return;
			}
			if (linkController.selectedLoadout != LinkController.SelectedLoadout.SWORD)
			{
				SkillDef skillDef = ((EntityState)this).characterBody.skillLocator.primary.skillDef;
				SkillDef skillDef2 = ((EntityState)this).characterBody.skillLocator.secondary.skillDef;
				SkillDef skillDef3 = ((EntityState)this).characterBody.skillLocator.utility.skillDef;
				SkillDef skillDef4 = ((EntityState)this).characterBody.skillLocator.special.skillDef;
				((EntityState)this).characterBody.skillLocator.primary.UnsetSkillOverride((object)((EntityState)this).characterBody.skillLocator.primary, skillDef, (SkillOverridePriority)4);
				((EntityState)this).characterBody.skillLocator.secondary.UnsetSkillOverride((object)((EntityState)this).characterBody.skillLocator.secondary, skillDef2, (SkillOverridePriority)4);
				((EntityState)this).characterBody.skillLocator.utility.UnsetSkillOverride((object)((EntityState)this).characterBody.skillLocator.utility, skillDef3, (SkillOverridePriority)4);
				((EntityState)this).characterBody.skillLocator.special.UnsetSkillOverride((object)((EntityState)this).characterBody.skillLocator.special, skillDef4, (SkillOverridePriority)4);
			}
			((EntityState)this).characterBody.skillLocator.primary.SetSkillOverride((object)((EntityState)this).characterBody.skillLocator.primary, LinkMod.Content.Link.Link.arrowEntryPoint, (SkillOverridePriority)4);
			((EntityState)this).characterBody.skillLocator.secondary.SetSkillOverride((object)((EntityState)this).characterBody.skillLocator.secondary, LinkMod.Content.Link.Link.swapArrowFiringType, (SkillOverridePriority)4);
			((EntityState)this).characterBody.skillLocator.utility.SetSkillOverride((object)((EntityState)this).characterBody.skillLocator.utility, LinkMod.Content.Link.Link.swapArrowEquipped, (SkillOverridePriority)4);
			((EntityState)this).characterBody.skillLocator.special.SetSkillOverride((object)((EntityState)this).characterBody.skillLocator.special, LinkMod.Content.Link.Link.activateComboShot, (SkillOverridePriority)4);
			linkController.selectedLoadout = LinkController.SelectedLoadout.ARROW;
			((EntityState)this).outer.SetNextStateToMain();
		}

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

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			return ((EntityState)this).GetMinimumInterruptPriority();
		}
	}
	internal class SwapBombLoadout : BaseSkillState
	{
		internal LinkController linkController;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			linkController = ((EntityState)this).gameObject.GetComponent<LinkController>();
			if (linkController.selectedLoadout == LinkController.SelectedLoadout.BOMB)
			{
				((EntityState)this).outer.SetNextStateToMain();
				linkController.selectedLoadout = LinkController.SelectedLoadout.BOMB;
				return;
			}
			if (linkController.selectedLoadout != LinkController.SelectedLoadout.SWORD)
			{
				SkillDef skillDef = ((EntityState)this).characterBody.skillLocator.primary.skillDef;
				SkillDef skillDef2 = ((EntityState)this).characterBody.skillLocator.secondary.skillDef;
				SkillDef skillDef3 = ((EntityState)this).characterBody.skillLocator.utility.skillDef;
				SkillDef skillDef4 = ((EntityState)this).characterBody.skillLocator.special.skillDef;
				((EntityState)this).characterBody.skillLocator.primary.UnsetSkillOverride((object)((EntityState)this).characterBody.skillLocator.primary, skillDef, (SkillOverridePriority)4);
				((EntityState)this).characterBody.skillLocator.secondary.UnsetSkillOverride((object)((EntityState)this).characterBody.skillLocator.secondary, skillDef2, (SkillOverridePriority)4);
				((EntityState)this).characterBody.skillLocator.utility.UnsetSkillOverride((object)((EntityState)this).characterBody.skillLocator.utility, skillDef3, (SkillOverridePriority)4);
				((EntityState)this).characterBody.skillLocator.special.UnsetSkillOverride((object)((EntityState)this).characterBody.skillLocator.special, skillDef4, (SkillOverridePriority)4);
			}
			if (linkController.runeBombThrown)
			{
				((EntityState)this).characterBody.skillLocator.primary.SetSkillOverride((object)((EntityState)this).characterBody.skillLocator.primary, LinkMod.Content.Link.Link.runeBombDetonate, (SkillOverridePriority)4);
				((EntityState)this).characterBody.skillLocator.secondary.SetSkillOverride((object)((EntityState)this).characterBody.skillLocator.secondary, LinkMod.Content.Link.Link.hylianShieldSkillDef, (SkillOverridePriority)4);
				((EntityState)this).characterBody.skillLocator.utility.SetSkillOverride((object)((EntityState)this).characterBody.skillLocator.utility, LinkMod.Content.Link.Link.standardBombSpawn, (SkillOverridePriority)4);
				((EntityState)this).characterBody.skillLocator.special.SetSkillOverride((object)((EntityState)this).characterBody.skillLocator.special, LinkMod.Content.Link.Link.superBombSpawn, (SkillOverridePriority)4);
				linkController.selectedLoadout = LinkController.SelectedLoadout.BOMB;
				((EntityState)this).outer.SetNextStateToMain();
			}
			else
			{
				((EntityState)this).characterBody.skillLocator.primary.SetSkillOverride((object)((EntityState)this).characterBody.skillLocator.primary, LinkMod.Content.Link.Link.runeBombSpawn, (SkillOverridePriority)4);
				((EntityState)this).characterBody.skillLocator.secondary.SetSkillOverride((object)((EntityState)this).characterBody.skillLocator.secondary, LinkMod.Content.Link.Link.hylianShieldSkillDef, (SkillOverridePriority)4);
				((EntityState)this).characterBody.skillLocator.utility.SetSkillOverride((object)((EntityState)this).characterBody.skillLocator.utility, LinkMod.Content.Link.Link.standardBombSpawn, (SkillOverridePriority)4);
				((EntityState)this).characterBody.skillLocator.special.SetSkillOverride((object)((EntityState)this).characterBody.skillLocator.special, LinkMod.Content.Link.Link.superBombSpawn, (SkillOverridePriority)4);
				linkController.selectedLoadout = LinkController.SelectedLoadout.BOMB;
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

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

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			return ((EntityState)this).GetMinimumInterruptPriority();
		}
	}
	internal class SwapMiscellaneousLoadout : BaseSkillState
	{
		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
		}

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

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			return ((EntityState)this).GetMinimumInterruptPriority();
		}
	}
	internal class SwapSwordLoadout : BaseSkillState
	{
		internal LinkController linkController;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			linkController = ((EntityState)this).gameObject.GetComponent<LinkController>();
			if (linkController.selectedLoadout == LinkController.SelectedLoadout.SWORD)
			{
				linkController.selectedLoadout = LinkController.SelectedLoadout.SWORD;
				((EntityState)this).outer.SetNextStateToMain();
				return;
			}
			SkillDef skillDef = ((EntityState)this).characterBody.skillLocator.primary.skillDef;
			SkillDef skillDef2 = ((EntityState)this).characterBody.skillLocator.secondary.skillDef;
			SkillDef skillDef3 = ((EntityState)this).characterBody.skillLocator.utility.skillDef;
			SkillDef skillDef4 = ((EntityState)this).characterBody.skillLocator.special.skillDef;
			((EntityState)this).characterBody.skillLocator.primary.UnsetSkillOverride((object)((EntityState)this).characterBody.skillLocator.primary, skillDef, (SkillOverridePriority)4);
			((EntityState)this).characterBody.skillLocator.secondary.UnsetSkillOverride((object)((EntityState)this).characterBody.skillLocator.secondary, skillDef2, (SkillOverridePriority)4);
			((EntityState)this).characterBody.skillLocator.utility.UnsetSkillOverride((object)((EntityState)this).characterBody.skillLocator.utility, skillDef3, (SkillOverridePriority)4);
			((EntityState)this).characterBody.skillLocator.special.UnsetSkillOverride((object)((EntityState)this).characterBody.skillLocator.special, skillDef4, (SkillOverridePriority)4);
			linkController.selectedLoadout = LinkController.SelectedLoadout.SWORD;
			((EntityState)this).outer.SetNextStateToMain();
		}

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

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			return ((EntityState)this).GetMinimumInterruptPriority();
		}
	}
}
namespace LinkMod.SkillStates.Link.SuperBomb
{
	internal class SuperBombHold : BaseSkillState
	{
		internal static float baseDuration = 1f;

		internal float duration;

		internal Animator animator;

		internal LinkController linkController;

		internal float totalDuration;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			linkController = ((EntityState)this).gameObject.GetComponent<LinkController>();
			animator = ((EntityState)this).GetModelAnimator();
			duration = baseDuration;
			animator.SetFloat("Swing.playbackRate", 1f);
			((EntityState)this).PlayAnimation("UpperBody, Override", "ItemThrowHold", "Swing.playbackRate", duration, 0f);
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			((EntityState)this).PlayAnimation("UpperBody, Override", "BufferEmpty");
			linkController.isCharged = false;
			linkController.isCharging = false;
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (totalDuration <= Config.bombTimerToMaxCharge.Value)
			{
				linkController.isCharged = false;
				linkController.isCharging = true;
			}
			if (totalDuration >= Config.bombTimerToMaxCharge.Value)
			{
				linkController.isCharging = false;
				linkController.isCharged = true;
			}
			if (!((EntityState)this).isAuthority)
			{
				return;
			}
			if (!((EntityState)this).inputBank.skill4.down)
			{
				totalDuration += duration;
				linkController.itemInHand = LinkController.ItemInHand.SUPER;
				((EntityState)this).outer.SetState((EntityState)(object)new ItemThrow
				{
					totalDuration = totalDuration
				});
			}
			else if (((EntityState)this).fixedAge >= duration)
			{
				if (((EntityState)this).inputBank.skill4.down)
				{
					totalDuration += duration;
					((EntityState)this).outer.SetState((EntityState)(object)new SuperBombHold
					{
						totalDuration = totalDuration
					});
				}
				else
				{
					totalDuration += duration;
					linkController.itemInHand = LinkController.ItemInHand.SUPER;
					((EntityState)this).outer.SetState((EntityState)(object)new ItemThrow
					{
						totalDuration = totalDuration
					});
				}
			}
		}

		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 OnSerialize(NetworkWriter writer)
		{
			((BaseSkillState)this).OnSerialize(writer);
			writer.Write(totalDuration);
		}

		public override void OnDeserialize(NetworkReader reader)
		{
			((BaseSkillState)this).OnDeserialize(reader);
			totalDuration = reader.ReadSingle();
		}
	}
}
namespace LinkMod.SkillStates.Link.StandardBomb
{
	internal class StandardBombHold : BaseSkillState
	{
		internal static float baseDuration = 1f;

		internal float duration;

		internal Animator animator;

		internal LinkController linkController;

		internal float totalDuration;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			linkController = ((EntityState)this).gameObject.GetComponent<LinkController>();
			animator = ((EntityState)this).GetModelAnimator();
			duration = baseDuration;
			animator.SetFloat("Swing.playbackRate", 1f);
			((EntityState)this).PlayAnimation("UpperBody, Override", "ItemThrowHold", "Swing.playbackRate", duration, 0f);
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			((EntityState)this).PlayAnimation("UpperBody, Override", "BufferEmpty");
			linkController.isCharged = false;
			linkController.isCharging = false;
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (totalDuration <= Config.bombTimerToMaxCharge.Value)
			{
				linkController.isCharged = false;
				linkController.isCharging = true;
			}
			if (totalDuration >= Config.bombTimerToMaxCharge.Value)
			{
				linkController.isCharging = false;
				linkController.isCharged = true;
			}
			if (!((EntityState)this).isAuthority)
			{
				return;
			}
			if (!((EntityState)this).inputBank.skill3.down)
			{
				totalDuration += duration;
				linkController.itemInHand = LinkController.ItemInHand.NORMAL;
				((EntityState)this).outer.SetState((EntityState)(object)new ItemThrow
				{
					totalDuration = totalDuration
				});
			}
			else if (((EntityState)this).fixedAge >= duration)
			{
				if (((EntityState)this).inputBank.skill3.down)
				{
					totalDuration += duration;
					((EntityState)this).outer.SetState((EntityState)(object)new StandardBombHold
					{
						totalDuration = totalDuration
					});
				}
				else
				{
					totalDuration += duration;
					linkController.itemInHand = LinkController.ItemInHand.NORMAL;
					((EntityState)this).outer.SetState((EntityState)(object)new ItemThrow
					{
						totalDuration = totalDuration
					});
				}
			}
		}

		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 OnSerialize(NetworkWriter writer)
		{
			((BaseSkillState)this).OnSerialize(writer);
			writer.Write(totalDuration);
		}

		public override void OnDeserialize(NetworkReader reader)
		{
			((BaseSkillState)this).OnDeserialize(reader);
			totalDuration = reader.ReadSingle();
		}
	}
	internal class StandardBombSpawn : BaseSkillState
	{
		internal static float baseDuration = 0.6f;

		internal static float sheatheFraction = 0.1f;

		internal static float unsheatheSwordFraction = 0.68f;

		internal static float bombSpawnFraction = 0.21f;

		internal bool sheathe;

		internal bool unsheatheSword;

		internal bool bombEnabled;

		internal float duration;

		internal Animator animator;

		internal LinkController linkController;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			animator = ((EntityState)this).GetModelAnimator();
			animator.SetFloat("Swing.playbackRate", ((BaseState)this).attackSpeedStat);
			linkController = ((EntityState)this).gameObject.GetComponent<LinkController>();
			((EntityState)this).PlayAnimation("UpperBody, Override", "DeployBomb", "Swing.playbackRate", duration, 0f);
			linkController.itemInHand = LinkController.ItemInHand.NORMAL;
			sheathe = false;
			unsheatheSword = false;
			bombEnabled = false;
			linkController.isHolding = true;
			linkController.DisableFakeStandardBombInHand();
			linkController.DisableStandardBombInHand();
		}

		public override void OnExit()
		{
			((EntityState)this).PlayAnimation("UpperBody, Override", "BufferEmpty");
			((EntityState)this).OnExit();
			linkController.itemInHand = LinkController.ItemInHand.NORMAL;
			linkController.isHolding = true;
			linkController.DisableFakeStandardBombInHand();
			linkController.EnableStandardBombInHand();
			linkController.SetSwordOnlyUnsheathed();
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= duration * sheatheFraction && !sheathe)
			{
				linkController.SetSheathed();
				sheathe = true;
			}
			if (((EntityState)this).fixedAge >= duration * bombSpawnFraction && !bombEnabled)
			{
				bombEnabled = true;
				linkController.EnableFakeStandardBombInHand();
			}
			if (((EntityState)this).fixedAge >= duration * unsheatheSwordFraction && !unsheatheSword)
			{
				linkController.SetSwordOnlyUnsheathed();
				unsheatheSword = true;
				if (!((EntityState)this).inputBank.skill3.down)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new ItemThrow
					{
						totalDuration = 0f
					});
					return;
				}
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				linkController.DisableFakeStandardBombInHand();
				linkController.EnableStandardBombInHand();
				((EntityState)this).outer.SetNextState((EntityState)(object)new ItemStartHold());
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)7;
		}
	}
	internal class SuperBombSpawn : BaseSkillState
	{
		internal static float baseDuration = 0.6f;

		internal static float sheatheFraction = 0.1f;

		internal static float unsheatheSwordFraction = 0.68f;

		internal static float bombSpawnFraction = 0.21f;

		internal bool sheathe;

		internal bool unsheatheSword;

		internal bool bombEnabled;

		internal float duration;

		internal Animator animator;

		internal LinkController linkController;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			animator = ((EntityState)this).GetModelAnimator();
			animator.SetFloat("Swing.playbackRate", ((BaseState)this).attackSpeedStat);
			linkController = ((EntityState)this).gameObject.GetComponent<LinkController>();
			((EntityState)this).PlayAnimation("UpperBody, Override", "DeployBomb", "Swing.playbackRate", duration, 0f);
			linkController.itemInHand = LinkController.ItemInHand.SUPER;
			sheathe = false;
			unsheatheSword = false;
			bombEnabled = false;
			linkController.isHolding = true;
			linkController.DisableFakeSuperBombInHand();
			linkController.DisableSuperBombInHand();
		}

		public override void OnExit()
		{
			((EntityState)this).PlayAnimation("UpperBody, Override", "BufferEmpty");
			((EntityState)this).OnExit();
			linkController.itemInHand = LinkController.ItemInHand.SUPER;
			linkController.isHolding = true;
			linkController.DisableFakeSuperBombInHand();
			linkController.EnableSuperBombInHand();
			linkController.SetSwordOnlyUnsheathed();
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= duration * sheatheFraction && !sheathe)
			{
				linkController.SetSheathed();
				sheathe = true;
			}
			if (((EntityState)this).fixedAge >= duration * bombSpawnFraction && !bombEnabled)
			{
				bombEnabled = true;
				linkController.EnableFakeSuperBombInHand();
			}
			if (((EntityState)this).fixedAge >= duration * unsheatheSwordFraction && !unsheatheSword)
			{
				linkController.SetSwordOnlyUnsheathed();
				unsheatheSword = true;
				if (!((EntityState)this).inputBank.skill4.down)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new ItemThrow
					{
						totalDuration = 0f
					});
					return;
				}
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				linkController.DisableFakeSuperBombInHand();
				linkController.EnableSuperBombInHand();
				((EntityState)this).outer.SetNextState((EntityState)(object)new ItemStartHold());
			}
		}

		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;
		}
	}
}
namespace LinkMod.SkillStates.Link.RuneBomb
{
	public class RuneBombDeathState : BaseState
	{
		public override void OnEnter()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: 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_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Expected O, but got Unknown
			((BaseState)this).OnEnter();
			EffectData val = new EffectData
			{
				rotation = Quaternion.identity,
				origin = ((EntityState)this).gameObject.transform.position,
				scale = 1f,
				color = Color32.op_Implicit(Color.white)
			};
			EffectManager.SpawnEffect(Assets.runeBombExplosion, val, true);
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority)
			{
				EntityState.Destroy((Object)(object)((EntityState)this).gameObject);
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0003: 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)
			return (InterruptPriority)9;
		}
	}
	internal class RuneBombDetonate : BaseSkillState
	{
		internal static float baseDuration = 1f;

		internal float duration;

		internal float detonateFraction = 0.13f;

		internal float takeShieldFraction = 0.58f;

		internal bool detonated;

		internal bool shieldtaken;

		internal LinkController linkController;

		internal Animator animator;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			animator = ((EntityState)this).GetModelAnimator();
			linkController = ((EntityState)this).gameObject.GetComponent<LinkController>();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			linkController.SetSwordOnlyUnsheathed();
			animator.SetFloat("Swing.playbackRate", ((BaseState)this).attackSpeedStat);
			((EntityState)this).PlayAnimation("UpperBody, Override", "TriggerRuneBomb", "Swing.playbackRate", duration, 0f);
			detonated = false;
			shieldtaken = false;
			((EntityState)this).characterBody.skillLocator.primary.UnsetSkillOverride((object)((EntityState)this).characterBody.skillLocator.primary, LinkMod.Content.Link.Link.runeBombDetonate, (SkillOverridePriority)4);
			((EntityState)this).characterBody.skillLocator.primary.SetSkillOverride((object)((EntityState)this).characterBody.skillLocator.primary, LinkMod.Content.Link.Link.runeBombSpawn, (SkillOverridePriority)4);
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			((EntityState)this).PlayAnimation("UpperBody, Override", "BufferEmpty");
		}

		public override void FixedUpdate()
		{
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge > duration * detonateFraction && !detonated)
			{
				detonated = true;
				if (((EntityState)this).isAuthority)
				{
					NetMessageExtensions.Send((INetMessage)(object)new RuneBombDestroyNetworkRequest(((EntityState)this).characterBody.masterObjectId), (NetworkDestination)1);
				}
			}
			if (((EntityState)this).fixedAge > duration * takeShieldFraction && !shieldtaken)
			{
				linkController.SetUnsheathed();
			}
			if (((EntityState)this).fixedAge > duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)this).fixedAge > duration * detonateFraction && detonated)
			{
				return (InterruptPriority)1;
			}
			return (InterruptPriority)7;
		}
	}
	internal class RuneBombHold : BaseSkillState
	{
		internal static float baseDuration = 1f;

		internal float duration;

		internal Animator animator;

		internal LinkController linkController;

		internal float totalDuration;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			linkController = ((EntityState)this).gameObject.GetComponent<LinkController>();
			animator = ((EntityState)this).GetModelAnimator();
			duration = baseDuration;
			animator.SetFloat("Swing.playbackRate", 1f);
			((EntityState)this).PlayAnimation("UpperBody, Override", "ItemThrowHold", "Swing.playbackRate", duration, 0f);
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			((EntityState)this).PlayAnimation("UpperBody, Override", "BufferEmpty");
			linkController.isCharged = false;
			linkController.isCharging = false;
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (totalDuration <= Config.bombTimerToMaxCharge.Value)
			{
				linkController.isCharged = false;
				linkController.isCharging = true;
			}
			if (totalDuration >= Config.bombTimerToMaxCharge.Value)
			{
				linkController.isCharging = false;
				linkController.isCharged = true;
			}
			if (!((EntityState)this).isAuthority)
			{
				return;
			}
			if (!((EntityState)this).inputBank.skill1.down)
			{
				totalDuration += duration;
				linkController.itemInHand = LinkController.ItemInHand.RUNE;
				((EntityState)this).outer.SetState((EntityState)(object)new ItemThrow
				{
					totalDuration = totalDuration
				});
			}
			else if (((EntityState)this).fixedAge >= duration)
			{
				if (((EntityState)this).inputBank.skill1.down)
				{
					totalDuration += duration;
					((EntityState)this).outer.SetState((EntityState)(object)new RuneBombHold
					{
						totalDuration = totalDuration
					});
				}
				else
				{
					totalDuration += duration;
					linkController.itemInHand = LinkController.ItemInHand.RUNE;
					((EntityState)this).outer.SetState((EntityState)(object)new ItemThrow
					{
						totalDuration = totalDuration
					});
				}
			}
		}

		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 OnSerialize(NetworkWriter writer)
		{
			((BaseSkillState)this).OnSerialize(writer);
			writer.Write(totalDuration);
		}

		public override void OnDeserialize(NetworkReader reader)
		{
			((BaseSkillState)this).OnDeserialize(reader);
			totalDuration = reader.ReadSingle();
		}
	}
	internal class RuneBombSpawn : BaseSkillState
	{
		internal static float baseDuration = 1.1f;

		internal static float sheatheFraction = 0.1f;

		internal static float unsheatheSwordFraction = 0.68f;

		internal static float bombSpawnFraction = 0.21f;

		internal bool sheathe;

		internal bool unsheatheSword;

		internal bool bombEnabled;

		internal float duration;

		internal Animator animator;

		internal LinkController linkController;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			animator = ((EntityState)this).GetModelAnimator();
			animator.SetFloat("Swing.playbackRate", ((BaseState)this).attackSpeedStat);
			linkController = ((EntityState)this).gameObject.GetComponent<LinkController>();
			((EntityState)this).PlayAnimation("UpperBody, Override", "DeployBomb", "Swing.playbackRate", duration, 0f);
			linkController.itemInHand = LinkController.ItemInHand.RUNE;
			sheathe = false;
			unsheatheSword = false;
			bombEnabled = false;
			linkController.isHolding = true;
			linkController.DisableRuneBombInHand();
			linkController.DisableFakeRuneBombInHand();
		}

		public override void OnExit()
		{
			((EntityState)this).PlayAnimation("UpperBody, Override", "BufferEmpty");
			((EntityState)this).OnExit();
			linkController.itemInHand = LinkController.ItemInHand.RUNE;
			linkController.DisableFakeRuneBombInHand();
			linkController.EnableRuneBombInHand();
			linkController.SetSwordOnlyUnsheathed();
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= duration * sheatheFraction && !sheathe)
			{
				linkController.SetSheathed();
				sheathe = true;
			}
			if (((EntityState)this).fixedAge >= duration * bombSpawnFraction && !bombEnabled)
			{
				bombEnabled = true;
				linkController.EnableFakeRuneBombInHand();
			}
			if (((EntityState)this).fixedAge >= duration * unsheatheSwordFraction && !unsheatheSword)
			{
				linkController.SetSwordOnlyUnsheathed();
				unsheatheSword = true;
				if (!((EntityState)this).inputBank.skill1.down)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new ItemThrow
					{
						totalDuration = 0f
					});
					return;
				}
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				linkController.DisableFakeRuneBombInHand();
				linkController.EnableRuneBombInHand();
				((EntityState)this).outer.SetNextState((EntityState)(object)new ItemStartHold());
			}
		}

		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;
		}
	}
}
namespace LinkMod.SkillStates.Link.MasterSwordSpinAttack
{
	internal class AerialSpinAttack : BaseSkillState
	{
		public static float baseDuration = 1.5f;

		public static float initialSpeedCoefficient = 5f;

		public static float finalSpeedCoefficient = 0f;

		public float duration;

		private float rollSpeed;

		private Vector3 movementVector;

		private Animator animator;

		private Vector3 previousPosition;

		public float stopwatch;

		internal int maxNoOfBlasts;

		internal int noOfBlasts;

		internal float blastTimer;

		internal float startBlasting = 0f;

		internal float endBlasting = 0.4f;

		internal float MajorBlast = 0.5f;

		internal bool hasFired;

		internal BlastAttack suckingBlastAttack;

		internal BlastAttack finalBlastAttack;

		internal float lengthBetweenTicks;

		internal HitStopCachedState hitstopCache;

		internal float lightHitStopDuration = 0.1f;

		internal float heavyHitStopDuration = 0.3f;

		internal float hitHopVelocity = 5f;

		internal bool inHitStop;

		internal Vector3 storedVelocity;

		internal float hitPauseTimer;

		internal bool hasHopped;

		public override void OnEnter()
		{
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: 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)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: 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_012a: 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_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)
			((BaseState)this).OnEnter();
			animator = ((EntityState)this).GetModelAnimator();
			animator.SetFloat("Swing.playbackRate", 1f);
			duration = baseDuration;
			stopwatch = 0f;
			((EntityState)this).PlayAnimation("FullBody, Override", "SpinAttackAir", "Swing.playbackRate", duration, 0f);
			RecalculateSpeed();
			Vector3 val = ((((EntityState)this).inputBank.moveVector == Vector3.zero) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.moveVector);
			Vector3 normalized = ((Vector3)(ref val)).normalized;
			normalized *= 0.8f;
			movementVector = Vector3.up + normalized;
			movementVector = ((Vector3)(ref movementVector)).normalized;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterMotor.velocity = movementVector * rollSpeed;
			}
			Vector3 val2 = (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) ? ((EntityState)this).characterMotor.velocity : Vector3.zero);
			previousPosition = ((EntityState)this).transform.position - val2;
			SetupBlastAttacks();
			blastTimer = 0f;
			hasFired = false;
			noOfBlasts = 0;
			maxNoOfBlasts = 5 * ((!(((BaseState)this).attackSpeedStat >= 1f)) ? 1 : ((int)((BaseState)this).attackSpeedStat));
			lengthBetweenTicks = duration * endBlasting / (float)maxNoOfBlasts;
			inHitStop = false;
		}

		private void RecalculateSpeed()
		{
			if (stopwatch / duration < 0.35f)
			{
				rollSpeed = ((BaseState)this).moveSpeedStat * Mathf.Lerp(initialSpeedCoefficient, finalSpeedCoefficient, stopwatch / duration);
			}
			else
			{
				rollSpeed = ((BaseState)this).moveSpeedStat * Mathf.SmoothStep(initialSpeedCoefficient, finalSpeedCoefficient, stopwatch / duration);
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			((EntityState)this).PlayAnimation("FullBody, Override", "BufferEmpty");
		}

		public void OnHitEnemyAuthority(bool isLightHit)
		{
			//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_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_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			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 (isLightHit)
			{
				if (!inHitStop && lightHitStopDuration > 0f)
				{
					storedVelocity = ((EntityState)this).characterMotor.velocity;
					hitstopCache = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, "Swing.playbackRate");
					hitPauseTimer = lightHitStopDuration;
					inHitStop = true;
				}
			}
			else if (!inHitStop && heavyHitStopDuration > 0f)
			{
				storedVelocity = ((EntityState)this).characterMotor.velocity;
				hitstopCache = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, "Swing.playbackRate");
				hitPauseTimer = heavyHitStopDuration;
				inHitStop = true;
			}
		}

		public override void FixedUpdate()
		{
			//IL_0042: 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_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: 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_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: 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_010d: 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_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_029a: Unknown result type (might be due to invalid IL or missing references)
			//IL_029f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_02af: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_031b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0320: Unknown result type (might be due to invalid IL or missing references)
			//IL_032b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0330: Unknown result type (might be due to invalid IL or missing references)
			//IL_0332: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (stopwatch < duration * MajorBlast)
			{
				RecalculateSpeed();
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
				{
					((EntityState)this).characterDirection.forward = movementVector;
				}
				if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams))
				{
					((EntityState)this).cameraTargetParams.fovOverride = Mathf.Lerp(Roll.dodgeFOV, 60f, ((EntityState)this).fixedAge / Roll.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, movementVector), 0f);
					val2 = movementVector * num;
					((EntityState)this).characterMotor.velocity = val2;
				}
				previousPosition = ((EntityState)this).transform.position;
			}
			if (!((EntityState)this).isAuthority)
			{
				return;
			}
			if (((BaseState)this).isGrounded)
			{
				NetMessageExtensions.Send((INetMessage)(object)new ServerForceFallStateNetworkRequest(((EntityState)this).characterBody.masterObjectId), (NetworkDestination)1);
				((EntityState)this).outer.SetNextStateToMain();
				return;
			}
			if (!inHitStop)
			{
				stopwatch += Time.fixedDeltaTime;
				blastTimer += Time.fixedDeltaTime;
			}
			else
			{
				hitPauseTimer -= Time.fixedDeltaTime;
				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 (hitPauseTimer <= 0f && inHitStop)
			{
				((BaseState)this).ConsumeHitStopCachedState(hitstopCache, ((EntityState)this).characterMotor, animator);
				inHitStop = false;
				((EntityState)this).characterMotor.velocity = storedVelocity;
			}
			if (noOfBlasts <= maxNoOfBlasts)
			{
				if (blastTimer > lengthBetweenTicks)
				{
					noOfBlasts++;
					suckingBlastAttack.position = ((EntityState)this).gameObject.transform.position;
					Result val3 = suckingBlastAttack.Fire();
					if (val3.hitCount > 0)
					{
						OnHitEnemyAuthority(isLightHit: true);
					}
					blastTimer = 0f;
				}
			}
			else if (stopwatch > duration * MajorBlast && !hasFired)
			{
				hasFired = true;
				finalBlastAttack.position = ((EntityState)this).gameObject.transform.position;
				Result val4 = finalBlastAttack.Fire();
				if (val4.hitCount > 0)
				{
					OnHitEnemyAuthority(isLightHit: false);
				}
			}
			if (stopwatch > duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public void SetupBlastAttacks()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: 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_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: 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_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Expected O, but got Unknown
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: 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_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Expected O, but got Unknown
			suckingBlastAttack = new BlastAttack
			{
				damageType = DamageTypeCombo.op_Implicit((DamageType)0),
				attacker = ((EntityState)this).gameObject,
				inflictor = ((EntityState)this).gameObject,
				teamIndex = ((BaseState)this).GetTeam(),
				baseDamage = 1f * ((BaseState)this).damageStat,
				procCoefficient = 1f,
				baseForce = -1000f,
				radius = 15f,
				crit = ((BaseState)this).RollCrit()
			};
			finalBlastAttack = new BlastAttack
			{
				damageType = DamageTypeCombo.op_Implicit((DamageType)0),
				attacker = ((EntityState)this).gameObject,
				inflictor = ((EntityState)this).gameObject,
				teamIndex = ((BaseState)this).GetTeam(),
				baseDamage = 10f * ((BaseState)this).damageStat,
				procCoefficient = 1f,
				baseForce = 1000f,
				radius = 20f,
				crit = ((BaseState)this).RollCrit()
			};
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)7;
		}
	}
	internal class GroundedSpinAttackCharge : BaseSkillState
	{
		internal static float baseDuration = 1.5f;

		internal float duration;

		internal float totalDuration;

		internal LinkController linkController;

		public override void OnEnter()
		{
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			((EntityState)this).GetModelAnimator().SetFloat("Swing.playbackRate", 1f);
			((EntityState)this).PlayAnimation("FullBody, Override", "GroundedSpinAttackHold", "Swing.playbackRate", baseDuration, 0f);
			linkController = ((EntityState)this).gameObject.GetComponent<LinkController>();
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.SetBuffCount(Buffs.SpinAttackSlowDebuff.buffIndex, 1);
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			((EntityState)this).PlayAnimation("FullBody, Override", "BufferEmpty");
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (totalDuration <= Config.multiplierSpinAttack.Value)
			{
				linkController.isCharged = false;
				linkController.isCharging = true;
			}
			if (totalDuration >= Config.multiplierSpinAttack.Value)
			{
				linkController.isCharged = true;
				linkController.isCharging = false;
			}
			if (!((EntityState)this).isAuthority)
			{
				return;
			}
			if (((EntityState)this).fixedAge > duration)
			{
				if (!((EntityState)this).inputBank.skill4.down)
				{
					totalDuration += ((EntityState)this).fixedAge;
					((EntityState)this).outer.SetState((EntityState)(object)new GroundedSpinAttackEnd
					{
						totalDurationHeld = totalDuration
					});
				}
				else
				{
					totalDuration += ((EntityState)this).fixedAge;
					((EntityState)this).outer.SetState((EntityState)(object)new GroundedSpinAttackCharge
					{
						totalDuration = totalDuration
					});
				}
			}
			if (!((EntityState)this).inputBank.skill4.down)
			{
				totalDuration += ((EntityState)this).fixedAge;
				((EntityState)this).outer.SetState((EntityState)(object)new GroundedSpinAttackEnd
				{
					totalDurationHeld = totalDuration
				});
			}
		}

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

		public override void OnDeserialize(NetworkReader reader)
		{
			((BaseSkillState)this).OnDeserialize(reader);
			totalDuration = reader.ReadSingle();
		}

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

		internal static float baseDuration = 1.5f;

		internal float boostedDamage;

		internal float duration;

		internal float excessAmount;

		internal float lengthBetweenTicks;

		internal BlastAttack suckingBlastAttack;

		internal BlastAttack finalBlastAttack;

		internal float stopwatch;

		internal Animator animator;

		internal int maxNoOfBlasts;

		internal int noOfBlasts;

		internal float blastTimer;

		internal float startBlasting = 0f;

		internal float endBlasting = 0.4f;

		internal float MajorBlast = 0.5f;

		internal bool hasFired;

		internal LinkController linkController;

		internal HitStopCachedState hitstopCache;

		internal float lightHitStopDuration = 0.1f;

		internal float heavyHitStopDuration = 0.3f;

		internal float hitHopVelocity = 5f;

		internal bool inHitStop;

		internal Vector3 storedVelocity;

		internal float hitPauseTimer;

		internal bool hasHopped;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			stopwatch = 0f;
			duration = baseDuration;
			excessAmount = 0f;
			blastTimer = 0f;
			hasFired = false;
			noOfBlasts = 0;
			maxNoOfBlasts = 5 * ((!(((BaseState)this).attackSpeedStat >= 1f)) ? 1 : ((int)((BaseState)this).attackSpeedStat));
			lengthBetweenTicks = duration * endBlasting / (float)maxNoOfBlasts;
			animator = ((EntityState)this).GetModelAnimator();
			linkController = ((EntityState)this).gameObject.GetComponent<LinkController>();
			linkController.isCharging = false;
			linkController.isCharged = false;
			animator.SetFloat("Swing.playbackRate", 1f);
			inHitStop = false;
			if (totalDurationHeld > 1f)
			{
				boostedDamage = totalDurationHeld;
				if (boostedDamage > 20f)
				{
					boostedDamage = 20f;
					excessAmount = boostedDamage - 20f;
					if (excessAmount < 0f)
					{
						excessAmount = 0f;
					}
					else
					{
						boostedDamage += excessAmount / 2f;
					}
				}
			}
			else
			{
				boostedDamage = 1f;
			}
			SetupBlastAttacks();
			((EntityState)this).PlayAnimation("FullBody, Override", "GroundedSpinAttack", "Swing.playbackRate", duration, 0f);
		}

		public override void OnExit()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).OnExit();
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.SetBuffCount(Buffs.SpinAttackSlowDebuff.buffIndex, 0);
			}
		}

		public void OnHitEnemyAuthority(bool isLightHit)
		{
			//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_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_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			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 (isLightHit)
			{
				if (!inHitStop && lightHitStopDuration > 0f)
				{
					storedVelocity = ((EntityState)this).characterMotor.velocity;
					hitstopCache = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, "Swing.playbackRate");
					hitPauseTimer = lightHitStopDuration;
					inHitStop = true;
				}
			}
			else if (!inHitStop && heavyHitStopDuration > 0f)
			{
				storedVelocity = ((EntityState)this).characterMotor.velocity;
				hitstopCache = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, "Swing.playbackRate");
				hitPauseTimer = heavyHitStopDuration;
				inHitStop = true;
			}
		}

		public override void FixedUpdate()
		{
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			//IL_0155: 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_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (!((EntityState)this).isAuthority)
			{
				return;
			}
			if (!inHitStop)
			{
				stopwatch += Time.fixedDeltaTime;
				blastTimer += Time.fixedDeltaTime;
			}
			else
			{
				hitPauseTimer -= Time.fixedDeltaTime;
				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 (hitPauseTimer <= 0f && inHitStop)
			{
				((BaseState)this).ConsumeHitStopCachedState(hitstopCache, ((EntityState)this).characterMotor, animator);
				inHitStop = false;
				((EntityState)this).characterMotor.velocity = storedVelocity;
			}
			if (noOfBlasts <= maxNoOfBlasts)
			{
				if (blastTimer > lengthBetweenTicks)
				{
					noOfBlasts++;
					suckingBlastAttack.position = ((EntityState)this).gameObject.transform.position;
					Result val = suckingBlastAttack.Fire();
					if (val.hitCount > 0)
					{
						OnHitEnemyAuthority(isLightHit: true);
					}
					blastTimer = 0f;
				}
			}
			else if (stopwatch > duration * MajorBlast && !hasFired)
			{
				hasFired = true;
				finalBlastAttack.position = ((EntityState)this).gameObject.transform.position;
				Result val2 = finalBlastAttack.Fire();
				if (val2.hitCount > 0)
				{
					OnHitEnemyAuthority(isLightHit: false);
				}
			}
			if (stopwatch > duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public void SetupBlastAttacks()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: 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_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Expected O, but got Unknown
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: 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_00b3: 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_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_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Expected O, but got Unknown
			suckingBlastAttack = new BlastAttack
			{
				damageType = DamageTypeCombo.op_Implicit((DamageType)0),
				attacker = ((EntityState)this).gameObject,
				inflictor = ((EntityState)this).gameObject,
				teamIndex = ((BaseState)this).GetTeam(),
				baseDamage = 1f * ((BaseState)this).damageStat * boostedDamage,
				falloffModel = (FalloffModel)0,
				procCoefficient = 1f,
				baseForce = -1000f,
				radius = 15f,
				crit = ((BaseState)this).RollCrit()
			};
			finalBlastAttack = new BlastAttack
			{
				damageType = DamageTypeCombo.op_Implicit((DamageType)0),
				attacker = ((EntityState)this).gameObject,
				inflictor = ((EntityState)this).gameObject,
				teamIndex = ((BaseState)this).GetTeam(),
				baseDamage = 10f * ((BaseState)this).damageStat * boostedDamage,
				procCoefficient = 1f,
				falloffModel = (FalloffModel)0,
				baseForce = 1000f,
				radius = 20f,
				crit = ((BaseState)this).RollCrit()
			};
		}

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

		public override void OnDeserialize(NetworkReader reader)
		{
			((BaseSkillState)this).OnDeserialize(reader);
			totalDurationHeld = reader.ReadSingle();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)7;
		}
	}
	internal class GroundedSpinAttackStart : BaseSkillState
	{
		internal static float baseDuration = 0.05f;

		internal float duration;

		public override void OnEnter()
		{
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			((EntityState)this).GetModelAnimator().SetFloat("Swing.playbackRate", ((BaseState)this).attackSpeedStat);
			((EntityState)this).PlayAnimation("FullBody, Override", "GroundedSpinAttackStart", "Swing.playbackRate", duration, 0f);
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.SetBuffCount(Buffs.SpinAttackSlowDebuff.buffIndex, 1);
			}
		}

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

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge > duration)
			{
				((EntityState)this).outer.SetState((EntityState)(object)new GroundedSpinAttackCharge());
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)7;
		}
	}
	internal class SpinAttack : BaseSkillState
	{
		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			if (((BaseState)this).isGrounded)
			{
				((EntityState)this).outer.SetState((EntityState)(object)new GroundedSpinAttackStart());
			}
			else
			{
				((EntityState)this).outer.SetState((EntityState)(object)new AerialSpinAttack());
			}
		}

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

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
		}
	}
}
namespace LinkMod.SkillStates.Link.MasterSwordPrimary
{
	internal class MasterSword : BaseSkillState
	{
		public static float baseDuration = 0.4f;

		public float duration;

		public Animator animator;

		internal ChildLocator childLocator;

		public override void OnEnter()
		{
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			animator = ((EntityState)this).GetModelAnimator();
			animator.SetFloat("Swing.playbackRate", ((BaseState)this).attackSpeedStat);
			childLocator = ((EntityState)this).GetModelChildLocator();
			((Component)childLocator.FindChild("ShieldHurtboxParent")).gameObject.SetActive(false);
			LinkController component = ((EntityState)this).gameObject.GetComponent<LinkController>();
			component.isShielding = false;
			((EntityState)this).PlayAnimation("UpperBody, Override", "ShieldBlockEnd", "Swing.playbackRate", duration, 0f);
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.SetBuffCount(Buffs.HylianShieldBuff.buffIndex, 0);
			}
			if (((BaseState)this).isGrounded)
			{
				if (((EntityState)this).characterBody.isSprinting)
				{
					((EntityState)this).outer.SetState((EntityState)(object)new MasterSwordDashAttack());
				}
				else
				{
					((EntityState)this).outer.SetState((EntityState)(object)new MasterSwordSwing());
				}
			}
			else if (CheckLookingDown())
			{
				((EntityState)this).outer.SetState((EntityState)(object)new MasterSwordAerialDownstabBegin());
			}
			else
			{
				((EntityState)this).outer.SetState((EntityState)(object)new MasterSwordAerialDoubleSwing());
			}
		}

		private bool CheckLookingDown()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			Ray aimRay = ((BaseState)this).GetAimRay();
			if (Vector3.Dot(((Ray)(ref aimRay)).direction, Vector3.down) > 0.8f)
			{
				return true;
			}
			return false;
		}

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

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
		}
	}
	internal class MasterSwordAerialDoubleSwing : BaseSkillState
	{
		internal static float baseDuration = 1.5f;

		internal static float firstSwingFractionStart = 0.18f;

		internal static float firstSwingFractionEnd = 0.22f;

		internal static float secondSwingFractionStart = 0.33f;

		internal static float secondSwingFractionEnd = 0.4f;

		internal static float earlyExitTime = 0.58f;

		internal float hitHopVelocity = 13f;

		internal float duration;

		internal bool hasFired;

		internal OverlapAttack firstAttack;

		internal OverlapAttack secondAttack;

		internal Animator animator;

		internal int index;

		internal float stopwatch;

		internal HitStopCachedState hitstopCache;

		internal float hitStopDuration = 0.1f;

		internal bool inHitStop;

		internal Vector3 storedVelocity;

		internal float hitPauseTimer;

		internal bool hasHopped;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			hasFired = false;
			animator = ((EntityState)this).GetModelAnimator();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			hitHopVelocity = 10f / ((BaseState)this).attackSpeedStat;
			((BaseState)this).StartAimMode(0.5f + duration, false);
			SetupOverlapAttack();
			animator.SetFloat("Swing.playbackRate", ((BaseState)this).attackSpeedStat);
			PlayAttackAnimation();
			stopwatch = 0f;
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			((EntityState)this).PlayAnimation("FullBody, Override", "BufferEmpty");
		}

		public void OnHitEnemyAuthority()
		{
			//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_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)
			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 (!inHitStop && hitStopDuration > 0f)
			{
				storedVelocity = ((EntityState)this).characterMotor.velocity;
				hitstopCache = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, "Swing.playbackRate");
				hitPauseTimer = hitStopDuration / ((BaseState)this).attackSpeedStat;
				inHitStop = true;
			}
		}

		public void PlayAttackAnimation()
		{
			((EntityState)this).PlayAnimation("FullBody, Override", "AerialAttack", "Swing.playbackRate", duration, 0f);
		}

		public void FireBeam()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			Projectiles.swordBeamPrefab.GetComponent<Projectiles.SwordbeamOnHit>().netID = ((EntityState)this).characterBody.masterObjectId;
			Ray aimRay = ((BaseState)this).GetAimRay();
			ProjectileSimple component = Projectiles.swordBeamPrefab.GetComponent<ProjectileSimple>();
			component.desiredForwardSpeed = 20f;
			ProjectileManager.instance.FireProjectile(Projectiles.swordBeamPrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, 2f * ((BaseState)this).damageStat, 0f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, 150f, (DamageTypeCombo?)null);
		}

		public override void FixedUpdate()
		{
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			((EntityState)this).FixedUpdate();
			if (!((EntityState)this).isAuthority)
			{
				return;
			}
			if (!inHitStop)
			{
				stopwatch += Time.fixedDeltaTime;
				if (((BaseState)this).isGrounded)
				{
					NetMessageExtensions.Send((INetMessage)(object)new ServerForceFallStateNetworkRequest(((EntityState)this).characterBody.masterObjectId), (NetworkDestination)1);
					((EntityState)this).outer.SetNextStateToMain();
					return;
				}
			}
			else
			{
				hitPauseTimer -= Time.fixedDeltaTime;
				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 (hitPauseTimer <= 0f && inHitStop)
			{
				((BaseState)this).ConsumeHitStopCachedState(hitstopCache, ((EntityState)this).characterMotor, animator);
				inHitStop = false;
				((EntityState)this).characterMotor.velocity = storedVelocity;
			}
			if (stopwatch >= duration * firstSwingFractionStart && stopwatch <= duration * firstSwingFractionEnd && firstAttack.Fire((List<HurtBox>)null))
			{
				OnHitEnemyAuthority();
			}
			if (stopwatch >= duration * secondSwingFractionStart && stopwatch <= duration * secondSwingFractionEnd)
			{
				if (!hasFired && ((EntityState)this).healthComponent.health / ((EntityState)this).characterBody.maxHealth >= 0.85f)
				{
					FireBeam();
				}
				hasFired = true;
				if (secondAttack.Fire((List<HurtBox>)null))
				{
					OnHitEnemyAuthority();
				}
			}
			if (stopwatch >= duration * earlyExitTime && ((EntityState)this).inputBank.skill1.down)
			{
				if (!((BaseState)this).isGrounded)
				{
					((EntityState)this).outer.SetState((EntityState)(object)new MasterSword());
					return;
				}
				((EntityState)this).outer.SetState((EntityState)(object)new MasterSwordAerialDoubleSwing());
			}
			if (stopwatch >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public void SetupOverlapAttack()
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due