Decompiled source of Belmont v1.5.7

plugins/rob_gaming-Belmont/BelmontMod.dll

Decompiled a day ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AncientScepter;
using BelmontMod.Content;
using BelmontMod.Content.Components;
using BelmontMod.Content.Enemies;
using BelmontMod.Content.Misc;
using BelmontMod.Content.Objective;
using BelmontMod.Content.Survivors;
using BelmontMod.Modules;
using BelmontMod.Modules.Achievements;
using BelmontMod.SkillStates;
using BelmontMod.SkillStates.BaseStates;
using BelmontMod.SkillStates.Belmont;
using BelmontMod.SkillStates.Belmont.Melee;
using BelmontMod.SkillStates.Belmont.Subweapon;
using BelmontMod.SkillStates.Belmont.Whip;
using BelmontMod.SkillStates.Emote;
using BelmontMod.SkillStates.Gargoyle;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.BrotherMonster;
using EntityStates.Commando;
using EntityStates.Commando.CommandoWeapon;
using EntityStates.Croco;
using EntityStates.Huntress;
using EntityStates.LemurianBruiserMonster;
using EntityStates.LemurianMonster;
using Grumpy;
using HG;
using HG.BlendableTypes;
using HunkMod.Modules;
using JetBrains.Annotations;
using KinematicCharacterController;
using MaterialHud;
using On.RoR2;
using On.RoR2.CharacterSpeech;
using On.RoR2.UI;
using On.RoR2.UI.MainMenu;
using R2API;
using R2API.Networking;
using R2API.Networking.Interfaces;
using R2API.Utils;
using Rewired.ComponentControls.Effects;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.Achievements;
using RoR2.Audio;
using RoR2.CameraModes;
using RoR2.CharacterAI;
using RoR2.CharacterSpeech;
using RoR2.ContentManagement;
using RoR2.HudOverlay;
using RoR2.Navigation;
using RoR2.Networking;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using RoR2.UI.MainMenu;
using TMPro;
using ThreeEyedGames;
using Unity.Jobs;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.Rendering.PostProcessing;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("BelmontMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("BelmontMod")]
[assembly: AssemblyTitle("BelmontMod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: UnverifiableCode]
public class RocketRotation : MonoBehaviour
{
	private Rigidbody rb;

	private void Awake()
	{
		rb = ((Component)this).GetComponent<Rigidbody>();
	}

	private void FixedUpdate()
	{
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		Transform transform = ((Component)this).transform;
		Vector3 velocity = rb.velocity;
		transform.rotation = Util.QuaternionSafeLookRotation(((Vector3)(ref velocity)).normalized);
	}
}
public class StupidFuckingBullshit : MonoBehaviour
{
	public ParticleSystem faggot;

	private void Awake()
	{
		faggot = ((Component)this).GetComponentInChildren<ParticleSystem>();
		((Component)faggot).transform.SetParent((Transform)null);
	}

	private void FixedUpdate()
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		((Component)faggot).transform.SetPositionAndRotation(((Component)this).transform.position, ((Component)this).transform.rotation);
	}
}
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);
	}
}
internal enum BelmontCameraParams
{
	DEFAULT,
	AIM,
	EMOTE,
	FAR
}
internal class BodyInfo
{
	internal string sourceBody = "";

	internal string bodyName = "";

	internal string bodyNameToken = "";

	internal string subtitleNameToken = "";

	internal Color bodyColor = Color.white;

	public Vector3 modelBasePosition = new Vector3(0f, -0.9f, 0f);

	public Vector3 aimOrigin = new Vector3(0f, 1.4f, 0f);

	public Vector3 cameraPivot = new Vector3(0f, 1.59f, 0f);

	internal Texture characterPortrait = null;

	internal GameObject crosshair = null;

	internal GameObject podPrefab = null;

	internal float maxHealth = 100f;

	internal float healthGrowth = 2f;

	internal float healthRegen = 0f;

	internal float shield = 0f;

	internal float shieldGrowth = 0f;

	internal float moveSpeed = 7f;

	internal float moveSpeedGrowth = 0f;

	internal float acceleration = 80f;

	internal float jumpPower = 15f;

	internal float jumpPowerGrowth = 0f;

	internal float damage = 12f;

	internal float attackSpeed = 1f;

	internal float attackSpeedGrowth = 0f;

	internal float armor = 0f;

	internal float armorGrowth = 0f;

	internal float crit = 1f;

	internal float critGrowth = 0f;

	internal int jumpCount = 1;
}
internal class CustomRendererInfo
{
	internal string childName;

	internal Material material;

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

	public string skillNameToken;

	public string skillDescriptionToken;

	public string[] keywordTokens = new string[0];

	public Sprite icon;

	public SerializableEntityStateType activationState;

	public InterruptPriority interruptPriority;

	public string activationStateMachineName;

	public float baseRechargeInterval;

	public int baseMaxStock = 1;

	public int rechargeStock = 1;

	public int requiredStock = 1;

	public int stockToConsume = 1;

	public bool isCombatSkill = true;

	public bool canceledFromSprinting;

	public bool forceSprintDuringState;

	public bool cancelSprintingOnActivation = true;

	public bool beginSkillCooldownOnSkillEnd;

	public bool fullRestockOnAssign = true;

	public bool resetCooldownTimerOnUse;

	public bool mustKeyPress;

	public SkillDefInfo()
	{
	}

	public SkillDefInfo(string skillName, string skillNameToken, string skillDescriptionToken, Sprite skillIcon, SerializableEntityStateType activationState, string activationStateMachineName, InterruptPriority interruptPriority, bool isCombatSkill, float baseRechargeInterval)
	{
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: 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)
		this.skillName = skillName;
		this.skillNameToken = skillNameToken;
		this.skillDescriptionToken = skillDescriptionToken;
		icon = skillIcon;
		this.activationState = activationState;
		this.activationStateMachineName = activationStateMachineName;
		this.interruptPriority = interruptPriority;
		this.isCombatSkill = isCombatSkill;
		this.baseRechargeInterval = baseRechargeInterval;
	}

	public SkillDefInfo(string skillName, string skillNameToken, string skillDescriptionToken, Sprite skillIcon, SerializableEntityStateType activationState, string activationStateMachineName = "Weapon", bool agile = false)
	{
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		this.skillName = skillName;
		this.skillNameToken = skillNameToken;
		this.skillDescriptionToken = skillDescriptionToken;
		icon = skillIcon;
		this.activationState = activationState;
		this.activationStateMachineName = activationStateMachineName;
		interruptPriority = (InterruptPriority)0;
		isCombatSkill = true;
		baseRechargeInterval = 0f;
		requiredStock = 0;
		stockToConsume = 0;
		cancelSprintingOnActivation = !agile;
		if (agile)
		{
			keywordTokens = new string[1] { "KEYWORD_AGILE" };
		}
	}
}
namespace BelmontMod
{
	[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.rob.Belmont", "Belmont", "1.5.7")]
	public class MainPlugin : BaseUnityPlugin
	{
		public const string MODUID = "com.rob.Belmont";

		public const string MODNAME = "Belmont";

		public const string MODVERSION = "1.5.7";

		public const string developerPrefix = "ROB";

		public static MainPlugin instance;

		public static List<HurtBox> hurtboxesList = new List<HurtBox>();

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

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

		public static bool hunkInstalled => Chainloader.PluginInfos.ContainsKey("com.rob.Hunk");

		public static bool riskUIInstalled
		{
			get
			{
				if (Chainloader.PluginInfos.ContainsKey("bubbet.riskui") && RiskUIEnabled())
				{
					return true;
				}
				return false;
			}
		}

		private void Awake()
		{
			instance = this;
			Files.PluginInfo = ((BaseUnityPlugin)this).Info;
			Config.myConfig = ((BaseUnityPlugin)this).Config;
			Log.Init(((BaseUnityPlugin)this).Logger);
			Config.ReadConfig();
			BelmontAssets.PopulateAssets();
			CameraParams.InitializeParams();
			States.RegisterStates();
			Projectiles.RegisterProjectiles();
			new LanguageTokens();
			ItemDisplays.PopulateDisplays();
			NetworkingAPI.RegisterMessageType<SyncTreasureChestAnimation>();
			NetworkingAPI.RegisterMessageType<SyncMorningStarOverlay>();
			new Belmont().CreateCharacter();
			new Gargoyle().CreateCharacter();
			new GreatGargoyle().CreateCharacter();
			Hook();
			new ContentPacks().Initialize();
			ContentManager.onContentPacksAssigned += LateSetup;
		}

		private void LateSetup(ReadOnlyArray<ReadOnlyContentPack> obj)
		{
			Belmont.SetItemDisplays();
		}

		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
			CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats);
			HurtBox.OnEnable += new hook_OnEnable(HurtBox_OnEnable);
			HurtBox.OnDisable += new hook_OnDisable(HurtBox_OnDisable);
			BodyCatalog.Init += new hook_Init(BodyCatalog_Init);
		}

		private IEnumerator BodyCatalog_Init(orig_Init orig)
		{
			yield return orig.Invoke();
			foreach (GameObject body in BodyCatalog.allBodyPrefabs)
			{
				if (Object.op_Implicit((Object)(object)body))
				{
					KinematicCharacterMotor motor = body.GetComponent<KinematicCharacterMotor>();
					if (Object.op_Implicit((Object)(object)motor))
					{
						motor.playerCharacter = true;
					}
				}
			}
		}

		private void HurtBox_OnEnable(orig_OnEnable orig, HurtBox self)
		{
			orig.Invoke(self);
			hurtboxesList.Add(self);
		}

		private void HurtBox_OnDisable(orig_OnDisable orig, HurtBox self)
		{
			orig.Invoke(self);
			hurtboxesList.Remove(self);
		}

		private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self) && self.HasBuff(Belmont.superSprintBuff))
			{
				self.moveSpeed += 12f;
			}
		}

		public static float GetICBMDamageMult(CharacterBody body)
		{
			float num = 1f;
			if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.inventory))
			{
				int itemCount = body.inventory.GetItemCount(Items.MoreMissile);
				int num2 = itemCount - 1;
				if (num2 > 0)
				{
					num += (float)num2 * 0.5f;
				}
			}
			return num;
		}

		private static bool RiskUIEnabled()
		{
			return RiskUIPlugin.Enabled.Value;
		}
	}
}
namespace BelmontMod.SkillStates
{
	public class FuckMyAss : GenericCharacterDeath
	{
		public override bool shouldAutoDestroy => false;

		public override void OnEnter()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: 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_002f: 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_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			((GenericCharacterDeath)this).OnEnter();
			Vector3 val = Vector3.up * 3f;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				val += ((EntityState)this).characterMotor.velocity;
				((Behaviour)((EntityState)this).characterMotor).enabled = false;
			}
			if (!Object.op_Implicit((Object)(object)((GenericCharacterDeath)this).cachedModelTransform))
			{
				return;
			}
			RagdollController component = ((Component)((GenericCharacterDeath)this).cachedModelTransform).GetComponent<RagdollController>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				return;
			}
			Transform[] bones = component.bones;
			foreach (Transform val2 in bones)
			{
				if (Object.op_Implicit((Object)(object)val2))
				{
					((Component)val2).gameObject.layer = LayerIndex.ragdoll.intVal;
					((Component)val2).gameObject.SetActive(true);
				}
			}
			component.BeginRagdoll(val);
		}

		public override void PlayDeathAnimation(float crossfadeDuration = 0.1f)
		{
		}

		public override void FixedUpdate()
		{
			((GenericCharacterDeath)this).FixedUpdate();
			if (NetworkServer.active && ((EntityState)this).fixedAge > 4f)
			{
				EntityState.Destroy((Object)(object)((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)7;
		}
	}
}
namespace BelmontMod.SkillStates.Gargoyle
{
	public class ChargeFireball : BaseSkillState
	{
		public float baseDuration = 0.8f;

		private float duration;

		private GameObject chargeInstance;

		private EffectManagerHelper _emh_chargeInstance;

		public override void Reset()
		{
			((BaseState)this).Reset();
			duration = 0f;
			chargeInstance = null;
			_emh_chargeInstance = null;
		}

		public override void OnEnter()
		{
			//IL_00c2: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			((BaseState)this).StartAimMode(2f, false);
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			Util.PlayAttackSpeedSound(ChargeFireball.attackString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat);
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				ChildLocator component = ((Component)modelTransform).GetComponent<ChildLocator>();
				if (Object.op_Implicit((Object)(object)component))
				{
					Transform val = component.FindChild("MuzzleMouth");
					if (Object.op_Implicit((Object)(object)val))
					{
						if (!EffectManager.ShouldUsePooledEffect(ChargeFireball.chargeVfxPrefab))
						{
							chargeInstance = Object.Instantiate<GameObject>(ChargeFireball.chargeVfxPrefab, val.position, val.rotation);
						}
						else
						{
							_emh_chargeInstance = EffectManager.GetAndActivatePooledEffect(ChargeFireball.chargeVfxPrefab, val.position, val.rotation);
							chargeInstance = ((Component)_emh_chargeInstance).gameObject;
						}
						chargeInstance.transform.parent = val;
					}
				}
			}
			((EntityState)this).PlayCrossfade("Head, Override", "ChargeFireball", "Fireball.playbackRate", duration, 0.1f);
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			if (!Object.op_Implicit((Object)(object)chargeInstance))
			{
				return;
			}
			if (!EffectManager.UsePools)
			{
				EntityState.Destroy((Object)(object)chargeInstance);
				return;
			}
			if ((Object)(object)_emh_chargeInstance != (Object)null && _emh_chargeInstance.OwningPool != null)
			{
				((GenericPool<EffectManagerHelper>)(object)_emh_chargeInstance.OwningPool).ReturnObject(_emh_chargeInstance);
				return;
			}
			if ((Object)(object)_emh_chargeInstance != (Object)null)
			{
			}
			EntityState.Destroy((Object)(object)chargeInstance);
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			((EntityState)this).characterBody.SetAimTimer(0.5f);
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new ThrowFireball());
			}
		}

		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 ChargeHellfire : BaseSkillState
	{
		public float baseDuration = 1.2f;

		private float duration;

		private GameObject chargeInstance;

		private EffectManagerHelper _emh_chargeInstance;

		public override void Reset()
		{
			((BaseState)this).Reset();
			duration = 0f;
			chargeInstance = null;
			_emh_chargeInstance = null;
		}

		public override void OnEnter()
		{
			//IL_00d4: 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_00b2: 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)
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			((BaseState)this).StartAimMode(2f, false);
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			Util.PlayAttackSpeedSound(ChargeMegaFireball.attackString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat);
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				ChildLocator component = ((Component)modelTransform).GetComponent<ChildLocator>();
				if (Object.op_Implicit((Object)(object)component))
				{
					Transform val = component.FindChild("MouthMuzzle");
					if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)ChargeMegaFireball.chargeEffectPrefab))
					{
						if (!EffectManager.ShouldUsePooledEffect(ChargeMegaFireball.chargeEffectPrefab))
						{
							chargeInstance = Object.Instantiate<GameObject>(ChargeMegaFireball.chargeEffectPrefab, val.position, val.rotation);
						}
						else
						{
							_emh_chargeInstance = EffectManager.GetAndActivatePooledEffect(ChargeMegaFireball.chargeEffectPrefab, val.position, val.rotation);
							chargeInstance = ((Component)_emh_chargeInstance).gameObject;
						}
						chargeInstance.transform.parent = val;
						ScaleParticleSystemDuration component2 = chargeInstance.GetComponent<ScaleParticleSystemDuration>();
						if (Object.op_Implicit((Object)(object)component2))
						{
							component2.newDuration = duration;
						}
					}
				}
			}
			((EntityState)this).PlayCrossfade("Head, Override", "ChargeFireball", "Fireball.playbackRate", duration, 0.1f);
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			if (Object.op_Implicit((Object)(object)chargeInstance))
			{
				if ((Object)(object)_emh_chargeInstance != (Object)null && _emh_chargeInstance.OwningPool != null)
				{
					((GenericPool<EffectManagerHelper>)(object)_emh_chargeInstance.OwningPool).ReturnObject(_emh_chargeInstance);
				}
				else
				{
					EntityState.Destroy((Object)(object)chargeInstance);
				}
				chargeInstance = null;
				_emh_chargeInstance = null;
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			((EntityState)this).characterBody.SetAimTimer(0.5f);
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new ThrowHellfire());
			}
		}

		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 DeathState : GenericCharacterDeath
	{
		private bool hasDied;

		public override void OnEnter()
		{
			((GenericCharacterDeath)this).OnEnter();
			Util.PlaySound("sfx_gargoyle_death", ((EntityState)this).gameObject);
			ModelLocator modelLocator = ((EntityState)this).modelLocator;
			if (Object.op_Implicit((Object)(object)modelLocator))
			{
				Transform modelTransform = modelLocator.modelTransform;
				if (Object.op_Implicit((Object)(object)modelTransform))
				{
					TemporaryOverlayInstance val = TemporaryOverlayManager.AddOverlay(((Component)modelTransform).gameObject);
					val.duration = 1f;
					val.destroyComponentOnEnd = true;
					val.originalMaterial = BelmontAssets.morningStarExplosionOverlay;
					val.inspectorCharacterModel = ((Component)modelTransform).GetComponent<CharacterModel>();
					val.alphaCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1.5f);
					val.animateShaderAlpha = true;
				}
			}
		}

		public override void FixedUpdate()
		{
			//IL_005a: 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_0066: 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_0082: Expected O, but got Unknown
			((GenericCharacterDeath)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= 1f && NetworkServer.active && !hasDied)
			{
				hasDied = true;
				GameObject val = BelmontAssets.morningStarExplosionEffect;
				if (Config.useHunkExplosion.Value && MainPlugin.hunkInstalled)
				{
					val = GetHunkExplosion();
				}
				EffectManager.SpawnEffect(val, new EffectData
				{
					origin = ((EntityState)this).characterBody.corePosition,
					scale = 8f
				}, true);
				((GenericCharacterDeath)this).DestroyBodyAsapServer();
				EntityState.Destroy((Object)(object)((EntityState)this).gameObject);
			}
		}

		public override void OnExit()
		{
			((GenericCharacterDeath)this).DestroyModel();
			((GenericCharacterDeath)this).OnExit();
		}

		private GameObject GetHunkExplosion()
		{
			//IL_0012: 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)
			if (!MainPlugin.hunkInstalled)
			{
				return Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/VFX/OmniExplosionVFX.prefab").WaitForCompletion();
			}
			return HunkAssets.flameExplosionEffect;
		}
	}
	public class GreatDeath : GenericCharacterDeath
	{
		private bool hasDied;

		public override void OnEnter()
		{
			((GenericCharacterDeath)this).OnEnter();
			Util.PlaySound("sfx_gargoyle_death", ((EntityState)this).gameObject);
			ModelLocator modelLocator = ((EntityState)this).modelLocator;
			if (Object.op_Implicit((Object)(object)modelLocator))
			{
				Transform modelTransform = modelLocator.modelTransform;
				if (Object.op_Implicit((Object)(object)modelTransform))
				{
					TemporaryOverlayInstance val = TemporaryOverlayManager.AddOverlay(((Component)modelTransform).gameObject);
					val.duration = 1f;
					val.destroyComponentOnEnd = true;
					val.originalMaterial = BelmontAssets.morningStarExplosionOverlay;
					val.inspectorCharacterModel = ((Component)modelTransform).GetComponent<CharacterModel>();
					val.alphaCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1.5f);
					val.animateShaderAlpha = true;
				}
			}
		}

		public override void FixedUpdate()
		{
			//IL_005a: 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_0066: 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_0082: Expected O, but got Unknown
			((GenericCharacterDeath)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= 1f && NetworkServer.active && !hasDied)
			{
				hasDied = true;
				GameObject val = BelmontAssets.morningStarExplosionEffect;
				if (Config.useHunkExplosion.Value && MainPlugin.hunkInstalled)
				{
					val = GetHunkExplosion();
				}
				EffectManager.SpawnEffect(val, new EffectData
				{
					origin = ((EntityState)this).characterBody.corePosition,
					scale = 16f
				}, true);
				((GenericCharacterDeath)this).DestroyBodyAsapServer();
				EntityState.Destroy((Object)(object)((EntityState)this).gameObject);
			}
		}

		public override void OnExit()
		{
			((GenericCharacterDeath)this).DestroyModel();
			((GenericCharacterDeath)this).OnExit();
		}

		private GameObject GetHunkExplosion()
		{
			//IL_0012: 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)
			if (!MainPlugin.hunkInstalled)
			{
				return Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/VFX/OmniExplosionVFX.prefab").WaitForCompletion();
			}
			return HunkAssets.grenadeExplosionEffect;
		}
	}
	public class GreatSpawn : GenericCharacterSpawnState
	{
		public override void OnEnter()
		{
			//IL_004a: 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_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_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Expected O, but got Unknown
			((GenericCharacterSpawnState)this).OnEnter();
			base.duration = 2f;
			((EntityState)this).PlayAnimation("Body", "Spawn", "Spawn.playbackRate", base.duration, 0f);
			Util.PlaySound("sfx_gargoyle_spawn", ((EntityState)this).gameObject);
			EffectManager.SpawnEffect(BelmontAssets.greatGargoyleSpawnEffect, new EffectData
			{
				origin = ((EntityState)this).transform.position + Vector3.up * -0.5f,
				rotation = Quaternion.identity,
				scale = 1f
			}, false);
		}
	}
	public class Slash : BaseMeleeAttack
	{
		private GameObject swingEffectInstance;

		public override void OnEnter()
		{
			//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)
			//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)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			hitboxName = "Slash";
			damageCoefficient = 4f;
			pushForce = 200f;
			baseDuration = 1.5f;
			baseEarlyExitTime = 2f;
			attackRecoil = 2f / ((BaseState)this).attackSpeedStat;
			hitHopVelocity = 6.5f / ((BaseState)this).attackSpeedStat;
			attackStartTime = 0.335f;
			attackEndTime = 0.45f;
			hitStopDuration = 0.3f;
			smoothHitstop = true;
			swingSoundString = "sfx_belmont_swing_sword";
			hitSoundString = "";
			impactSound = BelmontAssets.gargoyleImpactSoundEvent.index;
			hitEffectPrefab = BelmontAssets.whipCritImpactEffect;
			swingEffectPrefab = BelmontAssets.critSwingEffect;
			muzzleString = "SlashMuzzle";
			damageType = DamageTypeCombo.op_Implicit(DamageTypeCombo.GenericPrimary);
			base.OnEnter();
			Util.PlayAttackSpeedSound(Bite.attackString, ((EntityState)this).gameObject, 0.5f);
		}

		protected override void PlaySwingEffect()
		{
			Util.PlaySound(swingSoundString, ((EntityState)this).gameObject);
			if (!Object.op_Implicit((Object)(object)swingEffectPrefab))
			{
				return;
			}
			Transform val = ((BaseState)this).FindModelChild(muzzleString);
			if (Object.op_Implicit((Object)(object)val))
			{
				swingEffectInstance = Object.Instantiate<GameObject>(swingEffectPrefab, val);
				ScaleParticleSystemDuration component = swingEffectInstance.GetComponent<ScaleParticleSystemDuration>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.newDuration = component.initialDuration;
				}
			}
		}

		protected override void TriggerHitStop()
		{
			base.TriggerHitStop();
			if (Object.op_Implicit((Object)(object)swingEffectInstance))
			{
				ScaleParticleSystemDuration component = swingEffectInstance.GetComponent<ScaleParticleSystemDuration>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.newDuration = 20f;
				}
			}
		}

		protected override void ClearHitStop()
		{
			base.ClearHitStop();
			if (Object.op_Implicit((Object)(object)swingEffectInstance))
			{
				ScaleParticleSystemDuration component = swingEffectInstance.GetComponent<ScaleParticleSystemDuration>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.newDuration = component.initialDuration;
				}
			}
		}

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

		protected override void SetNextState()
		{
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			if (stopwatch >= 0.85f * duration)
			{
				return (InterruptPriority)0;
			}
			return (InterruptPriority)2;
		}
	}
	public class SpawnState : GenericCharacterSpawnState
	{
		public override void OnEnter()
		{
			//IL_004a: 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_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_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Expected O, but got Unknown
			((GenericCharacterSpawnState)this).OnEnter();
			base.duration = 1.5f;
			((EntityState)this).PlayAnimation("Body", "Spawn", "Spawn.playbackRate", base.duration, 0f);
			Util.PlaySound("sfx_gargoyle_spawn", ((EntityState)this).gameObject);
			EffectManager.SpawnEffect(BelmontAssets.gargoyleSpawnEffect, new EffectData
			{
				origin = ((EntityState)this).transform.position + Vector3.up * -0.5f,
				rotation = Quaternion.identity,
				scale = 1f
			}, false);
		}
	}
	public class ThrowFireball : BaseSkillState
	{
		public float baseDuration = 0.5f;

		public float force = 100f;

		public float damageCoefficient = 1f;

		private float duration;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			((EntityState)this).characterBody.SetAimTimer(0.5f);
			((EntityState)this).PlayAnimation("Head, Override", "ThrowFireball", "Fireball.playbackRate", duration, 0f);
			Util.PlaySound("sfx_belmont_flame_pillar", ((EntityState)this).gameObject);
			FireProjectile();
		}

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

		public void FireProjectile()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Expected O, but got Unknown
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_021d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: 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)
			//IL_0171: 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_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: 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_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			if (!((EntityState)this).isAuthority)
			{
				return;
			}
			Ray aimRay = ((BaseState)this).GetAimRay();
			if (!((EntityState)this).characterBody.isPlayerControlled)
			{
				BullseyeSearch val = new BullseyeSearch
				{
					teamMaskFilter = TeamMask.GetEnemyTeams(((BaseState)this).GetTeam()),
					filterByLoS = false,
					searchOrigin = ((Ray)(ref aimRay)).origin,
					searchDirection = Random.onUnitSphere,
					sortMode = (SortMode)1,
					maxDistanceFilter = 80f,
					maxAngleFilter = 360f
				};
				val.RefreshCandidates();
				val.FilterOutGameObject(((EntityState)this).gameObject);
				List<HurtBox> source = val.GetResults().ToList();
				HurtBox val2 = source.FirstOrDefault();
				if (Object.op_Implicit((Object)(object)val2))
				{
					Vector3 val3 = ((Component)val2).transform.position - ((Ray)(ref aimRay)).origin;
					((Ray)(ref aimRay)).direction = ((Vector3)(ref val3)).normalized;
				}
			}
			GameObject projectilePrefab = FireFireball.projectilePrefab;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory) && ((EntityState)this).characterBody.inventory.GetItemCount(Items.MoreMissile) > 0)
			{
				float iCBMDamageMult = MainPlugin.GetICBMDamageMult(((EntityState)this).characterBody);
				Vector3 val4 = Vector3.Cross(Vector3.up, ((Ray)(ref aimRay)).direction);
				Vector3 val5 = Vector3.Cross(((Ray)(ref aimRay)).direction, val4);
				Vector3 val6 = Quaternion.AngleAxis(-1.5f, val5) * ((Ray)(ref aimRay)).direction;
				Quaternion val7 = Quaternion.AngleAxis(1.5f, val5);
				Ray val8 = default(Ray);
				((Ray)(ref val8))..ctor(((Ray)(ref aimRay)).origin, val6);
				for (int i = 0; i < 3; i++)
				{
					ProjectileManager.instance.FireProjectile(projectilePrefab, ((Ray)(ref val8)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref val8)).direction), ((EntityState)this).gameObject, iCBMDamageMult * ((BaseState)this).damageStat * damageCoefficient, force, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, 50f, (DamageTypeCombo?)null);
					((Ray)(ref val8)).direction = val7 * ((Ray)(ref val8)).direction;
				}
			}
			else
			{
				ProjectileManager.instance.FireProjectile(projectilePrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, ((BaseState)this).damageStat * damageCoefficient, force, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, 50f, (DamageTypeCombo?)null);
			}
		}
	}
	public class ThrowHellfire : BaseSkillState
	{
		public float baseDuration = 0.5f;

		public float force = 100f;

		public float damageCoefficient = 0.3f;

		private float duration;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			((EntityState)this).characterBody.SetAimTimer(0.5f);
			((EntityState)this).PlayAnimation("Head, Override", "ThrowFireball", "Fireball.playbackRate", duration, 0f);
			Util.PlaySound("sfx_belmont_flame_pillar", ((EntityState)this).gameObject);
			FireProjectile();
		}

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

		public void FireProjectile()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Expected O, but got Unknown
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_021d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: 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)
			//IL_0171: 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_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: 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_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			if (!((EntityState)this).isAuthority)
			{
				return;
			}
			Ray aimRay = ((BaseState)this).GetAimRay();
			if (!((EntityState)this).characterBody.isPlayerControlled)
			{
				BullseyeSearch val = new BullseyeSearch
				{
					teamMaskFilter = TeamMask.GetEnemyTeams(((BaseState)this).GetTeam()),
					filterByLoS = false,
					searchOrigin = ((Ray)(ref aimRay)).origin,
					searchDirection = Random.onUnitSphere,
					sortMode = (SortMode)1,
					maxDistanceFilter = 80f,
					maxAngleFilter = 360f
				};
				val.RefreshCandidates();
				val.FilterOutGameObject(((EntityState)this).gameObject);
				List<HurtBox> source = val.GetResults().ToList();
				HurtBox val2 = source.FirstOrDefault();
				if (Object.op_Implicit((Object)(object)val2))
				{
					Vector3 val3 = ((Component)val2).transform.position - ((Ray)(ref aimRay)).origin;
					((Ray)(ref aimRay)).direction = ((Vector3)(ref val3)).normalized;
				}
			}
			GameObject hellfireFlaskProjectile = Projectiles.hellfireFlaskProjectile;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory) && ((EntityState)this).characterBody.inventory.GetItemCount(Items.MoreMissile) > 0)
			{
				float iCBMDamageMult = MainPlugin.GetICBMDamageMult(((EntityState)this).characterBody);
				Vector3 val4 = Vector3.Cross(Vector3.up, ((Ray)(ref aimRay)).direction);
				Vector3 val5 = Vector3.Cross(((Ray)(ref aimRay)).direction, val4);
				Vector3 val6 = Quaternion.AngleAxis(-1.5f, val5) * ((Ray)(ref aimRay)).direction;
				Quaternion val7 = Quaternion.AngleAxis(1.5f, val5);
				Ray val8 = default(Ray);
				((Ray)(ref val8))..ctor(((Ray)(ref aimRay)).origin, val6);
				for (int i = 0; i < 3; i++)
				{
					ProjectileManager.instance.FireProjectile(hellfireFlaskProjectile, ((Ray)(ref val8)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref val8)).direction), ((EntityState)this).gameObject, iCBMDamageMult * ((BaseState)this).damageStat * damageCoefficient, force, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, 50f, (DamageTypeCombo?)null);
					((Ray)(ref val8)).direction = val7 * ((Ray)(ref val8)).direction;
				}
			}
			else
			{
				ProjectileManager.instance.FireProjectile(hellfireFlaskProjectile, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, ((BaseState)this).damageStat * damageCoefficient, force, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, 50f, (DamageTypeCombo?)null);
			}
		}
	}
}
namespace BelmontMod.SkillStates.Emote
{
	public class BaseEmote : BaseState
	{
		private CameraParamsOverrideHandle camOverrideHandle;

		private Animator animator;

		private ChildLocator childLocator;

		private float duration;

		private uint activePlayID;

		public LocalUser localUser;

		public override void OnEnter()
		{
			//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)
			((BaseState)this).OnEnter();
			animator = ((EntityState)this).GetModelAnimator();
			childLocator = ((EntityState)this).GetModelChildLocator();
			FindLocalUser();
			((EntityState)this).characterBody.hideCrosshair = true;
			camOverrideHandle = CameraParams.OverrideCameraParams(((EntityState)this).cameraTargetParams, BelmontCameraParams.EMOTE);
		}

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

		protected void PlayEmote(string animString, string soundString = "", float animDuration = 0f)
		{
			PlayEmote(animString, soundString, ((EntityState)this).GetModelAnimator(), animDuration);
		}

		protected void PlayEmote(string animString, string soundString, Animator animator, float animDuration = 0f)
		{
			if (animDuration >= 0f && duration != 0f)
			{
				animDuration = duration;
			}
			if (duration > 0f)
			{
				EntityState.PlayAnimationOnAnimator(animator, "Emote, Override", animString, "Emote.playbackRate", animDuration, 0f);
			}
			else
			{
				animator.SetFloat("Emote.playbackRate", 1f);
				EntityState.PlayAnimationOnAnimator(animator, "Emote, Override", animString);
			}
			if (!string.IsNullOrEmpty(soundString))
			{
				activePlayID = Util.PlaySound(soundString, ((EntityState)this).gameObject);
			}
		}

		public override void Update()
		{
			((EntityState)this).Update();
			if (((EntityState)this).isAuthority)
			{
				CheckEmote<Rest>(Config.restKey);
				CheckEmote<Taunt>(Config.tauntKey);
				CheckEmote<Dance>(Config.danceKey);
			}
		}

		private void CheckEmote(KeyCode keybind, EntityState state)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			if (Input.GetKeyDown(keybind) && !localUser.isUIFocused)
			{
				((EntityState)this).outer.SetInterruptState(state, (InterruptPriority)0);
			}
		}

		private void CheckEmote<T>(ConfigEntry<KeyboardShortcut> keybind) where T : EntityState, new()
		{
			if (Config.GetKeyPressed(keybind))
			{
				FindLocalUser();
				if (localUser != null && !localUser.isUIFocused)
				{
					((EntityState)this).outer.SetInterruptState((EntityState)(object)new T(), (InterruptPriority)0);
				}
			}
		}

		public override void FixedUpdate()
		{
			//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)
			((EntityState)this).FixedUpdate();
			bool flag = false;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded)
			{
				flag = true;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank))
			{
				if (((EntityState)this).inputBank.skill1.down)
				{
					flag = true;
				}
				if (((EntityState)this).inputBank.skill2.down)
				{
					flag = true;
				}
				if (((EntityState)this).inputBank.skill3.down)
				{
					flag = true;
				}
				if (((EntityState)this).inputBank.skill4.down)
				{
					flag = true;
				}
				if (((EntityState)this).inputBank.moveVector != Vector3.zero)
				{
					flag = true;
				}
			}
			if (duration > 0f && ((EntityState)this).fixedAge >= duration)
			{
				flag = true;
			}
			if (flag && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			//IL_0045: 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)
			((EntityState)this).OnExit();
			((EntityState)this).characterBody.hideCrosshair = false;
			((EntityState)this).PlayAnimation("Emote, Override", "BufferEmpty");
			if (activePlayID != 0)
			{
				AkSoundEngine.StopPlayingID(activePlayID);
			}
			((EntityState)this).cameraTargetParams.RemoveParamsOverride(camOverrideHandle, 0.5f);
		}

		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)0;
		}
	}
	public class Dance : BaseEmote
	{
		public override void OnEnter()
		{
			base.OnEnter();
			PlayEmote("Dance");
		}

		public override void OnExit()
		{
			base.OnExit();
			if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator) && Object.op_Implicit((Object)(object)((EntityState)this).modelLocator.modelTransform))
			{
				BelmontAnimationEvents component = ((Component)((EntityState)this).modelLocator.modelTransform).GetComponent<BelmontAnimationEvents>();
				if (Object.op_Implicit((Object)(object)component))
				{
					component.EndTrails();
				}
			}
		}
	}
	public class Rest : BaseEmote
	{
		public override void OnEnter()
		{
			base.OnEnter();
			PlayEmote("Rest", "", 1.5f);
		}
	}
	public class Taunt : BaseEmote
	{
		public override void OnEnter()
		{
			base.OnEnter();
			PlayEmote("Taunt", "", 1.5f);
		}
	}
}
namespace BelmontMod.SkillStates.Belmont
{
	public class BaseBelmontSkillState : BaseSkillState
	{
		protected BelmontController belmont;

		protected virtual bool turningAllowed => true;

		protected virtual bool normalizeModel => false;

		protected virtual bool HasItem(ItemDef itemDef)
		{
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory))
			{
				return ((EntityState)this).characterBody.inventory.GetItemCount(itemDef) > 0;
			}
			return false;
		}

		public override void OnEnter()
		{
			ValidateControllerReference();
			((BaseState)this).OnEnter();
			if (!turningAllowed)
			{
				((EntityState)this).characterDirection.turnSpeed = 0f;
			}
			if (normalizeModel)
			{
				((EntityState)this).modelLocator.normalizeToFloor = true;
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			if (!turningAllowed)
			{
				((EntityState)this).characterDirection.turnSpeed = belmont.baseTurnSpeed;
			}
			if (normalizeModel)
			{
				((EntityState)this).modelLocator.normalizeToFloor = false;
			}
		}

		protected void ValidateControllerReference()
		{
			belmont = ((EntityState)this).gameObject.GetComponent<BelmontController>();
		}
	}
	public class BaseBelmontState : BaseState
	{
		protected BelmontController belmont;

		protected virtual bool HasItem(ItemDef itemDef)
		{
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory))
			{
				return ((EntityState)this).characterBody.inventory.GetItemCount(itemDef) > 0;
			}
			return false;
		}

		public override void OnEnter()
		{
			ValidateControllerReference();
			((BaseState)this).OnEnter();
		}

		protected void ValidateControllerReference()
		{
			belmont = ((EntityState)this).gameObject.GetComponent<BelmontController>();
		}
	}
	internal class CarryPot
	{
	}
	public class Falling : BaseBelmontSkillState
	{
		public Vector3 overrideVelocity = Vector3.zero;

		protected Vector3 slipVector = Vector3.zero;

		private float stopwatch;

		private float previousAirControl;

		private bool shouldCancel;

		public override void OnEnter()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: 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_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: 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_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: 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_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			base.OnEnter();
			Vector3 val = ((((EntityState)this).inputBank.moveVector == Vector3.zero) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.moveVector);
			slipVector = ((Vector3)(ref val)).normalized;
			previousAirControl = ((EntityState)this).characterMotor.airControl;
			((EntityState)this).characterMotor.airControl = BaseLeap.airControl;
			Ray aimRay = ((BaseState)this).GetAimRay();
			Vector3 direction = ((Ray)(ref aimRay)).direction;
			CharacterBody characterBody = ((EntityState)this).characterBody;
			characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags | 1);
			Util.PlaySound("sfx_hunk_airdodge", ((EntityState)this).gameObject);
			if (((EntityState)this).isAuthority)
			{
				((EntityState)this).characterBody.isSprinting = true;
				direction.y = Mathf.Max(direction.y, 1.05f * BaseLeap.minimumY);
				Vector3 val2 = slipVector * (0.5f * BaseLeap.aimVelocity) * 12f;
				Vector3 val3 = Vector3.up * 0.75f * BaseLeap.upwardVelocity;
				Vector3 val4 = direction * (0.75f * BaseLeap.aimVelocity) * 12f;
				val4.x = 0f;
				val4.z = 0f;
				val = new Vector3(direction.x, 0f, direction.z);
				Vector3 val5 = ((Vector3)(ref val)).normalized * (1.1f * BaseLeap.forwardVelocity);
				((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
				((EntityState)this).characterMotor.velocity = val2 + val4 + val3 + val5;
			}
			if (overrideVelocity != Vector3.zero)
			{
				((EntityState)this).characterMotor.velocity = overrideVelocity;
			}
			if (overrideVelocity.y >= 15f)
			{
				shouldCancel = true;
			}
		}

		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)
			base.OnExit();
			CharacterBody characterBody = ((EntityState)this).characterBody;
			characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags & -2);
			((EntityState)this).characterMotor.airControl = previousAirControl;
			belmont.shouldCancelFreefall = false;
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			if (belmont.shouldCancelFreefall)
			{
				if (((EntityState)this).isAuthority)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
				((EntityState)this).PlayAnimation("FullBody, Override Soft", "BufferEmpty");
				return;
			}
			if (stopwatch >= 0.1f && ((EntityState)this).isAuthority && ((EntityState)this).characterMotor.isGrounded)
			{
				SetNextState();
			}
			if (stopwatch >= 0.25f && shouldCancel && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		protected virtual void SetNextState()
		{
			((EntityState)this).outer.SetNextState((EntityState)(object)new Roll());
		}

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

		public LocalUser localUser;

		private BelmontController belmont;

		private float groundSprintTimer;

		private bool wasSuperSprinting;

		public override void OnEnter()
		{
			((GenericCharacterMain)this).OnEnter();
			animator = ((BaseCharacterMain)this).modelAnimator;
			belmont = ((EntityState)this).GetComponent<BelmontController>();
			FindLocalUser();
		}

		public override void FixedUpdate()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			if (belmont.isSwinging)
			{
				((EntityState)this).inputBank.moveVector = Vector3.zero;
			}
			((GenericCharacterMain)this).FixedUpdate();
			if (((BaseState)this).isGrounded && ((EntityState)this).characterBody.isSprinting)
			{
				groundSprintTimer += Time.fixedDeltaTime;
			}
			else
			{
				groundSprintTimer = 0f;
			}
			if (Object.op_Implicit((Object)(object)animator))
			{
				bool flag = false;
				if (!((EntityState)this).characterBody.outOfDanger || !((EntityState)this).characterBody.outOfCombat)
				{
					flag = true;
				}
				animator.SetBool("inCombat", flag);
				if (((BaseState)this).isGrounded)
				{
					animator.SetFloat("airBlend", 0f);
				}
				else
				{
					animator.SetFloat("airBlend", 1f);
				}
				animator.SetFloat("aimDir", ((EntityState)this).inputBank.aimDirection.y);
			}
			if (groundSprintTimer >= 1f && belmont.hasWingedBoots)
			{
				belmont.wingedBootsActive = true;
				if (NetworkServer.active && !wasSuperSprinting)
				{
					((EntityState)this).characterBody.AddBuff(BelmontMod.Content.Survivors.Belmont.superSprintBuff);
				}
				wasSuperSprinting = true;
				animator.SetBool("isSuperSprinting", true);
			}
			else
			{
				if (((BaseState)this).isGrounded)
				{
					belmont.wingedBootsActive = false;
				}
				if (NetworkServer.active && wasSuperSprinting)
				{
					((EntityState)this).characterBody.RemoveBuff(BelmontMod.Content.Survivors.Belmont.superSprintBuff);
				}
				wasSuperSprinting = false;
				animator.SetBool("isSuperSprinting", false);
			}
			if (belmont.hasWingedBoots)
			{
				HandleHover();
			}
		}

		private void HandleHover()
		{
			if (!((BaseState)this).isGrounded)
			{
				if (((EntityState)this).isAuthority && ((EntityState)this).inputBank.jump.down && !((BaseState)this).isGrounded && belmont.hoverDuration > 0f && ((EntityState)this).characterMotor.velocity.y <= 0f)
				{
					((EntityState)this).characterMotor.velocity.y = 0f;
					belmont.RunHover();
					belmont.isHovering = true;
					belmont.wingedBootsActive = true;
				}
				else
				{
					belmont.isHovering = false;
					belmont.wingedBootsActive = false;
				}
			}
			else
			{
				belmont.isHovering = false;
			}
		}

		public override void Update()
		{
			((GenericCharacterMain)this).Update();
			if (((EntityState)this).isAuthority && ((EntityState)this).characterMotor.isGrounded)
			{
				CheckEmote<Rest>(Config.restKey);
				CheckEmote<Taunt>(Config.tauntKey);
				CheckEmote<Dance>(Config.danceKey);
			}
		}

		private bool HasItem(ItemDef itemDef)
		{
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory))
			{
				return ((EntityState)this).characterBody.inventory.GetItemCount(itemDef) > 0;
			}
			return false;
		}

		private void CheckEmote(KeyCode keybind, EntityState state)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			if (Input.GetKeyDown(keybind) && !localUser.isUIFocused)
			{
				((EntityState)this).outer.SetInterruptState(state, (InterruptPriority)0);
			}
		}

		private void CheckEmote<T>(ConfigEntry<KeyboardShortcut> keybind) where T : EntityState, new()
		{
			if (Config.GetKeyPressed(keybind))
			{
				FindLocalUser();
				if (localUser != null && !localUser.isUIFocused)
				{
					((EntityState)this).outer.SetInterruptState((EntityState)(object)new T(), (InterruptPriority)0);
				}
			}
		}

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

		public override void ProcessJump()
		{
			//IL_028f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0294: 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_02ac: Expected O, but got Unknown
			//IL_02cf: 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_02db: 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_02fd: Expected O, but got Unknown
			//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_031d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0328: Unknown result type (might be due to invalid IL or missing references)
			//IL_032f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0334: Unknown result type (might be due to invalid IL or missing references)
			//IL_0339: Unknown result type (might be due to invalid IL or missing references)
			//IL_0344: Expected O, but got Unknown
			//IL_0374: Unknown result type (might be due to invalid IL or missing references)
			//IL_0386: 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)
			if (!((BaseCharacterMain)this).hasCharacterMotor)
			{
				return;
			}
			bool flag = false;
			bool flag2 = false;
			if (!base.jumpInputReceived || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody) || ((EntityState)this).characterMotor.jumpCount >= ((EntityState)this).characterBody.maxJumpCount)
			{
				return;
			}
			Util.PlaySound("sfx_belmont_jump", ((EntityState)this).gameObject);
			int itemCount = ((EntityState)this).characterBody.inventory.GetItemCount(Items.JumpBoost);
			float num = 1f;
			float num2 = 1f;
			if (((EntityState)this).characterMotor.jumpCount >= ((EntityState)this).characterBody.baseJumpCount)
			{
				flag = true;
				num = 1.5f;
				num2 = 1.5f;
			}
			else if (itemCount > 0 && ((EntityState)this).characterBody.isSprinting)
			{
				float num3 = ((EntityState)this).characterBody.acceleration * ((EntityState)this).characterMotor.airControl;
				if (((EntityState)this).characterBody.moveSpeed > 0f && num3 > 0f)
				{
					flag2 = true;
					float num4 = Mathf.Sqrt(10f * (float)itemCount / num3);
					float num5 = ((EntityState)this).characterBody.moveSpeed / num3;
					num = (num4 + num5) / num5;
				}
			}
			GenericCharacterMain.ApplyJumpVelocity(((EntityState)this).characterMotor, ((EntityState)this).characterBody, num, num2, false);
			if (((BaseCharacterMain)this).hasModelAnimator)
			{
				int layerIndex = ((BaseCharacterMain)this).modelAnimator.GetLayerIndex("Body");
				if (layerIndex >= 0)
				{
					if (((EntityState)this).characterBody.isSprinting && flag2)
					{
						if (Config.alternateAnimations.Value)
						{
							((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("ShitJump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex);
						}
						else
						{
							((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("SprintJump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex);
						}
					}
					else if (Config.alternateAnimations.Value)
					{
						((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("ShitJump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex);
					}
					else if (((EntityState)this).characterMotor.jumpCount == 0)
					{
						((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("Jump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex);
					}
					else
					{
						((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("Jump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex);
					}
				}
			}
			if (flag)
			{
				EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/FeatherEffect"), new EffectData
				{
					origin = ((EntityState)this).characterBody.footPosition
				}, true);
			}
			else if (((EntityState)this).characterMotor.jumpCount > 0)
			{
				EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ImpactEffects/CharacterLandImpact"), new EffectData
				{
					origin = ((EntityState)this).characterBody.footPosition,
					scale = ((EntityState)this).characterBody.radius
				}, true);
			}
			if (flag2)
			{
				EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/BoostJumpEffect"), new EffectData
				{
					origin = ((EntityState)this).characterBody.footPosition,
					rotation = Util.QuaternionSafeLookRotation(((EntityState)this).characterMotor.velocity)
				}, true);
			}
			CharacterMotor characterMotor = ((EntityState)this).characterMotor;
			characterMotor.jumpCount++;
			if (Object.op_Implicit((Object)(object)animator))
			{
				float num6 = ((CharacterAnimatorWalkParamCalculator)(ref ((BaseCharacterMain)this).animatorWalkParamCalculator)).animatorWalkSpeed.y;
				float num7 = ((CharacterAnimatorWalkParamCalculator)(ref ((BaseCharacterMain)this).animatorWalkParamCalculator)).animatorWalkSpeed.x;
				if ((Mathf.Abs(num6) <= 0.45f && Mathf.Abs(num7) <= 0.45f) || ((EntityState)this).inputBank.moveVector == Vector3.zero)
				{
					num6 = 0f;
					num7 = 0f;
				}
				if (Mathf.Abs(num6) > Mathf.Abs(num7))
				{
					num6 = ((!(num6 > 0f)) ? (-1f) : 1f);
					num7 = 0f;
				}
				else if (Mathf.Abs(num6) < Mathf.Abs(num7))
				{
					num7 = ((!(num7 > 0f)) ? (-1f) : 1f);
					num6 = 0f;
				}
				animator.SetFloat("forwardSpeedCached", num7);
				animator.SetFloat("rightSpeedCached", num6);
			}
		}
	}
	public class Roll : BaseBelmontSkillState
	{
		protected Vector3 slipVector = Vector3.zero;

		public float duration = 1.1f;

		private bool peepee;

		private float coeff = 12f;

		protected override bool turningAllowed => false;

		protected override bool normalizeModel => true;

		public override void OnEnter()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			base.OnEnter();
			Vector3 val = ((((EntityState)this).inputBank.moveVector == Vector3.zero) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.moveVector);
			slipVector = ((Vector3)(ref val)).normalized;
			((EntityState)this).gameObject.layer = LayerIndex.fakeActor.intVal;
			((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers();
			((EntityState)this).PlayCrossfade("FullBody, Override Soft", "Roll", "Landing.playbackRate", duration * 1.2f, 0.05f);
			Util.PlaySound("sfx_belmont_landing", ((EntityState)this).gameObject);
			Util.PlaySound("sfx_belmont_cloth_foley", ((EntityState)this).gameObject);
		}

		public override void FixedUpdate()
		{
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: 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_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: 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_0259: Unknown result type (might be due to invalid IL or missing references)
			if (peepee && ((EntityState)this).isAuthority)
			{
				((EntityState)this).characterMotor.jumpCount = 0;
				if (((ButtonState)(ref ((EntityState)this).inputBank.jump)).justPressed)
				{
					((EntityState)this).PlayCrossfade("FullBody, Override", "BufferEmpty", 0.05f);
					((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
					((EntityState)this).outer.SetNextStateToMain();
					return;
				}
			}
			else
			{
				((EntityState)this).characterMotor.jumpCount = ((EntityState)this).characterBody.maxJumpCount;
			}
			((EntityState)this).FixedUpdate();
			((EntityState)this).characterMotor.velocity = Vector3.zero;
			((EntityState)this).characterMotor.rootMotion = slipVector * (coeff * Time.fixedDeltaTime) * Mathf.Cos(((EntityState)this).fixedAge / duration * (MathF.PI / 2f));
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterDirection.forward = slipVector;
			}
			if (belmont.shouldCancelFreefall)
			{
				if (((EntityState)this).isAuthority)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
				((EntityState)this).PlayAnimation("FullBody, Override Soft", "BufferEmpty");
				return;
			}
			if (!peepee && ((EntityState)this).fixedAge >= 0.4f * duration)
			{
				peepee = true;
				coeff = 4f;
				((EntityState)this).gameObject.layer = LayerIndex.defaultLayer.intVal;
				((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers();
			}
			if (((EntityState)this).fixedAge >= 0.55f * duration && ((EntityState)this).inputBank.moveVector != Vector3.zero)
			{
				((EntityState)this).GetModelAnimator().SetTrigger("shouldCancel");
				if (((EntityState)this).isAuthority)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}
			else
			{
				if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
				((EntityState)this).inputBank.moveVector = Vector3.zero;
			}
		}

		public virtual void DampenVelocity()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			CharacterMotor characterMotor = ((EntityState)this).characterMotor;
			characterMotor.velocity *= 0.75f;
		}

		public override void OnExit()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			DampenVelocity();
			((EntityState)this).characterMotor.jumpCount = 0;
			base.OnExit();
			if (((EntityState)this).isAuthority && ((EntityState)this).inputBank.moveVector != Vector3.zero)
			{
				((EntityState)this).characterBody.isSprinting = true;
			}
			belmont.shouldCancelFreefall = false;
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddTimedBuff(Buffs.KillMoveSpeed, 0.25f);
				((EntityState)this).characterBody.AddTimedBuff(Buffs.KillMoveSpeed, 0.375f);
				((EntityState)this).characterBody.AddTimedBuff(Buffs.KillMoveSpeed, 0.5f);
				((EntityState)this).characterBody.AddTimedBuff(Buffs.KillMoveSpeed, 0.625f);
				((EntityState)this).characterBody.AddTimedBuff(Buffs.KillMoveSpeed, 0.75f);
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			if (peepee)
			{
				return (InterruptPriority)0;
			}
			return (InterruptPriority)5;
		}
	}
}
namespace BelmontMod.SkillStates.Belmont.Whip
{
	public class Crack : BaseBelmontSkillState
	{
		public HurtBox targetHurtbox;

		public float damageCoefficient = 6f;

		public float baseDuration = 1.7f;

		private float duration;

		private bool hasFired = false;

		private bool hasPlayedSound = false;

		private float targetTimer;

		private bool isCrit;

		private bool whipWasActive;

		private int swingIndex;

		private bool hasMorningStar;

		private float attackRecoil = 2f;

		private Vector3 targetPosition
		{
			get
			{
				//IL_002e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0033: Unknown result type (might be due to invalid IL or missing references)
				//IL_001b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				//IL_0036: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)targetHurtbox))
				{
					return ((Component)targetHurtbox).transform.position;
				}
				return ((BaseState)this).FindModelChild("WhipRTip").position;
			}
		}

		public override void OnEnter()
		{
			base.OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			whipWasActive = belmont.whipActiveTimer > 0f;
			belmont.PerformWhipCrack(duration);
			belmont.tracker.maxTrackingAngle = 45f;
			belmont.tracker.maxTrackingDistance = 40f;
			isCrit = ((BaseState)this).RollCrit();
			belmont.whipActiveTimer = duration;
			hasMorningStar = HasItem(BelmontMod.Content.Survivors.Belmont.morningStar);
			ModifyWhip();
			if (whipWasActive)
			{
				swingIndex = Random.Range(0, 3);
			}
			else
			{
				swingIndex = 0;
			}
			((EntityState)this).PlayCrossfade("Gesture, Override", "WhipCrack" + (swingIndex + 1), "Whip.playbackRate", duration, 0.05f);
			if (hasMorningStar)
			{
				Util.PlaySound("sfx_belmont_morningstar_foley_0" + (swingIndex + 1), ((EntityState)this).gameObject);
				belmont.morningStarHolder.SetActive(false);
			}
			else
			{
				Util.PlaySound("sfx_belmont_whip_foley_0" + (swingIndex + 1), ((EntityState)this).gameObject);
			}
		}

		private void ModifyWhip()
		{
			if (!Object.op_Implicit((Object)(object)belmont.characterModel))
			{
				return;
			}
			if (hasMorningStar)
			{
				((Component)((BaseState)this).FindModelChild("WhipRenderer")).gameObject.SetActive(false);
				((Component)((BaseState)this).FindModelChild("MorningStarRenderer")).gameObject.SetActive(true);
				return;
			}
			((Component)((BaseState)this).FindModelChild("WhipRenderer")).gameObject.SetActive(true);
			((Component)((BaseState)this).FindModelChild("MorningStarRenderer")).gameObject.SetActive(false);
			if (Config.redWhipEasterEgg.Value && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory) && ((EntityState)this).characterBody.inventory.GetItemCount(Items.SprintOutOfCombat) > 0)
			{
				belmont.characterModel.baseRendererInfos[7].defaultMaterial = BelmontAssets.redWhipMat;
			}
			else if (isCrit)
			{
				belmont.characterModel.baseRendererInfos[7].defaultMaterial = BelmontAssets.critWhipMat;
			}
			else
			{
				belmont.characterModel.baseRendererInfos[7].defaultMaterial = BelmontAssets.baseWhipMat;
			}
			belmont.characterModel.UpdateMaterials();
		}

		public override void OnExit()
		{
			base.OnExit();
			belmont.tracker.maxTrackingDistance = 40f;
			belmont.tracker.maxTrackingAngle = 20f;
			belmont.morningStarHolder.SetActive(true);
			belmont.whipTarget = null;
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			((BaseState)this).StartAimMode(0.5f, false);
			if (Object.op_Implicit((Object)(object)targetHurtbox))
			{
				belmont.whipTarget = ((Component)targetHurtbox).transform;
			}
			if (!hasFired)
			{
				HurtBox trackingTarget = belmont.tracker.GetTrackingTarget();
				if (Object.op_Implicit((Object)(object)trackingTarget))
				{
					targetHurtbox = trackingTarget;
					targetTimer = 0.2f;
					if (belmont.tracker.slamEligible && ((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= 0.1f && ((ButtonState)(ref ((EntityState)this).inputBank.skill1)).justPressed)
					{
						((EntityState)this).outer.SetNextState((EntityState)(object)new SlamDown
						{
							target = ((Component)trackingTarget.healthComponent).gameObject
						});
						return;
					}
				}
				else
				{
					targetTimer -= Time.fixedDeltaTime;
					if (targetTimer <= 0f)
					{
						targetHurtbox = null;
					}
				}
			}
			if (!hasFired && ((EntityState)this).fixedAge >= 0.32f * duration)
			{
				hasFired = true;
				FireBlast();
				belmont.tracker.maxTrackingDistance = 40f;
				belmont.tracker.maxTrackingAngle = 30f;
				if (((EntityState)this).isAuthority)
				{
					float num = 6f / ((BaseState)this).attackSpeedStat;
					((BaseState)this).AddRecoil(-1f * num, -2f * num, -0.5f * num, 0.5f * num);
				}
			}
			if (!hasPlayedSound && ((EntityState)this).fixedAge >= 0.3f * duration)
			{
				hasPlayedSound = true;
				if (!hasMorningStar)
				{
					Util.PlaySound("sfx_belmont_whip_impact", ((EntityState)this).gameObject);
				}
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				belmont.HideWhip();
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public void FireBlast()
		{
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Expected O, but got Unknown
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_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_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01db: Expected O, but got Unknown
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			if (hasMorningStar)
			{
				Util.PlaySound("sfx_belmont_morningstar_impact", ((EntityState)this).gameObject);
			}
			if (belmont.hasBrotherSoul)
			{
				FireFlamePillar();
			}
			if (!((EntityState)this).isAuthority)
			{
				return;
			}
			((BaseState)this).AddRecoil(-1f * attackRecoil, -2f * attackRecoil, -0.5f * attackRecoil, 0.5f * attackRecoil);
			BlastAttack val = new BlastAttack();
			val.radius = 4f;
			val.procCoefficient = 1f;
			val.position = targetPosition;
			val.attacker = ((EntityState)this).gameObject;
			val.crit = isCrit;
			val.baseDamage = ((BaseState)this).damageStat * damageCoefficient;
			val.falloffModel = (FalloffModel)2;
			val.baseForce = 200f;
			val.bonusForce = Vector3.up * 50f;
			val.teamIndex = TeamComponent.GetObjectTeam(val.attacker);
			val.damageType = DamageTypeCombo.op_Implicit((DamageType)0);
			val.attackerFiltering = (AttackerFiltering)2;
			val.damageType = DamageTypeCombo.GenericPrimary;
			HitPoint[] array = val.CollectHits();
			if (array.Length != 0 && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded)
			{
				((BaseState)this).SmallHop(((EntityState)this).characterMotor, 9f / ((BaseState)this).attackSpeedStat);
			}
			GameObject val2 = null;
			if (!hasMorningStar)
			{
				val2 = BelmontAssets.whipImpactEffect;
				if (isCrit)
				{
					val2 = BelmontAssets.whipCritImpactEffect;
				}
			}
			else
			{
				val2 = BelmontAssets.morningStarImpactEffect;
				if (isCrit)
				{
					val2 = BelmontAssets.morningStarCritImpactEffect;
				}
			}
			EffectManager.SpawnEffect(val2, new EffectData
			{
				origin = targetPosition
			}, true);
			if (Object.op_Implicit((Object)(object)targetHurtbox) && Object.op_Implicit((Object)(object)targetHurtbox.healthComponent) && targetHurtbox.healthComponent.alive && hasMorningStar)
			{
				MorningStarExplosion morningStarExplosion = ((Component)targetHurtbox.healthComponent).gameObject.AddComponent<MorningStarExplosion>();
				morningStarExplosion.attacker = ((EntityState)this).gameObject;
				morningStarExplosion.damageStat = ((BaseState)this).damageStat;
				morningStarExplosion.isCrit = isCrit;
			}
			val.Fire();
		}

		private void FireFlamePillar()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: 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_004d: Unknown result type (might be due to invalid IL or missing references)
			RaycastHit val = default(RaycastHit);
			if (((EntityState)this).isAuthority && Physics.Raycast(targetPosition, Vector3.down, ref val, 50f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)2))
			{
				ProjectileManager.instance.FireProjectile(WeaponSlam.pillarProjectilePrefab, ((RaycastHit)(ref val)).point, Quaternion.identity, ((EntityState)this).gameObject, ((EntityState)this).characterBody.damage * 4f, 0f, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)null);
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)this).fixedAge >= duration * 0.7f)
			{
				return (InterruptPriority)0;
			}
			return (InterruptPriority)1;
		}
	}
	public class PivotSwing : BaseBelmontSkillState
	{
		public HurtBox targetHurtbox;

		public float cachedInput;

		public float baseDuration = 0.5f;

		private GameObject rotationPoint;

		private GameObject anchor;

		private float speed;

		private GameObject whip;

		private LineRenderer whipLine;

		private float animFloat;

		private GameObject rootEffectInstance;

		private float reelSpeed;

		private float cachedDistance;

		private float currentDistance;

		private Vector3 overrideVel;

		private bool shouldCancel
		{
			get
			{
				if (!((EntityState)this).inputBank.skill3.down)
				{
					return true;
				}
				if (!Object.op_Implicit((Object)(object)targetHurtbox))
				{
					return true;
				}
				return false;
			}
		}

		public override void OnEnter()
		{
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: 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_014b: 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_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			base.OnEnter();
			baseDuration = belmont.whipDuration;
			if (!Object.op_Implicit((Object)(object)targetHurtbox))
			{
				((EntityState)this).outer.SetNextStateToMain();
				return;
			}
			reelSpeed = belmont.whipReelSpeed;
			Util.PlaySound("sfx_belmont_whip_latch", ((EntityState)this).gameObject);
			animFloat = 0f;
			float num = Vector3.Distance(((EntityState)this).transform.position, ((Component)targetHurtbox).transform.position);
			speed = ((EntityState)this).characterBody.baseMoveSpeed * Util.Remap(num, 0f, 28f, belmont.whipMinSpeed, belmont.whipMaxSpeed);
			((EntityState)this).PlayCrossfade("FullBody, Override Soft", "Swing", 0.05f);
			((EntityState)this).PlayCrossfade("FullBody, Override", "BufferEmpty", 0.02f);
			whip = ((Component)((BaseState)this).FindModelChild("WhipLLine")).gameObject;
			whipLine = whip.GetComponent<LineRenderer>();
			whipLine.SetPositions((Vector3[])(object)new Vector3[2]
			{
				whip.transform.position,
				whip.transform.position
			});
			whip.SetActive(true);
			belmont.isSwinging = true;
			((EntityState)this).characterDirection.turnSpeed = 2048f;
			SetupPoints();
			CharacterBody characterBody = ((EntityState)this).characterBody;
			characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags | 1);
		}

		private void SetupPoints()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			//IL_0032: 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_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: 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_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			anchor = new GameObject("Anchor");
			rotationPoint = new GameObject("RotationPoint");
			rotationPoint.transform.position = ((EntityState)this).transform.position;
			anchor.transform.position = targetHurtbox.healthComponent.body.corePosition;
			anchor.transform.rotation = Util.QuaternionSafeLookRotation(((EntityState)this).transform.position - anchor.transform.position);
			rotationPoint.transform.rotation = Util.QuaternionSafeLookRotation(anchor.transform.position - ((EntityState)this).transform.position);
			rotationPoint.transform.SetParent(anchor.transform, true);
			rootEffectInstance = Object.Instantiate<GameObject>(BelmontAssets.whipRootEffect);
			rootEffectInstance.transform.SetParent(anchor.transform, false);
			rootEffectInstance.transform.localPosition = new Vector3(0f, -1f, 0f);
			rootEffectInstance.transform.rotation = Quaternion.identity;
			rootEffectInstance.transform.localScale = Vector3.one * 0.33f;
			string name = ((Object)((Component)targetHurtbox.healthComponent).gameObject).name;
			if (BelmontAssets.whipRootEffectScale.ContainsKey(name))
			{
				rootEffectInstance.transform.localScale = BelmontAssets.whipRootEffectScale[name];
			}
			cachedDistance = Vector3.Distance(anchor.transform.position, rotationPoint.transform.position);
			currentDistance = cachedDistance;
		}

		public override void OnExit()
		{
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			base.OnExit();
			if (Object.op_Implicit((Object)(object)belmont))
			{
				belmont.isSwinging = false;
			}
			if (Object.op_Implicit((Object)(object)anchor))
			{
				EntityState.Destroy((Object)(object)anchor);
			}
			if (Object.op_Implicit((Object)(object)rotationPoint))
			{
				EntityState.Destroy((Object)(object)rotationPoint);
			}
			if (Object.op_Implicit((Object)(object)whip))
			{
				whip.SetActive(false);
			}
			((EntityState)this).characterDirection.turnSpeed = belmont.baseTurnSpeed;
			CharacterBody characterBody = ((EntityState)this).characterBody;
			characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags & -2);
			if (overrideVel.y >= 15f)
			{
				((EntityState)this).PlayCrossfade("FullBody, Override Soft", "Backflip", 0.05f);
			}
			else
			{
				((EntityState)this).PlayCrossfade("FullBody, Override Soft", "SwingRelease", 0.05f);
			}
		}

		private void UpdateRotation()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)targetHurtbox))
			{
				anchor.transform.position = targetHurtbox.healthComponent.body.corePosition + Vector3.up;
				Quaternion val = Quaternion.Euler(0f, speed * Time.fixedDeltaTime * cachedInput, 0f);
				anchor.transform.rotation = anchor.transform.rotation * val;
				cachedDistance -= reelSpeed * Time.fixedDeltaTime * 2f;
				if (cachedDistance < 5f)
				{
					cachedDistance = 5f;
				}
				currentDistance = Mathf.Lerp(currentDistance, cachedDistance, 1.5f * Time.fixedDeltaTime);
				rotationPoint.transform.position = anchor.transform.position + anchor.transform.forward * currentDistance;
				reelSpeed = Mathf.Lerp(reelSpeed, 0f, ((EntityState)this).fixedAge / baseDuration);
				if (reelSpeed <= 0f)
				{
					reelSpeed = 0f;
				}
			}
		}

		public override void Update()
		{
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0084: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).Update();
			((EntityState)this).characterBody.isSprinting = true;
			if (Object.op_Implicit((Object)(object)targetHurtbox) && Object.op_Implicit((Object)(object)anchor) && Object.op_