Decompiled source of Bandit Tweaks v1.9.1

BanditTweaks.dll

Decompiled 2 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 MonoMod.RuntimeDetour;
using On.EntityStates.Bandit2;
using On.EntityStates.Bandit2.Weapon;
using On.RoR2;
using On.RoR2.UI;
using R2API.Utils;
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.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("BanditTweaks")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+0ded376cae624df28f208095dc3c0126e0426cf8")]
[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.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.Moffein.BanditTweaks", "Bandit Tweaks", "1.9.1")]
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_Init <>9__12_0;

		public static hook_TakeDamage <>9__12_2;

		public static hook_FireShiv <>9__12_3;

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

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

		public static Manipulator <>9__12_15;

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

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

		public static Manipulator <>9__12_16;

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

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

		public static Manipulator <>9__12_17;

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

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

		public static Manipulator <>9__12_18;

		public static hook_GetMinimumInterruptPriority <>9__12_6;

		internal void <Awake>b__12_0(orig_Init orig)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke();
			Bandit2Index = BodyCatalog.FindBodyIndex("Bandit2Body");
		}

		internal void <Awake>b__12_2(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__12_3(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_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: 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 = (DamageType)134217760;
					FireProjectileInfo val2 = val;
					ProjectileManager.instance.FireProjectile(val2);
				}
			}
		}

		internal void <Awake>b__12_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__12_19(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdstr(x, "Gesture, Additive");
		}

		internal string <Awake>b__12_20(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__12_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__12_21(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdstr(x, "Gesture, Additive");
		}

		internal string <Awake>b__12_22(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__12_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__12_23(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdstr(x, "Gesture, Additive");
		}

		internal string <Awake>b__12_24(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__12_18(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__12_25(Instruction x)
		{
			return ILPatternMatchingExt.MatchLdstr(x, "Gesture, Additive");
		}

		internal string <Awake>b__12_26(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__12_6(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;
	}

	public void Awake()
	{
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: Expected O, but got Unknown
		//IL_00ae: Expected O, but got Unknown
		//IL_00c8: 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_00e3: Expected O, but got Unknown
		//IL_00e3: Expected O, but got Unknown
		//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0115: Expected O, but got Unknown
		//IL_0115: Expected O, but got Unknown
		//IL_0130: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Unknown result type (might be due to invalid IL or missing references)
		//IL_014b: Expected O, but got Unknown
		//IL_014b: Expected O, but got Unknown
		//IL_0166: Unknown result type (might be due to invalid IL or missing references)
		//IL_0177: Unknown result type (might be due to invalid IL or missing references)
		//IL_0181: Expected O, but got Unknown
		//IL_0181: Expected O, but got Unknown
		//IL_0181: Unknown result type (might be due to invalid IL or missing references)
		//IL_0186: Unknown result type (might be due to invalid IL or missing references)
		//IL_019c: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b7: Expected O, but got Unknown
		//IL_01b7: Expected O, but got Unknown
		//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ed: Expected O, but got Unknown
		//IL_01ed: Expected O, but got Unknown
		//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0208: Unknown result type (might be due to invalid IL or missing references)
		//IL_021d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0227: Expected O, but got Unknown
		//IL_0227: Expected O, but got Unknown
		//IL_0242: Unknown result type (might be due to invalid IL or missing references)
		//IL_0257: Unknown result type (might be due to invalid IL or missing references)
		//IL_0261: Expected O, but got Unknown
		//IL_0261: Expected O, but got Unknown
		//IL_027b: Unknown result type (might be due to invalid IL or missing references)
		//IL_028c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0296: Expected O, but got Unknown
		//IL_0296: Expected O, but got Unknown
		//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cd: Expected O, but got Unknown
		//IL_02cd: Expected O, but got Unknown
		//IL_02e8: 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_0307: Expected O, but got Unknown
		//IL_0307: Expected O, but got Unknown
		//IL_0322: Unknown result type (might be due to invalid IL or missing references)
		//IL_0333: Unknown result type (might be due to invalid IL or missing references)
		//IL_033d: Expected O, but got Unknown
		//IL_033d: Expected O, but got Unknown
		//IL_0358: Unknown result type (might be due to invalid IL or missing references)
		//IL_0369: Unknown result type (might be due to invalid IL or missing references)
		//IL_0373: Expected O, but got Unknown
		//IL_0373: Expected O, but got Unknown
		//IL_038d: Unknown result type (might be due to invalid IL or missing references)
		//IL_039e: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a8: Expected O, but got Unknown
		//IL_03a8: Expected O, but got Unknown
		//IL_03c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_03db: Expected O, but got Unknown
		//IL_03db: Expected O, but got Unknown
		//IL_03f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0406: Unknown result type (might be due to invalid IL or missing references)
		//IL_0410: Expected O, but got Unknown
		//IL_0410: Expected O, but got Unknown
		//IL_0427: Unknown result type (might be due to invalid IL or missing references)
		//IL_0438: Unknown result type (might be due to invalid IL or missing references)
		//IL_0442: Expected O, but got Unknown
		//IL_0442: Expected O, but got Unknown
		//IL_0459: Unknown result type (might be due to invalid IL or missing references)
		//IL_046a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0474: Expected O, but got Unknown
		//IL_0474: Expected O, but got Unknown
		//IL_0072: 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_007d: Expected O, but got Unknown
		//IL_04c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_04cc: Expected O, but got Unknown
		//IL_04eb: 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_04f6: Expected O, but got Unknown
		//IL_0792: Unknown result type (might be due to invalid IL or missing references)
		//IL_07a3: Unknown result type (might be due to invalid IL or missing references)
		//IL_07ad: Expected O, but got Unknown
		//IL_07ad: Expected O, but got Unknown
		//IL_07cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_07e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_07ea: Expected O, but got Unknown
		//IL_07ea: Expected O, but got Unknown
		//IL_051a: Unknown result type (might be due to invalid IL or missing references)
		//IL_051f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0525: Expected O, but got Unknown
		//IL_0824: Unknown result type (might be due to invalid IL or missing references)
		//IL_0835: Unknown result type (might be due to invalid IL or missing references)
		//IL_083f: Expected O, but got Unknown
		//IL_083f: Expected O, but got Unknown
		//IL_085a: Unknown result type (might be due to invalid IL or missing references)
		//IL_086b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0875: Expected O, but got Unknown
		//IL_0875: Expected O, but got Unknown
		//IL_0890: Unknown result type (might be due to invalid IL or missing references)
		//IL_08a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_08ab: Expected O, but got Unknown
		//IL_08ab: Expected O, but got Unknown
		//IL_08c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_08db: Unknown result type (might be due to invalid IL or missing references)
		//IL_08e5: Expected O, but got Unknown
		//IL_08e5: Expected O, but got Unknown
		//IL_08ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0914: Unknown result type (might be due to invalid IL or missing references)
		//IL_091e: Expected O, but got Unknown
		//IL_091e: Expected O, but got Unknown
		//IL_0936: Unknown result type (might be due to invalid IL or missing references)
		//IL_094b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0955: Expected O, but got Unknown
		//IL_0955: Expected O, but got Unknown
		//IL_0660: Unknown result type (might be due to invalid IL or missing references)
		//IL_0662: Unknown result type (might be due to invalid IL or missing references)
		//IL_066a: Unknown result type (might be due to invalid IL or missing references)
		//IL_066c: 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_0678: Unknown result type (might be due to invalid IL or missing references)
		//IL_0680: Unknown result type (might be due to invalid IL or missing references)
		//IL_0688: Unknown result type (might be due to invalid IL or missing references)
		//IL_0696: Expected O, but got Unknown
		//IL_069e: Unknown result type (might be due to invalid IL or missing references)
		//IL_06a8: Expected O, but got Unknown
		//IL_0584: Unknown result type (might be due to invalid IL or missing references)
		//IL_0590: Unknown result type (might be due to invalid IL or missing references)
		//IL_05a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_05b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_05c0: 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_05d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_09a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_09a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_09b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_09be: Unknown result type (might be due to invalid IL or missing references)
		//IL_09ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_09d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_09e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_09e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_09f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_09fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_06e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_06eb: Expected O, but got Unknown
		//IL_0a4a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a54: Expected O, but got Unknown
		//IL_0700: Unknown result type (might be due to invalid IL or missing references)
		//IL_0705: Unknown result type (might be due to invalid IL or missing references)
		//IL_070b: Expected O, but got Unknown
		//IL_0a71: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a7b: Expected O, but got Unknown
		//IL_0725: Unknown result type (might be due to invalid IL or missing references)
		//IL_072a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0730: Expected O, but got Unknown
		//IL_074a: Unknown result type (might be due to invalid IL or missing references)
		//IL_074f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0755: Expected O, but got Unknown
		//IL_0b1c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b26: Expected O, but got Unknown
		//IL_0b2e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b38: Expected O, but got Unknown
		//IL_0b40: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b4a: Expected O, but got Unknown
		//IL_0b52: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b5c: Expected O, but got Unknown
		//IL_0b64: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b6e: Expected O, but got Unknown
		//IL_0b09: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b13: Expected O, but got Unknown
		//IL_076f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0774: Unknown result type (might be due to invalid IL or missing references)
		//IL_077a: Expected O, but got Unknown
		//IL_0a97: 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_0adf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ae9: Expected O, but got Unknown
		//IL_0ac7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0acc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ad2: 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");
		object obj = <>c.<>9__12_0;
		if (obj == null)
		{
			hook_Init val2 = delegate(orig_Init orig)
			{
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke();
				Bandit2Index = BodyCatalog.FindBodyIndex("Bandit2Body");
			};
			<>c.<>9__12_0 = val2;
			obj = (object)val2;
		}
		BodyCatalog.Init += (hook_Init)obj;
		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 obj2 = <>c.<>9__12_2;
			if (obj2 == null)
			{
				hook_TakeDamage val3 = 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__12_2 = val3;
				obj2 = (object)val3;
			}
			HealthComponent.TakeDamage += (hook_TakeDamage)obj2;
		}
		if (value4)
		{
			object obj3 = <>c.<>9__12_3;
			if (obj3 == null)
			{
				hook_FireShiv val4 = 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_00d3: Unknown result type (might be due to invalid IL or missing references)
					//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
					//IL_00dc: 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 val23 = default(FireProjectileInfo);
							val23.projectilePrefab = self.projectilePrefab;
							val23.position = ((Ray)(ref aimRay)).origin;
							val23.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction);
							val23.owner = ((EntityState)self).gameObject;
							val23.damage = ((BaseState)self).damageStat * self.damageCoefficient;
							val23.force = self.force;
							val23.crit = ((BaseState)self).RollCrit();
							val23.damageTypeOverride = (DamageType)134217760;
							FireProjectileInfo val24 = val23;
							ProjectileManager.instance.FireProjectile(val24);
						}
					}
				};
				<>c.<>9__12_3 = val4;
				obj3 = (object)val4;
			}
			Bandit2FireShiv.FireShiv += (hook_FireShiv)obj3;
		}
		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 val5 = default(Keyframe);
			((Keyframe)(ref val5))..ctor(0f, 3f, -8.182907f, -3.3333333f, 0f, 0.058712736f);
			((Keyframe)(ref val5)).weightedMode = (WeightedMode)0;
			((Keyframe)(ref val5)).tangentMode = 65;
			Keyframe val6 = default(Keyframe);
			((Keyframe)(ref val6))..ctor(0.3f, 0f, -3.3333333f, -3.3333333f, 1f / 3f, 1f / 3f);
			((Keyframe)(ref val6)).weightedMode = (WeightedMode)0;
			((Keyframe)(ref val6)).tangentMode = 34;
			Keyframe[] keys = (Keyframe[])(object)new Keyframe[2] { val5, val6 };
			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)
			{
				Hook val7 = new Hook((MethodBase)Reflection.GetMethodCached(typeof(SlashBlade), "get_minimumDuration"), Reflection.GetMethodCached(typeof(BanditTweaks), "GetBandit2SlashBladeMinDurationHook"));
			}
			object obj4 = <>c.<>9__12_15;
			if (obj4 == 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 val22 = new ILCursor(il);
					val22.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "Gesture, Additive")
					});
					val22.Emit(OpCodes.Ldarg_0);
					val22.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__12_15 = val8;
				obj4 = (object)val8;
			}
			ThrowSmokebomb.OnEnter += (Manipulator)obj4;
			object obj5 = <>c.<>9__12_16;
			if (obj5 == 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 val21 = new ILCursor(il);
					val21.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchLdstr(x, "Gesture, Additive")
					});
					val21.Emit(OpCodes.Ldarg_0);
					val21.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__12_16 = val9;
				obj5 = (object)val9;
			}
			Bandit2FirePrimaryBase.OnEnter += (Manipulator)obj5;
			object obj6 = <>c.<>9__12_17;
			if (obj6 == null)
			{
				Manipulator val10 = 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 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__12_17 = val10;
				obj6 = (object)val10;
			}
			Reload.OnEnter += (Manipulator)obj6;
			object obj7 = <>c.<>9__12_18;
			if (obj7 == null)
			{
				Manipulator val11 = 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 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__12_18 = val11;
				obj7 = (object)val11;
			}
			EnterReload.OnEnter += (Manipulator)obj7;
		}
		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 val12 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Bandit2/FireShotgun2.asset").WaitForCompletion();
		SkillDef val13 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Bandit2/Bandit2Blast.asset").WaitForCompletion();
		SkillDef val14 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Bandit2/ThrowSmokebomb.asset").WaitForCompletion();
		SkillDef val15 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Bandit2/ResetRevolver.asset").WaitForCompletion();
		SkillDef val16 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Bandit2/SkullRevolver.asset").WaitForCompletion();
		val14.mustKeyPress = cloakRequireRepress;
		val15.canceledFromSprinting = specialSprintCancel;
		val16.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)
		{
			val12.mustKeyPress = false;
			val12.interruptPriority = (InterruptPriority)((!value) ? 1 : 0);
			val13.mustKeyPress = false;
			val13.interruptPriority = (InterruptPriority)((!value) ? 1 : 0);
			object obj8 = <>c.<>9__12_6;
			if (obj8 == null)
			{
				hook_GetMinimumInterruptPriority val17 = (orig_GetMinimumInterruptPriority orig, Bandit2FirePrimaryBase self) => (((EntityState)self).fixedAge <= self.minimumDuration && ((EntityState)self).inputBank.skill1.wasDown) ? ((InterruptPriority)2) : ((InterruptPriority)0);
				<>c.<>9__12_6 = val17;
				obj8 = (object)val17;
			}
			Bandit2FirePrimaryBase.GetMinimumInterruptPriority += (hook_GetMinimumInterruptPriority)obj8;
			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 : 4));
		}
		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 + Time.fixedDeltaTime;
			}
			else
			{
				orig.Invoke(self);
			}
		};
		BasePrepSidearmRevolverState.FixedUpdate += (hook_FixedUpdate)delegate(orig_FixedUpdate orig, BasePrepSidearmRevolverState self)
		{
			if (specialHold)
			{
				((EntityState)self).fixedAge = ((EntityState)self).fixedAge + Time.fixedDeltaTime;
				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_001b: Invalid comparison between Unknown and I4
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: 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_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_020c: Invalid comparison between Unknown and I4
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_028b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_0292: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
			if (slayerFix && (damageInfo.damageType & 0x80000) > 0)
			{
				damageInfo.damageType = (DamageType)(damageInfo.damageType & -524289);
				damageInfo.damage *= Mathf.Lerp(3f, 1f, self.combinedHealthFraction);
			}
			DamageType dt = (DamageType)(damageInfo.damageType & 0x10000004);
			GracePeriodComponent gracePeriodComponent = null;
			CharacterBody val18 = null;
			if (Object.op_Implicit((Object)(object)damageInfo.attacker))
			{
				val18 = damageInfo.attacker.GetComponent<CharacterBody>();
				if (Object.op_Implicit((Object)(object)val18) && val18.bodyIndex != Bandit2Index)
				{
					val18 = null;
				}
			}
			if (Object.op_Implicit((Object)(object)val18) && graceDurationLocalUser > 0f)
			{
				gracePeriodComponent = ((Component)self).gameObject.GetComponent<GracePeriodComponent>();
				if (!Object.op_Implicit((Object)(object)gracePeriodComponent))
				{
					gracePeriodComponent = ((Component)self).gameObject.AddComponent<GracePeriodComponent>();
				}
				if (self.alive && (damageInfo.damageType & 4) == 0 && gracePeriodComponent.HasReset(val18))
				{
					damageInfo.damageType = (DamageType)(damageInfo.damageType | 4);
				}
				if (self.alive && (damageInfo.damageType & 0x10000000) == 0 && gracePeriodComponent.HasSkull(val18))
				{
					damageInfo.damageType = (DamageType)(damageInfo.damageType | 0x10000000);
				}
			}
			orig.Invoke(self, damageInfo);
			if (Object.op_Implicit((Object)(object)gracePeriodComponent) && Object.op_Implicit((Object)(object)val18) && Object.op_Implicit((Object)(object)val18.master) && !damageInfo.rejected)
			{
				float graceDuration = (IsLocalUser(val18) ? GracePeriodComponent.graceDurationLocalUser : GracePeriodComponent.graceDurationClient);
				if (self.alive)
				{
					gracePeriodComponent.AddTimer(val18, dt, graceDuration);
				}
				else
				{
					gracePeriodComponent.TriggerEffects(val18);
				}
			}
			if (self.alive && executeThreshold > 0f && (damageInfo.damageType & 0x10000004) > 0 && Object.op_Implicit((Object)(object)val18))
			{
				float num = (self.isInFrozenState ? 0.3f : 0f);
				if (val18.executeEliteHealthFraction > num)
				{
					num = val18.executeEliteHealthFraction;
				}
				num += executeThreshold;
				if (executeThreshold > self.combinedHealthFraction)
				{
					damageInfo.damage = self.combinedHealth / 2f + 1f;
					damageInfo.damageType = (DamageType)(damageInfo.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;
			}
		}
	}
}
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;
		}
	}
}