Decompiled source of Driver v1.8.0

plugins/rob_gaming-Driver/DriverMod.dll

Decompiled 2 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AncientScepter;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using ClassicItemsReturns.Items;
using ClassicItemsReturns.Items.Uncommon;
using EntityStates;
using EntityStates.AI;
using EntityStates.BrotherMonster.Weapon;
using EntityStates.Commando;
using EntityStates.Commando.CommandoWeapon;
using EntityStates.GlobalSkills.LunarDetonator;
using EntityStates.GlobalSkills.LunarNeedle;
using EntityStates.GolemMonster;
using EntityStates.Huntress;
using EntityStates.LemurianBruiserMonster;
using EntityStates.Mage.Weapon;
using HG;
using HG.BlendableTypes;
using KinematicCharacterController;
using LostInTransit;
using MaterialHud;
using Microsoft.CodeAnalysis;
using Moonstorm.Starstorm2;
using On.EntityStates.AI;
using On.EntityStates.GlobalSkills.LunarDetonator;
using On.EntityStates.GlobalSkills.LunarNeedle;
using On.RoR2;
using On.RoR2.UI;
using R2API;
using R2API.Networking;
using R2API.Networking.Interfaces;
using R2API.Utils;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.Achievements;
using RoR2.Audio;
using RoR2.CharacterAI;
using RoR2.ContentManagement;
using RoR2.HudOverlay;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.Stats;
using RoR2.UI;
using RobDriver.Modules;
using RobDriver.Modules.Achievements;
using RobDriver.Modules.Components;
using RobDriver.Modules.Misc;
using RobDriver.Modules.Survivors;
using RobDriver.Modules.Weapons;
using RobDriver.SkillStates;
using RobDriver.SkillStates.BaseStates;
using RobDriver.SkillStates.Driver;
using RobDriver.SkillStates.Driver.ArmBFG;
using RobDriver.SkillStates.Driver.ArmCannon;
using RobDriver.SkillStates.Driver.ArtiGauntlet;
using RobDriver.SkillStates.Driver.BadassShotgun;
using RobDriver.SkillStates.Driver.Bazooka;
using RobDriver.SkillStates.Driver.BeetleShield;
using RobDriver.SkillStates.Driver.Compat;
using RobDriver.SkillStates.Driver.Compat.NemmandoGun;
using RobDriver.SkillStates.Driver.Compat.NemmandoSword;
using RobDriver.SkillStates.Driver.Compat.NemmercGun;
using RobDriver.SkillStates.Driver.GoldenGun;
using RobDriver.SkillStates.Driver.GolemGun;
using RobDriver.SkillStates.Driver.GrenadeLauncher;
using RobDriver.SkillStates.Driver.HeavyMachineGun;
using RobDriver.SkillStates.Driver.LunarGrenade;
using RobDriver.SkillStates.Driver.LunarHammer;
using RobDriver.SkillStates.Driver.LunarPistol;
using RobDriver.SkillStates.Driver.LunarRifle;
using RobDriver.SkillStates.Driver.MachineGun;
using RobDriver.SkillStates.Driver.PlasmaCannon;
using RobDriver.SkillStates.Driver.PyriteGun;
using RobDriver.SkillStates.Driver.Revolver;
using RobDriver.SkillStates.Driver.RiotShotgun;
using RobDriver.SkillStates.Driver.RocketLauncher;
using RobDriver.SkillStates.Driver.SMG;
using RobDriver.SkillStates.Driver.Shotgun;
using RobDriver.SkillStates.Driver.Skateboard;
using RobDriver.SkillStates.Driver.SlugShotgun;
using RobDriver.SkillStates.Driver.SniperRifle;
using RobDriver.SkillStates.Driver.SupplyDrop;
using RobDriver.SkillStates.Driver.SupplyDrop.Nerfed;
using RobDriver.SkillStates.Driver.SupplyDrop.Scepter;
using RobDriver.SkillStates.Driver.VoidPistol;
using RobDriver.SkillStates.Driver.VoidRifle;
using RobDriver.SkillStates.Emote;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("DriverMod")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: AssemblyProduct("DriverMod")]
[assembly: AssemblyTitle("DriverMod")]
[assembly: AssemblyInformationalVersion("1.0.0+c9bff88ad4ba2e1ef5c0011a945f1c266d0dae92")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
[module: UnverifiableCode]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
internal static class Log
{
	internal static ManualLogSource _logSource;

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

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

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

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

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

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

	internal static void Warning(object data)
	{
		_logSource.LogWarning(data);
	}
}
internal enum DriverCameraParams
{
	DEFAULT,
	AIM_PISTOL,
	AIM_SNIPER,
	EMOTE
}
public class StupidFuckingBullshit : MonoBehaviour
{
	public ParticleSystem faggot;

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

	private void FixedUpdate()
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		((Component)faggot).transform.SetPositionAndRotation(((Component)this).transform.position, ((Component)this).transform.rotation);
	}
}
[CreateAssetMenu(fileName = "blt", menuName = "ScriptableObjects/BulletDef", order = 2)]
public class DriverBulletDef : ScriptableObject
{
	[Header("General")]
	public string nameToken = "";

	public DamageType bulletType = (DamageType)0;

	public ModdedDamageType moddedBulletType = DamageTypes.Generic;

	public DriverWeaponTier tier = DriverWeaponTier.Common;

	[Header("Visuals")]
	public Sprite icon = null;

	public Color trailColor = Color.black;

	[HideInInspector]
	public ushort index;

	public static DriverBulletDef CreateBulletDefFromInfo(DriverBulletDefInfo bulletDefInfo)
	{
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: 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_0066: Unknown result type (might be due to invalid IL or missing references)
		DriverBulletDef driverBulletDef = (DriverBulletDef)(object)ScriptableObject.CreateInstance(typeof(DriverBulletDef));
		((Object)driverBulletDef).name = bulletDefInfo.nameToken;
		driverBulletDef.nameToken = bulletDefInfo.nameToken;
		driverBulletDef.bulletType = bulletDefInfo.driverBulletType;
		driverBulletDef.moddedBulletType = bulletDefInfo.moddedDriverBulletType;
		driverBulletDef.tier = bulletDefInfo.tier;
		driverBulletDef.icon = bulletDefInfo.icon;
		driverBulletDef.trailColor = bulletDefInfo.trailColor;
		return driverBulletDef;
	}
}
[Serializable]
public struct DriverBulletDefInfo
{
	public string nameToken;

	public DamageType driverBulletType;

	public ModdedDamageType moddedDriverBulletType;

	public DriverWeaponTier tier;

	public Sprite icon;

	public Color trailColor;
}
[CreateAssetMenu(fileName = "wpn", menuName = "ScriptableObjects/WeaponDef", order = 1)]
public class DriverWeaponDef : ScriptableObject
{
	public enum AnimationSet
	{
		Default,
		TwoHanded,
		BigMelee
	}

	public enum BuffType
	{
		Crit,
		Damage,
		AttackSpeed
	}

	[Header("General")]
	public string nameToken = "";

	public string descriptionToken = "";

	public Texture icon = null;

	public GameObject crosshairPrefab = null;

	public DriverWeaponTier tier = DriverWeaponTier.Common;

	public int shotCount = 8;

	public BuffType buffType = BuffType.Damage;

	[Header("Skills")]
	public SkillDef primarySkillDef;

	public SkillDef secondarySkillDef;

	[Header("Visuals")]
	public Mesh mesh;

	public Material material;

	public AnimationSet animationSet = AnimationSet.Default;

	public string calloutSoundString = "";

	[Header("Other")]
	public string configIdentifier = "";

	public float dropChance = 0f;

	[HideInInspector]
	public ushort index;

	[HideInInspector]
	public GameObject pickupPrefab;

	public string equipAnimationString
	{
		get
		{
			if (animationSet == AnimationSet.Default)
			{
				return "EquipPistol";
			}
			return "BufferEmpty";
		}
	}

	public Color color => (Color)(tier switch
	{
		DriverWeaponTier.Common => Helpers.whiteItemColor, 
		DriverWeaponTier.Uncommon => Helpers.greenItemColor, 
		DriverWeaponTier.Legendary => Helpers.redItemColor, 
		DriverWeaponTier.Unique => Helpers.yellowItemColor, 
		DriverWeaponTier.Lunar => Helpers.lunarItemColor, 
		DriverWeaponTier.Void => Helpers.voidItemColor, 
		_ => Helpers.whiteItemColor, 
	});

	public static DriverWeaponDef CreateWeaponDefFromInfo(DriverWeaponDefInfo weaponDefInfo)
	{
		DriverWeaponDef driverWeaponDef = (DriverWeaponDef)(object)ScriptableObject.CreateInstance(typeof(DriverWeaponDef));
		((Object)driverWeaponDef).name = weaponDefInfo.nameToken;
		driverWeaponDef.nameToken = weaponDefInfo.nameToken;
		driverWeaponDef.descriptionToken = weaponDefInfo.descriptionToken;
		driverWeaponDef.icon = weaponDefInfo.icon;
		driverWeaponDef.crosshairPrefab = weaponDefInfo.crosshairPrefab;
		driverWeaponDef.tier = weaponDefInfo.tier;
		driverWeaponDef.shotCount = weaponDefInfo.shotCount;
		driverWeaponDef.buffType = weaponDefInfo.buffType;
		driverWeaponDef.primarySkillDef = weaponDefInfo.primarySkillDef;
		driverWeaponDef.secondarySkillDef = weaponDefInfo.secondarySkillDef;
		driverWeaponDef.mesh = weaponDefInfo.mesh;
		driverWeaponDef.material = weaponDefInfo.material;
		driverWeaponDef.animationSet = weaponDefInfo.animationSet;
		driverWeaponDef.calloutSoundString = weaponDefInfo.calloutSoundString;
		driverWeaponDef.configIdentifier = weaponDefInfo.configIdentifier;
		driverWeaponDef.dropChance = weaponDefInfo.dropChance;
		return driverWeaponDef;
	}
}
[Serializable]
public struct DriverWeaponDefInfo
{
	public string nameToken;

	public string descriptionToken;

	public Texture icon;

	public GameObject crosshairPrefab;

	public DriverWeaponTier tier;

	public int shotCount;

	public DriverWeaponDef.BuffType buffType;

	public SkillDef primarySkillDef;

	public SkillDef secondarySkillDef;

	public Mesh mesh;

	public Material material;

	public DriverWeaponDef.AnimationSet animationSet;

	public string calloutSoundString;

	public string configIdentifier;

	public float dropChance;
}
public enum DriverWeaponTier
{
	Common,
	Uncommon,
	Legendary,
	Unique,
	Void,
	Lunar
}
[CreateAssetMenu(fileName = "rsd", menuName = "ScriptableObjects/DriverWeaponSkinDef", order = 3)]
public class DriverWeaponSkinDef : ScriptableObject
{
	[Serializable]
	public struct DriverWeaponSkinDefInfo
	{
		public string nameToken;

		public string mainSkinName;

		public ushort weaponDefIndex;

		public Mesh weaponSkinMesh;

		public Material weaponSkinMaterial;
	}

	[Header("General")]
	public string nameToken = "";

	public string mainSkinName = "";

	public ushort weaponDefIndex;

	public Mesh weaponSkinMesh;

	public Material weaponSkinMaterial;

	public static DriverWeaponSkinDef CreateWeaponSkinDefFromInfo(DriverWeaponSkinDefInfo skinDefInfo)
	{
		DriverWeaponSkinDef driverWeaponSkinDef = (DriverWeaponSkinDef)(object)ScriptableObject.CreateInstance(typeof(DriverWeaponSkinDef));
		driverWeaponSkinDef.nameToken = skinDefInfo.nameToken;
		driverWeaponSkinDef.mainSkinName = skinDefInfo.mainSkinName;
		driverWeaponSkinDef.weaponDefIndex = skinDefInfo.weaponDefIndex;
		driverWeaponSkinDef.weaponSkinMesh = skinDefInfo.weaponSkinMesh;
		driverWeaponSkinDef.weaponSkinMaterial = skinDefInfo.weaponSkinMaterial;
		return driverWeaponSkinDef;
	}
}
internal class BodyInfo
{
	internal string bodyName = "";

	internal string bodyNameToken = "";

	internal string subtitleNameToken = "";

	internal Color bodyColor = Color.white;

	internal Texture characterPortrait = null;

	internal GameObject crosshair = null;

	internal GameObject podPrefab = null;

	internal float maxHealth = 100f;

	internal float healthGrowth = 2f;

	internal float healthRegen = 0f;

	internal float shield = 0f;

	internal float shieldGrowth = 0f;

	internal float moveSpeed = 7f;

	internal float moveSpeedGrowth = 0f;

	internal float acceleration = 80f;

	internal float jumpPower = 15f;

	internal float jumpPowerGrowth = 0f;

	internal float damage = 12f;

	internal float attackSpeed = 1f;

	internal float attackSpeedGrowth = 0f;

	internal float armor = 0f;

	internal float armorGrowth = 0f;

	internal float crit = 1f;

	internal float critGrowth = 0f;

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

	internal Material material;

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

	public string skillNameToken;

	public string skillDescriptionToken;

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

	public Sprite skillIcon;

	public SerializableEntityStateType activationState;

	public InterruptPriority interruptPriority;

	public string activationStateMachineName;

	public float baseRechargeInterval;

	public int baseMaxStock = 1;

	public int rechargeStock = 1;

	public int requiredStock = 1;

	public int stockToConsume = 1;

	public bool isCombatSkill = true;

	public bool canceledFromSprinting;

	public bool forceSprintDuringState;

	public bool cancelSprintingOnActivation = true;

	public bool beginSkillCooldownOnSkillEnd;

	public bool fullRestockOnAssign = true;

	public bool resetCooldownTimerOnUse;

	public bool mustKeyPress;

	public SkillDefInfo()
	{
	}

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

	public SkillDefInfo(string skillName, string skillNameToken, string skillDescriptionToken, Sprite skillIcon, SerializableEntityStateType activationState, string activationStateMachineName = "Weapon", bool agile = false)
	{
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		this.skillName = skillName;
		this.skillNameToken = skillNameToken;
		this.skillDescriptionToken = skillDescriptionToken;
		this.skillIcon = skillIcon;
		this.activationState = activationState;
		this.activationStateMachineName = activationStateMachineName;
		interruptPriority = (InterruptPriority)0;
		isCombatSkill = true;
		baseRechargeInterval = 0f;
		requiredStock = 0;
		stockToConsume = 0;
		cancelSprintingOnActivation = !agile;
		if (agile)
		{
			keywordTokens = new string[1] { "KEYWORD_AGILE" };
		}
	}
}
namespace RobDriver
{
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.rob.Driver", "Driver", "1.8.0")]
	[R2APISubmoduleDependency(new string[] { "PrefabAPI", "LanguageAPI", "SoundAPI", "DirectorAPI", "LoadoutAPI", "UnlockableAPI", "NetworkingAPI", "RecalculateStatsAPI" })]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class DriverPlugin : BaseUnityPlugin
	{
		public const string MODUID = "com.rob.Driver";

		public const string MODNAME = "Driver";

		public const string MODVERSION = "1.8.0";

		public const string developerPrefix = "ROB";

		public static DriverPlugin instance;

		public static bool starstormInstalled => Chainloader.PluginInfos.ContainsKey("com.TeamMoonstorm.Starstorm2");

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

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

		public static bool litInstalled => Chainloader.PluginInfos.ContainsKey("com.ContactLight.LostInTransit");

		public static bool classicItemsInstalled => Chainloader.PluginInfos.ContainsKey("com.RiskySleeps.ClassicItemsReturns");

		public static bool riskUIInstalled => Chainloader.PluginInfos.ContainsKey("bubbet.riskui");

		public static bool extendedLoadoutInstalled => Chainloader.PluginInfos.ContainsKey("com.KingEnderBrine.ExtendedLoadout");

		public static bool greenAlienHeadInstalled => Chainloader.PluginInfos.ContainsKey("com.Borbo.GreenAlienHead");

		public static bool ravagerInstalled => Chainloader.PluginInfos.ContainsKey("com.rob.Ravager");

		private void Awake()
		{
			instance = this;
			Config.myConfig = ((BaseUnityPlugin)this).Config;
			Log.Init(((BaseUnityPlugin)this).Logger);
			Config.ReadConfig();
			Assets.PopulateAssets();
			CameraParams.InitializeParams();
			States.RegisterStates();
			DamageTypes.Init();
			DriverBulletCatalog.Init();
			Buffs.RegisterBuffs();
			Projectiles.RegisterProjectiles();
			Tokens.AddTokens();
			ItemDisplays.PopulateDisplays();
			NetMessages.RegisterNetworkMessages();
			new Driver().CreateCharacter();
			NetworkingAPI.RegisterMessageType<SyncWeapon>();
			NetworkingAPI.RegisterMessageType<SyncOverlay>();
			NetworkingAPI.RegisterMessageType<SyncStoredWeapon>();
			NetworkingAPI.RegisterMessageType<SyncDecapitation>();
			Hook();
			new ContentPacks().Initialize();
			ContentManager.onContentPacksAssigned += LateSetup;
			CreateWeapons();
		}

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

		private void CreateWeapons()
		{
			new ArmBFG().Init();
			new CrabGun().Init();
			new LunarGrenade().Init();
			new ScavGun().Init();
			new ArtiGauntlet().Init();
			new BanditRevolver().Init();
			new CommandoSMG().Init();
			new Revolver().Init();
			new SMG().Init();
			new RavSword().Init();
			new NemSword().Init();
		}

		private void Hook()
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected O, but got Unknown
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			if (Config.dynamicCrosshairUniversal.Value)
			{
				CrosshairController.Awake += new hook_Awake(CrosshairController_Awake);
			}
			CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats);
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(Driver.LateSkinSetup));
		}

		private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self) && self.HasBuff(Buffs.woundDebuff))
			{
				self.armor -= 40f;
			}
			if (Object.op_Implicit((Object)(object)self) && self.HasBuff(Buffs.syringeDamageBuff))
			{
				self.damage += self.level * 2f;
			}
			if (Object.op_Implicit((Object)(object)self) && self.HasBuff(Buffs.syringeAttackSpeedBuff))
			{
				self.attackSpeed += 0.5f;
			}
			if (Object.op_Implicit((Object)(object)self) && self.HasBuff(Buffs.syringeCritBuff))
			{
				self.crit += 30f;
			}
			if (Object.op_Implicit((Object)(object)self) && self.HasBuff(Buffs.syringeNewBuff))
			{
				self.attackSpeed += 0.5f;
				self.regen += 5f;
			}
			if (Object.op_Implicit((Object)(object)self) && self.HasBuff(Buffs.syringeScepterBuff))
			{
				self.damage += self.level * 2.5f;
				self.attackSpeed += 0.75f;
				self.crit += 40f;
				self.regen += 10f;
			}
		}

		private void CrosshairController_Awake(orig_Awake orig, CrosshairController self)
		{
			orig.Invoke(self);
			if (!((Object)self).name.Contains("SprintCrosshair") && !Object.op_Implicit((Object)(object)((Component)self).GetComponent<DynamicCrosshair>()))
			{
				((Component)self).gameObject.AddComponent<DynamicCrosshair>();
			}
		}

		private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
		{
		}

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

		public static bool CheckIfBodyIsTerminal(CharacterBody body)
		{
			if (starstormInstalled)
			{
				return _CheckIfBodyIsTerminal(body);
			}
			return false;
		}

		public static bool _CheckIfBodyIsTerminal(CharacterBody body)
		{
			return body.HasBuff(Buffs.BuffTerminationReady);
		}
	}
	public static class DriverWeaponCatalog
	{
		public static Dictionary<string, DriverWeaponDef> weaponDrops = new Dictionary<string, DriverWeaponDef>();

		public static DriverWeaponDef[] weaponDefs = new DriverWeaponDef[0];

		internal static DriverWeaponDef Pistol;

		internal static DriverWeaponDef PyriteGun;

		internal static DriverWeaponDef GoldenGun;

		internal static DriverWeaponDef PrototypeRocketLauncher;

		internal static DriverWeaponDef ArmCannon;

		internal static DriverWeaponDef PlasmaCannon;

		internal static DriverWeaponDef Behemoth;

		internal static DriverWeaponDef BeetleShield;

		internal static DriverWeaponDef LunarPistol;

		internal static DriverWeaponDef VoidPistol;

		internal static DriverWeaponDef Needler;

		internal static DriverWeaponDef GolemRifle;

		internal static DriverWeaponDef LunarRifle;

		internal static DriverWeaponDef LunarHammer;

		internal static DriverWeaponDef NemmandoGun;

		internal static DriverWeaponDef NemmercGun;

		internal static DriverWeaponDef RavSword;

		public static void AddWeapon(DriverWeaponDef weaponDef)
		{
			Array.Resize(ref weaponDefs, weaponDefs.Length + 1);
			int num = weaponDefs.Length - 1;
			weaponDef.index = (ushort)num;
			weaponDefs[num] = weaponDef;
			weaponDef.index = (ushort)num;
			weaponDef.pickupPrefab = Assets.CreatePickupObject(weaponDef);
			if (!Object.op_Implicit((Object)(object)weaponDef.icon))
			{
				switch (weaponDef.tier)
				{
				case DriverWeaponTier.Common:
					weaponDef.icon = Assets.mainAssetBundle.LoadAsset<Texture>("texGenericWeaponGrey");
					break;
				case DriverWeaponTier.Uncommon:
					weaponDef.icon = Assets.mainAssetBundle.LoadAsset<Texture>("texGenericWeaponGreen");
					break;
				case DriverWeaponTier.Legendary:
					weaponDef.icon = Assets.mainAssetBundle.LoadAsset<Texture>("texGenericWeaponRed");
					break;
				case DriverWeaponTier.Unique:
					weaponDef.icon = Assets.mainAssetBundle.LoadAsset<Texture>("texGenericWeaponYellow");
					break;
				case DriverWeaponTier.Lunar:
					weaponDef.icon = Assets.mainAssetBundle.LoadAsset<Texture>("texGenericWeaponBlue");
					break;
				case DriverWeaponTier.Void:
					weaponDef.icon = Assets.mainAssetBundle.LoadAsset<Texture>("texGenericWeaponPurple");
					break;
				}
			}
			Config.InitWeaponConfig(weaponDef);
			Debug.Log((object)("Added " + weaponDef.nameToken + " to catalog with index: " + weaponDef.index));
		}

		public static void AddWeaponDrop(string bodyName, DriverWeaponDef weaponDef, bool autoComplete = true)
		{
			if (string.IsNullOrWhiteSpace(bodyName))
			{
				return;
			}
			if (autoComplete)
			{
				if (!bodyName.Contains("Body"))
				{
					bodyName += "Body";
				}
				if (!bodyName.Contains("(Clone)"))
				{
					bodyName += "(Clone)";
				}
			}
			if (!weaponDrops.ContainsKey(bodyName))
			{
				weaponDrops.Add(bodyName, weaponDef);
			}
		}

		public static bool IsWeaponPistol(DriverWeaponDef weaponDef)
		{
			return weaponDef.nameToken == Pistol.nameToken || weaponDef.nameToken == LunarPistol.nameToken || weaponDef.nameToken == VoidPistol.nameToken || weaponDef.nameToken == Needler.nameToken || weaponDef.nameToken == PyriteGun.nameToken;
		}

		public static DriverWeaponDef GetWeaponFromIndex(int index)
		{
			return weaponDefs.ElementAtOrDefault(index) ?? Pistol;
		}

		public static DriverWeaponDef GetRandomWeapon()
		{
			List<DriverWeaponDef> list = new List<DriverWeaponDef>();
			for (int i = 0; i < weaponDefs.Length; i++)
			{
				if (Config.GetWeaponConfigEnabled(weaponDefs[i]) && weaponDefs[i].shotCount > 0)
				{
					list.Add(weaponDefs[i]);
				}
			}
			if (list.Count <= 0)
			{
				return Pistol;
			}
			return list[Random.Range(0, list.Count)];
		}

		public static DriverWeaponDef GetRandomWeaponFromTier(DriverWeaponTier tier)
		{
			List<DriverWeaponDef> list = new List<DriverWeaponDef>();
			for (int i = 0; i < weaponDefs.Length; i++)
			{
				DriverWeaponDef driverWeaponDef = weaponDefs[i];
				if (!Object.op_Implicit((Object)(object)driverWeaponDef))
				{
					continue;
				}
				if (Config.uniqueDropsAreLegendary.Value && tier == DriverWeaponTier.Legendary)
				{
					if (driverWeaponDef.tier >= tier && Config.GetWeaponConfigEnabled(driverWeaponDef))
					{
						list.Add(driverWeaponDef);
					}
				}
				else if (driverWeaponDef.tier == tier && Config.GetWeaponConfigEnabled(driverWeaponDef))
				{
					list.Add(driverWeaponDef);
				}
			}
			if (list.Count <= 0)
			{
				return Pistol;
			}
			return list[Random.Range(0, list.Count)];
		}
	}
}
namespace RobDriver.SkillStates
{
	public class FuckMyAss : GenericCharacterDeath
	{
		public override bool shouldAutoDestroy => false;

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

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

		public override void FixedUpdate()
		{
			((GenericCharacterDeath)this).FixedUpdate();
			if (NetworkServer.active && ((EntityState)this).fixedAge > 4f)
			{
				EntityState.Destroy((Object)(object)((EntityState)this).gameObject);
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)7;
		}
	}
}
namespace RobDriver.SkillStates.Emote
{
	public class BaseEmote : BaseState
	{
		private CameraParamsOverrideHandle camOverrideHandle;

		private Animator animator;

		private ChildLocator childLocator;

		private float duration;

		private uint activePlayID;

		public LocalUser localUser;

		public override void OnEnter()
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			animator = ((EntityState)this).GetModelAnimator();
			childLocator = ((EntityState)this).GetModelChildLocator();
			FindLocalUser();
			((EntityState)this).characterBody.hideCrosshair = true;
			camOverrideHandle = CameraParams.OverrideCameraParams(((EntityState)this).cameraTargetParams, DriverCameraParams.EMOTE);
		}

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

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

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

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

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

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

		public override void FixedUpdate()
		{
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			bool flag = false;
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded)
			{
				flag = true;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank))
			{
				if (((EntityState)this).inputBank.skill1.down)
				{
					flag = true;
				}
				if (((EntityState)this).inputBank.skill2.down)
				{
					flag = true;
				}
				if (((EntityState)this).inputBank.skill3.down)
				{
					flag = true;
				}
				if (((EntityState)this).inputBank.skill4.down)
				{
					flag = true;
				}
				if (((EntityState)this).inputBank.moveVector != Vector3.zero)
				{
					flag = true;
				}
			}
			if (duration > 0f && ((EntityState)this).fixedAge >= duration)
			{
				flag = true;
			}
			if (flag && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override void OnExit()
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).OnExit();
			((EntityState)this).characterBody.hideCrosshair = false;
			((EntityState)this).PlayAnimation("FullBody, Override", "BufferEmpty");
			if (activePlayID != 0)
			{
				AkSoundEngine.StopPlayingID(activePlayID);
			}
			((EntityState)this).cameraTargetParams.RemoveParamsOverride(camOverrideHandle, 0.5f);
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)0;
		}
	}
	public class Dance : BaseEmote
	{
		public override void OnEnter()
		{
			base.OnEnter();
			if (((EntityState)this).characterBody.skinIndex == 1)
			{
				PlayEmote("Dance", "sfx_jacket_dance");
			}
			else if (((EntityState)this).characterBody.skinIndex == 2)
			{
				PlayEmote("Dance", "sfx_slugger_dance");
			}
			else
			{
				PlayEmote("Dance", "sfx_driver_dance");
			}
			((Component)((BaseState)this).FindModelChild("Boombox")).gameObject.SetActive(true);
		}

		public override void OnExit()
		{
			base.OnExit();
			((Component)((BaseState)this).FindModelChild("Boombox")).gameObject.SetActive(false);
		}
	}
	public class Rest : BaseEmote
	{
		public override void OnEnter()
		{
			base.OnEnter();
			PlayEmote("RestEmote", "", 1.5f);
		}
	}
	public class Taunt : BaseEmote
	{
		public override void OnEnter()
		{
			base.OnEnter();
			PlayEmote("Taunt", "", 1.5f);
			Util.PlaySound("sfx_driver_boom", ((EntityState)this).gameObject);
		}
	}
}
namespace RobDriver.SkillStates.Driver
{
	public class BaseDriverSkillState : BaseSkillState
	{
		protected DriverController iDrive;

		protected DriverWeaponDef cachedWeaponDef;

		protected virtual bool hideGun => false;

		protected virtual string prop => string.Empty;

		public virtual void AddRecoil2(float x1, float x2, float y1, float y2)
		{
			if (Config.enableRecoil.Value)
			{
				((BaseState)this).AddRecoil(x1, x2, y1, y2);
			}
		}

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			RefreshState();
			if (hideGun)
			{
				((Component)((EntityState)this).GetModelChildLocator().FindChild("PistolModel")).gameObject.SetActive(false);
			}
			if (prop != string.Empty)
			{
				((Component)((EntityState)this).GetModelChildLocator().FindChild(prop)).gameObject.SetActive(true);
			}
		}

		public void RefreshState()
		{
			if (!Object.op_Implicit((Object)(object)iDrive))
			{
				iDrive = ((EntityState)this).GetComponent<DriverController>();
			}
			if (Object.op_Implicit((Object)(object)iDrive))
			{
				cachedWeaponDef = iDrive.weaponDef;
			}
		}

		public override void OnExit()
		{
			((EntityState)this).OnExit();
			if (hideGun)
			{
				((Component)((EntityState)this).GetModelChildLocator().FindChild("PistolModel")).gameObject.SetActive(true);
			}
			if (prop != string.Empty)
			{
				((Component)((EntityState)this).GetModelChildLocator().FindChild(prop)).gameObject.SetActive(false);
			}
		}
	}
	public class Coin : BaseDriverSkillState
	{
		private float baseDuration = 0.5f;

		private float duration;

		public override void OnEnter()
		{
			RefreshState();
			base.OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			Util.PlaySound("sfx_driver_coin", ((EntityState)this).gameObject);
			((EntityState)this).PlayAnimation("LeftArm, Override", "FireShard");
			FireProjectile();
		}

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

		private void FireProjectile()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: 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_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)this).isAuthority)
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				aimRay = ModifyProjectileAimRay(aimRay);
				((Ray)(ref aimRay)).direction = Util.ApplySpread(((Ray)(ref aimRay)).direction, 0f, 0f, 1f, 1f, 0f, -10f);
				Vector3 direction = ((Ray)(ref aimRay)).direction;
				Vector3 val = direction;
				Vector3 velocity = ((EntityState)this).rigidbody.velocity;
				direction = val * Mathf.Clamp(((Vector3)(ref velocity)).magnitude, 1f, 20f);
				direction.y += Mathf.Max(((EntityState)this).rigidbody.velocity.y, 0f);
				ProjectileManager.instance.FireProjectile(Projectiles.coinProjectile, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(direction), ((EntityState)this).gameObject, 0f, 0f, false, (DamageColorIndex)0, (GameObject)null, -1f);
			}
		}

		protected virtual Ray ModifyProjectileAimRay(Ray aimRay)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//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 aimRay;
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0024: 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_0027: Unknown result type (might be due to invalid IL or missing references)
			if ((double)((EntityState)this).fixedAge < (double)duration * 0.5)
			{
				return (InterruptPriority)3;
			}
			return (InterruptPriority)1;
		}
	}
	public class Dash : BaseState
	{
		protected Vector3 slipVector = Vector3.zero;

		public float duration = 0.3f;

		public float speedCoefficient = 7f;

		private Vector3 cachedForward;

		public override void OnEnter()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			Vector3 val = ((((EntityState)this).inputBank.moveVector == Vector3.zero) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.moveVector);
			slipVector = ((Vector3)(ref val)).normalized;
			cachedForward = ((EntityState)this).characterDirection.forward;
			Animator modelAnimator = ((EntityState)this).GetModelAnimator();
			Vector3 val2 = (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? ((EntityState)this).characterDirection.forward : slipVector);
			Vector3 val3 = Vector3.Cross(Vector3.up, val2);
			float num = Vector3.Dot(slipVector, val2);
			float num2 = Vector3.Dot(slipVector, val3);
			modelAnimator.SetFloat("dashF", num);
			modelAnimator.SetFloat("dashR", num2);
			((EntityState)this).PlayCrossfade("FullBody, Override", "Dash", "Dash.playbackRate", duration * 1.5f, 0.05f);
			((EntityState)this).PlayAnimation("Gesture, Override", "BufferEmpty");
			Util.PlaySound("sfx_driver_dash", ((EntityState)this).gameObject);
			ApplyBuff();
			CreateDashEffect();
		}

		public virtual void ApplyBuff()
		{
		}

		public virtual void CreateDashEffect()
		{
		}

		public override void FixedUpdate()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			((EntityState)this).characterMotor.velocity = Vector3.zero;
			((EntityState)this).characterMotor.rootMotion = slipVector * (base.moveSpeedStat * speedCoefficient * Time.fixedDeltaTime) * Mathf.Cos(((EntityState)this).fixedAge / duration * (MathF.PI / 2f));
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				((EntityState)this).characterDirection.forward = cachedForward;
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new WaitForReload());
			}
		}

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

		public override void OnExit()
		{
			DampenVelocity();
			((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 Heal : BaseDriverSkillState
	{
		public float startupDelay = 0.65f;

		public float healPercentPerTick = 0.01f;

		public float tickStopwatch = 0.25f;

		private float stopwatch;

		private bool cancelling;

		protected override string prop => "MedkitModel";

		protected override bool hideGun => true;

		public override void OnEnter()
		{
			base.OnEnter();
			((EntityState)this).PlayCrossfade("FullBody, Override", "Heal", "Action.playbackRate", startupDelay, 0.1f);
		}

		public override void OnExit()
		{
			base.OnExit();
			((EntityState)this).PlayAnimation("FullBody, Override", "BufferEmpty");
		}

		public override void FixedUpdate()
		{
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			((BaseState)this).attackSpeedStat = ((EntityState)this).characterBody.attackSpeed;
			if (((EntityState)this).fixedAge >= startupDelay / ((BaseState)this).attackSpeedStat)
			{
				HandleHeal();
			}
			if (((EntityState)this).isAuthority)
			{
				if (!((BaseState)this).isGrounded)
				{
					cancelling = true;
				}
				if (((EntityState)this).healthComponent.health >= ((EntityState)this).healthComponent.fullHealth || (((ButtonState)(ref ((EntityState)this).inputBank.skill4)).justPressed && ((EntityState)this).fixedAge >= 0.1f))
				{
					cancelling = true;
				}
				if (((EntityState)this).inputBank.moveVector != Vector3.zero && ((EntityState)this).fixedAge >= 0.1f)
				{
					cancelling = true;
				}
				if (cancelling)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}
		}

		protected virtual void HandleHeal()
		{
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= tickStopwatch / ((BaseState)this).attackSpeedStat)
			{
				TryHeal();
			}
		}

		protected virtual void TryHeal()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			stopwatch = 0f;
			if (NetworkServer.active)
			{
				((EntityState)this).healthComponent.Heal(((EntityState)this).healthComponent.fullHealth * healPercentPerTick, default(ProcChainMask), true);
			}
		}
	}
	public class JammedGun : BaseDriverSkillState
	{
		public float duration = 5f;

		public override void OnEnter()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			base.OnEnter();
			((EntityState)this).PlayAnimation("Gesture, Override", "GunJammed", "Action.playbackRate", duration, 0f);
			EffectData val = new EffectData
			{
				origin = ((BaseState)this).FindModelChild("PistolMuzzle").position,
				rotation = Quaternion.identity
			};
			EffectManager.SpawnEffect(Assets.jammedEffectPrefab, val, false);
			Util.PlaySound("sfx_driver_gun_jammed", ((EntityState)this).gameObject);
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (Object.op_Implicit((Object)(object)iDrive) && iDrive.weaponDef.nameToken != cachedWeaponDef.nameToken)
			{
				((EntityState)this).PlayAnimation("Gesture, Override", "BufferEmpty");
				((EntityState)this).outer.SetNextStateToMain();
			}
			else if (((EntityState)this).fixedAge >= duration)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new WaitForReload());
			}
		}

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

		public LocalUser localUser;

		private DriverController iDrive;

		public override void OnEnter()
		{
			((GenericCharacterMain)this).OnEnter();
			if (!Object.op_Implicit((Object)(object)iDrive))
			{
				iDrive = ((EntityState)this).GetComponent<DriverController>();
			}
			animator = ((BaseCharacterMain)this).modelAnimator;
			FindLocalUser();
		}

		public override void FixedUpdate()
		{
			((GenericCharacterMain)this).FixedUpdate();
			if (Object.op_Implicit((Object)(object)animator))
			{
				bool flag = false;
				if (!((EntityState)this).characterBody.outOfDanger || !((EntityState)this).characterBody.outOfCombat)
				{
					flag = true;
				}
				animator.SetBool("inCombat", flag);
				if (((BaseState)this).isGrounded)
				{
					animator.SetFloat("airBlend", 0f);
				}
				else
				{
					animator.SetFloat("airBlend", 1f);
				}
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).characterMotor.isGrounded)
			{
				CheckEmote<Rest>(Config.restKey);
				CheckEmote<Taunt>(Config.tauntKey);
				CheckEmote<Dance>(Config.danceKey);
			}
		}

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

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

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

		public override void ProcessJump()
		{
			//IL_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_022a: Unknown result type (might be due to invalid IL or missing references)
			//IL_023b: Expected O, but got Unknown
			//IL_025e: 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_028c: Expected O, but got Unknown
			//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02be: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d3: Expected O, but got Unknown
			//IL_0303: Unknown result type (might be due to invalid IL or missing references)
			//IL_0315: Unknown result type (might be due to invalid IL or missing references)
			//IL_0343: Unknown result type (might be due to invalid IL or missing references)
			//IL_0348: Unknown result type (might be due to invalid IL or missing references)
			if (!((BaseCharacterMain)this).hasCharacterMotor)
			{
				return;
			}
			bool flag = false;
			bool flag2 = false;
			if (!base.jumpInputReceived || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody) || ((EntityState)this).characterMotor.jumpCount >= ((EntityState)this).characterBody.maxJumpCount)
			{
				return;
			}
			int itemCount = ((EntityState)this).characterBody.inventory.GetItemCount(Items.JumpBoost);
			float num = 1f;
			float num2 = 1f;
			if (((EntityState)this).characterMotor.jumpCount >= ((EntityState)this).characterBody.baseJumpCount)
			{
				iDrive.featherTimer = 0.1f;
				flag = true;
				num = 1.5f;
				num2 = 1.5f;
			}
			else if (itemCount > 0 && ((EntityState)this).characterBody.isSprinting)
			{
				float num3 = ((EntityState)this).characterBody.acceleration * ((EntityState)this).characterMotor.airControl;
				if (((EntityState)this).characterBody.moveSpeed > 0f && num3 > 0f)
				{
					flag2 = true;
					float num4 = Mathf.Sqrt(10f * (float)itemCount / num3);
					float num5 = ((EntityState)this).characterBody.moveSpeed / num3;
					num = (num4 + num5) / num5;
				}
			}
			GenericCharacterMain.ApplyJumpVelocity(((EntityState)this).characterMotor, ((EntityState)this).characterBody, num, num2, false);
			if (((BaseCharacterMain)this).hasModelAnimator)
			{
				int layerIndex = ((BaseCharacterMain)this).modelAnimator.GetLayerIndex("Body");
				if (layerIndex >= 0)
				{
					if (((EntityState)this).characterBody.isSprinting)
					{
						((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("SprintJump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex);
					}
					else if (flag)
					{
						((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("BonusJump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex);
					}
					else
					{
						((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("Jump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex);
					}
				}
			}
			if (flag)
			{
				EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/FeatherEffect"), new EffectData
				{
					origin = ((EntityState)this).characterBody.footPosition
				}, true);
			}
			else if (((EntityState)this).characterMotor.jumpCount > 0)
			{
				EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ImpactEffects/CharacterLandImpact"), new EffectData
				{
					origin = ((EntityState)this).characterBody.footPosition,
					scale = ((EntityState)this).characterBody.radius
				}, true);
			}
			if (flag2)
			{
				EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/BoostJumpEffect"), new EffectData
				{
					origin = ((EntityState)this).characterBody.footPosition,
					rotation = Util.QuaternionSafeLookRotation(((EntityState)this).characterMotor.velocity)
				}, true);
			}
			CharacterMotor characterMotor = ((EntityState)this).characterMotor;
			characterMotor.jumpCount++;
			if (Object.op_Implicit((Object)(object)animator))
			{
				float num6 = ((CharacterAnimatorWalkParamCalculator)(ref ((BaseCharacterMain)this).animatorWalkParamCalculator)).animatorWalkSpeed.y;
				float num7 = ((CharacterAnimatorWalkParamCalculator)(ref ((BaseCharacterMain)this).animatorWalkParamCalculator)).animatorWalkSpeed.x;
				if ((Mathf.Abs(num6) <= 0.45f && Mathf.Abs(num7) <= 0.45f) || ((EntityState)this).inputBank.moveVector == Vector3.zero)
				{
					num6 = 0f;
					num7 = 0f;
				}
				if (Mathf.Abs(num6) > Mathf.Abs(num7))
				{
					num6 = ((!(num6 > 0f)) ? (-1f) : 1f);
					num7 = 0f;
				}
				else if (Mathf.Abs(num6) < Mathf.Abs(num7))
				{
					num7 = ((!(num7 > 0f)) ? (-1f) : 1f);
					num6 = 0f;
				}
				animator.SetFloat("forwardSpeedCached", num7);
				animator.SetFloat("rightSpeedCached", num6);
			}
		}
	}
	public class ReloadPistol : BaseDriverSkillState
	{
		public float baseDuration = 1.2f;

		public string animString = "ReloadPistol";

		public CameraParamsOverrideHandle camParamsOverrideHandle;

		public bool aiming;

		private bool wasAiming;

		private float duration;

		private bool heheheha;

		public override void OnEnter()
		{
			base.OnEnter();
			if (iDrive.passive.isPistolOnly)
			{
				baseDuration *= 0.5f;
			}
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			((EntityState)this).GetModelAnimator().SetFloat("aimBlend", 1f);
			((EntityState)this).PlayCrossfade("Gesture, Override", animString, "Action.playbackRate", duration * 1.1f, 0.1f);
			Util.PlaySound("sfx_driver_reload_01", ((EntityState)this).gameObject);
			wasAiming = aiming;
			if (NetworkServer.active && aiming)
			{
				((EntityState)this).characterBody.AddBuff(Buffs.Slow50);
			}
		}

		public override void OnExit()
		{
			//IL_002f: 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_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			base.OnExit();
			if (((EntityState)this).fixedAge <= duration && ((CameraParamsOverrideHandle)(ref camParamsOverrideHandle)).isValid)
			{
				((EntityState)this).cameraTargetParams.RemoveParamsOverride(camParamsOverrideHandle, 0.2f);
			}
			if (((CameraParamsOverrideHandle)(ref camParamsOverrideHandle)).isValid && !aiming)
			{
				((EntityState)this).cameraTargetParams.RemoveParamsOverride(camParamsOverrideHandle, 0.2f);
			}
			if (NetworkServer.active && aiming)
			{
				((EntityState)this).characterBody.RemoveBuff(Buffs.Slow50);
			}
			if (((EntityState)this).inputBank.skill3.down && (Object)(object)((EntityState)this).skillLocator.utility.skillDef == (Object)(object)RobDriver.Modules.Survivors.Driver.skateboardSkillDef)
			{
				((EntityState)this).PlayCrossfade("Gesture, Override", "BufferEmpty", 0.1f);
			}
		}

		public override void FixedUpdate()
		{
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (aiming)
			{
				((EntityState)this).characterBody.isSprinting = false;
				((EntityState)this).characterBody.SetAimTimer(1f);
			}
			if (((EntityState)this).isAuthority && aiming && !((EntityState)this).inputBank.skill2.down)
			{
				aiming = false;
				if (((CameraParamsOverrideHandle)(ref camParamsOverrideHandle)).isValid)
				{
					((EntityState)this).cameraTargetParams.RemoveParamsOverride(camParamsOverrideHandle, 0.2f);
				}
				((EntityState)this).GetModelAnimator().SetFloat("aimBlend", 0f);
				if (NetworkServer.active)
				{
					((EntityState)this).characterBody.RemoveBuff(Buffs.Slow50);
				}
			}
			if (!aiming && wasAiming && ((EntityState)this).fixedAge >= 0.8f * duration && !heheheha)
			{
				heheheha = true;
				((EntityState)this).PlayCrossfade("Gesture, Override", "BufferEmpty", 0.25f);
			}
			if (((EntityState)this).fixedAge >= 0.75f * duration && iDrive.weaponTimer != iDrive.maxWeaponTimer)
			{
				iDrive.FinishReload();
			}
			if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration)
			{
				if (aiming)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new SteadyAim
					{
						skipAnim = true,
						camParamsOverrideHandle = camParamsOverrideHandle
					});
				}
				else
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			if (iDrive.weaponTimer > 0f)
			{
				return (InterruptPriority)0;
			}
			return (InterruptPriority)2;
		}
	}
	public class Shoot : BaseDriverSkillState
	{
		public static float damageCoefficient = 2.2f;

		public static float procCoefficient = 1f;

		public static float baseDuration = 0.7f;

		public static float force = 200f;

		public static float recoil = 2f;

		public static float range = 2000f;

		public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/TracerGoldGat");

		public static GameObject critTracerEffectPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/TracerCaptainShotgun");

		private float duration;

		private float fireTime;

		private float fireTime2;

		private bool hasFired;

		private bool hasFired2;

		private string muzzleString;

		private bool isCrit;

		private GameObject effectInstance;

		private uint spinPlayID;

		private bool oldShoot;

		protected virtual float _damageCoefficient => damageCoefficient;

		protected virtual GameObject tracerPrefab => isCrit ? critTracerEffectPrefab : tracerEffectPrefab;

		public virtual string shootSoundString => isCrit ? "sfx_driver_pistol_shoot_critical" : "sfx_driver_pistol_shoot";

		public virtual FalloffModel falloff => (FalloffModel)1;

		protected virtual float baseCritDuration => 0.9f;

		protected virtual float baseCritDuration2 => 1.4f;

		public override void OnEnter()
		{
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			base.OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			((EntityState)this).characterBody.isSprinting = false;
			oldShoot = Config.oldCritShot.Value;
			fireTime = 0.1f * duration;
			fireTime2 = 0.2f * duration;
			((EntityState)this).characterBody.SetAimTimer(2f);
			muzzleString = "PistolMuzzle";
			isCrit = ((BaseState)this).RollCrit();
			if (isCrit)
			{
				if (oldShoot)
				{
					duration = baseCritDuration / ((BaseState)this).attackSpeedStat;
					fireTime = 0.5f * duration;
					fireTime2 = 0.55f * duration;
					effectInstance = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/CommandoReloadFX.prefab").WaitForCompletion());
					effectInstance.transform.parent = ((BaseState)this).FindModelChild("Pistol");
					effectInstance.transform.localRotation = Quaternion.Euler(new Vector3(0f, 80f, 0f));
					effectInstance.transform.localPosition = Vector3.zero;
					spinPlayID = Util.PlaySound("sfx_driver_pistol_spin", ((EntityState)this).gameObject);
					((EntityState)this).PlayAnimation("Gesture, Override", "ShootCritical", "Shoot.playbackRate", duration, 0f);
				}
				else
				{
					duration = baseCritDuration2 / ((BaseState)this).attackSpeedStat;
					fireTime = 0f * duration;
					fireTime2 = 0.05f * duration;
					((EntityState)this).PlayAnimation("Gesture, Override", "ShootCriticalAlt", "Shoot.playbackRate", duration, 0f);
				}
			}
			else
			{
				hasFired = true;
				Fire();
				((EntityState)this).PlayAnimation("Gesture, Override", "Shoot", "Shoot.playbackRate", duration * 1.5f, 0f);
			}
			if (iDrive.maxWeaponTimer > 0f)
			{
				iDrive.ConsumeAmmo();
			}
		}

		public override void OnExit()
		{
			base.OnExit();
			if (spinPlayID != 0)
			{
				AkSoundEngine.StopPlayingID(spinPlayID);
			}
			if (Object.op_Implicit((Object)(object)effectInstance))
			{
				EntityState.Destroy((Object)(object)effectInstance);
			}
		}

		private void Fire()
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: 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_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: 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_01b5: Expected O, but got Unknown
			//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
			EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleString, false);
			Util.PlaySound(shootSoundString, ((EntityState)this).gameObject);
			if (((EntityState)this).isAuthority)
			{
				Ray aimRay = ((BaseState)this).GetAimRay();
				base.AddRecoil2(-1f * recoil, -2f * recoil, -0.5f * recoil, 0.5f * recoil);
				BulletAttack val = new BulletAttack
				{
					bulletCount = 1u,
					aimVector = ((Ray)(ref aimRay)).direction,
					origin = ((Ray)(ref aimRay)).origin,
					damage = _damageCoefficient * ((BaseState)this).damageStat,
					damageColorIndex = (DamageColorIndex)0,
					damageType = DamageTypeCombo.op_Implicit(iDrive.DamageType),
					falloffModel = falloff,
					maxDistance = range,
					force = force,
					hitMask = CommonMasks.bullet,
					minSpread = 0f,
					maxSpread = ((EntityState)this).characterBody.spreadBloomAngle * 2f,
					isCrit = isCrit,
					owner = ((EntityState)this).gameObject,
					muzzleName = muzzleString,
					smartCollision = true,
					procChainMask = default(ProcChainMask),
					procCoefficient = procCoefficient,
					radius = 0.75f,
					sniper = false,
					stopperMask = CommonMasks.bullet,
					weapon = null,
					tracerEffectPrefab = tracerPrefab,
					spreadPitchScale = 1f,
					spreadYawScale = 1f,
					queryTriggerInteraction = (QueryTriggerInteraction)0,
					hitEffectPrefab = FirePistol2.hitEffectPrefab
				};
				DamageAPI.AddModdedDamageType(val, iDrive.ModdedDamageType);
				val.Fire();
			}
			((EntityState)this).characterBody.AddSpreadBloom(1.25f);
		}

		public override void FixedUpdate()
		{
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0240: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (Object.op_Implicit((Object)(object)iDrive) && iDrive.weaponDef.nameToken != cachedWeaponDef.nameToken)
			{
				((EntityState)this).PlayAnimation("Gesture, Override", "BufferEmpty");
				((EntityState)this).outer.SetNextStateToMain();
				return;
			}
			if (((EntityState)this).fixedAge >= fireTime && ((EntityState)this).isAuthority && !hasFired)
			{
				hasFired = true;
				Fire();
			}
			if (isCrit && ((EntityState)this).fixedAge >= fireTime2 && ((EntityState)this).isAuthority && !hasFired2)
			{
				hasFired2 = true;
				Fire();
			}
			if (oldShoot)
			{
				if (Object.op_Implicit((Object)(object)effectInstance) && ((EntityState)this).fixedAge >= 0.4f * duration)
				{
					EntityState.Destroy((Object)(object)effectInstance);
					AkSoundEngine.StopPlayingID(spinPlayID);
					spinPlayID = 0u;
					Util.PlaySound("sfx_driver_pistol_ready", ((EntityState)this).gameObject);
				}
			}
			else if (isCrit && !Object.op_Implicit((Object)(object)effectInstance) && ((EntityState)this).fixedAge >= 0.55f * duration)
			{
				effectInstance = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/CommandoReloadFX.prefab").WaitForCompletion());
				effectInstance.transform.parent = ((BaseState)this).FindModelChild("Pistol");
				effectInstance.transform.localRotation = Quaternion.Euler(new Vector3(0f, 80f, 0f));
				effectInstance.transform.localPosition = Vector3.zero;
				spinPlayID = Util.PlaySound("sfx_driver_pistol_spin", ((EntityState)this).gameObject);
			}
			if (iDrive.weaponTimer <= 0f && iDrive.maxWeaponTimer > 0f && (int)((EntityState)this).GetMinimumInterruptPriority() == 0 && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new ReloadPistol());
			}
			else if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextState((EntityState)(object)new WaitForReload());
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			float num = 0.5f;
			if (isCrit && oldShoot)
			{
				num = 0.75f;
			}
			if (((EntityState)this).fixedAge >= num * duration)
			{
				return (InterruptPriority)0;
			}
			if (isCrit && !hasFired2)
			{
				return (InterruptPriority)2;
			}
			return (InterruptPriority)1;
		}
	}
	public class Slide : BaseDriverSkillState
	{
		private Vector3 forwardDirection;

		private GameObject slideEffectInstance;

		private bool startedStateGrounded;

		private Animator animator;

		private bool classicSound;

		public override void OnEnter()
		{
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: 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_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Expected O, but got Unknown
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
			base.OnEnter();
			animator = ((EntityState)this).GetModelAnimator();
			classicSound = Config.classicDodgeSound.Value;
			if (classicSound)
			{
				Util.PlaySound(SlideState.soundString, ((EntityState)this).gameObject);
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
			{
				CharacterDirection characterDirection = ((EntityState)this).characterDirection;
				Vector3 val = ((((EntityState)this).inputBank.moveVector == Vector3.zero) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.moveVector);
				characterDirection.forward = ((Vector3)(ref val)).normalized;
			}
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
			{
				startedStateGrounded = ((EntityState)this).characterMotor.isGrounded;
			}
			((EntityState)this).characterBody.SetSpreadBloom(0f, false);
			if (Object.op_Implicit((Object)(object)iDrive) && Object.op_Implicit((Object)(object)iDrive.weaponDef) && iDrive.weaponDef.animationSet == DriverWeaponDef.AnimationSet.TwoHanded)
			{
				animator.SetBool("holding", true);
				((EntityState)this).PlayAnimation("Gesture, Override", "HoldGun");
			}
			if (!startedStateGrounded)
			{
				if (!classicSound)
				{
					Util.PlaySound("sfx_driver_air_dodge", ((EntityState)this).gameObject);
				}
				EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ImpactEffects/CharacterLandImpact"), new EffectData
				{
					origin = ((EntityState)this).characterBody.footPosition,
					scale = ((EntityState)this).characterBody.radius
				}, true);
				((EntityState)this).PlayAnimation("FullBody, Override", "AirDodge");
				Vector3 velocity = ((EntityState)this).characterMotor.velocity;
				velocity.y = ((EntityState)this).characterBody.jumpPower;
				((EntityState)this).characterMotor.velocity = velocity;
			}
			else
			{
				if (!classicSound)
				{
					Util.PlaySound("sfx_driver_dodge", ((EntityState)this).gameObject);
				}
				((EntityState)this).PlayAnimation("FullBody, Override", "Slide", "Slide.playbackRate", SlideState.slideDuration, 0f);
				if (Object.op_Implicit((Object)(object)SlideState.slideEffectPrefab))
				{
					Transform val2 = ((BaseState)this).FindModelChild("Root");
					slideEffectInstance = Object.Instantiate<GameObject>(SlideState.slideEffectPrefab, val2);
				}
			}
		}

		public override void Update()
		{
			((EntityState)this).Update();
			if (Object.op_Implicit((Object)(object)animator))
			{
				animator.SetBool("isGrounded", ((BaseState)this).isGrounded);
			}
		}

		public override void FixedUpdate()
		{
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			if (Object.op_Implicit((Object)(object)animator))
			{
				animator.SetBool("isGrounded", ((BaseState)this).isGrounded);
			}
			if (!((BaseState)this).isGrounded && Object.op_Implicit((Object)(object)slideEffectInstance))
			{
				EntityState.Destroy((Object)(object)slideEffectInstance);
			}
			if (((EntityState)this).isAuthority)
			{
				float num = (startedStateGrounded ? SlideState.slideDuration : SlideState.jumpDuration);
				if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
				{
					((EntityState)this).characterDirection.moveVector = ((EntityState)this).inputBank.moveVector;
					forwardDirection = ((EntityState)this).characterDirection.forward;
				}
				if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor))
				{
					float num2 = ((!startedStateGrounded) ? SlideState.jumpforwardSpeedCoefficientCurve.Evaluate(((EntityState)this).fixedAge / num) : SlideState.forwardSpeedCoefficientCurve.Evaluate(((EntityState)this).fixedAge / num));
					CharacterMotor characterMotor = ((EntityState)this).characterMotor;
					characterMotor.rootMotion += num2 * ((BaseState)this).moveSpeedStat * forwardDirection * Time.fixedDeltaTime;
				}
				if (((EntityState)this).fixedAge >= num)
				{
					((EntityState)this).outer.SetNextStateToMain();
				}
			}
		}

		public override void OnExit()
		{
			PlayImpactAnimation();
			if (Object.op_Implicit((Object)(object)slideEffectInstance))
			{
				EntityState.Destroy((Object)(object)slideEffectInstance);
			}
			animator.SetBool("holding", false);
			base.OnExit();
		}

		private void PlayImpactAnimation()
		{
			Animator modelAnimator = ((EntityState)this).GetModelAnimator();
			int layerIndex = modelAnimator.GetLayerIndex("Impact");
			if (layerIndex >= 0)
			{
				modelAnimator.SetLayerWeight(layerIndex, 1f);
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (InterruptPriority)2;
		}
	}
	public class SteadyAim : BaseDriverSkillState
	{
		public float baseShotDuration = 0.3f;

		public float baseChargeDuration = 0.15f;

		public static float damageCoefficient = 5f;

		public static float recoil = 0.5f;

		protected bool lastCharge;

		public bool skipAnim = false;

		public CameraParamsOverrideHandle camParamsOverrideHandle;

		private OverlayController overlayController;

		private float shotCooldown;

		private float chargeTimer;

		private float chargeDuration;

		private bool isCharged;

		private bool isCrit;

		private int cachedShots;

		private float cachedShotTimer;

		private PrimarySkillShurikenBehavior shurikenComponent;

		private bool _autoFocus;

		private bool autoFocus;

		private bool cancelling;

		private bool adaptiveFocus;

		private bool reloading;

		private GameObject lightEffectInstance;

		private Animator animator;

		private bool jamFlag;

		protected virtual bool isPiercing => false;

		protected virtual float _damageCoefficient => damageCoefficient;

		protected virtual GameObject tracerPrefab
		{
			get
			{
				if (isCrit)
				{
					return Shoot.critTracerEffectPrefab;
				}
				return Shoot.tracerEffectPrefab;
			}
		}

		public override void OnEnter()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: 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)
			base.OnEnter();
			animator = ((EntityState)this).GetModelAnimator();
			if (!((CameraParamsOverrideHandle)(ref camParamsOverrideHandle)).isValid)
			{
				camParamsOverrideHandle = CameraParams.OverrideCameraParams(((EntityState)this).cameraTargetParams, DriverCameraParams.AIM_PISTOL);
			}
			((EntityState)this).PlayAnimation("AimPitch", "SteadyAimPitch");
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddBuff(Buffs.Slow50);
			}
			shurikenComponent = ((EntityState)this).GetComponent<PrimarySkillShurikenBehavior>();
			if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody.master) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.master.inventory))
			{
				((EntityState)this).characterBody.master.inventory.onInventoryChanged += Inventory_onInventoryChanged;
			}
			((EntityState)this).characterBody._defaultCrosshairPrefab = Assets.pistolAimCrosshairPrefab;
			_autoFocus = Config.autoFocus.Value;
			adaptiveFocus = Config.adaptiveFocus.Value;
			chargeDuration = baseChargeDuration / ((BaseState)this).attackSpeedStat;
			autoFocus = false;
			if (adaptiveFocus && chargeDuration <= 0.1f)
			{
				autoFocus = true;
			}
			if (_autoFocus)
			{
				autoFocus = true;
			}
			if (!skipAnim)
			{
				PlayAnim();
				Util.PlaySound("sfx_driver_aim_foley", ((EntityState)this).gameObject);
			}
			((Component)((BaseState)this).FindModelChild("PistolSight")).gameObject.SetActive(true);
			overlayController = HudOverlayManager.AddOverlay(((EntityState)this).gameObject, new OverlayCreationParams
			{
				prefab = Assets.headshotOverlay,
				childLocatorEntry = "ScopeContainer"
			});
			if (!Config.defaultPistolAnims.Value)
			{
				animator.SetLayerWeight(animator.GetLayerIndex("AltPistol, Override"), 1f);
			}
			else
			{
				animator.SetLayerWeight(animator.GetLayerIndex("AltPistol, Override"), 0f);
			}
			lightEffectInstance = Object.Instantiate<GameObject>(Assets.mainAssetBundle.LoadAsset<GameObject>("GunLight"));
		}

		protected virtual void PlayAnim()
		{
			((EntityState)this).PlayAnimation("Gesture, Override", "SteadyAim", "Action.playbackRate", 0.25f, 0f);
		}

		protected virtual void PlayExitAnim()
		{
			((EntityState)this).PlayAnimation("Gesture, Override", "SteadyAimEnd", "Action.playbackRate", 0.2f, 0f);
		}

		private void Inventory_onInventoryChanged()
		{
			shurikenComponent = ((EntityState)this).GetComponent<PrimarySkillShurikenBehavior>();
		}

		private void UpdateLightEffect()
		{
			//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)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			Ray aimRay = ((BaseState)this).GetAimRay();
			RaycastHit val = default(RaycastHit);
			if (Physics.Raycast(((Ray)(ref aimRay)).origin, ((Ray)(ref aimRay)).direction, ref val, Shoot.range, LayerMask.op_Implicit(CommonMasks.bullet)))
			{
				lightEffectInstance.SetActive(true);
				lightEffectInstance.transform.position = ((RaycastHit)(ref val)).point + ((Ray)(ref aimRay)).direction * -0.3f;
			}
			else
			{
				lightEffectInstance.SetActive(false);
			}
		}

		public override void FixedUpdate()
		{
			//IL_0276: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			chargeDuration = baseChargeDuration / ((BaseState)this).attackSpeedStat;
			autoFocus = false;
			if (adaptiveFocus && chargeDuration <= 0.1f)
			{
				autoFocus = true;
			}
			if (_autoFocus)
			{
				autoFocus = true;
			}
			shotCooldown -= Time.fixedDeltaTime;
			cachedShotTimer -= Time.fixedDeltaTime;
			((EntityState)this).characterBody.outOfCombatStopwatch = 0f;
			((EntityState)this).characterBody.isSprinting = false;
			((EntityState)this).characterBody.SetAimTimer(0.2f);
			((BaseState)this).attackSpeedStat = ((EntityState)this).characterBody.attackSpeed;
			((BaseState)this).damageStat = ((EntityState)this).characterBody.damage;
			((BaseState)this).critStat = ((EntityState)this).characterBody.crit;
			UpdateLightEffect();
			if (Object.op_Implicit((Object)(object)iDrive) && iDrive.weaponDef.nameToken != cachedWeaponDef.nameToken)
			{
				cancelling = true;
				((EntityState)this).outer.SetNextStateToMain();
				return;
			}
			if (reloading && shotCooldown <= 0f)
			{
				reloading = false;
				iDrive.FinishReload();
			}
			if (((EntityState)this).skillLocator.secondary.stock < 1)
			{
				isCharged = false;
				chargeTimer = 0f;
			}
			else if (shotCooldown <= 0f)
			{
				chargeTimer += Time.fixedDeltaTime;
			}
			if (!isCharged && chargeTimer >= chargeDuration)
			{
				isCharged = true;
				Util.PlaySound("sfx_driver_pistol_ready", ((EntityState)this).gameObject);
			}
			if (iDrive.weaponTimer <= 0f && iDrive.maxWeaponTimer > 0f)
			{
				if (shotCooldown <= 0f && ((EntityState)this).inputBank.skill1.down && ((EntityState)this).isAuthority)
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new ReloadPistol
					{
						animString = "SteadyAimReload",
						camParamsOverrideHandle = camParamsOverrideHandle,
						aiming = true
					});
					reloading = true;
				}
			}
			else if (shotCooldown <= 0f)
			{
				if (autoFocus)
				{
					if (((EntityState)this).inputBank.skill1.down)
					{
						if (((EntityState)this).skillLocator.secondary.stock > 0)
						{
							if (isCharged)
							{
								isCrit = ((BaseState)this).RollCrit();
								Fire();
							}
						}
						else
						{
							isCrit = ((BaseState)this).RollCrit();
							Fire();
						}
					}
				}
				else if (((EntityState)this).inputBank.skill1.down)
				{
					isCrit = ((BaseState)this).RollCrit();
					Fire();
				}
			}
			if (cachedShots > 0 && ((EntityState)this).isAuthority && cachedShotTimer <= 0f)
			{
				Fire2(cachedShots);
				cachedShots = 0;
			}
			if (!((EntityState)this).inputBank.skill2.down && ((EntityState)this).isAuthority && !reloading)
			{
				if (jamFlag && shotCooldown > 0f && Object.op_Implicit((Object)(object)iDrive) && iDrive.AddJamBuildup())
				{
					((EntityState)this).outer.SetNextState((EntityState)(object)new JammedGun());
					return;
				}
				((EntityState)this).outer.SetNextState((EntityState)(object)new WaitForReload());
			}
			if (Object.op_Implicit((Object)(object)iDrive))
			{
				if (((EntityState)this).skillLocator.secondary.stock < 1)
				{
					iDrive.chargeValue = 0f;
					return;
				}
				float chargeValue = Util.Remap(chargeTimer, 0f, chargeDuration, 0f, 1f);
				iDrive.chargeValue = chargeValue;
			}
		}

		protected virtual void PlayShootAnim(bool wasCharged, bool wasCrit, float speed)
		{
			string text = "SteadyAimFire";
			if (wasCharged)
			{
				text = ((!wasCrit) ? "SteadyAimFireCharged" : "SteadyAimFireChargedCritical");
			}
			else if (wasCrit)
			{
				text = "SteadyAimFireCritical";
			}
			((EntityState)this).PlayAnimation("Gesture, Override", text, "Action.playbackRate", speed, 0f);
		}

		protected virtual string GetSoundString(bool crit, bool charged)
		{
			string result = "sfx_driver_pistol_shoot";
			if (crit)
			{
				result = "sfx_driver_pistol_shoot_critical";
			}
			if (charged)
			{
				result = "sfx_driver_pistol_shoot_charged";
			}
			return result;
		}

		public virtual void Fire()
		{
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: 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)
			//IL_0354: Unknown result type (might be due to invalid IL or missing references)
			//IL_0359: Unknown result type (might be due to invalid IL or missing references)
			//IL_0360: Unknown result type (might be due to invalid IL or missing references)
			//IL_0363: Unknown result type (might be due to invalid IL or missing references)
			//IL_036e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0371: Unknown result type (might be due to invalid IL or missing references)
			//IL_0376: Unknown result type (might be due to invalid IL or missing references)
			//IL_037b: Unknown result type (might be due to invalid IL or missing references)
			//IL_038a: Unknown result type (might be due to invalid IL or missing references)
			//IL_038c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0391: Unknown result type (might be due to invalid IL or missing references)
			//IL_0398: Unknown result type (might be due to invalid IL or missing references)
			//IL_039d: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_03af: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_040a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0411: Unknown result type (might be due to invalid IL or missing references)
			//IL_0417: Unknown result type (might be due to invalid IL or missing references)
			//IL_041d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0428: Unknown result type (might be due to invalid IL or missing references)
			//IL_0433: Unknown result type (might be due to invalid IL or missing references)
			//IL_043a: Unknown result type (might be due to invalid IL or missing references)
			//IL_043b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0440: Unknown result type (might be due to invalid IL or missing references)
			//IL_0445: Unknown result type (might be due to invalid IL or missing references)
			//IL_044c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0458: Unknown result type (might be due to invalid IL or missing references)
			//IL_0463: Unknown result type (might be due to invalid IL or missing references)
			//IL_046e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0470: Unknown result type (might be due to invalid IL or missing references)
			//IL_0475: Unknown result type (might be due to invalid IL or missing references)
			//IL_0482: Expected O, but got Unknown
			//IL_048a: Unknown result type (might be due to invalid IL or missing references)
			//IL_049e: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a8: Expected O, but got Unknown
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: 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_0252: Unknown result type (might be due to invalid IL or missing references)
			//IL_0253: 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_0266: Unknown result type (might be due to invalid IL or missing references)
			//IL_0271: Unknown result type (might be due to invalid IL or missing references)
			//IL_0272: Unknown result type (might be due to invalid IL or missing references)
			//IL_0277: 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_0287: Unknown result type (might be due to invalid IL or missing references)
			//IL_0292: Unknown result type (might be due to invalid IL or missing references)
			//IL_029e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02de: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0308: Unknown result type (might be due to invalid IL or missing references)
			//IL_0313: Unknown result type (might be due to invalid IL or missing references)
			//IL_031e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0320: Unknown result type (might be due to invalid IL or missing references)
			//IL_0325: Unknown result type (might be due to invalid IL or missing references)
			//IL_0332: Expected O, but got Unknown
			//IL_033a: Unknown result type (might be due to invalid IL or missing references)
			if (iDrive.maxWeaponTimer > 0f)
			{
				iDrive.ConsumeAmmo(1f, scaleWithAttackSpeed: false);
			}
			if (Object.op_Implicit((Object)(object)shurikenComponent))
			{
				shurikenComponent.OnSkillActivated(((EntityState)this).skillLocator.primary);
			}
			if (((EntityState)this).fixedAge <= 0.25f)
			{
				jamFlag = true;
			}
			bool wasCharged = isCharged;
			shotCooldown = baseShotDuration / ((BaseState)this).attackSpeedStat;
			chargeTimer = 0f;
			isCharged = false;
			EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, "PistolMuzzle", false);
			if (isCrit)
			{
				cachedShots++;
				cachedShotTimer = 0.05f;
			}
			if (wasCharged)
			{
				((EntityState)this).characterBody.AddSpreadBloom(1.5f);
			}
			else
			{
				((EntityState)this).characterBody.AddSpreadBloom(0.35f);
			}
			Util.PlaySound(GetSoundString(isCrit, wasCharged), ((EntityState)this).gameObject);
			PlayShootAnim(wasCharged, isCrit, shotCooldown * 1.5f);
			if (!((EntityState)this).isAuthority)
			{
				return;
			}
			Ray aimRay = ((BaseState)this).GetAimRay();
			base.AddRecoil2(-1f * recoil, -2f * recoil, -0.5f * recoil, 0.5f * recoil);
			float num = Shoot.damageCoefficient;
			if (wasCharged)
			{
				num = _damageCoefficient;
				((EntityState)this).skillLocator.secondary.DeductStock(1);
			}
			lastCharge = wasCharged;
			FalloffModel falloffModel = (FalloffModel)1;
			if (lastCharge)
			{
				falloffModel = (FalloffModel)0;
			}
			if (isPiercing)
			{
				BulletAttack val = new BulletAttack
				{
					bulletCount = 1u,
					aimVector = ((Ray)(ref aimRay)).direction,
					origin = ((Ray)(ref aimRay)).origin,
					damage = num * ((BaseState)this).damageStat,
					damageColorIndex = (DamageColorIndex)0,
					damageType = DamageTypeCombo.op_Implicit(iDrive.DamageType),
					falloffModel = falloffModel,
					maxDistance = Shoot.range,
					force = Shoot.force,
					hitMask = CommonMasks.bullet,
					minSpread = 0f,
					maxSpread = 0f,
					isCrit = isCrit,
					owner = ((EntityState)this).gameObject,
					muzzleName = "PistolMuzzle",
					smartCollision = true,
					procChainMask = default(ProcChainMask),
					procCoefficient = Shoot.procCoefficient,
					radius = 1f,