Decompiled source of Pilot v0.3.18

plugins/EnforcerGang-Pilot/Pilot.dll

Decompiled 3 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AncientScepter;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EmotesAPI;
using EntityStates;
using EntityStates.MoffeinPilot;
using EntityStates.MoffeinPilot.Airstrike;
using EntityStates.MoffeinPilot.FireSelect;
using EntityStates.MoffeinPilot.Parachute;
using EntityStates.MoffeinPilot.Weapon;
using HG;
using HG.BlendableTypes;
using KinematicCharacterController;
using MoffeinPilot.Content.Components;
using MoffeinPilot.Content.Components.Projectile;
using MoffeinPilot.Modules;
using MoffeinPilot.Modules.Characters;
using MoffeinPilot.Modules.Survivors;
using MoffeinPilot.SkillStates.BaseStates;
using On.RoR2;
using Pilot.Content.Components.ProjectileGhost;
using Pilot.Modules;
using R2API;
using R2API.Utils;
using RiskOfOptions;
using RiskOfOptions.Options;
using RoR2;
using RoR2.Audio;
using RoR2.CharacterAI;
using RoR2.ContentManagement;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using ShaderSwapper;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Pilot")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+227b0e45adc85dc635b46f8a04f2a544d13ccbfa")]
[assembly: AssemblyProduct("Pilot")]
[assembly: AssemblyTitle("Pilot")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: UnverifiableCode]
namespace EntityStates.MoffeinPilot
{
	public class PilotMainState : GenericCharacterMain
	{
		public override void OnEnter()
		{
			((GenericCharacterMain)this).OnEnter();
			SetWeaponModel();
		}

		private void SetWeaponModel()
		{
			if ((Object)(object)((EntityState)this).skillLocator == (Object)null || (Object)(object)((EntityState)this).skillLocator.primary == (Object)null)
			{
				return;
			}
			bool flag = (Object)(object)((EntityState)this).skillLocator.primary.baseSkill == (Object)(object)PilotSurvivor.SkillDefs.Primaries.Silencer;
			ChildLocator modelChildLocator = ((EntityState)this).GetModelChildLocator();
			if (Object.op_Implicit((Object)(object)modelChildLocator))
			{
				Transform val = modelChildLocator.FindChild("PilotPistol");
				Transform val2 = modelChildLocator.FindChild("PilotWeapon");
				if (Object.op_Implicit((Object)(object)val))
				{
					((Component)val).gameObject.SetActive(flag);
				}
				if (Object.op_Implicit((Object)(object)val2))
				{
					((Component)val2).gameObject.SetActive(!flag);
				}
			}
		}
	}
}
namespace EntityStates.MoffeinPilot.Weapon
{
	public class ClusterFire : BaseSkillState, IStepSetter
	{
		public static ConfigEntry<bool> useLaser;

		public static float spreadBloomValueCosmetic = 1f;

		public static float recoilAmplitude = 1f;

		public static float comboRecoilAmplitude = 2f;

		public static float damageCoefficient = 1.6f;

		public static float force = 500f;

		public static float comboDamageCoefficient = 3.2f;

		public static float comboForce = 1500f;

		public static float comboBlastRadius = 9f;

		public static float comboMinDistance = 2f;

		public static float comboMinBlastRadius = 3f;

		public static float selfKnockbackForce = 0f;

		public static float comboSelfKnockbackForce = 0f;

		public static float shotRadius = 0.5f;

		public static float comboShotRadius = 0.5f;

		public static float comboShotRadiusLaser = 1.5f;

		public static float baseDuration = 0.3f;

		public static string muzzleName = "Muzzle";

		public static string attackSoundString = "Play_MoffeinPilot_Primary_Cluster";

		public static string comboAttackSoundString = "Play_MoffeinPilot_Primary_Cluster_Combo";

		public static GameObject tracerEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Captain/TracerCaptainShotgun.prefab").WaitForCompletion();

		public static GameObject hitEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Captain/HitsparkCaptainShotgun.prefab").WaitForCompletion();

		public static GameObject comboExplosionEffectPrefab;

		public static GameObject comboTracerEffectPrefab;

		public static GameObject comboHitEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Captain/HitsparkCaptainShotgun.prefab").WaitForCompletion();

		public static GameObject muzzleEffectPrefab;

		public static GameObject comboMuzzleEffectPrefab;

		private PilotController pilotController;

		private bool triggeredComboExplosion;

		private float duration;

		private int step;

		public void SetStep(int i)
		{
			step = i;
		}

		public override void OnEnter()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			triggeredComboExplosion = false;
			pilotController = ((EntityState)this).GetComponent<PilotController>();
			Ray aimRay = ((BaseState)this).GetAimRay();
			((BaseState)this).StartAimMode(aimRay, 3f, false);
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			((EntityState)this).characterBody.AddSpreadBloom(RapidFire.spreadBloomValue);
			((EntityState)this).PlayAnimation("Gesture, Additive", "Shoot1", "ShootGun.playbackRate", duration * 2f, 0f);
			if (step == 2)
			{
				FireBulletCombo(aimRay);
			}
			else
			{
				FireBullet(aimRay);
			}
		}

		public void FireBullet(Ray aimRay)
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: 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_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: 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_00e0: 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_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)muzzleEffectPrefab))
			{
				EffectManager.SimpleMuzzleFlash(muzzleEffectPrefab, ((EntityState)this).gameObject, RapidFire.muzzleName, false);
			}
			if (((EntityState)this).isAuthority)
			{
				new BulletAttack
				{
					owner = ((EntityState)this).gameObject,
					weapon = ((EntityState)this).gameObject,
					origin = ((Ray)(ref aimRay)).origin,
					aimVector = ((Ray)(ref aimRay)).direction,
					minSpread = 0f,
					maxSpread = 0f,
					bulletCount = 1u,
					damage = damageCoefficient * ((BaseState)this).damageStat,
					force = force,
					tracerEffectPrefab = tracerEffectPrefab,
					muzzleName = muzzleName,
					hitEffectPrefab = hitEffectPrefab,
					isCrit = ((BaseState)this).RollCrit(),
					radius = shotRadius,
					smartCollision = true,
					damageType = DamageTypeCombo.op_Implicit((DamageType)0),
					falloffModel = (FalloffModel)0,
					procCoefficient = 1f
				}.Fire();
				if (selfKnockbackForce != 0f && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded && ((EntityState)this).characterMotor.velocity != Vector3.zero)
				{
					((EntityState)this).characterMotor.ApplyForce((0f - selfKnockbackForce) * ((Ray)(ref aimRay)).direction, false, false);
				}
			}
			Util.PlaySound(attackSoundString, ((EntityState)this).gameObject);
			((BaseState)this).AddRecoil(-0.4f * recoilAmplitude, -0.8f * recoilAmplitude, -0.3f * recoilAmplitude, 0.3f * recoilAmplitude);
			((EntityState)this).characterBody.AddSpreadBloom(spreadBloomValueCosmetic);
		}

		public void FireBulletCombo(Ray aimRay)
		{
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: 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_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: 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_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01be: 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_01c5: 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_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01db: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: 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_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: 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_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Expected O, but got Unknown
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0224: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)comboMuzzleEffectPrefab))
			{
				EffectManager.SimpleMuzzleFlash(comboMuzzleEffectPrefab, ((EntityState)this).gameObject, RapidFire.muzzleName, false);
			}
			if (((EntityState)this).isAuthority)
			{
				if (!useLaser.Value)
				{
					new BulletAttack
					{
						tracerEffectPrefab = comboTracerEffectPrefab,
						damage = 0f,
						procCoefficient = 0f,
						damageType = DamageTypeCombo.op_Implicit((DamageType)2049),
						owner = ((EntityState)this).gameObject,
						aimVector = ((Ray)(ref aimRay)).direction,
						isCrit = false,
						minSpread = 0f,
						maxSpread = 0f,
						origin = ((Ray)(ref aimRay)).origin,
						maxDistance = 2000f,
						muzzleName = muzzleName,
						radius = comboShotRadius,
						hitCallback = new HitCallback(ComboHitCallback)
					}.Fire();
				}
				else
				{
					new BulletAttack
					{
						owner = ((EntityState)this).gameObject,
						weapon = ((EntityState)this).gameObject,
						origin = ((Ray)(ref aimRay)).origin,
						aimVector = ((Ray)(ref aimRay)).direction,
						minSpread = 0f,
						maxSpread = 0f,
						bulletCount = 1u,
						damage = comboDamageCoefficient * ((BaseState)this).damageStat,
						force = comboForce,
						tracerEffectPrefab = comboTracerEffectPrefab,
						muzzleName = muzzleName,
						hitEffectPrefab = hitEffectPrefab,
						isCrit = ((BaseState)this).RollCrit(),
						radius = comboShotRadiusLaser,
						smartCollision = true,
						damageType = DamageTypeCombo.op_Implicit((DamageType)0),
						falloffModel = (FalloffModel)0,
						procCoefficient = 1f,
						stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask,
						maxDistance = 2000f
					}.Fire();
				}
				if (comboSelfKnockbackForce != 0f && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded && ((EntityState)this).characterMotor.velocity != Vector3.zero)
				{
					((EntityState)this).characterMotor.ApplyForce((0f - comboSelfKnockbackForce) * ((Ray)(ref aimRay)).direction, false, false);
				}
			}
			Util.PlaySound(attackSoundString, ((EntityState)this).gameObject);
			Util.PlaySound(comboAttackSoundString, ((EntityState)this).gameObject);
			((BaseState)this).AddRecoil(-0.4f * comboRecoilAmplitude, -0.8f * comboRecoilAmplitude, -0.3f * comboRecoilAmplitude, 0.3f * comboRecoilAmplitude);
			((EntityState)this).characterBody.AddSpreadBloom(spreadBloomValueCosmetic);
		}

		private bool ComboHitCallback(BulletAttack bulletRef, ref BulletHit hitInfo)
		{
			//IL_0003: 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_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_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: 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_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: 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_01a8: 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_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: 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_0104: Expected O, but got Unknown
			_ = hitInfo.point;
			if (!triggeredComboExplosion && Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				triggeredComboExplosion = true;
				_ = bulletRef.aimVector;
				float num = comboForce;
				Vector3 val = bulletRef.aimVector;
				Vector3 bonusForce = num * ((Vector3)(ref val)).normalized;
				val = hitInfo.point - ((EntityState)this).characterBody.corePosition;
				float magnitude = ((Vector3)(ref val)).magnitude;
				float num2 = comboBlastRadius;
				if (magnitude < comboBlastRadius)
				{
					num2 = ((!(magnitude <= comboMinDistance)) ? Mathf.Lerp(comboMinBlastRadius, comboBlastRadius, (magnitude - comboMinDistance) / (comboBlastRadius - comboMinDistance)) : comboMinBlastRadius);
				}
				if (Object.op_Implicit((Object)(object)comboExplosionEffectPrefab))
				{
					EffectManager.SpawnEffect(comboExplosionEffectPrefab, new EffectData
					{
						origin = hitInfo.point,
						scale = num2 / 4.83f
					}, true);
				}
				new BlastAttack
				{
					attacker = ((EntityState)this).gameObject,
					attackerFiltering = (AttackerFiltering)2,
					baseDamage = ((BaseState)this).damageStat * comboDamageCoefficient,
					baseForce = 0f,
					bonusForce = bonusForce,
					canRejectForce = true,
					crit = ((BaseState)this).RollCrit(),
					damageColorIndex = (DamageColorIndex)0,
					damageType = DamageTypeCombo.op_Implicit((DamageType)0),
					falloffModel = (FalloffModel)0,
					inflictor = ((EntityState)this).gameObject,
					position = hitInfo.point,
					procChainMask = default(ProcChainMask),
					procCoefficient = 1f,
					radius = num2,
					teamIndex = ((BaseState)this).GetTeam()
				}.Fire();
			}
			return false;
		}

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)2;
		}
	}
	public class FireColdWar : BaseState
	{
		public static float selfKnockbackForce = 450f;

		public static float damageCoefficient = 2.2f;

		public static float force = 450f;

		public static float baseDuration = 0.3f;

		public static float baseShotDuration = 0.1f;

		public static string attackSoundString = "Play_MoffeinPilot_Secondary_FireAlt";

		public static int baseShotCount = 3;

		public static string muzzleString = "";

		public static float spreadBloom = 0f;

		public static float recoil = 1f;

		public static GameObject projectilePrefab;

		private int shotCount;

		private float duration;

		private float shotDuration;

		private float shotStopwatch;

		private bool crit;

		private PilotController pilotController;

		private bool applySelfForce;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).characterMotor.velocity.y < 0f)
			{
				((EntityState)this).characterMotor.velocity.y = 0f;
			}
			applySelfForce = true;
			pilotController = ((EntityState)this).GetComponent<PilotController>();
			if (Object.op_Implicit((Object)(object)pilotController))
			{
				pilotController.ConsumeSecondaryStock(1);
				applySelfForce = !pilotController.isWavedashing;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator) && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator.secondary))
			{
				((EntityState)this).characterBody.OnSkillActivated(((EntityState)this).skillLocator.secondary);
			}
			crit = ((BaseState)this).RollCrit();
			shotCount = 0;
			shotStopwatch = 0f;
			duration = baseDuration / base.attackSpeedStat;
			shotDuration = baseShotDuration / base.attackSpeedStat;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.SetAimTimer(2f);
			}
			FireProjectile();
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).characterMotor.velocity.y < 0f)
			{
				((EntityState)this).characterMotor.velocity.y = 0f;
			}
			if (shotCount < baseShotCount)
			{
				shotStopwatch += Time.fixedDeltaTime;
				if (shotStopwatch >= shotDuration)
				{
					FireProjectile();
				}
			}
			else if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration && shotCount >= baseShotCount)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.SetSpreadBloom(0f, false);
			}
			((EntityState)this).OnExit();
		}

		private void FireProjectile()
		{
			//IL_0061: 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_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			shotStopwatch = 0f;
			shotCount++;
			Util.PlaySound(attackSoundString, ((EntityState)this).gameObject);
			((EntityState)this).PlayAnimation("Gesture, Additive", "Shoot1", "ShootGun.playbackRate", shotDuration * 2f, 0f);
			if (((EntityState)this).isAuthority)
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				ProjectileManager.instance.FireProjectile(projectilePrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, base.damageStat * damageCoefficient, force, crit, (DamageColorIndex)0, (GameObject)null, -1f);
				if (applySelfForce && selfKnockbackForce != 0f && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded && ((EntityState)this).characterMotor.velocity != Vector3.zero)
				{
					((EntityState)this).characterMotor.ApplyForce((0f - selfKnockbackForce) * ((Ray)(ref aimRay)).direction, false, false);
				}
			}
			((BaseState)this).AddRecoil(-0.4f * recoil, -0.8f * recoil, -0.3f * recoil, 0.3f * recoil);
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.AddSpreadBloom(spreadBloom);
			}
		}

		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 FireSilencedPistol : BaseState
	{
		public static float selfKnockbackForce = 0f;

		public static float damageCoefficient = 1f;

		public static float weakpointMultiplier = 1f;

		public static GameObject weakpointEffectPrefab;

		public static float force = 400f;

		public static float baseDuration = 0.25f;

		public static float spreadBloomValue = 0.75f;

		public static float recoilAmplitude = 1f;

		public static string attackSoundString = "Play_MoffeinPilot_Silencer";

		public static string muzzleName = "Muzzle";

		public static GameObject tracerEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/TracerCommandoDefault.prefab").WaitForCompletion();

		public static GameObject hitEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/HitsparkCommando.prefab").WaitForCompletion();

		public static GameObject muzzleEffectPrefab;

		private PilotController pilotController;

		private float duration;

		public override void OnEnter()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: 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_00fe: 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_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Expected O, but got Unknown
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Expected O, but got Unknown
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			pilotController = ((EntityState)this).GetComponent<PilotController>();
			Ray aimRay = ((BaseState)this).GetAimRay();
			((BaseState)this).StartAimMode(aimRay, 3f, false);
			duration = baseDuration / base.attackSpeedStat;
			((EntityState)this).PlayAnimation("Gesture, Additive", "Shoot1", "ShootGun.playbackRate", duration * 2f, 0f);
			if (Object.op_Implicit((Object)(object)muzzleEffectPrefab))
			{
				EffectManager.SimpleMuzzleFlash(muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleName, false);
			}
			if (((EntityState)this).isAuthority)
			{
				BulletAttack val = new BulletAttack
				{
					owner = ((EntityState)this).gameObject,
					weapon = ((EntityState)this).gameObject,
					origin = ((Ray)(ref aimRay)).origin,
					aimVector = ((Ray)(ref aimRay)).direction,
					minSpread = 0f,
					maxSpread = 0f,
					bulletCount = 1u,
					damage = damageCoefficient * base.damageStat,
					force = force,
					tracerEffectPrefab = tracerEffectPrefab,
					muzzleName = muzzleName,
					hitEffectPrefab = hitEffectPrefab,
					isCrit = ((BaseState)this).RollCrit(),
					radius = 0.5f,
					smartCollision = true,
					damageType = DamageTypeCombo.op_Implicit((DamageType)0),
					falloffModel = (FalloffModel)1,
					procCoefficient = 1f
				};
				DamageAPI.AddModdedDamageType(val, DamageTypes.SlayerExceptItActuallyWorks);
				if (weakpointMultiplier > 1f)
				{
					val.modifyOutgoingDamageCallback = (ModifyOutgoingDamageCallback)delegate(BulletAttack _bulletAttack, ref BulletHit hitInfo, DamageInfo damageInfo)
					{
						//IL_0024: 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_0040: Unknown result type (might be due to invalid IL or missing references)
						//IL_004b: Unknown result type (might be due to invalid IL or missing references)
						//IL_004e: Unknown result type (might be due to invalid IL or missing references)
						//IL_0053: Unknown result type (might be due to invalid IL or missing references)
						//IL_0058: Unknown result type (might be due to invalid IL or missing references)
						//IL_005d: Unknown result type (might be due to invalid IL or missing references)
						//IL_0063: Expected O, but got Unknown
						if (BulletAttack.IsSniperTargetHit(ref hitInfo))
						{
							damageInfo.damage *= weakpointMultiplier;
							damageInfo.damageColorIndex = (DamageColorIndex)12;
							if (Object.op_Implicit((Object)(object)weakpointEffectPrefab))
							{
								EffectData val2 = new EffectData
								{
									origin = hitInfo.point,
									rotation = Quaternion.LookRotation(-hitInfo.direction)
								};
								val2.SetHurtBoxReference(hitInfo.hitHurtBox);
								EffectManager.SpawnEffect(weakpointEffectPrefab, val2, true);
							}
							Util.PlaySound("Play_MoffeinPilot_Headshot", ((EntityState)this).gameObject);
						}
					};
				}
				val.Fire();
				if (selfKnockbackForce != 0f && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded && ((EntityState)this).characterMotor.velocity != Vector3.zero)
				{
					((EntityState)this).characterMotor.ApplyForce((0f - selfKnockbackForce) * ((Ray)(ref aimRay)).direction, false, false);
				}
			}
			((BaseState)this).AddRecoil(-0.4f * recoilAmplitude, -0.8f * recoilAmplitude, -0.3f * recoilAmplitude, 0.3f * recoilAmplitude);
			Util.PlaySound(attackSoundString, ((EntityState)this).gameObject);
			((EntityState)this).characterBody.AddSpreadBloom(spreadBloomValue);
		}

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)2;
		}
	}
	public class FireTargetAcquired : BaseState
	{
		public static float selfKnockbackForce = 450f;

		public static float damageCoefficient = 1.9f;

		public static float force = 450f;

		public static float baseDuration = 0.3f;

		public static float baseShotDuration = 0.1f;

		public static string attackSoundString = "Play_MoffeinPilot_Secondary_FireBurst";

		public static int baseShotCount = 3;

		public static string muzzleString = "";

		public static float spreadBloom = 0f;

		public static float recoil = 1f;

		public static GameObject tracerEffectPrefab;

		public static GameObject hitEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/OmniExplosionVFXFMJ.prefab").WaitForCompletion();

		private int shotCount;

		private float duration;

		private float shotDuration;

		private float shotStopwatch;

		private bool crit;

		private PilotController pilotController;

		private bool applySelfForce;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).characterMotor.velocity.y < 0f)
			{
				((EntityState)this).characterMotor.velocity.y = 0f;
			}
			applySelfForce = true;
			pilotController = ((EntityState)this).GetComponent<PilotController>();
			if (Object.op_Implicit((Object)(object)pilotController))
			{
				pilotController.BeginAutoAim();
				pilotController.ConsumeSecondaryStock(1);
				applySelfForce = !pilotController.isWavedashing;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator) && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator.secondary))
			{
				((EntityState)this).characterBody.OnSkillActivated(((EntityState)this).skillLocator.secondary);
			}
			crit = ((BaseState)this).RollCrit();
			shotCount = 0;
			shotStopwatch = 0f;
			duration = baseDuration / base.attackSpeedStat;
			shotDuration = baseShotDuration / base.attackSpeedStat;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.SetAimTimer(2f);
			}
			FireBullet();
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).characterMotor.velocity.y < 0f)
			{
				((EntityState)this).characterMotor.velocity.y = 0f;
			}
			if (shotCount < baseShotCount)
			{
				shotStopwatch += Time.fixedDeltaTime;
				if (shotStopwatch >= shotDuration)
				{
					FireBullet();
				}
			}
			else if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration && shotCount >= baseShotCount)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.SetSpreadBloom(0f, false);
			}
			if (Object.op_Implicit((Object)(object)pilotController))
			{
				pilotController.EndAutoAim();
			}
			((EntityState)this).OnExit();
		}

		private void FireBullet()
		{
			//IL_0061: 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_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: 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_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Expected O, but got Unknown
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: 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)
			shotStopwatch = 0f;
			shotCount++;
			Util.PlaySound(attackSoundString, ((EntityState)this).gameObject);
			((EntityState)this).PlayAnimation("Gesture, Additive", "Shoot1", "ShootGun.playbackRate", shotDuration * 2f, 0f);
			if (((EntityState)this).isAuthority)
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				if (Object.op_Implicit((Object)(object)pilotController))
				{
					pilotController.UpdateAutoAim();
					pilotController.UpdateIndicator();
				}
				BulletAttack val = new BulletAttack
				{
					aimVector = AutoTarget(aimRay),
					origin = ((Ray)(ref aimRay)).origin,
					damage = damageCoefficient * base.damageStat,
					damageType = DamageTypeCombo.op_Implicit((DamageType)0),
					damageColorIndex = (DamageColorIndex)0,
					minSpread = 0f,
					maxSpread = 0f,
					falloffModel = (FalloffModel)0,
					force = force,
					isCrit = crit,
					owner = ((EntityState)this).gameObject,
					muzzleName = muzzleString,
					smartCollision = true,
					procChainMask = default(ProcChainMask),
					procCoefficient = 1f,
					radius = 2f,
					weapon = ((EntityState)this).gameObject,
					tracerEffectPrefab = tracerEffectPrefab,
					hitEffectPrefab = hitEffectPrefab,
					stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask
				};
				DamageAPI.AddModdedDamageType(val, DamageTypes.KeepAirborne);
				val.Fire();
				if (applySelfForce && selfKnockbackForce != 0f && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded && ((EntityState)this).characterMotor.velocity != Vector3.zero)
				{
					((EntityState)this).characterMotor.ApplyForce((0f - selfKnockbackForce) * ((Ray)(ref aimRay)).direction, false, false);
				}
			}
			((BaseState)this).AddRecoil(-0.4f * recoil, -0.8f * recoil, -0.3f * recoil, 0.3f * recoil);
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.AddSpreadBloom(spreadBloom);
			}
		}

		private Vector3 AutoTarget(Ray aimRay)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			Vector3 result = ((Ray)(ref aimRay)).direction;
			HurtBox val = (Object.op_Implicit((Object)(object)pilotController) ? pilotController.GetAutoaimHurtbox() : null);
			if (Object.op_Implicit((Object)(object)val))
			{
				result = ((Component)val).transform.position - ((Ray)(ref aimRay)).origin;
				((Vector3)(ref result)).Normalize();
			}
			return result;
		}

		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 RapidFire : BaseState
	{
		public static float selfKnockbackForce = 0f;

		public static float damageCoefficient = 1.4f;

		public static float force = 200f;

		public static float baseDuration = 0.12f;

		public static float spreadBloomValue = 0.3f;

		public static float recoilAmplitude = 1f;

		public static string attackSoundString = "Play_MoffeinPilot_Primary_Rapid";

		public static string muzzleName = "Muzzle";

		public static GameObject tracerEffectPrefab;

		public static GameObject hitEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/HitsparkCommandoShotgun.prefab").WaitForCompletion();

		public static GameObject muzzleEffectPrefab;

		private PilotController pilotController;

		private float duration;

		public override void OnEnter()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: 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)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: 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_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			pilotController = ((EntityState)this).GetComponent<PilotController>();
			Ray aimRay = ((BaseState)this).GetAimRay();
			((BaseState)this).StartAimMode(aimRay, 3f, false);
			duration = baseDuration / base.attackSpeedStat;
			((EntityState)this).PlayAnimation("Gesture, Additive", "Shoot1", "ShootGun.playbackRate", duration * 2f, 0f);
			if (Object.op_Implicit((Object)(object)muzzleEffectPrefab))
			{
				EffectManager.SimpleMuzzleFlash(muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleName, false);
			}
			if (((EntityState)this).isAuthority)
			{
				new BulletAttack
				{
					owner = ((EntityState)this).gameObject,
					weapon = ((EntityState)this).gameObject,
					origin = ((Ray)(ref aimRay)).origin,
					aimVector = ((Ray)(ref aimRay)).direction,
					minSpread = 0f,
					maxSpread = ((EntityState)this).characterBody.spreadBloomAngle,
					bulletCount = 1u,
					damage = damageCoefficient * base.damageStat,
					force = force,
					tracerEffectPrefab = tracerEffectPrefab,
					muzzleName = muzzleName,
					hitEffectPrefab = hitEffectPrefab,
					isCrit = ((BaseState)this).RollCrit(),
					radius = 0.2f,
					smartCollision = true,
					damageType = DamageTypeCombo.op_Implicit((DamageType)0),
					falloffModel = (FalloffModel)1,
					procCoefficient = 1f
				}.Fire();
				if (selfKnockbackForce != 0f && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded && ((EntityState)this).characterMotor.velocity != Vector3.zero)
				{
					((EntityState)this).characterMotor.ApplyForce((0f - selfKnockbackForce) * ((Ray)(ref aimRay)).direction, false, false);
				}
			}
			((BaseState)this).AddRecoil(-0.4f * recoilAmplitude, -0.8f * recoilAmplitude, -0.3f * recoilAmplitude, 0.3f * recoilAmplitude);
			Util.PlaySound(attackSoundString, ((EntityState)this).gameObject);
			((EntityState)this).characterBody.AddSpreadBloom(spreadBloomValue);
		}

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)2;
		}
	}
	public class ReloadRapidFire : BaseState
	{
		public static string startSoundString = "Play_commando_M2_grenade_throw";

		public static string endSoundString = "Play_captain_m1_reload";

		public static float baseDuration = 1.1f;

		private float duration;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				if (Object.op_Implicit((Object)(object)((EntityState)this).skillLocator) && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator.primary))
				{
					((EntityState)this).skillLocator.primary.stock = ((EntityState)this).skillLocator.primary.maxStock;
				}
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			Util.PlaySound(endSoundString, ((EntityState)this).gameObject);
			((EntityState)this).OnExit();
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)1;
		}
	}
}
namespace EntityStates.MoffeinPilot.Parachute
{
	public class AerobaticsDashBase : BaseState
	{
		public static float baseDuration = 0.3f;

		public static GameObject blinkPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Huntress/HuntressBlinkEffect.prefab").WaitForCompletion();

		public static string blinkSoundString = "Play_huntress_shift_mini_blink";

		public Vector3 blinkVector;

		private Transform modelTransform;

		private CharacterModel characterModel;

		private HurtBoxGroup hurtboxGroup;

		private bool startedAirborne;

		public static float minWavedashSpeedMult = 0.5f;

		public static float maxWavedashSpeedMult = 0.5f;

		private float wavedashSpeedMult;

		private EntityStateMachine parachuteMachine;

		private int origJumpCount;

		public override void OnEnter()
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			Util.PlaySound(blinkSoundString, ((EntityState)this).gameObject);
			CreateBlinkEffect(Util.GetCorePosition(((EntityState)this).gameObject));
			SetBlinkVector();
			modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				characterModel = ((Component)modelTransform).GetComponent<CharacterModel>();
				hurtboxGroup = ((Component)modelTransform).GetComponent<HurtBoxGroup>();
				CharacterModel component = ((Component)modelTransform).GetComponent<CharacterModel>();
				if (Object.op_Implicit((Object)(object)component))
				{
					TemporaryOverlayInstance val = TemporaryOverlayManager.AddOverlay(((Component)component).gameObject);
					val.duration = 0.6f + baseDuration;
					val.animateShaderAlpha = true;
					val.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
					val.destroyComponentOnEnd = true;
					val.originalMaterial = LegacyResourcesAPI.Load<Material>("Materials/matHuntressFlashBright");
					val.AddToCharacterModel(component);
					val.Start();
					TemporaryOverlayInstance val2 = TemporaryOverlayManager.AddOverlay(((Component)component).gameObject);
					val2.duration = 0.7f + baseDuration;
					val2.animateShaderAlpha = true;
					val2.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
					val2.destroyComponentOnEnd = true;
					val2.originalMaterial = LegacyResourcesAPI.Load<Material>("Materials/matHuntressFlashExpanded");
					val2.AddToCharacterModel(component);
					val2.Start();
				}
			}
			parachuteMachine = EntityStateMachine.FindByCustomName(((EntityState)this).gameObject, "Parachute");
			wavedashSpeedMult = maxWavedashSpeedMult;
			startedAirborne = false;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				startedAirborne = !((EntityState)this).characterMotor.isGrounded;
				origJumpCount = ((EntityState)this).characterMotor.jumpCount;
				((EntityState)this).characterMotor.jumpCount = ((!Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) ? 1 : ((EntityState)this).characterBody.maxJumpCount);
			}
			if (Object.op_Implicit((Object)(object)hurtboxGroup))
			{
				HurtBoxGroup val3 = hurtboxGroup;
				int hurtBoxesDeactivatorCounter = val3.hurtBoxesDeactivatorCounter + 1;
				val3.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter;
			}
		}

		public virtual void SetBlinkVector()
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			Ray aimRay = ((BaseState)this).GetAimRay();
			blinkVector = ((Ray)(ref aimRay)).direction;
		}

		public virtual float GetBlinkSpeed()
		{
			return 14f;
		}

		public override void FixedUpdate()
		{
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			DashPhysics();
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).characterMotor.isGrounded)
			{
				if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && ((EntityState)this).inputBank.jump.down && Object.op_Implicit((Object)(object)parachuteMachine))
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new Wavedash
					{
						initialSpeed = base.moveSpeedStat * GetBlinkSpeed() * Mathf.Max(wavedashSpeedMult, minWavedashSpeedMult),
						entryDirection = blinkVector
					});
					return;
				}
				wavedashSpeedMult -= Time.deltaTime / baseDuration;
			}
			CheckStateExit();
		}

		protected virtual void CheckStateExit()
		{
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= baseDuration)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public virtual void DashPhysics()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterMotor.velocity = Vector3.zero;
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				characterMotor.rootMotion += blinkVector * (base.moveSpeedStat * GetBlinkSpeed() * Time.deltaTime);
			}
		}

		public override void OnExit()
		{
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).OnExit();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				if (((EntityState)this).characterMotor.isGrounded)
				{
					((EntityState)this).characterMotor.jumpCount = 0;
				}
				else
				{
					((EntityState)this).characterMotor.jumpCount = Mathf.Max(origJumpCount, 1);
				}
			}
			if (!((EntityState)this).outer.destroying)
			{
				CreateBlinkEffect(Util.GetCorePosition(((EntityState)this).gameObject));
			}
			if (Object.op_Implicit((Object)(object)hurtboxGroup))
			{
				HurtBoxGroup val = hurtboxGroup;
				int hurtBoxesDeactivatorCounter = val.hurtBoxesDeactivatorCounter - 1;
				val.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter;
			}
		}

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

		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 AerobaticsDashEntry : AerobaticsDashBase
	{
		public static float minDurationBeforeWallcling = 0.06f;

		private bool detectedWallbounce = false;

		private bool triggeredWallbounce = false;

		private Vector3 forwardCheckDirection;

		private Vector3 clingPoint;

		protected override void CheckStateExit()
		{
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= AerobaticsDashBase.baseDuration)
			{
				CheckWallBounceExit();
			}
		}

		public override void SetBlinkVector()
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			base.SetBlinkVector();
			forwardCheckDirection = blinkVector;
			forwardCheckDirection.y = 0f;
			((Vector3)(ref forwardCheckDirection)).Normalize();
		}

		public override void FixedUpdate()
		{
			if (!((EntityState)this).isAuthority || !AttemptTriggerWallCling())
			{
				base.FixedUpdate();
			}
		}

		private void CheckWallBounceExit()
		{
			if (!AttemptTriggerWallCling())
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		private bool AttemptTriggerWallCling()
		{
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			CheckWallCling();
			if (detectedWallbounce && !triggeredWallbounce && (!Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) || !((EntityState)this).characterMotor.isGrounded))
			{
				triggeredWallbounce = true;
				((EntityState)this).outer.SetNextState((EntityState)(object)new Wallcling
				{
					clingPoint = clingPoint
				});
				return true;
			}
			return false;
		}

		private void CheckWallCling()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: 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_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Expected O, but got Unknown
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Expected O, but got Unknown
			if (!detectedWallbounce && !(((EntityState)this).fixedAge < minDurationBeforeWallcling) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				BulletAttack val = new BulletAttack
				{
					tracerEffectPrefab = null,
					damage = 0f,
					procCoefficient = 0f,
					damageType = DamageTypeCombo.op_Implicit((DamageType)2049),
					owner = ((EntityState)this).gameObject,
					aimVector = forwardCheckDirection,
					isCrit = false,
					minSpread = 0f,
					maxSpread = 0f,
					origin = ((EntityState)this).characterBody.corePosition,
					maxDistance = 2f,
					muzzleName = null,
					radius = 0.5f,
					hitCallback = new HitCallback(CheckWallbounceHitCallback),
					stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask
				};
				val.Fire();
			}
		}

		private bool CheckWallbounceHitCallback(BulletAttack bulletRef, ref BulletHit hitInfo)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			if (!detectedWallbounce)
			{
				_ = hitInfo.point;
				if (Object.op_Implicit((Object)(object)hitInfo.collider) && ((Component)hitInfo.collider).gameObject.layer == LayerIndex.world.intVal)
				{
					clingPoint = hitInfo.point;
					detectedWallbounce = true;
				}
			}
			return false;
		}

		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 AirSpeedBoost : BaseState
	{
		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			if (NetworkServer.active && Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.AddBuff(Buffs.CloakSpeed);
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).isAuthority && ((BaseState)this).isGrounded)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			if (NetworkServer.active && Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.RemoveBuff(Buffs.CloakSpeed);
			}
			((EntityState)this).OnExit();
		}
	}
	public class DashGround : BaseState
	{
		public static ConfigEntry<bool> onlyDashBackwards;

		public static float baseDuration = 0.2f;

		public static GameObject blinkPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Huntress/HuntressBlinkEffect.prefab").WaitForCompletion();

		public Vector3 blinkVector;

		private Transform modelTransform;

		private CharacterModel characterModel;

		private HurtBoxGroup hurtboxGroup;

		public override void OnEnter()
		{
			//IL_000f: 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_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_0038: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			CreateBlinkEffect(Util.GetCorePosition(((EntityState)this).gameObject));
			SetBlinkVector();
			((BaseState)this).StartAimMode(new Ray(((EntityState)this).transform.position, -blinkVector), 0.5f, false);
			((EntityState)this).PlayAnimation("Gesture, Override", "PointGround", "Point.playbackRate", 0.5f, 0f);
			modelTransform = ((EntityState)this).GetModelTransform();
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				characterModel = ((Component)modelTransform).GetComponent<CharacterModel>();
				hurtboxGroup = ((Component)modelTransform).GetComponent<HurtBoxGroup>();
				CharacterModel component = ((Component)modelTransform).GetComponent<CharacterModel>();
				if (Object.op_Implicit((Object)(object)component))
				{
					TemporaryOverlayInstance val = TemporaryOverlayManager.AddOverlay(((Component)component).gameObject);
					val.duration = 0.6f + baseDuration;
					val.animateShaderAlpha = true;
					val.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
					val.destroyComponentOnEnd = true;
					val.originalMaterial = LegacyResourcesAPI.Load<Material>("Materials/matHuntressFlashBright");
					val.AddToCharacterModel(component);
					val.Start();
					TemporaryOverlayInstance val2 = TemporaryOverlayManager.AddOverlay(((Component)component).gameObject);
					val2.duration = 0.7f + baseDuration;
					val2.animateShaderAlpha = true;
					val2.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
					val2.destroyComponentOnEnd = true;
					val2.originalMaterial = LegacyResourcesAPI.Load<Material>("Materials/matHuntressFlashExpanded");
					val2.AddToCharacterModel(component);
					val2.Start();
				}
			}
			if (Object.op_Implicit((Object)(object)hurtboxGroup))
			{
				HurtBoxGroup val3 = hurtboxGroup;
				int hurtBoxesDeactivatorCounter = val3.hurtBoxesDeactivatorCounter + 1;
				val3.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter;
			}
		}

		public virtual void SetBlinkVector()
		{
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			Vector3 forward;
			if (!onlyDashBackwards.Value)
			{
				Vector3 val;
				if (!Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
				{
					val = Vector3.zero;
				}
				else
				{
					forward = ((EntityState)this).characterDirection.forward;
					val = ((Vector3)(ref forward)).normalized;
				}
				blinkVector = val;
				if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && ((EntityState)this).inputBank.moveVector != Vector3.zero)
				{
					blinkVector = ((Vector3)(ref ((EntityState)this).inputBank.moveVector)).normalized;
				}
			}
			else
			{
				Vector3 val2;
				if (!Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
				{
					val2 = Vector3.zero;
				}
				else
				{
					forward = ((EntityState)this).characterDirection.forward;
					val2 = -((Vector3)(ref forward)).normalized;
				}
				blinkVector = val2;
			}
		}

		public virtual float GetBlinkSpeed()
		{
			return 10.875f;
		}

		public override void Update()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).Update();
			((EntityState)this).characterDirection.forward = -((Vector3)(ref blinkVector)).normalized;
		}

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

		public virtual void DashPhysics()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterMotor.velocity = Vector3.zero;
				CharacterMotor characterMotor = ((EntityState)this).characterMotor;
				characterMotor.rootMotion += blinkVector * (base.moveSpeedStat * GetBlinkSpeed() * Time.deltaTime);
			}
		}

		public override void OnExit()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).OnExit();
			if (!((EntityState)this).outer.destroying)
			{
				CreateBlinkEffect(Util.GetCorePosition(((EntityState)this).gameObject));
			}
			if (Object.op_Implicit((Object)(object)hurtboxGroup))
			{
				HurtBoxGroup val = hurtboxGroup;
				int hurtBoxesDeactivatorCounter = val.hurtBoxesDeactivatorCounter - 1;
				val.hurtBoxesDeactivatorCounter = hurtBoxesDeactivatorCounter;
			}
		}

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

		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 DeployParachute : BaseState
	{
		public static float liftDuration = 0f;

		public static float baseDuration = 1.2f;

		public static float liftVelocity = 54f;

		public static float boostVelocity = 18f;

		public static float stopAscentVelocity = 12f;

		public static float airBoostMult = 1.4f;

		public static float airLiftMult = 0.6f;

		public static float minDuration = 0.3f;

		public static ConfigEntry<bool> holdToAscend;

		public static float stunRadius = 12f;

		public static string deploySoundString = "Play_bandit2_shift_exit";

		public static GameObject stunEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Bandit2/Bandit2SmokeBomb.prefab").WaitForCompletion();

		private PilotController pilotController;

		private bool stopAscent;

		private bool startedAirborne;

		private GameObject parachute;

		private Renderer[] parachuteRenderers;

		private bool uninterrupted;

		private int origJumpCount;

		private CameraParamsOverrideHandle camOverrideHandle;

		private CharacterCameraParamsData cameraParams = new CharacterCameraParamsData
		{
			maxPitch = BlendableFloat.op_Implicit(70f),
			minPitch = BlendableFloat.op_Implicit(-70f),
			pivotVerticalOffset = BlendableFloat.op_Implicit(3.5f),
			idealLocalCameraPos = BlendableVector3.op_Implicit(zoomCameraPosition),
			wallCushion = BlendableFloat.op_Implicit(0.1f)
		};

		private static Vector3 zoomCameraPosition = new Vector3(0f, 0f, -10f);

		public static ConfigEntry<bool> enableParachuteFade;

		public static float fadeAmount = 0.6f;

		public static float fadeLookAngle = -0.35f;

		private MaterialPropertyBlock propertyStorage;

		public override void OnEnter()
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_0215: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_0231: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: Unknown result type (might be due to invalid IL or missing references)
			//IL_023d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			stopAscent = false;
			Util.PlaySound(deploySoundString, ((EntityState)this).gameObject);
			if (NetworkServer.active && stunRadius > 0f)
			{
				StunEnemies(((EntityState)this).transform.position);
			}
			startedAirborne = false;
			CreateParachute();
			((BaseState)this).StartAimMode(1f, false);
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				startedAirborne = !((EntityState)this).characterMotor.isGrounded;
				origJumpCount = ((EntityState)this).characterMotor.jumpCount;
				((EntityState)this).characterMotor.jumpCount = ((!Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) ? 1 : ((EntityState)this).characterBody.maxJumpCount);
				if (startedAirborne)
				{
					((EntityState)this).PlayAnimation("FullBody, Override", "ParachuteForward");
				}
				else
				{
					((EntityState)this).PlayAnimation("FullBody, Override", "ParachuteUp");
				}
				if (((EntityState)this).isAuthority)
				{
					((EntityState)this).characterMotor.disableAirControlUntilCollision = false;
					Ray aimRay = ((BaseState)this).GetAimRay();
					float num = base.moveSpeedStat / ((Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && ((EntityState)this).characterBody.baseMoveSpeed != 0f) ? ((EntityState)this).characterBody.baseMoveSpeed : 7f);
					if (startedAirborne)
					{
						num *= airBoostMult;
					}
					Vector3 direction = ((Ray)(ref aimRay)).direction;
					direction.y = 0f;
					((Vector3)(ref direction)).Normalize();
					CharacterMotor characterMotor = ((EntityState)this).characterMotor;
					characterMotor.velocity += direction * boostVelocity * num;
				}
			}
			pilotController = ((EntityState)this).GetComponent<PilotController>();
			if (Object.op_Implicit((Object)(object)pilotController))
			{
				pilotController.isParachuting = true;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams))
			{
				((EntityState)this).cameraTargetParams.RemoveParamsOverride(camOverrideHandle, 0.2f);
				CameraParamsOverrideRequest val = default(CameraParamsOverrideRequest);
				val.cameraParamsData = cameraParams;
				val.priority = 0f;
				CameraParamsOverrideRequest val2 = val;
				camOverrideHandle = ((EntityState)this).cameraTargetParams.AddParamsOverride(val2, 0.5f);
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			HandleMotion();
			((BaseState)this).StartAimMode(2f, false);
			if (((EntityState)this).isAuthority)
			{
				if (Object.op_Implicit((Object)(object)((EntityState)this).healthComponent) && ((EntityState)this).healthComponent.isInFrozenState)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
				else if (((EntityState)this).fixedAge >= baseDuration || stopAscent)
				{
					uninterrupted = true;
					((EntityState)this).outer.SetNextState((EntityState)(object)new Glide());
				}
			}
		}

		private void HandleMotion()
		{
			if (stopAscent || !Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				return;
			}
			if (((EntityState)this).characterMotor.velocity.y < 0f)
			{
				((EntityState)this).characterMotor.velocity.y = 0f;
			}
			float num = liftVelocity;
			if (startedAirborne)
			{
				num *= airLiftMult;
			}
			if (((EntityState)this).fixedAge > liftDuration)
			{
				num *= Mathf.Lerp(baseDuration, liftDuration, ((EntityState)this).fixedAge);
			}
			if (num > stopAscentVelocity)
			{
				((EntityState)this).characterMotor.rootMotion.y += num * Time.deltaTime;
				if (((EntityState)this).isAuthority && holdToAscend.Value && ((EntityState)this).fixedAge > minDuration && Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && !((EntityState)this).inputBank.skill3.down)
				{
					stopAscent = true;
					((BaseState)this).SmallHop(((EntityState)this).characterMotor, stopAscentVelocity);
				}
			}
			else
			{
				stopAscent = true;
				((BaseState)this).SmallHop(((EntityState)this).characterMotor, stopAscentVelocity);
			}
		}

		public override void OnExit()
		{
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				if (((EntityState)this).characterMotor.isGrounded)
				{
					((EntityState)this).characterMotor.jumpCount = 0;
				}
				else
				{
					((EntityState)this).characterMotor.jumpCount = Mathf.Max(origJumpCount, 1);
				}
			}
			if (Object.op_Implicit((Object)(object)pilotController))
			{
				pilotController.isParachuting = false;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded)
			{
				((EntityState)this).characterMotor.jumpCount = 1;
			}
			DestroyParachute();
			if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams))
			{
				((EntityState)this).cameraTargetParams.RemoveParamsOverride(camOverrideHandle, 0.5f);
			}
			((EntityState)this).OnExit();
		}

		private void StunEnemies(Vector3 stunPosition)
		{
			//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_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				return;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody.coreTransform))
			{
				EffectManager.SimpleEffect(stunEffectPrefab, stunPosition, ((EntityState)this).characterBody.coreTransform.rotation, true);
			}
			TeamIndex team = ((BaseState)this).GetTeam();
			List<HealthComponent> list = new List<HealthComponent>();
			Collider[] array = Physics.OverlapSphere(stunPosition, stunRadius, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask));
			for (int i = 0; i < array.Length; i++)
			{
				HurtBox component = ((Component)array[i]).GetComponent<HurtBox>();
				if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.healthComponent) || list.Contains(component.healthComponent))
				{
					continue;
				}
				list.Add(component.healthComponent);
				if (Object.op_Implicit((Object)(object)component.healthComponent.body.teamComponent) && component.healthComponent.body.teamComponent.teamIndex != team)
				{
					SetStateOnHurt component2 = ((Component)component.healthComponent).gameObject.GetComponent<SetStateOnHurt>();
					if (Object.op_Implicit((Object)(object)component2) && component2.canBeStunned)
					{
						component2.SetStun(1f);
					}
				}
			}
		}

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

		private void SetupParachuteFade()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			propertyStorage = new MaterialPropertyBlock();
			if (Object.op_Implicit((Object)(object)parachute))
			{
				Renderer[] componentsInChildren = (Renderer[])(object)parachute.GetComponentsInChildren<SkinnedMeshRenderer>();
				parachuteRenderers = componentsInChildren;
			}
			if (parachuteRenderers != null && ((EntityState)this).isAuthority && enableParachuteFade.Value && Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && ((EntityState)this).characterBody.isPlayerControlled)
			{
				for (int i = 0; i < parachuteRenderers.Length; i++)
				{
					parachuteRenderers[i].GetPropertyBlock(propertyStorage);
					propertyStorage.SetFloat("_Fade", fadeAmount);
					parachuteRenderers[i].SetPropertyBlock(propertyStorage);
				}
			}
		}

		private void CreateParachute()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			parachute = Object.Instantiate<GameObject>(Asset.TempParachute, ((BaseState)this).FindModelChild("ParachutePosition"), false);
			parachute.transform.localPosition = Vector3.zero;
			parachute.transform.localScale = Vector3.one;
			parachute.transform.localRotation = Quaternion.identity;
			SetupParachuteFade();
		}

		private void DestroyParachute()
		{
			if (Object.op_Implicit((Object)(object)parachute))
			{
				EntityState.Destroy((Object)(object)parachute);
			}
		}
	}
	public class Glide : BaseState
	{
		public static float maxFallVelocity = -6f;

		public static float exitHopVelocity = 17f;

		public static GameObject jumpEffect = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ImpactEffects/CharacterLandImpact");

		private PilotController pilotController;

		private int origJumpCount;

		private bool jumpReleased = false;

		private GameObject parachute;

		private Renderer[] parachuteRenderers;

		private CameraParamsOverrideHandle camOverrideHandle;

		private CharacterCameraParamsData cameraParams = new CharacterCameraParamsData
		{
			maxPitch = BlendableFloat.op_Implicit(70f),
			minPitch = BlendableFloat.op_Implicit(-70f),
			pivotVerticalOffset = BlendableFloat.op_Implicit(3.5f),
			idealLocalCameraPos = BlendableVector3.op_Implicit(zoomCameraPosition),
			wallCushion = BlendableFloat.op_Implicit(0.1f)
		};

		private static Vector3 zoomCameraPosition = new Vector3(0f, 0f, -10f);

		private MaterialPropertyBlock propertyStorage;

		public override void OnEnter()
		{
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: 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)
			//IL_00fc: 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_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			if (Object.op_Implicit((Object)(object)parachute))
			{
				DestroyOnTimer component = parachute.GetComponent<DestroyOnTimer>();
				if (Object.op_Implicit((Object)(object)component))
				{
					EntityState.Destroy((Object)(object)component);
				}
			}
			CreateParachute();
			pilotController = ((EntityState)this).GetComponent<PilotController>();
			if (Object.op_Implicit((Object)(object)pilotController))
			{
				pilotController.isParachuting = true;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				origJumpCount = ((EntityState)this).characterMotor.jumpCount;
				((EntityState)this).characterMotor.jumpCount = ((!Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) ? 1 : ((EntityState)this).characterBody.maxJumpCount);
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams))
			{
				((EntityState)this).cameraTargetParams.RemoveParamsOverride(camOverrideHandle, 0.2f);
				CameraParamsOverrideRequest val = default(CameraParamsOverrideRequest);
				val.cameraParamsData = cameraParams;
				val.priority = 0f;
				CameraParamsOverrideRequest val2 = val;
				camOverrideHandle = ((EntityState)this).cameraTargetParams.AddParamsOverride(val2, 0f);
			}
		}

		public override void FixedUpdate()
		{
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Expected O, but got Unknown
			((EntityState)this).FixedUpdate();
			((BaseState)this).StartAimMode(2f, false);
			if (!((EntityState)this).isAuthority)
			{
				return;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).characterMotor.velocity.y <= maxFallVelocity)
			{
				((EntityState)this).characterMotor.velocity.y = maxFallVelocity;
			}
			bool flag = Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).characterMotor.isGrounded;
			bool flag2 = false;
			if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank))
			{
				if (!jumpReleased)
				{
					jumpReleased = !((EntityState)this).inputBank.jump.down;
				}
				flag2 = jumpReleased && ((EntityState)this).inputBank.jump.down;
			}
			if (!(flag || flag2))
			{
				return;
			}
			if (flag2)
			{
				((BaseState)this).SmallHop(((EntityState)this).characterMotor, exitHopVelocity);
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
				{
					EffectManager.SpawnEffect(jumpEffect, new EffectData
					{
						origin = ((EntityState)this).characterBody.footPosition,
						scale = ((EntityState)this).characterBody.radius
					}, true);
				}
				((EntityState)this).PlayAnimation("Body", "Jump");
			}
			((EntityState)this).outer.SetNextStateToMain();
		}

		public override void OnExit()
		{
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				if (((EntityState)this).characterMotor.isGrounded)
				{
					((EntityState)this).characterMotor.jumpCount = 0;
				}
				else
				{
					((EntityState)this).characterMotor.jumpCount = Mathf.Max(origJumpCount, 1);
				}
			}
			if (Object.op_Implicit((Object)(object)pilotController))
			{
				pilotController.isParachuting = false;
			}
			DestroyParachute();
			if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams))
			{
				((EntityState)this).cameraTargetParams.RemoveParamsOverride(camOverrideHandle, 0.5f);
			}
			((EntityState)this).OnExit();
		}

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

		private void SetupParachuteFade()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			propertyStorage = new MaterialPropertyBlock();
			if (Object.op_Implicit((Object)(object)parachute))
			{
				Renderer[] componentsInChildren = (Renderer[])(object)parachute.GetComponentsInChildren<SkinnedMeshRenderer>();
				parachuteRenderers = componentsInChildren;
			}
			if (parachuteRenderers != null && ((EntityState)this).isAuthority && DeployParachute.enableParachuteFade.Value && Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && ((EntityState)this).characterBody.isPlayerControlled)
			{
				for (int i = 0; i < parachuteRenderers.Length; i++)
				{
					parachuteRenderers[i].GetPropertyBlock(propertyStorage);
					propertyStorage.SetFloat("_Fade", DeployParachute.fadeAmount);
					parachuteRenderers[i].SetPropertyBlock(propertyStorage);
				}
			}
		}

		private void CreateParachute()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			parachute = Object.Instantiate<GameObject>(Asset.TempParachute, ((BaseState)this).FindModelChild("ParachutePosition"), false);
			parachute.transform.localPosition = Vector3.zero;
			parachute.transform.localScale = Vector3.one;
			parachute.transform.localRotation = Quaternion.identity;
			SetupParachuteFade();
		}

		private void DestroyParachute()
		{
			if (Object.op_Implicit((Object)(object)parachute))
			{
				EntityState.Destroy((Object)(object)parachute);
			}
		}
	}
	public class Wallcling : BaseState
	{
		public static float jumpExitForce = 7000f;

		public static float jumpExitVerticalDistanceMult = 0.5f;

		public static string entrySoundString = "Play_loader_m2_impact";

		public static string jumpExitSoundString = "Play_loader_m1_swing";

		public static SkillDef utilityOverride;

		private GenericSkill overriddenSkill;

		private bool jumpExit = false;

		private Vector3 initialPosition;

		public Vector3 clingPoint;

		public override void OnEnter()
		{
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && ((EntityState)this).characterBody.isSprinting)
			{
				((EntityState)this).characterBody.isSprinting = false;
			}
			if (NetworkServer.active && Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				if (!((EntityState)this).characterBody.HasBuff(Buffs.WallclingBonus))
				{
					((EntityState)this).characterBody.AddBuff(Buffs.WallclingBonus);
				}
				if (((EntityState)this).characterBody.HasBuff(Buffs.WallclingBonusAirborne))
				{
					((EntityState)this).characterBody.RemoveBuff(Buffs.WallclingBonusAirborne);
				}
			}
			Util.PlaySound(entrySoundString, ((EntityState)this).gameObject);
			initialPosition = ((EntityState)this).transform.position;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				((EntityState)this).characterMotor.jumpCount = ((!Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) ? 1 : ((EntityState)this).characterBody.maxJumpCount);
				if (((EntityState)this).isAuthority)
				{
					((EntityState)this).characterMotor.velocity = Vector3.zero;
					((EntityState)this).characterMotor.rootMotion = Vector3.zero;
					((EntityState)this).characterMotor.disableAirControlUntilCollision = 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_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && ((EntityState)this).characterBody.isSprinting)
			{
				((EntityState)this).characterBody.isSprinting = false;
			}
			if (((EntityState)this).isAuthority)
			{
				bool flag = false;
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
				{
					((EntityState)this).characterMotor.velocity = Vector3.zero;
					((EntityState)this).characterMotor.rootMotion = Vector3.zero;
					flag = ((EntityState)this).characterMotor.isGrounded;
					((BaseCharacterController)((EntityState)this).characterMotor).Motor.SetPosition(initialPosition, true);
				}
				if (!jumpExit && Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && ((EntityState)this).inputBank.jump.down)
				{
					jumpExit = true;
				}
				if (flag)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
				else if (jumpExit)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new AirSpeedBoost());
				}
			}
		}

		public override void OnExit()
		{
			//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)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)