Decompiled source of Wanderer v0.5.4

plugins/UnforgivenMod.dll

Decompiled 18 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EmotesAPI;
using EntityStates;
using EntityStates.AI.Walker;
using EntityStates.Merc.Weapon;
using HG;
using HG.BlendableTypes;
using JetBrains.Annotations;
using KinematicCharacterController;
using On.RoR2;
using On.RoR2.UI;
using R2API;
using R2API.Networking;
using R2API.Networking.Interfaces;
using R2API.Utils;
using Rewired.ComponentControls.Effects;
using RoR2;
using RoR2.Achievements;
using RoR2.Audio;
using RoR2.CharacterAI;
using RoR2.ContentManagement;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
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.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("UnforgivenMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+c15b2e1fff4eb80fb18e52fbcc9bd0edcfb4531b")]
[assembly: AssemblyProduct("UnforgivenMod")]
[assembly: AssemblyTitle("UnforgivenMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
internal enum UnforgivenCameraParams
{
	DEFAULT,
	AIM_PISTOL,
	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.*/)]
	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;

		public static bool emotesInstalled => Chainloader.PluginInfos.ContainsKey("com.weliveinasociety.CustomEmotesAPI");

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

		private void Awake()
		{
			instance = this;
			NetworkingAPI.RegisterMessageType<SyncWindExplosion>();
			NetworkingAPI.RegisterMessageType<SyncStacks>();
			NetworkingAPI.RegisterMessageType<SyncIcon>();
			Log.Init(((BaseUnityPlugin)this).Logger);
			Language.Init();
			new UnforgivenSurvivor().Initialize();
			new ContentPacks().Initialize();
		}

		private void Start()
		{
			SoundBanks.Init();
		}
	}
}
namespace UnforgivenMod.Unforgiven
{
	public class UnforgivenSurvivor : SurvivorBase<UnforgivenSurvivor>
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_Init <>9__61_0;

			internal void <Emotes>b__61_0(orig_Init orig)
			{
				orig.Invoke();
				GameObject val = UnforgivenAssets.mainAssetBundle.LoadAsset<GameObject>("unforgiven_emoteskeleton");
				CustomEmotesAPI.ImportArmature(characterPrefab, val, 0, true);
			}
		}

		public const string UNFORGIVEN_PREFIX = "KENKO_UNFORGIVEN_";

		internal static GameObject characterPrefab;

		public static SkillDef scepterDef;

		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 = Assets.LoadCrosshair("Standard"),
			podPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/SurvivorPod"),
			maxHealth = 110f,
			healthRegen = 1.5f,
			armor = 0f,
			damage = 12f,
			jumpCount = 1
		};

		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();
			UnforgivenAssets.Init(assetBundle);
			UnforgivenBuffs.Init(assetBundle);
			InitializeEntityStateMachines();
			InitializeSkills();
			InitializeSkins();
			InitializeCharacterMaster();
			AdditionalBodySetup();
			characterPrefab = bodyPrefab;
			AddHooks();
		}

		private void AdditionalBodySetup()
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Expected O, but got Unknown
			//IL_004d: Expected O, but got Unknown
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Expected O, but got Unknown
			//IL_0075: Expected O, but got Unknown
			//IL_0082: 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_009d: Expected O, but got Unknown
			//IL_009d: Expected O, but got Unknown
			AddHitboxes();
			bodyPrefab.AddComponent<UnforgivenController>();
			bodyPrefab.AddComponent<UnforgivenTracker>();
			TempVisualEffectAPI.AddTemporaryVisualEffect(UnforgivenAssets.shieldEffect, new EffectRadius(pee), new EffectCondition(tempAddShield), "");
			TempVisualEffectAPI.AddTemporaryVisualEffect(UnforgivenAssets.dashCdEffect, new EffectRadius(pee2), new EffectCondition(tempAdd), "");
			TempVisualEffectAPI.AddTemporaryVisualEffect(UnforgivenAssets.nadoUpEffect, new EffectRadius(pee3), new EffectCondition(tempNadoUp), "");
			static float pee(CharacterBody body)
			{
				return body.radius * 1.5f;
			}
			static float pee2(CharacterBody body)
			{
				return body.radius;
			}
			static float pee3(CharacterBody body)
			{
				return body.radius * 5f;
			}
			static bool tempAdd(CharacterBody body)
			{
				return body.HasBuff(UnforgivenBuffs.dashCooldownBuff);
			}
			static bool tempAddShield(CharacterBody body)
			{
				return body.HasBuff(UnforgivenBuffs.hasShieldBuff);
			}
			static bool tempNadoUp(CharacterBody body)
			{
				return body.HasBuff(UnforgivenBuffs.stabMaxStacksBuff);
			}
		}

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

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

		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,
				Tokens.unforgivenSwiftKeyword
			};
			skillDefInfo.skillIcon = assetBundle.LoadAsset<Sprite>("texSecondaryIcon");
			skillDefInfo.activationState = new SerializableEntityStateType(typeof(EnterStab));
			skillDefInfo.activationStateMachineName = "Weapon2";
			skillDefInfo.interruptPriority = (InterruptPriority)1;
			skillDefInfo.baseMaxStock = 1;
			skillDefInfo.baseRechargeInterval = 4f;
			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<ScaleCDwAttackSpeed>(skillDefInfo);
			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 = "Body";
			skillDefInfo.interruptPriority = (InterruptPriority)1;
			skillDefInfo.baseRechargeInterval = 0.1f;
			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 = "Body";
			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 = true;
			skillDefInfo.cancelSprintingOnActivation = true;
			skillDefInfo.forceSprintDuringState = false;
			SkillDef val = (SkillDef)(object)Skills.CreateSkillDef<UnforgivenSpecialTrackerSkillDef>(skillDefInfo);
			Skills.AddSpecialSkills(bodyPrefab, val);
		}

		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);
			val.skins = list.ToArray();
		}

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

		private void AddHooks()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			HUD.onHudTargetChangedGlobal += HUDSetup;
			LoadoutPanelController.Rebuild += new hook_Rebuild(LoadoutPanelController_Rebuild);
			CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats);
			HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage);
			GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal;
			if (UnforgivenPlugin.emotesInstalled)
			{
				Emotes();
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private static void Emotes()
		{
			//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_0020: Expected O, but got Unknown
			object obj = <>c.<>9__61_0;
			if (obj == null)
			{
				hook_Init val = delegate(orig_Init orig)
				{
					orig.Invoke();
					GameObject val2 = UnforgivenAssets.mainAssetBundle.LoadAsset<GameObject>("unforgiven_emoteskeleton");
					CustomEmotesAPI.ImportArmature(characterPrefab, val2, 0, true);
				};
				<>c.<>9__61_0 = val;
				obj = (object)val;
			}
			SurvivorCatalog.Init += (hook_Init)obj;
		}

		private static void GlobalEventManager_onCharacterDeathGlobal(DamageReport damageReport)
		{
			//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.baseNameToken == "KENKO_UNFORGIVEN_NAME" && 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), (NetworkDestination)1);
			}
		}

		private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
		{
			if ((NetworkServer.active && self.alive) || !self.godMode || self.ospTimer <= 0f)
			{
				CharacterBody body = self.body;
				UnforgivenController unforgivenController = default(UnforgivenController);
				if (Object.op_Implicit((Object)(object)body) && body.baseNameToken == "KENKO_UNFORGIVEN_NAME" && !damageInfo.rejected && ((Component)body).TryGetComponent<UnforgivenController>(ref unforgivenController) && unforgivenController.shieldAmount == 100f)
				{
					body.healthComponent.AddBarrier(body.healthComponent.fullCombinedHealth * 0.25f);
					unforgivenController.shieldAmount = 0f;
					body.RemoveBuff(UnforgivenBuffs.hasShieldBuff);
					Util.PlaySound("sfx_unforgiven_nado_impact", ((Component)body).gameObject);
					Util.PlaySound("sfx_unforgiven_lost_stacks", ((Component)body).gameObject);
				}
			}
			orig.Invoke(self, damageInfo);
		}

		private static void LoadoutPanelController_Rebuild(orig_Rebuild orig, LoadoutPanelController self)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (self.currentDisplayData.bodyIndex != BodyCatalog.FindBodyIndex("UnforgivenBody"))
			{
				return;
			}
			LanguageTextMeshController[] componentsInChildren = ((Component)self).gameObject.GetComponentsInChildren<LanguageTextMeshController>();
			foreach (LanguageTextMeshController val in componentsInChildren)
			{
				if (Object.op_Implicit((Object)(object)val) && val.token == "LOADOUT_SKILL_MISC")
				{
					val.token = "Passive";
				}
			}
		}

		private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self) && self.baseNameToken == "KENKO_UNFORGIVEN_NAME")
			{
				self.crit *= 1.5f;
				self.critMultiplier *= 0.9f;
			}
		}

		private static void HUDSetup(HUD hud)
		{
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_0227: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0255: Unknown result type (might be due to invalid IL or missing references)
			//IL_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0288: Unknown result type (might be due to invalid IL or missing references)
			//IL_030b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0322: Unknown result type (might be due to invalid IL or missing references)
			//IL_0339: Unknown result type (might be due to invalid IL or missing references)
			//IL_0350: Unknown result type (might be due to invalid IL or missing references)
			//IL_0367: Unknown result type (might be due to invalid IL or missing references)
			//IL_0383: Unknown result type (might be due to invalid IL or missing references)
			//IL_039f: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a4: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)hud.targetBodyObject) && Object.op_Implicit((Object)(object)hud.targetMaster) && (Object)(object)hud.targetMaster.bodyPrefab == (Object)(object)characterPrefab && ((NetworkBehaviour)hud.targetMaster).hasAuthority)
			{
				Transform parent = ((Component)hud.equipmentIcons[0]).gameObject.transform.parent;
				Transform val = ((Component)hud).transform.Find("MainContainer").Find("MainUIArea").Find("SpringCanvas")
					.Find("BottomLeftCluster")
					.Find("BarRoots")
					.Find("LevelDisplayCluster");
				GameObject val2 = Object.Instantiate<GameObject>(((Component)val).gameObject, ((Component)hud).transform.Find("MainContainer").Find("MainUIArea").Find("SpringCanvas")
					.Find("BottomLeftCluster"));
				((Object)val2).name = "ShieldTracker";
				val2.transform.SetParent(((Component)hud).transform.Find("MainContainer").Find("MainUIArea").Find("CrosshairCanvas")
					.Find("CrosshairExtras"));
				Object.DestroyImmediate((Object)(object)((Component)val2.transform.GetChild(0)).gameObject);
				Object.Destroy((Object)(object)val2.GetComponentInChildren<LevelText>());
				Object.Destroy((Object)(object)val2.GetComponentInChildren<ExpBar>());
				((Component)val2.transform.Find("LevelDisplayRoot").Find("ValueText")).gameObject.SetActive(false);
				Object.DestroyImmediate((Object)(object)((Component)val2.transform.Find("ExpBarRoot")).gameObject);
				((Component)val2.transform.Find("LevelDisplayRoot")).GetComponent<RectTransform>().anchoredPosition = new Vector2(-12f, 0f);
				RectTransform component = val2.GetComponent<RectTransform>();
				((Transform)component).localScale = new Vector3(0.8f, 0.8f, 1f);
				component.anchorMin = new Vector2(0f, 0f);
				component.anchorMax = new Vector2(0f, 0f);
				component.offsetMin = new Vector2(120f, -40f);
				component.offsetMax = new Vector2(120f, -40f);
				component.pivot = new Vector2(0.5f, 0f);
				component.anchoredPosition = new Vector2(50f, 0f);
				((Transform)component).localPosition = new Vector3(120f, -40f, 0f);
				GameObject val3 = Object.Instantiate<GameObject>(UnforgivenAssets.mainAssetBundle.LoadAsset<GameObject>("WeaponChargeBar"));
				((Object)val3).name = "WindShieldMeter";
				val3.transform.SetParent(((Component)hud).transform.Find("MainContainer").Find("MainUIArea").Find("CrosshairCanvas")
					.Find("CrosshairExtras"));
				component = val3.GetComponent<RectTransform>();
				((Transform)component).localScale = new Vector3(0.75f, 0.1f, 1f);
				component.anchorMin = new Vector2(100f, 2f);
				component.anchorMax = new Vector2(100f, 2f);
				component.pivot = new Vector2(0.5f, 0f);
				component.anchoredPosition = new Vector2(100f, 2f);
				((Transform)component).localPosition = new Vector3(100f, 2f, 0f);
				((Transform)component).rotation = Quaternion.Euler(new Vector3(0f, 0f, 90f));
				PassiveShieldHudController passiveShieldHudController = val2.AddComponent<PassiveShieldHudController>();
				passiveShieldHudController.targetHUD = hud;
				passiveShieldHudController.targetText = ((Component)val2.transform.Find("LevelDisplayRoot").Find("PrefixText")).gameObject.GetComponent<LanguageTextMeshController>();
				passiveShieldHudController.durationDisplay = val3;
				passiveShieldHudController.durationBar = ((Component)val3.transform.GetChild(1)).gameObject.GetComponent<Image>();
				passiveShieldHudController.durationBarColor = ((Component)val3.transform.GetChild(0)).gameObject.GetComponent<Image>();
			}
		}
	}
}
namespace UnforgivenMod.Unforgiven.SkillStates
{
	public class Dash : BaseUnforgivenSkillState
	{
		public int targetIndex = 0;

		public CharacterBody target;

		private Transform modelTransform;

		private UnforgivenTracker tracker;

		private HurtBoxGroup hurtboxGroup;

		private OverlapAttack overlapAttack;

		private Vector3 direction;

		private float distance;

		private float duration;

		private float speed;

		private bool hasFired;

		private float stopwatch;

		private float damageCoefficient = UnforgivenStaticValues.dashDamageCoefficient;

		public static float hitRange = 4.5f;

		private float baseDuration = 0.1f;

		public static float baseExtraDuration = 0.1f;

		private float extraDuration;

		private float minDistance = 7f;

		public static float extraDistance = 5f;

		public static float baseChainPrepDuration = 0.067f;

		public static float basePrepDuration = 0.067f;

		private float prepDuration;

		private float prepStopwatch;

		private bool bufferedSecondary;

		public override void OnEnter()
		{
			//IL_0030: 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_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: 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_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			RefreshState();
			base.OnEnter();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && NetworkServer.active)
			{
				CharacterBody characterBody = ((EntityState)this).characterBody;
				characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags | 1);
				damageCoefficient = UnforgivenStaticValues.dashDamageCoefficient + (float)((EntityState)this).characterBody.GetBuffCount(UnforgivenBuffs.stackingDashDamageBuff) * UnforgivenStaticValues.dashStackingDamageCoefficient;
			}
			tracker = ((EntityState)this).GetComponent<UnforgivenTracker>();
			if (Object.op_Implicit((Object)(object)tracker))
			{
				HurtBox trackingTarget = tracker.GetTrackingTarget();
				if (Object.op_Implicit((Object)(object)trackingTarget) && Object.op_Implicit((Object)(object)trackingTarget.healthComponent) && Object.op_Implicit((Object)(object)trackingTarget.healthComponent.body))
				{
					target = tracker.GetTrackingTarget().healthComponent.body;
				}
			}
			if (!Object.op_Implicit((Object)(object)target))
			{
				((EntityState)this).outer.SetNextStateToMain();
				((BaseSkillState)this).activatorSkillSlot.AddOneStock();
				return;
			}
			if (NetworkServer.active)
			{
				target.AddTimedBuff(UnforgivenBuffs.dashCooldownBuff, 6f);
			}
			((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground();
			Vector3 corePosition = Util.GetCorePosition(target);
			float num = minDistance;
			Vector3 val = ((EntityState)this).transform.position - corePosition;
			distance = Mathf.Max(num, ((Vector3)(ref val)).magnitude);
			val = corePosition - ((EntityState)this).transform.position;
			direction = ((Vector3)(ref val)).normalized;
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			extraDuration = baseExtraDuration / ((BaseState)this).attackSpeedStat;
			speed = distance / duration;
			prepDuration = baseChainPrepDuration / ((BaseState)this).attackSpeedStat;
			modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				hurtboxGroup = ((Component)modelTransform).GetComponent<HurtBoxGroup>();
			}
			if (Object.op_Implicit((Object)(object)hurtboxGroup))
			{
				HurtBoxGroup val2 = hurtboxGroup;
				int hurtBoxesDeactivatorCounter = val2.hurtBoxesDeactivatorCounter + 1;
				val2.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter;
			}
			((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);
		}

		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_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: 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;
			if (Object.op_Implicit((Object)(object)hurtboxGroup))
			{
				HurtBoxGroup val = hurtboxGroup;
				int hurtBoxesDeactivatorCounter = val.hurtBoxesDeactivatorCounter - 1;
				val.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter;
			}
			if (NetworkServer.active)
			{
				CharacterBody characterBody = ((EntityState)this).characterBody;
				characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags & -2);
				int num = ((EntityState)this).characterBody.GetBuffCount(UnforgivenBuffs.stackingDashDamageBuff);
				if (num == 4)
				{
					num = 3;
				}
				((EntityState)this).characterBody.ClearTimedBuffs(UnforgivenBuffs.stackingDashDamageBuff);
				for (int i = 0; i < num + 1; i++)
				{
					((EntityState)this).characterBody.AddTimedBuff(UnforgivenBuffs.stackingDashDamageBuff, 6f, 4);
				}
			}
			((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_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Expected O, but got Unknown
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: 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_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0136: Expected O, but got Unknown
			if (!hasFired)
			{
				hasFired = true;
				if (NetworkServer.active)
				{
					DamageInfo val = new DamageInfo
					{
						position = target.transform.position,
						attacker = ((EntityState)this).gameObject,
						inflictor = ((EntityState)this).gameObject,
						damage = damageCoefficient * ((BaseState)this).damageStat,
						damageColorIndex = (DamageColorIndex)0,
						damageType = (DamageType)(empoweredSpecial ? 2 : 0),
						crit = ((BaseState)this).RollCrit(),
						force = Vector3.zero,
						procChainMask = default(ProcChainMask),
						procCoefficient = 1f
					};
					target.healthComponent.TakeDamage(val);
					GlobalEventManager.instance.OnHitEnemy(val, ((Component)target).gameObject);
					GlobalEventManager.instance.OnHitAll(val, ((Component)target).gameObject);
					EffectManager.SpawnEffect(UnforgivenAssets.unforgivenHitEffect, new EffectData
					{
						origin = target.transform.position,
						rotation = Quaternion.identity,
						networkSoundEventIndex = UnforgivenAssets.swordImpactSoundEvent.index
					}, true);
				}
			}
		}

		public override void FixedUpdate()
		{
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			base.FixedUpdate();
			if (((EntityState)this).inputBank.skill2.wasDown || ((EntityState)this).inputBank.skill2.down)
			{
				bufferedSecondary = true;
			}
			if (((BaseState)this).isGrounded)
			{
				((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground();
			}
			if (prepStopwatch >= prepDuration)
			{
				stopwatch += Time.fixedDeltaTime;
				if (stopwatch >= 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)target))
				{
					Fire();
				}
				if (((EntityState)this).isAuthority && stopwatch >= duration && ((EntityState)this).skillLocator.secondary.CanExecute() && bufferedSecondary)
				{
					((EntityState)this).skillLocator.secondary.ExecuteIfReady();
				}
				if (((EntityState)this).isAuthority && stopwatch >= duration + baseExtraDuration)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}
			else
			{
				prepStopwatch += Time.fixedDeltaTime;
			}
		}

		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 DashSpecial : BaseUnforgivenSkillState
	{
		public int targetIndex = 0;

		public CharacterBody target;

		private Transform modelTransform;

		private HurtBoxGroup hurtboxGroup;

		private Vector3 lastKnownPosition;

		private Vector3 direction;

		private float distance;

		private float duration;

		private float speed;

		private float stopwatch;

		public static float stopTrackTime = 0.8f;

		private float baseDuration = 0.1f;

		public float extraDuration;

		public static float extraDistance = 3.25f;

		public static float exitExtraDistance = 3.25f;

		public static float baseChainPrepDuration = 0.067f;

		public static float basePrepDuration = 0.067f;

		private float prepDuration;

		private float prepStopwatch;

		private bool bufferedSecondary = false;

		public override void OnEnter()
		{
			//IL_0047: 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_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: 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_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: 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_0096: 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_00b1: 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_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_0251: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			//IL_025c: Unknown result type (might be due to invalid IL or missing references)
			//IL_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0271: Unknown result type (might be due to invalid IL or missing references)
			//IL_0443: Unknown result type (might be due to invalid IL or missing references)
			//IL_0453: Unknown result type (might be due to invalid IL or missing references)
			//IL_0458: Unknown result type (might be due to invalid IL or missing references)
			//IL_045d: Unknown result type (might be due to invalid IL or missing references)
			//IL_047d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0488: Unknown result type (might be due to invalid IL or missing references)
			//IL_048d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0492: Unknown result type (might be due to invalid IL or missing references)
			//IL_0496: Unknown result type (might be due to invalid IL or missing references)
			//IL_049b: Unknown result type (might be due to invalid IL or missing references)
			//IL_041f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0425: Unknown result type (might be due to invalid IL or missing references)
			//IL_0426: Unknown result type (might be due to invalid IL or missing references)
			RefreshState();
			base.OnEnter();
			RaycastHit val = default(RaycastHit);
			Vector3 val2;
			if (((EntityState)this).inputBank.GetAimRaycast(60f, ref val))
			{
				val2 = Vector3.MoveTowards(((RaycastHit)(ref val)).point, ((EntityState)this).transform.position, 5f);
			}
			else
			{
				Ray aimRay = ((EntityState)this).inputBank.GetAimRay();
				val2 = Vector3.MoveTowards(((Ray)(ref aimRay)).GetPoint(60f), ((EntityState)this).transform.position, 5f);
			}
			Vector3 origin = val2;
			origin.y += 2.5f;
			HurtBox[] hurtBoxes = new SphereSearch
			{
				origin = origin,
				radius = 30f,
				mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask
			}.RefreshCandidates().FilterCandidatesByHurtBoxTeam(TeamMask.GetEnemyTeams(((EntityState)this).teamComponent.teamIndex)).OrderCandidatesByDistance()
				.FilterCandidatesByDistinctHurtBoxEntities()
				.GetHurtBoxes();
			if (hurtBoxes.Length != 0)
			{
				HurtBox[] array = hurtBoxes;
				foreach (HurtBox val3 in array)
				{
					if (Object.op_Implicit((Object)(object)val3) && Object.op_Implicit((Object)(object)val3.healthComponent) && Object.op_Implicit((Object)(object)val3.healthComponent.body) && Object.op_Implicit((Object)(object)val3.healthComponent.body.characterMotor))
					{
						if (val3.healthComponent.body.HasBuff(UnforgivenBuffs.airborneBuff) || !val3.healthComponent.body.characterMotor.isGrounded || val3.healthComponent.body.characterMotor.isFlying)
						{
							target = val3.healthComponent.body;
							break;
						}
					}
					else if (Object.op_Implicit((Object)(object)val3) && Object.op_Implicit((Object)(object)val3.healthComponent) && Object.op_Implicit((Object)(object)val3.healthComponent.body) && !Object.op_Implicit((Object)(object)val3.healthComponent.body.characterMotor))
					{
						target = val3.healthComponent.body;
						break;
					}
				}
			}
			if (!Object.op_Implicit((Object)(object)target))
			{
				HurtBox[] hurtBoxes2 = new SphereSearch
				{
					origin = ((EntityState)this).transform.position,
					radius = 60f,
					mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask
				}.RefreshCandidates().FilterCandidatesByHurtBoxTeam(TeamMask.GetEnemyTeams(((EntityState)this).teamComponent.teamIndex)).OrderCandidatesByDistance()
					.FilterCandidatesByDistinctHurtBoxEntities()
					.GetHurtBoxes();
				HurtBox[] array2 = hurtBoxes2;
				foreach (HurtBox val4 in array2)
				{
					if (Object.op_Implicit((Object)(object)val4) && Object.op_Implicit((Object)(object)val4.healthComponent) && Object.op_Implicit((Object)(object)val4.healthComponent.body) && Object.op_Implicit((Object)(object)val4.healthComponent.body.characterMotor))
					{
						if (val4.healthComponent.body.HasBuff(UnforgivenBuffs.airborneBuff) || !val4.healthComponent.body.characterMotor.isGrounded || val4.healthComponent.body.characterMotor.isFlying)
						{
							target = val4.healthComponent.body;
							break;
						}
					}
					else if (Object.op_Implicit((Object)(object)val4) && Object.op_Implicit((Object)(object)val4.healthComponent) && Object.op_Implicit((Object)(object)val4.healthComponent.body) && !Object.op_Implicit((Object)(object)val4.healthComponent.body.characterMotor))
					{
						target = val4.healthComponent.body;
						break;
					}
				}
			}
			if (!Object.op_Implicit((Object)(object)target))
			{
				((EntityState)this).skillLocator.special.AddOneStock();
				((EntityState)this).outer.SetNextStateToMain();
				return;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && NetworkServer.active)
			{
				CharacterBody characterBody = ((EntityState)this).characterBody;
				characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags | 1);
			}
			((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground();
			Vector3 val5 = ((EntityState)this).transform.position - target.coreTransform.position;
			distance = ((Vector3)(ref val5)).magnitude + 4f;
			val5 = target.coreTransform.position - ((EntityState)this).transform.position;
			direction = ((Vector3)(ref val5)).normalized;
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			extraDuration = Dash.baseExtraDuration / ((BaseState)this).attackSpeedStat;
			speed = distance / duration;
			prepDuration = Dash.baseChainPrepDuration / ((BaseState)this).attackSpeedStat;
			modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				hurtboxGroup = ((Component)modelTransform).GetComponent<HurtBoxGroup>();
			}
			if (Object.op_Implicit((Object)(object)hurtboxGroup))
			{
				HurtBoxGroup val6 = hurtboxGroup;
				int hurtBoxesDeactivatorCounter = val6.hurtBoxesDeactivatorCounter + 1;
				val6.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter;
			}
			unforgivenController.Unsheath();
			((EntityState)this).PlayCrossfade("FullBody, Override", "Dash", 0.1f);
			Util.PlaySound("Play_merc_shift_slice", ((EntityState)this).gameObject);
		}

		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_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: 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;
			if (Object.op_Implicit((Object)(object)hurtboxGroup))
			{
				HurtBoxGroup val = hurtboxGroup;
				int hurtBoxesDeactivatorCounter = val.hurtBoxesDeactivatorCounter - 1;
				val.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter;
			}
			if (NetworkServer.active)
			{
				CharacterBody characterBody = ((EntityState)this).characterBody;
				characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags & -2);
			}
			((EntityState)this).OnExit();
		}

		public override void FixedUpdate()
		{
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: 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_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: 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_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			base.FixedUpdate();
			if (((EntityState)this).inputBank.skill2.wasDown || ((EntityState)this).inputBank.skill2.down)
			{
				bufferedSecondary = true;
			}
			if (prepStopwatch >= prepDuration)
			{
				stopwatch += Time.fixedDeltaTime;
				Vector3 val = ((!Object.op_Implicit((Object)(object)target)) ? lastKnownPosition : (lastKnownPosition = target.coreTransform.position));
				if (stopwatch < duration * 0.5f)
				{
					Vector3 val2 = val - ((EntityState)this).transform.position;
					direction = ((Vector3)(ref val2)).normalized;
				}
				if (stopwatch >= 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;
				((EntityState)this).gameObject.layer = LayerIndex.fakeActor.intVal;
				((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers();
				if (((EntityState)this).isAuthority && stopwatch >= duration && ((EntityState)this).skillLocator.secondary.CanExecute() && bufferedSecondary)
				{
					unforgivenController.bufferedSpin = true;
					((EntityState)this).skillLocator.secondary.ExecuteIfReady();
				}
				if (stopwatch >= duration + Dash.baseExtraDuration)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new Special());
				}
			}
			else
			{
				prepStopwatch += Time.fixedDeltaTime;
			}
		}

		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
	{
		private bool hasGrantedStacks;

		private bool activateNado;

		public override void OnEnter()
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			RefreshState();
			hitboxGroupName = "SteelTempestSpinHitbox";
			damageType = (DamageType)(empoweredSpecial ? 2 : 0);
			damageCoefficient = (empowered ? UnforgivenStaticValues.tornadoDamageCoefficient : UnforgivenStaticValues.stabDamageCoefficient);
			procCoefficient = 1f;
			pushForce = 300f;
			bonusForce = (empowered ? (Vector3.up * 3000f) : Vector3.zero);
			baseDuration = 0.67f;
			if (unforgivenController.bufferedSpin)
			{
				baseDuration = 0.35f;
			}
			attackStartPercentTime = 0f;
			attackEndPercentTime = 0.2f;
			earlyExitPercentTime = 0.2f;
			hitStopDuration = 0.05f;
			attackRecoil = 2f / ((BaseState)this).attackSpeedStat;
			hitHopVelocity = 9f;
			swingSoundString = GroundLight2.slash1Sound;
			hitSoundString = "sfx_unforgiven_stab";
			playbackRateParam = "Slash.playbackRate";
			muzzleString = "SpinMuzzle";
			swingEffectPrefab = (empowered ? UnforgivenAssets.spinNadoEffect : (empoweredSpecial ? UnforgivenAssets.spinEmpoweredSlashEffect : UnforgivenAssets.spinSlashEffect));
			hitEffectPrefab = UnforgivenAssets.unforgivenHitEffect;
			if (empowered)
			{
				if (NetworkServer.active)
				{
					((EntityState)this).characterBody.ClearTimedBuffs(UnforgivenBuffs.stabMaxStacksBuff);
				}
				activateNado = true;
				moddedDamageTypeHolder.Add(DamageTypes.KnockAirborne);
			}
			impactSound = (empowered ? UnforgivenAssets.nadoImpactSoundEvent.index : UnforgivenAssets.swordImpactSoundEvent.index);
			base.OnEnter();
		}

		protected override void PlayAttackAnimation()
		{
			unforgivenController.Unsheath();
			((EntityState)this).PlayCrossfade("FullBody, Override", "DashSpin", "Dash.playbackRate", duration, 0.05f);
		}

		public override void FixedUpdate()
		{
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			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)
				{
					EnterAttack();
				}
				FireAttack();
			}
			if (((EntityState)this).isAuthority && unforgivenController.bufferedSpin && stopwatch >= duration)
			{
				unforgivenController.bufferedSpin = false;
				((EntityState)this).outer.SetNextState((EntityState)(object)new Special());
			}
			else if (((EntityState)this).isAuthority && !unforgivenController.bufferedSpin && 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 void OnExit()
		{
			base.OnExit();
		}

		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)1;
		}
	}
	public class EnterStab : BaseUnforgivenSkillState
	{
		public override void OnEnter()
		{
			RefreshState();
			base.OnEnter();
			EntityStateMachine val = null;
			EntityStateMachine[] components = ((EntityState)this).gameObject.GetComponents<EntityStateMachine>();
			for (int i = 0; i < components.Length; i++)
			{
				if (components[i].customName == "Body")
				{
					val = components[i];
					break;
				}
			}
			if (Object.op_Implicit((Object)(object)val) && val.state is Dash)
			{
				val.SetNextStateToMain();
				((EntityState)this).outer.SetNextState((EntityState)(object)new DashSpin());
			}
			else if (Object.op_Implicit((Object)(object)val) && val.state is DashSpecial)
			{
				val.SetNextStateToMain();
				((EntityState)this).outer.SetNextState((EntityState)(object)new DashSpin());
			}
			else if (empowered)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new Tornado());
			}
			else
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new StabForward());
			}
		}

		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);
					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_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0213: Unknown result type (might be due to invalid IL or missing references)
			//IL_021a: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Expected O, but got Unknown
			//IL_024e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0253: Unknown result type (might be due to invalid IL or missing references)
			//IL_025a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0265: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Expected O, but got Unknown
			//IL_0290: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			//IL_029c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b3: 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_02c3: Expected O, but got Unknown
			if (!((BaseCharacterMain)this).hasCharacterMotor)
			{
				return;
			}
			bool flag = false;
			bool flag2 = false;
			if (!base.jumpInputReceived || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody) || ((EntityState)this).characterMotor.jumpCount >= ((EntityState)this).characterBody.maxJumpCount)
			{
				return;
			}
			int itemCount = ((EntityState)this).characterBody.inventory.GetItemCount(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 (itemCount > 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)itemCount / 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++;
		}
	}
	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_0047: 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_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			RefreshState();
			hitboxGroupName = "MeleeHitbox";
			damageType = (DamageType)(empoweredSpecial ? 2 : 0);
			damageCoefficient = UnforgivenStaticValues.swingDamageCoefficient;
			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 = 5f;
			swingSoundString = GroundLight2.slash1Sound;
			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()
		{
			Util.PlaySound(swingSoundString, ((EntityState)this).gameObject);
			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, duration * 0.3f);
			}
			else
			{
				((EntityState)this).PlayCrossfade("Gesture, Override", "Slash" + (1 + swingIndex), playbackRateParam, duration * 1.3f, duration * 0.3f);
			}
		}

		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;

		private float maxRange = 12f;

		private float roundDuration = 0.3f;

		private float roundStopwatch;

		private int numRounds = 3;

		private int roundsCompleted = 0;

		private bool hasToggled;

		protected GameObject swingEffectInstance;

		private GameObject swingEffectPrefab = UnforgivenAssets.swordSwingEffect;

		private GameObject swingEffectPrefab2 = UnforgivenAssets.swordSwingEmpoweredEffect;

		private GameObject slashEffectPrefab = UnforgivenAssets.specialSlashingEffect;

		private GameObject slashEffectPrefab2 = UnforgivenAssets.specialEmpoweredSlashingEffect;

		public override void OnEnter()
		{
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddBuff(UnforgivenBuffs.lastBreathBuff);
			}
			RefreshState();
			base.OnEnter();
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddBuff(Buffs.HiddenInvincibility);
			}
			((EntityState)this).characterBody.SetAimTimer(1.5f);
			roundsCompleted = 0;
			roundStopwatch = roundDuration;
			float num = (((BaseState)this).attackSpeedStat - 1f) * 0.5f;
			roundDuration /= num + 1f;
			crit = ((BaseState)this).RollCrit();
			unforgivenController.Unsheath();
			((EntityState)this).PlayAnimation("FullBody, Override", "Special", "Slash.playbackRate", (float)numRounds * roundDuration);
			Transform modelTransform = ((EntityState)this).characterBody.modelLocator.modelTransform;
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				Animator component = ((Component)modelTransform).GetComponent<Animator>();
				TemporaryOverlay val = ((Component)component).gameObject.AddComponent<TemporaryOverlay>();
				val.duration = 1.2f;
				val.destroyComponentOnEnd = true;
				val.originalMaterial = 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.lastBreathBuff);
				((EntityState)this).characterBody.AddTimedBuff(UnforgivenBuffs.lastBreathBuff, 6f);
			}
			((EntityState)this).OnExit();
			if (Object.op_Implicit((Object)(object)swingEffectInstance))
			{
				EntityState.Destroy((Object)(object)swingEffectInstance);
			}
		}

		private void Fire()
		{
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: 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_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: 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_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: 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_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_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: 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_0103: Unknown result type (might be due to invalid IL or missing references)
			//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_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Expected O, but got Unknown
			//IL_0211: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			//IL_0267: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: Unknown result type (might be due to invalid IL or missing references)
			//IL_0227: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0340: Unknown result type (might be due to invalid IL or missing references)
			//IL_0347: Unknown result type (might be due to invalid IL or missing references)
			//IL_034c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0376: Unknown result type (might be due to invalid IL or missing references)
			//IL_037d: Unknown result type (might be due to invalid IL or missing references)
			bool flag = roundsCompleted == numRounds - 1;
			float num = (flag ? finalDamageCoefficient : damageCoefficient);
			Util.PlaySound(flag ? GroundLight2.slash3Sound : GroundLight2.slash1Sound, ((EntityState)this).gameObject);
			new BlastAttack
			{
				attacker = ((EntityState)this).gameObject,
				procChainMask = default(ProcChainMask),
				losType = (LoSType)1,
				damageColorIndex = (DamageColorIndex)0,
				damageType = (DamageType)(empoweredSpecial ? 2 : 32),
				procCoefficient = 1f,
				bonusForce = Vector3.down * 3000f,
				baseForce = 300f,
				baseDamage = num * ((BaseState)this).damageStat,
				falloffModel = (FalloffModel)0,
				radius = maxRange,
				position = ((EntityState)this).transform.position,
				attackerFiltering = (AttackerFiltering)2,
				teamIndex = ((BaseState)this).GetTeam(),
				inflictor = ((EntityState)this).gameObject,
				crit = crit
			}.Fire();
			if (Object.op_Implicit((Object)(object)slashEffectPrefab) && Object.op_Implicit((Object)(object)slashEffectPrefab2))
			{
				EffectManager.SpawnEffect(flag ? slashEffectPrefab2 : slashEffectPrefab, new EffectData
				{
					origin = ((EntityState)this).transform.position
				}, true);
			}
			Transform val = ((roundsCompleted % 2 == 0) ? ((BaseState)this).FindModelChild("SwingMuzzle2") : ((BaseState)this).FindModelChild("SwingMuzzle1"));
			if (Object.op_Implicit((Object)(object)val) && 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, val);
			}
			Util.PlayAttackSpeedSound(flag ? GroundLight2.slash3Sound : GroundLight2.slash1Sound, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat);
			if (!NetworkServer.active)
			{
				return;
			}
			Vector3 val2 = Vector3.down;
			if (!flag)
			{
				val2 = Random.insideUnitSphere;
			}
			val2.y = Mathf.Max(0f, val2.y);
			val2 = ((Vector3)(ref val2)).normalized;
			List<HealthComponent> list = new List<HealthComponent>();
			Collider[] array = Physics.OverlapSphere(((EntityState)this).transform.position, maxRange, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)0);
			for (int i = 0; i < array.Length; i++)
			{
				HurtBox component = ((Component)array[i]).GetComponent<HurtBox>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					continue;
				}
				HealthComponent healthComponent = component.healthComponent;
				if (!Object.op_Implicit((Object)(object)healthComponent))
				{
					continue;
				}
				TeamComponent component2 = ((Component)healthComponent).GetComponent<TeamComponent>();
				if (component2.teamIndex == ((EntityState)this).teamComponent.teamIndex || list.Contains(healthComponent))
				{
					continue;
				}
				list.Add(healthComponent);
				if (Object.op_Implicit((Object)(object)healthComponent.body))
				{
					if (Object.op_Implicit((Object)(object)healthComponent.body.characterMotor))
					{
						healthComponent.body.characterMotor.velocity = val2 * 12f;
					}
					else if (Object.op_Implicit((Object)(object)healthComponent.body.rigidbody))
					{
						healthComponent.body.rigidbody.velocity = val2 * 12f;
					}
					healthComponent.body.AddTimedBuff(UnforgivenBuffs.specialSlamTrackerBuff, 2f, 1);
				}
			}
		}

		public override void FixedUpdate()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			base.FixedUpdate();
			((EntityState)this).characterMotor.velocity = Vector3.zero;
			roundStopwatch += Time.fixedDeltaTime;
			if (roundStopwatch >= roundDuration)
			{
				Fire();
				roundsCompleted++;
				roundStopwatch = 0f;
			}
			if (roundsCompleted >= numRounds)
			{
				((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)6;
		}
	}
	public class StabForward : BaseMeleeAttack
	{
		private bool hasPlayedSound;

		private int stacks;

		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_0047: 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_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)
			RefreshState();
			hitboxGroupName = "SteelTempestHitbox";
			damageType = (DamageType)(empoweredSpecial ? 2 : 0);
			damageCoefficient = UnforgivenStaticValues.stabDamageCoefficient;
			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 = 5f;
			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();
		}

		protected override void PlaySwingEffect()
		{
			Util.PlaySound(swingSoundString, ((EntityState)this).gameObject);
			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()
		{
			if (!unforgivenController.isUnsheathed)
			{
				unforgivenController.Unsheath();
				((EntityState)this).PlayCrossfade("Gesture, Override", "DrawStab", playbackRateParam, duration * 1.3f, duration * 0.3f);
			}
			else
			{
				((EntityState)this).PlayCrossfade("Gesture, Override", "Stab", playbackRateParam, duration * 1.3f, duration * 0.3f);
			}
		}

		public override void OnExit()
		{
			base.OnExit();
			if (Object.op_Implicit((Object)(object)swingEffectInstance))
			{
				EntityState.Destroy((Object)(object)swingEffectInstance);
			}
		}

		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 class Tornado : BaseUnforgivenSkillState
	{
		public static float damageCoefficient = UnforgivenStaticValues.tornadoDamageCoefficient;

		public static float procCoefficient = 1f;

		public static float baseDuration = 0.65f;

		public static float throwForce = 80f;

		public GameObject nado = UnforgivenAssets.nadoPrefab;

		private float duration;

		public override void OnEnter()
		{
			RefreshState();
			base.OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			((EntityState)this).characterBody.SetAimTimer(2f);
			if (!unforgivenController.isUnsheathed)
			{
				unforgivenController.Unsheath();
				((EntityState)this).PlayAnimation("FullBody, Override", "DrawSlash", "Slash.playbackRate", duration);
			}
			else
			{
				((EntityState)this).PlayAnimation("FullBody, Override", "Slash2", "Slash.playbackRate", duration);
			}
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.ClearTimedBuffs(UnforgivenBuffs.stabMaxStacksBuff);
			}
			Fire();
		}

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

		private void Fire()
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//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_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//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_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			Util.PlaySound("sfx_unforgiven_throw_nado", ((EntityState)this).gameObject);
			DamageType value = (DamageType)(empoweredSpecial ? 2 : 0);
			if (((EntityState)this).isAuthority)
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				ProjectileManager instance = ProjectileManager.instance;
				FireProjectileInfo val = new FireProjectileInfo
				{
					projectilePrefab = nado,
					position = ((Ray)(ref aimRay)).origin,
					rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction),
					owner = ((EntityState)this).gameObject,
					damage = damageCoefficient * ((BaseState)this).damageStat,
					force = 800f,
					crit = ((BaseState)this).RollCrit(),
					damageColorIndex = (DamageColorIndex)0,
					target = null
				};
				((FireProjectileInfo)(ref val)).speedOverride = throwForce;
				val.useSpeedOverride = false;
				val.damageTypeOverride = value;
				instance.FireProjectile(val);
			}
		}

		public override void FixedUpdate()
		{
			base.FixedUpdate();
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((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;
		}
	}
}
namespace UnforgivenMod.Unforgiven.Content
{
	public static class DamageTypes
	{
		public static ModdedDamageType Default;

		public static ModdedDamageType KnockAirborne;

		internal static void Init()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			Default = DamageAPI.ReserveDamageType();
			KnockAirborne = DamageAPI.ReserveDamageType();
			Hook();
		}

		private static void Hook()
		{
			GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt;
		}

		private static void GlobalEventManager_onServerDamageDealt(DamageReport damageReport)
		{
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			DamageInfo damageInfo = damageReport.damageInfo;
			if (Object.op_Implicit((Object)(object)damageReport.attackerBody) && Object.op_Implicit((Object)(object)damageReport.victimBody))
			{
				HealthComponent victim = damageReport.victim;
				GameObject inflictor = damageInfo.inflictor;
				CharacterBody victimBody = damageReport.victimBody;
				EntityStateMachine component = ((Component)victimBody).GetComponent<EntityStateMachine>();
				CharacterBody attackerBody = damageReport.attackerBody;
				GameObject gameObject = damageReport.attacker.gameObject;
				UnforgivenController component2 = ((Component)attackerBody).GetComponent<UnforgivenController>();
				if (NetworkServer.active && Object.op_Implicit((Object)(object)component2) && attackerBody.baseNameToken == "KENKO_UNFORGIVEN_NAME" && DamageAPI.HasModdedDamageType(damageInfo, KnockAirborne))
				{
					((Component)victimBody).gameObject.AddComponent<AirborneComponent>();
				}
			}
		}
	}
	public static class UnforgivenAI
	{
		public static void Init(GameObject bodyPrefab, string masterName)
		{
			//IL_003a: 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_00d0: 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_00fe: 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_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0244: Unknown result type (might be due to invalid IL or missing references)
			//IL_024c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0268: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e4: 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_0308: Unknown result type (might be due to invalid IL or missing references)
			//IL_0330: Unknown result type (might be due to invalid IL or missing references)
			//IL_0350: Unknown result type (might be due to invalid IL or missing references)
			//IL_0364: Unknown result type (might be due to invalid IL or missing references)
			//IL_036c: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Prefabs.CreateBlankMasterPrefab(bodyPrefab, masterName);
			BaseAI component = val.GetComponent<BaseAI>();
			component.aimVectorDampTime = 0.1f;
			component.aimVectorMaxSpeed = 360f;
			AISkillDriver val2 = val.AddComponent<AISkillDriver>();
			val2.customName = "Use Primary Swing";
			val2.skillSlot = (SkillSlot)0;
			val2.requiredSkill = null;
			val2.requireSkillReady = false;
			val2.requireEquipmentReady = false;
			val2.minUserHealthFraction = float.NegativeInfinity;
			val2.maxUserHealthFraction = float.PositiveInfinity;
			val2.minTargetHealthFraction = float.NegativeInfinity;
			val2.maxTargetHealthFraction = float.PositiveInfinity;
			val2.minDistance = 0f;
			val2.maxDistance = 8f;
			val2.selectionRequiresTargetLoS = false;
			val2.selectionRequiresOnGround = false;
			val2.selectionRequiresAimTarget = false;
			val2.maxTimesSelected = -1;
			val2.moveTargetType = (TargetType)0;
			val2.activationRequiresTargetLoS = false;
			val2.activationRequiresAimTargetLoS = false;
			val2.activationRequiresAimConfirmation = false;
			val2.movementType = (MovementType)1;
			val2.moveInputScale = 1f;
			val2.aimType = (AimType)1;
			val2.ignoreNodeGraph = false;
			val2.shouldSprint = false;
			val2.shouldFireEquipment = false;
			val2.buttonPressType = (ButtonPressType)0;
			val2.driverUpdateTimerOverride = -1f;
			val2.resetCurrentEnemyOnNextDriverSelection = false;
			val2.noRepeat = false;
			val2.nextHighPriorityOverride = null;
			AISkillDriver val3 = val.AddComponent<AISkillDriver>();
			val3.customName = "Use Secondary Shoot";
			val3.skillSlot = (SkillSlot)1;
			val3.requireSkillReady = true;
			val3.minDistance = 0f;
			val3.maxDistance = 25f;
			val3.selectionRequiresTargetLoS = false;
			val3.selectionRequiresOnGround = false;
			val3.selectionRequiresAimTarget = false;
			val3.maxTimesSelected = -1;
			val3.moveTargetType = (TargetType)0;
			val3.activationRequiresTargetLoS = false;
			val3.activationRequiresAimTargetLoS = false;
			val3.activationRequiresAimConfirmation = true;
			val3.movementType = (MovementType)1;
			val3.moveInputScale = 1f;
			val3.aimType = (AimType)1;
			val3.buttonPressType = (ButtonPressType)0;
			AISkillDriver val4 = val.AddComponent<AISkillDriver>();
			val4.customName = "Use Utility Roll";
			val4.skillSlot = (SkillSlot)2;
			val4.requireSkillReady = true;
			val4.minDistance = 8f;
			val4.maxDistance = 20f;
			val4.selectionRequiresTargetLoS = true;
			val4.selectionRequiresOnGround = false;
			val4.selectionRequiresAimTarget = false;
			val4.maxTimesSelected = -1;
			val4.moveTargetType = (TargetType)0;
			val4.activationRequiresTargetLoS = false;
			val4.activationRequiresAimTargetLoS = false;
			val4.activationRequiresAimConfirmation = false;
			val4.movementType = (MovementType)2;
			val4.moveInputScale = 1f;
			val4.aimType = (AimType)1;
			val4.buttonPressType = (ButtonPressType)0;
			AISkillDriver val5 = val.AddComponent<AISkillDriver>();
			val5.customName = "Use Special bomb";
			val5.skillSlot = (SkillSlot)3;
			val5.requireSkillReady = true;
			val5.minDistance = 0f;
			val5.maxDistance = 20f;
			val5.selectionRequiresTargetLoS = false;
			val5.selectionRequiresOnGround = false;
			val5.selectionRequiresAimTarget = false;
			val5.maxTimesSelected = -1;
			val5.moveTargetType = (TargetType)0;
			val5.activationRequiresTargetLoS = false;
			val5.activationRequiresAimTargetLoS = false;
			val5.activationRequiresAimConfirmation = false;
			val5.movementType = (MovementType)1;
			val5.moveInputScale = 1f;
			val5.aimType = (AimType)1;
			val5.buttonPressType = (ButtonPressType)0;
			AISkillDriver val6 = val.AddComponent<AISkillDriver>();
			val6.customName = "Chase";
			val6.skillSlot = (SkillSlot)(-1);
			val6.requireSkillReady = false;
			val6.minDistance = 0f;
			val6.maxDistance = float.PositiveInfinity;
			val6.moveTargetType = (TargetType)0;
			val6.activationRequiresTargetLoS = false;
			val6.activationRequiresAimTargetLoS = false;
			val6.activationRequiresAimConfirmation = false;
			val6.movementType = (MovementType)1;
			val6.moveInputScale = 1f;
			val6.aimType = (AimType)1;
			val6.buttonPressType = (ButtonPressType)0;
		}
	}
	public static class UnforgivenAssets
	{
		internal static AssetBundle mainAssetBundle;

		internal static Material commandoMat;

		internal static GameObject nadoPrefab;

		internal static GameObject nadoGhost;

		internal static Shader hotpoo = Resources.Load<Shader>("Shaders/Deferred/HGStandard");

		internal static GameObject bloodSplatterEffect;

		internal static GameObject windExplosionEffect;

		internal static GameObject beerExplosion;

		internal static GameObject bloodSpurtEffect;

		internal static GameObject spinSlashEffect;

		internal static GameObject spinEmpoweredSlashEffect;

		internal static GameObject specialSlashingEffect;

		internal static GameObject specialEmpoweredSlashingEffect;

		internal static GameObject swordSwingEffect;

		internal static GameObject swordSwingEmpoweredEffect;

		internal static GameObject stabSwingEffect;

		internal static GameObject unforgivenHitEffect;

		internal static GameObject batHitEffectRed;

		internal static GameObject dashEffect;

		internal static GameObject realNado;

		internal static GameObject spinNadoEffect;

		internal static GameObject dashCdEffect;

		internal static GameObject shieldEffect;

		internal static GameObject nadoUpEffect;

		internal static Material specialMaterial;

		internal static NetworkSoundEventDef swordImpactSoundEvent;

		internal static NetworkSoundEventDef stabImpactSoundEvent;

		internal static NetworkSoundEventDef nadoImpactSoundEvent;

		internal static Color unforgivenColor = new Color(1f, 0.4f, 0.4f);

		internal static Color unforgivenSecondaryColor = Color.red;

		internal static GameObject throwable;

		internal static GameObject throwableEnd;

		internal static Sprite secondaryIcon;

		internal static Sprite secondaryEmpoweredIcon;

		internal static GameObject unforgivenIndicator;

		public static void Init(AssetBundle assetBundle)
		{
			mainAssetBundle = assetBundle;
			CreateMaterials();
			CreateModels();
			CreateEffects();
			CreateSounds();
			CreateProjectiles();
			CreateUI();
		}

		private static void CleanChildren(Transform startingTrans)
		{
			for (int num = startingTrans.childCount - 1; num >= 0; num--)
			{
				if (startingTrans.GetChild(num).childCount > 0)
				{
					CleanChildren(startingTrans.GetChild(num));
				}
				Object.DestroyImmediate((Object)(object)((Component)startingTrans.GetChild(num)).gameObject);
			}
		}

		private static void CreateMaterials()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			specialMaterial = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Imp/matImpBossDissolve.mat").WaitForCompletion();
		}

		private static void CreateModels()
		{
		}

		private static void CreateEffects()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: 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_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: 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_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might