Decompiled source of Rimuru Tempest Mod v1.1.1

RimuruTempestMod.dll

Decompiled 3 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EmotesAPI;
using EntityStates;
using EntityStates.ClayGrenadier;
using EntityStates.Commando;
using EntityStates.HermitCrab;
using EntityStates.Huntress;
using EntityStates.Merc;
using EntityStates.RoboBallBoss.Weapon;
using EntityStates.ScavMonster;
using HG;
using HG.BlendableTypes;
using KinematicCharacterController;
using On.RoR2;
using R2API;
using R2API.Networking;
using R2API.Networking.Interfaces;
using R2API.Utils;
using RimuruMod.Content.BuffControllers;
using RimuruMod.Modules;
using RimuruMod.Modules.Characters;
using RimuruMod.Modules.Networking;
using RimuruMod.Modules.Survivors;
using RimuruMod.SkillStates;
using RimuruMod.SkillStates.BaseStates;
using RimuruMod.SkillStates.Rimuru;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.Audio;
using RoR2.ContentManagement;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.Skills;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("RimuruTempestMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+084d96de22a5902b942649f2effb55c2374522b4")]
[assembly: AssemblyProduct("RimuruTempestMod")]
[assembly: AssemblyTitle("RimuruTempestMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: UnverifiableCode]
namespace RimuruMod
{
	internal static class Log
	{
		internal static ManualLogSource _logSource;

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

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

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

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

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

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

		internal static void Warning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.PopcornFactory.RimuruTempestMod", "RimuruTempestMod", "1.1.1")]
	public class RimuruPlugin : BaseUnityPlugin
	{
		public const string MODUID = "com.PopcornFactory.RimuruTempestMod";

		public const string MODNAME = "RimuruTempestMod";

		public const string MODVERSION = "1.1.1";

		public const string DEVELOPER_PREFIX = "POPCORN";

		public static RimuruPlugin instance;

		public RimuruController Rimurucon;

		public RimuruMasterController Rimurumastercon;

		private void Awake()
		{
			instance = this;
			Log.Init(((BaseUnityPlugin)this).Logger);
			AssetsRimuru.Initialize();
			Config.ReadConfig();
			if (Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"))
			{
				Config.SetupRiskOfOptions();
			}
			States.RegisterStates();
			Buffs.RegisterBuffs();
			Projectiles.RegisterProjectiles();
			Tokens.AddTokens();
			ItemDisplays.PopulateDisplays();
			Damage.SetupModdedDamage();
			new RimuruHuman().Initialize(isHidden: false);
			new RimuruSlime().Initialize(isHidden: true);
			new ContentPacks().Initialize();
			StaticValues.LoadDictionary();
			NetworkingAPI.RegisterMessageType<ItemDropNetworked>();
			NetworkingAPI.RegisterMessageType<HealNetworkRequest>();
			NetworkingAPI.RegisterMessageType<PeformDirectionalForceNetworkRequest>();
			NetworkingAPI.RegisterMessageType<SetDashStateMachine>();
			NetworkingAPI.RegisterMessageType<GravityPulsePullRequest>();
			NetworkingAPI.RegisterMessageType<OrbDamageRequest>();
			NetworkingAPI.RegisterMessageType<UpdateControllers>();
			Hook();
		}

		private void Hook()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Expected O, but got Unknown
			CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats);
			CharacterModel.UpdateOverlays += new hook_UpdateOverlays(CharacterModel_UpdateOverlays);
			GlobalEventManager.OnHitEnemy += new hook_OnHitEnemy(GlobalEventManager_OnHitEnemy);
			HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage);
			CharacterModel.Awake += new hook_Awake(CharacterModel_Awake);
			CharacterBody.OnDeathStart += new hook_OnDeathStart(CharacterBody_OnDeathStart);
			if (Chainloader.PluginInfos.ContainsKey("com.weliveinasociety.CustomEmotesAPI"))
			{
				SurvivorCatalog.Init += new hook_Init(SurvivorCatalog_Init);
			}
		}

		private void CharacterModel_Start(orig_Start orig, CharacterModel self)
		{
			orig.Invoke(self);
		}

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

		private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
		{
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Invalid comparison between Unknown and I4
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//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_01d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Invalid comparison between Unknown and I4
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Invalid comparison between Unknown and I4
			//IL_015d: 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_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Invalid comparison between Unknown and I4
			if (Object.op_Implicit((Object)(object)self))
			{
				if (damageInfo != null && Object.op_Implicit((Object)(object)damageInfo.attacker) && Object.op_Implicit((Object)(object)damageInfo.attacker.GetComponent<CharacterBody>()))
				{
					if (((Component)self).GetComponent<CharacterBody>().HasBuff(Buffs.CritDebuff) && (int)self.body.teamComponent.teamIndex != 1 && (int)DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)67108864)) != 67108864)
					{
						if (Config.doubleInsteadOfCrit.Value)
						{
							damageInfo.damage *= 2f;
						}
						else
						{
							damageInfo.crit = true;
						}
					}
					if ((int)damageInfo.attacker.GetComponent<CharacterBody>().teamComponent.teamIndex == 1 && damageInfo.attacker.GetComponent<CharacterBody>().HasBuff(Buffs.CritDebuff) && (int)DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)67108864)) != 67108864)
					{
						if (Config.doubleInsteadOfCrit.Value)
						{
							damageInfo.damage *= 2f;
						}
						else
						{
							damageInfo.crit = true;
						}
					}
					if (DamageAPI.HasModdedDamageType(damageInfo, Damage.rimuruDevour))
					{
						NetworkingHelpers.ApplyBuff(self.body, Buffs.rimuruDevourDebuff.buffIndex, 1, -1f);
					}
				}
				if (damageInfo != null && self.body.HasBuff(Buffs.immuneToFallDamage))
				{
					DamageType val = (DamageType)2097153;
					DamageType val2 = (DamageType)2359296;
					if (DamageTypeCombo.op_Implicit(damageInfo.damageType) == val || DamageTypeCombo.op_Implicit(damageInfo.damageType) == val2)
					{
						damageInfo.damage = 0f;
						damageInfo.rejected = true;
					}
				}
			}
			orig.Invoke(self, damageInfo);
		}

		private void GlobalEventManager_OnHitEnemy(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
		{
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Invalid comparison between Unknown and I4
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Invalid comparison between Unknown and I4
			//IL_0311: Unknown result type (might be due to invalid IL or missing references)
			//IL_0316: Unknown result type (might be due to invalid IL or missing references)
			//IL_0320: Invalid comparison between Unknown and I4
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Expected O, but got Unknown
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//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_0168: 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_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: 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_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: 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_0224: Unknown result type (might be due to invalid IL or missing references)
			//IL_0242: Expected O, but got Unknown
			//IL_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_0265: Unknown result type (might be due to invalid IL or missing references)
			//IL_026a: Unknown result type (might be due to invalid IL or missing references)
			//IL_026f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0271: Unknown result type (might be due to invalid IL or missing references)
			//IL_0276: Unknown result type (might be due to invalid IL or missing references)
			//IL_0288: Unknown result type (might be due to invalid IL or missing references)
			//IL_028e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0293: Unknown result type (might be due to invalid IL or missing references)
			//IL_0298: Unknown result type (might be due to invalid IL or missing references)
			//IL_029b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02df: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0341: Unknown result type (might be due to invalid IL or missing references)
			//IL_0346: Unknown result type (might be due to invalid IL or missing references)
			//IL_034d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0358: Unknown result type (might be due to invalid IL or missing references)
			//IL_036d: Expected O, but got Unknown
			//IL_036e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0373: Unknown result type (might be due to invalid IL or missing references)
			//IL_0384: Unknown result type (might be due to invalid IL or missing references)
			//IL_0390: Unknown result type (might be due to invalid IL or missing references)
			//IL_0395: Unknown result type (might be due to invalid IL or missing references)
			//IL_039a: Unknown result type (might be due to invalid IL or missing references)
			//IL_039c: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03be: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0402: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, damageInfo, victim);
			if (!Object.op_Implicit((Object)(object)damageInfo.attacker))
			{
				return;
			}
			CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
			CharacterBody component2 = victim.GetComponent<CharacterBody>();
			if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component2))
			{
				if (component2.HasBuff(Buffs.WetDebuff) && !component2.HasBuff(Buffs.WetLightningDebuff) && damageInfo.damage > 0f && (int)DamageTypeCombo.op_Implicit(damageInfo.damageType) == 16777216)
				{
					NetworkingHelpers.ApplyBuff(component2, Buffs.WetLightningDebuff.buffIndex, 1, 1f);
					EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/effects/LightningStakeNova"), new EffectData
					{
						origin = component2.transform.position,
						scale = Config.blackLightningRadius.Value * component.attackSpeed / 2f
					}, true);
					new BlastAttack
					{
						attacker = damageInfo.attacker.gameObject,
						teamIndex = TeamComponent.GetObjectTeam(damageInfo.attacker.gameObject),
						falloffModel = (FalloffModel)0,
						baseDamage = component.damage * Config.blackLightningDamageCoefficient.Value,
						damageType = DamageTypeCombo.op_Implicit((DamageType)16777216),
						damageColorIndex = (DamageColorIndex)5,
						baseForce = 0f,
						position = component2.transform.position,
						radius = Config.blackLightningRadius.Value * component.attackSpeed / 2f,
						procCoefficient = 1f,
						attackerFiltering = (AttackerFiltering)2
					}.Fire();
				}
				if (component2.HasBuff(Buffs.WetDebuff) && damageInfo.damage > 0f && (int)DamageTypeCombo.op_Implicit(damageInfo.damageType) == 128)
				{
					NetworkingHelpers.ApplyBuff(component2, Buffs.WetDebuff.buffIndex, 0, 0f);
					EffectManager.SpawnEffect(AssetsRimuru.elderlemurianexplosionEffect, new EffectData
					{
						origin = component2.transform.position,
						scale = 15f * component.attackSpeed / 2f
					}, true);
					new BlastAttack
					{
						attacker = damageInfo.attacker.gameObject,
						teamIndex = TeamComponent.GetObjectTeam(damageInfo.attacker.gameObject),
						falloffModel = (FalloffModel)0,
						baseDamage = component.damage * 4f,
						damageType = DamageTypeCombo.op_Implicit((DamageType)128),
						damageColorIndex = (DamageColorIndex)11,
						baseForce = 0f,
						position = component2.transform.position,
						radius = 15f * component.attackSpeed / 2f,
						procCoefficient = 1f,
						attackerFiltering = (AttackerFiltering)2
					}.Fire();
				}
				if (component2.HasBuff(Buffs.OnFire) && damageInfo.damage > 0f && (int)DamageTypeCombo.op_Implicit(damageInfo.damageType) == 16777216)
				{
					int buffCount = component2.GetBuffCount(Buffs.OnFire);
					EffectManager.SpawnEffect(AssetsRimuru.elderlemurianexplosionEffect, new EffectData
					{
						origin = component2.transform.position,
						scale = 1f * (float)buffCount
					}, true);
					new BlastAttack
					{
						attacker = damageInfo.attacker.gameObject,
						teamIndex = TeamComponent.GetObjectTeam(damageInfo.attacker.gameObject),
						falloffModel = (FalloffModel)0,
						baseDamage = component.damage * (float)buffCount,
						damageType = DamageTypeCombo.op_Implicit((DamageType)32),
						damageColorIndex = (DamageColorIndex)5,
						baseForce = 0f,
						position = component2.transform.position,
						radius = 1f * (float)buffCount,
						procCoefficient = 1f,
						attackerFiltering = (AttackerFiltering)2
					}.Fire();
				}
			}
		}

		private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self)
		{
			if (!Object.op_Implicit((Object)(object)((self != null) ? self.healthComponent : null)))
			{
				return;
			}
			orig.Invoke(self);
			if (!Object.op_Implicit((Object)(object)self))
			{
				return;
			}
			if (self.HasBuff(Buffs.tarManipDebuff))
			{
				self.attackSpeed *= 0.7f;
			}
			if (self.HasBuff(Buffs.SpatialMovementBuff))
			{
				self.armor += 50f;
			}
			if (self.HasBuff(Buffs.CritDebuff))
			{
				AnalyzeEffectController component = ((Component)self).gameObject.GetComponent<AnalyzeEffectController>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					component = ((Component)self).gameObject.AddComponent<AnalyzeEffectController>();
					component.charbody = self;
				}
			}
			if (self.HasBuff(Buffs.WetDebuff))
			{
				WetEffectController component2 = ((Component)self).gameObject.GetComponent<WetEffectController>();
				if (!Object.op_Implicit((Object)(object)component2))
				{
					component2 = ((Component)self).gameObject.AddComponent<WetEffectController>();
					component2.charbody = self;
				}
			}
		}

		private void CharacterBody_OnDeathStart(orig_OnDeathStart orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (self.baseNameToken == "POPCORN_RIMURUSLIME_BODY_NAME" || self.baseNameToken == "POPCORN_RIMURUHUMAN_BODY_NAME")
			{
				AkSoundEngine.PostEvent("RimuruDeath", ((Component)self).gameObject);
			}
		}

		private void CharacterModel_Awake(orig_Awake orig, CharacterModel self)
		{
			orig.Invoke(self);
			if (((Object)((Component)self).gameObject).name.Contains("RimuruHumanDisplay"))
			{
				AkSoundEngine.PostEvent("RimuruEntrance", ((Component)self).gameObject);
			}
		}

		private void CharacterModel_UpdateOverlays(orig_UpdateOverlays orig, CharacterModel self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body))
			{
				OverlayFunction(AssetsRimuru.SpatialMovementBuffMaterial, self.body.HasBuff(Buffs.SpatialMovementBuff), self);
			}
		}

		private void OverlayFunction(Material overlayMaterial, bool condition, CharacterModel model)
		{
			if (model.activeOverlayCount < CharacterModel.maxOverlays && condition)
			{
				Material[] currentOverlays = model.currentOverlays;
				int activeOverlayCount = model.activeOverlayCount;
				model.activeOverlayCount = activeOverlayCount + 1;
				currentOverlays[activeOverlayCount] = overlayMaterial;
			}
		}
	}
}
namespace RimuruMod.SkillStates
{
	public class Gliding : BaseState
	{
		private Animator rimuruAnim;

		private static float slowestDescent = -3f;

		private VultureBuffController vultureBuffController;

		private bool doNothing;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			rimuruAnim = ((EntityState)this).GetModelAnimator();
			rimuruAnim.SetBool("isGliding", true);
			((EntityState)this).PlayCrossfade("FullBody, Override", "Sprint1", 0.15f);
			vultureBuffController = ((Component)((EntityState)this).characterBody.master).GetComponent<VultureBuffController>();
			doNothing = false;
		}

		public override void FixedUpdate()
		{
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (!((EntityState)this).isAuthority)
			{
				return;
			}
			if (Object.op_Implicit((Object)(object)vultureBuffController))
			{
				if (!vultureBuffController.flightExpired || ((EntityState)this).characterMotor.isGrounded || ((EntityState)this).characterMotor.velocity.y > 0f)
				{
					doNothing = true;
				}
				else
				{
					doNothing = false;
				}
			}
			if (!doNothing)
			{
				float num = ((EntityState)this).characterMotor.velocity.y / 1.5f;
				if (num > slowestDescent)
				{
					num = slowestDescent;
				}
				num = Mathf.MoveTowards(num, Config.glideSpeed.Value, Config.glideAcceleration.Value * Time.fixedDeltaTime * (((EntityState)this).characterBody.HasBuff(Buffs.flightBuff) ? 0.5f : 1f));
				((EntityState)this).characterMotor.velocity = new Vector3(((EntityState)this).characterMotor.velocity.x, num, ((EntityState)this).characterMotor.velocity.z);
			}
		}

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)5;
		}
	}
	public class Dash : BaseSkillState
	{
		private bool startedStateGrounded;

		private Vector3 forwardDirection;

		private float baseslideDuration = 0.3f;

		private float basejumpDuration = 0.3f;

		private float slideDuration;

		private float jumpDuration;

		private CharacterModel characterModel;

		private HurtBoxGroup hurtboxGroup;

		public override void OnEnter()
		{
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: 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_0175: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			slideDuration = baseslideDuration / ((BaseState)this).attackSpeedStat;
			jumpDuration = basejumpDuration / ((BaseState)this).attackSpeedStat;
			((EntityState)this).GetModelAnimator().SetFloat("Attack.playbackRate", ((BaseState)this).attackSpeedStat);
			((EntityState)this).PlayAnimation("FullBody, Override", "DashAttack");
			if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				CharacterDirection characterDirection = ((EntityState)this).characterDirection;
				Vector3 val = ((((EntityState)this).inputBank.moveVector == Vector3.zero) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.moveVector);
				characterDirection.forward = ((Vector3)(ref val)).normalized;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				startedStateGrounded = ((EntityState)this).characterMotor.isGrounded;
			}
			if (!startedStateGrounded)
			{
				Vector3 velocity = ((EntityState)this).characterMotor.velocity;
				velocity.y = ((EntityState)this).characterBody.jumpPower;
				((EntityState)this).characterMotor.velocity = velocity;
				return;
			}
			if (Object.op_Implicit((Object)(object)characterModel))
			{
				CharacterModel obj = characterModel;
				obj.invisibilityCount++;
			}
			if (Object.op_Implicit((Object)(object)hurtboxGroup))
			{
				HurtBoxGroup val2 = hurtboxGroup;
				int hurtBoxesDeactivatorCounter = val2.hurtBoxesDeactivatorCounter + 1;
				val2.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter;
			}
			CreateBlinkEffect(Util.GetCorePosition(((EntityState)this).gameObject));
			Util.PlaySound(Assaulter2.endSoundString, ((EntityState)this).gameObject);
		}

		private void CreateBlinkEffect(Vector3 origin)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			EffectData val = new EffectData();
			val.rotation = Util.QuaternionSafeLookRotation(forwardDirection);
			val.origin = origin;
			EffectManager.SpawnEffect(EvisDash.blinkPrefab, val, false);
		}

		public override void OnExit()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).OnExit();
			CreateBlinkEffect(Util.GetCorePosition(((EntityState)this).gameObject));
			if (Object.op_Implicit((Object)(object)characterModel))
			{
				CharacterModel obj = characterModel;
				obj.invisibilityCount--;
			}
			if (Object.op_Implicit((Object)(object)hurtboxGroup))
			{
				HurtBoxGroup val = hurtboxGroup;
				int hurtBoxesDeactivatorCounter = val.hurtBoxesDeactivatorCounter - 1;
				val.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter;
			}
			((EntityState)this).PlayAnimation("FullBody, Override", "BufferEmpty");
		}

		public override void FixedUpdate()
		{
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority)
			{
				float num = (startedStateGrounded ? slideDuration : jumpDuration);
				if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
				{
					((EntityState)this).characterDirection.moveVector = ((EntityState)this).inputBank.moveVector;
					forwardDirection = ((EntityState)this).characterDirection.forward;
				}
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
				{
					float num2 = ((!startedStateGrounded) ? SlideState.jumpforwardSpeedCoefficientCurve.Evaluate(((EntityState)this).fixedAge / num) : SlideState.forwardSpeedCoefficientCurve.Evaluate(((EntityState)this).fixedAge / num));
					CharacterMotor characterMotor = ((EntityState)this).characterMotor;
					characterMotor.rootMotion += num2 * ((BaseState)this).moveSpeedStat * ((BaseState)this).attackSpeedStat * forwardDirection * Time.fixedDeltaTime * 5f;
				}
				if (((EntityState)this).fixedAge >= num)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)5;
		}
	}
	public class BlackLightning : BaseSkillState
	{
		public RimuruController Rimurucon;

		private DamageType damageType;

		private Ray aimRay;

		private bool beamPlay;

		private float basefireInterval = 0.25f;

		private float fireInterval;

		private float basetotalDuration = Config.blackLightningTotalDuration.Value;

		private float totalDuration;

		private float range = 60f;

		private float damageCoefficient = Config.blackLightningDamageCoefficient.Value;

		private float procCoefficient = Config.blackLightningProcCoefficient.Value;

		private float force = 100f;

		private float fireTimer;

		public string muzzleString = "LWrist";

		public uint loopID;

		private GameObject blacklightning = Object.Instantiate<GameObject>(AssetsRimuru.blacklightning);

		private ParticleSystem mainBlacklightning;

		private BulletAttack attack;

		private BlastAttack blastAttack;

		private Animator animator;

		public override void OnEnter()
		{
			//IL_0045: 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_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: 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_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: 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_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_020e: 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_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_0242: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_0264: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			updateAimRay();
			((EntityState)this).characterBody.SetAimTimer(2f);
			totalDuration = basetotalDuration;
			fireInterval = basefireInterval / ((BaseState)this).attackSpeedStat;
			damageType = (DamageType)16777216;
			if (((EntityState)this).characterBody.HasBuff(Buffs.poisonMeleeBuff))
			{
				damageType = (DamageType)(damageType | 0x100000);
			}
			Rimurucon = ((EntityState)this).gameObject.GetComponent<RimuruController>();
			animator = ((EntityState)this).GetModelAnimator();
			((EntityState)this).GetModelAnimator().SetFloat("Attack.playbackRate", ((BaseState)this).attackSpeedStat);
			animator.SetBool("attacking", true);
			((EntityState)this).PlayCrossfade("LeftArm, Override", "BlackLightning", "Attack.playbackRate", fireInterval / 2f, 0.05f);
			loopID = AkSoundEngine.PostEvent("RimuruThunder", ((EntityState)this).gameObject);
			EffectManager.SimpleMuzzleFlash(AssetsRimuru.blacklightning, ((EntityState)this).gameObject, muzzleString, false);
			fireTimer = 0f;
			((EntityState)this).characterBody.SetAimTimer(2f);
			beamPlay = false;
			attack = new BulletAttack
			{
				bulletCount = 1u,
				aimVector = ((Ray)(ref aimRay)).direction,
				origin = ((Ray)(ref aimRay)).origin,
				damage = ((BaseState)this).damageStat * damageCoefficient,
				damageColorIndex = (DamageColorIndex)0,
				damageType = DamageTypeCombo.op_Implicit(damageType),
				falloffModel = (FalloffModel)0,
				maxDistance = range,
				force = 0f,
				hitMask = CommonMasks.bullet,
				minSpread = 0f,
				maxSpread = 0f,
				isCrit = ((BaseState)this).RollCrit(),
				owner = ((EntityState)this).gameObject,
				muzzleName = muzzleString,
				smartCollision = false,
				procChainMask = default(ProcChainMask),
				procCoefficient = procCoefficient,
				radius = 1f,
				sniper = false,
				stopperMask = ((LayerIndex)(ref LayerIndex.noCollision)).mask,
				weapon = null,
				spreadPitchScale = 0f,
				spreadYawScale = 0f,
				queryTriggerInteraction = (QueryTriggerInteraction)0,
				hitEffectPrefab = AssetsRimuru.blacklightningimpactEffect
			};
		}

		public override void Update()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: 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)
			((EntityState)this).Update();
			updateAimRay();
			if (beamPlay)
			{
				((EntityState)this).characterDirection.forward = ((Ray)(ref aimRay)).direction;
				blacklightning.transform.position = ((Component)((BaseState)this).FindModelChild(muzzleString)).transform.position;
				blacklightning.transform.rotation = Quaternion.LookRotation(((Ray)(ref aimRay)).direction);
			}
		}

		public void updateAimRay()
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			aimRay = ((BaseState)this).GetAimRay();
		}

		public override void OnExit()
		{
			animator.SetBool("attacking", false);
			((EntityState)this).PlayCrossfade("LeftArm, Override", "BufferEmpty", "Attack.playbackRate", 0.1f, 0.1f);
			((EntityState)this).OnExit();
			AkSoundEngine.StopPlayingID(loopID);
			mainBlacklightning.Stop();
			if (NetworkServer.active)
			{
				NetworkServer.Destroy(blacklightning);
			}
		}

		public override void FixedUpdate()
		{
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge > fireInterval)
			{
				if (!beamPlay)
				{
					if (NetworkServer.active)
					{
						NetworkServer.Spawn(blacklightning);
					}
					mainBlacklightning = blacklightning.GetComponent<ParticleSystem>();
					mainBlacklightning.Play();
					beamPlay = true;
				}
				fireTimer += Time.fixedDeltaTime;
				if (fireTimer > fireInterval)
				{
					((EntityState)this).PlayCrossfade("LeftArm, Override", "BlackLightningLoop", "Attack.playbackRate", fireInterval, 0.05f);
					((EntityState)this).characterBody.SetAimTimer(2f);
					attack.muzzleName = muzzleString;
					attack.aimVector = ((Ray)(ref aimRay)).direction;
					attack.origin = ((BaseState)this).FindModelChild(muzzleString).position;
					if (((EntityState)this).characterBody.HasBuff(Buffs.lightningDamageBoostBuff))
					{
						attack.damage = ((BaseState)this).damageStat * (damageCoefficient * 3f);
					}
					else
					{
						attack.damage = ((BaseState)this).damageStat * damageCoefficient;
					}
					if (((EntityState)this).characterBody.HasBuff(Buffs.lightningProcBoostBuff))
					{
						attack.procCoefficient = procCoefficient * 4f;
					}
					else
					{
						attack.procCoefficient = procCoefficient;
					}
					attack.Fire();
					fireTimer = 0f;
				}
			}
			if (((EntityState)this).fixedAge > totalDuration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

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

		public RimuruMasterController Rimurumastercon;

		public HurtBox Target;

		private bool targetIsValid;

		private OverlapAttack attack;

		private List<HurtBox> HitResults = new List<HurtBox>();

		private float procCoefficient = 1f;

		private float pushForce = 0f;

		private Vector3 storedPosition;

		public static float dashSpeed = 80f;

		public static float hopForce = 10f;

		public static float damageCoefficient = 0f;

		public override void OnEnter()
		{
			//IL_003f: 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_012b: Expected O, but got Unknown
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			Rimurucon = ((EntityState)this).GetComponent<RimuruController>();
			Rimurumastercon = ((Component)((EntityState)this).characterBody.master).gameObject.GetComponent<RimuruMasterController>();
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddTimedBuff(Buffs.immuneToFallDamage.buffIndex, 1.5f);
			}
			if (Object.op_Implicit((Object)(object)Rimurucon) && ((EntityState)this).isAuthority)
			{
				Target = Rimurucon.GetTrackingTarget();
			}
			if (!Object.op_Implicit((Object)(object)Target))
			{
				return;
			}
			if (Object.op_Implicit((Object)(object)Target) && Object.op_Implicit((Object)(object)Target.healthComponent) && Target.healthComponent.alive)
			{
				targetIsValid = true;
			}
			HitBoxGroup hitBoxGroup = null;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "Sword");
			}
			attack = new OverlapAttack();
			attack.damageType = DamageTypeCombo.op_Implicit((DamageType)0);
			attack.attacker = ((EntityState)this).gameObject;
			attack.inflictor = ((EntityState)this).gameObject;
			attack.teamIndex = ((BaseState)this).GetTeam();
			attack.damage = damageCoefficient * ((BaseState)this).damageStat;
			attack.procCoefficient = procCoefficient;
			attack.hitBoxGroup = hitBoxGroup;
			attack.isCrit = ((BaseState)this).RollCrit();
			attack.pushAwayForce = pushForce * 0.2f;
			((EntityState)this).PlayAnimation("FullBody, Override", "DashAttack");
			((BaseState)this).OnEnter();
		}

		public override void FixedUpdate()
		{
			//IL_0024: 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_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: 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_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (Object.op_Implicit((Object)(object)Target))
			{
				storedPosition = ((Component)Target).transform.position;
			}
			if (((EntityState)this).isAuthority && targetIsValid)
			{
				Vector3 val = storedPosition - ((EntityState)this).transform.position;
				Vector3 velocity = ((Vector3)(ref val)).normalized * dashSpeed;
				((EntityState)this).characterMotor.velocity = velocity;
				((EntityState)this).characterDirection.forward = ((Vector3)(ref ((EntityState)this).characterMotor.velocity)).normalized;
				if (((EntityState)this).fixedAge >= 0.8f)
				{
					((EntityState)this).outer.SetNextStateToMain();
					return;
				}
				attack.forceVector = ((Vector3)(ref ((EntityState)this).characterMotor.velocity)).normalized * pushForce;
				if (!attack.Fire(HitResults))
				{
					return;
				}
				if (HitResults.Count > 0)
				{
					foreach (HurtBox hitResult in HitResults)
					{
						if (Object.op_Implicit((Object)(object)hitResult.healthComponent) && !(hitResult.healthComponent.health > 0f))
						{
						}
					}
					((EntityState)this).outer.SetNextState((EntityState)(object)new DashAttackExit());
				}
				else
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new DashAttackExit());
				}
			}
			else
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).OnExit();
			CharacterBody characterBody = ((EntityState)this).characterBody;
			characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags & -2);
			CharacterMotor characterMotor = ((EntityState)this).characterMotor;
			characterMotor.velocity *= 0.1f;
			((EntityState)this).PlayAnimation("FullBody, Override", "BufferEmpty");
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)5;
		}
	}
	public class DashAttackExit : BaseMeleeAttack
	{
		protected int baseAttackAmount = 3;

		protected int attackAmount = 0;

		protected float attackTimer = 0f;

		protected float attackStopwatch = 0f;

		protected float stopHoptrigger = 0.35f;

		public override void OnEnter()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: 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_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			hitboxName = "Sword";
			damageType = (DamageType)0;
			if (((EntityState)this).characterBody.HasBuff(Buffs.fireBuff))
			{
				damageType = (DamageType)(damageType | 0x80);
			}
			damageCoefficient = Config.swordDamageCoefficient.Value;
			procCoefficient = 1f;
			pushForce = 300f;
			bonusForce = new Vector3(0f, -500f, 0f);
			baseDuration = 1.3f;
			attackStartTime = 0.25f;
			attackEndTime = 0.65f;
			baseEarlyExitTime = 0.7f;
			hitStopDuration = 0.012f;
			attackRecoil = 0.5f;
			hitHopVelocity = 7f;
			swingSoundString = "RimuruSword";
			hitSoundString = "";
			muzzleString = ((swingIndex % 2 == 0) ? "SwingLeft" : "SwingRight");
			swingEffectPrefab = AssetsRimuru.swordSwingEffect;
			hitEffectPrefab = AssetsRimuru.swordHitImpactEffect;
			impactSound = AssetsRimuru.swordHitSoundEvent.index;
			float num = ((((BaseState)this).attackSpeedStat >= 1f) ? ((BaseState)this).attackSpeedStat : 1f);
			attackAmount = (int)((float)baseAttackAmount * num);
			base.OnEnter();
			attackTimer = duration * attackEndTime - duration * attackStartTime / (float)attackAmount;
		}

		protected override void PlayAttackAnimation()
		{
			((EntityState)this).PlayCrossfade("FullBody, Override", "OutOfDashAttack", "Slash.playbackRate", duration, 0.05f);
		}

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

		protected override void OnHitEnemyAuthority()
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			Util.PlaySound(hitSoundString, ((EntityState)this).gameObject);
			if (!inHitPause && hitStopDuration > 0f)
			{
				storedVelocity = ((EntityState)this).characterMotor.velocity;
				hitStopCachedState = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, "Slash.playbackRate");
				hitPauseTimer = hitStopDuration / ((BaseState)this).attackSpeedStat;
				inHitPause = true;
			}
		}

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

		public override void FixedUpdate()
		{
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			base.FixedUpdate();
			if (stopwatch >= duration * attackStartTime && ((EntityState)this).isAuthority && stopwatch <= duration * stopHoptrigger)
			{
				((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
				((EntityState)this).characterMotor.velocity = new Vector3(((EntityState)this).characterMotor.velocity.x, Mathf.Max(((EntityState)this).characterMotor.velocity.y, Config.dashAttackHop.Value), ((EntityState)this).characterMotor.velocity.z);
			}
			if (stopwatch >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		protected override void FireAttack()
		{
			//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_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			if (!hasFired)
			{
				hasFired = true;
				Util.PlayAttackSpeedSound(swingSoundString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat);
				if (((EntityState)this).isAuthority)
				{
					PlaySwingEffect();
					((BaseState)this).AddRecoil(-1f * attackRecoil, -2f * attackRecoil, -0.5f * attackRecoil, 0.5f * attackRecoil);
				}
				if (((EntityState)this).characterBody.HasBuff(Buffs.icicleLanceBuff))
				{
					Ray aimRay = ((BaseState)this).GetAimRay();
					ProjectileManager.instance.FireProjectile(Projectiles.icicleLanceProjectile, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(new Vector3(((Ray)(ref aimRay)).direction.x, ((Ray)(ref aimRay)).direction.y, ((Ray)(ref aimRay)).direction.z)), ((EntityState)this).gameObject, damageCoefficient * ((BaseState)this).damageStat, 0f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f);
				}
			}
			attackStopwatch += Time.fixedDeltaTime;
			if (attackStopwatch > attackTimer)
			{
				attackStopwatch = 0f;
				CreateNewAttack();
			}
			if (((EntityState)this).isAuthority)
			{
				List<HurtBox> list = new List<HurtBox>();
				if (attack.Fire(list))
				{
					OnHitEnemyAuthority();
					CheckIfDead(list);
				}
			}
		}

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)5;
		}
	}
	public class RimuruHumanPrimary : BaseSkillState
	{
		public RimuruController Rimurucon;

		public RimuruMasterController Rimurumastercon;

		public HurtBox Target;

		public override void OnEnter()
		{
			//IL_0088: 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)
			Rimurucon = ((EntityState)this).GetComponent<RimuruController>();
			Rimurumastercon = ((Component)((EntityState)this).characterBody.master).gameObject.GetComponent<RimuruMasterController>();
			if (Object.op_Implicit((Object)(object)Rimurucon) && ((EntityState)this).isAuthority)
			{
				Target = Rimurucon.GetTrackingTarget();
			}
			if (Object.op_Implicit((Object)(object)Target))
			{
				float num = 10f;
				if (!((BaseState)this).isGrounded)
				{
					num = 7f;
				}
				float num2 = Vector3.Distance(((EntityState)this).transform.position, ((Component)Target).transform.position);
				if (num2 >= num)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new DashAttack());
				}
				else
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new SlashCombo());
				}
			}
			else if (!Object.op_Implicit((Object)(object)Target))
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new SlashCombo());
			}
			((BaseState)this).OnEnter();
		}

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)1;
		}
	}
	public class SlashCombo : BaseMeleeAttack
	{
		public new RimuruController Rimurucon;

		public RimuruMasterController Rimurumastercon;

		public HurtBox Target;

		public override void OnEnter()
		{
			//IL_000e: 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_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: 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_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_0205: Unknown result type (might be due to invalid IL or missing references)
			hitboxName = "Sword";
			damageType = (DamageType)0;
			if (((EntityState)this).characterBody.HasBuff(Buffs.bleedMeleeBuff))
			{
				damageType = (DamageType)(damageType | 0x400);
			}
			if (((EntityState)this).characterBody.HasBuff(Buffs.fireBuff))
			{
				damageType = (DamageType)(damageType | 0x80);
			}
			if (((EntityState)this).characterBody.HasBuff(Buffs.poisonMeleeBuff))
			{
				damageType = (DamageType)(damageType | 0x100000);
			}
			if (((EntityState)this).characterBody.HasBuff(Buffs.lightningBuff))
			{
				damageType = (DamageType)(damageType | 0x1000000);
			}
			if (((EntityState)this).characterBody.HasBuff(Buffs.crippleBuff))
			{
				damageType = (DamageType)(damageType | 0x400000);
			}
			if (((EntityState)this).characterBody.HasBuff(Buffs.exposeBuff))
			{
				damageType = (DamageType)(damageType | 0x800000);
			}
			if (((EntityState)this).characterBody.HasBuff(Buffs.meleeBoostBuff))
			{
				damageCoefficient = Config.devourDamageCoefficient.Value * 1.3f;
			}
			procCoefficient = 1f;
			pushForce = 300f;
			bonusForce = new Vector3(0f, -300f, 0f);
			baseDuration = 0.63f;
			attackStartTime = 0.3f;
			attackEndTime = 0.5f;
			baseEarlyExitTime = 0.75f;
			hitStopDuration = 0.012f;
			attackRecoil = 0.5f;
			hitHopVelocity = 7f;
			swingSoundString = "RimuruSword";
			hitSoundString = "";
			muzzleString = ((swingIndex % 2 == 0) ? "SwingLeft" : "SwingRight");
			swingEffectPrefab = AssetsRimuru.swordSwingEffect;
			hitEffectPrefab = AssetsRimuru.swordHitImpactEffect;
			impactSound = AssetsRimuru.swordHitSoundEvent.index;
			Rimurucon = ((EntityState)this).GetComponent<RimuruController>();
			Rimurumastercon = ((Component)((EntityState)this).characterBody.master).gameObject.GetComponent<RimuruMasterController>();
			if (Object.op_Implicit((Object)(object)Rimurucon) && ((EntityState)this).isAuthority)
			{
				Target = Rimurucon.GetTrackingTarget();
			}
			base.OnEnter();
		}

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

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

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

		protected override void SetNextState()
		{
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			int num = ((swingIndex == 0) ? 1 : 0);
			if (Object.op_Implicit((Object)(object)Target))
			{
				float num2 = 10f;
				if (!((BaseState)this).isGrounded)
				{
					num2 = 7f;
				}
				float num3 = Vector3.Distance(((EntityState)this).transform.position, ((Component)Target).transform.position);
				if (num3 >= num2)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new DashAttack());
					return;
				}
				((EntityState)this).outer.SetNextState((EntityState)(object)new SlashCombo
				{
					swingIndex = num
				});
			}
			else if (!Object.op_Implicit((Object)(object)Target))
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new SlashCombo
				{
					swingIndex = num
				});
			}
		}

		public override void OnExit()
		{
			base.OnExit();
		}
	}
	public class SpatialMovement : BaseSkillState
	{
		private bool teleportFlag = false;

		private float teleportTimer = 0f;

		private float teleportDuration = 0.1f;

		private Vector3 velocity;

		private Vector3 teleportLocation = new Vector3(0f, 0f, 0f);

		private bool exitState = false;

		private GameObject aimSphere;

		public float radius = 3f;

		private Ray aimRay;

		private float maxDistance = 75f;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			aimSphere = Object.Instantiate<GameObject>(ArrowRain.areaIndicatorPrefab);
			AkSoundEngine.PostEvent("RimuruBlink", ((EntityState)this).gameObject);
		}

		public override void Update()
		{
			((EntityState)this).Update();
			UpdateAreaIndicator();
		}

		private void UpdateAreaIndicator()
		{
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: 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_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: 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_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)this).isAuthority)
			{
				aimSphere.transform.localScale = new Vector3(radius, radius, radius);
			}
			aimRay = ((BaseState)this).GetAimRay();
			RaycastHit val = default(RaycastHit);
			if (Physics.Raycast(((BaseState)this).GetAimRay(), ref val, maxDistance, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask)))
			{
				aimSphere.transform.position = ((RaycastHit)(ref val)).point + Vector3.up;
				aimSphere.transform.up = ((RaycastHit)(ref val)).normal;
				aimSphere.transform.forward = -((Ray)(ref aimRay)).direction;
			}
			else
			{
				Ray val2 = ((BaseState)this).GetAimRay();
				Vector3 position = ((Ray)(ref val2)).origin + maxDistance * ((Ray)(ref val2)).direction;
				aimSphere.transform.position = position;
				aimSphere.transform.up = ((RaycastHit)(ref val)).normal;
				aimSphere.transform.forward = -((Ray)(ref aimRay)).direction;
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority && !((BaseSkillState)this).IsKeyDownAuthority())
			{
				teleportFlag = true;
			}
			if (teleportFlag)
			{
				Teleport();
			}
			if (exitState)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public void Teleport()
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).characterMotor.velocity.y = 0f;
			teleportTimer += Time.fixedDeltaTime;
			((BaseCharacterController)((EntityState)this).characterMotor).Motor.SetPosition(Vector3.SmoothDamp(((EntityState)this).characterBody.corePosition, aimSphere.transform.position, ref velocity, teleportDuration, 1000f), true);
			if (teleportTimer >= teleportDuration)
			{
				exitState = true;
			}
		}

		public override void OnExit()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).OnExit();
			EntityState.Destroy((Object)(object)aimSphere.gameObject);
			((EntityState)this).characterBody.AddTimedBuffAuthority(Buffs.SpatialMovementBuff.buffIndex, Config.spatialMovementBuffDuration.Value);
		}

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

		public RimuruMasterController masterController;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			masterController = ((Component)((EntityState)this).characterBody.master).GetComponent<RimuruMasterController>();
			oldHealth = ((EntityState)this).characterBody.healthComponent.health;
			if (NetworkServer.active)
			{
				StaticValues.TransformBodyType(StaticValues.TargetBody.SLIME, ((EntityState)this).characterBody.master);
			}
			AkSoundEngine.PostEvent("RimuruTransform", ((EntityState)this).gameObject);
		}

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

		public override void OnExit()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).OnExit();
			NetMessageExtensions.Send((INetMessage)(object)new UpdateControllers(((NetworkBehaviour)((EntityState)this).characterBody.master).netId, oldHealth), (NetworkDestination)1);
			masterController.setHealthToValue = true;
			masterController.oldHealth = oldHealth;
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)5;
		}
	}
	public class Analyze : BaseSkillState
	{
		public RimuruController Rimurucon;

		public RimuruMasterController Rimurumastercon;

		public HurtBox Target;

		public bool aoe;

		public float duration = 0.1f;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			Rimurucon = ((EntityState)this).GetComponent<RimuruController>();
			Rimurumastercon = ((Component)((EntityState)this).characterBody.master).gameObject.GetComponent<RimuruMasterController>();
			if (Object.op_Implicit((Object)(object)Rimurucon) && ((EntityState)this).isAuthority)
			{
				Target = Rimurucon.GetTrackingTarget();
			}
			if (((EntityState)this).characterBody.HasBuff(Buffs.aoeBufferBuff))
			{
				aoe = true;
			}
			else
			{
				aoe = false;
			}
		}

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

		public override void OnExit()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Expected O, but got Unknown
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).OnExit();
			if (aoe)
			{
				BullseyeSearch val = new BullseyeSearch
				{
					teamMaskFilter = TeamMask.GetEnemyTeams(((EntityState)this).characterBody.teamComponent.teamIndex),
					filterByLoS = false,
					searchOrigin = ((EntityState)this).characterBody.corePosition,
					searchDirection = Random.onUnitSphere,
					sortMode = (SortMode)1,
					maxDistanceFilter = 40f,
					maxAngleFilter = 360f
				};
				val.RefreshCandidates();
				val.FilterOutGameObject(((Component)((EntityState)this).characterBody).gameObject);
				List<HurtBox> list = val.GetResults().ToList();
				{
					foreach (HurtBox item in list)
					{
						if (Object.op_Implicit((Object)(object)item.healthComponent) && Object.op_Implicit((Object)(object)item.healthComponent.body))
						{
							NetworkingHelpers.ApplyBuff(item.healthComponent.body, Buffs.CritDebuff.buffIndex, Config.analyseDebuffduration.Value, -1f);
						}
					}
					return;
				}
			}
			if (!Object.op_Implicit((Object)(object)Target))
			{
				((EntityState)this).skillLocator.utility.AddOneStock();
			}
			else if (Object.op_Implicit((Object)(object)Target))
			{
				NetworkingHelpers.ApplyBuff(Target.healthComponent.body, Buffs.CritDebuff.buffIndex, 1, (float)Config.analyseDebuffduration.Value);
				AkSoundEngine.PostEvent("RimuruAnalyse", ((EntityState)this).gameObject);
			}
		}

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

		private GameObject effectObj;

		public void Start()
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: 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)
			charbody = ((Component)this).gameObject.GetComponent<CharacterBody>();
			if (Object.op_Implicit((Object)(object)charbody))
			{
				float num = charbody.corePosition.y - charbody.footPosition.y;
				effectObj = Object.Instantiate<GameObject>(AssetsRimuru.analyzeEffect, charbody.corePosition + Vector3.up * num * 1.5f, Quaternion.LookRotation(charbody.characterDirection.forward));
				effectObj.transform.parent = ((Component)charbody).gameObject.transform;
			}
		}

		public void FixedUpdate()
		{
			if (Object.op_Implicit((Object)(object)charbody) && !charbody.HasBuff(Buffs.CritDebuff))
			{
				Object.Destroy((Object)(object)effectObj);
				Object.Destroy((Object)(object)this);
			}
			if (!Object.op_Implicit((Object)(object)charbody))
			{
				Object.Destroy((Object)(object)effectObj);
			}
		}

		public void OnDestroy()
		{
			Object.Destroy((Object)(object)effectObj);
		}
	}
	public class Devour : BaseMeleeAttack
	{
		public override void OnEnter()
		{
			//IL_0012: 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_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: 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_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: 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_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_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_0213: 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_012b: 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)
			hitboxName = "Devour";
			damageType = (DamageType)524288;
			if (((EntityState)this).characterBody.HasBuff(Buffs.bleedMeleeBuff))
			{
				damageType = (DamageType)(damageType | 0x400);
			}
			if (((EntityState)this).characterBody.HasBuff(Buffs.fireBuff))
			{
				damageType = (DamageType)(damageType | 0x80);
			}
			if (((EntityState)this).characterBody.HasBuff(Buffs.lightningBuff))
			{
				damageType = (DamageType)(damageType | 0x1000000);
			}
			if (((EntityState)this).characterBody.HasBuff(Buffs.crippleBuff))
			{
				damageType = (DamageType)(damageType | 0x400000);
			}
			if (((EntityState)this).characterBody.HasBuff(Buffs.meleeBoostBuff))
			{
				damageCoefficient = Config.devourDamageCoefficient.Value * 1.3f;
			}
			if (((EntityState)this).characterBody.HasBuff(Buffs.devourBuff))
			{
				hitboxName = "DevourExtended";
			}
			if (((EntityState)this).characterBody.HasBuff(Buffs.exposeBuff))
			{
				damageType = (DamageType)(damageType | 0x800000);
			}
			procCoefficient = 1f;
			damageCoefficient = Config.devourDamageCoefficient.Value;
			pushForce = 300f;
			bonusForce = new Vector3(0f, -300f, 0f);
			baseDuration = 0.8f;
			attackStartTime = 0.1f;
			attackEndTime = 0.5f;
			baseEarlyExitTime = 0.5f;
			hitStopDuration = 0.01f;
			attackRecoil = 0.2f;
			hitHopVelocity = 4f;
			swingSoundString = "RimuruSwordSwing";
			hitSoundString = "";
			muzzleString = "Spine";
			swingEffectPrefab = AssetsRimuru.swordSwingEffect;
			hitEffectPrefab = AssetsRimuru.swordHitImpactEffect;
			impactSound = AssetsRimuru.swordHitSoundEvent.index;
			base.OnEnter();
			DamageAPI.AddModdedDamageType(attack, Damage.rimuruDevour);
		}

		public override void FixedUpdate()
		{
			base.FixedUpdate();
			hitboxName = "Devour";
		}

		protected override void PlayAttackAnimation()
		{
		}

		protected override void PlaySwingEffect()
		{
		}

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

		protected override void SetNextState()
		{
			((EntityState)this).outer.SetNextState((EntityState)(object)new Devour());
		}

		public override void OnExit()
		{
			base.OnExit();
		}
	}
	public class TransformSlime : BaseSkillState
	{
		public float oldHealth;

		public RimuruMasterController masterController;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			masterController = ((Component)((EntityState)this).characterBody.master).GetComponent<RimuruMasterController>();
			oldHealth = ((EntityState)this).characterBody.healthComponent.health;
			if (NetworkServer.active)
			{
				StaticValues.TransformBodyType(StaticValues.TargetBody.HUMAN, ((EntityState)this).characterBody.master);
			}
			AkSoundEngine.PostEvent("RimuruTransform", ((EntityState)this).gameObject);
		}

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

		public override void OnExit()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).OnExit();
			NetMessageExtensions.Send((INetMessage)(object)new UpdateControllers(((NetworkBehaviour)((EntityState)this).characterBody.master).netId, oldHealth), (NetworkDestination)1);
			masterController.setHealthToValue = true;
			masterController.oldHealth = oldHealth;
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)5;
		}
	}
	public class Waterblade : BaseSkillState
	{
		public static float damageCoefficient = Config.waterbladeDamageCoefficient.Value;

		public static float procCoefficient = 1f;

		public static float baseDuration = 0.65f;

		public static float throwForce = 80f;

		private float duration;

		private float fireTime;

		private bool hasFired;

		private Animator animator;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			fireTime = 0.35f * duration;
			((EntityState)this).characterBody.SetAimTimer(2f);
			animator = ((EntityState)this).GetModelAnimator();
			((EntityState)this).PlayAnimation("Gesture, Override", "ThrowBomb", "ThrowBomb.playbackRate", duration, 0f);
		}

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

		private void Fire()
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: 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_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: 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_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			if (hasFired)
			{
				return;
			}
			hasFired = true;
			AkSoundEngine.PostEvent(2654748154u, ((EntityState)this).gameObject);
			if (((EntityState)this).isAuthority)
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				if (((EntityState)this).characterBody.HasBuff(Buffs.ConductivityBuff))
				{
					ProjectileDamage component = Projectiles.waterbladeProjectile.GetComponent<ProjectileDamage>();
					component.damageType |= DamageTypeCombo.op_Implicit((DamageType)16777216);
				}
				if (((EntityState)this).characterBody.HasBuff(Buffs.TarProjBuff))
				{
					ProjectileDamage component2 = Projectiles.waterbladeProjectile.GetComponent<ProjectileDamage>();
					component2.damageType |= DamageTypeCombo.op_Implicit((DamageType)512);
				}
				if (((EntityState)this).characterBody.HasBuff(Buffs.CrippleProjBuff))
				{
					ProjectileDamage component3 = Projectiles.waterbladeProjectile.GetComponent<ProjectileDamage>();
					component3.damageType |= DamageTypeCombo.op_Implicit((DamageType)4194304);
				}
				ProjectileManager.instance.FireProjectile(Projectiles.waterbladeProjectile, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, damageCoefficient * ((BaseState)this).damageStat, 0f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, throwForce);
				if (((EntityState)this).characterBody.HasBuff(Buffs.tripleWaterBladeBuff))
				{
					ProjectileManager.instance.FireProjectile(Projectiles.waterbladeProjectile, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(new Vector3(((Ray)(ref aimRay)).direction.x, ((Ray)(ref aimRay)).direction.y, ((Ray)(ref aimRay)).direction.z + 1f)), ((EntityState)this).gameObject, damageCoefficient * ((BaseState)this).damageStat, 0f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, throwForce);
					ProjectileManager.instance.FireProjectile(Projectiles.waterbladeProjectile, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(new Vector3(((Ray)(ref aimRay)).direction.x, ((Ray)(ref aimRay)).direction.y, ((Ray)(ref aimRay)).direction.z - 1f)), ((EntityState)this).gameObject, damageCoefficient * ((BaseState)this).damageStat, 0f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, throwForce);
				}
			}
		}

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

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

		private GameObject effectObj;

		public void Start()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: 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_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			charbody = ((Component)this).gameObject.GetComponent<CharacterBody>();
			float num = charbody.corePosition.y - charbody.footPosition.y;
			effectObj = Object.Instantiate<GameObject>(AssetsRimuru.wetEffect, charbody.corePosition + Vector3.up * num, Quaternion.LookRotation(charbody.characterDirection.forward));
			effectObj.transform.parent = ((Component)charbody).gameObject.transform;
		}

		public void FixedUpdate()
		{
			if (Object.op_Implicit((Object)(object)charbody) && !charbody.HasBuff(Buffs.WetDebuff))
			{
				Object.Destroy((Object)(object)effectObj);
				Object.Destroy((Object)(object)this);
			}
			if (!Object.op_Implicit((Object)(object)charbody))
			{
				Object.Destroy((Object)(object)effectObj);
			}
		}

		public void OnDestroy()
		{
			Object.Destroy((Object)(object)effectObj);
		}
	}
}
namespace RimuruMod.SkillStates.Rimuru
{
	internal class RimuruCharacterMain : GenericCharacterMain
	{
		private EntityStateMachine weaponStateMachine;

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

		public override void ProcessJump()
		{
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Expected O, but got Unknown
			((GenericCharacterMain)this).ProcessJump();
			if (((BaseCharacterMain)this).hasCharacterMotor && ((BaseCharacterMain)this).hasInputBank && ((EntityState)this).isAuthority)
			{
				bool flag = ((EntityState)this).inputBank.jump.down && (((EntityState)this).characterMotor.velocity.y < 0f || ((EntityState)this).characterBody.HasBuff(Buffs.flightBuff)) && !((EntityState)this).characterMotor.isGrounded;
				bool flag2 = ((object)weaponStateMachine.state).GetType() == typeof(Gliding);
				if (flag && !flag2)
				{
					weaponStateMachine.SetNextState((EntityState)(object)new Gliding());
				}
				if (!flag && flag2)
				{
					weaponStateMachine.SetNextState((EntityState)new Idle());
				}
			}
		}

		public override void OnExit()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)weaponStateMachine))
			{
				weaponStateMachine.SetNextState((EntityState)new Idle());
			}
			((GenericCharacterMain)this).OnExit();
		}
	}
}
namespace RimuruMod.SkillStates.BaseStates
{
	public class BaseMeleeAttack : BaseSkillState
	{
		public int swingIndex;

		protected string hitboxName = "Sword";

		protected DamageType damageType = (DamageType)0;

		protected float damageCoefficient = 3.5f;

		protected float procCoefficient = 1f;

		protected float pushForce = 300f;

		protected Vector3 bonusForce = Vector3.zero;

		protected float baseDuration = 1f;

		protected float attackStartTime = 0.2f;

		protected float attackEndTime = 0.4f;

		protected float baseEarlyExitTime = 0.4f;

		protected float hitStopDuration = 0.012f;

		protected float attackRecoil = 0.75f;

		protected float hitHopVelocity = 10f;

		protected bool cancelled = false;

		protected string swingSoundString = "RimuruSword";

		protected string hitSoundString = "";

		protected string muzzleString = "SwingCenter";

		protected GameObject swingEffectPrefab;

		protected GameObject hitEffectPrefab;

		protected NetworkSoundEventIndex impactSound;

		protected float earlyExitTime;

		public float duration;

		protected bool hasFired;

		protected float hitPauseTimer;

		protected OverlapAttack attack;

		protected bool inHitPause;

		protected bool hasHopped;

		protected float stopwatch;

		protected Animator animator;

		protected HitStopCachedState hitStopCachedState;

		protected Vector3 storedVelocity;

		public RimuruController Rimurucon;

		public override void OnEnter()
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			earlyExitTime = baseEarlyExitTime / ((BaseState)this).attackSpeedStat;
			hasFired = false;
			animator = ((EntityState)this).GetModelAnimator();
			Ray aimRay = ((BaseState)this).GetAimRay();
			((EntityState)this).characterBody.SetAimTimer(0.5f + duration);
			((EntityState)this).characterBody.outOfCombatStopwatch = 0f;
			animator.SetBool("attacking", true);
			animator.SetFloat("Slash.playbackRate", ((BaseState)this).attackSpeedStat);
			PlayAttackAnimation();
			CreateNewAttack();
		}

		protected virtual void CreateNewAttack()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Expected O, but got Unknown
			//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_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_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			HitBoxGroup hitBoxGroup = null;
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == hitboxName);
			}
			attack = new OverlapAttack();
			attack.damageType = DamageTypeCombo.op_Implicit(damageType);
			attack.attacker = ((EntityState)this).gameObject;
			attack.inflictor = ((EntityState)this).gameObject;
			attack.teamIndex = ((BaseState)this).GetTeam();
			attack.damage = damageCoefficient * ((BaseState)this).damageStat;
			attack.procCoefficient = procCoefficient;
			attack.hitEffectPrefab = hitEffectPrefab;
			attack.forceVector = bonusForce;
			attack.pushAwayForce = pushForce;
			attack.hitBoxGroup = hitBoxGroup;
			attack.isCrit = ((BaseState)this).RollCrit();
			attack.impactSound = impactSound;
		}

		protected virtual void PlayAttackAnimation()
		{
			((EntityState)this).PlayCrossfade("UpperBody, Override", "Swing" + (1 + swingIndex), "Slash.playbackRate", duration, 0.05f);
			AkSoundEngine.PostEvent(2454616260u, ((EntityState)this).gameObject);
		}

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

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

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

		protected virtual void CheckIfDead(List<HurtBox> hurtboxes)
		{
		}

		protected virtual void FireAttack()
		{
			//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_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			if (!hasFired)
			{
				hasFired = true;
				Util.PlayAttackSpeedSound(swingSoundString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat);
				if (((EntityState)this).isAuthority)
				{
					PlaySwingEffect();
					((BaseState)this).AddRecoil(-1f * attackRecoil, -2f * attackRecoil, -0.5f * attackRecoil, 0.5f * attackRecoil);
				}
				if (((EntityState)this).characterBody.HasBuff(Buffs.icicleLanceBuff))
				{
					Ray aimRay = ((BaseState)this).GetAimRay();
					ProjectileManager.instance.FireProjectile(Projectiles.icicleLanceProjectile, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(new Vector3(((Ray)(ref aimRay)).direction.x, ((Ray)(ref aimRay)).direction.y, ((Ray)(ref aimRay)).direction.z)), ((EntityState)this).gameObject, damageCoefficient * ((BaseState)this).damageStat, 0f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f);
				}
			}
			if (((EntityState)this).isAuthority)
			{
				List<HurtBox> list = new List<HurtBox>();
				if (attack.Fire(list))
				{
					OnHitEnemyAuthority();
					CheckIfDead(list);
				}
			}
		}

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

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

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