Decompiled source of BanditReloaded v4.1.3

BanditReloaded.dll

Decompiled 2 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AncientScepter;
using BanditReloaded;
using BanditReloaded.Components;
using BanditReloaded.Hooks;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using EntityStates;
using EntityStates.Bandit2.Weapon;
using EntityStates.BanditReloadedSkills;
using EntityStates.Commando.CommandoWeapon;
using EntityStates.Toolbot;
using KinematicCharacterController;
using On.EntityStates;
using On.RoR2;
using On.RoR2.Projectile;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.CharacterAI;
using RoR2.Projectile;
using RoR2.Skills;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;

[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyCompany("BanditReloaded")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: CompilationRelaxations(8)]
[assembly: AssemblyTitle("BanditReloaded")]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("BanditReloaded")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace EntityStates.BanditReloadedSkills
{
	public class BanditHelpers
	{
		public static void TriggerQuickdraw(SkillLocator skills)
		{
			skills.primary.stock = skills.primary.maxStock;
			skills.primary.rechargeStopwatch = 0f;
		}

		public static void ConsumeCloakDamageBuff(CharacterBody cb)
		{
			if (NetworkServer.active && Object.op_Implicit((Object)(object)cb))
			{
				cb.ClearTimedBuffs(ModContentPack.cloakDamageBuff);
			}
		}

		public static void PlayCloakDamageSound(CharacterBody cb)
		{
			if (Object.op_Implicit((Object)(object)cb) && cb.HasBuff(ModContentPack.cloakDamageBuff))
			{
				Util.PlaySound("Play_BanditReloaded_cloakdamage", ((Component)cb).gameObject);
			}
		}
	}
	public class Blast : BaseState
	{
		public static GameObject effectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/muzzleflashes/muzzleflashbandit2");

		public static GameObject hitEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/impacteffects/hitsparkbandit");

		public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/tracers/tracerbandit2rifle");

		public static string attackSoundString = "Play_BanditReloaded_blast";

		public static float maxDistance;

		public static float damageCoefficient;

		public static float force;

		public static float bulletRadius = 0.4f;

		public static float baseMaxDuration;

		public static float baseMinDuration;

		public static float recoilAmplitude;

		public static float spreadBloomValue;

		public static bool individualReload;

		public static bool useFalloff;

		public static bool penetrateEnemies;

		public static bool noReload;

		public static float mashSpread;

		private float maxDuration;

		private float minDuration;

		private bool buttonReleased;

		public override void OnEnter()
		{
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: 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_01d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: 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_0213: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_022a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_0251: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_026a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0278: Expected O, but got Unknown
			//IL_028b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0290: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			((BaseState)this).AddRecoil(-1f * recoilAmplitude, -2f * recoilAmplitude, -0.5f * recoilAmplitude, 0.5f * recoilAmplitude);
			maxDuration = baseMaxDuration / base.attackSpeedStat;
			minDuration = baseMinDuration / base.attackSpeedStat;
			Util.PlaySound(attackSoundString, ((EntityState)this).gameObject);
			((EntityState)this).characterBody.skillLocator.primary.rechargeStopwatch = 0f;
			if (!noReload && ((EntityState)this).characterBody.skillLocator.primary.stock == 0)
			{
				Util.PlaySound("Play_commando_M2_grenade_throw", ((EntityState)this).gameObject);
			}
			Ray aimRay = ((BaseState)this).GetAimRay();
			((BaseState)this).StartAimMode(aimRay, 2f, false);
			if (global::BanditReloaded.BanditReloaded.useOldModel)
			{
				((EntityState)this).PlayAnimation("Gesture, Additive", "FireShotgun", "FireShotgun.playbackRate", 0.5f, 0f);
				((EntityState)this).PlayAnimation("Gesture, Override", "FireShotgun", "FireShotgun.playbackRate", 0.5f, 0f);
			}
			else
			{
				((EntityState)this).PlayAnimation("Gesture, Additive", "FireMainWeapon", "FireMainWeapon.playbackRate", maxDuration, 0f);
			}
			string text = "MuzzleShotgun";
			if (Object.op_Implicit((Object)(object)effectPrefab))
			{
				EffectManager.SimpleMuzzleFlash(effectPrefab, ((EntityState)this).gameObject, text, 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 = ((EntityState)this).characterBody.spreadBloomAngle,
					bulletCount = 1u,
					procCoefficient = 1f,
					damage = damageCoefficient * base.damageStat,
					force = force,
					falloffModel = (FalloffModel)(useFalloff ? 1 : 0),
					tracerEffectPrefab = tracerEffectPrefab,
					muzzleName = text,
					hitEffectPrefab = hitEffectPrefab,
					isCrit = Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master),
					HitEffectNormal = true,
					radius = bulletRadius,
					smartCollision = true,
					maxDistance = maxDistance
				};
				if (penetrateEnemies)
				{
					val.stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask;
				}
				val.Fire();
			}
			((EntityState)this).characterBody.AddSpreadBloom(spreadBloomValue);
		}

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

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			((EntityState)this).characterBody.isSprinting = false;
			buttonReleased |= !((EntityState)this).inputBank.skill1.down;
			if (((EntityState)this).fixedAge >= maxDuration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0027: 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_002a: Unknown result type (might be due to invalid IL or missing references)
			if (buttonReleased && ((EntityState)this).fixedAge >= minDuration)
			{
				return (InterruptPriority)0;
			}
			return (InterruptPriority)2;
		}
	}
	public class Scatter : BaseState
	{
		public static GameObject effectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/muzzleflashes/muzzleflashbandit2");

		public static GameObject hitEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/impacteffects/hitsparkbandit");

		public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/tracers/tracerbandit2shotgun");

		public static float damageCoefficient;

		public static float force;

		public static float bulletRadius = 0.3f;

		public static float baseMaxDuration;

		public static float baseMinDuration;

		public static string attackSoundString = "Play_BanditReloaded_shotgun";

		public static float recoilAmplitude;

		public static float spreadBloomValue;

		public static uint pelletCount;

		public static float procCoefficient;

		public static float range;

		public static bool penetrateEnemies;

		private float maxDuration;

		private float minDuration;

		private bool buttonReleased;

		public static bool noReload;

		private bool playedSound = false;

		public override void OnEnter()
		{
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: 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_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: 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_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: 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_01f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0206: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_022a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_026a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0275: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0288: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ad: Expected O, but got Unknown
			((BaseState)this).OnEnter();
			((BaseState)this).AddRecoil(-1f * recoilAmplitude, -2f * recoilAmplitude, -0.5f * recoilAmplitude, 0.5f * recoilAmplitude);
			maxDuration = baseMaxDuration / base.attackSpeedStat;
			minDuration = baseMinDuration / base.attackSpeedStat;
			Util.PlaySound(attackSoundString, ((EntityState)this).gameObject);
			((EntityState)this).characterBody.skillLocator.primary.rechargeStopwatch = 0f;
			if (!noReload && ((EntityState)this).characterBody.skillLocator.primary.stock == 0)
			{
				Util.PlaySound("Play_commando_M2_grenade_throw", ((EntityState)this).gameObject);
			}
			Ray aimRay = ((BaseState)this).GetAimRay();
			((BaseState)this).StartAimMode(aimRay, 2f, false);
			if (global::BanditReloaded.BanditReloaded.useOldModel)
			{
				((EntityState)this).PlayAnimation("Gesture, Additive", "FireShotgun", "FireShotgun.playbackRate", maxDuration * 0.8f, 0f);
				((EntityState)this).PlayAnimation("Gesture, Override", "FireShotgun", "FireShotgun.playbackRate", maxDuration * 0.8f, 0f);
			}
			else
			{
				((EntityState)this).PlayAnimation("Gesture, Additive", "FireMainWeapon", "FireMainWeapon.playbackRate", maxDuration, 0f);
			}
			string text = "MuzzleShotgun";
			if (Object.op_Implicit((Object)(object)effectPrefab))
			{
				EffectManager.SimpleMuzzleFlash(effectPrefab, ((EntityState)this).gameObject, text, 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 = Mathf.Max(spreadBloomValue, ((EntityState)this).characterBody.spreadBloomAngle),
					bulletCount = pelletCount,
					procCoefficient = procCoefficient,
					damage = damageCoefficient * base.damageStat,
					force = force,
					falloffModel = (FalloffModel)1,
					tracerEffectPrefab = tracerEffectPrefab,
					muzzleName = text,
					hitEffectPrefab = hitEffectPrefab,
					isCrit = Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master),
					HitEffectNormal = false,
					radius = bulletRadius,
					smartCollision = true,
					maxDistance = range,
					stopperMask = (penetrateEnemies ? ((LayerIndex)(ref LayerIndex.world)).mask : ((LayerIndex)(ref LayerIndex.entityPrecise)).mask)
				};
				val.Fire();
				((EntityState)this).characterBody.AddSpreadBloom(spreadBloomValue);
			}
		}

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

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			((EntityState)this).characterBody.isSprinting = false;
			buttonReleased |= !((EntityState)this).inputBank.skill1.down;
			if (!playedSound && ((EntityState)this).fixedAge > maxDuration * 0.5f)
			{
				playedSound = true;
				((EntityState)this).PlayCrossfade("Gesture, Additive", "EnterReload", "Reload.playbackRate", maxDuration * 0.5f, 0.1f);
				Util.PlaySound("Play_bandit_M1_pump", ((EntityState)this).gameObject);
			}
			if (((EntityState)this).fixedAge >= maxDuration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0027: 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_002a: Unknown result type (might be due to invalid IL or missing references)
			if (buttonReleased && ((EntityState)this).fixedAge >= minDuration)
			{
				return (InterruptPriority)0;
			}
			return (InterruptPriority)2;
		}
	}
	public class AcidBomb : BaseState
	{
		public static GameObject projectilePrefab;

		public static float damageCoefficient;

		public static float acidDamageCoefficient;

		public static float force;

		public static float selfForce;

		public static float baseDuration;

		private float duration;

		public override void OnEnter()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: 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_00af: 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_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_0128: 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_0145: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			Ray aimRay = ((BaseState)this).GetAimRay();
			((BaseState)this).StartAimMode(aimRay, 2f, false);
			if (global::BanditReloaded.BanditReloaded.useOldModel)
			{
				((EntityState)this).PlayAnimation("Gesture", "FireRevolver", "FireRevolver.playbackRate", duration, 0f);
			}
			else
			{
				((EntityState)this).PlayAnimation("Gesture, Additive", "SlashBlade", "SlashBlade.playbackRate", duration, 0f);
			}
			Util.PlaySound("Play_commando_M2_grenade_throw", ((EntityState)this).gameObject);
			if (((EntityState)this).isAuthority)
			{
				ProjectileManager.instance.FireProjectile(projectilePrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, base.damageStat * damageCoefficient, 0f, Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f);
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded)
			{
				Vector3 val = -((Ray)(ref aimRay)).direction * selfForce;
				val.y *= 0.5f;
				((EntityState)this).characterMotor.ApplyForce(val, true, false);
			}
			BanditHelpers.TriggerQuickdraw(((EntityState)this).characterBody.skillLocator);
		}

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

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)3;
		}
	}
	public class ClusterBomb : BaseState
	{
		public static float damageCoefficient;

		public static float force = 2500f;

		public static float selfForce = 0f;

		public static float baseDuration;

		public static float bombletDamageCoefficient;

		private float duration;

		public static GameObject projectilePrefab { get; set; }

		public override void OnEnter()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: 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_00af: 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_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_0128: 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_0145: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			Ray aimRay = ((BaseState)this).GetAimRay();
			((BaseState)this).StartAimMode(aimRay, 2f, false);
			if (global::BanditReloaded.BanditReloaded.useOldModel)
			{
				((EntityState)this).PlayAnimation("Gesture", "FireRevolver", "FireRevolver.playbackRate", duration, 0f);
			}
			else
			{
				((EntityState)this).PlayAnimation("Gesture, Additive", "SlashBlade", "SlashBlade.playbackRate", duration, 0f);
			}
			Util.PlaySound("Play_BanditReloaded_dynamite_toss", ((EntityState)this).gameObject);
			if (((EntityState)this).isAuthority)
			{
				ProjectileManager.instance.FireProjectile(projectilePrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, base.damageStat * damageCoefficient, 0f, Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f);
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded)
			{
				Vector3 val = -((Ray)(ref aimRay)).direction * selfForce;
				val.y *= 0.5f;
				((EntityState)this).characterMotor.ApplyForce(val, true, false);
			}
			BanditHelpers.TriggerQuickdraw(((EntityState)this).characterBody.skillLocator);
		}

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

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)3;
		}
	}
	public class ThermiteBomb : BaseState
	{
		public static GameObject projectilePrefab;

		public static float damageCoefficient;

		public static float force = 0f;

		public static float selfForce = 0f;

		public static float baseDuration;

		public static float burnDamageMult;

		public static GameObject effectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/muzzleflashes/muzzleflashbanditpistol");

		private float duration;

		private bool playedAnim = false;

		private Animator animator;

		private int bodySideWeaponLayerIndex;

		public override void OnEnter()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: 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_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_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: 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_01ed: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			Ray aimRay = ((BaseState)this).GetAimRay();
			((BaseState)this).StartAimMode(aimRay, 2f, false);
			Util.PlaySound("Play_Bandit_m2_shot", ((EntityState)this).gameObject);
			animator = ((EntityState)this).GetModelAnimator();
			if (global::BanditReloaded.BanditReloaded.useOldModel)
			{
				((EntityState)this).PlayAnimation("Gesture, Additive", "PrepRevolver", "PrepRevolver.playbackRate", duration * 0.5f, 0f);
				((EntityState)this).PlayAnimation("Gesture, Override", "PrepRevolver", "PrepRevolver.playbackRate", duration * 0.5f, 0f);
			}
			else
			{
				if (Object.op_Implicit((Object)(object)animator))
				{
					bodySideWeaponLayerIndex = animator.GetLayerIndex("Body, SideWeapon");
					animator.SetLayerWeight(bodySideWeaponLayerIndex, 1f);
				}
				((EntityState)this).PlayAnimation("Gesture, Additive", "MainToSide", "MainToSide.playbackRate", duration * 0.5f, 0f);
			}
			if (Object.op_Implicit((Object)(object)effectPrefab))
			{
				EffectManager.SimpleMuzzleFlash(effectPrefab, ((EntityState)this).gameObject, "MuzzlePistol", false);
			}
			if (((EntityState)this).isAuthority)
			{
				ProjectileManager.instance.FireProjectile(projectilePrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)this).gameObject, base.damageStat * damageCoefficient, 0f, Util.CheckRoll(base.critStat, ((EntityState)this).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f);
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded)
			{
				Vector3 val = -((Ray)(ref aimRay)).direction * selfForce;
				val.y *= 0.5f;
				((EntityState)this).characterMotor.ApplyForce(val, true, false);
			}
			((EntityState)this).characterBody.AddSpreadBloom(2.4f);
			((BaseState)this).AddRecoil(-6f, -12f, -3f, 3f);
			BanditHelpers.TriggerQuickdraw(((EntityState)this).characterBody.skillLocator);
		}

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

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			((EntityState)this).characterBody.isSprinting = false;
			if (!playedAnim && ((EntityState)this).fixedAge > duration * 0.5f)
			{
				playedAnim = true;
				if (!global::BanditReloaded.BanditReloaded.useOldModel)
				{
					((EntityState)this).PlayAnimation("Gesture, Additive", "FireSideWeapon", "FireSideWeapon.playbackRate", duration, 0f);
				}
				else
				{
					((EntityState)this).PlayAnimation("Gesture", "FireRevolver", "FireRevolver.playbackRate", duration, 0f);
				}
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				if (Object.op_Implicit((Object)(object)animator))
				{
					animator.SetLayerWeight(bodySideWeaponLayerIndex, 0f);
				}
				Transform val = ((BaseState)this).FindModelChild("SpinningPistolFX");
				if (Object.op_Implicit((Object)(object)val))
				{
					((Component)val).gameObject.SetActive(false);
				}
				((EntityState)this).outer.SetNextState((EntityState)(object)new ExitRevolver());
			}
		}

		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)3;
		}
	}
	public class PrepBarrage : BaseState
	{
		public static float baseDuration;

		public static string prepSoundString = "Play_bandit2_R_load";

		private float duration;

		private ChildLocator childLocator;

		private Animator animator;

		private int bodySideWeaponLayerIndex;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			animator = ((EntityState)this).GetModelAnimator();
			if (global::BanditReloaded.BanditReloaded.useOldModel)
			{
				((EntityState)this).PlayAnimation("Gesture, Additive", "PrepRevolver", "PrepRevolver.playbackRate", duration, 0f);
				((EntityState)this).PlayAnimation("Gesture, Override", "PrepRevolver", "PrepRevolver.playbackRate", duration, 0f);
			}
			else
			{
				if (Object.op_Implicit((Object)(object)animator))
				{
					bodySideWeaponLayerIndex = animator.GetLayerIndex("Body, SideWeapon");
					animator.SetLayerWeight(bodySideWeaponLayerIndex, 1f);
				}
				((EntityState)this).PlayAnimation("Gesture, Additive", "MainToSide", "MainToSide.playbackRate", duration, 0f);
			}
			Util.PlaySound(prepSoundString, ((EntityState)this).gameObject);
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.SetAimTimer(duration);
				BanditHelpers.TriggerQuickdraw(((EntityState)this).characterBody.skillLocator);
				if (((EntityState)this).characterBody.HasBuff(ModContentPack.cloakDamageBuff))
				{
					((EntityState)this).characterBody.ClearTimedBuffs(ModContentPack.cloakDamageBuff);
					((EntityState)this).characterBody.AddTimedBuff(ModContentPack.cloakDamageBuff, 1.2f);
				}
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			((EntityState)this).characterBody.isSprinting = false;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.SetAimTimer(duration);
				((EntityState)this).characterBody.SetSpreadBloom(FireBarrage.spread * 0.8f, false);
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority && !((EntityState)this).inputBank.skill4.down)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new FireBarrage());
			}
		}

		public override void OnExit()
		{
			if (!global::BanditReloaded.BanditReloaded.useOldModel)
			{
				if (Object.op_Implicit((Object)(object)animator))
				{
					animator.SetLayerWeight(bodySideWeaponLayerIndex, 0f);
				}
				Transform val = ((BaseState)this).FindModelChild("SpinningPistolFX");
				if (Object.op_Implicit((Object)(object)val))
				{
					((Component)val).gameObject.SetActive(false);
				}
			}
			((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)5;
		}
	}
	public class FireBarrage : BaseState
	{
		public static GameObject effectPrefab = Resources.Load<GameObject>("prefabs/effects/muzzleflashes/muzzleflashbandit2");

		public static GameObject hitEffectPrefab = Resources.Load<GameObject>("prefabs/effects/impacteffects/hitsparkbandit2pistol");

		public static GameObject tracerEffectPrefab = Resources.Load<GameObject>("prefabs/effects/tracers/tracerbandit2rifle");

		public static float damageCoefficient;

		public static float force;

		public static float baseDuration;

		public static string attackSoundString = "Play_bandit2_R_fire";

		public static float recoilAmplitude = 2.2f;

		public static int maxBullets;

		public static float endLag;

		public static float spread;

		public static float maxDistance;

		private int bulletCount;

		private ChildLocator childLocator;

		private float duration;

		private float prevShot;

		private string muzzleName;

		private bool isCrit;

		private float recoil;

		private Animator animator;

		private int bodySideWeaponLayerIndex;

		private bool earlyExit = true;

		public override void OnEnter()
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			bulletCount = maxBullets;
			prevShot = 0f;
			duration = baseDuration / base.attackSpeedStat;
			recoil = recoilAmplitude / base.attackSpeedStat;
			Ray aimRay = ((BaseState)this).GetAimRay();
			((BaseState)this).StartAimMode(aimRay, 2f, false);
			muzzleName = "MuzzlePistol";
			isCrit = ((BaseState)this).RollCrit();
			animator = ((EntityState)this).GetModelAnimator();
			if (Object.op_Implicit((Object)(object)animator) && !global::BanditReloaded.BanditReloaded.useOldModel)
			{
				bodySideWeaponLayerIndex = animator.GetLayerIndex("Body, SideWeapon");
				animator.SetLayerWeight(bodySideWeaponLayerIndex, 1f);
			}
		}

		public override void OnExit()
		{
			BanditHelpers.ConsumeCloakDamageBuff(((EntityState)this).characterBody);
			((EntityState)this).characterBody.SetSpreadBloom(0f, false);
			if (earlyExit && !global::BanditReloaded.BanditReloaded.useOldModel)
			{
				if (Object.op_Implicit((Object)(object)animator))
				{
					animator.SetLayerWeight(bodySideWeaponLayerIndex, 0f);
				}
				((EntityState)this).PlayAnimation("Gesture, Additive", "SideToMain");
				Transform val = ((BaseState)this).FindModelChild("SpinningPistolFX");
				if (Object.op_Implicit((Object)(object)val))
				{
					((Component)val).gameObject.SetActive(false);
				}
			}
			((EntityState)this).OnExit();
		}

		public override void FixedUpdate()
		{
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: 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_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: 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_01ab: 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_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: 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)
			((EntityState)this).FixedUpdate();
			((EntityState)this).characterBody.isSprinting = false;
			if (!(((EntityState)this).fixedAge - prevShot > duration))
			{
				return;
			}
			if (bulletCount > 0)
			{
				prevShot = ((EntityState)this).fixedAge;
				bulletCount--;
				((BaseState)this).AddRecoil(-3f * recoil, -4f * recoil, -0.5f * recoil, 0.5f * recoil);
				Ray aimRay = ((BaseState)this).GetAimRay();
				muzzleName = "MuzzlePistol";
				Util.PlaySound(attackSoundString, ((EntityState)this).gameObject);
				if (global::BanditReloaded.BanditReloaded.useOldModel)
				{
					((EntityState)this).PlayAnimation("Gesture, Additive", "FireRevolver");
					((EntityState)this).PlayAnimation("Gesture, Override", "FireRevolver");
				}
				else
				{
					((EntityState)this).PlayAnimation("Gesture, Additive", "FireSideWeapon", "FireSideWeapon.playbackRate", 0.5f, 0f);
				}
				if (Object.op_Implicit((Object)(object)effectPrefab))
				{
					EffectManager.SimpleMuzzleFlash(effectPrefab, ((EntityState)this).gameObject, muzzleName, false);
				}
				float num = ((bulletCount <= 0) ? 0f : spread);
				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 = num,
						maxSpread = num,
						force = force,
						falloffModel = (FalloffModel)0,
						tracerEffectPrefab = tracerEffectPrefab,
						muzzleName = muzzleName,
						hitEffectPrefab = hitEffectPrefab,
						isCrit = isCrit,
						HitEffectNormal = true,
						radius = 0.4f,
						maxDistance = maxDistance,
						procCoefficient = 1f,
						damage = damageCoefficient * base.damageStat,
						damageType = DamageTypeCombo.op_Implicit((DamageType)12),
						smartCollision = true
					}.Fire();
					((EntityState)this).characterBody.SetSpreadBloom(spread * 0.8f, false);
				}
			}
			else
			{
				if (!(((EntityState)this).fixedAge - prevShot > endLag))
				{
					return;
				}
				if (!global::BanditReloaded.BanditReloaded.useOldModel)
				{
					if (Object.op_Implicit((Object)(object)animator))
					{
						animator.SetLayerWeight(bodySideWeaponLayerIndex, 0f);
					}
					Transform val = ((BaseState)this).FindModelChild("SpinningPistolFX");
					if (Object.op_Implicit((Object)(object)val))
					{
						((Component)val).gameObject.SetActive(false);
					}
				}
				earlyExit = false;
				((EntityState)this).outer.SetNextState((EntityState)(object)new ExitRevolver());
			}
		}

		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;
		}
	}
	internal class ExitRevolver : BaseState
	{
		public float baseDuration = 1.5f;

		protected float duration;

		private Animator animator;

		private int bodySideWeaponLayerIndex;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			if (global::BanditReloaded.BanditReloaded.useOldModel)
			{
				((EntityState)this).outer.SetNextStateToMain();
				return;
			}
			animator = ((EntityState)this).GetModelAnimator();
			duration = baseDuration / base.attackSpeedStat;
			if (Object.op_Implicit((Object)(object)animator))
			{
				bodySideWeaponLayerIndex = animator.GetLayerIndex("Body, SideWeapon");
				animator.SetLayerWeight(bodySideWeaponLayerIndex, 1f);
			}
		}

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

		public override void OnExit()
		{
			if (Object.op_Implicit((Object)(object)animator))
			{
				animator.SetLayerWeight(bodySideWeaponLayerIndex, 0f);
			}
			((EntityState)this).PlayAnimation("Gesture, Additive", "SideToMain");
			Transform val = ((BaseState)this).FindModelChild("SpinningPistolFX");
			if (Object.op_Implicit((Object)(object)val))
			{
				((Component)val).gameObject.SetActive(false);
			}
			((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;
		}
	}
	public class PrepLightsOut : BaseState
	{
		public static float baseDuration;

		public static string prepSoundString = "Play_bandit2_R_load";

		private float duration;

		private ChildLocator childLocator;

		public static GameObject specialCrosshairPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/crosshair/Bandit2CrosshairPrepRevolver");

		private GameObject defaultCrosshairPrefab;

		private Animator animator;

		private int bodySideWeaponLayerIndex;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			animator = ((EntityState)this).GetModelAnimator();
			if (global::BanditReloaded.BanditReloaded.useOldModel)
			{
				((EntityState)this).PlayAnimation("Gesture, Additive", "PrepRevolver", "PrepRevolver.playbackRate", duration, 0f);
				((EntityState)this).PlayAnimation("Gesture, Override", "PrepRevolver", "PrepRevolver.playbackRate", duration, 0f);
			}
			else
			{
				if (Object.op_Implicit((Object)(object)animator))
				{
					bodySideWeaponLayerIndex = animator.GetLayerIndex("Body, SideWeapon");
					animator.SetLayerWeight(bodySideWeaponLayerIndex, 1f);
				}
				((EntityState)this).PlayAnimation("Gesture, Additive", "MainToSide", "MainToSide.playbackRate", duration, 0f);
			}
			Util.PlaySound(prepSoundString, ((EntityState)this).gameObject);
			defaultCrosshairPrefab = ((EntityState)this).characterBody._defaultCrosshairPrefab;
			((EntityState)this).characterBody._defaultCrosshairPrefab = specialCrosshairPrefab;
			BanditHelpers.TriggerQuickdraw(((EntityState)this).characterBody.skillLocator);
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.SetAimTimer(duration);
				if (((EntityState)this).characterBody.HasBuff(ModContentPack.cloakDamageBuff))
				{
					((EntityState)this).characterBody.ClearTimedBuffs(ModContentPack.cloakDamageBuff);
					((EntityState)this).characterBody.AddTimedBuff(ModContentPack.cloakDamageBuff, 1.2f);
				}
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			((EntityState)this).characterBody.isSprinting = false;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.SetAimTimer(duration);
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority && !((EntityState)this).inputBank.skill4.down)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new FireLightsOut());
			}
		}

		public override void OnExit()
		{
			((EntityState)this).characterBody._defaultCrosshairPrefab = defaultCrosshairPrefab;
			if (!global::BanditReloaded.BanditReloaded.useOldModel)
			{
				if (Object.op_Implicit((Object)(object)animator))
				{
					animator.SetLayerWeight(bodySideWeaponLayerIndex, 0f);
				}
				Transform val = ((BaseState)this).FindModelChild("SpinningPistolFX");
				if (Object.op_Implicit((Object)(object)val))
				{
					((Component)val).gameObject.SetActive(false);
				}
			}
			((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)5;
		}
	}
	public class FireLightsOut : BaseState
	{
		public static GameObject effectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/muzzleflashes/muzzleflashbandit2");

		public static GameObject hitEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/impacteffects/hitsparkbandit2pistol");

		public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/tracers/tracerbandit2rifle");

		public static float damageCoefficient;

		public static float force;

		public static float baseDuration;

		public static string attackSoundString = "Play_bandit2_R_fire";

		public static float recoilAmplitude = 4f;

		private ChildLocator childLocator;

		private float duration;

		private Animator animator;

		private int bodySideWeaponLayerIndex;

		private bool earlyExit = true;

		public override void OnEnter()
		{
			//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_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			((BaseState)this).AddRecoil(-3f * recoilAmplitude, -4f * recoilAmplitude, -0.5f * recoilAmplitude, 0.5f * recoilAmplitude);
			Ray aimRay = ((BaseState)this).GetAimRay();
			((BaseState)this).StartAimMode(aimRay, 2f, false);
			string text = "MuzzlePistol";
			Util.PlaySound(attackSoundString, ((EntityState)this).gameObject);
			animator = ((EntityState)this).GetModelAnimator();
			if (global::BanditReloaded.BanditReloaded.useOldModel)
			{
				((EntityState)this).PlayAnimation("Gesture, Additive", "FireRevolver");
				((EntityState)this).PlayAnimation("Gesture, Override", "FireRevolver");
			}
			else
			{
				if (Object.op_Implicit((Object)(object)animator))
				{
					bodySideWeaponLayerIndex = animator.GetLayerIndex("Body, SideWeapon");
					animator.SetLayerWeight(bodySideWeaponLayerIndex, 1f);
				}
				((EntityState)this).PlayAnimation("Gesture, Additive", "FireSideWeapon", "FireSideWeapon.playbackRate", 1f, 0f);
			}
			if (Object.op_Implicit((Object)(object)effectPrefab))
			{
				EffectManager.SimpleMuzzleFlash(effectPrefab, ((EntityState)this).gameObject, text, 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,
					force = force,
					falloffModel = (FalloffModel)0,
					tracerEffectPrefab = tracerEffectPrefab,
					muzzleName = text,
					hitEffectPrefab = hitEffectPrefab,
					isCrit = ((BaseState)this).RollCrit(),
					HitEffectNormal = true,
					radius = 0.5f,
					maxDistance = 2000f,
					procCoefficient = 1f,
					damage = damageCoefficient * base.damageStat,
					damageType = DamageTypeCombo.op_Implicit((DamageType)4),
					smartCollision = true
				}.Fire();
			}
		}

		public override void OnExit()
		{
			BanditHelpers.ConsumeCloakDamageBuff(((EntityState)this).characterBody);
			if (earlyExit && !global::BanditReloaded.BanditReloaded.useOldModel)
			{
				if (Object.op_Implicit((Object)(object)animator))
				{
					animator.SetLayerWeight(bodySideWeaponLayerIndex, 0f);
				}
				((EntityState)this).PlayAnimation("Gesture, Additive", "SideToMain");
				Transform val = ((BaseState)this).FindModelChild("SpinningPistolFX");
				if (Object.op_Implicit((Object)(object)val))
				{
					((Component)val).gameObject.SetActive(false);
				}
			}
			((EntityState)this).OnExit();
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			((EntityState)this).characterBody.isSprinting = false;
			if (!(((EntityState)this).fixedAge >= duration) || !((EntityState)this).isAuthority)
			{
				return;
			}
			if (!global::BanditReloaded.BanditReloaded.useOldModel)
			{
				if (Object.op_Implicit((Object)(object)animator))
				{
					animator.SetLayerWeight(bodySideWeaponLayerIndex, 0f);
				}
				Transform val = ((BaseState)this).FindModelChild("SpinningPistolFX");
				if (Object.op_Implicit((Object)(object)val))
				{
					((Component)val).gameObject.SetActive(false);
				}
			}
			earlyExit = false;
			((EntityState)this).outer.SetNextState((EntityState)(object)new ExitRevolver());
		}

		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 PrepBarrageScepter : BaseState
	{
		public static float baseDuration;

		public static string prepSoundString = "Play_bandit2_R_load";

		private float duration;

		private ChildLocator childLocator;

		private Animator animator;

		private int bodySideWeaponLayerIndex;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			animator = ((EntityState)this).GetModelAnimator();
			if (global::BanditReloaded.BanditReloaded.useOldModel)
			{
				((EntityState)this).PlayAnimation("Gesture, Additive", "PrepRevolver", "PrepRevolver.playbackRate", duration, 0f);
				((EntityState)this).PlayAnimation("Gesture, Override", "PrepRevolver", "PrepRevolver.playbackRate", duration, 0f);
			}
			else
			{
				if (Object.op_Implicit((Object)(object)animator))
				{
					bodySideWeaponLayerIndex = animator.GetLayerIndex("Body, SideWeapon");
					animator.SetLayerWeight(bodySideWeaponLayerIndex, 1f);
				}
				((EntityState)this).PlayAnimation("Gesture, Additive", "MainToSide", "MainToSide.playbackRate", duration, 0f);
			}
			Util.PlaySound(prepSoundString, ((EntityState)this).gameObject);
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.SetAimTimer(duration);
				BanditHelpers.TriggerQuickdraw(((EntityState)this).characterBody.skillLocator);
				if (((EntityState)this).characterBody.HasBuff(ModContentPack.cloakDamageBuff))
				{
					((EntityState)this).characterBody.ClearTimedBuffs(ModContentPack.cloakDamageBuff);
					((EntityState)this).characterBody.AddTimedBuff(ModContentPack.cloakDamageBuff, 1.2f);
				}
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.SetSpreadBloom(FireBarrage.spread * 0.8f, false);
				((EntityState)this).characterBody.SetAimTimer(duration);
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority && !((EntityState)this).inputBank.skill4.down)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new FireBarrageScepter());
			}
		}

		public override void OnExit()
		{
			if (!global::BanditReloaded.BanditReloaded.useOldModel)
			{
				if (Object.op_Implicit((Object)(object)animator))
				{
					animator.SetLayerWeight(bodySideWeaponLayerIndex, 0f);
				}
				Transform val = ((BaseState)this).FindModelChild("SpinningPistolFX");
				if (Object.op_Implicit((Object)(object)val))
				{
					((Component)val).gameObject.SetActive(false);
				}
			}
			((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)5;
		}
	}
	public class FireBarrageScepter : BaseState
	{
		public static GameObject effectPrefab = Resources.Load<GameObject>("prefabs/effects/muzzleflashes/muzzleflashbandit2");

		public static GameObject hitEffectPrefab = Resources.Load<GameObject>("prefabs/effects/impacteffects/hitsparkbandit2pistol");

		public static GameObject tracerEffectPrefab = Resources.Load<GameObject>("prefabs/effects/tracers/tracerbandit2rifle");

		public static float damageCoefficient;

		public static float force;

		public static float baseDuration;

		public static string attackSoundString = "Play_bandit2_R_fire";

		public static float recoilAmplitude = 2.2f;

		public static int maxBullets;

		public static float endLag;

		public static float spread;

		public static float maxDistance;

		private int bulletCount;

		private ChildLocator childLocator;

		private float duration;

		private float prevShot;

		private string muzzleName;

		private bool isCrit;

		private float recoil;

		private Animator animator;

		private int bodySideWeaponLayerIndex;

		private bool earlyExit = true;

		public override void OnEnter()
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			bulletCount = maxBullets;
			prevShot = 0f;
			duration = baseDuration / base.attackSpeedStat;
			recoil = recoilAmplitude / base.attackSpeedStat;
			Ray aimRay = ((BaseState)this).GetAimRay();
			((BaseState)this).StartAimMode(aimRay, 2f, false);
			muzzleName = "MuzzlePistol";
			isCrit = ((BaseState)this).RollCrit();
			animator = ((EntityState)this).GetModelAnimator();
			if (Object.op_Implicit((Object)(object)animator) && !global::BanditReloaded.BanditReloaded.useOldModel)
			{
				bodySideWeaponLayerIndex = animator.GetLayerIndex("Body, SideWeapon");
				animator.SetLayerWeight(bodySideWeaponLayerIndex, 1f);
			}
		}

		public override void OnExit()
		{
			BanditHelpers.ConsumeCloakDamageBuff(((EntityState)this).characterBody);
			((EntityState)this).characterBody.SetSpreadBloom(0f, false);
			if (earlyExit && !global::BanditReloaded.BanditReloaded.useOldModel)
			{
				if (Object.op_Implicit((Object)(object)animator))
				{
					animator.SetLayerWeight(bodySideWeaponLayerIndex, 0f);
				}
				((EntityState)this).PlayAnimation("Gesture, Additive", "SideToMain");
				Transform val = ((BaseState)this).FindModelChild("SpinningPistolFX");
				if (Object.op_Implicit((Object)(object)val))
				{
					((Component)val).gameObject.SetActive(false);
				}
			}
			((EntityState)this).OnExit();
		}

		public override void FixedUpdate()
		{
			//IL_0088: 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_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: 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_016a: 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_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: 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_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: 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_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: 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_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0211: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (!(((EntityState)this).fixedAge - prevShot > duration))
			{
				return;
			}
			if (bulletCount > 0)
			{
				prevShot = ((EntityState)this).fixedAge;
				bulletCount--;
				((BaseState)this).AddRecoil(-3f * recoil, -4f * recoil, -0.5f * recoil, 0.5f * recoil);
				Ray aimRay = ((BaseState)this).GetAimRay();
				muzzleName = "MuzzlePistol";
				Util.PlaySound(attackSoundString, ((EntityState)this).gameObject);
				if (global::BanditReloaded.BanditReloaded.useOldModel)
				{
					((EntityState)this).PlayAnimation("Gesture, Additive", "FireRevolver");
					((EntityState)this).PlayAnimation("Gesture, Override", "FireRevolver");
				}
				else
				{
					((EntityState)this).PlayAnimation("Gesture, Additive", "FireSideWeapon", "FireSideWeapon.playbackRate", 0.5f, 0f);
				}
				if (Object.op_Implicit((Object)(object)effectPrefab))
				{
					EffectManager.SimpleMuzzleFlash(effectPrefab, ((EntityState)this).gameObject, muzzleName, false);
				}
				float num = ((bulletCount <= 0) ? 0f : spread);
				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 = num,
						maxSpread = num,
						force = force,
						falloffModel = (FalloffModel)0,
						tracerEffectPrefab = tracerEffectPrefab,
						muzzleName = muzzleName,
						hitEffectPrefab = hitEffectPrefab,
						isCrit = isCrit,
						HitEffectNormal = true,
						radius = 0.4f,
						maxDistance = maxDistance,
						procCoefficient = 1f,
						damage = damageCoefficient * base.damageStat,
						damageType = DamageTypeCombo.op_Implicit((DamageType)12),
						smartCollision = true
					}.Fire();
					((EntityState)this).characterBody.SetSpreadBloom(FireBarrage.spread * 0.8f, false);
				}
			}
			else if (((EntityState)this).fixedAge - prevShot > endLag)
			{
				if (Object.op_Implicit((Object)(object)animator))
				{
					animator.SetLayerWeight(bodySideWeaponLayerIndex, 0f);
				}
				Transform val = ((BaseState)this).FindModelChild("SpinningPistolFX");
				if (Object.op_Implicit((Object)(object)val))
				{
					((Component)val).gameObject.SetActive(false);
				}
				earlyExit = false;
				((EntityState)this).outer.SetNextState((EntityState)(object)new ExitRevolver());
			}
		}

		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 PrepLightsOutScepter : BaseState
	{
		public static float baseDuration;

		public static string prepSoundString = "Play_bandit2_R_load";

		private float duration;

		private ChildLocator childLocator;

		public static GameObject specialCrosshairPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/crosshair/Bandit2CrosshairPrepRevolver");

		private GameObject defaultCrosshairPrefab;

		private Animator animator;

		private int bodySideWeaponLayerIndex;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			if (global::BanditReloaded.BanditReloaded.useOldModel)
			{
				((EntityState)this).PlayAnimation("Gesture, Additive", "PrepRevolver", "PrepRevolver.playbackRate", duration, 0f);
				((EntityState)this).PlayAnimation("Gesture, Override", "PrepRevolver", "PrepRevolver.playbackRate", duration, 0f);
			}
			else
			{
				if (Object.op_Implicit((Object)(object)animator))
				{
					bodySideWeaponLayerIndex = animator.GetLayerIndex("Body, SideWeapon");
					animator.SetLayerWeight(bodySideWeaponLayerIndex, 1f);
				}
				((EntityState)this).PlayAnimation("Gesture, Additive", "MainToSide", "MainToSide.playbackRate", duration, 0f);
			}
			((EntityState)this).PlayAnimation("Gesture, Additive", "MainToSide", "MainToSide.playbackRate", duration, 0f);
			Util.PlaySound(prepSoundString, ((EntityState)this).gameObject);
			defaultCrosshairPrefab = ((EntityState)this).characterBody._defaultCrosshairPrefab;
			((EntityState)this).characterBody._defaultCrosshairPrefab = specialCrosshairPrefab;
			BanditHelpers.TriggerQuickdraw(((EntityState)this).characterBody.skillLocator);
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				((EntityState)this).characterBody.SetAimTimer(duration);
				if (((EntityState)this).characterBody.HasBuff(ModContentPack.cloakDamageBuff))
				{
					((EntityState)this).characterBody.ClearTimedBuffs(ModContentPack.cloakDamageBuff);
					((EntityState)this).characterBody.AddTimedBuff(ModContentPack.cloakDamageBuff, 1.2f);
				}
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority && !((EntityState)this).inputBank.skill4.down)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new FireLightsOutScepter());
			}
		}

		public override void OnExit()
		{
			((EntityState)this).characterBody._defaultCrosshairPrefab = defaultCrosshairPrefab;
			if (!global::BanditReloaded.BanditReloaded.useOldModel)
			{
				if (Object.op_Implicit((Object)(object)animator))
				{
					animator.SetLayerWeight(bodySideWeaponLayerIndex, 0f);
				}
				Transform val = ((BaseState)this).FindModelChild("SpinningPistolFX");
				if (Object.op_Implicit((Object)(object)val))
				{
					((Component)val).gameObject.SetActive(false);
				}
			}
			((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)5;
		}
	}
	public class FireLightsOutScepter : BaseState
	{
		public static GameObject effectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/muzzleflashes/muzzleflashbandit2");

		public static GameObject hitEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/impacteffects/hitsparkbandit2pistol");

		public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/tracers/tracerbandit2rifle");

		public static float damageCoefficient;

		public static float force;

		public static float baseDuration;

		public static string attackSoundString = "Play_bandit2_R_fire";

		public static float recoilAmplitude = 4f;

		private float duration;

		private Animator animator;

		private int bodySideWeaponLayerIndex;

		private bool earlyExit = true;

		public override void OnEnter()
		{
			//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_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			((BaseState)this).AddRecoil(-3f * recoilAmplitude, -4f * recoilAmplitude, -0.5f * recoilAmplitude, 0.5f * recoilAmplitude);
			Ray aimRay = ((BaseState)this).GetAimRay();
			((BaseState)this).StartAimMode(aimRay, 2f, false);
			string text = "MuzzlePistol";
			Util.PlaySound(attackSoundString, ((EntityState)this).gameObject);
			animator = ((EntityState)this).GetModelAnimator();
			if (global::BanditReloaded.BanditReloaded.useOldModel)
			{
				((EntityState)this).PlayAnimation("Gesture, Additive", "FireRevolver");
				((EntityState)this).PlayAnimation("Gesture, Override", "FireRevolver");
			}
			else
			{
				if (Object.op_Implicit((Object)(object)animator))
				{
					bodySideWeaponLayerIndex = animator.GetLayerIndex("Body, SideWeapon");
					animator.SetLayerWeight(bodySideWeaponLayerIndex, 1f);
				}
				((EntityState)this).PlayAnimation("Gesture, Additive", "FireSideWeapon", "FireSideWeapon.playbackRate", 1f, 0f);
			}
			if (Object.op_Implicit((Object)(object)effectPrefab))
			{
				EffectManager.SimpleMuzzleFlash(effectPrefab, ((EntityState)this).gameObject, text, 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,
					force = force,
					falloffModel = (FalloffModel)0,
					tracerEffectPrefab = tracerEffectPrefab,
					muzzleName = text,
					hitEffectPrefab = hitEffectPrefab,
					isCrit = ((BaseState)this).RollCrit(),
					HitEffectNormal = true,
					radius = 0.5f,
					maxDistance = 2000f,
					procCoefficient = 1f,
					damage = damageCoefficient * base.damageStat,
					damageType = DamageTypeCombo.op_Implicit((DamageType)4),
					smartCollision = true
				}.Fire();
			}
		}

		public override void OnExit()
		{
			BanditHelpers.ConsumeCloakDamageBuff(((EntityState)this).characterBody);
			if (earlyExit && !global::BanditReloaded.BanditReloaded.useOldModel)
			{
				if (Object.op_Implicit((Object)(object)animator))
				{
					animator.SetLayerWeight(bodySideWeaponLayerIndex, 0f);
				}
				((EntityState)this).PlayAnimation("Gesture, Additive", "SideToMain");
				Transform val = ((BaseState)this).FindModelChild("SpinningPistolFX");
				if (Object.op_Implicit((Object)(object)val))
				{
					((Component)val).gameObject.SetActive(false);
				}
			}
			((EntityState)this).OnExit();
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (!(((EntityState)this).fixedAge >= duration) || !((EntityState)this).isAuthority)
			{
				return;
			}
			if (!global::BanditReloaded.BanditReloaded.useOldModel)
			{
				if (Object.op_Implicit((Object)(object)animator))
				{
					animator.SetLayerWeight(bodySideWeaponLayerIndex, 0f);
				}
				Transform val = ((BaseState)this).FindModelChild("SpinningPistolFX");
				if (Object.op_Implicit((Object)(object)val))
				{
					((Component)val).gameObject.SetActive(false);
				}
			}
			earlyExit = false;
			((EntityState)this).outer.SetNextState((EntityState)(object)new ExitRevolver());
		}

		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 Assassinate : BaseState
	{
		public static string chargeSoundString = "Play_item_proc_crit_cooldown";

		public static string beginChargeSoundString = "Play_MULT_m1_snipe_charge";

		public static float baseChargeDuration;

		public static float minimumStateDuration = 0f;

		public static float zoomFOV;

		private float stopwatch;

		private Animator animator;

		private float lastMuzzleFlash = 0f;

		private float chargeDuration;

		private bool playedSound = false;

		private float chargeCoefficient = 0f;

		public static GameObject chargeupVfxPrefab;

		public static GameObject holdChargeVfxPrefab;

		private GameObject chargeupVfxGameObject;

		private GameObject holdChargeVfxGameObject;

		private Transform muzzleTransform;

		public static string muzzleName = "MuzzleShotgun";

		private GameObject defaultCrosshairPrefab;

		private GameObject specialCrosshairPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/crosshair/banditcrosshair");

		private GameObject perfectCrosshairPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/crosshair/StraightBracketCrosshair");

		private bool chargeEffect = false;

		public static float perfectChargeDuration = 0f;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			BanditHelpers.TriggerQuickdraw(((EntityState)this).characterBody.skillLocator);
			animator = ((EntityState)this).GetModelAnimator();
			chargeDuration = baseChargeDuration / base.attackSpeedStat;
			((EntityState)this).PlayAnimation("Gesture, Additive", "FireShotgun", "FireShotgun.playbackRate", chargeDuration * 1.5f, 0f);
			((EntityState)this).PlayAnimation("Gesture, Override", "FireShotgun", "FireShotgun.playbackRate", chargeDuration * 1.5f, 0f);
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			((EntityState)this).cameraTargetParams.fovOverride = zoomFOV;
			if (Object.op_Implicit((Object)(object)modelTransform))
			{
				ChildLocator component = ((Component)modelTransform).GetComponent<ChildLocator>();
				if (Object.op_Implicit((Object)(object)component))
				{
					muzzleTransform = component.FindChild(muzzleName);
					if (Object.op_Implicit((Object)(object)muzzleTransform))
					{
						chargeupVfxGameObject = Object.Instantiate<GameObject>(chargeupVfxPrefab, muzzleTransform);
						chargeupVfxGameObject.GetComponent<ScaleParticleSystemDuration>().newDuration = chargeDuration;
					}
				}
			}
			Util.PlaySound(beginChargeSoundString, ((EntityState)this).gameObject);
			defaultCrosshairPrefab = ((EntityState)this).characterBody._defaultCrosshairPrefab;
			((EntityState)this).characterBody._defaultCrosshairPrefab = specialCrosshairPrefab;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && ((EntityState)this).characterBody.HasBuff(ModContentPack.cloakDamageBuff))
			{
				((EntityState)this).characterBody.ClearTimedBuffs(ModContentPack.cloakDamageBuff);
				((EntityState)this).characterBody.AddTimedBuff(ModContentPack.cloakDamageBuff, chargeDuration + 0.5f);
			}
		}

		public override void OnExit()
		{
			((EntityState)this).characterBody._defaultCrosshairPrefab = defaultCrosshairPrefab;
			((EntityState)this).cameraTargetParams.fovOverride = -1f;
			if (Object.op_Implicit((Object)(object)chargeupVfxGameObject))
			{
				EntityState.Destroy((Object)(object)chargeupVfxGameObject);
				chargeupVfxGameObject = null;
			}
			if (Object.op_Implicit((Object)(object)holdChargeVfxGameObject))
			{
				EntityState.Destroy((Object)(object)holdChargeVfxGameObject);
				holdChargeVfxGameObject = null;
			}
			((EntityState)this).OnExit();
			if (((EntityState)this).inputBank.skill4.down)
			{
				((EntityState)this).skillLocator.utility.rechargeStopwatch = ((EntityState)this).skillLocator.utility.CalculateFinalRechargeInterval() / 6f;
			}
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= chargeDuration)
			{
				if (stopwatch <= chargeDuration + perfectChargeDuration)
				{
					chargeCoefficient = 1.2f;
					if (Object.op_Implicit((Object)(object)FireChargeShot.effectPrefab) && stopwatch - lastMuzzleFlash > 0.1f)
					{
						lastMuzzleFlash = stopwatch;
						EffectManager.SimpleMuzzleFlash(FireChargeShot.effectPrefab, ((EntityState)this).gameObject, muzzleName, false);
					}
					((EntityState)this).characterBody._defaultCrosshairPrefab = perfectCrosshairPrefab;
				}
				else
				{
					if ((Object)(object)((EntityState)this).characterBody._defaultCrosshairPrefab != (Object)(object)specialCrosshairPrefab)
					{
						((EntityState)this).characterBody._defaultCrosshairPrefab = specialCrosshairPrefab;
					}
					chargeCoefficient = 1f;
				}
				((EntityState)this).characterBody.SetSpreadBloom(0f, false);
				if (!playedSound)
				{
					playedSound = true;
					Util.PlayAttackSpeedSound(chargeSoundString, ((EntityState)this).gameObject, perfectChargeDuration);
				}
				if (!chargeEffect)
				{
					chargeEffect = true;
					if (Object.op_Implicit((Object)(object)chargeupVfxGameObject))
					{
						EntityState.Destroy((Object)(object)chargeupVfxGameObject);
						chargeupVfxGameObject = null;
					}
					if (!Object.op_Implicit((Object)(object)holdChargeVfxGameObject) && Object.op_Implicit((Object)(object)muzzleTransform))
					{
						holdChargeVfxGameObject = Object.Instantiate<GameObject>(holdChargeVfxPrefab, muzzleTransform);
					}
				}
			}
			else
			{
				chargeCoefficient = stopwatch / chargeDuration;
				((EntityState)this).characterBody.SetSpreadBloom(1.25f * (1f - chargeCoefficient), false);
			}
			if (!Object.op_Implicit((Object)(object)((EntityState)this).inputBank) || (stopwatch >= minimumStateDuration && ((EntityState)this).isAuthority))
			{
				if (!((EntityState)this).inputBank.skill3.down)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new FireChargeShot
					{
						chargeCoefficient = chargeCoefficient
					});
				}
				else if (!Object.op_Implicit((Object)(object)((EntityState)this).inputBank))
				{
					((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 FireChargeShot : BaseState
	{
		public static GameObject effectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/muzzleflashes/muzzleflashbanditshotgun");

		public static GameObject hitEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/muzzleflashes/muzzleflashbanditshotgun");

		public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/tracers/tracertoolbotrebar");

		public static GameObject perfectTracerEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/tracers/tracertoolbotrebar");

		public static float minDamageCoefficient;

		public static float maxDamageCoefficient;

		public static float perfectChargeBonus = 2f;

		public static float minForce;

		public static float maxForce;

		public static float baseDuration;

		public static string attackSoundString = "Play_bandit_M2_shot";

		public static string fullChargeSoundString = "Play_item_use_lighningArm";

		public static float recoilAmplitude = 4f;

		public float chargeCoefficient;

		public static float selfForceMax;

		public static float selfForceMin;

		private ChildLocator childLocator;

		private float duration;

		private bool perfect = false;

		public static float minRadius;

		public static float maxRadius;

		public static int maxTargets;

		public override void OnEnter()
		{
			//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_0055: 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_0135: 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_014d: 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_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: 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_01bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: 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_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_0231: 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_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0250: Unknown result type (might be due to invalid IL or missing references)
			//IL_0255: Unknown result type (might be due to invalid IL or missing references)
			//IL_025a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02da: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f2: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			duration = baseDuration / base.attackSpeedStat;
			((BaseState)this).AddRecoil(-3f * recoilAmplitude, -4f * recoilAmplitude, -0.5f * recoilAmplitude, 0.5f * recoilAmplitude);
			Ray aimRay = ((BaseState)this).GetAimRay();
			((BaseState)this).StartAimMode(aimRay, 2f, false);
			string text = "MuzzleShotgun";
			Util.PlaySound(attackSoundString, ((EntityState)this).gameObject);
			if (chargeCoefficient > 1f)
			{
				perfect = true;
				chargeCoefficient = 1f;
				Util.PlaySound(fullChargeSoundString, ((EntityState)this).gameObject);
			}
			((EntityState)this).PlayAnimation("Gesture, Additive", "FireShotgun", "FireShotgun.playbackRate", duration * 0.8f, 0f);
			((EntityState)this).PlayAnimation("Gesture, Override", "FireShotgun", "FireShotgun.playbackRate", duration * 0.8f, 0f);
			if (Object.op_Implicit((Object)(object)effectPrefab))
			{
				EffectManager.SimpleMuzzleFlash(effectPrefab, ((EntityState)this).gameObject, text, 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,
					damage = Mathf.Lerp(minDamageCoefficient, maxDamageCoefficient, chargeCoefficient) * base.damageStat + (perfect ? (perfectChargeBonus * base.damageStat) : 0f),
					force = Mathf.Lerp(minForce, maxForce, chargeCoefficient),
					falloffModel = (FalloffModel)0,
					tracerEffectPrefab = (perfect ? perfectTracerEffectPrefab : tracerEffectPrefab),
					muzzleName = text,
					hitEffectPrefab = hitEffectPrefab,
					isCrit = ((BaseState)this).RollCrit(),
					radius = Mathf.Lerp(minRadius, maxRadius, chargeCoefficient),
					maxDistance = 2000f,
					stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask,
					damageType = DamageTypeCombo.op_Implicit((DamageType)32),
					smartCollision = true,
					procCoefficient = Mathf.Lerp(0f, 1f, chargeCoefficient)
				}.Fire();
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded)
				{
					Vector3 val = -((Ray)(ref aimRay)).direction * Mathf.Lerp(selfForceMin, selfForceMax, chargeCoefficient);
					val.y *= 0.5f;
					((EntityState)this).characterMotor.ApplyForce(val, true, false);
				}
			}
		}

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

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

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)1;
		}
	}
	public class CastSmokescreenNoDelay : BaseState
	{
		public static float duration;

		public static float minimumStateDuration;

		public static string startCloakSoundString = "Play_bandit_shift_land";

		public static string stopCloakSoundString = "Play_bandit_shift_end";

		public static GameObject smokescreenEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/smokescreeneffect");

		public static Material destealthMaterial;

		public static float damageCoefficient;

		public static float procCoefficient;

		public static bool nonLethal;

		public static float radius;

		public static float forceMagnitude = 0f;

		private float stopwatch;

		private bool hasCastSmoke;

		private Animator animator;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			animator = ((EntityState)this).GetModelAnimator();
			CastSmoke();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				if (((EntityState)this).isAuthority)
				{
					((EntityState)this).characterBody.isSprinting = true;
				}
				if (NetworkServer.active)
				{
					((EntityState)this).characterBody.AddBuff(Buffs.Cloak);
					((EntityState)this).characterBody.AddBuff(Buffs.CloakSpeed);
					((EntityState)this).characterBody.AddTimedBuff(ModContentPack.cloakDamageBuff, duration + 0.5f);
				}
				BanditHelpers.TriggerQuickdraw(((EntityState)this).characterBody.skillLocator);
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded && !global::BanditReloaded.BanditReloaded.useOldModel)
			{
				((EntityState)this).PlayAnimation("Gesture, Additive", "ThrowSmokebomb", "ThrowSmokebomb.playbackRate", 0.2f, 0f);
			}
		}

		public override void OnExit()
		{
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
			{
				if (NetworkServer.active)
				{
					if (((EntityState)this).characterBody.HasBuff(Buffs.Cloak))
					{
						((EntityState)this).characterBody.RemoveBuff(Buffs.Cloak);
					}
					if (((EntityState)this).characterBody.HasBuff(Buffs.CloakSpeed))
					{
						((EntityState)this).characterBody.RemoveBuff(Buffs.CloakSpeed);
					}
				}
				BanditHelpers.PlayCloakDamageSound(((EntityState)this).characterBody);
			}
			if (!((EntityState)this).outer.destroying)
			{
				CastSmoke();
			}
			if (Object.op_Implicit((Object)(object)destealthMaterial))
			{
				TemporaryOverlay val = ((Component)animator).gameObject.AddComponent<TemporaryOverlay>();
				val.duration = 1f;
				val.destroyComponentOnEnd = true;
				val.originalMaterial = destealthMaterial;
				val.inspectorCharacterModel = ((Component)animator).gameObject.GetComponent<CharacterModel>();
				val.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
				val.animateShaderAlpha = true;
			}
			Util.PlaySound(stopCloakSoundString, ((EntityState)this).gameObject);
			if (Object.op_Implicit((Object)(object)animator))
			{
				animator.SetLayerWeight(animator.GetLayerIndex("Body, StealthWeapon"), 0f);
			}
			((EntityState)this).OnExit();
		}

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

		private void CastSmoke()
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			//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_00b0: 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_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: 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_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: 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_0108: 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_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_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_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			if (!hasCastSmoke)
			{
				Util.PlaySound(startCloakSoundString, ((EntityState)this).gameObject);
				hasCastSmoke = true;
			}
			EffectManager.SpawnEffect(smokescreenEffectPrefab, new EffectData
			{
				origin = ((EntityState)this).transform.position
			}, false);
			int layerIndex = animator.GetLayerIndex("Impact");
			if (layerIndex >= 0)
			{
				animator.SetLayerWeight(layerIndex, 1f);
				animator.PlayInFixedTime("LightImpact", layerIndex, 0f);
			}
			if (NetworkServer.active)
			{
				new BlastAttack
				{
					attacker = ((EntityState)this).gameObject,
					inflictor = ((EntityState)this).gameObject,
					teamIndex = TeamComponent.GetObjectTeam(((EntityState)this).gameObject),
					baseDamage = base.damageStat * damageCoefficient,
					baseForce = forceMagnitude,
					position = ((EntityState)this).transform.position,
					radius = radius,
					falloffModel = (FalloffModel)0,
					damageType = DamageTypeCombo.op_Implicit((DamageType)(nonLethal ? 33 : 32)),
					procCoefficient = procCoefficient,
					crit = ((BaseState)this).RollCrit(),
					attackerFiltering = (AttackerFiltering)2
				}.Fire();
			}
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded)
			{
				((EntityState)this).characterMotor.velocity = new Vector3(((EntityState)this).characterMotor.velocity.x, 17f, ((EntityState)this).characterMotor.velocity.z);
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			if (stopwatch <= minimumStateDuration)
			{
				return (InterruptPriority)3;
			}
			return (InterruptPriority)0;
		}
	}
}
namespace BanditReloaded
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.Moffein.BanditReloaded_v4", "Bandit Reloaded v4", "4.1.3")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	internal class BanditReloaded : BaseUnityPlugin
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_OnEnable <>9__60_0;

			internal void <Awake>b__60_0(orig_OnEnable orig, CameraRigController self)
			{
				SceneDef sceneDefForCurrentScene = SceneCatalog.GetSceneDefForCurrentScene();
				if (Object.op_Implicit((Object)(object)sceneDefForCurrentScene) && sceneDefForCurrentScene.baseSceneName.Equals("lobby"))
				{
					self.enableFading = false;
				}
				orig.Invoke(self);
			}
		}

		public static bool useOldModel;

		public static bool swapSpecial;

		private int blastStock;

		private float thermiteBurnDuration;

		private float thermiteRadius;

		private float thermiteProcCoefficient;

		private float thermiteCooldown;

		private int thermiteStock;

		private float cloakCooldown;

		private int cloakStock;

		private float loCooldown;

		private int loStock;

		private int scatterStock;

		private float acidRadius;

		private float acidProcCoefficient;

		private float acidCooldown;

		private int acidStock;

		private float asCooldown;

		private int asStock;

		private bool asEnabled;

		private float cbRadius;

		private float cbBombletRadius;

		private float cbBombletProcCoefficient;

		private float cbCooldown;

		public static int cbStock;

		public static int cbBombletCount;

		private float reuCooldown;

		private int reuStock;

		public static SurvivorDef item;

		public ReloadSkillDef primaryBlastDef;

		public ReloadSkillDef primaryScatterDef;

		public SkillDef utilityDefA;

		public SkillDef utilityAltDef;

		public SkillDef thermiteDef;

		public SkillDef acidBombDef;

		public SkillDef specialLightsOutDef;

		public SkillDef clusterBombDef;

		public SkillDef specialBarrageDef;

		public SkillDef specialBarrageScepterDef;

		public SkillDef specialLightsOutScepterDef;

		public static GameObject BanditBody;

		public GameObject BanditMonsterMaster = null;

		public static ModdedDamageType ClusterBombDamage;

		public GameObject AcidBombObject = null;

		public GameObject ThermiteObject = null;

		public static GameObject ClusterBombletObject;

		public GameObject AcidBombGhostObject = null;

		public GameObject ThermiteGhostObject = null;

		public GameObject ClusterBombGhostObject = null;

		public GameObject ClusterBombletGhostObject = null;

		public Color BanditColor = new Color(41f / 51f, 41f / 85f, 43f / 51f);

		private string BanditBodyName = "";

		private readonly Shader hotpoo = Load<Shader>("RoR2/Base/Shaders/HGStandard.shader");

		public GameObject ClusterBombObject { get; set; }

		public void RegisterLanguageTokens()
		{
			LanguageAPI.Add("BANDITRELOADEDBODY_DEFAULT_SKIN_NAME", "Default");
			LanguageAPI.Add("BANDITRELOADED_PASSIVE_NAME", "Quickdraw");
			LanguageAPI.Add("BANDITRELOADED_PASSIVE_DESCRIPTION", "The Bandit <style=cIsUtility>instantly reloads</style> his primary when using other skills.");
			LanguageAPI.Add("BANDITRELOADED_OUTRO_FLAVOR", "..and so he left, with his pyrrhic plunder.");
			LanguageAPI.Add("BANDITRELOADED_MAIN_ENDING_ESCAPE_FAILURE_FLAVOR", "..and so he vanished, unable to escape his past.");
			LanguageAPI.Add("BANDITRELOADED_BODY_NAME", "Classic Bandit");
			LanguageAPI.Add("BANDITRELOADED_BODY_SUBTITLE", "Wanted Dead or Alive");
			string text = "The Bandit is a hit-and-run survivor who uses dirty tricks to assassinate his targets.<color=#CCD3E0>" + Environment.NewLine + Environment.NewLine;
			text = text + "< ! > Space out your skill usage to keep firing Blast, or dump them all at once for massive damage!" + Environment.NewLine + Environment.NewLine;
			text = text + "< ! > Use grenades to apply debuffs to enemies, boosting the damage of Lights Out." + Environment.NewLine + Environment.NewLine;
			text = text + "< ! > Use Smokebomb to either run away or to stun many enemies at once." + Environment.NewLine + Environment.NewLine;
			text = text + "< ! > Dealing a killing blow with Lights Out allows you to chain many skills together, allowing for maximum damage AND safety." + Environment.NewLine + Environment.NewLine;
			LanguageAPI.Add("BANDITRELOADED_BODY_DESC", text);
			LanguageAPI.Add("KEYWORD_BANDITRELOADED_EXECUTE", "<style=cKeywordName>Executing</style><style=cSub>The ability <style=cIsHealth>instantly kills</style> enemies below <style=cIsHealth>" + TakeDamage.specialExecuteThreshold.ToString("P0").Replace(" ", "").Replace(",", "") + " HP</style>.</style>");
			LanguageAPI.Add("KEYWORD_BANDITRELOADED_RAPIDFIRE", "<style=cKeywordName>Rapid-Fire</style><style=cSub>The skill fires faster if you click faster.</style>");
			LanguageAPI.Add("KEYWORD_BANDITRELOADED_THERMITE", "<style=cKeywordName>Thermite</style><style=cSub>Reduce movement speed by <style=cIsDamage>15%</style> per stack. Reduce armor by <style=cIsDamage>2.5</style> per stack.</style>");
			LanguageAPI.Add("KEYWORD_BANDITRELOADED_DEBUFFBOOST", "<style=cKeywordName>Debuff Boosted</style><style=cSub>Gain <style=cIsDamage>+" + TakeDamage.specialDebuffBonus.ToString("P0").Replace(" ", "").Replace(",", "") + " TOTAL damage</style> for each unique debuff on the enemy.");
			LanguageAPI.Add("BANDITRELOADED_PRIMARY_NAME", "Blast");
			LanguageAPI.Add("BANDITRELOADED_PRIMARY_ALT_NAME", "Scatter");
			LanguageAPI.Add("BANDITRELOADED_SECONDARY_NAME", "Dynamite Toss");
			LanguageAPI.Add("BANDITRELOADED_SECONDARY_ALT_NAME", "Thermite Flare");
			LanguageAPI.Add("BANDITRELOADED_SECONDARY_ALT2_NAME", "Acid Bomb");
			LanguageAPI.Add("BANDITRELOADED_UTILITY_NAME", "Smokebomb");
			LanguageAPI.Add("BANDITRELOADED_SPECIAL_NAME", "Lights Out");
			LanguageAPI.Add("BANDITRELOADED_SPECIAL_ALT_NAME", "Rack em Up");
			LanguageAPI.Add("BANDITRELOADED_SPECIAL_SCEPTER_NAME", "Decapitate");
			LanguageAPI.Add("BANDITRELOADED_SPECIAL_ALT_SCEPTER_NAME", "Fistful of Lead");
		}

		internal static T Load<T>(string path)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return Addressables.LoadAssetAsync<T>((object)path).WaitForCompletion();
		}

		public void Start()
		{
			CastSmokescreenNoDelay.destealthMaterial = CastSmokescreenNoDelay.destealthMaterial;
			Assassinate.chargeupVfxPrefab = ChargeSpear.chargeupVfxPrefab;
			Assassinate.holdChargeVfxPrefab = ChargeSpear.holdChargeVfxPrefab;
			if (useOldModel)
			{
				DisplaySetup.DisplayRules(BanditBody);
			}
		}

		public void Awake()
		{
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Expected O, but got Unknown
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			ModContentPack.LoadResources();
			ReadConfig();
			SetupBanditBody();
			SetupProjectiles();
			SetAttributes();
			AssignSkills();
			CreateMaster();
			CreateBuffs();
			if (useOldModel)
			{
				AddClassicSkin();
				object obj = <>c.<>9__60