Decompiled source of Wanderer v1.0.1

plugins/UnforgivenMod.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AncientScepter;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EmotesAPI;
using EntityStates;
using EntityStates.AI.Walker;
using EntityStates.Merc.Weapon;
using HG;
using HG.BlendableTypes;
using JetBrains.Annotations;
using KinematicCharacterController;
using On.RoR2;
using R2API;
using R2API.Networking;
using R2API.Networking.Interfaces;
using R2API.Utils;
using Rewired.ComponentControls.Effects;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.Achievements;
using RoR2.Audio;
using RoR2.CharacterAI;
using RoR2.ContentManagement;
using RoR2.Projectile;
using RoR2.Skills;
using ThreeEyedGames;
using UnforgivenMod.Modules;
using UnforgivenMod.Modules.Achievements;
using UnforgivenMod.Modules.BaseStates;
using UnforgivenMod.Modules.Characters;
using UnforgivenMod.Unforgiven;
using UnforgivenMod.Unforgiven.Components;
using UnforgivenMod.Unforgiven.Content;
using UnforgivenMod.Unforgiven.SkillStates;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.Rendering.PostProcessing;
using UnityEngine.ResourceManagement.AsyncOperations;

[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("UnforgivenMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+683f0aecb6ab71f30b12390ef60b57974757039d")]
[assembly: AssemblyProduct("UnforgivenMod")]
[assembly: AssemblyTitle("UnforgivenMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
internal enum UnforgivenCameraParams
{
	DEFAULT,
	LAST_BREATH,
	AIM_SNIPER,
	EMOTE
}
namespace UnforgivenMod
{
	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 ErrorAssetBundle(string assetName, string bundleName)
		{
			Error("failed to load asset, " + assetName + ", because it does not exist in asset bundle, " + bundleName);
		}

		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);
		}
	}
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.kenko.Unforgiven", "Unforgiven", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class UnforgivenPlugin : BaseUnityPlugin
	{
		public const string MODUID = "com.kenko.Unforgiven";

		public const string MODNAME = "Unforgiven";

		public const string MODVERSION = "1.0.0";

		public const string DEVELOPER_PREFIX = "KENKO";

		public static UnforgivenPlugin instance;

		private static bool? _emotesInstalled;

		public static bool emotesInstalled
		{
			get
			{
				if (!_emotesInstalled.HasValue)
				{
					_emotesInstalled = Chainloader.PluginInfos.ContainsKey("com.weliveinasociety.CustomEmotesAPI");
				}
				return _emotesInstalled.Value;
			}
		}

		public static bool scepterInstalled => Chainloader.PluginInfos.ContainsKey("com.DestroyedClone.AncientScepter");

		public static bool riskOfOptionsInstalled => Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions");

		private void Awake()
		{
			instance = this;
			NetworkingAPI.RegisterMessageType<SyncWindExplosion>();
			NetworkingAPI.RegisterMessageType<SyncStacks>();
			Log.Init(((BaseUnityPlugin)this).Logger);
			Language.Init();
			UnforgivenSurvivor unforgivenSurvivor = new UnforgivenSurvivor();
			unforgivenSurvivor.Initialize();
			if (riskOfOptionsInstalled)
			{
				Config.InitializeOptions(unforgivenSurvivor.prefabCharacterBody.portraitIcon);
			}
			new ContentPacks().Initialize();
		}
	}
}
namespace UnforgivenMod.Unforgiven
{
	public class UnforgivenSurvivor : SurvivorBase<UnforgivenSurvivor>
	{
		public static class EmoteAPICompat
		{
			[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
			public static void Emotes()
			{
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Expected O, but got Unknown
				GameObject val = UnforgivenAssets.mainAssetBundle.LoadAsset<GameObject>("unforgiven_emoteskeleton");
				CustomEmotesAPI.ImportArmature(characterPrefab, val, 0, true);
				CustomEmotesAPI.animChanged += new AnimationChanged(CustomEmotesAPI_animChanged);
			}

			[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
			private static void CustomEmotesAPI_animChanged(string newAnimation, BoneMapper mapper)
			{
				if (newAnimation != "none")
				{
					if (((Object)((Component)mapper).transform).name == "unforgiven_emoteskeleton")
					{
						((Component)((Component)((Component)mapper).transform.parent).GetComponent<ChildLocator>().FindChild("KatanaModel")).gameObject.SetActive(false);
					}
				}
				else if (((Object)((Component)mapper).transform).name == "unforgiven_emoteskeleton")
				{
					((Component)((Component)((Component)mapper).transform.parent).GetComponent<ChildLocator>().FindChild("KatanaModel")).gameObject.SetActive(true);
				}
			}
		}

		public const string UNFORGIVEN_PREFIX = "KENKO_UNFORGIVEN_";

		internal static GameObject characterPrefab;

		public static SkillDef firstBreath;

		public override string assetBundleName => "unforgiven";

		public override string bodyName => "UnforgivenBody";

		public override string masterName => "UnforgivenMonsterMaster";

		public override string modelPrefabName => "mdlUnforgiven";

		public override string displayPrefabName => "UnforgivenDisplay";

		public override string survivorTokenPrefix => "KENKO_UNFORGIVEN_";

		public override BodyInfo bodyInfo => new BodyInfo
		{
			bodyName = bodyName,
			bodyNameToken = "KENKO_UNFORGIVEN_NAME",
			subtitleNameToken = "KENKO_UNFORGIVEN_SUBTITLE",
			characterPortrait = assetBundle.LoadAsset<Texture>("texUnforgivenIcon"),
			bodyColor = UnforgivenAssets.unforgivenColor,
			sortPosition = 7.9f,
			crosshair = CharacterAssets.LoadCrosshair("Standard"),
			podPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/SurvivorPod"),
			damage = UnforgivenConfig.damage.Value,
			damageGrowth = UnforgivenConfig.damageGrowth.Value * UnforgivenConfig.damage.Value,
			attackSpeed = UnforgivenConfig.attackSpeed.Value,
			attackSpeedGrowth = UnforgivenConfig.attackSpeedGrowth.Value,
			crit = UnforgivenConfig.crit.Value,
			critGrowth = UnforgivenConfig.critGrowth.Value,
			maxHealth = UnforgivenConfig.maxHealth.Value,
			healthGrowth = UnforgivenConfig.healthGrowth.Value * UnforgivenConfig.maxHealth.Value,
			healthRegen = UnforgivenConfig.healthRegen.Value,
			regenGrowth = UnforgivenConfig.regenGrowth.Value * UnforgivenConfig.healthRegen.Value,
			shield = UnforgivenConfig.shield.Value,
			shieldGrowth = UnforgivenConfig.shieldGrowth.Value * UnforgivenConfig.shield.Value,
			armor = UnforgivenConfig.armor.Value,
			armorGrowth = UnforgivenConfig.armorGrowth.Value * UnforgivenConfig.armor.Value,
			moveSpeed = UnforgivenConfig.moveSpeed.Value,
			moveSpeedGrowth = UnforgivenConfig.moveSpeedGrowth.Value * UnforgivenConfig.moveSpeed.Value,
			jumpPower = UnforgivenConfig.jumpPower.Value,
			jumpPowerGrowth = UnforgivenConfig.jumpPowerGrowth.Value * UnforgivenConfig.jumpPower.Value,
			acceleration = UnforgivenConfig.acceleration.Value,
			jumpCount = UnforgivenConfig.jumpCount.Value,
			autoCalculateLevelStats = UnforgivenConfig.autoCalculateLevelStats.Value
		};

		public override CustomRendererInfo[] customRendererInfos => new CustomRendererInfo[5]
		{
			new CustomRendererInfo
			{
				childName = "Model"
			},
			new CustomRendererInfo
			{
				childName = "KatanaModel"
			},
			new CustomRendererInfo
			{
				childName = "SheathModel"
			},
			new CustomRendererInfo
			{
				childName = "EmpoweredSword"
			},
			new CustomRendererInfo
			{
				childName = "ArmModel"
			}
		};

		public override UnlockableDef characterUnlockableDef => UnforgivenUnlockables.characterUnlockableDef;

		public override ItemDisplaysBase itemDisplays => new UnforgivenItemDisplays();

		public override AssetBundle assetBundle { get; protected set; }

		public override GameObject bodyPrefab { get; protected set; }

		public override CharacterBody prefabCharacterBody { get; protected set; }

		public override GameObject characterModelObject { get; protected set; }

		public override CharacterModel prefabCharacterModel { get; protected set; }

		public override GameObject displayPrefab { get; protected set; }

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

		public override void InitializeCharacter()
		{
			UnforgivenConfig.Init();
			UnforgivenUnlockables.Init();
			base.InitializeCharacter();
			CameraParams.InitializeParams();
			DamageTypes.Init();
			UnforgivenStates.Init();
			UnforgivenTokens.Init();
			UnforgivenBuffs.Init(assetBundle);
			LastBreathSuspension.Init();
			UnforgivenAssets.Init(assetBundle);
			InitializeEntityStateMachines();
			InitializeSkills();
			InitializeSkins();
			InitializeCharacterMaster();
			AdditionalBodySetup();
			characterPrefab = bodyPrefab;
			AddHooks();
		}

		private void AdditionalBodySetup()
		{
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Expected O, but got Unknown
			//IL_00c3: Expected O, but got Unknown
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Expected O, but got Unknown
			//IL_00eb: Expected O, but got Unknown
			//IL_00fd: 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_0118: Expected O, but got Unknown
			//IL_0118: Expected O, but got Unknown
			//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_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Expected O, but got Unknown
			//IL_006d: Expected O, but got Unknown
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Expected O, but got Unknown
			//IL_009a: Expected O, but got Unknown
			AddHitboxes();
			bodyPrefab.AddComponent<UnforgivenController>();
			bodyPrefab.AddComponent<UnforgivenTracker>();
			bodyPrefab.AddComponent<AirborneTargetLineController>();
			if (!UnforgivenConfig.noShieldVisual.Value)
			{
				TempVisualEffectAPI.AddTemporaryVisualEffect(UnforgivenAssets.shieldEffect, new EffectRadius(tempAddShieldRadius), new EffectCondition(tempAddShield), "");
				TempVisualEffectAPI.AddTemporaryVisualEffect(UnforgivenSkinVFX.GetMonsoonEffect(UnforgivenAssets.shieldEffect), new EffectRadius(tempAddShieldRadius), new EffectCondition(tempMonsoonShield), "");
			}
			TempVisualEffectAPI.AddTemporaryVisualEffect(UnforgivenAssets.dashCdEffect, new EffectRadius(dashCdRadius), new EffectCondition(dashCooldown), "");
			TempVisualEffectAPI.AddTemporaryVisualEffect(UnforgivenAssets.nadoUpEffect, new EffectRadius(nadoUpRadius), new EffectCondition(tempNadoUp), "");
			TempVisualEffectAPI.AddTemporaryVisualEffect(UnforgivenSkinVFX.GetMonsoonEffect(UnforgivenAssets.nadoUpEffect), new EffectRadius(nadoUpRadius), new EffectCondition(tempMonsoonNadoUp), "");
			AkBank component = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Merc/MercBody.prefab").WaitForCompletion().GetComponent<AkBank>();
			AkBank val = bodyPrefab.AddComponent<AkBank>();
			((AkTriggerHandler)val).triggerList = ((AkTriggerHandler)component).triggerList;
			val.data = component.data;
			((AkTriggerHandler)val).useOtherObject = false;
			val.decodeBank = false;
			val.overrideLoadSetting = false;
			val.loadAsynchronous = false;
			val.saveDecodedBank = false;
			val.unloadTriggerList = component.unloadTriggerList;
			static float dashCdRadius(CharacterBody body)
			{
				return body.radius * 1.25f;
			}
			static bool dashCooldown(CharacterBody body)
			{
				return body.HasBuff(UnforgivenBuffs.dashCooldownBuff);
			}
			static float nadoUpRadius(CharacterBody body)
			{
				return body.radius * 5f;
			}
			static bool tempAddShield(CharacterBody body)
			{
				return body.HasBuff(UnforgivenBuffs.hasShieldBuff) && !UnforgivenSkinVFX.IsMonsoon(((Component)body).gameObject);
			}
			static float tempAddShieldRadius(CharacterBody body)
			{
				return body.radius * 1.1f;
			}
			static bool tempMonsoonNadoUp(CharacterBody body)
			{
				return body.HasBuff(UnforgivenBuffs.stabMaxStacksBuff) && UnforgivenSkinVFX.IsMonsoon(((Component)body).gameObject);
			}
			static bool tempMonsoonShield(CharacterBody body)
			{
				return body.HasBuff(UnforgivenBuffs.hasShieldBuff) && UnforgivenSkinVFX.IsMonsoon(((Component)body).gameObject);
			}
			static bool tempNadoUp(CharacterBody body)
			{
				return body.HasBuff(UnforgivenBuffs.stabMaxStacksBuff) && !UnforgivenSkinVFX.IsMonsoon(((Component)body).gameObject);
			}
		}

		public void AddHitboxes()
		{
			Prefabs.SetupHitBoxGroup(characterModelObject, "MeleeHitbox", "MeleeHitbox");
			Prefabs.SetupHitBoxGroup(characterModelObject, "SteelTempestHitbox", "SteelTempestHitbox");
			Prefabs.SetupHitBoxGroup(characterModelObject, "SteelTempestSpinHitbox", "SteelTempestSpinHitbox");
		}

		public override void InitializeEntityStateMachines()
		{
			Prefabs.ClearEntityStateMachines(bodyPrefab);
			Prefabs.AddMainEntityStateMachine(bodyPrefab, "Body", typeof(MainState), typeof(SpawnTeleporterState));
			Prefabs.AddEntityStateMachine(bodyPrefab, "Weapon");
			Prefabs.AddEntityStateMachine(bodyPrefab, "Weapon2");
			Prefabs.AddEntityStateMachine(bodyPrefab, "Dash");
			Prefabs.AddEntityStateMachine(bodyPrefab, "Dash2");
		}

		public override void InitializeSkills()
		{
			bodyPrefab.AddComponent<UnforgivenPassive>();
			Skills.CreateSkillFamilies(bodyPrefab);
			AddPassiveSkills();
			AddPrimarySkills();
			AddSecondarySkills();
			AddUtilitySkills();
			AddSpecialSkills();
			if (UnforgivenPlugin.scepterInstalled)
			{
				InitializeScepter();
			}
		}

		private void AddPassiveSkills()
		{
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			UnforgivenPassive component = bodyPrefab.GetComponent<UnforgivenPassive>();
			SkillLocator component2 = bodyPrefab.GetComponent<SkillLocator>();
			component2.passiveSkill.enabled = false;
			component.unforgivenPassive = Skills.CreateSkillDef(new SkillDefInfo
			{
				skillName = "KENKO_UNFORGIVEN_PASSIVE_NAME",
				skillNameToken = "KENKO_UNFORGIVEN_PASSIVE_NAME",
				skillDescriptionToken = "KENKO_UNFORGIVEN_PASSIVE_DESCRIPTION",
				skillIcon = assetBundle.LoadAsset<Sprite>("texPassiveIcon"),
				keywordTokens = new string[0],
				activationState = new SerializableEntityStateType(typeof(Idle)),
				activationStateMachineName = "",
				baseMaxStock = 1,
				baseRechargeInterval = 0f,
				beginSkillCooldownOnSkillEnd = false,
				canceledFromSprinting = false,
				forceSprintDuringState = false,
				fullRestockOnAssign = true,
				interruptPriority = (InterruptPriority)0,
				resetCooldownTimerOnUse = false,
				isCombatSkill = false,
				mustKeyPress = false,
				cancelSprintingOnActivation = false,
				rechargeStock = 1,
				requiredStock = 2,
				stockToConsume = 1
			});
			Skills.AddPassiveSkills(component.passiveSkillSlot.skillFamily, component.unforgivenPassive);
		}

		private void AddPrimarySkills()
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			UnforgivenSteppedSkillDef unforgivenSteppedSkillDef = Skills.CreateSkillDef<UnforgivenSteppedSkillDef>(new SkillDefInfo("Swift Strikes", "KENKO_UNFORGIVEN_PRIMARY_SWING_NAME", "KENKO_UNFORGIVEN_PRIMARY_SWING_DESCRIPTION", assetBundle.LoadAsset<Sprite>("texPrimaryIcon"), new SerializableEntityStateType(typeof(SlashCombo))));
			unforgivenSteppedSkillDef.stepCount = 2;
			unforgivenSteppedSkillDef.stepGraceDuration = 0.1f;
			((SkillDef)unforgivenSteppedSkillDef).keywordTokens = new string[0];
			Skills.AddPrimarySkills(bodyPrefab, unforgivenSteppedSkillDef);
		}

		private void AddSecondarySkills()
		{
			//IL_0065: 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_007c: Unknown result type (might be due to invalid IL or missing references)
			SkillDefInfo skillDefInfo = new SkillDefInfo();
			skillDefInfo.skillName = "SteelTempest";
			skillDefInfo.skillNameToken = "KENKO_UNFORGIVEN_SECONDARY_STEEL_NAME";
			skillDefInfo.skillDescriptionToken = "KENKO_UNFORGIVEN_SECONDARY_STEEL_DESCRIPTION";
			skillDefInfo.keywordTokens = new string[2]
			{
				Tokens.agileKeyword,
				"KEYWORD_RAPID"
			};
			skillDefInfo.skillIcon = assetBundle.LoadAsset<Sprite>("texSecondaryIcon");
			skillDefInfo.activationState = new SerializableEntityStateType(typeof(EnterStab));
			skillDefInfo.activationStateMachineName = "Weapon2";
			skillDefInfo.interruptPriority = (InterruptPriority)1;
			skillDefInfo.baseMaxStock = 1;
			skillDefInfo.baseRechargeInterval = 2.5f;
			skillDefInfo.rechargeStock = 1;
			skillDefInfo.requiredStock = 1;
			skillDefInfo.stockToConsume = 1;
			skillDefInfo.resetCooldownTimerOnUse = false;
			skillDefInfo.fullRestockOnAssign = false;
			skillDefInfo.dontAllowPastMaxStocks = false;
			skillDefInfo.beginSkillCooldownOnSkillEnd = true;
			skillDefInfo.mustKeyPress = false;
			skillDefInfo.isCombatSkill = true;
			skillDefInfo.canceledFromSprinting = false;
			skillDefInfo.cancelSprintingOnActivation = false;
			skillDefInfo.forceSprintDuringState = false;
			SkillDef val = (SkillDef)(object)Skills.CreateSkillDef<UnforgivenSecondarySkillDef>(skillDefInfo);
			val.attackSpeedBuffsRestockSpeed = true;
			val.attackSpeedBuffsRestockSpeed_Multiplier = 1f;
			Skills.AddSecondarySkills(bodyPrefab, val);
		}

		private void AddUtilitySkills()
		{
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			SkillDefInfo skillDefInfo = new SkillDefInfo();
			skillDefInfo.skillName = "SweepingBlade";
			skillDefInfo.skillNameToken = "KENKO_UNFORGIVEN_UTILITY_SWEEP_NAME";
			skillDefInfo.skillDescriptionToken = "KENKO_UNFORGIVEN_UTILITY_SWEEP_DESCRIPTION";
			skillDefInfo.keywordTokens = new string[0];
			skillDefInfo.skillIcon = assetBundle.LoadAsset<Sprite>("texUtilityIcon");
			skillDefInfo.activationState = new SerializableEntityStateType(typeof(Dash));
			skillDefInfo.activationStateMachineName = "Dash";
			skillDefInfo.interruptPriority = (InterruptPriority)1;
			skillDefInfo.baseRechargeInterval = 0.25f;
			skillDefInfo.baseMaxStock = 1;
			skillDefInfo.rechargeStock = 1;
			skillDefInfo.requiredStock = 1;
			skillDefInfo.stockToConsume = 1;
			skillDefInfo.resetCooldownTimerOnUse = false;
			skillDefInfo.fullRestockOnAssign = true;
			skillDefInfo.dontAllowPastMaxStocks = false;
			skillDefInfo.mustKeyPress = false;
			skillDefInfo.beginSkillCooldownOnSkillEnd = false;
			skillDefInfo.isCombatSkill = true;
			skillDefInfo.canceledFromSprinting = false;
			skillDefInfo.cancelSprintingOnActivation = false;
			skillDefInfo.forceSprintDuringState = true;
			SkillDef val = (SkillDef)(object)Skills.CreateSkillDef<DashTrackerSkillDef>(skillDefInfo);
			Skills.AddUtilitySkills(bodyPrefab, val);
		}

		private void AddSpecialSkills()
		{
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			SkillDefInfo skillDefInfo = new SkillDefInfo();
			skillDefInfo.skillName = "LastBreath";
			skillDefInfo.skillNameToken = "KENKO_UNFORGIVEN_SPECIAL_BREATH_NAME";
			skillDefInfo.skillDescriptionToken = "KENKO_UNFORGIVEN_SPECIAL_BREATH_DESCRIPTION";
			skillDefInfo.keywordTokens = new string[0];
			skillDefInfo.skillIcon = assetBundle.LoadAsset<Sprite>("texSpecialIcon");
			skillDefInfo.activationState = new SerializableEntityStateType(typeof(DashSpecial));
			skillDefInfo.activationStateMachineName = "Dash";
			skillDefInfo.interruptPriority = (InterruptPriority)2;
			skillDefInfo.baseRechargeInterval = 9f;
			skillDefInfo.baseMaxStock = 1;
			skillDefInfo.rechargeStock = 1;
			skillDefInfo.requiredStock = 1;
			skillDefInfo.stockToConsume = 1;
			skillDefInfo.resetCooldownTimerOnUse = false;
			skillDefInfo.fullRestockOnAssign = true;
			skillDefInfo.dontAllowPastMaxStocks = false;
			skillDefInfo.mustKeyPress = true;
			skillDefInfo.beginSkillCooldownOnSkillEnd = true;
			skillDefInfo.isCombatSkill = true;
			skillDefInfo.canceledFromSprinting = false;
			skillDefInfo.cancelSprintingOnActivation = false;
			skillDefInfo.forceSprintDuringState = true;
			SkillDef val = (SkillDef)(object)Skills.CreateSkillDef<UnforgivenSpecialTrackerSkillDef>(skillDefInfo);
			Skills.AddSpecialSkills(bodyPrefab, val);
		}

		private void InitializeScepter()
		{
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			SkillDefInfo skillDefInfo = new SkillDefInfo();
			skillDefInfo.skillName = "FirstBreath";
			skillDefInfo.skillNameToken = "KENKO_UNFORGIVEN_SPECIAL_SCEP_BREATH_NAME";
			skillDefInfo.skillDescriptionToken = "KENKO_UNFORGIVEN_SPECIAL_SCEP_BREATH_DESCRIPTION";
			skillDefInfo.keywordTokens = new string[0];
			skillDefInfo.skillIcon = assetBundle.LoadAsset<Sprite>("texSpecialIcon");
			skillDefInfo.activationState = new SerializableEntityStateType(typeof(DashSpecial));
			skillDefInfo.activationStateMachineName = "Dash";
			skillDefInfo.interruptPriority = (InterruptPriority)2;
			skillDefInfo.baseRechargeInterval = 9f;
			skillDefInfo.baseMaxStock = 1;
			skillDefInfo.rechargeStock = 1;
			skillDefInfo.requiredStock = 1;
			skillDefInfo.stockToConsume = 1;
			skillDefInfo.resetCooldownTimerOnUse = false;
			skillDefInfo.fullRestockOnAssign = true;
			skillDefInfo.dontAllowPastMaxStocks = false;
			skillDefInfo.mustKeyPress = true;
			skillDefInfo.beginSkillCooldownOnSkillEnd = true;
			skillDefInfo.isCombatSkill = true;
			skillDefInfo.canceledFromSprinting = false;
			skillDefInfo.cancelSprintingOnActivation = false;
			skillDefInfo.forceSprintDuringState = true;
			firstBreath = (SkillDef)(object)Skills.CreateSkillDef<UnforgivenSpecialTrackerSkillDef>(skillDefInfo);
			ItemBase<AncientScepterItem>.instance.RegisterScepterSkill(firstBreath, bodyName, (SkillSlot)3, 0);
		}

		public override void InitializeSkins()
		{
			ModelSkinController val = ((Component)prefabCharacterModel).gameObject.AddComponent<ModelSkinController>();
			RendererInfo[] baseRendererInfos = prefabCharacterModel.baseRendererInfos;
			List<SkinDef> list = new List<SkinDef>();
			SkinDef val2 = Skins.CreateSkinDef("DEFAULT_SKIN", assetBundle.LoadAsset<Sprite>("texDefaultSkin"), baseRendererInfos, ((Component)prefabCharacterModel).gameObject);
			val2.meshReplacements = Skins.getMeshReplacements(assetBundle, baseRendererInfos, "meshBody", "meshDefaultSword", "meshSheath", "meshEmpoweredSword", "meshArm");
			list.Add(val2);
			SkinDef val3 = Skins.CreateSkinDef("KENKO_UNFORGIVEN_MASTERY_SKIN_NAME", assetBundle.LoadAsset<Sprite>("texWhirlwindSkin"), baseRendererInfos, ((Component)prefabCharacterModel).gameObject, UnforgivenUnlockables.masterySkinUnlockableDef);
			val3.meshReplacements = Skins.getMeshReplacements(assetBundle, baseRendererInfos, "meshAscendancyBody", "meshAscendancySword", "meshAscendancySheath", "meshAscendancySwordEmpowered", "meshAscendancyArm");
			val3.rendererInfos[0].defaultMaterial = UnforgivenAssets.ascendencyMat;
			val3.rendererInfos[1].defaultMaterial = UnforgivenAssets.ascendencyMat;
			val3.rendererInfos[2].defaultMaterial = UnforgivenAssets.ascendencyMat;
			val3.rendererInfos[3].defaultMaterial = UnforgivenAssets.ascendencyMat;
			val3.rendererInfos[4].defaultMaterial = UnforgivenAssets.ascendencyMat;
			list.Add(val3);
			UnforgivenSkinVFX.Init(val3);
			val.skins = list.ToArray();
		}

		public override void InitializeCharacterMaster()
		{
			UnforgivenAI.Init(bodyPrefab, masterName);
		}

		private void AddHooks()
		{
			//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_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats);
			HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(HealthComponent_TakeDamageProcess);
			GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal;
			SurvivorCatalog.Init += new hook_Init(SurvivorCatalog_Init);
		}

		private void SurvivorCatalog_Init(orig_Init orig)
		{
			orig.Invoke();
			if (UnforgivenPlugin.emotesInstalled)
			{
				EmoteAPICompat.Emotes();
			}
		}

		private static void GlobalEventManager_onCharacterDeathGlobal(DamageReport damageReport)
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			CharacterBody attackerBody = damageReport.attackerBody;
			NetworkIdentity val = default(NetworkIdentity);
			if (Object.op_Implicit((Object)(object)attackerBody) && Object.op_Implicit((Object)(object)damageReport.attackerMaster) && Object.op_Implicit((Object)(object)damageReport.victim) && attackerBody.bodyIndex == BodyCatalog.FindBodyIndex("UnforgivenBody") && damageReport.victimBody.HasBuff(UnforgivenBuffs.airborneBuff) && ((Component)damageReport.victim).gameObject.TryGetComponent<NetworkIdentity>(ref val))
			{
				NetMessageExtensions.Send((INetMessage)(object)new SyncWindExplosion(val.netId, ((Component)damageReport.victim).gameObject, UnforgivenSkinVFX.IsMonsoon(((Component)attackerBody).gameObject)), (NetworkDestination)1);
			}
		}

		private void HealthComponent_TakeDamageProcess(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo)
		{
			//IL_0029: 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)
			if (NetworkServer.active && self.alive)
			{
				CharacterBody body = self.body;
				UnforgivenController unforgivenController = default(UnforgivenController);
				if (Object.op_Implicit((Object)(object)body) && body.bodyIndex == BodyCatalog.FindBodyIndex("UnforgivenBody") && !damageInfo.rejected && ((Component)body).TryGetComponent<UnforgivenController>(ref unforgivenController) && unforgivenController.TryConsumeShield())
				{
					body.healthComponent.AddBarrier(body.healthComponent.fullCombinedHealth * 0.25f);
					Util.PlaySound("sfx_unforgiven_nado_impact", ((Component)body).gameObject);
					Util.PlaySound("sfx_unforgiven_lost_stacks", ((Component)body).gameObject);
				}
			}
			orig.Invoke(self, damageInfo);
		}

		private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self)
		{
			//IL_0015: 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)
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self) && self.bodyIndex == BodyCatalog.FindBodyIndex("UnforgivenBody"))
			{
				self.crit *= 1.5f;
				self.critMultiplier *= 0.9f;
			}
		}
	}
}
namespace UnforgivenMod.Unforgiven.SkillStates
{
	public class Dash : BaseUnforgivenSkillState
	{
		public static float baseDuration = 0.3f;

		public static float baseExtraDuration = 0.1f;

		public static float extraDistance = 2.5f;

		public static float hitRange = 4.5f;

		private const float minimumDashDuration = 0.1f;

		public int targetIndex = 0;

		public CharacterBody victimBody;

		private Transform modelTransform;

		private HurtBox hurtbox;

		private UnforgivenTracker tracker;

		private Vector3 direction;

		private float distance;

		private float duration;

		private float extraDuration;

		private float speed;

		private bool hasFired;

		private bool hasStartedDash;

		private float damageCoefficient = UnforgivenConfig.dashDamageCoefficient.Value;

		private float minDistance = 7f;

		private AimRequest aimRequest;

		private int maxStacks => UnforgivenConfig.baseMaxDashStacks.Value + (((EntityState)this).skillLocator.utility.maxStock - 1);

		public override void OnEnter()
		{
			//IL_029d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a2: 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_02b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02de: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0253: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			RefreshState();
			base.OnEnter();
			float num = baseDuration + baseExtraDuration;
			float num2 = Mathf.Max(0f, ((BaseState)this).moveSpeedStat / ((EntityState)this).characterBody.baseMoveSpeed - 1f);
			float num3 = 1f + 0.6f * num2;
			float num4 = Mathf.Max(0.1f, num / num3);
			if (!(((BaseState)this).moveSpeedStat > 0f) || !(((EntityState)this).characterBody.baseMoveSpeed > 0f) || float.IsInfinity(((BaseState)this).moveSpeedStat) || float.IsInfinity(((EntityState)this).characterBody.baseMoveSpeed) || !(num3 > 0f) || float.IsInfinity(num3) || float.IsNaN(num4) || float.IsInfinity(num4))
			{
				Log.Warning("Sweeping Blade cannot start with an invalid movement speed, dash speed multiplier, or dash duration.");
				if (((EntityState)this).isAuthority)
				{
					((EntityState)this).outer.SetNextStateToMain();
					((BaseSkillState)this).activatorSkillSlot.AddOneStock();
				}
				return;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams))
			{
				aimRequest = ((EntityState)this).cameraTargetParams.RequestAimType((AimType)2);
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && NetworkServer.active)
			{
				damageCoefficient = UnforgivenConfig.dashDamageCoefficient.Value + (float)((EntityState)this).characterBody.GetBuffCount(UnforgivenBuffs.stackingDashDamageBuff) * UnforgivenConfig.dashStackingDamageCoefficient.Value;
			}
			tracker = ((EntityState)this).GetComponent<UnforgivenTracker>();
			if (Object.op_Implicit((Object)(object)tracker) && ((EntityState)this).isAuthority)
			{
				hurtbox = tracker.GetTrackingTarget();
			}
			if (Object.op_Implicit((Object)(object)hurtbox) && Object.op_Implicit((Object)(object)hurtbox.healthComponent) && Object.op_Implicit((Object)(object)hurtbox.healthComponent.body))
			{
				victimBody = hurtbox.healthComponent.body;
			}
			if (!Object.op_Implicit((Object)(object)victimBody))
			{
				if (((EntityState)this).isAuthority)
				{
					((EntityState)this).outer.SetNextStateToMain();
					((BaseSkillState)this).activatorSkillSlot.AddOneStock();
				}
				return;
			}
			hasStartedDash = true;
			if (NetworkServer.active)
			{
				CharacterBody characterBody = ((EntityState)this).characterBody;
				characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags | 1);
				victimBody.AddTimedBuff(UnforgivenBuffs.dashCooldownBuff, 6f);
				((EntityState)this).characterBody.AddBuff(Buffs.HiddenInvincibility);
			}
			((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
			Vector3 corePosition = Util.GetCorePosition(victimBody);
			float num5 = minDistance;
			Vector3 val = ((EntityState)this).transform.position - corePosition;
			distance = Mathf.Max(num5, ((Vector3)(ref val)).magnitude);
			val = corePosition - ((EntityState)this).transform.position;
			direction = ((Vector3)(ref val)).normalized;
			duration = num4 * baseDuration / num;
			extraDuration = num4 - duration;
			speed = distance / duration;
			float cooldownRemaining = ((EntityState)this).skillLocator.secondary.cooldownRemaining;
			float num6 = num * ((EntityState)this).skillLocator.secondary.rechargeRate;
			if (((EntityState)this).isAuthority && cooldownRemaining > 0f && cooldownRemaining < num6)
			{
				((EntityState)this).skillLocator.secondary.RunRecharge(num6);
			}
			((EntityState)this).gameObject.layer = LayerIndex.fakeActor.intVal;
			((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers();
			unforgivenController.Unsheath();
			((EntityState)this).PlayCrossfade("FullBody, Override", "Dash", 0.1f);
			Util.PlaySound("Play_merc_shift_slice", ((EntityState)this).gameObject);
			if (((BaseState)this).isGrounded)
			{
				((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
			}
		}

		public override void OnExit()
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: 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_0082: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).gameObject.layer = LayerIndex.defaultLayer.intVal;
			((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers();
			((EntityState)this).characterMotor.velocity = Vector3.zero;
			AimRequest obj = aimRequest;
			if (obj != null)
			{
				obj.Dispose();
			}
			if (NetworkServer.active && hasStartedDash)
			{
				((EntityState)this).characterBody.RemoveBuff(Buffs.HiddenInvincibility);
				CharacterBody characterBody = ((EntityState)this).characterBody;
				characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags & -2);
				int num = ((EntityState)this).characterBody.GetBuffCount(UnforgivenBuffs.stackingDashDamageBuff);
				if (num >= maxStacks)
				{
					num = maxStacks - 1;
				}
				((EntityState)this).characterBody.ClearTimedBuffs(UnforgivenBuffs.stackingDashDamageBuff);
				for (int i = 0; i < num + 1; i++)
				{
					((EntityState)this).characterBody.AddTimedBuff(UnforgivenBuffs.stackingDashDamageBuff, 6f, maxStacks);
				}
			}
			((EntityState)this).OnExit();
		}

		private void Fire()
		{
			//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_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: 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_0097: 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_00a7: 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_00b9: Expected O, but got Unknown
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Expected O, but got Unknown
			if (!hasFired)
			{
				hasFired = true;
				if (NetworkServer.active)
				{
					DamageInfo val = new DamageInfo
					{
						position = victimBody.transform.position,
						attacker = ((EntityState)this).gameObject,
						inflictor = ((EntityState)this).gameObject,
						damage = damageCoefficient * ((BaseState)this).damageStat,
						damageColorIndex = (DamageColorIndex)0,
						damageType = DamageTypeCombo.op_Implicit((DamageType)(empoweredSpecial ? 2 : 0)),
						crit = ((BaseState)this).RollCrit(),
						force = Vector3.zero,
						procChainMask = default(ProcChainMask),
						procCoefficient = 1f
					};
					val.damageType.damageSource = (DamageSource)4;
					victimBody.healthComponent.TakeDamage(val);
					GlobalEventManager.instance.OnHitEnemy(val, ((Component)victimBody).gameObject);
					GlobalEventManager.instance.OnHitAll(val, ((Component)victimBody).gameObject);
					EffectManager.SpawnEffect(UnforgivenSkinVFX.GetEffect(UnforgivenAssets.unforgivenHitEffect, ((EntityState)this).gameObject), new EffectData
					{
						origin = victimBody.transform.position,
						rotation = Quaternion.identity,
						networkSoundEventIndex = UnforgivenAssets.swordImpactSoundEvent.index
					}, true);
				}
			}
		}

		public override void FixedUpdate()
		{
			//IL_0059: 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_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			base.FixedUpdate();
			if (hasStartedDash)
			{
				if (((EntityState)this).fixedAge >= duration && extraDuration != 0f)
				{
					speed = extraDistance / extraDuration;
				}
				((EntityState)this).characterDirection.forward = direction;
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				characterMotor.rootMotion += direction * speed * Time.fixedDeltaTime;
				((EntityState)this).characterMotor.velocity = Vector3.zero;
				if (Object.op_Implicit((Object)(object)victimBody))
				{
					Fire();
				}
				if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration + extraDuration)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)2;
		}

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

		public override void OnDeserialize(NetworkReader reader)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			HurtBoxReference val = NetworkExtensions.ReadHurtBoxReference(reader);
			hurtbox = ((HurtBoxReference)(ref val)).ResolveHurtBox();
		}
	}
	public class DashSpecial : BaseUnforgivenSkillState
	{
		private const float baseDuration = 0.167f;

		private HurtBox target;

		private CharacterBody victimBody;

		private float duration;

		private bool hasStartedDash;

		private bool holdBuffer;

		private AimRequest aimRequest;

		public override void OnEnter()
		{
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			base.OnEnter();
			if (((EntityState)this).isAuthority)
			{
				target = FindTarget();
				holdBuffer = unforgivenController.bufferedSpin;
			}
			if (!Object.op_Implicit((Object)(object)target) || !Object.op_Implicit((Object)(object)target.healthComponent) || !target.healthComponent.alive || !Object.op_Implicit((Object)(object)target.healthComponent.body))
			{
				Cancel();
				return;
			}
			victimBody = target.healthComponent.body;
			hasStartedDash = true;
			duration = 0.167f / ((BaseState)this).attackSpeedStat;
			if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams))
			{
				aimRequest = ((EntityState)this).cameraTargetParams.RequestAimType((AimType)2);
			}
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddBuff(Buffs.HiddenInvincibility);
				((EntityState)this).characterBody.AddBuff(UnforgivenBuffs.specialSuspensionBuff);
				victimBody.AddBuff(UnforgivenBuffs.specialSuspensionBuff);
			}
			((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
			((EntityState)this).characterMotor.rootMotion = Vector3.zero;
			((EntityState)this).characterMotor.velocity = Vector3.zero;
			unforgivenController.Unsheath();
			((EntityState)this).PlayCrossfade("FullBody, Override", "Dash", 0.05f);
			Util.PlaySound("Play_merc_shift_slice", ((EntityState)this).gameObject);
		}

		private HurtBox FindTarget()
		{
			//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_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: 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_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			Ray aimRay = ((EntityState)this).inputBank.GetAimRay();
			RaycastHit val2 = default(RaycastHit);
			Vector3 val = (((EntityState)this).inputBank.GetAimRaycast(60f, ref val2) ? ((RaycastHit)(ref val2)).point : ((Ray)(ref aimRay)).GetPoint(60f));
			HurtBox result = null;
			float num = float.PositiveInfinity;
			HurtBox[] hurtBoxes = new SphereSearch
			{
				origin = ((EntityState)this).characterBody.corePosition,
				radius = 60f,
				mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask
			}.RefreshCandidates().FilterCandidatesByHurtBoxTeam(TeamMask.GetEnemyTeams(((BaseState)this).GetTeam())).FilterCandidatesByDistinctHurtBoxEntities()
				.GetHurtBoxes();
			HurtBox[] array = hurtBoxes;
			foreach (HurtBox val3 in array)
			{
				if (UnforgivenSpecialTrackerSkillDef.TryGetEligibleBody(val3, out var _))
				{
					Vector3 val4 = ((Component)val3).transform.position - val;
					if (((Vector3)(ref val4)).sqrMagnitude < num)
					{
						result = val3;
						val4 = ((Component)val3).transform.position - val;
						num = ((Vector3)(ref val4)).sqrMagnitude;
					}
				}
			}
			return result;
		}

		private bool TryGetArrivalPosition(out Vector3 position)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: 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_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: 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_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_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: 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_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: 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_010a: 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_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: 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_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: Unknown result type (might be due to invalid IL or missing references)
			Vector3 position2 = ((Component)target).transform.position;
			Vector3 val = Vector3.ProjectOnPlane(((EntityState)this).characterBody.corePosition - position2, Vector3.up);
			Vector3 val2 = ((Vector3)(ref val)).normalized;
			if (val2 == Vector3.zero)
			{
				val2 = -((EntityState)this).characterDirection.forward;
			}
			CapsuleCollider capsule = ((BaseCharacterController)((EntityState)this).characterMotor).Motor.Capsule;
			Vector3 lossyScale = ((EntityState)this).transform.lossyScale;
			float num = capsule.radius * Mathf.Max(Mathf.Abs(lossyScale.x), Mathf.Abs(lossyScale.z));
			float num2 = Mathf.Max(0f, capsule.height * Mathf.Abs(lossyScale.y) * 0.5f - num);
			Vector3 val3 = ((EntityState)this).characterBody.corePosition - ((EntityState)this).transform.position;
			Collider component = ((Component)target).GetComponent<Collider>();
			float num3;
			if (!Object.op_Implicit((Object)(object)component))
			{
				num3 = victimBody.radius;
			}
			else
			{
				Bounds bounds = component.bounds;
				val = ((Bounds)(ref bounds)).extents;
				num3 = ((Vector3)(ref val)).magnitude;
			}
			float num4 = num3;
			for (int i = 0; i < 2; i++)
			{
				for (int j = 0; j < 8; j++)
				{
					Vector3 val4 = Quaternion.AngleAxis((float)j * 45f, Vector3.up) * val2;
					Vector3 val5 = (Object.op_Implicit((Object)(object)component) ? component.ClosestPoint(position2 + val4 * (num4 + 1f)) : (position2 + val4 * num4));
					position = val5 + val4 * (num + 0.5f) - val3 + Vector3.up * ((float)i * (num2 + num));
					Vector3 val6 = position + ((EntityState)this).transform.TransformVector(capsule.center);
					if (!Physics.CheckCapsule(val6 + Vector3.up * num2, val6 - Vector3.up * num2, num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1))
					{
						return true;
					}
				}
			}
			position = ((EntityState)this).transform.position;
			return false;
		}

		private void Cancel()
		{
			if (((EntityState)this).isAuthority)
			{
				((EntityState)this).skillLocator.special.AddOneStock();
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void FixedUpdate()
		{
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			base.FixedUpdate();
			if (hasStartedDash && ((EntityState)this).isAuthority && !(((EntityState)this).fixedAge < duration))
			{
				if (!Object.op_Implicit((Object)(object)target) || !Object.op_Implicit((Object)(object)target.healthComponent) || !target.healthComponent.alive)
				{
					Cancel();
					return;
				}
				if (!TryGetArrivalPosition(out var position))
				{
					Log.Warning("Last Breath could not find an unobstructed position next to its target; refunding the skill.");
					Cancel();
					return;
				}
				Vector3 val = position + ((EntityState)this).characterBody.corePosition - ((EntityState)this).transform.position;
				TeleportHelper.TeleportGameObject(((EntityState)this).gameObject, position);
				((EntityState)this).characterMotor.velocity = Vector3.zero;
				CharacterDirection characterDirection = ((EntityState)this).characterDirection;
				Vector3 val2 = Vector3.ProjectOnPlane(((Component)target).transform.position - val, Vector3.up);
				characterDirection.forward = ((Vector3)(ref val2)).normalized;
				EntityStateMachine outer = ((EntityState)this).outer;
				Special obj = new Special
				{
					target = target,
					arrivalPosition = position,
					isBuffered = holdBuffer
				};
				((BaseSkillState)obj).activatorSkillSlot = ((BaseSkillState)this).activatorSkillSlot;
				outer.SetNextState((EntityState)(object)obj);
			}
		}

		public override void OnExit()
		{
			AimRequest obj = aimRequest;
			if (obj != null)
			{
				obj.Dispose();
			}
			if (NetworkServer.active && hasStartedDash)
			{
				((EntityState)this).characterBody.RemoveBuff(Buffs.HiddenInvincibility);
				((EntityState)this).characterBody.RemoveBuff(UnforgivenBuffs.specialSuspensionBuff);
				if (Object.op_Implicit((Object)(object)victimBody))
				{
					victimBody.RemoveBuff(UnforgivenBuffs.specialSuspensionBuff);
				}
			}
			((EntityState)this).OnExit();
		}

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

		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);
			HurtBoxReference val = NetworkExtensions.ReadHurtBoxReference(reader);
			target = ((HurtBoxReference)(ref val)).ResolveHurtBox();
			holdBuffer = reader.ReadBoolean();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)2;
		}
	}
	public class DashSpin : BaseMeleeAttack
	{
		public bool empoweredSpin;

		public const float airbladeRangeMultiplier = 3f;

		private bool isAirblade;

		private HitBox[] scaledHitBoxes;

		private Vector3[] originalHitBoxScales;

		private bool hasGrantedStacks;

		private bool activateNado;

		private EntityStateMachine dashStateMachine;

		private bool waitingForDash;

		public bool HasPendingSpin => !hasFired;

		public bool IsWaitingForDash => !hasFired && Object.op_Implicit((Object)(object)dashStateMachine) && (dashStateMachine.state is Dash || dashStateMachine.state is DashSpecial || dashStateMachine.HasPendingState());

		public bool TryConfirmAirblade()
		{
			if (hasFired)
			{
				return false;
			}
			isAirblade = true;
			return true;
		}

		public override void OnEnter()
		{
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			RefreshState();
			dashStateMachine = EntityStateMachine.FindByCustomName(((EntityState)this).gameObject, "Dash");
			if (!Object.op_Implicit((Object)(object)dashStateMachine))
			{
				Log.Error("DashSpin could not find the required Dash state machine; the spin cannot wait for a dash.");
			}
			hitboxGroupName = "SteelTempestSpinHitbox";
			damageType = DamageTypeCombo.op_Implicit((DamageType)(empoweredSpecial ? 2 : 0));
			damageSource = (DamageSource)2;
			damageCoefficient = (empoweredSpin ? UnforgivenConfig.tornadoDamageCoefficient.Value : UnforgivenConfig.stabDamageCoefficient.Value);
			procCoefficient = 1f;
			pushForce = 300f;
			bonusForce = (empoweredSpin ? (Vector3.up * 3000f) : Vector3.zero);
			baseDuration = 1.1f;
			attackStartPercentTime = 0f;
			attackEndPercentTime = 0.4f;
			earlyExitPercentTime = 0.5f;
			hitStopDuration = 0.05f;
			attackRecoil = 2f / ((BaseState)this).attackSpeedStat;
			hitHopVelocity = 8f;
			swingSoundString = GroundLight2.slash1Sound;
			hitSoundString = "sfx_unforgiven_stab";
			playbackRateParam = "Slash.playbackRate";
			muzzleString = "SpinMuzzle";
			swingEffectPrefab = (empoweredSpin ? UnforgivenAssets.spinNadoEffect : (empoweredSpecial ? UnforgivenAssets.spinEmpoweredSlashEffect : UnforgivenAssets.spinSlashEffect));
			hitEffectPrefab = UnforgivenAssets.unforgivenHitEffect;
			if (empoweredSpin)
			{
				activateNado = true;
				moddedDamageTypeHolder.Add(DamageTypes.KnockAirborne);
			}
			impactSound = (empoweredSpin ? UnforgivenAssets.nadoImpactSoundEvent.index : UnforgivenAssets.swordImpactSoundEvent.index);
			waitingForDash = IsWaitingForDash;
			base.OnEnter();
			((EntityState)this).characterBody.isSprinting = true;
		}

		protected override void PlayAttackAnimation()
		{
			if (!IsWaitingForDash)
			{
				unforgivenController.Unsheath();
				((EntityState)this).PlayCrossfade("FullBody, Override", "DashSpin", 0.05f);
			}
		}

		protected override void PlaySwingEffect()
		{
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Expected O, but got Unknown
			if (((EntityState)this).isAuthority)
			{
				GameObject effect = ((!isAirblade) ? swingEffectPrefab : (empoweredSpin ? UnforgivenAssets.airbladeNadoEffect : (empoweredSpecial ? UnforgivenAssets.airbladeEmpoweredSlashEffect : UnforgivenAssets.airbladeSlashEffect)));
				EffectManager.SimpleMuzzleFlash(UnforgivenSkinVFX.GetEffect(effect, ((EntityState)this).gameObject), ((EntityState)this).gameObject, muzzleString, true);
				if (isAirblade)
				{
					EffectManager.SpawnEffect(UnforgivenSkinVFX.GetEffect(UnforgivenAssets.windExplosionEffect, ((EntityState)this).gameObject), new EffectData
					{
						origin = ((EntityState)this).characterBody.corePosition,
						rotation = Quaternion.identity,
						networkSoundEventIndex = UnforgivenAssets.airbladeImpactSoundEvent.index
					}, true);
				}
			}
		}

		protected override void FireAttack()
		{
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: 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)
			if (((EntityState)this).isAuthority && isAirblade && originalHitBoxScales == null)
			{
				scaledHitBoxes = attack.hitBoxGroup.hitBoxes;
				originalHitBoxScales = (Vector3[])(object)new Vector3[scaledHitBoxes.Length];
				for (int i = 0; i < scaledHitBoxes.Length; i++)
				{
					originalHitBoxScales[i] = ((Component)scaledHitBoxes[i]).transform.localScale;
					((Component)scaledHitBoxes[i]).transform.localScale = originalHitBoxScales[i] * 3f;
				}
			}
			base.FireAttack();
		}

		public override void OnExit()
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			if (originalHitBoxScales != null)
			{
				for (int i = 0; i < scaledHitBoxes.Length; i++)
				{
					if (Object.op_Implicit((Object)(object)scaledHitBoxes[i]))
					{
						((Component)scaledHitBoxes[i]).transform.localScale = originalHitBoxScales[i];
					}
				}
			}
			base.OnExit();
		}

		public override void FixedUpdate()
		{
			//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)
			((EntityState)this).characterBody.isSprinting = true;
			if (IsWaitingForDash)
			{
				waitingForDash = true;
				return;
			}
			if (waitingForDash)
			{
				waitingForDash = false;
				PlayAttackAnimation();
			}
			hitPauseTimer -= Time.fixedDeltaTime;
			if (hitPauseTimer <= 0f && inHitPause)
			{
				RemoveHitstop();
			}
			if (!inHitPause)
			{
				stopwatch += Time.fixedDeltaTime;
			}
			else
			{
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
				{
					((EntityState)this).characterMotor.velocity = Vector3.zero;
				}
				if (Object.op_Implicit((Object)(object)animator))
				{
					animator.SetFloat(playbackRateParam, 0f);
				}
			}
			bool flag = stopwatch >= duration * attackStartPercentTime;
			bool flag2 = stopwatch >= duration * attackEndPercentTime;
			if ((flag && !flag2) || (flag && flag2 && !hasFired))
			{
				if (!hasFired)
				{
					if (empoweredSpin && NetworkServer.active)
					{
						((EntityState)this).characterBody.ClearTimedBuffs(UnforgivenBuffs.stabMaxStacksBuff);
					}
					EnterAttack();
				}
				FireAttack();
			}
			if (((EntityState)this).isAuthority && stopwatch >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		protected override void OnHitEnemyAuthority()
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			base.OnHitEnemyAuthority();
			if (!hasGrantedStacks)
			{
				hasGrantedStacks = true;
				NetworkIdentity component = ((EntityState)this).gameObject.GetComponent<NetworkIdentity>();
				if (Object.op_Implicit((Object)(object)component))
				{
					NetMessageExtensions.Send((INetMessage)(object)new SyncStacks(component.netId, activateNado), (NetworkDestination)2);
				}
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0023: 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_0026: Unknown result type (might be due to invalid IL or missing references)
			if (stopwatch >= duration * earlyExitPercentTime)
			{
				return (InterruptPriority)0;
			}
			return (InterruptPriority)2;
		}

		public override void OnSerialize(NetworkWriter writer)
		{
			base.OnSerialize(writer);
			writer.Write(empoweredSpin);
			writer.Write(isAirblade);
		}

		public override void OnDeserialize(NetworkReader reader)
		{
			base.OnDeserialize(reader);
			empoweredSpin = reader.ReadBoolean();
			isAirblade = reader.ReadBoolean();
		}
	}
	public class EnterStab : BaseUnforgivenSkillState
	{
		private EntityState savedState;

		private bool hasChosenState;

		private EntityStateMachine dashStateMachine;

		private bool hasLoggedMissingDash;

		public bool HasBufferedSpin => hasChosenState;

		public bool TryConfirmAirblade()
		{
			return savedState is DashSpin dashSpin && dashSpin.TryConfirmAirblade();
		}

		public override void OnEnter()
		{
			RefreshState();
			base.OnEnter();
			dashStateMachine = EntityStateMachine.FindByCustomName(((EntityState)this).gameObject, "Dash");
			if (!Object.op_Implicit((Object)(object)dashStateMachine))
			{
				LogMissingDashStateMachine();
			}
			else if (dashStateMachine.state is Dash)
			{
				BufferSpin();
			}
		}

		public override void FixedUpdate()
		{
			base.FixedUpdate();
			EntityStateMachine val = dashStateMachine;
			if (!Object.op_Implicit((Object)(object)val))
			{
				LogMissingDashStateMachine();
			}
			if (Object.op_Implicit((Object)(object)val) && val.state is Dash && !hasChosenState)
			{
				BufferSpin();
			}
			if (((EntityState)this).isAuthority)
			{
				if (hasChosenState)
				{
					((EntityState)this).outer.SetNextState(savedState);
				}
				else if (empowered)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new Tornado());
				}
				else
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new StabForward());
				}
			}
		}

		private void BufferSpin()
		{
			hasChosenState = true;
			DashSpin obj = new DashSpin
			{
				empoweredSpin = empowered
			};
			((BaseSkillState)obj).activatorSkillSlot = ((BaseSkillState)this).activatorSkillSlot;
			savedState = (EntityState)(object)obj;
		}

		private void LogMissingDashStateMachine()
		{
			if (!hasLoggedMissingDash)
			{
				hasLoggedMissingDash = true;
				Log.Error("EnterStab could not find the required Dash state machine; continuing without waiting for a dash.");
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)2;
		}
	}
	public class MainState : GenericCharacterMain
	{
		private Animator animator;

		public LocalUser localUser;

		public override void OnEnter()
		{
			((GenericCharacterMain)this).OnEnter();
			animator = ((BaseCharacterMain)this).modelAnimator;
			FindLocalUser();
		}

		private void FindLocalUser()
		{
			if (localUser != null || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				return;
			}
			foreach (LocalUser readOnlyLocalUsers in LocalUserManager.readOnlyLocalUsersList)
			{
				if ((Object)(object)readOnlyLocalUsers.cachedBody == (Object)(object)((EntityState)this).characterBody)
				{
					localUser = readOnlyLocalUsers;
					break;
				}
			}
		}

		public override void FixedUpdate()
		{
			((GenericCharacterMain)this).FixedUpdate();
			if (!Object.op_Implicit((Object)(object)animator))
			{
				return;
			}
			bool flag = false;
			if (!((EntityState)this).characterBody.outOfDanger || !((EntityState)this).characterBody.outOfCombat)
			{
				flag = true;
			}
			animator.SetBool("inCombat", flag);
			if (((BaseState)this).isGrounded)
			{
				animator.SetFloat("airBlend", 0f);
			}
			else
			{
				animator.SetFloat("airBlend", 1f);
			}
			if (!flag)
			{
				if (animator.GetBool("isUnsheathed"))
				{
					animator.SetBool("isUnsheathed", false);
					if (((EntityState)this).characterBody.isSprinting)
					{
						EntityState.PlayAnimationOnAnimator(animator, "Transition", "SprintToSafe");
					}
					else if (!((EntityState)this).characterBody.GetNotMoving())
					{
						EntityState.PlayAnimationOnAnimator(animator, "Transition", "RunToSafe");
					}
					else
					{
						EntityState.PlayAnimationOnAnimator(animator, "Transition", "ToSafe");
					}
				}
				animator.SetLayerWeight(animator.GetLayerIndex("Body, Combat"), 0f);
			}
			else if (animator.GetBool("isUnsheathed"))
			{
				animator.SetLayerWeight(animator.GetLayerIndex("Body, Combat"), 1f);
			}
		}

		public override void ProcessJump()
		{
			//IL_0268: Unknown result type (might be due to invalid IL or missing references)
			//IL_026d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0274: Unknown result type (might be due to invalid IL or missing references)
			//IL_0285: Expected O, but got Unknown
			//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d6: Expected O, but got Unknown
			//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0301: Unknown result type (might be due to invalid IL or missing references)
			//IL_0308: Unknown result type (might be due to invalid IL or missing references)
			//IL_030d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0312: Unknown result type (might be due to invalid IL or missing references)
			//IL_031d: Expected O, but got Unknown
			if (!Object.op_Implicit((Object)(object)((EntityState)this).characterBody) || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory) || !((BaseCharacterMain)this).hasCharacterMotor || ((EntityState)this).healthComponent.isInFrozenState)
			{
				return;
			}
			bool flag = false;
			bool flag2 = false;
			if (((EntityState)this).characterBody.inventory.GetItemCountEffective(Items.JumpDamageStrike) > 0)
			{
				((EntityState)this).characterBody.GetBuffCount(Buffs.JumpDamageStrikeCharge);
			}
			if (!base.jumpInputReceived || ((EntityState)this).characterMotor.jumpCount >= ((EntityState)this).characterBody.maxJumpCount)
			{
				return;
			}
			int itemCountEffective = ((EntityState)this).characterBody.inventory.GetItemCountEffective(Items.JumpBoost);
			float num = 1f;
			float num2 = 1f;
			if (((EntityState)this).characterMotor.jumpCount >= ((EntityState)this).characterBody.baseJumpCount)
			{
				flag = true;
				num = 1.5f;
				num2 = 1.5f;
			}
			else if (itemCountEffective > 0 && ((EntityState)this).characterBody.isSprinting)
			{
				float num3 = ((EntityState)this).characterBody.acceleration * ((EntityState)this).characterMotor.airControl;
				if (((EntityState)this).characterBody.moveSpeed > 0f && num3 > 0f)
				{
					flag2 = true;
					float num4 = Mathf.Sqrt(10f * (float)itemCountEffective / num3);
					float num5 = ((EntityState)this).characterBody.moveSpeed / num3;
					num = (num4 + num5) / num5;
				}
			}
			GenericCharacterMain.ApplyJumpVelocity(((EntityState)this).characterMotor, ((EntityState)this).characterBody, num, num2, false);
			if (((BaseCharacterMain)this).hasModelAnimator)
			{
				int layerIndex = ((BaseCharacterMain)this).modelAnimator.GetLayerIndex("Body");
				if (layerIndex >= 0)
				{
					if (((EntityState)this).characterBody.isSprinting)
					{
						((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("SprintJump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex);
					}
					else if (flag)
					{
						((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("BonusJump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex);
					}
					else
					{
						((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("Jump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex);
					}
				}
			}
			if (flag)
			{
				EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/FeatherEffect"), new EffectData
				{
					origin = ((EntityState)this).characterBody.footPosition
				}, true);
			}
			else if (((EntityState)this).characterMotor.jumpCount > 0)
			{
				EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ImpactEffects/CharacterLandImpact"), new EffectData
				{
					origin = ((EntityState)this).characterBody.footPosition,
					scale = ((EntityState)this).characterBody.radius
				}, true);
			}
			if (flag2)
			{
				EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/BoostJumpEffect"), new EffectData
				{
					origin = ((EntityState)this).characterBody.footPosition,
					rotation = Util.QuaternionSafeLookRotation(((EntityState)this).characterMotor.velocity)
				}, true);
			}
			CharacterMotor characterMotor = ((EntityState)this).characterMotor;
			characterMotor.jumpCount++;
			((EntityState)this).characterBody.TriggerJumpEventGlobally();
		}
	}
	public class SlashCombo : BaseMeleeAttack
	{
		protected GameObject swingEffectInstance;

		public override void OnEnter()
		{
			//IL_0020: 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)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			RefreshState();
			hitboxGroupName = "MeleeHitbox";
			damageType = DamageTypeCombo.op_Implicit((DamageType)(empoweredSpecial ? 2 : 0));
			damageSource = (DamageSource)1;
			damageCoefficient = UnforgivenConfig.swingDamageCoefficient.Value;
			procCoefficient = 1f;
			pushForce = 300f;
			bonusForce = Vector3.zero;
			baseDuration = 1.1f;
			attackStartPercentTime = 0.2f;
			attackEndPercentTime = 0.4f;
			earlyExitPercentTime = 0.5f;
			hitStopDuration = 0.05f;
			attackRecoil = 2f / ((BaseState)this).attackSpeedStat;
			hitHopVelocity = 7f;
			swingSoundString = "Play_merc_sword_swing";
			hitSoundString = "";
			playbackRateParam = "Slash.playbackRate";
			swingEffectPrefab = (empoweredSpecial ? UnforgivenAssets.swordSwingEmpoweredEffect : UnforgivenAssets.swordSwingEffect);
			hitEffectPrefab = UnforgivenAssets.unforgivenHitEffect;
			impactSound = UnforgivenAssets.swordImpactSoundEvent.index;
			switch (swingIndex)
			{
			case 0:
				muzzleString = "SwingMuzzle1";
				break;
			case 1:
				muzzleString = "SwingMuzzle2";
				break;
			}
			base.OnEnter();
		}

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

		protected override void FireAttack()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)this).isAuthority)
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				Vector3 direction = ((Ray)(ref aimRay)).direction;
				direction.y = Mathf.Max(direction.y, direction.y * 0.5f);
				((BaseState)this).FindModelChild("MeleePivot").rotation = Util.QuaternionSafeLookRotation(direction);
			}
			base.FireAttack();
		}

		protected override void PlaySwingEffect()
		{
			if (Object.op_Implicit((Object)(object)swingEffectPrefab))
			{
				Transform val = ((BaseState)this).FindModelChild(muzzleString);
				if (Object.op_Implicit((Object)(object)val))
				{
					swingEffectInstance = Object.Instantiate<GameObject>(swingEffectPrefab, val);
				}
			}
		}

		protected override void PlayAttackAnimation()
		{
			RefreshState();
			if (!unforgivenController.isUnsheathed)
			{
				unforgivenController.Unsheath();
				((EntityState)this).PlayCrossfade("Gesture, Override", "DrawSlash", playbackRateParam, duration * 1.3f, 0.05f);
			}
			else
			{
				((EntityState)this).PlayCrossfade("Gesture, Override", "Slash" + (1 + swingIndex), playbackRateParam, duration * 1.3f, 0.05f);
			}
		}

		public override void OnExit()
		{
			base.OnExit();
			if (Object.op_Implicit((Object)(object)swingEffectInstance))
			{
				EntityState.Destroy((Object)(object)swingEffectInstance);
			}
		}
	}
	public class Special : BaseUnforgivenSkillState
	{
		public static float damageCoefficient = 2.5f;

		public static float finalDamageCoefficient = 8f;

		public static float procCoefficient = 1f;

		public bool crit;

		public bool isBuffered;

		public HurtBox target;

		public Vector3 arrivalPosition;

		private Vector3 attackPosition;

		private float maxRange = 12f;

		private float roundDuration = 0.3f;

		private float roundStopwatch;

		private int numRounds = 3;

		private int roundsCompleted = 0;

		private readonly HashSet<CharacterBody> suspendedTargets = new HashSet<CharacterBody>();

		protected GameObject swingEffectInstance;

		private GameObject swingEffectPrefab = UnforgivenAssets.swordSwingEffect;

		private GameObject swingEffectPrefab2 = UnforgivenAssets.swordSwingEmpoweredEffect;

		private GameObject slashEffectPrefab = UnforgivenAssets.specialSlashingEffect;

		private GameObject slashEffectPrefab2 = UnforgivenAssets.specialEmpoweredSlashingEffect;

		private AimRequest aimRequest;

		public override void OnEnter()
		{
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			base.OnEnter();
			swingEffectPrefab = UnforgivenSkinVFX.GetEffect(swingEffectPrefab, ((EntityState)this).gameObject);
			swingEffectPrefab2 = UnforgivenSkinVFX.GetEffect(swingEffectPrefab2, ((EntityState)this).gameObject);
			slashEffectPrefab = UnforgivenSkinVFX.GetEffect(slashEffectPrefab, ((EntityState)this).gameObject);
			slashEffectPrefab2 = UnforgivenSkinVFX.GetEffect(slashEffectPrefab2, ((EntityState)this).gameObject);
			if (!((EntityState)this).isAuthority)
			{
				TeleportHelper.OnTeleport(((EntityState)this).gameObject, arrivalPosition, arrivalPosition - ((EntityState)this).transform.position);
			}
			((EntityState)this).characterBody.modelLocator.LateUpdate();
			attackPosition = (Object.op_Implicit((Object)(object)target) ? ((Component)target).transform.position : ((EntityState)this).characterBody.corePosition);
			if (isBuffered)
			{
				bool flag = unforgivenController.TryConfirmAirblade();
				if (((EntityState)this).isAuthority)
				{
					isBuffered = flag;
				}
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams))
			{
				aimRequest = ((EntityState)this).cameraTargetParams.RequestAimType((AimType)2);
			}
			((EntityState)this).characterBody.isSprinting = true;
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddBuff(Buffs.HiddenInvincibility);
				((EntityState)this).characterBody.AddBuff(UnforgivenBuffs.lastBreathBuff);
				((EntityState)this).characterBody.AddBuff(UnforgivenBuffs.specialSuspensionBuff);
				if (Object.op_Implicit((Object)(object)target) && Object.op_Implicit((Object)(object)target.healthComponent))
				{
					HoldTarget(target.healthComponent.body);
				}
			}
			RefreshState();
			((EntityState)this).characterBody.SetAimTimer(1.5f);
			roundsCompleted = 0;
			float num = (((BaseState)this).attackSpeedStat - 1f) * 0.5f;
			roundDuration /= num + 1f;
			roundStopwatch = roundDuration;
			crit = ((BaseState)this).RollCrit();
			unforgivenController.Unsheath();
			if (!isBuffered)
			{
				((EntityState)this).PlayCrossfade("FullBody, Override", "Special", "Slash.playbackRate", (float)numRounds * roundDuration, (float)numRounds * roundDuration * 0.05f);
			}
			Transform modelTransform = ((EntityState)this).characterBody.modelLocator.modelTransform;
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				Animator component = ((Component)modelTransform).GetComponent<Animator>();
				TemporaryOverlayInstance val = TemporaryOverlayManager.AddOverlay(((EntityState)this).gameObject);
				val.duration = 1.2f;
				val.destroyComponentOnEnd = true;
				val.originalMaterial = (UnforgivenSkinVFX.IsMonsoon(((EntityState)this).gameObject) ? UnforgivenSkinVFX.specialMaterial : UnforgivenAssets.specialMaterial);
				val.inspectorCharacterModel = ((Component)component).gameObject.GetComponent<CharacterModel>();
				val.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
				val.animateShaderAlpha = true;
			}
		}

		public override void OnExit()
		{
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.RemoveBuff(Buffs.HiddenInvincibility);
				((EntityState)this).characterBody.RemoveBuff(UnforgivenBuffs.specialSuspensionBuff);
				ReleaseTargets();
				((EntityState)this).characterBody.RemoveBuff(UnforgivenBuffs.lastBreathBuff);
				((EntityState)this).characterBody.AddTimedBuff(UnforgivenBuffs.lastBreathBuff, 6f);
			}
			((EntityState)this).OnExit();
			AimRequest obj = aimRequest;
			if (obj != null)
			{
				obj.Dispose();
			}
			if (Object.op_Implicit((Object)(object)swingEffectInstance))
			{
				EntityState.Destroy((Object)(object)swingEffectInstance);
			}
			isBuffered = false;
		}

		private void Fire()
		{
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Expected O, but got Unknown
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ec: 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)
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_0206: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ea: Expected O, but got Unknown
			bool flag = roundsCompleted == numRounds - 1;
			float num = (flag ? finalDamageCoefficient : damageCoefficient);
			Util.PlaySound(flag ? GroundLight2.slash3Sound : GroundLight2.slash1Sound, ((EntityState)this).gameObject);
			bool flag2 = (Object)(object)((EntityState)this).skillLocator.special.skillDef == (Object)(object)UnforgivenSurvivor.firstBreath;
			if (((EntityState)this).isAuthority && flag2 && ((EntityState)this).skillLocator.secondary.stock != ((EntityState)this).skillLocator.secondary.maxStock)
			{
				((EntityState)this).skillLocator.secondary.Reset();
			}
			if (NetworkServer.active)
			{
				if (Object.op_Implicit((Object)(object)target))
				{
					attackPosition = ((Component)target).transform.position;
				}
				if (flag)
				{
					ReleaseTargets();
				}
				BlastAttack val = new BlastAttack
				{
					attacker = ((EntityState)this).gameObject,
					procChainMask = default(ProcChainMask),
					losType = (LoSType)1,
					damageColorIndex = (DamageColorIndex)0,
					damageType = DamageTypeCombo.op_Implicit((DamageType)(0x20 | (empoweredSpecial ? 2 : 0))),
					procCoefficient = procCoefficient,
					bonusForce = (flag ? (Vector3.down * 3000f) : Vector3.zero),
					baseForce = 0f,
					baseDamage = num * ((BaseState)this).damageStat,
					falloffModel = (FalloffModel)0,
					radius = maxRange,
					position = attackPosition,
					attackerFiltering = (AttackerFiltering)2,
					teamIndex = ((BaseState)this).GetTeam(),
					inflictor = ((EntityState)this).gameObject,
					crit = crit
				};
				val.damageType.damageSource = (DamageSource)8;
				if (flag2)
				{
					DamageAPI.AddModdedDamageType(val, DamageTypes.ResetDashes);
				}
				Result val2 = val.Fire();
				HitPoint[] hitPoints = val2.hitPoints;
				foreach (HitPoint val3 in hitPoints)
				{
					CharacterBody val4 = ((Object.op_Implicit((Object)(object)val3.hurtBox) && Object.op_Implicit((Object)(object)val3.hurtBox.healthComponent)) ? val3.hurtBox.healthComponent.body : null);
					if (Object.op_Implicit((Object)(object)val4) && val4.healthComponent.alive)
					{
						if (flag)
						{
							val4.AddTimedBuff(UnforgivenBuffs.specialSlamTrackerBuff, 2f, 1);
						}
						else
						{
							HoldTarget(val4);
						}
					}
				}
				if (Object.op_Implicit((Object)(object)slashEffectPrefab) && Object.op_Implicit((Object)(object)slashEffectPrefab2))
				{
					EffectManager.SpawnEffect(flag ? slashEffectPrefab2 : slashEffectPrefab, new EffectData
					{
						origin = attackPosition
					}, true);
				}
			}
			Transform val5 = ((roundsCompleted % 2 == 0) ? ((BaseState)this).FindModelChild("SwingMuzzle2") : ((BaseState)this).FindModelChild("SwingMuzzle1"));
			if (Object.op_Implicit((Object)(object)val5) && Object.op_Implicit((Object)(object)swingEffectPrefab2) && Object.op_Implicit((Object)(object)swingEffectPrefab))
			{
				if (Object.op_Implicit((Object)(object)swingEffectInstance))
				{
					EntityState.Destroy((Object)(object)swingEffectInstance);
				}
				swingEffectInstance = Object.Instantiate<GameObject>(flag ? swingEffectPrefab2 : swingEffectPrefab, val5);
			}
			Util.PlayAttackSpeedSound(flag ? GroundLight2.slash3Sound : GroundLight2.slash1Sound, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat);
		}

		private void HoldTarget(CharacterBody body)
		{
			if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.healthComponent) && body.healthComponent.alive && suspendedTargets.Add(body))
			{
				body.AddBuff(UnforgivenBuffs.specialSuspensionBuff);
			}
		}

		private void ReleaseTargets()
		{
			foreach (CharacterBody suspendedTarget in suspendedTargets)
			{
				if (Object.op_Implicit((Object)(object)suspendedTarget))
				{
					suspendedTarget.RemoveBuff(UnforgivenBuffs.specialSuspensionBuff);
				}
			}
			suspendedTargets.Clear();
		}

		public override void FixedUpdate()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			base.FixedUpdate();
			((EntityState)this).characterBody.isSprinting = true;
			((EntityState)this).characterMotor.velocity = Vector3.zero;
			roundStopwatch += Time.fixedDeltaTime;
			if (roundStopwatch >= roundDuration && roundsCompleted < numRounds)
			{
				Fire();
				roundsCompleted++;
				roundStopwatch = 0f;
			}
			if (roundsCompleted >= numRounds && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnSerialize(NetworkWriter writer)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			((BaseSkillState)this).OnSerialize(writer);
			writer.Write(isBuffered);
			NetworkExtensions.Write(writer, HurtBoxReference.FromHurtBox(target));
			writer.Write(arrivalPosition);
		}

		public override void OnDeserialize(NetworkReader reader)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			((BaseSkillState)this).OnDeserialize(reader);
			isBuffered = reader.ReadBoolean();
			HurtBoxReference val = NetworkExtensions.ReadHurtBoxReference(reader);
			target = ((HurtBoxReference)(ref val)).ResolveHurtBox();
			arrivalPosition = reader.ReadVector3();
		}

		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;
		}
	}
	public class StabForward : BaseMeleeAttack
	{
		private bool hasGrantedStacks;

		protected GameObject swingEffectInstance;

		public override void OnEnter()
		{
			//IL_0020: 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)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			RefreshState();
			hitboxGroupName = "SteelTempestHitbox";
			damageType = DamageTypeCombo.op_Implicit((DamageType)(empoweredSpecial ? 2 : 0));
			damageSource = (DamageSource)2;
			damageCoefficient = UnforgivenConfig.stabDamageCoefficient.Value;
			procCoefficient = 1f;
			pushForce = 300f;
			bonusForce = Vector3.zero;
			baseDuration = 1.1f;
			attackStartPercentTime = 0.2f;
			attackEndPercentTime = 0.4f;
			earlyExitPercentTime = 0.5f;
			hitStopDuration = 0.05f;
			attackRecoil = 2f / ((BaseState)this).attackSpeedStat;
			hitHopVelocity = 6f;
			swingSoundString = "sfx_unforgiven_stab";
			hitSoundString = "";
			playbackRateParam = "Slash.playbackRate";
			swingEffectPrefab = UnforgivenAssets.stabSwingEffect;
			hitEffectPrefab = UnforgivenAssets.unforgivenHitEffect;
			impactSound = UnforgivenAssets.stabImpactSoundEvent.index;
			muzzleString = "StabMuzzle";
			base.OnEnter();
		}

		protected override void OnHitEnemyAuthority()
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			base.OnHitEnemyAuthority();
			if (!hasGrantedStacks)
			{
				hasGrantedStacks = true;
				NetworkIdentity component = ((EntityState)this).gameObject.GetComponent<NetworkIdentity>();
				if (Object.op_Implicit((Object)(object)component))
				{
					NetMessageExtensions.Send((INetMessage)(object)new SyncStacks(component.netId, empowered), (NetworkDestination)2);
				}
			}
		}

		protected override void FireAttack()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)this).isAuthority)
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				Vector3 direction = ((Ray)(ref aimRay)).direction;
				direction.y = Mathf.Max(direction.y, direction.y * 0.5f);
				((BaseState)this).FindModelChild("MeleePivot").rotation = Util.QuaternionSafeLookRotation(direction);
			}
			base.FireAttack();
		}

		public override void