Decompiled source of Bandit Tweaks v1.9.4

BanditTweaks.dll

Decompiled 4 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using EntityStates;
using EntityStates.Bandit2;
using EntityStates.Bandit2.Weapon;
using IL.EntityStates.Bandit2;
using IL.EntityStates.Bandit2.Weapon;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.EntityStates.Bandit2;
using On.EntityStates.Bandit2.Weapon;
using On.RoR2;
using On.RoR2.UI;
using RiskyMod.Survivors.Bandit2;
using RoR2;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("BanditTweaks")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+479bdf9377e8ff8884be4d4b82b0a71c8a413838")]
[assembly: AssemblyProduct("BanditTweaks")]
[assembly: AssemblyTitle("BanditTweaks")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace BanditTweaks;

[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.Moffein.BanditTweaks", "Bandit Tweaks", "1.9.3")]
public class BanditTweaks : BaseUnityPlugin
{
	public enum BanditFireMode
	{
		Tap,
		Spam
	}

	[Serializable]
	[CompilerGenerated]
	private sealed class <>c
	{
		public static readonly <>c <>9 = new <>c();

		public static hook_TakeDamage <>9__13_1;

		public static hook_FireShiv <>9__13_2;

		public static Func<Instruction, bool> <>9__13_18;

		public static Func<string, ThrowSmokebomb, string> <>9__13_19;

		public static Manipulator <>9__13_14;

		public static Func<Instruction, bool> <>9__13_20;

		public static Func<string, ThrowSmokebomb, string> <>9__13_21;

		public static Manipulator <>9__13_15;

		public static Func<Instruction, bool> <>9__13_22;

		public static Func<string, ThrowSmokebomb, string> <>9__13_23;

		public static Manipulator <>9__13_16;

		public static Func<Instruction, bool> <>9__13_24;

		public static Func<string, ThrowSmokebomb, string> <>9__13_25;

		public static Manipulator <>9__13_17;

		public static hook_GetMinimumInterruptPriority <>9__13_5;

		internal void <Awake>b__13_1(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Invalid comparison between Unknown and I4
			if ((int)damageInfo.dotIndex == 6)
			{
				float num = self.body.armor + self.adaptiveArmorValue;
				if (num > 0f)
				{
					damageInfo.damage *= (100f + num) / 100f;
				}
			}
			orig.Invoke(self, damageInfo);
		}

		internal void <Awake>b__13_2(orig_FireShiv orig, Bandit2FireShiv self)
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)Bandit2FireShiv.muzzleEffectPrefab))
			{
				EffectManager.SimpleMuzzleFlash(Bandit2FireShiv.muzzleEffectPrefab, ((EntityState)self).gameObject, Bandit2FireShiv.muzzleString, false);
			}
			if (((EntityState)self).isAuthority)
			{
				Ray aimRay = ((BaseState)self).GetAimRay();
				if ((Object)(object)self.projectilePrefab != (Object)null)
				{
					FireProjectileInfo val = default(FireProjectileInfo);
					val.projectilePrefab = self.projectilePrefab;
					val.position = ((Ray)(ref aimRay)).origin;
					val.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction);
					val.owner = ((EntityState)self).gameObject;
					val.damage = ((BaseState)self).damageStat * self.damageCoefficient;
					val.force = self.force;
					val.crit = ((BaseState)self).RollCrit();
					val.damageTypeOverride = DamageTypeCombo.op_Implicit((DamageType)134217760);
					FireProjectileInfo val2 = val;
					ProjectileManager.instance.FireProjectile(val2);
				}
			}
		}

		internal void <Awake>b__13_14(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "Gesture, Additive")
			});
			val.Emit(OpCodes.Ldarg_0);
			val.EmitDelegate<Func<string, ThrowSmokebomb, string>>((Func<string, ThrowSmokebomb, string>)delegate(string animLayer, ThrowSmokebomb self)
			{
				//IL_002d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0032: Unknown result type (might be due to invalid IL or missing references)
				Animator modelAnimator = ((EntityState)self).GetModelAnimator();
				if (Object.op_Implicit((Object)(object)modelAnimator))
				{
					int layerIndex = modelAnimator.GetLayerIndex("Gesture, Additive");
					if (layerIndex >= 0)
					{
						AnimatorStateInfo currentAnimatorStateInfo = modelAnimator.GetCurrentAnimatorStateInfo(layerIndex);
						if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("SlashBlade"))
						{
							return "BanditTweaksInvalidLayer";
						}
					}
				}
				return animLayer;
			});
		}

		internal bool <Awake>b__13_18(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdstr(x, "Gesture, Additive");
		}

		internal string <Awake>b__13_19(string animLayer, ThrowSmokebomb self)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			Animator modelAnimator = ((EntityState)self).GetModelAnimator();
			if (Object.op_Implicit((Object)(object)modelAnimator))
			{
				int layerIndex = modelAnimator.GetLayerIndex("Gesture, Additive");
				if (layerIndex >= 0)
				{
					AnimatorStateInfo currentAnimatorStateInfo = modelAnimator.GetCurrentAnimatorStateInfo(layerIndex);
					if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("SlashBlade"))
					{
						return "BanditTweaksInvalidLayer";
					}
				}
			}
			return animLayer;
		}

		internal void <Awake>b__13_15(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "Gesture, Additive")
			});
			val.Emit(OpCodes.Ldarg_0);
			val.EmitDelegate<Func<string, ThrowSmokebomb, string>>((Func<string, ThrowSmokebomb, string>)delegate(string animLayer, ThrowSmokebomb self)
			{
				//IL_002d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0032: Unknown result type (might be due to invalid IL or missing references)
				Animator modelAnimator = ((EntityState)self).GetModelAnimator();
				if (Object.op_Implicit((Object)(object)modelAnimator))
				{
					int layerIndex = modelAnimator.GetLayerIndex("Gesture, Additive");
					if (layerIndex >= 0)
					{
						AnimatorStateInfo currentAnimatorStateInfo = modelAnimator.GetCurrentAnimatorStateInfo(layerIndex);
						if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("SlashBlade"))
						{
							return "BanditTweaksInvalidLayer";
						}
					}
				}
				return animLayer;
			});
		}

		internal bool <Awake>b__13_20(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdstr(x, "Gesture, Additive");
		}

		internal string <Awake>b__13_21(string animLayer, ThrowSmokebomb self)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			Animator modelAnimator = ((EntityState)self).GetModelAnimator();
			if (Object.op_Implicit((Object)(object)modelAnimator))
			{
				int layerIndex = modelAnimator.GetLayerIndex("Gesture, Additive");
				if (layerIndex >= 0)
				{
					AnimatorStateInfo currentAnimatorStateInfo = modelAnimator.GetCurrentAnimatorStateInfo(layerIndex);
					if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("SlashBlade"))
					{
						return "BanditTweaksInvalidLayer";
					}
				}
			}
			return animLayer;
		}

		internal void <Awake>b__13_16(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "Gesture, Additive")
			});
			val.Emit(OpCodes.Ldarg_0);
			val.EmitDelegate<Func<string, ThrowSmokebomb, string>>((Func<string, ThrowSmokebomb, string>)delegate(string animLayer, ThrowSmokebomb self)
			{
				//IL_002d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0032: Unknown result type (might be due to invalid IL or missing references)
				Animator modelAnimator = ((EntityState)self).GetModelAnimator();
				if (Object.op_Implicit((Object)(object)modelAnimator))
				{
					int layerIndex = modelAnimator.GetLayerIndex("Gesture, Additive");
					if (layerIndex >= 0)
					{
						AnimatorStateInfo currentAnimatorStateInfo = modelAnimator.GetCurrentAnimatorStateInfo(layerIndex);
						if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("SlashBlade"))
						{
							return "BanditTweaksInvalidLayer";
						}
					}
				}
				return animLayer;
			});
		}

		internal bool <Awake>b__13_22(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdstr(x, "Gesture, Additive");
		}

		internal string <Awake>b__13_23(string animLayer, ThrowSmokebomb self)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			Animator modelAnimator = ((EntityState)self).GetModelAnimator();
			if (Object.op_Implicit((Object)(object)modelAnimator))
			{
				int layerIndex = modelAnimator.GetLayerIndex("Gesture, Additive");
				if (layerIndex >= 0)
				{
					AnimatorStateInfo currentAnimatorStateInfo = modelAnimator.GetCurrentAnimatorStateInfo(layerIndex);
					if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("SlashBlade"))
					{
						return "BanditTweaksInvalidLayer";
					}
				}
			}
			return animLayer;
		}

		internal void <Awake>b__13_17(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "Gesture, Additive")
			});
			val.Emit(OpCodes.Ldarg_0);
			val.EmitDelegate<Func<string, ThrowSmokebomb, string>>((Func<string, ThrowSmokebomb, string>)delegate(string animLayer, ThrowSmokebomb self)
			{
				//IL_002d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0032: Unknown result type (might be due to invalid IL or missing references)
				Animator modelAnimator = ((EntityState)self).GetModelAnimator();
				if (Object.op_Implicit((Object)(object)modelAnimator))
				{
					int layerIndex = modelAnimator.GetLayerIndex("Gesture, Additive");
					if (layerIndex >= 0)
					{
						AnimatorStateInfo currentAnimatorStateInfo = modelAnimator.GetCurrentAnimatorStateInfo(layerIndex);
						if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("SlashBlade"))
						{
							return "BanditTweaksInvalidLayer";
						}
					}
				}
				return animLayer;
			});
		}

		internal bool <Awake>b__13_24(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdstr(x, "Gesture, Additive");
		}

		internal string <Awake>b__13_25(string animLayer, ThrowSmokebomb self)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			Animator modelAnimator = ((EntityState)self).GetModelAnimator();
			if (Object.op_Implicit((Object)(object)modelAnimator))
			{
				int layerIndex = modelAnimator.GetLayerIndex("Gesture, Additive");
				if (layerIndex >= 0)
				{
					AnimatorStateInfo currentAnimatorStateInfo = modelAnimator.GetCurrentAnimatorStateInfo(layerIndex);
					if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("SlashBlade"))
					{
						return "BanditTweaksInvalidLayer";
					}
				}
			}
			return animLayer;
		}

		internal InterruptPriority <Awake>b__13_5(orig_GetMinimumInterruptPriority orig, Bandit2FirePrimaryBase self)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)self).fixedAge <= self.minimumDuration && ((EntityState)self).inputBank.skill1.wasDown)
			{
				return (InterruptPriority)2;
			}
			return (InterruptPriority)0;
		}
	}

	private bool enableFireSelect = true;

	private BanditFireMode fireMode = BanditFireMode.Tap;

	private bool selectWithScrollWheel = true;

	private KeyCode selectButton = (KeyCode)0;

	private KeyCode defaultButton = (KeyCode)0;

	private KeyCode burstButton = (KeyCode)0;

	private bool slayerFix = true;

	public static bool quickdrawEnabled;

	public static bool RiskyModLoaded;

	private static BodyIndex Bandit2Index;

	[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
	private bool CheckRiskyModBandit2Core()
	{
		return !Bandit2Core.enabled;
	}

	private void OnLoad()
	{
		//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)
		Bandit2Index = BodyCatalog.FindBodyIndex("Bandit2Body");
	}

	public void Awake()
	{
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a9: Expected O, but got Unknown
		//IL_00a9: Expected O, but got Unknown
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00de: Expected O, but got Unknown
		//IL_00de: Expected O, but got Unknown
		//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0106: Unknown result type (might be due to invalid IL or missing references)
		//IL_0110: Expected O, but got Unknown
		//IL_0110: Expected O, but got Unknown
		//IL_012b: Unknown result type (might be due to invalid IL or missing references)
		//IL_013c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0146: Expected O, but got Unknown
		//IL_0146: Expected O, but got Unknown
		//IL_0161: Unknown result type (might be due to invalid IL or missing references)
		//IL_0172: Unknown result type (might be due to invalid IL or missing references)
		//IL_017c: Expected O, but got Unknown
		//IL_017c: Expected O, but got Unknown
		//IL_017c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0181: Unknown result type (might be due to invalid IL or missing references)
		//IL_0197: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b2: Expected O, but got Unknown
		//IL_01b2: Expected O, but got Unknown
		//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01de: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e8: Expected O, but got Unknown
		//IL_01e8: Expected O, but got Unknown
		//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_0203: Unknown result type (might be due to invalid IL or missing references)
		//IL_0218: Unknown result type (might be due to invalid IL or missing references)
		//IL_0222: Expected O, but got Unknown
		//IL_0222: Expected O, but got Unknown
		//IL_023d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0252: Unknown result type (might be due to invalid IL or missing references)
		//IL_025c: Expected O, but got Unknown
		//IL_025c: Expected O, but got Unknown
		//IL_0276: 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_0291: Expected O, but got Unknown
		//IL_0291: Expected O, but got Unknown
		//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02be: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c8: Expected O, but got Unknown
		//IL_02c8: Expected O, but got Unknown
		//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0302: Expected O, but got Unknown
		//IL_0302: Expected O, but got Unknown
		//IL_031d: Unknown result type (might be due to invalid IL or missing references)
		//IL_032e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0338: Expected O, but got Unknown
		//IL_0338: Expected O, but got Unknown
		//IL_0353: Unknown result type (might be due to invalid IL or missing references)
		//IL_0364: Unknown result type (might be due to invalid IL or missing references)
		//IL_036e: Expected O, but got Unknown
		//IL_036e: Expected O, but got Unknown
		//IL_0388: Unknown result type (might be due to invalid IL or missing references)
		//IL_0399: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a3: Expected O, but got Unknown
		//IL_03a3: Expected O, but got Unknown
		//IL_03bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_03cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d6: Expected O, but got Unknown
		//IL_03d6: Expected O, but got Unknown
		//IL_03f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0401: Unknown result type (might be due to invalid IL or missing references)
		//IL_040b: Expected O, but got Unknown
		//IL_040b: Expected O, but got Unknown
		//IL_0422: Unknown result type (might be due to invalid IL or missing references)
		//IL_0433: Unknown result type (might be due to invalid IL or missing references)
		//IL_043d: Expected O, but got Unknown
		//IL_043d: Expected O, but got Unknown
		//IL_0454: Unknown result type (might be due to invalid IL or missing references)
		//IL_0465: Unknown result type (might be due to invalid IL or missing references)
		//IL_046f: Expected O, but got Unknown
		//IL_046f: Expected O, but got Unknown
		//IL_04bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c7: Expected O, but got Unknown
		//IL_04e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_04eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f1: Expected O, but got Unknown
		//IL_0774: Unknown result type (might be due to invalid IL or missing references)
		//IL_0785: Unknown result type (might be due to invalid IL or missing references)
		//IL_078f: Expected O, but got Unknown
		//IL_078f: Expected O, but got Unknown
		//IL_07ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_07c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_07cc: Expected O, but got Unknown
		//IL_07cc: Expected O, but got Unknown
		//IL_0515: Unknown result type (might be due to invalid IL or missing references)
		//IL_051a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0520: Expected O, but got Unknown
		//IL_0806: Unknown result type (might be due to invalid IL or missing references)
		//IL_0817: Unknown result type (might be due to invalid IL or missing references)
		//IL_0821: Expected O, but got Unknown
		//IL_0821: Expected O, but got Unknown
		//IL_083c: Unknown result type (might be due to invalid IL or missing references)
		//IL_084d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0857: Expected O, but got Unknown
		//IL_0857: Expected O, but got Unknown
		//IL_0872: Unknown result type (might be due to invalid IL or missing references)
		//IL_0883: Unknown result type (might be due to invalid IL or missing references)
		//IL_088d: Expected O, but got Unknown
		//IL_088d: Expected O, but got Unknown
		//IL_08a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_08bd: Unknown result type (might be due to invalid IL or missing references)
		//IL_08c7: Expected O, but got Unknown
		//IL_08c7: Expected O, but got Unknown
		//IL_08e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_08f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0900: Expected O, but got Unknown
		//IL_0900: Expected O, but got Unknown
		//IL_0918: Unknown result type (might be due to invalid IL or missing references)
		//IL_092d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0937: Expected O, but got Unknown
		//IL_0937: Expected O, but got Unknown
		//IL_065b: Unknown result type (might be due to invalid IL or missing references)
		//IL_065d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0665: Unknown result type (might be due to invalid IL or missing references)
		//IL_0667: Unknown result type (might be due to invalid IL or missing references)
		//IL_066e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0673: Unknown result type (might be due to invalid IL or missing references)
		//IL_067b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0683: Unknown result type (might be due to invalid IL or missing references)
		//IL_0691: Expected O, but got Unknown
		//IL_0699: Unknown result type (might be due to invalid IL or missing references)
		//IL_06a3: Expected O, but got Unknown
		//IL_057f: Unknown result type (might be due to invalid IL or missing references)
		//IL_058b: Unknown result type (might be due to invalid IL or missing references)
		//IL_059d: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_05bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_05cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_05d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0986: Unknown result type (might be due to invalid IL or missing references)
		//IL_098b: Unknown result type (might be due to invalid IL or missing references)
		//IL_099b: Unknown result type (might be due to invalid IL or missing references)
		//IL_09a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_09b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_09b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_09c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_09ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_09da: Unknown result type (might be due to invalid IL or missing references)
		//IL_09df: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a2c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a36: Expected O, but got Unknown
		//IL_06e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_06e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_06ed: Expected O, but got Unknown
		//IL_0a53: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a5d: Expected O, but got Unknown
		//IL_0707: Unknown result type (might be due to invalid IL or missing references)
		//IL_070c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0712: Expected O, but got Unknown
		//IL_072c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0731: Unknown result type (might be due to invalid IL or missing references)
		//IL_0737: Expected O, but got Unknown
		//IL_0afe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b08: Expected O, but got Unknown
		//IL_0b10: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b1a: Expected O, but got Unknown
		//IL_0b22: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b2c: Expected O, but got Unknown
		//IL_0b34: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b3e: Expected O, but got Unknown
		//IL_0b46: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b50: Expected O, but got Unknown
		//IL_0aeb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0af5: Expected O, but got Unknown
		//IL_0751: Unknown result type (might be due to invalid IL or missing references)
		//IL_0756: Unknown result type (might be due to invalid IL or missing references)
		//IL_075c: Expected O, but got Unknown
		//IL_0a79: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a90: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ac1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0acb: Expected O, but got Unknown
		//IL_0aa9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0aae: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ab4: Expected O, but got Unknown
		RiskyModLoaded = Chainloader.PluginInfos.ContainsKey("com.RiskyLives.RiskyMod");
		bool flag = true;
		if (RiskyModLoaded)
		{
			flag = CheckRiskyModBandit2Core();
		}
		if (!flag)
		{
			Debug.LogError((object)"BanditTweaks: RiskyMod's Bandit changes are enabled, aborting Awake(). BanditTweaks and RiskyMod's Bandit changes are highly incompatible, so you should disable this mod or RiskyMod's Bandit tweaks in the config.");
			return;
		}
		GameObject val = LegacyResourcesAPI.Load<GameObject>("prefabs/characterbodies/bandit2body");
		RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(OnLoad));
		quickdrawEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("00 - Passive", "Enable Quickdraw"), false, new ConfigDescription("From BanditReloaded. Using other skills will instantly reload your Primary.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		bool flag2 = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("01 - Primary", "Enable Autofire"), true, new ConfigDescription("Holding down the Primary button automatically fires your gun.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		enableFireSelect = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("01 - Primary", "Enable Firemode Selection"), true, new ConfigDescription("Enables swapping primary firemode between slow and fast fire.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		selectWithScrollWheel = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("01 - Primary", "Select with ScrollWheel"), true, new ConfigDescription("Scroll wheel swaps between firemodes.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		selectButton = ((BaseUnityPlugin)this).Config.Bind<KeyCode>(new ConfigDefinition("01 - Primary", "Select Button"), (KeyCode)0, new ConfigDescription("Button to swap between firemodes.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		defaultButton = ((BaseUnityPlugin)this).Config.Bind<KeyCode>(new ConfigDefinition("01 - Primary", "Tapfire Button"), (KeyCode)0, new ConfigDescription("Button to swap to Default firemode.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		burstButton = ((BaseUnityPlugin)this).Config.Bind<KeyCode>(new ConfigDefinition("01 - Primary", "Spamfire Button"), (KeyCode)0, new ConfigDescription("Button to swap to Burst firemode.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		float autoFireDuration = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("01 - Primary", "Tap Fire Rate"), 0.3f, new ConfigDescription("How long it takes to autofire shots on the Default firemode.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		float burstFireDuration = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("01 - Primary", "Spam Fire Rate"), 0.12f, new ConfigDescription("How long it takes to autofire shots on the Burst firemode.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		bool value = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("01 - Primary", "Prioritize Reload"), false, new ConfigDescription("Makes reloading take priority over shooting.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		float burstBulletRadius = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("01a - Burst", "Bullet Radius"), 0.3f, new ConfigDescription("How wide bullets are (0 is vanilla).", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		float blastBulletRadius = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("01b - Blast", "Bullet Radius"), 0.5f, new ConfigDescription("How wide bullets are (0 is vanilla).", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		bool blastReduceSpread = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("01b - Blast", "Remove Spread"), true, new ConfigDescription("Removes spread inaccuracy.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		bool blastPenetration = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("01b - Blast", "Pierce Enemies"), true, new ConfigDescription("Bullets can pierce through multiple enemies.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		bool value2 = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("02 - Secondary", "Serrated Dagger Tweaks"), true, new ConfigDescription("Serrated Dagger lunges while sprinting and has a larger hitbox.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		bool noKnifeAttackSpeed = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("02 - Secondary", "Serrated Dagger Minimum Duration"), true, new ConfigDescription("Serrated Dagger has a minimum duration of 0.3s so that the lunge doesn't stop working at high attack speeds.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		bool value3 = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("02 - Secondary", "Hemorrhage Ignore Armor"), true, new ConfigDescription("*SERVER-SIDE* Hemorrhage ignores positive armor values.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		bool value4 = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("02 - Secondary", "Serrated Shiv Tweaks"), true, new ConfigDescription("Serrated Shiv stuns on hit.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		bool value5 = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("03 - Utility", "Smokebomb Anim while grounded"), true, new ConfigDescription("Enable the Smokebomb animation when on the ground.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		if (Chainloader.PluginInfos.ContainsKey("de.userstorm.banditweaponmodes"))
		{
			flag2 = false;
		}
		if (!flag2)
		{
			enableFireSelect = false;
		}
		if (blastPenetration || blastReduceSpread)
		{
			Bandit2FireRifle.ModifyBullet += (hook_ModifyBullet)delegate(orig_ModifyBullet orig, Bandit2FireRifle self, BulletAttack bulletAttack)
			{
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(self, bulletAttack);
				if (blastPenetration)
				{
					bulletAttack.stopperMask = LayerMask.op_Implicit(LayerIndex.world.intVal);
				}
				if (blastReduceSpread)
				{
					bulletAttack.minSpread = 0f;
					bulletAttack.maxSpread = 0f;
				}
			};
		}
		if (value3)
		{
			object obj = <>c.<>9__13_1;
			if (obj == null)
			{
				hook_TakeDamage val2 = delegate(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
				{
					//IL_0002: Unknown result type (might be due to invalid IL or missing references)
					//IL_0008: Invalid comparison between Unknown and I4
					if ((int)damageInfo.dotIndex == 6)
					{
						float num2 = self.body.armor + self.adaptiveArmorValue;
						if (num2 > 0f)
						{
							damageInfo.damage *= (100f + num2) / 100f;
						}
					}
					orig.Invoke(self, damageInfo);
				};
				<>c.<>9__13_1 = val2;
				obj = (object)val2;
			}
			HealthComponent.TakeDamage += (hook_TakeDamage)obj;
		}
		if (value4)
		{
			object obj2 = <>c.<>9__13_2;
			if (obj2 == null)
			{
				hook_FireShiv val3 = delegate(orig_FireShiv orig, Bandit2FireShiv self)
				{
					//IL_0037: Unknown result type (might be due to invalid IL or missing references)
					//IL_003c: Unknown result type (might be due to invalid IL or missing references)
					//IL_0053: Unknown result type (might be due to invalid IL or missing references)
					//IL_006a: Unknown result type (might be due to invalid IL or missing references)
					//IL_006f: Unknown result type (might be due to invalid IL or missing references)
					//IL_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_0082: Unknown result type (might be due to invalid IL or missing references)
					//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
					//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
					//IL_00da: Unknown result type (might be due to invalid IL or missing references)
					//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
					if (Object.op_Implicit((Object)(object)Bandit2FireShiv.muzzleEffectPrefab))
					{
						EffectManager.SimpleMuzzleFlash(Bandit2FireShiv.muzzleEffectPrefab, ((EntityState)self).gameObject, Bandit2FireShiv.muzzleString, false);
					}
					if (((EntityState)self).isAuthority)
					{
						Ray aimRay = ((BaseState)self).GetAimRay();
						if ((Object)(object)self.projectilePrefab != (Object)null)
						{
							FireProjectileInfo val21 = default(FireProjectileInfo);
							val21.projectilePrefab = self.projectilePrefab;
							val21.position = ((Ray)(ref aimRay)).origin;
							val21.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction);
							val21.owner = ((EntityState)self).gameObject;
							val21.damage = ((BaseState)self).damageStat * self.damageCoefficient;
							val21.force = self.force;
							val21.crit = ((BaseState)self).RollCrit();
							val21.damageTypeOverride = DamageTypeCombo.op_Implicit((DamageType)134217760);
							FireProjectileInfo val22 = val21;
							ProjectileManager.instance.FireProjectile(val22);
						}
					}
				};
				<>c.<>9__13_2 = val3;
				obj2 = (object)val3;
			}
			Bandit2FireShiv.FireShiv += (hook_FireShiv)obj2;
		}
		if (value2)
		{
			CharacterBody component = val.GetComponent<CharacterBody>();
			HitBoxGroup componentInChildren = ((Component)component).GetComponentInChildren<HitBoxGroup>();
			if (componentInChildren.groupName == "SlashBlade")
			{
				Transform transform = ((Component)componentInChildren.hitBoxes[0]).transform;
				transform.localScale = new Vector3(transform.localScale.x, transform.localScale.y * 1.4f, transform.localScale.z * 1.3f);
				transform.localPosition += new Vector3(0f, 0f, 1f);
			}
			Keyframe val4 = default(Keyframe);
			((Keyframe)(ref val4))..ctor(0f, 3f, -8.182907f, -3.3333333f, 0f, 0.058712736f);
			((Keyframe)(ref val4)).weightedMode = (WeightedMode)0;
			((Keyframe)(ref val4)).tangentMode = 65;
			Keyframe val5 = default(Keyframe);
			((Keyframe)(ref val5))..ctor(0.3f, 0f, -3.3333333f, -3.3333333f, 1f / 3f, 1f / 3f);
			((Keyframe)(ref val5)).weightedMode = (WeightedMode)0;
			((Keyframe)(ref val5)).tangentMode = 34;
			Keyframe[] keys = (Keyframe[])(object)new Keyframe[2] { val4, val5 };
			AnimationCurve knifeVelocity = new AnimationCurve
			{
				preWrapMode = (WrapMode)8,
				postWrapMode = (WrapMode)8,
				keys = keys
			};
			SlashBlade.OnEnter += (hook_OnEnter)delegate(orig_OnEnter orig, SlashBlade self)
			{
				if (noKnifeAttackSpeed)
				{
					((BasicMeleeAttack)self).ignoreAttackSpeed = true;
				}
				orig.Invoke(self);
				if (Object.op_Implicit((Object)(object)((EntityState)self).characterBody) && ((EntityState)self).characterBody.isSprinting)
				{
					((BasicMeleeAttack)self).forceForwardVelocity = true;
					((BasicMeleeAttack)self).forwardVelocityCurve = knifeVelocity;
				}
			};
			if (noKnifeAttackSpeed)
			{
				SetEntityStateField("entitystates.bandit2.weapon.slashblade", "ignoreAttackSpeed", "1");
			}
			object obj3 = <>c.<>9__13_14;
			if (obj3 == null)
			{
				Manipulator val6 = delegate(ILContext il)
				{
					//IL_0002: Unknown result type (might be due to invalid IL or missing references)
					//IL_0008: Expected O, but got Unknown
					//IL_0039: Unknown result type (might be due to invalid IL or missing references)
					ILCursor val20 = new ILCursor(il);
					val20.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "Gesture, Additive")
					});
					val20.Emit(OpCodes.Ldarg_0);
					val20.EmitDelegate<Func<string, ThrowSmokebomb, string>>((Func<string, ThrowSmokebomb, string>)delegate(string animLayer, ThrowSmokebomb self)
					{
						//IL_002d: Unknown result type (might be due to invalid IL or missing references)
						//IL_0032: Unknown result type (might be due to invalid IL or missing references)
						Animator modelAnimator4 = ((EntityState)self).GetModelAnimator();
						if (Object.op_Implicit((Object)(object)modelAnimator4))
						{
							int layerIndex4 = modelAnimator4.GetLayerIndex("Gesture, Additive");
							if (layerIndex4 >= 0)
							{
								AnimatorStateInfo currentAnimatorStateInfo4 = modelAnimator4.GetCurrentAnimatorStateInfo(layerIndex4);
								if (((AnimatorStateInfo)(ref currentAnimatorStateInfo4)).IsName("SlashBlade"))
								{
									return "BanditTweaksInvalidLayer";
								}
							}
						}
						return animLayer;
					});
				};
				<>c.<>9__13_14 = val6;
				obj3 = (object)val6;
			}
			ThrowSmokebomb.OnEnter += (Manipulator)obj3;
			object obj4 = <>c.<>9__13_15;
			if (obj4 == null)
			{
				Manipulator val7 = delegate(ILContext il)
				{
					//IL_0002: Unknown result type (might be due to invalid IL or missing references)
					//IL_0008: Expected O, but got Unknown
					//IL_0039: Unknown result type (might be due to invalid IL or missing references)
					ILCursor val19 = new ILCursor(il);
					val19.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "Gesture, Additive")
					});
					val19.Emit(OpCodes.Ldarg_0);
					val19.EmitDelegate<Func<string, ThrowSmokebomb, string>>((Func<string, ThrowSmokebomb, string>)delegate(string animLayer, ThrowSmokebomb self)
					{
						//IL_002d: Unknown result type (might be due to invalid IL or missing references)
						//IL_0032: Unknown result type (might be due to invalid IL or missing references)
						Animator modelAnimator3 = ((EntityState)self).GetModelAnimator();
						if (Object.op_Implicit((Object)(object)modelAnimator3))
						{
							int layerIndex3 = modelAnimator3.GetLayerIndex("Gesture, Additive");
							if (layerIndex3 >= 0)
							{
								AnimatorStateInfo currentAnimatorStateInfo3 = modelAnimator3.GetCurrentAnimatorStateInfo(layerIndex3);
								if (((AnimatorStateInfo)(ref currentAnimatorStateInfo3)).IsName("SlashBlade"))
								{
									return "BanditTweaksInvalidLayer";
								}
							}
						}
						return animLayer;
					});
				};
				<>c.<>9__13_15 = val7;
				obj4 = (object)val7;
			}
			Bandit2FirePrimaryBase.OnEnter += (Manipulator)obj4;
			object obj5 = <>c.<>9__13_16;
			if (obj5 == null)
			{
				Manipulator val8 = delegate(ILContext il)
				{
					//IL_0002: Unknown result type (might be due to invalid IL or missing references)
					//IL_0008: Expected O, but got Unknown
					//IL_0039: Unknown result type (might be due to invalid IL or missing references)
					ILCursor val18 = new ILCursor(il);
					val18.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "Gesture, Additive")
					});
					val18.Emit(OpCodes.Ldarg_0);
					val18.EmitDelegate<Func<string, ThrowSmokebomb, string>>((Func<string, ThrowSmokebomb, string>)delegate(string animLayer, ThrowSmokebomb self)
					{
						//IL_002d: Unknown result type (might be due to invalid IL or missing references)
						//IL_0032: Unknown result type (might be due to invalid IL or missing references)
						Animator modelAnimator2 = ((EntityState)self).GetModelAnimator();
						if (Object.op_Implicit((Object)(object)modelAnimator2))
						{
							int layerIndex2 = modelAnimator2.GetLayerIndex("Gesture, Additive");
							if (layerIndex2 >= 0)
							{
								AnimatorStateInfo currentAnimatorStateInfo2 = modelAnimator2.GetCurrentAnimatorStateInfo(layerIndex2);
								if (((AnimatorStateInfo)(ref currentAnimatorStateInfo2)).IsName("SlashBlade"))
								{
									return "BanditTweaksInvalidLayer";
								}
							}
						}
						return animLayer;
					});
				};
				<>c.<>9__13_16 = val8;
				obj5 = (object)val8;
			}
			Reload.OnEnter += (Manipulator)obj5;
			object obj6 = <>c.<>9__13_17;
			if (obj6 == null)
			{
				Manipulator val9 = delegate(ILContext il)
				{
					//IL_0002: Unknown result type (might be due to invalid IL or missing references)
					//IL_0008: Expected O, but got Unknown
					//IL_0039: Unknown result type (might be due to invalid IL or missing references)
					ILCursor val17 = new ILCursor(il);
					val17.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "Gesture, Additive")
					});
					val17.Emit(OpCodes.Ldarg_0);
					val17.EmitDelegate<Func<string, ThrowSmokebomb, string>>((Func<string, ThrowSmokebomb, string>)delegate(string animLayer, ThrowSmokebomb self)
					{
						//IL_002d: Unknown result type (might be due to invalid IL or missing references)
						//IL_0032: Unknown result type (might be due to invalid IL or missing references)
						Animator modelAnimator = ((EntityState)self).GetModelAnimator();
						if (Object.op_Implicit((Object)(object)modelAnimator))
						{
							int layerIndex = modelAnimator.GetLayerIndex("Gesture, Additive");
							if (layerIndex >= 0)
							{
								AnimatorStateInfo currentAnimatorStateInfo = modelAnimator.GetCurrentAnimatorStateInfo(layerIndex);
								if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("SlashBlade"))
								{
									return "BanditTweaksInvalidLayer";
								}
							}
						}
						return animLayer;
					});
				};
				<>c.<>9__13_17 = val9;
				obj6 = (object)val9;
			}
			EnterReload.OnEnter += (Manipulator)obj6;
		}
		bool cloakRequireRepress = !((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("03 - Utility", "Auto Cloak when Holding"), true, new ConfigDescription("Holding down the Utility button cloaks you as soon as it is off cooldown.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		float minCloakDuration = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("03 - Utility", "Minimum Cloak Duration"), 0.3f, new ConfigDescription("Minimum duration before other skills can be used after cloaking if Cloak Requires re-press is disabled.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		if (minCloakDuration <= 0f)
		{
			cloakRequireRepress = true;
		}
		slayerFix = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("04 - Special", "Slayer Fix"), true, new ConfigDescription("*SERVER-SIDE* Slayer (bonus damage against low HP enemies) now affects procs.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		bool specialHold = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("04 - Special", "Hold to Aim"), true, new ConfigDescription("The Special button can be held down to aim your shot. The shot will only shoot once you release.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		bool specialSprintCancel = ((BaseUnityPlugin)this).Config.Bind<bool>(new ConfigDefinition("04 - Special", "Cancel by Sprinting"), false, new ConfigDescription("Sprinting cancels your special.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		float graceDurationLocalUser = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("04 - Special", "Grace Period Duration - Host"), 0.25f, new ConfigDescription("*SERVER-SIDE* Special on-kill grace period for Host and Singleplayer. 0 disables.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		float graceDurationClient = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("04 - Special", "Grace Period Duration - Client"), 0.5f, new ConfigDescription("*SERVER-SIDE* Special on-kill grace period for online clients. 0 disables.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		float executeThreshold = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("04 - Special", "Execute Threshold"), 0f, new ConfigDescription("*SERVER-SIDE* Bandit's Specials instanatly kill enemies below this HP percent. 0 = disabled, 1.0 = 100% HP.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
		if (RiskyModLoaded)
		{
			slayerFix = false;
			graceDurationLocalUser = 0f;
			graceDurationClient = 0f;
		}
		GracePeriodComponent.graceDurationLocalUser = graceDurationLocalUser;
		GracePeriodComponent.graceDurationClient = graceDurationClient;
		SkillLocator component2 = val.GetComponent<SkillLocator>();
		SkillDef val10 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Bandit2/FireShotgun2.asset").WaitForCompletion();
		SkillDef val11 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Bandit2/Bandit2Blast.asset").WaitForCompletion();
		SkillDef val12 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Bandit2/ThrowSmokebomb.asset").WaitForCompletion();
		SkillDef val13 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Bandit2/ResetRevolver.asset").WaitForCompletion();
		SkillDef val14 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Bandit2/SkullRevolver.asset").WaitForCompletion();
		val12.mustKeyPress = cloakRequireRepress;
		val13.canceledFromSprinting = specialSprintCancel;
		val14.canceledFromSprinting = specialSprintCancel;
		if (burstBulletRadius > 0f)
		{
			FireShotgun2.ModifyBullet += (hook_ModifyBullet)delegate(orig_ModifyBullet orig, FireShotgun2 self, BulletAttack bulletAttack)
			{
				bulletAttack.radius = burstBulletRadius;
				orig.Invoke(self, bulletAttack);
			};
		}
		if (blastBulletRadius > 0f)
		{
			Bandit2FireRifle.ModifyBullet += (hook_ModifyBullet)delegate(orig_ModifyBullet orig, Bandit2FireRifle self, BulletAttack bulletAttack)
			{
				bulletAttack.radius = blastBulletRadius;
				orig.Invoke(self, bulletAttack);
			};
		}
		if (flag2)
		{
			val10.mustKeyPress = false;
			val10.interruptPriority = (InterruptPriority)((!value) ? 1 : 0);
			val11.mustKeyPress = false;
			val11.interruptPriority = (InterruptPriority)((!value) ? 1 : 0);
			object obj7 = <>c.<>9__13_5;
			if (obj7 == null)
			{
				hook_GetMinimumInterruptPriority val15 = (orig_GetMinimumInterruptPriority orig, Bandit2FirePrimaryBase self) => (((EntityState)self).fixedAge <= self.minimumDuration && ((EntityState)self).inputBank.skill1.wasDown) ? ((InterruptPriority)2) : ((InterruptPriority)0);
				<>c.<>9__13_5 = val15;
				obj7 = (object)val15;
			}
			Bandit2FirePrimaryBase.GetMinimumInterruptPriority += (hook_GetMinimumInterruptPriority)obj7;
			Bandit2FirePrimaryBase.OnEnter += (hook_OnEnter)delegate(orig_OnEnter orig, Bandit2FirePrimaryBase self)
			{
				if (fireMode == BanditFireMode.Tap)
				{
					self.minimumBaseDuration = autoFireDuration;
				}
				else
				{
					self.minimumBaseDuration = burstFireDuration;
				}
				orig.Invoke(self);
			};
		}
		val.AddComponent<QuickdrawComponent>();
		if (!cloakRequireRepress)
		{
			StealthMode.GetMinimumInterruptPriority += (hook_GetMinimumInterruptPriority)((orig_GetMinimumInterruptPriority orig, StealthMode self) => (InterruptPriority)((((EntityState)self).fixedAge > minCloakDuration) ? 1 : 5));
		}
		ThrowSmokebomb.GetMinimumInterruptPriority += (hook_GetMinimumInterruptPriority)((orig_GetMinimumInterruptPriority orig, ThrowSmokebomb self) => (!cloakRequireRepress) ? ((InterruptPriority)((((EntityState)self).fixedAge > minCloakDuration) ? 2 : 3)) : orig.Invoke(self));
		BaseSidearmState.FixedUpdate += (hook_FixedUpdate)delegate(orig_FixedUpdate orig, BaseSidearmState self)
		{
			if (!specialSprintCancel)
			{
				((EntityState)self).fixedAge = ((EntityState)self).fixedAge + ((EntityState)self).GetDeltaTime();
			}
			else
			{
				orig.Invoke(self);
			}
		};
		BasePrepSidearmRevolverState.FixedUpdate += (hook_FixedUpdate)delegate(orig_FixedUpdate orig, BasePrepSidearmRevolverState self)
		{
			if (specialHold)
			{
				((EntityState)self).fixedAge = ((EntityState)self).fixedAge + ((EntityState)self).GetDeltaTime();
				if (((EntityState)self).fixedAge > ((BaseSidearmState)self).duration && !((EntityState)self).inputBank.skill4.down)
				{
					((EntityState)self).outer.SetNextState(self.GetNextState());
				}
			}
			else
			{
				orig.Invoke(self);
			}
		};
		HealthComponent.TakeDamage += (hook_TakeDamage)delegate(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: 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_0029: Invalid comparison between Unknown and I4
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_0253: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: 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_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0316: Unknown result type (might be due to invalid IL or missing references)
			if (slayerFix && (int)DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)524288)) > 0)
			{
				damageInfo.damageType &= DamageTypeCombo.op_Implicit((DamageType)(-524289));
				damageInfo.damage *= Mathf.Lerp(3f, 1f, self.combinedHealthFraction);
			}
			DamageType dt = DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)268435460));
			GracePeriodComponent gracePeriodComponent = null;
			CharacterBody val16 = null;
			if (Object.op_Implicit((Object)(object)damageInfo.attacker))
			{
				val16 = damageInfo.attacker.GetComponent<CharacterBody>();
				if (Object.op_Implicit((Object)(object)val16) && val16.bodyIndex != Bandit2Index)
				{
					val16 = null;
				}
			}
			if (Object.op_Implicit((Object)(object)val16) && graceDurationLocalUser > 0f)
			{
				gracePeriodComponent = ((Component)self).gameObject.GetComponent<GracePeriodComponent>();
				if (!Object.op_Implicit((Object)(object)gracePeriodComponent))
				{
					gracePeriodComponent = ((Component)self).gameObject.AddComponent<GracePeriodComponent>();
				}
				if (self.alive && DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)4)) == 0L && gracePeriodComponent.HasReset(val16))
				{
					damageInfo.damageType |= DamageTypeCombo.op_Implicit((DamageType)4);
				}
				if (self.alive && DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)268435456)) == 0L && gracePeriodComponent.HasSkull(val16))
				{
					damageInfo.damageType |= DamageTypeCombo.op_Implicit((DamageType)268435456);
				}
			}
			orig.Invoke(self, damageInfo);
			if (Object.op_Implicit((Object)(object)gracePeriodComponent) && Object.op_Implicit((Object)(object)val16) && Object.op_Implicit((Object)(object)val16.master) && !damageInfo.rejected)
			{
				float graceDuration = (IsLocalUser(val16) ? GracePeriodComponent.graceDurationLocalUser : GracePeriodComponent.graceDurationClient);
				if (self.alive)
				{
					gracePeriodComponent.AddTimer(val16, dt, graceDuration);
				}
				else
				{
					gracePeriodComponent.TriggerEffects(val16);
				}
			}
			if (self.alive && executeThreshold > 0f && DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)268435460)) != 0 && Object.op_Implicit((Object)(object)val16))
			{
				float num = (self.isInFrozenState ? 0.3f : 0f);
				if (val16.executeEliteHealthFraction > num)
				{
					num = val16.executeEliteHealthFraction;
				}
				num += executeThreshold;
				if (executeThreshold > self.combinedHealthFraction)
				{
					damageInfo.damage = self.combinedHealth / 2f + 1f;
					damageInfo.damageType |= DamageTypeCombo.op_Implicit((DamageType)2);
					damageInfo.procCoefficient = 0f;
					damageInfo.crit = true;
					damageInfo.damageColorIndex = (DamageColorIndex)5;
					orig.Invoke(self, damageInfo);
				}
			}
		};
		SkillIcon.Update += (hook_Update)delegate(orig_Update orig, SkillIcon self)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Invalid comparison between Unknown and I4
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (enableFireSelect && Object.op_Implicit((Object)(object)self.targetSkill) && (int)self.targetSkillSlot == 0 && self.targetSkill.characterBody.bodyIndex == Bandit2Index)
			{
				((Component)self.stockText).gameObject.SetActive(true);
				((TMP_Text)self.stockText).fontSize = 12f;
				((TMP_Text)self.stockText).SetText(fireMode.ToString() + "\n" + self.targetSkill.stock, true);
			}
		};
	}

	public static bool IsLocalUser(CharacterBody playerBody)
	{
		foreach (LocalUser readOnlyLocalUsers in LocalUserManager.readOnlyLocalUsersList)
		{
			if ((Object)(object)playerBody == (Object)(object)readOnlyLocalUsers.cachedBody)
			{
				return true;
			}
		}
		return false;
	}

	private static float GetBandit2SlashBladeMinDurationHook(SlashBlade self)
	{
		return 0.3f;
	}

	public void ToggleFireMode()
	{
		if (fireMode == BanditFireMode.Tap)
		{
			fireMode = BanditFireMode.Spam;
		}
		else
		{
			fireMode = BanditFireMode.Tap;
		}
	}

	public void Update()
	{
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		if (enableFireSelect)
		{
			if (selectWithScrollWheel && Input.GetAxis("Mouse ScrollWheel") != 0f)
			{
				ToggleFireMode();
			}
			if (Input.GetKeyDown(selectButton))
			{
				ToggleFireMode();
			}
			if (Input.GetKeyDown(defaultButton))
			{
				fireMode = BanditFireMode.Tap;
			}
			if (Input.GetKeyDown(burstButton))
			{
				fireMode = BanditFireMode.Spam;
			}
		}
	}

	internal bool SetEntityStateField(string entityStateName, string fieldName, string value)
	{
		EntityStateConfiguration val = LegacyResourcesAPI.Load<EntityStateConfiguration>("entitystateconfigurations/" + entityStateName);
		for (int i = 0; i < val.serializedFieldsCollection.serializedFields.Length; i++)
		{
			if (val.serializedFieldsCollection.serializedFields[i].fieldName == fieldName)
			{
				val.serializedFieldsCollection.serializedFields[i].fieldValue.stringValue = value;
				return true;
			}
		}
		return false;
	}
}
public class GracePeriodComponent : MonoBehaviour
{
	public class BanditTimer
	{
		public SkillLocator skillLocator;

		public float length;

		public DamageType damageType;

		public CharacterBody body;

		public BanditTimer(CharacterBody b, SkillLocator o, float l, DamageType dt)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			body = b;
			skillLocator = o;
			length = l;
			damageType = dt;
		}
	}

	public static float graceDurationLocalUser = 0.5f;

	public static float graceDurationClient = 1f;

	private List<BanditTimer> hitList = new List<BanditTimer>();

	private List<BanditTimer> del = new List<BanditTimer>();

	public void FixedUpdate()
	{
		del.Clear();
		foreach (BanditTimer hit in hitList)
		{
			if (Object.op_Implicit((Object)(object)hit.skillLocator))
			{
				hit.length -= Time.fixedDeltaTime;
				if (hit.length <= 0f)
				{
					del.Add(hit);
				}
			}
		}
		foreach (BanditTimer item in del)
		{
			hitList.Remove(item);
		}
		del.Clear();
	}

	public void TriggerEffects(CharacterBody killerBody)
	{
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bd: Invalid comparison between Unknown and I4
		//IL_00d4: 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_00e0: Invalid comparison between Unknown and I4
		List<CharacterBody> list = new List<CharacterBody>();
		foreach (BanditTimer hit in hitList)
		{
			bool flag = false;
			foreach (CharacterBody item in list)
			{
				if ((Object)(object)item == (Object)(object)hit.body)
				{
					flag = true;
					break;
				}
			}
			if (!flag && (Object)(object)hit.body != (Object)(object)killerBody && Object.op_Implicit((Object)(object)hit.skillLocator) && ((Behaviour)hit.skillLocator).isActiveAndEnabled)
			{
				list.Add(hit.body);
				if ((hit.damageType & 4) > 0)
				{
					hit.skillLocator.ResetSkills();
				}
				if ((hit.damageType & 0x10000000) > 0)
				{
					hit.body.AddBuff(Buffs.BanditSkull);
				}
			}
		}
		hitList.Clear();
	}

	public void AddTimer(CharacterBody b, DamageType dt, float graceDuration)
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)b.skillLocator))
		{
			BanditTimer item = new BanditTimer(b, b.skillLocator, graceDuration, dt);
			hitList.Add(item);
		}
	}

	public bool HasSkull(CharacterBody body)
	{
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Invalid comparison between Unknown and I4
		foreach (BanditTimer hit in hitList)
		{
			if ((Object)(object)hit.body == (Object)(object)body && (hit.damageType & 0x10000000) > 0)
			{
				return true;
			}
		}
		return false;
	}

	public bool HasReset(CharacterBody body)
	{
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Invalid comparison between Unknown and I4
		foreach (BanditTimer hit in hitList)
		{
			if ((Object)(object)hit.body == (Object)(object)body && (hit.damageType & 4) > 0)
			{
				return true;
			}
		}
		return false;
	}
}
internal class QuickdrawComponent : MonoBehaviour
{
	private SkillLocator sk;

	private int prevSecondaryStock = 0;

	private int prevUtilityStock = 0;

	private int prevSpecialStock = 0;

	public void Awake()
	{
		sk = ((Component)this).GetComponent<SkillLocator>();
		if (!Object.op_Implicit((Object)(object)sk))
		{
			Object.Destroy((Object)(object)this);
		}
	}

	public void FixedUpdate()
	{
		if (BanditTweaks.quickdrawEnabled)
		{
			if (sk.secondary.stock < prevSecondaryStock || sk.utility.stock < prevUtilityStock || sk.special.stock < prevSpecialStock)
			{
				sk.primary.stock = sk.primary.maxStock;
			}
			prevSecondaryStock = sk.secondary.stock;
			prevUtilityStock = sk.utility.stock;
			prevSpecialStock = sk.special.stock;
		}
		if (sk.primary.stock > sk.primary.maxStock)
		{
			sk.primary.stock = sk.primary.maxStock;
		}
	}
}