Decompiled source of UnofficialRiskOfRuina v1.2.0

RiskOfRuinaMod.dll

Decompiled 2 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AncientScepter;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using EmotesAPI;
using EntityStates;
using EntityStates.Commando.CommandoWeapon;
using EntityStates.Huntress;
using EntityStates.Mage;
using HG;
using HG.BlendableTypes;
using IL.RoR2;
using JetBrains.Annotations;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using NS_KingKombatArena;
using On.RoR2;
using On.RoR2.CharacterSpeech;
using On.RoR2.Networking;
using On.RoR2.UI;
using R2API;
using R2API.Utils;
using RiskOfRuinaMod.Modules;
using RiskOfRuinaMod.Modules.Components;
using RiskOfRuinaMod.Modules.Items;
using RiskOfRuinaMod.Modules.Misc;
using RiskOfRuinaMod.Modules.Survivors;
using RiskOfRuinaMod.SkillStates;
using RiskOfRuinaMod.SkillStates.BaseStates;
using RoR2;
using RoR2.Achievements;
using RoR2.Audio;
using RoR2.CharacterAI;
using RoR2.CharacterSpeech;
using RoR2.ContentManagement;
using RoR2.Networking;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using TILER2;
using ThinkInvisible.ClassicItems;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyCompany("RiskOfRuinaMod")]
[assembly: AssemblyProduct("RiskOfRuinaMod")]
[assembly: AssemblyTitle("RiskOfRuinaMod")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
internal class BodyInfo
{
	internal string bodyName = "";

	internal string bodyNameToken = "";

	internal string subtitleNameToken = "";

	internal string bodyNameToClone = "Commando";

	internal Texture characterPortrait;

	internal GameObject crosshair;

	internal GameObject podPrefab;

	internal float maxHealth = 100f;

	internal float healthGrowth = 2f;

	internal float healthRegen;

	internal float shield;

	internal float shieldGrowth;

	internal float moveSpeed = 7f;

	internal float moveSpeedGrowth;

	internal float acceleration = 80f;

	internal float jumpPower = 15f;

	internal float jumpPowerGrowth;

	internal float damage = 12f;

	internal float attackSpeed = 1f;

	internal float attackSpeedGrowth;

	internal float armor;

	internal float armorGrowth;

	internal float crit = 1f;

	internal float critGrowth;

	internal float sprintSpeedMult = 1.45f;

	internal int jumpCount = 1;

	internal Color bodyColor = Color.grey;

	internal Vector3 aimOriginPosition = new Vector3(0f, 1.8f, 0f);

	internal Vector3 modelBasePosition = new Vector3(0f, -0.92f, 0f);

	internal Vector3 cameraPivotPosition = new Vector3(0f, 1.6f, 0f);
}
internal class CustomRendererInfo
{
	internal string childName;

	internal Material material;

	internal bool ignoreOverlays;
}
internal class SkillDefInfo
{
	public string skillName;

	public string skillNameToken;

	public string skillDescriptionToken;

	public Sprite skillIcon;

	public SerializableEntityStateType activationState;

	public string activationStateMachineName;

	public int baseMaxStock;

	public float baseRechargeInterval;

	public bool beginSkillCooldownOnSkillEnd;

	public bool canceledFromSprinting;

	public bool forceSprintDuringState;

	public bool fullRestockOnAssign;

	public InterruptPriority interruptPriority;

	public bool resetCooldownTimerOnUse;

	public bool isCombatSkill;

	public bool mustKeyPress;

	public bool cancelSprintingOnActivation;

	public int rechargeStock;

	public int requiredStock;

	public int stockToConsume;

	public string[] keywordTokens;
}
namespace RiskOfRuinaMod
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.Moonlol.UnofficialRiskOfRuina", "UnofficialRiskOfRuina", "1.1.4")]
	public class RiskOfRuinaPlugin : BaseUnityPlugin
	{
		public const string MODUID = "com.Moonlol.UnofficialRiskOfRuina";

		public const string MODNAME = "UnofficialRiskOfRuina";

		public const string MODVERSION = "1.2.0";

		public const string developerPrefix = "COF";

		public static bool DEBUG_MODE = false;

		public static GameObject CentralNetworkObject;

		public static GameObject _centralNetworkObjectSpawned;

		internal List<SurvivorBase> Survivors = new List<SurvivorBase>();

		public static GameObject characterPrefab;

		public static RiskOfRuinaPlugin instance;

		public static bool ancientScepterInstalled = false;

		public static bool notstandalone = false;

		public static bool kombatArenaInstalled = false;

		public static uint argaliaSkinIndex = 1u;

		public bool IsRedMistSelected;

		public bool IsArbiterSelected;

		public bool IsBlackSilenceSelected;

		public bool IsModCharSelected;

		public string CurrentCharacterNameSelected = "";

		public bool songOverride;

		public uint currentOverrideSong;

		private DoTCore dotCore;

		private ItemManager itemManager;

		private void Awake()
		{
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Expected O, but got Unknown
			//IL_01e8: Expected O, but got Unknown
			instance = this;
			Config.ReadConfig();
			Asset.Initialize();
			CameraParams.InitializeParams();
			States.RegisterStates();
			Buffs.RegisterBuffs();
			dotCore = new DoTCore();
			Projectiles.RegisterProjectiles();
			Tokens.AddTokens();
			Music.Initialize();
			itemManager = new ItemManager();
			itemManager.items.Add(new ArbitersTrophy());
			itemManager.items.Add(new BlackTea());
			itemManager.items.Add(new Prescript());
			itemManager.items.Add(new LiuBadge());
			itemManager.items.Add(new WorkshopAmmo());
			itemManager.items.Add(new WeddingRing());
			itemManager.items.Add(new UdjatMask());
			itemManager.items.Add(new Reverberation());
			ItemManager.instance.AddItems();
			itemManager.equips.Add(new BackwardsClock());
			ItemManager.instance.AddEquips();
			ItemDisplays.PopulateDisplays();
			Unlockables.AddUnlockables();
			if (Config.CharacterEnableConfig("RedMist").Value)
			{
				new RedMist().Initialize();
			}
			if (Config.CharacterEnableConfig("Arbiter").Value)
			{
				new AnArbiter().Initialize();
			}
			if (Chainloader.PluginInfos.ContainsKey("com.DestroyedClone.AncientScepter"))
			{
				ancientScepterInstalled = true;
				Skills.ScepterSkillSetup("COF");
				standaloneScepterSetup();
			}
			else if (Chainloader.PluginInfos.ContainsKey("com.ThinkInvisible.ClassicItems"))
			{
				ancientScepterInstalled = true;
				notstandalone = true;
				Skills.ScepterSkillSetup("COF");
				classicScepterSetup();
			}
			if (Chainloader.PluginInfos.ContainsKey("com.Kingpinush.KingKombatArena"))
			{
				kombatArenaInstalled = true;
			}
			GameObject val = new GameObject("tmpGo");
			val.AddComponent<NetworkIdentity>();
			CentralNetworkObject = PrefabAPI.InstantiateClone(val, "riskOfRuinaNetworkManager");
			Object.Destroy((Object)val);
			CentralNetworkObject.AddComponent<RiskOfRuinaNetworkManager>();
			new ContentPacks().Initialize();
			ContentManager.onContentPacksAssigned += LateSetup;
			Hook();
		}

		private void LateSetup(ReadOnlyArray<ReadOnlyContentPack> obj)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			SurvivorBase.instance?.SetItemDisplays();
			CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats);
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private void standaloneScepterSetup()
		{
			ItemBase<AncientScepterItem>.instance.RegisterScepterSkill(Skills.ScepterBasicAttack, "RedMistBody", (SkillSlot)0, 0);
			ItemBase<AncientScepterItem>.instance.RegisterScepterSkill(Skills.scepterShockwaveDef, "ArbiterBody", (SkillSlot)3, 0);
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private void classicScepterSetup()
		{
			Item<Scepter>.instance.RegisterScepterSkill(Skills.ScepterBasicAttack, "RedMistBody", (SkillSlot)0, RedMist.BasicAttack);
			Item<Scepter>.instance.RegisterScepterSkill(Skills.scepterShockwaveDef, "ArbiterBody", (SkillSlot)3, AnArbiter.Shockwave);
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static bool KombatGamemodeActive()
		{
			return KingKombatArenaMainPlugin.s_GAME_MODE_ACTIVE;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static bool KombatIsDueling(CharacterMaster masterToCheck)
		{
			return ((NetworkedGameModeData)(ref NetworkedGameModeManager.instance.m_currentNetworkedGameModeData)).IsCharacterDueling(masterToCheck);
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static bool KombatIsCharacter(CharacterMaster masterToCheck)
		{
			return KingKombatArenaMainPlugin.AccessCurrentKombatArenaInstance().GetAllCurrentCharacterMasters().Contains(masterToCheck);
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static bool KombatIsWaiting(GameObject bodyToCheck)
		{
			return KingKombatArenaMainPlugin.IsInWaitingArea(bodyToCheck);
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static int KombatDuelsPlayed(CharacterMaster masterToCheck)
		{
			return ((ParticipantData)(ref ((NetworkedGameModeData)(ref NetworkedGameModeManager.instance.m_currentNetworkedGameModeData)).AccessParticipantData(masterToCheck))).GetDuelTotal();
		}

		private void Hook()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected O, but got Unknown
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Expected O, but got Unknown
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Expected O, but got Unknown
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Expected O, but got Unknown
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Expected O, but got Unknown
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Expected O, but got Unknown
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Expected O, but got Unknown
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Expected O, but got Unknown
			if (Config.snapLevel.Value)
			{
				CharacterBody.OnLevelUp += new hook_OnLevelUp(CharacterBody_OnLevelUp);
			}
			GlobalEventManager.OnHitEnemy += new hook_OnHitEnemy(GlobalEvent_OnHitEnemy);
			GlobalEventManager.OnCharacterDeath += new hook_OnCharacterDeath(GlobalEvent_OnCharacterDeath);
			BrotherSpeechDriver.DoInitialSightResponse += new hook_DoInitialSightResponse(BrotherSpeechDriver_DoInitialSightResponse);
			BrotherSpeechDriver.OnBodyKill += new hook_OnBodyKill(BrotherSpeechDriver_OnBodyKill);
			NetworkManagerSystem.OnClientSceneChanged += new hook_OnClientSceneChanged(GameNetworkManager_OnClientSceneChanged_Hook);
			CharacterSelectController.Update += new hook_Update(Update_Hook);
			CharacterBody.OnSkillActivated += new hook_OnSkillActivated(CharacterBody_OnSkillActivated);
			DotController.onDotInflictedServerGlobal += new OnDotInflictedServerGlobalDelegate(DotController_InflictDot);
			if (Chainloader.PluginInfos.ContainsKey("com.weliveinasociety.CustomEmotesAPI"))
			{
				SurvivorCatalog.Init += new hook_Init(catalogue_hook);
			}
		}

		private void CharacterBody_OnSkillActivated(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: Expected O, but got Unknown
			//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: 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_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: 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)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: 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_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Expected O, but got Unknown
			//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_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, skill);
			if (!Object.op_Implicit((Object)(object)self) || !NetworkServer.active)
			{
				return;
			}
			DotController val = DotController.FindDotController(((Component)self).gameObject);
			if (!Object.op_Implicit((Object)(object)val) || !val.HasDotActive(DoTCore.FairyIndex))
			{
				return;
			}
			_ = self.GetBuffCount(Buffs.fairyDebuff) / 3;
			for (int i = 0; i < val.dotStackList.Count; i++)
			{
				DotStack val2 = val.dotStackList[i];
				if (val2.dotIndex == DoTCore.FairyIndex)
				{
					DamageInfo val3 = ((!Object.op_Implicit((Object)(object)val2.attackerObject) || !Object.op_Implicit((Object)(object)val2.attackerObject.GetComponent<CharacterBody>())) ? new DamageInfo
					{
						attacker = val2.attackerObject,
						inflictor = val2.attackerObject,
						crit = false,
						damage = 1f,
						position = self.corePosition,
						force = Vector3.zero,
						damageType = DamageTypeCombo.op_Implicit((DamageType)0),
						damageColorIndex = (DamageColorIndex)2,
						dotIndex = DoTCore.FairyIndex,
						procCoefficient = Config.FairyProc.Value
					} : new DamageInfo
					{
						attacker = val2.attackerObject,
						inflictor = val2.attackerObject,
						crit = val2.attackerObject.GetComponent<CharacterBody>().RollCrit(),
						damage = val2.attackerObject.GetComponent<CharacterBody>().damage * 1f,
						position = self.corePosition,
						force = Vector3.zero,
						damageType = DamageTypeCombo.op_Implicit((DamageType)0),
						damageColorIndex = (DamageColorIndex)2,
						dotIndex = DoTCore.FairyIndex,
						procCoefficient = Config.FairyProc.Value
					});
					self.healthComponent.TakeDamage(val3);
					GlobalEventManager.instance.OnHitEnemy(val3, ((Component)self.healthComponent.body).gameObject);
					GlobalEventManager.instance.OnHitAll(val3, ((Component)self.healthComponent.body).gameObject);
				}
			}
			EffectData val4 = new EffectData();
			val4.rotation = Util.QuaternionSafeLookRotation(Vector3.zero);
			val4.origin = self.corePosition;
			EffectManager.SpawnEffect(Asset.fairyProcEffect, val4, false);
		}

		private void Update_Hook(orig_Update orig, CharacterSelectController self)
		{
			orig.Invoke(self);
			if ((Object)(object)self.currentSurvivorDef != (Object)null)
			{
				IsRedMistSelected = self.currentSurvivorDef.cachedName == "RedMist";
				IsArbiterSelected = self.currentSurvivorDef.cachedName == "Arbiter";
				IsBlackSilenceSelected = self.currentSurvivorDef.cachedName == "BlackSilence";
				IsModCharSelected = IsArbiterSelected || IsRedMistSelected || IsBlackSilenceSelected;
			}
			SurvivorDef currentSurvivorDef = self.currentSurvivorDef;
			CurrentCharacterNameSelected = ((currentSurvivorDef != null) ? currentSurvivorDef.cachedName : null);
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private void catalogue_hook(orig_Init orig)
		{
			orig.Invoke();
			foreach (SurvivorDef allSurvivorDef in SurvivorCatalog.allSurvivorDefs)
			{
				if (((Object)allSurvivorDef.bodyPrefab).name == "ArbiterBody")
				{
					CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, Asset.rigbundle.LoadAsset<GameObject>("mdlArbiter"), 0, true);
				}
			}
		}

		private void GameNetworkManager_OnClientSceneChanged_Hook(orig_OnClientSceneChanged orig, NetworkManagerSystem self, NetworkConnection conn)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, conn);
			Scene activeScene = SceneManager.GetActiveScene();
			if (((Scene)(ref activeScene)).name.Contains("outro") && IsModCharSelected)
			{
				songOverride = true;
				currentOverrideSong = Util.PlaySound("Play_Dark_Fantasy_Studio___Sun_and_Moon", ((Component)this).gameObject);
				Music.musicSources++;
			}
			else if (songOverride)
			{
				songOverride = false;
				AkSoundEngine.StopPlayingID(currentOverrideSong);
				Music.musicSources--;
			}
		}

		private void BrotherSpeechDriver_DoInitialSightResponse(orig_DoInitialSightResponse orig, BrotherSpeechDriver self)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			bool flag = false;
			ReadOnlyCollection<CharacterBody> readOnlyInstancesList = CharacterBody.readOnlyInstancesList;
			for (int i = 0; i < readOnlyInstancesList.Count; i++)
			{
				BodyIndex bodyIndex = readOnlyInstancesList[i].bodyIndex;
				flag |= bodyIndex == BodyCatalog.FindBodyIndex(RedMist.redMistPrefab);
			}
			if (flag)
			{
				SpeechInfo[] array = (SpeechInfo[])(object)new SpeechInfo[1]
				{
					new SpeechInfo
					{
						duration = 1f,
						maxWait = 4f,
						mustPlay = true,
						priority = 0f,
						token = "BROTHER_SEE_REDMIST_1"
					}
				};
				self.SendReponseFromPool(array);
			}
			orig.Invoke(self);
		}

		private void BrotherSpeechDriver_OnBodyKill(orig_OnBodyKill orig, BrotherSpeechDriver self, DamageReport damageReport)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)damageReport.victimBody) && damageReport.victimBodyIndex == BodyCatalog.FindBodyIndex(RedMist.redMistPrefab))
			{
				SpeechInfo[] array = (SpeechInfo[])(object)new SpeechInfo[1]
				{
					new SpeechInfo
					{
						duration = 1f,
						maxWait = 4f,
						mustPlay = true,
						priority = 0f,
						token = "BROTHER_KILL_REDMIST_1"
					}
				};
				self.SendReponseFromPool(array);
			}
			orig.Invoke(self, damageReport);
		}

		private void CharacterBody_OnLevelUp(orig_OnLevelUp orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self) && IsModCharSelected && self.isPlayerControlled)
			{
				Util.PlaySound("Ruina_Snap", ((Component)self).gameObject);
			}
		}

		private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (!Object.op_Implicit((Object)(object)self))
			{
				return;
			}
			if (self.HasBuff(Buffs.feebleDebuff))
			{
				self.armor *= 0.5f;
				self.damage *= 0.5f;
			}
			if (self.HasBuff(Buffs.warpBuff))
			{
				self.moveSpeed *= 2f;
				self.attackSpeed *= 2f;
			}
			if (self.HasBuff(Buffs.strengthBuff))
			{
				if (self.isPlayerControlled)
				{
					self.moveSpeed *= 1.5f;
					self.attackSpeed *= 1.5f;
					self.regen *= 2f;
					self.armor += 50f;
					self.damage *= 1.5f;
				}
				else
				{
					self.moveSpeed *= 1.5f;
					self.attackSpeed *= 5f;
					self.regen *= 5f;
					self.armor += 100f;
					self.damage *= 5f;
				}
				if (Object.op_Implicit((Object)(object)self.skillLocator))
				{
					if (Object.op_Implicit((Object)(object)self.skillLocator.primary))
					{
						GenericSkill primary = self.skillLocator.primary;
						primary.cooldownScale -= 0.25f;
					}
					if (Object.op_Implicit((Object)(object)self.skillLocator.secondary))
					{
						GenericSkill secondary = self.skillLocator.secondary;
						secondary.cooldownScale -= 0.25f;
					}
					if (Object.op_Implicit((Object)(object)self.skillLocator.utility))
					{
						GenericSkill utility = self.skillLocator.utility;
						utility.cooldownScale -= 0.25f;
					}
					if (Object.op_Implicit((Object)(object)self.skillLocator.special))
					{
						GenericSkill special = self.skillLocator.special;
						special.cooldownScale -= 0.25f;
					}
				}
			}
			RedMistStatTracker component = ((Component)self).GetComponent<RedMistStatTracker>();
			RedMistEmotionComponent component2 = ((Component)self).GetComponent<RedMistEmotionComponent>();
			if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component2))
			{
				return;
			}
			float moveSpeed = self.moveSpeed;
			float attackSpeed = self.attackSpeed;
			self.moveSpeed = self.baseMoveSpeed;
			self.attackSpeed = self.baseAttackSpeed;
			float num = (moveSpeed - self.baseMoveSpeed) / self.baseMoveSpeed;
			if (self.isSprinting)
			{
				num = (moveSpeed - self.baseMoveSpeed * self.sprintingSpeedMultiplier) / (self.baseMoveSpeed * self.sprintingSpeedMultiplier);
			}
			float num2 = (attackSpeed - self.baseAttackSpeed) / self.baseAttackSpeed;
			num *= Config.moveSpeedMult.Value;
			num2 *= Config.attackSpeedMult.Value;
			float num3 = self.baseDamage + self.levelDamage * (self.level - 1f);
			float num4 = Config.redMistBuffDamage.Value * (float)self.GetBuffCount(Buffs.RedMistBuff) * num3;
			self.damage += num4;
			float num5 = num * num3 + num2 * num3;
			self.damage += num5;
			float num6 = 0f;
			float num7 = 0f;
			if (Object.op_Implicit((Object)(object)self.inventory) && self.inventory.GetItemCount(Items.SprintBonus) > 0)
			{
				num6 += Config.sprintSpeedMult.Value * (float)self.inventory.GetItemCount(Items.SprintBonus);
			}
			if (Object.op_Implicit((Object)(object)self.inventory) && self.inventory.GetItemCount(Items.SprintOutOfCombat) > 0)
			{
				num7 += Config.sprintSpeedMult.Value * 2f * (float)self.inventory.GetItemCount(Items.SprintOutOfCombat);
			}
			if (self.HasBuff(Buffs.EGOBuff))
			{
				if (!component2.inEGO && NetworkServer.active)
				{
					self.RemoveBuff(Buffs.EGOBuff);
				}
				self.armor += 50f;
				self.sprintingSpeedMultiplier = 2.2f;
			}
			else
			{
				self.sprintingSpeedMultiplier = 1.5f;
			}
			self.sprintingSpeedMultiplier += num6;
			if (self.outOfCombat)
			{
				self.sprintingSpeedMultiplier += num7;
			}
			if (self.isSprinting)
			{
				self.moveSpeed *= self.sprintingSpeedMultiplier;
			}
		}

		private void GlobalEvent_OnHitEnemy(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
		{
			//IL_0058: 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_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: 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_0215: Unknown result type (might be due to invalid IL or missing references)
			if (NetworkServer.active)
			{
				RiskOfRuinaNetworkManager.OnHit(self, damageInfo, victim);
			}
			GameObject attacker = damageInfo.attacker;
			if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)attacker))
			{
				CharacterBody component = attacker.GetComponent<CharacterBody>();
				CharacterBody component2 = victim.GetComponent<CharacterBody>();
				if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component2) && component.teamComponent.teamIndex != component2.teamComponent.teamIndex)
				{
					if (component.baseNameToken == "COF_REDMIST_BODY_NAME")
					{
						RedMistStatTracker component3 = ((Component)component).GetComponent<RedMistStatTracker>();
						RedMistEmotionComponent component4 = ((Component)component).GetComponent<RedMistEmotionComponent>();
						if (Object.op_Implicit((Object)(object)component3) && Object.op_Implicit((Object)(object)component4))
						{
							float damage = component.damage;
							float num = Mathf.Clamp(damageInfo.damage / damage, 0f, 4f);
							float num2 = (float)Run.instance.stageClearCount / ((float)Run.instance.stageClearCount + 1f);
							if (kombatArenaInstalled && KombatGamemodeActive() && Object.op_Implicit((Object)(object)component.master))
							{
								num2 = (float)KombatDuelsPlayed(component.master) / ((float)KombatDuelsPlayed(component.master) + 1f);
							}
							float num3 = num * Config.emotionRatio.Value;
							float num4 = 1f;
							if (component2.isElite)
							{
								num4 = 1.2f;
							}
							if (component2.isBoss)
							{
								num4 = 1.4f;
							}
							if (kombatArenaInstalled && KombatGamemodeActive())
							{
								num4 = ((!Object.op_Implicit((Object)(object)component2.master) || !KombatIsCharacter(component2.master)) ? 0.75f : 7.5f);
							}
							component4.AddEmotion((num3 + num3 * num2) * num4);
						}
					}
					if (component.baseNameToken == "COF_ARBITER_BODY_NAME" && damageInfo.dotIndex != DoTCore.FairyIndex && Util.CheckRoll(100f * damageInfo.procCoefficient, component.master))
					{
						InflictDotInfo val = default(InflictDotInfo);
						val.attackerObject = damageInfo.attacker;
						val.victimObject = victim;
						val.dotIndex = DoTCore.FairyIndex;
						val.duration = 10f;
						val.damageMultiplier = 0f;
						InflictDotInfo val2 = val;
						DotController.InflictDot(ref val2);
					}
				}
			}
			orig.Invoke(self, damageInfo, victim);
		}

		private void GlobalEvent_OnCharacterDeath(orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport damageReport)
		{
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Expected O, but got Unknown
			//IL_0148: 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_0089: Expected O, but got Unknown
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)damageReport?.attackerBody) && damageReport.attackerBody.baseNameToken == "COF_REDMIST_BODY_NAME")
			{
				RedMistEmotionComponent component = ((Component)damageReport.attackerBody).GetComponent<RedMistEmotionComponent>();
				if (Object.op_Implicit((Object)(object)component) && component.inEGO && NetworkServer.active)
				{
					damageReport.attackerBody.AddBuff(Buffs.RedMistBuff);
				}
				if (damageReport.combinedHealthBeforeDamage - damageReport.damageDealt <= 0f - damageReport.victim.fullHealth)
				{
					EffectData val = new EffectData();
					val.origin = damageReport.victimBody.corePosition;
					val.scale = 1f;
					EffectManager.SpawnEffect(Asset.mistEffect, val, true);
					if (Object.op_Implicit((Object)(object)damageReport.victimBody.modelLocator) && Object.op_Implicit((Object)(object)((Component)damageReport.victimBody.modelLocator.modelTransform).GetComponent<CharacterModel>()) && NetworkServer.active)
					{
						RiskOfRuinaNetworkManager.SetInvisible(((Component)damageReport.victimBody).gameObject);
					}
				}
			}
			if (damageReport.victimBody.baseNameToken == "COF_REDMIST_BODY_NAME" || damageReport.victimBody.baseNameToken == "COF_ARBITER_BODY_NAME" || damageReport.victimBody.baseNameToken == "COF_BLACKSILENCE_BODY_NAME")
			{
				EffectData val2 = new EffectData();
				val2.origin = damageReport.victimBody.corePosition;
				val2.scale = 1f;
				EffectManager.SpawnEffect(Asset.pagePoof, val2, true);
				if (NetworkServer.active)
				{
					RiskOfRuinaNetworkManager.SetInvisible(((Component)damageReport.victimBody).gameObject);
				}
			}
			orig.Invoke(self, damageReport);
		}

		private void DotController_InflictDot(DotController self, ref InflictDotInfo dotInfo)
		{
			//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_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			if (dotInfo.dotIndex != DoTCore.FairyIndex)
			{
				return;
			}
			int i = 0;
			for (int count = self.dotStackList.Count; i < count; i++)
			{
				if (self.dotStackList[i].dotIndex == DoTCore.FairyIndex)
				{
					self.dotStackList[i].timer = Mathf.Max(self.dotStackList[i].timer, dotInfo.duration);
				}
			}
		}
	}
}
namespace RiskOfRuinaMod.SkillStates
{
	internal class AirBackAttack : BaseDirectionalSkill
	{
		public override void OnEnter()
		{
			//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_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			attackIndex = 1;
			hitboxName = "AirBasic";
			damageCoefficient = 2f;
			baseDuration = 0.25f;
			attackStartTime = 0.5f;
			attackEndTime = 0.8f;
			baseEarlyExitTime = 0f;
			hitStopDuration = 0.05f;
			swingSoundString = "Ruina_Swipe";
			impactSound = Asset.swordHitSoundVert.index;
			muzzleString = "SwingLeft";
			hitEffectPrefab = Asset.swordHitEffect;
			bonusForce = Vector3.down * 900f;
			base.OnEnter();
			swingEffectPrefab = statTracker.slashPrefab;
		}

		public override void FixedUpdate()
		{
			base.FixedUpdate();
			((EntityState)this).characterMotor.velocity.y = 0f;
			if (stopwatch > duration * attackEndTime)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new AirBackFallingAttack());
			}
		}

		protected override void PlayAttackAnimation()
		{
			((EntityState)this).PlayCrossfade("FullBody, Override", "AirBackSlash", "BaseAttack.playbackRate", duration, 0.1f);
		}

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

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

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

		public override void OnExit()
		{
			base.OnExit();
		}
	}
	internal class AirBackFallingAttack : BaseSkillState
	{
		private float duration = 10f;

		private float cooldown = 0.4f;

		private float landTime;

		private bool landed;

		public ShakeEmitter shakeEmitter;

		private float startY;

		protected float trueDamage => ((BaseState)this).damageStat;

		public override void OnEnter()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			CharacterBody characterBody = ((EntityState)this).characterBody;
			characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags | 1);
			if (((EntityState)this).isAuthority)
			{
				((EntityState)this).characterMotor.velocity.y = -60f;
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				characterMotor.rootMotion.y = characterMotor.rootMotion.y - 0.5f;
				((EntityState)this).characterMotor.velocity.x = 0f;
				((EntityState)this).characterMotor.velocity.z = 0f;
			}
			startY = ((EntityState)this).characterBody.corePosition.y;
			((EntityState)this).PlayCrossfade("FullBody, Override", "AirBackSlashContinue", "BaseAttack.playbackRate", duration, 0.1f);
		}

		public override void FixedUpdate()
		{
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: 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_0198: 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)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Expected O, but got Unknown
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_0232: Unknown result type (might be due to invalid IL or missing references)
			//IL_023d: 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_0240: Unknown result type (might be due to invalid IL or missing references)
			//IL_0245: 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_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0282: Unknown result type (might be due to invalid IL or missing references)
			//IL_0284: Unknown result type (might be due to invalid IL or missing references)
			//IL_0289: Unknown result type (might be due to invalid IL or missing references)
			//IL_028b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0290: Unknown result type (might be due to invalid IL or missing references)
			//IL_0292: Unknown result type (might be due to invalid IL or missing references)
			//IL_0297: Unknown result type (might be due to invalid IL or missing references)
			//IL_0299: Unknown result type (might be due to invalid IL or missing references)
			//IL_029e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (landed)
			{
				if (((EntityState)this).fixedAge >= landTime + cooldown && ((EntityState)this).isAuthority)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
				return;
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).characterMotor.velocity.y > -100f)
			{
				((EntityState)this).characterMotor.velocity.y = -100f;
			}
			if (((EntityState)this).fixedAge >= duration || ((EntityState)this).characterMotor.isGrounded)
			{
				Util.PlaySound("Play_Kali_Special_Vert_Fin", ((EntityState)this).gameObject);
				((EntityState)this).PlayCrossfade("FullBody, Override", "AirBackSlashFinish", "BaseAttack.playbackRate", cooldown, 0.1f);
				landed = true;
				landTime = ((EntityState)this).fixedAge;
				if (((EntityState)this).isAuthority)
				{
					shakeEmitter = ((EntityState)this).gameObject.AddComponent<ShakeEmitter>();
					shakeEmitter.amplitudeTimeDecay = true;
					shakeEmitter.duration = 0.2f;
					shakeEmitter.radius = 80f;
					shakeEmitter.scaleShakeRadiusWithLocalScale = false;
					shakeEmitter.wave = new Wave
					{
						amplitude = 0.8f,
						frequency = 30f,
						cycleOffset = 0f
					};
					float num = 8f;
					((BaseState)this).AddRecoil(-0.4f * num, -0.8f * num, -0.3f * num, 0.3f * num);
					CharacterMotor characterMotor = ((EntityState)this).characterMotor;
					characterMotor.velocity *= 0.1f;
					CharacterBody characterBody = ((EntityState)this).characterBody;
					characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags - 1);
					EffectData val = new EffectData();
					val.origin = ((EntityState)this).characterBody.footPosition;
					val.scale = 1f;
					EffectManager.SpawnEffect(((EntityState)this).GetComponent<RedMistStatTracker>().groundPoundEffect, val, true);
					float y = ((EntityState)this).characterBody.corePosition.y;
					float num2 = Mathf.Clamp((startY - y) / 10f, 1f, 10f);
					Vector3 footPosition = ((EntityState)this).characterBody.footPosition;
					new BlastAttack
					{
						radius = 10f + num2,
						procCoefficient = 0.8f,
						position = footPosition,
						attacker = ((EntityState)this).gameObject,
						teamIndex = ((EntityState)this).teamComponent.teamIndex,
						crit = ((BaseState)this).RollCrit(),
						baseDamage = trueDamage * 2f * num2,
						damageColorIndex = (DamageColorIndex)0,
						falloffModel = (FalloffModel)0,
						attackerFiltering = (AttackerFiltering)2,
						damageType = DamageTypeCombo.op_Implicit((DamageType)0)
					}.Fire();
					((EntityState)this).characterMotor.velocity.y = 0f;
				}
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			Object.Destroy((Object)(object)shakeEmitter);
		}
	}
	internal class AirBasicAttack : BaseDirectionalSkill
	{
		public override void OnEnter()
		{
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			if (attackIndex > 2)
			{
				attackIndex = 1;
			}
			hitboxName = "AirBasic";
			damageCoefficient = 2f;
			baseDuration = 1f;
			attackStartTime = 0.2f;
			attackEndTime = 0.4f;
			baseEarlyExitTime = 0.4f;
			hitStopDuration = 0.05f;
			swingHopVelocity = 8f;
			pushForce = 0f;
			bonusForce = Vector3.zero;
			swingSoundString = "Ruina_Swipe";
			impactSound = Asset.swordHitSoundHori.index;
			switch (attackIndex)
			{
			case 1:
				muzzleString = "Air1";
				break;
			case 2:
				muzzleString = "Air2";
				break;
			}
			hitEffectPrefab = Asset.swordHitEffect;
			base.OnEnter();
			swingEffectPrefab = statTracker.slashPrefab;
		}

		protected override void PlayAttackAnimation()
		{
			((EntityState)this).PlayCrossfade("FullBody, Override", "AirBasicSlash" + attackIndex, "BaseAttack.playbackRate", duration, 0.1f);
		}

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

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

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

		protected override void FireAttack()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: 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_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			base.FireAttack();
			if (inputVector != Vector2.zero && !inHitPause)
			{
				float num = Mathf.Clamp(0f, 2f, 0.5f * base.trueMoveSpeed);
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				characterMotor.rootMotion += ((EntityState)this).inputBank.moveVector * (num * FlyUpState.speedCoefficientCurve.Evaluate(((EntityState)this).fixedAge / duration) * Time.fixedDeltaTime);
			}
		}

		public override void OnExit()
		{
			base.OnExit();
		}
	}
	internal class BackAttack : BaseDirectionalSkill
	{
		public override void OnEnter()
		{
			//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)
			attackIndex = 1;
			hitboxName = "Back";
			damageCoefficient = 1.75f;
			baseDuration = 1f;
			attackStartTime = 0.4f;
			attackEndTime = 0.6f;
			baseEarlyExitTime = 0.2f;
			hitStopDuration = 0.05f;
			swingSoundString = "Ruina_Swipe";
			impactSound = Asset.swordHitSoundHori.index;
			muzzleString = "BasicSwing3";
			hitEffectPrefab = Asset.swordHitEffect;
			if (attackIndex == 1)
			{
				if (NetworkServer.active)
				{
					((EntityState)this).characterBody.AddBuff(Buffs.HiddenInvincibility);
				}
				AddOverlay(baseDuration * attackStartTime);
			}
			base.OnEnter();
			swingEffectPrefab = statTracker.slashPrefab;
		}

		protected override void PlayAttackAnimation()
		{
			((EntityState)this).PlayCrossfade("FullBody, Override", "BackSlash", "BaseAttack.playbackRate", duration, 0.1f);
		}

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

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

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

		public override void FixedUpdate()
		{
			//IL_0029: 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_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: 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)
			base.FixedUpdate();
			if (stopwatch <= duration * attackEndTime && !inHitPause)
			{
				Vector3 aimDirection = ((EntityState)this).inputBank.aimDirection;
				aimDirection.y = 0f;
				((Vector3)(ref aimDirection)).Normalize();
				float num = 5f;
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				characterMotor.rootMotion -= aimDirection * (num * FlyUpState.speedCoefficientCurve.Evaluate(((EntityState)this).fixedAge / (duration * attackEndTime)) * Time.fixedDeltaTime);
			}
			if (stopwatch > duration * attackStartTime)
			{
				if (NetworkServer.active && ((EntityState)this).characterBody.HasBuff(Buffs.HiddenInvincibility))
				{
					((EntityState)this).characterBody.RemoveBuff(Buffs.HiddenInvincibility);
				}
				RemoveOverlay();
			}
		}

		public override void OnExit()
		{
			if (NetworkServer.active && ((EntityState)this).characterBody.HasBuff(Buffs.HiddenInvincibility))
			{
				((EntityState)this).characterBody.RemoveBuff(Buffs.HiddenInvincibility);
			}
			RemoveOverlay();
			base.OnExit();
		}
	}
	internal class BasicAttack : BaseDirectionalSkill
	{
		public override void OnEnter()
		{
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			if (attackIndex > 3)
			{
				attackIndex = 1;
			}
			hitboxName = "Basic";
			if (attackIndex == 3)
			{
				hitboxName = "BasicThird";
			}
			damageCoefficient = 2f;
			if (attackIndex == 3)
			{
				damageCoefficient = 3f;
			}
			baseDuration = 1.3f;
			attackStartTime = 0.2f;
			attackEndTime = 0.4f;
			baseEarlyExitTime = 0.8f;
			if (attackIndex == 3)
			{
				baseEarlyExitTime = 0.6f;
			}
			hitStopDuration = 0.05f;
			if (attackIndex == 3)
			{
				pushForce = 600f;
			}
			swingSoundString = "Ruina_Swipe";
			impactSound = Asset.swordHitSoundVert.index;
			if (attackIndex == 3)
			{
				impactSound = Asset.swordHitSoundHori.index;
			}
			switch (attackIndex)
			{
			case 1:
				muzzleString = "BasicSwing1";
				break;
			case 2:
				muzzleString = "BasicSwing2";
				break;
			case 3:
				muzzleString = "BasicSwing3";
				break;
			}
			hitEffectPrefab = Asset.swordHitEffect;
			base.OnEnter();
			swingEffectPrefab = statTracker.slashPrefab;
		}

		protected override void PlayAttackAnimation()
		{
			((EntityState)this).PlayCrossfade("FullBody, Override", "BasicSlash" + attackIndex, "BaseAttack.playbackRate", duration, 0.1f);
		}

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

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

		protected override void FireAttack()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			base.FireAttack();
			float num = Mathf.Clamp(0f, 0.5f, 0.5f * base.trueMoveSpeed);
			CharacterMotor characterMotor = ((EntityState)this).characterMotor;
			characterMotor.rootMotion += ((EntityState)this).characterDirection.forward * (num * FlyUpState.speedCoefficientCurve.Evaluate(((EntityState)this).fixedAge / duration) * Time.fixedDeltaTime);
		}

		public override void OnExit()
		{
			base.OnExit();
		}
	}
	public class BasicStringStart : BaseDirectionalSkill
	{
		public override void OnEnter()
		{
			base.OnEnter();
			attackIndex = 0;
		}

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

		protected override void FireAttack()
		{
		}

		public override void FixedUpdate()
		{
			if (((EntityState)this).isAuthority)
			{
				EvaluateInput();
				SetNextState();
			}
		}

		protected override void SetNextState()
		{
			base.SetNextState();
		}
	}
	internal class Block : BaseSkillState
	{
		public float duration = 0.7f;

		public float invulEnd = 0.35f;

		public float hitBonus = 0.6f;

		public bool invul;

		public bool blockOut;

		public float damageCounter;

		public float bonusMult = 1f;

		public float stockBonus = 0.4f;

		public int hits;

		protected TemporaryOverlayInstance iframeOverlay;

		protected RedMistEmotionComponent emotionComponent;

		protected RedMistStatTracker statTracker;

		private float originalHeight;

		private float originalRadius;

		public override void OnEnter()
		{
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Expected O, but got Unknown
			emotionComponent = ((EntityState)this).gameObject.GetComponent<RedMistEmotionComponent>();
			statTracker = ((EntityState)this).gameObject.GetComponent<RedMistStatTracker>();
			if (((EntityState)this).skillLocator.utility.stock > 1)
			{
				bonusMult += (float)(((EntityState)this).skillLocator.utility.stock - 1) * stockBonus;
			}
			AddOverlay(invulEnd);
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddBuff(Buffs.HiddenInvincibility);
			}
			invul = true;
			((BaseState)this).OnEnter();
			Util.PlaySound("Ruina_Swipe", ((EntityState)this).gameObject);
			((EntityState)this).PlayAnimation("FullBody, Override", "BlockIn");
			RiskOfRuinaNetworkManager.ServerOnHit += OnHit;
			CapsuleCollider val = (CapsuleCollider)((EntityState)this).characterBody.mainHurtBox.collider;
			originalHeight = val.height;
			originalRadius = val.radius;
			val.height = originalHeight * 1.5f;
			val.radius = originalRadius * 10f;
		}

		public void OnHit(float damage, GameObject attacker, GameObject victim)
		{
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_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_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: 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_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: 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_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Expected O, but got Unknown
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Unknown result type (might be due to invalid IL or missing references)
			//IL_0211: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)victim == (Object)(object)((EntityState)this).gameObject) || !invul)
			{
				return;
			}
			Util.PlaySound("Play_Defense_Guard", ((EntityState)this).gameObject);
			if (!Object.op_Implicit((Object)(object)attacker) || !Object.op_Implicit((Object)(object)attacker.GetComponent<CharacterBody>()) || !((Object)(object)attacker.GetComponent<CharacterBody>() != (Object)(object)((EntityState)this).characterBody))
			{
				return;
			}
			Vector3 val = attacker.GetComponent<CharacterBody>().footPosition - ((EntityState)this).characterBody.footPosition;
			val.y = 0f;
			((Vector3)(ref val)).Normalize();
			Vector3 forward = ((EntityState)this).characterDirection.forward;
			Vector3 val2 = Vector3.Cross(((EntityState)this).transform.up, forward);
			Vector3 normalized = ((Vector3)(ref val2)).normalized;
			Vector2 val3 = new Vector2(Vector3.Dot(val, forward), Vector3.Dot(val, normalized));
			Vector2 normalized2 = ((Vector2)(ref val3)).normalized;
			if (normalized2.x >= 0.5f)
			{
				((EntityState)this).PlayAnimation("FullBody, Override", "BlockHit");
			}
			else if (normalized2.x <= -0.5f)
			{
				((EntityState)this).PlayAnimation("FullBody, Override", "BlockHitBack");
			}
			else if (normalized2.y >= 0.5f)
			{
				((EntityState)this).PlayAnimation("FullBody, Override", "BlockHitRight");
			}
			else if (normalized2.y <= -0.5f)
			{
				((EntityState)this).PlayAnimation("FullBody, Override", "BlockHitLeft");
			}
			else
			{
				((EntityState)this).PlayAnimation("FullBody, Override", "BlockHit");
			}
			invulEnd = ((EntityState)this).fixedAge + hitBonus;
			duration = invulEnd + hitBonus;
			float num = damage;
			if (Object.op_Implicit((Object)(object)attacker) && Object.op_Implicit((Object)(object)attacker.GetComponent<CharacterBody>()))
			{
				num = damage;
				if (RiskOfRuinaPlugin.kombatArenaInstalled && RiskOfRuinaPlugin.KombatGamemodeActive() && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.master) && RiskOfRuinaPlugin.KombatIsDueling(((EntityState)this).characterBody.master))
				{
					num = damage * 5f;
				}
				damageCounter += num;
				hits++;
			}
			if (((EntityState)this).isAuthority)
			{
				EffectData val4 = new EffectData();
				val4.rotation = Util.QuaternionSafeLookRotation(Vector3.zero);
				val4.origin = ((EntityState)this).characterBody.corePosition;
				EffectManager.SpawnEffect(Asset.blockEffect, val4, true);
			}
		}

		public override void FixedUpdate()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			((EntityState)this).characterMotor.velocity = Vector3.zero;
			if (((EntityState)this).fixedAge >= invulEnd && invul)
			{
				if (NetworkServer.active && ((EntityState)this).characterBody.HasBuff(Buffs.HiddenInvincibility))
				{
					((EntityState)this).characterBody.RemoveBuff(Buffs.HiddenInvincibility);
				}
				RemoveOverlay();
				invul = false;
				CapsuleCollider val = (CapsuleCollider)((EntityState)this).characterBody.mainHurtBox.collider;
				val.height = 1.5f;
				val.radius = 0.2f;
				if (damageCounter > 0f && ((EntityState)this).isAuthority)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new BlockCounter
					{
						damageCounter = damageCounter,
						hits = hits,
						bonusMult = bonusMult
					});
				}
			}
			if (damageCounter > 0f && !((EntityState)this).inputBank.skill3.down && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new BlockCounter
				{
					damageCounter = damageCounter,
					hits = hits,
					bonusMult = bonusMult
				});
			}
			if (((EntityState)this).fixedAge >= invulEnd && !blockOut)
			{
				blockOut = true;
				((EntityState)this).PlayAnimation("FullBody, Override", "BlockOut");
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			//IL_003f: 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)
			if (NetworkServer.active && ((EntityState)this).characterBody.HasBuff(Buffs.HiddenInvincibility))
			{
				((EntityState)this).characterBody.RemoveBuff(Buffs.HiddenInvincibility);
			}
			RemoveOverlay();
			CapsuleCollider val = (CapsuleCollider)((EntityState)this).characterBody.mainHurtBox.collider;
			val.height = 1.5f;
			val.radius = 0.2f;
			RiskOfRuinaNetworkManager.ServerOnHit -= OnHit;
			if (!blockOut)
			{
				((EntityState)this).PlayAnimation("FullBody, Override", "BlockOut");
			}
			((EntityState)this).OnExit();
		}

		protected void AddOverlay(float duration)
		{
			if (Config.iframeOverlay.Value)
			{
				TemporaryOverlayInstance obj = TemporaryOverlayManager.AddOverlay(((Component)((EntityState)this).characterBody).gameObject);
				obj.duration = duration;
				obj.alphaCurve = AnimationCurve.Constant(0f, duration, 0.1f);
				obj.animateShaderAlpha = true;
				obj.destroyComponentOnEnd = true;
				obj.originalMaterial = LegacyResourcesAPI.Load<Material>("Materials/matHuntressFlashBright");
				obj.AddToCharacterModel(((Component)((EntityState)this).modelLocator.modelTransform).GetComponent<CharacterModel>());
			}
		}

		protected void RemoveOverlay()
		{
			if (iframeOverlay != null)
			{
				iframeOverlay.Destroy();
			}
		}

		public override void OnSerialize(NetworkWriter writer)
		{
			((BaseSkillState)this).OnSerialize(writer);
			writer.Write(damageCounter);
			writer.Write(hits);
			writer.Write(invulEnd);
			writer.Write(duration);
		}

		public override void OnDeserialize(NetworkReader reader)
		{
			((BaseSkillState)this).OnDeserialize(reader);
			damageCounter = reader.ReadSingle();
			hits = reader.ReadInt32();
			invulEnd = reader.ReadSingle();
			duration = reader.ReadSingle();
		}
	}
	internal class BlockCounter : BaseSkillState
	{
		public float damageCounter;

		public int hits;

		public float duration = 0.5f;

		public float bonusMult = 1f;

		protected RedMistEmotionComponent emotionComponent;

		protected RedMistStatTracker statTracker;

		protected BlastAttack attack;

		public override void OnEnter()
		{
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Expected O, but got Unknown
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Expected O, but got Unknown
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: Expected O, but got Unknown
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			emotionComponent = ((EntityState)this).gameObject.GetComponent<RedMistEmotionComponent>();
			statTracker = ((EntityState)this).gameObject.GetComponent<RedMistStatTracker>();
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddBuff(Buffs.HiddenInvincibility);
			}
			if (((EntityState)this).isAuthority)
			{
				attack = new BlastAttack();
				attack.damageType = DamageTypeCombo.op_Implicit((DamageType)0);
				attack.procCoefficient = 1f;
				attack.baseForce = 300f;
				attack.bonusForce = Vector3.zero;
				attack.baseDamage = damageCounter * 1.5f * bonusMult;
				attack.crit = ((BaseState)this).RollCrit();
				attack.attacker = ((Component)((EntityState)this).characterBody).gameObject;
				attack.damageColorIndex = (DamageColorIndex)0;
				attack.falloffModel = (FalloffModel)0;
				attack.radius = 15 + Mathf.Clamp(hits, 0, 15);
				attack.inflictor = ((Component)((EntityState)this).characterBody).gameObject;
				attack.position = ((EntityState)this).characterBody.footPosition;
				attack.procCoefficient = 1f;
				attack.teamIndex = TeamComponent.GetObjectTeam(((Component)((EntityState)this).characterBody).gameObject);
				attack.Fire();
			}
			((BaseState)this).OnEnter();
			Util.PlaySound("Play_Kali_Normal_Hori", ((EntityState)this).gameObject);
			((EntityState)this).PlayAnimation("FullBody, Override", "BlockCounter");
			EffectData val = new EffectData();
			val.rotation = Quaternion.identity;
			val.origin = ((EntityState)this).characterBody.footPosition;
			EffectManager.SpawnEffect(statTracker.spinPrefab, val, true);
			if (hits > 5)
			{
				Util.PlaySound("Play_Kali_Special_Vert_Fin", ((EntityState)this).gameObject);
				val = new EffectData();
				val.rotation = Quaternion.identity;
				val.origin = ((EntityState)this).characterBody.footPosition;
				EffectManager.SpawnEffect(statTracker.spinPrefabTwo, val, true);
			}
		}

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

		public override void OnExit()
		{
			if (NetworkServer.active && ((EntityState)this).characterBody.HasBuff(Buffs.HiddenInvincibility))
			{
				((EntityState)this).characterBody.RemoveBuff(Buffs.HiddenInvincibility);
			}
			((EntityState)this).OnExit();
		}
	}
	public class CastPillar : BaseCastChanneledSpellState
	{
		public override void OnEnter()
		{
			baseDuration = 0.5f;
			baseInterval = 0f;
			muzzleString = "HandR";
			muzzleflashEffectPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ImpactEffects/CrocoDiseaseImpactEffect");
			projectilePrefabs.Enqueue(Projectiles.pillarPrefab);
			castSoundString = "Play_Binah_Stone_Ready";
			base.OnEnter();
		}

		protected override void Fire()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: 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_009d: 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_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: 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_00c0: 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)
			if (projectilePrefabs.Count > 0)
			{
				if (((EntityState)this).isAuthority)
				{
					BlastAttack val = new BlastAttack
					{
						attacker = ((EntityState)this).gameObject,
						inflictor = ((EntityState)this).gameObject
					};
					val.teamIndex = TeamComponent.GetObjectTeam(val.attacker);
					val.position = spellPosition;
					val.procCoefficient = 1f;
					val.radius = 12.5f;
					val.baseForce = 2000f;
					val.bonusForce = Vector3.zero;
					val.baseDamage = 5f * ((BaseState)this).damageStat;
					val.falloffModel = (FalloffModel)2;
					val.damageColorIndex = (DamageColorIndex)0;
					val.attackerFiltering = (AttackerFiltering)2;
					val.crit = ((BaseState)this).RollCrit();
					val.damageType = DamageTypeCombo.op_Implicit((DamageType)131072);
					val.Fire();
				}
				base.Fire();
			}
		}

		protected override void PlayCastAnimation()
		{
			((EntityState)this).PlayAnimation("Gesture, Override", "Pillar", "Pillar.playbackRate", baseDuration, 0f);
		}
	}
	public class CastShockwave : BaseCastChanneledSpellState
	{
		private Vector3 storedPosition;

		private int shockwaveNum;

		private ShakeEmitter shakeEmitter;

		public override void OnEnter()
		{
			//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)
			baseDuration = 3.5f;
			baseInterval = 1.5f;
			centered = true;
			muzzleString = "HandR";
			muzzleflashEffectPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ImpactEffects/CrocoDiseaseImpactEffect");
			projectilePrefabs.Enqueue(Projectiles.shockwaveSmallPrefab);
			projectilePrefabs.Enqueue(Projectiles.shockwaveMediumPrefab);
			projectilePrefabs.Enqueue(Projectiles.shockwaveLargePrefab);
			castSoundString = "Play_Binah_Shockwave";
			storedPosition = ((EntityState)this).transform.position;
			base.OnEnter();
		}

		protected override void PlayCastAnimation()
		{
			((EntityState)this).PlayAnimation("Gesture, Override", "CastShockwave", "Shockwave.playbackRate", 0.25f, 0f);
		}

		protected override void Fire()
		{
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: 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_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: 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_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: 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)
			if (projectilePrefabs.Count > 0)
			{
				shakeEmitter = ((EntityState)this).gameObject.AddComponent<ShakeEmitter>();
				shakeEmitter.amplitudeTimeDecay = true;
				shakeEmitter.duration = 1.5f;
				shakeEmitter.radius = 100f;
				shakeEmitter.scaleShakeRadiusWithLocalScale = false;
				shakeEmitter.wave = new Wave
				{
					amplitude = 0.1f,
					frequency = 10f,
					cycleOffset = 0f
				};
				float radius = 40f;
				if (shockwaveNum == 1)
				{
					radius = 40f;
				}
				if (shockwaveNum == 2)
				{
					radius = 40f;
				}
				float num = 5f;
				if (shockwaveNum == 1)
				{
					num = 10f;
				}
				if (shockwaveNum == 2)
				{
					num = 15f;
				}
				if (((EntityState)this).isAuthority)
				{
					BlastAttack val = new BlastAttack
					{
						attacker = ((EntityState)this).gameObject,
						inflictor = ((EntityState)this).gameObject
					};
					val.teamIndex = TeamComponent.GetObjectTeam(val.attacker);
					val.position = ((EntityState)this).transform.position;
					val.procCoefficient = 1f;
					val.radius = radius;
					val.baseForce = 2000f;
					val.bonusForce = Vector3.zero;
					val.baseDamage = num * ((BaseState)this).damageStat;
					val.falloffModel = (FalloffModel)0;
					val.damageColorIndex = (DamageColorIndex)0;
					val.attackerFiltering = (AttackerFiltering)2;
					val.crit = ((BaseState)this).RollCrit();
					val.damageType = DamageTypeCombo.op_Implicit((DamageType)32);
					val.Fire();
				}
				shockwaveNum++;
				base.Fire();
			}
		}

		public override void OnExit()
		{
			base.OnExit();
			((EntityState)this).PlayAnimation("Gesture, Override", "CastShockwaveEnd", "Shockwave.playbackRate", 0.8f, 0f);
		}

		public override void FixedUpdate()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			base.FixedUpdate();
			((EntityState)this).transform.position = storedPosition;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				((EntityState)this).characterMotor.velocity = Vector3.zero;
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)7;
		}
	}
	internal class ChannelPillar : BaseChannelSpellState
	{
		public override void OnEnter()
		{
			chargeEffectPrefab = null;
			maxSpellRadius = 25f;
			baseDuration = 0.25f;
			zooming = false;
			line = true;
			base.OnEnter();
		}

		protected override void PlayChannelAnimation()
		{
			((EntityState)this).PlayAnimation("Gesture, Override", "Channel", "Channel.playbackRate", baseDuration, 0f);
		}

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

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

		protected override BaseCastChanneledSpellState GetNextState()
		{
			return new CastPillar();
		}
	}
	internal class ChannelShockwave : BaseChannelSpellState
	{
		private GameObject chargeEffect;

		public override void OnEnter()
		{
			chargeEffectPrefab = null;
			maxSpellRadius = 40f;
			baseDuration = 0.4f;
			zooming = true;
			centered = true;
			base.OnEnter();
		}

		protected override void PlayChannelAnimation()
		{
			((EntityState)this).PlayAnimation("Gesture, Override", "Channel", "Channel.playbackRate", baseDuration, 0f);
		}

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

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

		protected override BaseCastChanneledSpellState GetNextState()
		{
			return new CastShockwave();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)7;
		}
	}
	public class ChargePillarSpear : BaseChargeSpellState
	{
		private GameObject chargeEffect;

		private Vector3 originalScale;

		public override void OnEnter()
		{
			//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)
			baseDuration = 2f;
			chargeEffectPrefab = null;
			chargeSoundString = "Play_Binah_Stone_Ready";
			crosshairOverridePrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Crosshair/ToolbotGrenadeLauncherCrosshair");
			maxBloomRadius = 0.1f;
			minBloomRadius = 1f;
			base.OnEnter();
			ChildLocator modelChildLocator = ((EntityState)this).GetModelChildLocator();
			if (Object.op_Implicit((Object)(object)modelChildLocator))
			{
				chargeEffect = ((Component)modelChildLocator.FindChild("SpearSummon")).gameObject;
				chargeEffect.SetActive(true);
				originalScale = chargeEffect.transform.localScale;
			}
		}

		public override void FixedUpdate()
		{
			//IL_0012: 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)
			base.FixedUpdate();
			chargeEffect.transform.localScale = originalScale * (1f + CalcCharge());
		}

		public override void OnExit()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			base.OnExit();
			if (Object.op_Implicit((Object)(object)chargeEffect))
			{
				chargeEffect.transform.localScale = originalScale;
				chargeEffect.SetActive(false);
			}
		}

		protected override BaseThrowSpellState GetNextState()
		{
			return new ThrowPillarSpear();
		}
	}
	internal class Dodge : BaseSkillState
	{
		public Vector3 dodgeVector;

		public float duration = 0.65f;

		public float moveEnd = 0.65f;

		public float invulStart;

		public float invulEnd = 0.4f;

		public float stockBonus = 0.05f;

		public bool invul;

		public bool aerial;

		protected TemporaryOverlayInstance iframeOverlay;

		public override void OnEnter()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			dodgeVector = ((EntityState)this).inputBank.moveVector;
			if (!((EntityState)this).characterMotor.isGrounded)
			{
				aerial = true;
				((BaseState)this).SmallHop(((EntityState)this).characterMotor, 10f);
			}
			if (((EntityState)this).skillLocator.utility.stock > 1)
			{
				invulEnd += (float)(((EntityState)this).skillLocator.utility.stock - 1) * stockBonus;
			}
			AddOverlay(invulEnd);
			((BaseState)this).OnEnter();
			Util.PlaySound("Ruina_Swipe", ((EntityState)this).gameObject);
			((EntityState)this).PlayCrossfade("FullBody, Override", "Dodge", "Dodge.playbackRate", duration, 0.1f);
		}

		public override void FixedUpdate()
		{
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: 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)
			((EntityState)this).FixedUpdate();
			if (!aerial)
			{
				if (((EntityState)this).fixedAge <= moveEnd)
				{
					CharacterMotor characterMotor = ((EntityState)this).characterMotor;
					characterMotor.rootMotion += dodgeVector * (3.5f * FlyUpState.speedCoefficientCurve.Evaluate(((EntityState)this).fixedAge / (moveEnd * 1.3f)) * Time.fixedDeltaTime);
					((EntityState)this).characterMotor.velocity.y = 0f;
					CharacterMotor characterMotor2 = ((EntityState)this).characterMotor;
					characterMotor2.moveDirection *= 2f;
				}
			}
			else if (((EntityState)this).fixedAge <= moveEnd)
			{
				CharacterMotor characterMotor3 = ((EntityState)this).characterMotor;
				characterMotor3.rootMotion += dodgeVector * (2f * FlyUpState.speedCoefficientCurve.Evaluate(((EntityState)this).fixedAge / (moveEnd * 1.3f)) * Time.fixedDeltaTime);
				CharacterMotor characterMotor4 = ((EntityState)this).characterMotor;
				characterMotor4.moveDirection *= 2f;
			}
			if (NetworkServer.active && ((EntityState)this).fixedAge >= invulStart && !invul)
			{
				((EntityState)this).characterBody.AddBuff(Buffs.HiddenInvincibility);
				invul = true;
			}
			if (NetworkServer.active && ((EntityState)this).fixedAge >= invulEnd && invul)
			{
				if (((EntityState)this).characterBody.HasBuff(Buffs.HiddenInvincibility))
				{
					((EntityState)this).characterBody.RemoveBuff(Buffs.HiddenInvincibility);
				}
				RemoveOverlay();
				invul = false;
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			if (NetworkServer.active && ((EntityState)this).characterBody.HasBuff(Buffs.HiddenInvincibility))
			{
				((EntityState)this).characterBody.RemoveBuff(Buffs.HiddenInvincibility);
			}
			RemoveOverlay();
			((EntityState)this).OnExit();
		}

		protected void AddOverlay(float duration)
		{
			if (Config.iframeOverlay.Value)
			{
				TemporaryOverlayInstance obj = TemporaryOverlayManager.AddOverlay(((Component)((EntityState)this).characterBody).gameObject);
				obj.duration = duration;
				obj.alphaCurve = AnimationCurve.Constant(0f, duration, 0.1f);
				obj.animateShaderAlpha = true;
				obj.destroyComponentOnEnd = true;
				obj.originalMaterial = LegacyResourcesAPI.Load<Material>("Materials/matHuntressFlashBright");
				obj.AddToCharacterModel(((Component)((EntityState)this).modelLocator.modelTransform).GetComponent<CharacterModel>());
			}
		}

		protected void RemoveOverlay()
		{
			if (iframeOverlay != null)
			{
				iframeOverlay.Destroy();
			}
		}
	}
	internal class EGOActivate : BaseSkillState
	{
		public static float baseDuration = 1f;

		private float duration;

		private Vector3 storedPosition;

		private Animator modelAnimator;

		public override void OnEnter()
		{
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = baseDuration;
			modelAnimator = ((EntityState)this).GetModelAnimator();
			((EntityState)this).characterBody.hideCrosshair = true;
			if (Object.op_Implicit((Object)(object)modelAnimator))
			{
				modelAnimator.SetBool("isMoving", false);
				modelAnimator.SetBool("isSprinting", false);
			}
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddBuff(Buffs.HiddenInvincibility);
			}
			EntityStateMachine[] components = ((EntityState)this).gameObject.GetComponents<EntityStateMachine>();
			foreach (EntityStateMachine val in components)
			{
				if (Object.op_Implicit((Object)(object)val))
				{
					if (val.customName == "Weapon")
					{
						val.SetNextStateToMain();
					}
					if (val.customName == "Slide")
					{
						val.SetNextStateToMain();
					}
				}
			}
			((EntityState)this).gameObject.GetComponent<RedMistEmotionComponent>();
			((EntityState)this).PlayAnimation("Gesture, Override", "BufferEmpty");
			((EntityState)this).PlayAnimation("FullBody, Override", "EGOActivate", "EGOActivate.playbackRate", duration, 0f);
			Util.PlaySound("Play_Kali_Change", ((EntityState)this).gameObject);
			((EntityState)this).cameraTargetParams.cameraParams = CameraParams.EGOActivateCameraParamsRedMist;
			storedPosition = ((EntityState)this).transform.position;
		}

		public override void FixedUpdate()
		{
			//IL_000d: 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_003b: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			((EntityState)this).transform.position = storedPosition;
			((EntityState)this).characterBody.isSprinting = false;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				((EntityState)this).characterMotor.velocity = Vector3.zero;
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new EGOActivateOut());
			}
		}

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)7;
		}
	}
	internal class EGOActivateOut : BaseSkillState
	{
		public static float baseDuration = 1f;

		public static float shockwaveRadius = 15f;

		public static float shockwaveForce = 8000f;

		public static float shockwaveBonusForce = 1500f;

		private float duration;

		private AimRequest aimRequest;

		private RedMistEmotionComponent EGOController;

		private RedMistStatTracker statTracker;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration;
			EGOController = ((EntityState)this).gameObject.GetComponent<RedMistEmotionComponent>();
			statTracker = ((EntityState)this).gameObject.GetComponent<RedMistStatTracker>();
			((EntityState)this).PlayAnimation("FullBody, Override", "BufferEmpty");
			((EntityState)this).PlayAnimation("FullBody, Override", "EGOActivateOut", "EGOActivate.playbackRate", duration, 0f);
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddBuff(Buffs.EGOBuff);
			}
			((EntityState)this).cameraTargetParams.cameraParams = CameraParams.EGOActivateOutCameraParamsRedMist;
			aimRequest = ((EntityState)this).cameraTargetParams.RequestAimType((AimType)2);
			FireShockwave();
			if ((Object)(object)((EntityState)this).skillLocator.utility.baseSkill == (Object)(object)RedMist.NormalBlock)
			{
				((EntityState)this).skillLocator.utility.SetSkillOverride((object)((EntityState)this).skillLocator.utility, RedMist.EGOBlock, (SkillOverridePriority)4);
			}
			else if ((Object)(object)((EntityState)this).skillLocator.utility.baseSkill == (Object)(object)RedMist.NormalDodge)
			{
				((EntityState)this).skillLocator.utility.SetSkillOverride((object)((EntityState)this).skillLocator.utility, RedMist.EGODodge, (SkillOverridePriority)4);
			}
			((EntityState)this).skillLocator.special.SetSkillOverride((object)((EntityState)this).skillLocator.special, RedMist.HorizontalSlash, (SkillOverridePriority)4);
		}

		private void FireShockwave()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: 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_0079: 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_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: 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_00b1: 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_00c0: 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_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			Util.PlaySound("Play_Effect_Index_Unlock", ((EntityState)this).gameObject);
			EffectData val = new EffectData();
			val.origin = ((EntityState)this).characterBody.corePosition;
			val.scale = 1f;
			EffectManager.SpawnEffect(statTracker.EGOActivatePrefab, val, false);
			if (((EntityState)this).isAuthority)
			{
				BlastAttack val2 = new BlastAttack
				{
					attacker = ((EntityState)this).gameObject,
					inflictor = ((EntityState)this).gameObject
				};
				val2.teamIndex = TeamComponent.GetObjectTeam(val2.attacker);
				val2.position = ((EntityState)this).characterBody.corePosition;
				val2.procCoefficient = 0f;
				val2.radius = shockwaveRadius;
				val2.baseForce = shockwaveForce;
				val2.bonusForce = Vector3.up * shockwaveBonusForce;
				val2.baseDamage = 0f;
				val2.falloffModel = (FalloffModel)0;
				val2.damageColorIndex = (DamageColorIndex)3;
				val2.attackerFiltering = (AttackerFiltering)2;
				val2.Fire();
			}
			if (Object.op_Implicit((Object)(object)EGOController))
			{
				EGOController.EnterEGO();
			}
		}

		public override void FixedUpdate()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			((EntityState)this).characterMotor.velocity = Vector3.zero;
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			((EntityState)this).cameraTargetParams.cameraParams = CameraParams.defaultCameraParamsRedMist;
			AimRequest obj = aimRequest;
			if (obj != null)
			{
				obj.Dispose();
			}
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.RemoveBuff(Buffs.HiddenInvincibility);
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)5;
		}
	}
	internal class EGOAirBackAttack : BaseDirectionalSkill
	{
		public override void OnEnter()
		{
			//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_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			attackIndex = 1;
			hitboxName = "EGOAirBasic";
			damageCoefficient = 2f;
			baseDuration = 0.25f;
			attackStartTime = 0.5f;
			attackEndTime = 0.8f;
			baseEarlyExitTime = 0f;
			hitStopDuration = 0.05f;
			swingSoundString = "Ruina_Swipe";
			impactSound = Asset.swordHitEGOSoundVert.index;
			muzzleString = "SwingLeft";
			hitEffectPrefab = Asset.swordHitEffect;
			bonusForce = Vector3.down * 900f;
			base.OnEnter();
			swingEffectPrefab = statTracker.EGOSlashPrefab;
		}

		public override void FixedUpdate()
		{
			base.FixedUpdate();
			((EntityState)this).characterMotor.velocity.y = 0f;
			if (stopwatch > duration * attackEndTime && !inHitPause)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new AirBackFallingAttack());
			}
		}

		protected override void PlayAttackAnimation()
		{
			((EntityState)this).PlayCrossfade("FullBody, Override", "EGOAirBackSlash", "BaseAttack.playbackRate", duration, 0.1f);
		}

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

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

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

		public override void OnExit()
		{
			base.OnExit();
		}
	}
	internal class EGOAirBackFallingAttack : BaseSkillState
	{
		private float duration = 10f;

		private float cooldown = 0.3f;

		private float landTime;

		private bool landed;

		public ShakeEmitter shakeEmitter;

		private float startY;

		protected float trueDamage => ((BaseState)this).damageStat;

		public override void OnEnter()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			CharacterBody characterBody = ((EntityState)this).characterBody;
			characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags | 1);
			if (((EntityState)this).isAuthority)
			{
				((EntityState)this).characterMotor.velocity.y = -60f;
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				characterMotor.rootMotion.y = characterMotor.rootMotion.y - 0.5f;
				((EntityState)this).characterMotor.velocity.x = 0f;
				((EntityState)this).characterMotor.velocity.z = 0f;
			}
			startY = ((EntityState)this).characterBody.corePosition.y;
			((EntityState)this).PlayCrossfade("FullBody, Override", "EGOAirBackSlashContinue", "BaseAttack.playbackRate", duration, 0.1f);
		}

		public override void FixedUpdate()
		{
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: 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_0198: 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)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Expected O, but got Unknown
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_0232: Unknown result type (might be due to invalid IL or missing references)
			//IL_023d: 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_0240: Unknown result type (might be due to invalid IL or missing references)
			//IL_0245: 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_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0282: Unknown result type (might be due to invalid IL or missing references)
			//IL_0284: Unknown result type (might be due to invalid IL or missing references)
			//IL_0289: Unknown result type (might be due to invalid IL or missing references)
			//IL_028b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0290: Unknown result type (might be due to invalid IL or missing references)
			//IL_0292: Unknown result type (might be due to invalid IL or missing references)
			//IL_0297: Unknown result type (might be due to invalid IL or missing references)
			//IL_0299: Unknown result type (might be due to invalid IL or missing references)
			//IL_029e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a3: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (landed)
			{
				if (((EntityState)this).fixedAge >= landTime + cooldown && ((EntityState)this).isAuthority)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
				return;
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).characterMotor.velocity.y > -100f)
			{
				((EntityState)this).characterMotor.velocity.y = -100f;
			}
			if (((EntityState)this).fixedAge >= duration || ((EntityState)this).characterMotor.isGrounded)
			{
				Util.PlaySound("Play_Kali_Special_Vert_Fin", ((EntityState)this).gameObject);
				((EntityState)this).PlayCrossfade("FullBody, Override", "EGOAirBackSlashFinish", "BaseAttack.playbackRate", cooldown, 0.1f);
				landed = true;
				landTime = ((EntityState)this).fixedAge;
				if (((EntityState)this).isAuthority)
				{
					shakeEmitter = ((EntityState)this).gameObject.AddComponent<ShakeEmitter>();
					shakeEmitter.amplitudeTimeDecay = true;
					shakeEmitter.duration = 0.2f;
					shakeEmitter.radius = 80f;
					shakeEmitter.scaleShakeRadiusWithLocalScale = false;
					shakeEmitter.wave = new Wave
					{
						amplitude = 0.8f,
						frequency = 30f,
						cycleOffset = 0f
					};
					float num = 8f;
					((BaseState)this).AddRecoil(-0.4f * num, -0.8f * num, -0.3f * num, 0.3f * num);
					CharacterMotor characterMotor = ((EntityState)this).characterMotor;
					characterMotor.velocity *= 0.1f;
					CharacterBody characterBody = ((EntityState)this).characterBody;
					characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags - 1);
					EffectData val = new EffectData();
					val.origin = ((EntityState)this).characterBody.footPosition;
					val.scale = 1f;
					EffectManager.SpawnEffect(((EntityState)this).GetComponent<RedMist