Decompiled source of Driver v2.4.4

DriverMod.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
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.Captain.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 Grumpy;
using HG;
using HG.BlendableTypes;
using HG.Reflection;
using HunkHud.Components.UI;
using HunkMod.Modules;
using HunkMod.Modules.Components;
using KinematicCharacterController;
using LostInTransit;
using MaterialHud;
using Microsoft.CodeAnalysis;
using On.EntityStates.AI;
using On.EntityStates.GlobalSkills.LunarDetonator;
using On.EntityStates.GlobalSkills.LunarNeedle;
using On.RoR2;
using On.RoR2.Skills;
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.AddressableAssets;
using RoR2.Audio;
using RoR2.CharacterAI;
using RoR2.ContentManagement;
using RoR2.HudOverlay;
using RoR2.Navigation;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.Stats;
using RoR2.UI;
using RoR2BepInExPack.GameAssetPathsBetter;
using RobDriver.Modules;
using RobDriver.Modules.Achievements;
using RobDriver.Modules.Components;
using RobDriver.Modules.Components.UI;
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.CaptainGun;
using RobDriver.SkillStates.Driver.FalsePistol;
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.NemmandoGun;
using RobDriver.SkillStates.Driver.NemmandoSword;
using RobDriver.SkillStates.Driver.NemmercGun;
using RobDriver.SkillStates.Driver.PlasmaCannon;
using RobDriver.SkillStates.Driver.PyriteGun;
using RobDriver.SkillStates.Driver.RavSword;
using RobDriver.SkillStates.Driver.Revolver;
using RobDriver.SkillStates.Driver.RiotShotgun;
using RobDriver.SkillStates.Driver.RocketLauncher;
using RobDriver.SkillStates.Driver.SMG;
using RobDriver.SkillStates.Driver.Scepter;
using RobDriver.SkillStates.Driver.Scepter.SupplyDrop;
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.VoidPistol;
using RobDriver.SkillStates.Driver.VoidRifle;
using RobDriver.SkillStates.Emote;
using SS2;
using TMPro;
using Unity.Collections;
using Unity.Jobs;
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.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: CompilationRelaxations(8)]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyProduct("DriverMod")]
[assembly: AssemblyTitle("DriverMod")]
[assembly: OptIn]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+e76b7a5d4e3783ba365461e2d410c8debbbd8269")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[CompilerGenerated]
internal sealed class <>z__ReadOnlyArray<T> : IEnumerable, ICollection, IList, IEnumerable<T>, IReadOnlyCollection<T>, IReadOnlyList<T>, ICollection<T>, IList<T>
{
	int ICollection.Count => _items.Length;

	bool ICollection.IsSynchronized => false;

	object ICollection.SyncRoot => this;

	object IList.this[int index]
	{
		get
		{
			return _items[index];
		}
		set
		{
			throw new NotSupportedException();
		}
	}

	bool IList.IsFixedSize => true;

	bool IList.IsReadOnly => true;

	int IReadOnlyCollection<T>.Count => _items.Length;

	T IReadOnlyList<T>.this[int index] => _items[index];

	int ICollection<T>.Count => _items.Length;

	bool ICollection<T>.IsReadOnly => true;

	T IList<T>.this[int index]
	{
		get
		{
			return _items[index];
		}
		set
		{
			throw new NotSupportedException();
		}
	}

	public <>z__ReadOnlyArray(T[] items)
	{
		_items = items;
	}

	IEnumerator IEnumerable.GetEnumerator()
	{
		return ((IEnumerable)_items).GetEnumerator();
	}

	void ICollection.CopyTo(Array array, int index)
	{
		((ICollection)_items).CopyTo(array, index);
	}

	int IList.Add(object value)
	{
		throw new NotSupportedException();
	}

	void IList.Clear()
	{
		throw new NotSupportedException();
	}

	bool IList.Contains(object value)
	{
		return ((IList)_items).Contains(value);
	}

	int IList.IndexOf(object value)
	{
		return ((IList)_items).IndexOf(value);
	}

	void IList.Insert(int index, object value)
	{
		throw new NotSupportedException();
	}

	void IList.Remove(object value)
	{
		throw new NotSupportedException();
	}

	void IList.RemoveAt(int index)
	{
		throw new NotSupportedException();
	}

	IEnumerator<T> IEnumerable<T>.GetEnumerator()
	{
		return ((IEnumerable<T>)_items).GetEnumerator();
	}

	void ICollection<T>.Add(T item)
	{
		throw new NotSupportedException();
	}

	void ICollection<T>.Clear()
	{
		throw new NotSupportedException();
	}

	bool ICollection<T>.Contains(T item)
	{
		return ((ICollection<T>)_items).Contains(item);
	}

	void ICollection<T>.CopyTo(T[] array, int arrayIndex)
	{
		((ICollection<T>)_items).CopyTo(array, arrayIndex);
	}

	bool ICollection<T>.Remove(T item)
	{
		throw new NotSupportedException();
	}

	int IList<T>.IndexOf(T item)
	{
		return ((IList<T>)_items).IndexOf(item);
	}

	void IList<T>.Insert(int index, T item)
	{
		throw new NotSupportedException();
	}

	void IList<T>.RemoveAt(int index)
	{
		throw new NotSupportedException();
	}
}
namespace Microsoft.CodeAnalysis
{
	[Embedded]
	[CompilerGenerated]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	[CompilerGenerated]
	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_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		((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 bulletName = "";

	public string bulletNameToken = "";

	public string description = "";

	public string descriptionToken = "";

	[Header("Visuals")]
	public DriverWeaponTier tier = DriverWeaponTier.Common;

	public Color trailColor = Color.black;

	public DamageTypeCombo damageType = DamageTypeCombo.GenericPrimary;

	[HideInInspector]
	public ushort index;

	[HideInInspector]
	public bool enabled;

	public static DriverBulletDef CreateBulletDefFromInfo(DriverBulletDefInfo bulletDefInfo)
	{
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		DriverBulletDef driverBulletDef = ScriptableObject.CreateInstance<DriverBulletDef>();
		((Object)driverBulletDef).name = bulletDefInfo.bulletName;
		driverBulletDef.bulletName = bulletDefInfo.bulletName;
		driverBulletDef.bulletNameToken = bulletDefInfo.bulletNameToken;
		driverBulletDef.description = bulletDefInfo.description;
		driverBulletDef.descriptionToken = bulletDefInfo.descriptionToken;
		driverBulletDef.tier = bulletDefInfo.tier;
		driverBulletDef.trailColor = bulletDefInfo.trailColor;
		driverBulletDef.damageType.damageType = bulletDefInfo.damageType.GetValueOrDefault();
		driverBulletDef.damageType.damageTypeExtended = bulletDefInfo.damageTypeExtended.GetValueOrDefault();
		return driverBulletDef;
	}
}
[Serializable]
public struct DriverBulletDefInfo
{
	public string bulletName;

	public string bulletNameToken;

	public string description;

	public string descriptionToken;

	public DriverWeaponTier tier;

	public Color trailColor;

	public DamageType? damageType;

	public DamageTypeExtended? damageTypeExtended;

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

	public enum BuffType
	{
		Crit,
		Damage,
		AttackSpeed
	}

	[Serializable]
	public struct ModelSwapInfo
	{
		public Mesh mesh;

		public Material material;

		public string childName;
	}

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

	public string nameToken = "";

	public string description = "";

	public string descriptionToken = "";

	public Sprite icon;

	public DriverWeaponTier tier = DriverWeaponTier.Common;

	public AnimationSet animationSet;

	public BuffType buffType = BuffType.Damage;

	public int shotCount = 8;

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

	public SkillDef secondarySkillDef;

	public SkillDef arsenalSkillDef;

	public UnlockableDef unlockableDef;

	[Header("Visuals")]
	public ModelSwapInfo[] modelSwapInfo = new ModelSwapInfo[1]
	{
		new ModelSwapInfo
		{
			childName = "PistolModel"
		}
	};

	public GameObject crosshairPrefab;

	public GameObject pickupPrefabOverride;

	public Color? colorOverride;

	public bool disableHolster;

	[Header("Other")]
	public string equipAnimationString = "BufferEmpty";

	public string reloadAnimationString = "ReloadPistol";

	public string calloutSoundString = "sfx_driver_callout_generic";

	public string dropBodyName = "";

	public float dropChance;

	[HideInInspector]
	public ushort index;

	[HideInInspector]
	public bool enabled;

	public Mesh mesh
	{
		get
		{
			return modelSwapInfo[0].mesh;
		}
		set
		{
			modelSwapInfo[0].mesh = value;
		}
	}

	public Material material
	{
		get
		{
			return modelSwapInfo[0].material;
		}
		set
		{
			modelSwapInfo[0].material = value;
		}
	}

	public Color color => (Color)(((??)colorOverride) ?? Helpers.GetColorForTier(tier));

	public GameObject pickupPrefab => pickupPrefabOverride ?? Helpers.GetPickupPrefabForTier(tier);

	public static DriverWeaponDef CreateWeaponDefFromInfo(DriverWeaponDefInfo weaponDefInfo)
	{
		DriverWeaponDef driverWeaponDef = ScriptableObject.CreateInstance<DriverWeaponDef>();
		((Object)driverWeaponDef).name = weaponDefInfo.name;
		driverWeaponDef.weaponName = weaponDefInfo.name;
		driverWeaponDef.nameToken = weaponDefInfo.nameToken;
		driverWeaponDef.description = weaponDefInfo.description;
		driverWeaponDef.descriptionToken = weaponDefInfo.descriptionToken;
		driverWeaponDef.icon = weaponDefInfo.icon;
		driverWeaponDef.tier = weaponDefInfo.tier;
		driverWeaponDef.animationSet = weaponDefInfo.animationSet;
		driverWeaponDef.buffType = weaponDefInfo.buffType;
		driverWeaponDef.shotCount = weaponDefInfo.shotCount;
		driverWeaponDef.primarySkillDef = weaponDefInfo.primarySkillDef;
		driverWeaponDef.secondarySkillDef = weaponDefInfo.secondarySkillDef;
		driverWeaponDef.arsenalSkillDef = weaponDefInfo.arsenalSkillDef;
		driverWeaponDef.unlockableDef = weaponDefInfo.unlockableDef;
		driverWeaponDef.mesh = weaponDefInfo.mesh;
		driverWeaponDef.material = weaponDefInfo.material;
		driverWeaponDef.crosshairPrefab = weaponDefInfo.crosshairPrefab;
		driverWeaponDef.pickupPrefabOverride = weaponDefInfo.pickupPrefabOverride;
		driverWeaponDef.colorOverride = weaponDefInfo.colorOveride;
		driverWeaponDef.disableHolster = weaponDefInfo.disableHolster;
		driverWeaponDef.equipAnimationString = weaponDefInfo.equipAnimationString;
		driverWeaponDef.reloadAnimationString = weaponDefInfo.reloadAnimationString;
		driverWeaponDef.calloutSoundString = weaponDefInfo.calloutSoundString;
		driverWeaponDef.dropBodyName = weaponDefInfo.dropBodyName;
		driverWeaponDef.dropChance = weaponDefInfo.dropChance;
		return driverWeaponDef;
	}
}
[Serializable]
public struct DriverWeaponDefInfo
{
	public string name;

	public string nameToken;

	public string description;

	public string descriptionToken;

	public Sprite icon;

	public DriverWeaponTier tier;

	public DriverWeaponDef.AnimationSet animationSet;

	public DriverWeaponDef.BuffType buffType;

	public int shotCount;

	public SkillDef primarySkillDef;

	public SkillDef secondarySkillDef;

	public SkillDef arsenalSkillDef;

	public UnlockableDef unlockableDef;

	public Mesh mesh;

	public Material material;

	public GameObject crosshairPrefab;

	public GameObject pickupPrefabOverride;

	public Color? colorOveride;

	public bool disableHolster;

	public string equipAnimationString;

	public string reloadAnimationString;

	public string calloutSoundString;

	public string dropBodyName;

	public float dropChance;
}
public enum DriverWeaponTier
{
	NoTier,
	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 DriverWeaponDef.ModelSwapInfo[] modelSwapInfo;
	}

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

	public string mainSkinName = "";

	public ushort weaponDefIndex;

	public DriverWeaponDef.ModelSwapInfo[] modelSwapInfo;

	public Mesh mesh
	{
		get
		{
			return modelSwapInfo[0].mesh;
		}
		set
		{
			modelSwapInfo[0].mesh = value;
		}
	}

	public Material material
	{
		get
		{
			return modelSwapInfo[0].material;
		}
		set
		{
			modelSwapInfo[0].material = value;
		}
	}

	public static DriverWeaponSkinDef CreateWeaponSkinDefFromInfo(DriverWeaponSkinDefInfo skinDefInfo)
	{
		DriverWeaponSkinDef driverWeaponSkinDef = ScriptableObject.CreateInstance<DriverWeaponSkinDef>();
		driverWeaponSkinDef.nameToken = skinDefInfo.nameToken;
		driverWeaponSkinDef.mainSkinName = skinDefInfo.mainSkinName;
		driverWeaponSkinDef.weaponDefIndex = skinDefInfo.weaponDefIndex;
		driverWeaponSkinDef.modelSwapInfo = skinDefInfo.modelSwapInfo;
		return driverWeaponSkinDef;
	}
}
internal class BodyInfo
{
	internal string bodyName = "";

	internal string bodyNameToken = "";

	internal string subtitleNameToken = "";

	internal Color bodyColor = Color.white;

	internal Texture characterPortrait;

	internal GameObject crosshair;

	internal GameObject podPrefab;

	internal float maxHealth = 100f;

	internal float healthGrowth = 2f;

	internal float healthRegen;

	internal float shield;

	internal float shieldGrowth;

	internal float moveSpeed = 7f;

	internal float moveSpeedGrowth;

	internal float acceleration = 80f;

	internal float jumpPower = 15f;

	internal float jumpPowerGrowth;

	internal float damage = 12f;

	internal float attackSpeed = 1f;

	internal float attackSpeedGrowth;

	internal float armor;

	internal float armorGrowth;

	internal float crit = 1f;

	internal float critGrowth;

	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 = Array.Empty<string>();

	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 bool autoHandleLuminousShot = true;

	public SkillDefInfo()
	{
	}

	public SkillDefInfo(string skillName, string skillNameToken, string skillDescriptionToken, Sprite skillIcon, SerializableEntityStateType activationState, string activationStateMachineName, InterruptPriority interruptPriority, bool isCombatSkill, float baseRechargeInterval)
	{
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_0077: 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)
		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_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: 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
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.rob.Driver", "Driver", "2.4.4")]
	[NetworkCompatibility(/*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.*/)]
	[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 = "2.4.4";

		public const string developerPrefix = "ROB";

		public static DriverPlugin instance;

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

		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");

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

		public static bool HunkHudInstalled => Chainloader.PluginInfos.ContainsKey("com.public_ParticleSystem.HunkHud");

		public static bool CleanerHudInstalled => Chainloader.PluginInfos.ContainsKey("LordVGames.CleanestHud");

		private void Awake()
		{
			instance = this;
			Log.Init(((BaseUnityPlugin)this).Logger);
			Config.ReadConfig(((BaseUnityPlugin)this).Config);
			Assets.PopulateAssets();
			Buffs.Init();
			DriverDamageTypes.Init();
			CameraParams.InitializeParams();
			States.RegisterStates();
			Projectiles.RegisterProjectiles();
			Tokens.AddTokens();
			NetMessages.RegisterNetworkMessages();
			Unlockables.Init();
			new Driver().CreateCharacter();
			new ContentPacks().Initialize();
		}

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

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static bool CheckIfBodyIsTerminal(CharacterBody body)
		{
			return body.HasBuff(Buffs.BuffTerminationVFX);
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static bool IsHunkHudGlobal()
		{
			return Config.globalCustomHUD.Value;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void AddHunkFlashbang(GameObject prefab)
		{
			prefab.AddComponent<FlashbangNearby>();
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static GameObject GetHunkExplosion()
		{
			return HunkAssets.explosionEffect;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static GameObject GetHunkExplosionSmall()
		{
			return HunkAssets.smallExplosionEffect;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static bool IsItemGoldenGun(ItemIndex itemIndex)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			ItemDef goldenGun = Items.GoldenGun;
			if (!Object.op_Implicit((Object)(object)goldenGun))
			{
				return false;
			}
			return goldenGun.itemIndex == itemIndex;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static bool IsItemGoldenGun2(ItemIndex itemIndex)
		{
			//IL_0021: 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)
			GoldenGun val = ItemBase<GoldenGun>.Instance;
			if (!Object.op_Implicit((Object)(object)((ItemBase)(val?)).ItemDef))
			{
				return false;
			}
			return ((ItemBase)val).ItemDef.itemIndex == itemIndex;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static bool IsItemScepter(ItemIndex itemIndex)
		{
			//IL_0021: 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)
			AncientScepterItem val = ItemBase<AncientScepterItem>.instance;
			if (!Object.op_Implicit((Object)(object)((val != null) ? ((ItemBase)val).ItemDef : null)))
			{
				return false;
			}
			return ((ItemBase)val).ItemDef.itemIndex == itemIndex;
		}
	}
	public static class DriverBulletCatalog
	{
		public static DriverBulletDef[] bulletDefs = Array.Empty<DriverBulletDef>();

		public static DriverBulletDef Default;

		internal static DriverBulletDef Stunning;

		internal static DriverBulletDef Incendiary;

		internal static DriverBulletDef Serrated;

		internal static DriverBulletDef Poison;

		internal static DriverBulletDef Weakening;

		internal static DriverBulletDef Executing;

		internal static DriverBulletDef Blighting;

		internal static DriverBulletDef Resetting;

		internal static DriverBulletDef Crippling;

		internal static DriverBulletDef Fruitful;

		internal static DriverBulletDef Frostbite;

		internal static DriverBulletDef Nullifying;

		internal static DriverBulletDef Coin;

		internal static DriverBulletDef Explosive;

		internal static DriverBulletDef Missile;

		internal static DriverBulletDef Flaming;

		internal static DriverBulletDef Icy;

		internal static DriverBulletDef Sticky;

		internal static DriverBulletDef Mystery;

		internal static DriverBulletDef Hemorrhaging;

		internal static DriverBulletDef Helfire;

		internal static DriverBulletDef Infernal;

		internal static DriverBulletDef Dagger;

		internal static DriverBulletDef Lightning;

		internal static DriverBulletDef Fireball;

		internal static DriverBulletDef Hook;

		internal static DriverBulletDef Ruinous;

		internal static DriverBulletDef GiantSlayer;

		internal static DriverBulletDef Disabling;

		internal static DriverBulletDef Gouging;

		internal static DriverBulletDef VoidMissile;

		internal static DriverBulletDef VoidLightning;

		internal static DriverBulletDef Collapse;

		internal static void InitBulletDefs()
		{
			//IL_000b: 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_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: 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_00c7: 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_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_023a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0282: 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_02a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ce: 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_02d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0321: Unknown result type (might be due to invalid IL or missing references)
			//IL_0326: Unknown result type (might be due to invalid IL or missing references)
			//IL_032b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0353: Unknown result type (might be due to invalid IL or missing references)
			//IL_0358: Unknown result type (might be due to invalid IL or missing references)
			//IL_035d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0379: 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_03b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bc: 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_03ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_041c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0421: Unknown result type (might be due to invalid IL or missing references)
			//IL_0426: 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_045f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0464: Unknown result type (might be due to invalid IL or missing references)
			//IL_048c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0491: Unknown result type (might be due to invalid IL or missing references)
			//IL_0496: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_051d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0522: Unknown result type (might be due to invalid IL or missing references)
			//IL_0527: Unknown result type (might be due to invalid IL or missing references)
			//IL_0542: Unknown result type (might be due to invalid IL or missing references)
			Default = CreateBulletType("Default", "Default ammo", DriverWeaponTier.NoTier, Color.white, (DamageType)0);
			Stunning = CreateBulletType("Stunning", "Applies a short stun.", DriverWeaponTier.Common, Color.gray, (DamageType)32);
			Incendiary = CreateBulletType("Incendiary", "Inflicts a stacking burn.", DriverWeaponTier.Common, Color32.op_Implicit(new Color32(byte.MaxValue, (byte)127, (byte)80, byte.MaxValue)), (DamageType)128);
			Serrated = CreateBulletType("Serrated", "Inflicts a stacking bleed.", DriverWeaponTier.Common, DamageColor.FindColor((DamageColorIndex)2), (DamageType)1024);
			Poison = CreateBulletType("Poison", "Inflicts poison.", DriverWeaponTier.Common, Color.green, (DamageType)4096);
			Weakening = CreateBulletType("Weakening", "Slightly lowers targets stats.", DriverWeaponTier.Common, Color32.op_Implicit(new Color32((byte)220, (byte)237, (byte)159, byte.MaxValue)), (DamageType)16384);
			Blighting = CreateBulletType("Blighting", "Inflicts a stacking blight.", DriverWeaponTier.Common, Color32.op_Implicit(new Color32((byte)222, (byte)85, (byte)230, byte.MaxValue)), (DamageType)1048576);
			Coin = CreateBulletType("Coin", "Gain money on hit.", DriverWeaponTier.Common, Color32.op_Implicit(new Color32(byte.MaxValue, (byte)212, (byte)94, byte.MaxValue)), DriverDamageTypes.CoinShot);
			Mystery = CreateBulletType("Mystery", "Each bullet applies a random effect.", DriverWeaponTier.Common, Color32.op_Implicit(new Color32((byte)30, (byte)51, (byte)45, byte.MaxValue)), DriverDamageTypes.MysteryShot);
			Fruitful = CreateBulletType("Fruity", "Enemies drop healing fruit on death.", DriverWeaponTier.Common, Color32.op_Implicit(new Color32(byte.MaxValue, (byte)191, (byte)225, byte.MaxValue)), (DamageType)536870912);
			Crippling = CreateBulletType("Crippling", "Greatly lowers movement speed on hit.", DriverWeaponTier.Common, Color32.op_Implicit(new Color32((byte)48, (byte)205, (byte)217, byte.MaxValue)), (DamageType)4194304);
			Nullifying = CreateBulletType("Nullifying", "Roots enemies on hit.", DriverWeaponTier.Common, DamageColor.FindColor((DamageColorIndex)9), (DamageType)32768);
			Executing = CreateBulletType("Executing", "Deals more damage to low health enemies.", DriverWeaponTier.Uncommon, DamageColor.FindColor((DamageColorIndex)11), (DamageType)524288);
			Collapse = CreateBulletType("Collapse", "Applies a stacking void affliction.", DriverWeaponTier.Uncommon, DamageColor.FindColor((DamageColorIndex)9), DriverDamageTypes.Collapse);
			Resetting = CreateBulletType("Resetting", "Reset current weapon's ammo on kill.", DriverWeaponTier.Uncommon, Color.red, (DamageType)4);
			VoidMissile = CreateBulletType("Void Missile", "Fires a void missile on hit.", DriverWeaponTier.Uncommon, Color32.op_Implicit(new Color32((byte)122, (byte)69, (byte)173, byte.MaxValue)), DriverDamageTypes.VoidMissileShot);
			Explosive = CreateBulletType("Explosive", "Explodes on impact.", DriverWeaponTier.Uncommon, Color.yellow, DriverDamageTypes.ExplosiveRounds);
			Sticky = CreateBulletType("Sticky", "Leaves a sticky grenade on hit.", DriverWeaponTier.Uncommon, Color32.op_Implicit(new Color32(byte.MaxValue, (byte)117, (byte)48, byte.MaxValue)), DriverDamageTypes.StickyShot);
			Disabling = CreateBulletType("Disabling", "Disables enemies skills for a short time.", DriverWeaponTier.Uncommon, DamageColor.FindColor((DamageColorIndex)15), (DamageTypeExtended)1073741824);
			Flaming = CreateBulletType("Elemental Flame", "Conjures a blazing whirlpool on hit.", DriverWeaponTier.Uncommon, Color32.op_Implicit(new Color32(byte.MaxValue, (byte)127, (byte)80, byte.MaxValue)), DriverDamageTypes.FlameTornadoShot);
			Infernal = CreateBulletType("Infernal", "Inflicts a severe stacking burn.", DriverWeaponTier.Uncommon, Color32.op_Implicit(new Color32(byte.MaxValue, (byte)127, (byte)80, byte.MaxValue)), DriverDamageTypes.BetterBurn);
			Ruinous = CreateBulletType("Ruinous", "Inflicts a stacking damage vulnerability.", DriverWeaponTier.Uncommon, DamageColor.FindColor((DamageColorIndex)13), (DamageType)1073741824);
			Icy = CreateBulletType("Elemental Ice", "Conjures a chilling blast on hit.", DriverWeaponTier.Uncommon, Color.cyan, DriverDamageTypes.IceBlastShot);
			Hook = CreateBulletType("Hook", "Pulls in nearby enemies on hit.", DriverWeaponTier.Uncommon, Color.grey, DriverDamageTypes.HookShot);
			VoidLightning = CreateBulletType("Void Lightning", "Shocks a single target with an electrical chain.", DriverWeaponTier.Legendary, Color32.op_Implicit(new Color32((byte)194, (byte)115, byte.MaxValue, byte.MaxValue)), DriverDamageTypes.VoidLightning);
			Missile = CreateBulletType("Missile", "Fires a missile on hit.", DriverWeaponTier.Legendary, Color32.op_Implicit(new Color32((byte)219, (byte)132, (byte)11, byte.MaxValue)), DriverDamageTypes.MissileShot);
			Dagger = CreateBulletType("Dagger", "Conjures homing daggers on hit.", DriverWeaponTier.Legendary, Color.black, DriverDamageTypes.DaggerShot);
			Lightning = CreateBulletType("Lightning", "Shocks nearby enemies with an electrical chain.", DriverWeaponTier.Legendary, Color.cyan, DriverDamageTypes.LightningStrikeRounds);
			Fireball = CreateBulletType("Fireball", "Conjures a volcanic eruption on hit.", DriverWeaponTier.Legendary, Color32.op_Implicit(new Color32(byte.MaxValue, (byte)127, (byte)80, byte.MaxValue)), DriverDamageTypes.FireballRounds);
			Frostbite = CreateBulletType("Frostbite", "Freezes enemies on hit.", DriverWeaponTier.Legendary, Color.cyan, (DamageType)256);
			Gouging = CreateBulletType("Gouging", "Inflicts a stacking bleed that procs items.", DriverWeaponTier.Unique, DamageColor.FindColor((DamageColorIndex)8), DriverDamageTypes.Gouge);
			Hemorrhaging = CreateBulletType("Hemorrhaging", "Inflicts a stacking mortal wound.", DriverWeaponTier.Unique, DamageColor.FindColor((DamageColorIndex)8), DriverDamageTypes.Hemorrhage);
			Helfire = CreateBulletType("Helfire", "Inflicts a stacking burn that could kill the gods.", DriverWeaponTier.Unique, Color32.op_Implicit(new Color32(byte.MaxValue, (byte)127, (byte)127, byte.MaxValue)), DriverDamageTypes.Helfire);
			GiantSlayer = CreateBulletType("Giant Slayer", "The bigger they are, the harder they fall.", DriverWeaponTier.Unique, DamageColor.FindColor((DamageColorIndex)7), (DamageTypeExtended)268435456);
		}

		public static DriverBulletDef CreateBulletType(string bulletName, string bulletDesc, DriverWeaponTier tier, Color color, DamageType damageType)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			return CreateBulletType(bulletName, bulletDesc, tier, color, damageType, null, null);
		}

		public static DriverBulletDef CreateBulletType(string bulletName, string bulletDesc, DriverWeaponTier tier, Color color, DamageTypeExtended damageType)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			return CreateBulletType(bulletName, bulletDesc, tier, color, null, damageType, null);
		}

		public static DriverBulletDef CreateBulletType(string bulletName, string bulletDesc, DriverWeaponTier tier, Color color, ModdedDamageType damageType)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			return CreateBulletType(bulletName, bulletDesc, tier, color, null, null, damageType);
		}

		public static DriverBulletDef CreateBulletType(string bulletName, string bulletDesc, DriverWeaponTier tier, Color color, DamageType? damageType, DamageTypeExtended? damageTypeExtended, ModdedDamageType? moddedDamageType)
		{
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			return CreateAndAddBullet(new DriverBulletDefInfo
			{
				bulletName = bulletName,
				bulletNameToken = "ROB_DRIVER_BULLET_" + bulletName.ToUpper() + "_NAME",
				description = (bulletDesc ?? bulletName),
				descriptionToken = "ROB_DRIVER_BULLET_" + bulletName.ToUpper() + "_DESC",
				damageType = damageType,
				damageTypeExtended = damageTypeExtended,
				moddedDamageType = moddedDamageType,
				tier = tier,
				trailColor = color
			});
		}

		public static DriverBulletDef CreateAndAddBullet(DriverBulletDefInfo bulletDefInfo)
		{
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			if (!string.IsNullOrEmpty(bulletDefInfo.bulletNameToken) && !string.IsNullOrEmpty(bulletDefInfo.bulletName))
			{
				LanguageAPI.Add(bulletDefInfo.bulletNameToken, bulletDefInfo.bulletName);
			}
			if (!string.IsNullOrEmpty(bulletDefInfo.descriptionToken) && !string.IsNullOrEmpty(bulletDefInfo.description))
			{
				LanguageAPI.Add(bulletDefInfo.descriptionToken, bulletDefInfo.description);
			}
			DriverBulletDef driverBulletDef = DriverBulletDef.CreateBulletDefFromInfo(bulletDefInfo);
			DamageAPI.AddModdedDamageType(ref driverBulletDef.damageType, (ModdedDamageType)(((??)bulletDefInfo.moddedDamageType) ?? DriverDamageTypes.Generic));
			return CreateAndAddBullet(driverBulletDef);
		}

		public static DriverBulletDef CreateAndAddBullet(DriverBulletDef bulletDef)
		{
			Array.Resize(ref bulletDefs, bulletDefs.Length + 1);
			int num = bulletDefs.Length - 1;
			bulletDef.index = (ushort)num;
			bulletDefs[num] = bulletDef;
			Config.InitBulletConfig(bulletDef);
			Log.Debug("Added " + bulletDef.bulletName + " to catalog with tier: " + bulletDef.tier);
			return bulletDef;
		}

		public static DriverBulletDef GetBulletFromIndex(int index)
		{
			return ArrayUtils.GetSafe<DriverBulletDef>(bulletDefs, index, ref Default);
		}

		public static DriverBulletDef GetWeightedRandomBullet(DriverWeaponTier tier)
		{
			int num = 60;
			int num2 = ((tier >= DriverWeaponTier.Uncommon) ? 35 : 0);
			int num3 = ((tier >= DriverWeaponTier.Legendary) ? 2 : 0);
			int num4 = ((tier >= DriverWeaponTier.Unique) ? 1 : 0);
			int num5 = Random.Range(0, num + num2 + num3 + num4);
			if (num5 < num)
			{
				tier = DriverWeaponTier.Common;
			}
			else if (num5 < num + num2)
			{
				tier = DriverWeaponTier.Uncommon;
			}
			else if (num5 < num + num2 + num3)
			{
				tier = DriverWeaponTier.Legendary;
			}
			return GetRandomBulletFromTier(tier);
		}

		public static DriverBulletDef GetRandomBulletFromTier(DriverWeaponTier tier)
		{
			List<DriverBulletDef> list = new List<DriverBulletDef>();
			DriverBulletDef[] array = bulletDefs;
			foreach (DriverBulletDef driverBulletDef in array)
			{
				if (driverBulletDef.enabled && driverBulletDef.tier != DriverWeaponTier.NoTier)
				{
					if (driverBulletDef.tier == tier)
					{
						list.Add(driverBulletDef);
					}
					if (Config.uniqueDropsAreLegendary.Value && tier == DriverWeaponTier.Legendary && driverBulletDef.tier > DriverWeaponTier.Legendary)
					{
						list.Add(driverBulletDef);
					}
				}
			}
			if (list.Count <= 0)
			{
				return Default;
			}
			return list[Random.Range(0, list.Count)];
		}
	}
	public static class DriverWeaponCatalog
	{
		public struct WeaponDrop
		{
			public ushort weaponIndex;

			public float dropChance;

			public WeaponDrop(ushort weaponIndex, float dropChance)
			{
				this.weaponIndex = weaponIndex;
				this.dropChance = dropChance;
			}
		}

		public static Dictionary<BodyIndex, WeaponDrop> weaponDrops = new Dictionary<BodyIndex, WeaponDrop>();

		public static DriverWeaponDef[] weaponDefs = Array.Empty<DriverWeaponDef>();

		internal static DriverWeaponDef Pistol;

		internal static DriverWeaponDef LunarPistol;

		internal static DriverWeaponDef VoidPistol;

		internal static DriverWeaponDef PyriteGun;

		internal static DriverWeaponDef BeetleShield;

		internal static DriverWeaponDef Needler;

		internal static DriverWeaponDef GoldenGun;

		internal static DriverWeaponDef Shotgun;

		internal static DriverWeaponDef RiotShotgun;

		internal static DriverWeaponDef SlugShotgun;

		internal static DriverWeaponDef MachineGun;

		internal static DriverWeaponDef HeavyMachineGun;

		internal static DriverWeaponDef Sniper;

		internal static DriverWeaponDef Bazooka;

		internal static DriverWeaponDef GrenadeLauncher;

		internal static DriverWeaponDef RocketLauncher;

		internal static DriverWeaponDef Behemoth;

		internal static DriverWeaponDef PrototypeRocketLauncher;

		internal static DriverWeaponDef ArmCannon;

		internal static DriverWeaponDef PlasmaCannon;

		internal static DriverWeaponDef BadassShotgun;

		internal static DriverWeaponDef LunarRifle;

		internal static DriverWeaponDef LunarHammer;

		internal static DriverWeaponDef NemmandoGun;

		internal static DriverWeaponDef NemmercGun;

		internal static DriverWeaponDef GolemRifle;

		internal static void InitWeaponDefs()
		{
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: Unknown result type (might be due to invalid IL or missing references)
			//IL_0359: Unknown result type (might be due to invalid IL or missing references)
			//IL_0472: Unknown result type (might be due to invalid IL or missing references)
			//IL_0477: 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_05bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_073a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0870: Unknown result type (might be due to invalid IL or missing references)
			//IL_13a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_13a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_1429: Unknown result type (might be due to invalid IL or missing references)
			//IL_142e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a21: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a26: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a4d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b5f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b64: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b8b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1cb6: Unknown result type (might be due to invalid IL or missing references)
			//IL_1df2: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f05: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f0a: Unknown result type (might be due to invalid IL or missing references)
			Pistol = CreateAndAddWeapon(new DriverWeaponDefInfo
			{
				name = "Pistol",
				nameToken = "ROB_DRIVER_PISTOL_NAME",
				description = "A reliable handgun that excels at nothing.",
				descriptionToken = "ROB_DRIVER_PISTOL_DESC",
				icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texPistolWeaponIcon"),
				tier = DriverWeaponTier.NoTier,
				animationSet = DriverWeaponDef.AnimationSet.Default,
				buffType = DriverWeaponDef.BuffType.Crit,
				shotCount = 26,
				primarySkillDef = Skills.pistolPrimarySkillDef,
				secondarySkillDef = Skills.pistolSecondarySkillDef,
				arsenalSkillDef = Skills.CreateAndAddWeaponSkillDef("PISTOL"),
				unlockableDef = null,
				mesh = Assets.LoadMesh("meshPistol"),
				material = Assets.pistolMat,
				crosshairPrefab = Assets.defaultCrosshairPrefab,
				pickupPrefabOverride = Assets.commonPickupModel,
				colorOveride = Helpers.uniqueItemColor,
				reloadAnimationString = "ReloadPistol",
				equipAnimationString = "EquipPistol",
				calloutSoundString = "",
				dropChance = 0f,
				disableHolster = false,
				dropBodyName = ""
			});
			BeetleShield = CreateAndAddWeapon(new DriverWeaponDefInfo
			{
				name = "Chitin Shield",
				nameToken = "ROB_DRIVER_BEETLESHIELD_NAME",
				description = "An offhand shield to protect you while you use your pistol.",
				descriptionToken = "ROB_DRIVER_BEETLESHIELD_DESC",
				icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texBeetleShieldWeaponIcon"),
				tier = DriverWeaponTier.Unique,
				animationSet = DriverWeaponDef.AnimationSet.Default,
				buffType = DriverWeaponDef.BuffType.Crit,
				shotCount = 32,
				primarySkillDef = Skills.beetleShieldPrimarySkillDef,
				secondarySkillDef = Skills.beetleShieldSecondarySkillDef,
				arsenalSkillDef = Skills.CreateAndAddWeaponSkillDef("BEETLESHIELD"),
				unlockableDef = Unlockables.CreateAndAddWeaponUnlockableDef("BEETLESHIELD"),
				mesh = Assets.LoadMesh("meshBeetleShield"),
				material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Beetle/matBeetle.mat").WaitForCompletion(),
				crosshairPrefab = Assets.defaultCrosshairPrefab,
				pickupPrefabOverride = Assets.uniquePickupModel,
				colorOveride = Helpers.uniqueItemColor,
				reloadAnimationString = "ReloadPistol",
				equipAnimationString = "EquipPistol",
				calloutSoundString = "",
				dropChance = 0.1f,
				disableHolster = false
			});
			PyriteGun = CreateAndAddWeapon(new DriverWeaponDefInfo
			{
				name = "Pyrite Gun",
				nameToken = "ROB_DRIVER_PYRITEGUN_NAME",
				description = "A mockery of the real thing.",
				descriptionToken = "ROB_DRIVER_PYRITEGUN_DESC",
				icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texPyriteGunWeaponIcon"),
				tier = DriverWeaponTier.NoTier,
				animationSet = DriverWeaponDef.AnimationSet.Default,
				buffType = DriverWeaponDef.BuffType.Crit,
				shotCount = 18,
				primarySkillDef = Skills.pyriteGunPrimarySkillDef,
				secondarySkillDef = Skills.pyriteGunSecondarySkillDef,
				arsenalSkillDef = Skills.CreateAndAddWeaponSkillDef("PYRITEGUN"),
				unlockableDef = Unlockables.CreateAndAddWeaponUnlockableDef("PYRITEGUN"),
				mesh = Assets.LoadMesh("meshGoldenGun"),
				material = Assets.LoadMaterial("matPyriteGun"),
				crosshairPrefab = Assets.defaultCrosshairPrefab,
				pickupPrefabOverride = Assets.uniquePickupModel,
				colorOveride = Helpers.uniqueItemColor,
				reloadAnimationString = "ReloadPistol",
				equipAnimationString = "EquipPistol",
				calloutSoundString = "",
				dropChance = 0f,
				disableHolster = false
			});
			new FalsePistol();
			LunarPistol = CreateAndAddWeapon(new DriverWeaponDefInfo
			{
				name = "Lunar Pistol",
				nameToken = "ROB_DRIVER_LUNAR_PISTOL_NAME",
				description = "A perfect weapon with no flaws. Speed is war.",
				descriptionToken = "ROB_DRIVER_LUNAR_PISTOL_DESC",
				icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texLunarPistolWeaponIcon"),
				tier = DriverWeaponTier.NoTier,
				animationSet = DriverWeaponDef.AnimationSet.Default,
				buffType = DriverWeaponDef.BuffType.Damage,
				shotCount = 52,
				primarySkillDef = Skills.lunarPistolPrimarySkillDef,
				secondarySkillDef = Skills.lunarPistolSecondarySkillDef,
				arsenalSkillDef = Skills.CreateAndAddWeaponSkillDef("LUNAR_PISTOL"),
				unlockableDef = Unlockables.CreateAndAddWeaponUnlockableDef("LUNAR_PISTOL"),
				mesh = Assets.LoadMesh("meshLunarPistol"),
				material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/LunarGolem/matLunarGolem.mat").WaitForCompletion(),
				crosshairPrefab = Assets.defaultCrosshairPrefab,
				pickupPrefabOverride = Assets.lunarPickupModel,
				colorOveride = Helpers.lunarItemColor,
				reloadAnimationString = "ReloadPistol",
				equipAnimationString = "EquipPistol",
				calloutSoundString = "",
				dropChance = 0f,
				disableHolster = false,
				dropBodyName = ""
			});
			VoidPistol = CreateAndAddWeapon(new DriverWeaponDefInfo
			{
				name = "Void Pistol",
				nameToken = "ROB_DRIVER_VOID_PISTOL_NAME",
				description = "A weapon corrupted and powered up by the void.",
				descriptionToken = "ROB_DRIVER_VOID_PISTOL_DESC",
				icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texVoidPistolWeaponIcon"),
				tier = DriverWeaponTier.NoTier,
				animationSet = DriverWeaponDef.AnimationSet.Default,
				buffType = DriverWeaponDef.BuffType.Damage,
				shotCount = 52,
				primarySkillDef = Skills.lunarPistolPrimarySkillDef,
				secondarySkillDef = Skills.lunarPistolSecondarySkillDef,
				arsenalSkillDef = Skills.CreateAndAddWeaponSkillDef("VOID_PISTOL"),
				unlockableDef = Unlockables.CreateAndAddWeaponUnlockableDef("VOID_PISTOL"),
				mesh = Assets.LoadMesh("meshVoidPistol"),
				material = Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/VoidJailer/matVoidJailer.mat").WaitForCompletion(),
				crosshairPrefab = Assets.defaultCrosshairPrefab,
				pickupPrefabOverride = Assets.voidPickupModel,
				colorOveride = Helpers.voidItemColor,
				reloadAnimationString = "ReloadPistol",
				equipAnimationString = "EquipPistol",
				calloutSoundString = "",
				dropChance = 0f,
				disableHolster = false
			});
			Needler = CreateAndAddWeapon(new DriverWeaponDefInfo
			{
				name = "Needler",
				nameToken = "ROB_DRIVER_NEEDLER_NAME",
				description = "Risk of Rain 2",
				descriptionToken = "ROB_DRIVER_NEEDLER_DESC",
				icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texNeedlerWeaponIcon"),
				tier = DriverWeaponTier.NoTier,
				animationSet = DriverWeaponDef.AnimationSet.Default,
				buffType = DriverWeaponDef.BuffType.Damage,
				shotCount = 28,
				primarySkillDef = (SkillDef)(object)Addressables.LoadAssetAsync<LunarPrimaryReplacementSkill>((object)"RoR2/Base/LunarSkillReplacements/LunarPrimaryReplacement.asset").WaitForCompletion(),
				secondarySkillDef = (SkillDef)(object)Addressables.LoadAssetAsync<LunarSecondaryReplacementSkill>((object)"RoR2/Base/LunarSkillReplacements/LunarSecondaryReplacement.asset").WaitForCompletion(),
				arsenalSkillDef = Skills.CreateAndAddWeaponSkillDef("NEEDLER"),
				unlockableDef = Unlockables.CreateAndAddWeaponUnlockableDef("NEEDLER"),
				mesh = Assets.LoadMesh("meshNeedler"),
				material = Assets.LoadMaterial("matNeedler"),
				crosshairPrefab = Assets.needlerCrosshairPrefab,
				pickupPrefabOverride = Assets.lunarPickupModel,
				colorOveride = Helpers.lunarItemColor,
				reloadAnimationString = "ReloadPistol",
				equipAnimationString = "EquipPistol",
				calloutSoundString = "",
				dropChance = 100f,
				disableHolster = false
			});
			GoldenGun = CreateAndAddWeapon(new DriverWeaponDefInfo
			{
				name = "Golden Gun",
				nameToken = "ROB_DRIVER_GOLDENGUN_NAME",
				description = "Deals extraordinary damage, but only has a few shots.",
				descriptionToken = "ROB_DRIVER_GOLDENGUN_DESC",
				icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texGoldenGunWeaponIcon"),
				tier = DriverWeaponTier.NoTier,
				animationSet = DriverWeaponDef.AnimationSet.Default,
				buffType = DriverWeaponDef.BuffType.Crit,
				shotCount = 6,
				primarySkillDef = Skills.goldenGunPrimarySkillDef,
				secondarySkillDef = Skills.goldenGunSecondarySkillDef,
				arsenalSkillDef = Skills.CreateAndAddWeaponSkillDef("GOLDENGUN"),
				unlockableDef = Unlockables.CreateAndAddWeaponUnlockableDef("GOLDENGUN"),
				mesh = Assets.LoadMesh("meshGoldenGun"),
				material = Assets.LoadMaterial("matGoldenGun"),
				crosshairPrefab = Assets.defaultCrosshairPrefab,
				pickupPrefabOverride = Assets.uniquePickupModel,
				colorOveride = Helpers.uniqueItemColor,
				reloadAnimationString = "ReloadPistol",
				equipAnimationString = "EquipPistol",
				calloutSoundString = "sfx_driver_callout_generic",
				dropChance = 100f,
				disableHolster = false
			});
			Shotgun = CreateAndAddWeapon(new DriverWeaponDefInfo
			{
				name = "Shotgun",
				nameToken = "ROB_DRIVER_SHOTGUN_NAME",
				description = "Close-range powerhouse with overwhelming damage.",
				descriptionToken = "ROB_DRIVER_SHOTGUN_DESC",
				icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texShotgunWeaponIcon"),
				tier = DriverWeaponTier.Common,
				animationSet = DriverWeaponDef.AnimationSet.TwoHanded,
				buffType = DriverWeaponDef.BuffType.Damage,
				shotCount = 8,
				primarySkillDef = Skills.shotgunPrimarySkillDef,
				secondarySkillDef = Skills.bashSkillDef,
				arsenalSkillDef = Skills.CreateAndAddWeaponSkillDef("SHOTGUN"),
				unlockableDef = Unlockables.CreateAndAddWeaponUnlockableDef("SHOTGUN"),
				mesh = Assets.LoadMesh("meshSuperShotgun"),
				material = Assets.LoadMaterial("matShotgun"),
				crosshairPrefab = Assets.shotgunCrosshairPrefab,
				pickupPrefabOverride = null,
				colorOveride = null,
				reloadAnimationString = "ReloadShotgun",
				equipAnimationString = "BufferEmpty",
				calloutSoundString = "sfx_driver_callout_shotgun",
				dropChance = 0f,
				disableHolster = false
			});
			RiotShotgun = CreateAndAddWeapon(new DriverWeaponDefInfo
			{
				name = "Riot Shotgun",
				nameToken = "ROB_DRIVER_RIOT_SHOTGUN_NAME",
				description = "Piercing blasts great for crowd control.",
				descriptionToken = "ROB_DRIVER_RIOT_SHOTGUN_DESC",
				icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texRiotShotgunWeaponIcon"),
				tier = DriverWeaponTier.Common,
				animationSet = DriverWeaponDef.AnimationSet.TwoHanded,
				buffType = DriverWeaponDef.BuffType.AttackSpeed,
				shotCount = 8,
				primarySkillDef = Skills.riotShotgunPrimarySkillDef,
				secondarySkillDef = Skills.bashSkillDef,
				arsenalSkillDef = Skills.CreateAndAddWeaponSkillDef("RIOT_SHOTGUN"),
				unlockableDef = Unlockables.CreateAndAddWeaponUnlockableDef("RIOT_SHOTGUN"),
				mesh = Assets.LoadMesh("meshRiotShotgun"),
				material = Assets.LoadMaterial("matRiotShotgun"),
				crosshairPrefab = Assets.shotgunCrosshairPrefab,
				pickupPrefabOverride = null,
				colorOveride = null,
				reloadAnimationString = "ReloadPistol",
				equipAnimationString = "BufferEmpty",
				calloutSoundString = "sfx_driver_callout_shotgun",
				dropChance = 0f,
				disableHolster = false
			});
			SlugShotgun = CreateAndAddWeapon(new DriverWeaponDefInfo
			{
				name = "Slug Shotgun",
				nameToken = "ROB_DRIVER_SLUG_SHOTGUN_NAME",
				description = "Powerful single hits with heavy kickback.",
				descriptionToken = "ROB_DRIVER_SLUG_SHOTGUN_DESC",
				icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texSlugShotgunWeaponIcon"),
				tier = DriverWeaponTier.Common,
				animationSet = DriverWeaponDef.AnimationSet.TwoHanded,
				buffType = DriverWeaponDef.BuffType.Damage,
				shotCount = 8,
				primarySkillDef = Skills.slugShotgunPrimarySkillDef,
				secondarySkillDef = Skills.bashSkillDef,
				arsenalSkillDef = Skills.CreateAndAddWeaponSkillDef("SLUG_SHOTGUN"),
				unlockableDef = Unlockables.CreateAndAddWeaponUnlockableDef("SLUG_SHOTGUN"),
				mesh = Assets.LoadMesh("meshSlugShotgun"),
				material = Assets.LoadMaterial("matSlugShotgun"),
				crosshairPrefab = Assets.shotgunCrosshairPrefab,
				pickupPrefabOverride = null,
				colorOveride = null,
				reloadAnimationString = "ReloadPistol",
				equipAnimationString = "BufferEmpty",
				calloutSoundString = "sfx_driver_callout_shotgun",
				dropChance = 0f,
				disableHolster = false
			});
			MachineGun = CreateAndAddWeapon(new DriverWeaponDefInfo
			{
				name = "Machine Gun",
				nameToken = "ROB_DRIVER_MACHINEGUN_NAME",
				description = "Shoots fast but has high spread.",
				descriptionToken = "ROB_DRIVER_MACHINEGUN_DESC",
				icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texMachineGunWeaponIcon"),
				tier = DriverWeaponTier.Common,
				animationSet = DriverWeaponDef.AnimationSet.TwoHanded,
				buffType = DriverWeaponDef.BuffType.AttackSpeed,
				shotCount = 48,
				primarySkillDef = Skills.machineGunPrimarySkillDef,
				secondarySkillDef = Skills.machineGunSecondarySkillDef,
				arsenalSkillDef = Skills.CreateAndAddWeaponSkillDef("MACHINEGUN"),
				unlockableDef = Unlockables.CreateAndAddWeaponUnlockableDef("MACHINEGUN"),
				mesh = Assets.LoadMesh("meshMachineGun"),
				material = Assets.LoadMaterial("matMachineGun"),
				crosshairPrefab = Assets.defaultCrosshairPrefab,
				pickupPrefabOverride = null,
				colorOveride = null,
				reloadAnimationString = "ReloadPistol",
				equipAnimationString = "BufferEmpty",
				calloutSoundString = "sfx_driver_callout_machine_gun",
				dropChance = 0f,
				disableHolster = false
			});
			HeavyMachineGun = CreateAndAddWeapon(new DriverWeaponDefInfo
			{
				name = "Heavy Machine Gun",
				nameToken = "ROB_DRIVER_HEAVY_MACHINEGUN_NAME",
				description = "Accurate, armor piercing rounds.",
				descriptionToken = "ROB_DRIVER_HEAVY_MACHINEGUN_DESC",
				icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texHeavyMachineGunWeaponIcon"),
				tier = DriverWeaponTier.Common,
				animationSet = DriverWeaponDef.AnimationSet.TwoHanded,
				buffType = DriverWeaponDef.BuffType.AttackSpeed,
				shotCount = 44,
				primarySkillDef = Skills.heavyMachineGunPrimarySkillDef,
				secondarySkillDef = Skills.heavyMachineGunSecondarySkillDef,
				arsenalSkillDef = Skills.CreateAndAddWeaponSkillDef("HEAVY_MACHINEGUN"),
				unlockableDef = Unlockables.CreateAndAddWeaponUnlockableDef("HEAVY_MACHINEGUN"),
				mesh = Assets.LoadMesh("meshHeavyMachineGun"),
				material = Assets.LoadMaterial("matHeavyMachineGun"),
				crosshairPrefab = Assets.defaultCrosshairPrefab,
				pickupPrefabOverride = null,
				colorOveride = null,
				reloadAnimationString = "ReloadPistol",
				equipAnimationString = "BufferEmpty",
				calloutSoundString = "sfx_driver_callout_hmg",
				dropChance = 0f,
				disableHolster = false
			});
			Sniper = CreateAndAddWeapon(new DriverWeaponDefInfo
			{
				name = "Sniper Rifle",
				nameToken = "ROB_DRIVER_SNIPER_NAME",
				description = "Precise, fatal shots.",
				descriptionToken = "ROB_DRIVER_SNIPER_DESC",
				icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texSniperRifleWeaponIcon"),
				tier = DriverWeaponTier.Uncommon,
				animationSet = DriverWeaponDef.AnimationSet.TwoHanded,
				buffType = DriverWeaponDef.BuffType.Damage,
				shotCount = 6,
				primarySkillDef = Skills.sniperPrimarySkillDef,
				secondarySkillDef = Skills.sniperSecondarySkillDef,
				arsenalSkillDef = Skills.CreateAndAddWeaponSkillDef("SNIPER"),
				unlockableDef = Unlockables.CreateAndAddWeaponUnlockableDef("SNIPER"),
				mesh = Assets.LoadMesh("meshSniperRifle"),
				material = Assets.LoadMaterial("matSniperRifle"),
				crosshairPrefab = Assets.defaultCrosshairPrefab,
				pickupPrefabOverride = null,
				colorOveride = null,
				reloadAnimationString = "ReloadPistol",
				equipAnimationString = "BufferEmpty",
				calloutSoundString = "sfx_driver_callout_sniper",
				dropChance = 0f,
				disableHolster = false
			});
			Bazooka = CreateAndAddWeapon(new DriverWeaponDefInfo
			{
				name = "Bazooka",
				nameToken = "ROB_DRIVER_BAZOOKA_NAME",
				description = "Chargeable arcing rockets.",
				descriptionToken = "ROB_DRIVER_BAZOOKA_DESC",
				icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texBazookaWeaponIcon"),
				tier = DriverWeaponTier.Uncommon,
				animationSet = DriverWeaponDef.AnimationSet.TwoHanded,
				buffType = DriverWeaponDef.BuffType.Damage,
				shotCount = 8,
				primarySkillDef = Skills.bazookaPrimarySkillDef,
				secondarySkillDef = Skills.bashSkillDef,
				arsenalSkillDef = Skills.CreateAndAddWeaponSkillDef("BAZOOKA"),
				unlockableDef = Unlockables.CreateAndAddWeaponUnlockableDef("BAZOOKA"),
				mesh = Assets.LoadMesh("meshBazooka"),
				material = Assets.LoadMaterial("matBazooka"),
				crosshairPrefab = Assets.bazookaCrosshairPrefab,
				pickupPrefabOverride = null,
				colorOveride = null,
				reloadAnimationString = "ReloadShotgun",
				equipAnimationString = "BufferEmpty",
				calloutSoundString = "sfx_driver_callout_rocket_launcher",
				dropChance = 0f,
				disableHolster = false
			});
			GrenadeLauncher = CreateAndAddWeapon(new DriverWeaponDefInfo
			{
				name = "Grenade Launcher",
				nameToken = "ROB_DRIVER_GRENADELAUNCHER_NAME",
				description = "Fast-firing grenades with high damage but low blast radius.",
				descriptionToken = "ROB_DRIVER_GRENADELAUNCHER_DESC",
				icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texGrenadeLauncherWeaponIcon"),
				tier = DriverWeaponTier.Uncommon,
				animationSet = DriverWeaponDef.AnimationSet.TwoHanded,
				buffType = DriverWeaponDef.BuffType.Damage,
				shotCount = 16,
				primarySkillDef = Skills.grenadeLauncherPrimarySkillDef,
				secondarySkillDef = Skills.bashSkillDef,
				arsenalSkillDef = Skills.CreateAndAddWeaponSkillDef("GRENADELAUNCHER"),
				unlockableDef = Unlockables.CreateAndAddWeaponUnlockableDef("GRENADELAUNCHER"),
				mesh = Assets.LoadMesh("meshGrenadeLauncher"),
				material = Assets.LoadMaterial("matGrenadeLauncher"),
				crosshairPrefab = Assets.grenadeLauncherCrosshairPrefab,
				pickupPrefabOverride = null,
				colorOveride = null,
				reloadAnimationString = "ReloadShotgun",
				equipAnimationString = "BufferEmpty",
				calloutSoundString = "sfx_driver_callout_grenade_launcher",
				dropChance = 0f,
				disableHolster = false
			});
			RocketLauncher = CreateAndAddWeapon(new DriverWeaponDefInfo
			{
				name = "Rocket Launcher",
				nameToken = "ROB_DRIVER_ROCKETLAUNCHER_NAME",
				description = "KABOOOM",
				descriptionToken = "ROB_DRIVER_ROCKETLAUNCHER_DESC",
				icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texRocketLauncherWeaponIcon"),
				tier = DriverWeaponTier.Legendary,
				animationSet = DriverWeaponDef.AnimationSet.TwoHanded,
				buffType = DriverWeaponDef.BuffType.AttackSpeed,
				shotCount = 20,
				primarySkillDef = Skills.rocketLauncherPrimarySkillDef,
				secondarySkillDef = Skills.rocketLauncherSecondarySkillDef,
				arsenalSkillDef = Skills.CreateAndAddWeaponSkillDef("ROCKETLAUNCHER"),
				unlockableDef = Unlockables.CreateAndAddWeaponUnlockableDef("ROCKETLAUNCHER"),
				mesh = Assets.LoadMesh("meshRocketLauncher"),
				material = Assets.LoadMaterial("matRocketLauncher"),
				crosshairPrefab = Assets.rocketLauncherCrosshairPrefab,
				pickupPrefabOverride = null,
				colorOveride = null,
				reloadAnimationString = "ReloadShotgun",
				equipAnimationString = "BufferEmpty",
				calloutSoundString = "sfx_driver_callout_rocket_launcher",
				dropChance = 0f,
				disableHolster = false
			});
			Behemoth = CreateAndAddWeapon(new DriverWeaponDefInfo
			{
				name = "Brilliant Behemoth",
				nameToken = "ROB_DRIVER_BEHEMOTH_NAME",
				description = "huh?",
				descriptionToken = "ROB_DRIVER_BEHEMOTH_DESC",
				icon = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Behemoth/texBehemothIcon.png").WaitForCompletion(),
				tier = DriverWeaponTier.Unique,
				animationSet = DriverWeaponDef.AnimationSet.TwoHanded,
				buffType = DriverWeaponDef.BuffType.AttackSpeed,
				shotCount = 20,
				primarySkillDef = Skills.behemothPrimarySkillDef,
				secondarySkillDef = Skills.behemothSecondarySkillDef,
				arsenalSkillDef = Skills.CreateAndAddWeaponSkillDef("BEHEMOTH"),
				unlockableDef = Unlockables.CreateAndAddWeaponUnlockableDef("BEHEMOTH"),
				mesh = Assets.LoadMesh("meshBehemoth"),
				material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Behemoth/matBehemoth.mat").WaitForCompletion(),
				crosshairPrefab = Assets.rocketLauncherCrosshairPrefab,
				pickupPrefabOverride = null,
				colorOveride = null,
				reloadAnimationString = "ReloadShotgun",
				equipAnimationString = "BufferEmpty",
				calloutSoundString = "sfx_driver_callout_rocket_launcher",
				dropChance = 0f,
				disableHolster = false
			});
			PrototypeRocketLauncher = CreateAndAddWeapon(new DriverWeaponDefInfo
			{
				name = "Prototype Rocket Launcher",
				nameToken = "ROB_DRIVER_ROCKETLAUNCHER_ALT_NAME",
				description = "A faulty prototype that can only fire a few shots.",
				descriptionToken = "ROB_DRIVER_ROCKETLAUNCHER_ALT_DESC",
				icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texRocketLauncherAltWeaponIcon"),
				tier = DriverWeaponTier.Unique,
				animationSet = DriverWeaponDef.AnimationSet.TwoHanded,
				buffType = DriverWeaponDef.BuffType.AttackSpeed,
				shotCount = 10,
				primarySkillDef = Skills.rocketLauncherAltPrimarySkillDef,
				secondarySkillDef = Skills.rocketLauncherAltSecondarySkillDef,
				arsenalSkillDef = Skills.CreateAndAddWeaponSkillDef("ROCKETLAUNCHER_ALT"),
				unlockableDef = Unlockables.CreateAndAddWeaponUnlockableDef("ROCKETLAUNCHER_ALT"),
				mesh = Assets.LoadMesh("meshRocketLauncher"),
				material = Assets.LoadMaterial("matRocketLauncherAlt"),
				crosshairPrefab = Assets.rocketLauncherCrosshairPrefab,
				pickupPrefabOverride = null,
				colorOveride = null,
				reloadAnimationString = "ReloadShotgun",
				equipAnimationString = "BufferEmpty",
				calloutSoundString = "sfx_driver_callout_rocket_launcher",
				dropChance = 0f,
				disableHolster = false
			});
			ArmCannon = CreateAndAddWeapon(new DriverWeaponDefInfo
			{
				name = "Arm Cannon",
				nameToken = "ROB_DRIVER_ARMCANNON_NAME",
				description = "Arm Cannon scavenged from a Steel Mechorilla.",
				descriptionToken = "ROB_DRIVER_ARMCANNON_DESC",
				icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texArmCannonWeaponIcon"),
				tier = DriverWeaponTier.Unique,
				animationSet = DriverWeaponDef.AnimationSet.Default,
				buffType = DriverWeaponDef.BuffType.AttackSpeed,
				shotCount = 20,
				primarySkillDef = Skills.armCannonPrimarySkillDef,
				secondarySkillDef = Skills.bashSkillDef,
				arsenalSkillDef = Skills.CreateAndAddWeaponSkillDef("ARMCANNON"),
				unlockableDef = Unlockables.CreateAndAddWeaponUnlockableDef("ARMCANNON"),
				mesh = Assets.LoadMesh("meshArmCannon"),
				material = Assets.LoadMaterial("matArmCannon"),
				crosshairPrefab = Assets.rocketLauncherCrosshairPrefab,
				pickupPrefabOverride = null,
				colorOveride = null,
				reloadAnimationString = "Recharge",
				equipAnimationString = "Recharge",
				calloutSoundString = "sfx_driver_callout_rocket_launcher",
				dropChance = 100f,
				disableHolster = true
			});
			PlasmaCannon = CreateAndAddWeapon(new DriverWeaponDefInfo
			{
				name = "Super Plasma Cannon",
				nameToken = "ROB_DRIVER_PLASMACANNON_NAME",
				description = "POWERRR!!!",
				descriptionToken = "ROB_DRIVER_PLASMACANNON_DESC",
				icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texPlasmaCannonWeaponIcon"),
				tier = DriverWeaponTier.Void,
				animationSet = DriverWeaponDef.AnimationSet.TwoHanded,
				buffType = DriverWeaponDef.BuffType.AttackSpeed,
				shotCount = 30,
				primarySkillDef = Skills.plasmaCannonPrimarySkillDef,
				secondarySkillDef = Skills.plasmaCannonSecondarySkillDef,
				arsenalSkillDef = Skills.CreateAndAddWeaponSkillDef("PLASMACANNON"),
				unlockableDef = Unlockables.CreateAndAddWeaponUnlockableDef("PLASMACANNON"),
				mesh = Assets.LoadMesh("meshPlasmaCannon"),
				material = Assets.LoadMaterial("matPlasmaCannon"),
				crosshairPrefab = Assets.rocketLauncherCrosshairPrefab,
				pickupPrefabOverride = null,
				colorOveride = null,
				reloadAnimationString = "ReloadShotgun",
				equipAnimationString = "BufferEmpty",
				calloutSoundString = "sfx_driver_callout_laser",
				dropChance = 0f,
				disableHolster = false
			});
			BadassShotgun = CreateAndAddWeapon(new DriverWeaponDefInfo
			{
				name = "Badass Shotgun",
				nameToken = "ROB_DRIVER_BADASS_SHOTGUN_NAME",
				description = "A six-barreled shotgun...!?",
				descriptionToken = "ROB_DRIVER_BADASS_SHOTGUN_DESC",
				icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texBadassShotgunWeaponIcon"),
				tier = DriverWeaponTier.Legendary,
				animationSet = DriverWeaponDef.AnimationSet.Default,
				buffType = DriverWeaponDef.BuffType.Damage,
				shotCount = 12,
				primarySkillDef = Skills.badassShotgunPrimarySkillDef,
				secondarySkillDef = Skills.bashSkillDef,
				arsenalSkillDef = Skills.CreateAndAddWeaponSkillDef("BADASS_SHOTGUN"),
				unlockableDef = Unlockables.CreateAndAddWeaponUnlockableDef("BADASS_SHOTGUN"),
				mesh = Assets.LoadMesh("meshSixBarrelShotgun"),
				material = Assets.LoadMaterial("matSawedOff"),
				crosshairPrefab = Assets.LoadCrosshair("SMG"),
				pickupPrefabOverride = null,
				colorOveride = null,
				reloadAnimationString = "ReloadShotgun",
				equipAnimationString = "EquipPistol",
				calloutSoundString = "sfx_driver_callout_shotgun",
				dropChance = 0f,
				disableHolster = false
			});
			LunarRifle = CreateAndAddWeapon(new DriverWeaponDefInfo
			{
				name = "Chimeric Cannon",
				nameToken = "ROB_DRIVER_LUNARRIFLE_NAME",
				description = "Blasts of condensed lunar energy.",
				descriptionToken = "ROB_DRIVER_LUNARRIFLE_DESC",
				icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texLunarRifleWeaponIcon"),
				tier = DriverWeaponTier.Lunar,
				animationSet = DriverWeaponDef.AnimationSet.TwoHanded,
				buffType = DriverWeaponDef.BuffType.AttackSpeed,
				shotCount = 48,
				primarySkillDef = Skills.lunarRiflePrimarySkillDef,
				secondarySkillDef = Skills.bashSkillDef,
				arsenalSkillDef = Skills.CreateAndAddWeaponSkillDef("LUNARRIFLE"),
				unlockableDef = Unlockables.CreateAndAddWeaponUnlockableDef("LUNARRIFLE"),
				mesh = Assets.LoadMesh("meshLunarRifle"),
				material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/LunarGolem/matLunarGolem.mat").WaitForCompletion(),
				crosshairPrefab = Assets.rocketLauncherCrosshairPrefab,
				pickupPrefabOverride = Assets.lunarPickupModel,
				colorOveride = Helpers.lunarItemColor,
				reloadAnimationString = "ReloadShotgun",
				equipAnimationString = "BufferEmpty",
				calloutSoundString = "sfx_driver_callout_generic",
				dropChance = 10f,
				disableHolster = false
			});
			LunarHammer = CreateAndAddWeapon(new DriverWeaponDefInfo
			{
				name = "Lunar Hammer",
				nameToken = "ROB_DRIVER_LUNARHAMMER_NAME",
				description = "Wield supreme power in the palm of your hand.",
				descriptionToken = "ROB_DRIVER_LUNARHAMMER_DESC",
				icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texLunarHammerWeaponIcon"),
				tier = DriverWeaponTier.NoTier,
				animationSet = DriverWeaponDef.AnimationSet.BigMelee,
				buffType = DriverWeaponDef.BuffType.Damage,
				shotCount = 0,
				primarySkillDef = Skills.lunarHammerPrimarySkillDef,
				secondarySkillDef = Skills.lunarHammerSecondarySkillDef,
				arsenalSkillDef = Skills.CreateAndAddWeaponSkillDef("LUNARHAMMER"),
				unlockableDef = Unlockables.CreateAndAddWeaponUnlockableDef("LUNARHAMMER"),
				mesh = Assets.LoadMesh("meshLunarHammer"),
				material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Brother/matBrotherHammer.mat").WaitForCompletion(),
				crosshairPrefab = Assets.needlerCrosshairPrefab,
				pickupPrefabOverride = Assets.lunarPickupModel,
				colorOveride = Helpers.lunarItemColor,
				equipAnimationString = "BufferEmpty",
				calloutSoundString = "sfx_driver_callout_generic",
				dropChance = 100f,
				disableHolster = false
			});
			NemmandoGun = CreateAndAddWeapon(new DriverWeaponDefInfo
			{
				name = "Nemesis Commando SMG",
				nameToken = "ROB_DRIVER_NEMMANDO_NAME",
				description = "Nemesis Commando's gun.",
				descriptionToken = "ROB_DRIVER_NEMMANDO_DESC",
				icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texNemmandoWeaponIcon"),
				tier = DriverWeaponTier.Void,
				animationSet = DriverWeaponDef.AnimationSet.Default,
				buffType = DriverWeaponDef.BuffType.Crit,
				shotCount = 64,
				primarySkillDef = Skills.nemmandoGunPrimarySkillDef,
				secondarySkillDef = Skills.nemmandoGunSecondarySkillDef,
				arsenalSkillDef = Skills.CreateAndAddWeaponSkillDef("NEMMANDO"),
				unlockableDef = Unlockables.CreateAndAddWeaponUnlockableDef("NEMMANDO"),
				mesh = Assets.LoadMesh("meshNemmandoGun"),
				material = Assets.LoadMaterial("matNemmandoGun"),
				crosshairPrefab = Assets.defaultCrosshairPrefab,
				pickupPrefabOverride = Assets.voidPickupModel,
				colorOveride = Helpers.voidItemColor,
				reloadAnimationString = "ReloadPistol",
				equipAnimationString = "EquipPistol",
				calloutSoundString = "sfx_driver_callout_generic",
				dropChance = 100f,
				disableHolster = false
			});
			NemmercGun = CreateAndAddWeapon(new DriverWeaponDefInfo
			{
				name = "Nemesis Mercenary Shotgun",
				nameToken = "ROB_DRIVER_NEMMERC_NAME",
				description = "Nemesis Mercenary's shotgun.",
				descriptionToken = "ROB_DRIVER_NEMMERC_DESC",
				icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texNemmercWeaponIcon"),
				tier = DriverWeaponTier.Void,
				animationSet = DriverWeaponDef.AnimationSet.TwoHanded,
				buffType = DriverWeaponDef.BuffType.Damage,
				shotCount = 48,
				primarySkillDef = Skills.nemmercGunPrimarySkillDef,
				secondarySkillDef = Skills.bashSkillDef,
				arsenalSkillDef = Skills.CreateAndAddWeaponSkillDef("NEMMERC"),
				unlockableDef = Unlockables.CreateAndAddWeaponUnlockableDef("NEMMERC"),
				mesh = Assets.LoadMesh("meshNemmercGun"),
				material = Assets.LoadMaterial("matNemmercGun"),
				crosshairPrefab = Assets.LoadCrosshair("SMG"),
				pickupPrefabOverride = Assets.voidPickupModel,
				colorOveride = Helpers.voidItemColor,
				reloadAnimationString = "ReloadShotgun",
				equipAnimationString = "EquipPistol",
				calloutSoundString = "sfx_driver_callout_shotgun",
				dropChance = 100f,
				disableHolster = false
			});
			GolemRifle = CreateAndAddWeapon(new DriverWeaponDefInfo
			{
				name = "Stone Cannon",
				nameToken = "ROB_DRIVER_GOLEMGUN_NAME",
				description = "Harness the intense beams of a Stone Golem.",
				descriptionToken = "ROB_DRIVER_GOLEMGUN_DESC",
				icon = Assets.mainAssetBundle.LoadAsset<Sprite>("texGolemGunWeaponIcon"),
				tier = DriverWeaponTier.Unique,
				animationSet = DriverWeaponDef.AnimationSet.TwoHanded,
				buffType = DriverWeaponDef.BuffType.Damage,
				shotCount = 48,
				primarySkillDef = Skills.golemGunPrimarySkillDef,
				secondarySkillDef = Skills.bashSkillDef,
				arsenalSkillDef = Skills.CreateAndAddWeaponSkillDef("GOLEMGUN"),
				unlockableDef = Unlockables.CreateAndAddWeaponUnlockableDef("GOLEMGUN"),
				mesh = Assets.LoadMesh("meshGolemGun"),
				material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Golem/matGolem.mat").WaitForCompletion(),
				crosshairPrefab = Assets.circleCrosshairPrefab,
				pickupPrefabOverride = null,
				colorOveride = null,
				reloadAnimationString = "ReloadPistol",
				equipAnimationString = "BufferEmpty",
				calloutSoundString = "sfx_driver_callout_laser",
				dropChance = 1f,
				disableHolster = false
			});
			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 NemKatana().Init();
			new VulkanShotgun();
			AddWeaponDrop("Beetle", BeetleShield, 0.1f);
			AddWeaponDrop("Golem", GolemRifle, 1f);
			AddWeaponDrop("Titan", GolemRifle, 10f);
			AddWeaponDrop("LunarGolem", LunarRifle, 10f);
			AddWeaponDrop("TitanGold", GoldenGun, 100f);
			AddWeaponDrop("TimeCrystal", LunarRifle, 50f);
			AddWeaponDrop("BrotherHurt", LunarHammer, 100f);
			AddWeaponDrop("BrotherHurtBodyP3", LunarHammer, 100f, autoComplete: false);
			AddWeaponDrop("Mechorilla", ArmCannon, 100f);
			AddWeaponDrop("SS2UNemmando", NemmandoGun, 100f);
			AddWeaponDrop("NemMerc", NemmercGun, 100f);
			AddWeaponDrop("Heretic", Needler, 100f);
		}

		public static DriverWeaponDef CreateAndAddWeapon(DriverWeaponDefInfo weaponDefInfo)
		{
			if (!string.IsNullOrEmpty(weaponDefInfo.nameToken) && !string.IsNullOrEmpty(weaponDefInfo.name))
			{
				LanguageAPI.Add(weaponDefInfo.nameToken, weaponDefInfo.name);
			}
			if (!string.IsNullOrEmpty(weaponDefInfo.descriptionToken) && !string.IsNullOrEmpty(weaponDefInfo.description))
			{
				LanguageAPI.Add(weaponDefInfo.descriptionToken, weaponDefInfo.description);
			}
			return CreateAndAddWeapon(DriverWeaponDef.CreateWeaponDefFromInfo(weaponDefInfo));
		}

		public static DriverWeaponDef CreateAndAddWeapon(DriverWeaponDef weaponDef)
		{
			Array.Resize(ref weaponDefs, weaponDefs.Length + 1);
			int num = weaponDefs.Length - 1;
			weaponDef.index = (ushort)num;
			weaponDefs[num] = weaponDef;
			Config.InitWeaponConfig(weaponDef);
			DriverWeaponDef driverWeaponDef = weaponDef;
			if (driverWeaponDef.crosshairPrefab == null)
			{
				driverWeaponDef.crosshairPrefab = Assets.defaultCrosshairPrefab;
			}
			if ((Object)(object)weaponDef.icon == (Object)null)
			{
				Log.Warning("Weapon " + weaponDef.weaponName + " is missing an icon! Assigning default based on tier.");
				driverWeaponDef = weaponDef;
				driverWeaponDef.icon = (Sprite)(weaponDef.tier switch
				{
					DriverWeaponTier.Common => Assets.commonWeaponIcon, 
					DriverWeaponTier.Uncommon => Assets.uncommonWeaponIcon, 
					DriverWeaponTier.Legendary => Assets.legendaryWeaponIcon, 
					DriverWeaponTier.Unique => Assets.uniqueWeaponIcon, 
					DriverWeaponTier.Void => Assets.voidWeaponIcon, 
					DriverWeaponTier.Lunar => Assets.lunarWeaponIcon, 
					_ => Assets.commonWeaponIcon, 
				});
			}
			if (Config.enableArsenal.Value && weaponDef.enabled)
			{
				driverWeaponDef = weaponDef;
				if (driverWeaponDef.arsenalSkillDef == null)
				{
					driverWeaponDef.arsenalSkillDef = Skills.CreateAndAddWeaponSkillDef(weaponDef.nameToken, weaponDef.descriptionToken);
				}
				Skills.AddWeaponSkillToFamily(weaponDef.arsenalSkillDef, weaponDef.unlockableDef, weaponDef.icon);
			}
			Log.Debug("Added " + weaponDef.nameToken + " to catalog with rarity: " + Enum.GetName(typeof(DriverWeaponTier), weaponDef.tier));
			return weaponDef;
		}

		public static void AddWeaponDrop(string bodyName, DriverWeaponDef weaponDef, float dropChance = 0f, bool autoComplete = true)
		{
			if (string.IsNullOrWhiteSpace(bodyName))
			{
				return;
			}
			if (autoComplete)
			{
				bodyName = bodyName.Replace("(Clone)", "");
				if (!bodyName.EndsWith("Body"))
				{
					bodyName += "Body";
				}
			}
			((ResourceAvailability)(ref BodyCatalog.availability)).CallWhenAvailable((Action)delegate
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Invalid comparison between Unknown and I4
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				BodyIndex val = BodyCatalog.FindBodyIndex(bodyName);
				if ((int)val != -1)
				{
					weaponDrops[val] = new WeaponDrop(weaponDef.index, Mathf.Max(dropChance, weaponDef.dropChance));
					Log.Debug("Added " + weaponDef.nameToken + " to drop list for " + bodyName);
				}
				else
				{
					Log.Warning("Failed to add " + weaponDef.nameToken + " to drop list for " + bodyName + " because the body index was not found.");
				}
			});
		}

		public static DriverWeaponDef GetWeaponFromIndex(int index)
		{
			return ArrayUtils.GetSafe<DriverWeaponDef>(weaponDefs, index, ref Pistol);
		}

		public static bool IsWeaponPistol(DriverWeaponDef weaponDef)
		{
			if (!((Object)(object)weaponDef == (Object)(object)Pistol) && !((Object)(object)weaponDef == (Object)(object)VoidPistol) && !((Object)(object)weaponDef == (Object)(object)LunarPistol) && !((Object)(object)weaponDef == (Object)(object)PyriteGun) && !((Object)(object)weaponDef == (Object)(object)BeetleShield))
			{
				return (Object)(object)weaponDef == (Object)(object)BundledWeapon<FalsePistol>.instance.weaponDef;
			}
			return true;
		}

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

		public static DriverWeaponDef GetWeightedRandomWeapon(DriverWeaponTier tier)
		{
			int num = 60;
			int num2 = ((tier >= DriverWeaponTier.Uncommon) ? 35 : 0);
			int num3 = ((tier >= DriverWeaponTier.Legendary) ? 2 : 0);
			int num4 = ((tier >= DriverWeaponTier.Unique) ? 1 : 0);
			int num5 = Random.Range(0, num + num2 + num3 + num4);
			if (num5 < num)
			{
				tier = DriverWeaponTier.Common;
			}
			else if (num5 < num + num2)
			{
				tier = DriverWeaponTier.Uncommon;
			}
			else if (num5 < num + num2 + num3)
			{
				tier = DriverWeaponTier.Legendary;
			}
			return GetRandomWeaponFromTier(tier);
		}

		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 (driverWeaponDef.enabled && driverWeaponDef.shotCount > 0 && driverWeaponDef.tier != DriverWeaponTier.NoTier)
				{
					if (driverWeaponDef.tier == tier)
					{
						list.Add(driverWeaponDef);
					}
					if (Config.uniqueDropsAreLegendary.Value && tier == DriverWeaponTier.Legendary && driverWeaponDef.tier > DriverWeaponTier.Legendary)
					{
						list.Add(driverWeaponDef);
					}
				}
			}
			if (list.Count == 0)
			{
				return Pistol;
			}
			return list[Random.Range(0, list.Count)];
		}
	}
	public static class DriverWeaponSkinCatalog
	{
		internal static Dictionary<SkinIndex, DriverWeaponSkinDef[]> driverSkinDefs = new Dictionary<SkinIndex, DriverWeaponSkinDef[]>();

		public static void AddSkin(SkinIndex index, IEnumerable<DriverWeaponSkinDef> skinDefs)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Invalid comparison between Unknown and I4
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			if (skinDefs.Any() && (int)index != -1)
			{
				driverSkinDefs.Add(index, skinDefs.ToArray());
			}
		}

		public static DriverWeaponDef.ModelSwapInfo[] GetModelSwapInfoForWeapon(ModelSkinController skinController, DriverWeaponDef weaponDef)
		{
			if (weaponDef == null)
			{
				weaponDef = DriverWeaponCatalog.Pistol;
			}
			if (skinController != null && skinController.skins?.Length == 0)
			{
				return weaponDef.modelSwapInfo;
			}
			return GetModelSwapInfoForWeapon(skinController.skins, skinController.currentSkinIndex, weaponDef);
		}

		public static DriverWeaponDef.ModelSwapInfo[] GetModelSwapInfoForWeapon(SkinDef[] skins, int skinIndex, DriverWeaponDef weaponDef)
		{
			//IL_0021: 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)
			if (weaponDef == null)
			{
				weaponDef = DriverWeaponCatalog.Pistol;
			}
			SkinDef safe = ArrayUtils.GetSafe<SkinDef>(skins, skinIndex);
			if ((Object)(object)safe == (Object)null || !driverSkinDefs.ContainsKey(safe.skinIndex))
			{
				return weaponDef.modelSwapInfo;
			}
			DriverWeaponSkinDef[] array = driverSkinDefs[safe.skinIndex];
			for (int i = 0; i < array.Length; i++)
			{
				if (array[i].weaponDefIndex == weaponDef.index)
				{
					return array[i].modelSwapInfo;
				}
			}
			return weaponDef.modelSwapInfo;
		}
	}
}
namespace RobDriver.SkillStates
{
	public class FuckMyAss : GenericCharacterDeath
	{
		public override bool shouldAutoDestroy => false;

		public override void OnEnter()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//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_00a9: 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()
		{
			return (InterruptPriority)9;
		}
	}
}
namespace RobDriver.SkillStates.Emote
{
	public class BaseEmote : BaseState
	{
		private CameraParamsOverrideHandle camOverrideHandle;

		protected float duration;

		private uint activePlayID;

		public LocalUser localUser;

		public override void OnEnter()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			((BaseState)this).OnEnter();
			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_0000: 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_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			((EntityState)this).FixedUpdate();
			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_003c: 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)
			((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()
		{
			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 Bash : BaseDriverSkillState
	{
		public static string hitboxString = "BashHitbox";

		public static float baseDuration = 0.8f;

		public static float hitboxRadius = 6f;

		public static float damageCoefficient = 2.5f;

		public static float procCoefficient = 1f;

		public static float knockbackForce = 0.11f;

		public static float recoilAmplitude = 1f;

		public float lungeForce = 18f;

		public float hopForce = 7f;

		private float fireTime;

		private bool hasLunged;

		private bool hasFired;

		private float duration;

		private float stopwatch;

		public override void OnEnter()
		{
			base.OnEnter();
			duration = baseDuration / ((BaseState)this).attackSpeedStat;
			fireTime = 0.2f * duration;
			((BaseState)this).StartAimMode(2f, false);
			((EntityState)this).PlayCrossfade("Gesture, Override", "Bash", "Action.playbackRate", duration, 0.05f);
			Util.PlaySound("sfx_driver_bash_prep", ((EntityState)this).gameObject);
		}

		private void Fire()
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: 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_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: 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_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL