Decompiled source of RocketGatling v1.4.3

RocketGatling.dll

Decompiled 7 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using Configgy;
using HarmonyLib;
using RocketGatling;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("Ultracoins")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Ultracoins")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("9e04a71c-24d2-4cd7-b19b-0da76f660cc9")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace RocektGatling
{
	[BepInPlugin("plonk.rocketgatling", "RocketGatling", "1.4.2")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class RocketGatling : BaseUnityPlugin
	{
		public enum AlternateProjectile
		{
			StrayProjectile = 1,
			RevolverBeam,
			Rocket,
			Grenade
		}

		[HarmonyPatch]
		public class RocketGatlingPatches
		{
			[HarmonyPostfix]
			[HarmonyPatch(typeof(RocketLauncher), "Start")]
			public static void Start(RocketLauncher __instance)
			{
				if ((Object)(object)muzzleflash == (Object)null)
				{
					muzzleflash = __instance.muzzleFlash;
				}
			}

			[HarmonyPrefix]
			[HarmonyPatch(typeof(RocketLauncher), "Shoot")]
			public static void patch_PreUpdate(RocketLauncher __instance)
			{
				if (((ConfigValueElement<bool>)(object)Enabled_RocketGatling).Value)
				{
					if (((ConfigValueElement<float>)(object)RocketCoolDownFloat).Value < 0.33f)
					{
						__instance.muzzleFlash = __instance.clunkSound;
					}
					else
					{
						__instance.muzzleFlash = muzzleflash;
					}
				}
				if (!((ConfigValueElement<bool>)(object)Enabled_RocketGatling).Value && (Object)(object)__instance.muzzleFlash != (Object)(object)muzzleflash)
				{
					__instance.muzzleFlash = muzzleflash;
				}
				if (((ConfigValueElement<bool>)(object)rocketgrenade).Value && __instance.variation == 1)
				{
					__instance.rocket = malrailbeam;
				}
				if (!((ConfigValueElement<bool>)(object)rocketgrenade).Value || __instance.variation != 1)
				{
					__instance.rocket = rocket;
				}
				if (((ConfigValueElement<bool>)(object)Enabled_RocketGatling).Value)
				{
					if (!hasJaket)
					{
						__instance.rateOfFire = 1f / ((ConfigValueElement<float>)(object)RocketCoolDownFloat).Value;
					}
					else
					{
						float num = Mathf.Clamp(((ConfigValueElement<float>)(object)RocketCoolDownFloat).Value, 0f, 4f);
						__instance.rateOfFire = 1f / num;
					}
				}
				if (!((ConfigValueElement<bool>)(object)Enabled_RocketGatling).Value && __instance.rateOfFire != 1f)
				{
					__instance.rateOfFire = 1f;
				}
			}

			[HarmonyPrefix]
			[HarmonyPatch(typeof(Revolver), "Start")]
			public static void Start(Revolver __instance)
			{
				if (__instance.gunVariation == 1 && __instance.altVersion && ((ConfigValueElement<bool>)(object)Enabled_HudTips).Value)
				{
					SendHudMessage("<color=red>The alternate marksman is generally considered\nuseless by the community due to the alt piercer filling its role.</color>", 0, silent: false);
				}
			}

			[HarmonyPrefix]
			[HarmonyPatch(typeof(Revolver), "Shoot")]
			public static void RevolverStrongbeam(Revolver __instance, int shotType)
			{
				//IL_008b: Unknown result type (might be due to invalid IL or missing references)
				//IL_009b: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
				//IL_03f3: Unknown result type (might be due to invalid IL or missing references)
				//IL_0403: Unknown result type (might be due to invalid IL or missing references)
				//IL_0456: Unknown result type (might be due to invalid IL or missing references)
				//IL_045b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0212: Unknown result type (might be due to invalid IL or missing references)
				//IL_0222: Unknown result type (might be due to invalid IL or missing references)
				//IL_0275: Unknown result type (might be due to invalid IL or missing references)
				//IL_027a: 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_013d: 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_0187: Unknown result type (might be due to invalid IL or missing references)
				//IL_018c: Unknown result type (might be due to invalid IL or missing references)
				//IL_057b: 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_05de: Unknown result type (might be due to invalid IL or missing references)
				//IL_05e3: Unknown result type (might be due to invalid IL or missing references)
				//IL_04a0: Unknown result type (might be due to invalid IL or missing references)
				//IL_04a5: Unknown result type (might be due to invalid IL or missing references)
				//IL_04a9: Unknown result type (might be due to invalid IL or missing references)
				//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
				//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
				//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
				//IL_04ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_04f4: Unknown result type (might be due to invalid IL or missing references)
				//IL_030e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0313: Unknown result type (might be due to invalid IL or missing references)
				//IL_0628: Unknown result type (might be due to invalid IL or missing references)
				//IL_062d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0631: Unknown result type (might be due to invalid IL or missing references)
				//IL_0677: Unknown result type (might be due to invalid IL or missing references)
				//IL_067c: Unknown result type (might be due to invalid IL or missing references)
				Bounds bounds;
				if (((ConfigValueElement<bool>)(object)StrongPistolbeam).Value && !__instance.altVersion)
				{
					float num = 0f;
					num = ((!hasJaket) ? ((float)((ConfigValueElement<int>)(object)Beammult2).Value) : ((float)Mathf.Clamp(((ConfigValueElement<int>)(object)Beammult2).Value, 0, 12)));
					if (((ConfigValueElement<bool>)(object)Shootaltbeams1).Value || shotType == 2)
					{
						for (int i = 0; (float)i < num; i++)
						{
							GameObject val = Object.Instantiate<GameObject>(__instance.revolverBeamSuper, ((Component)__instance.cc).transform.position, ((Component)__instance.cc).transform.rotation * Quaternion.Euler(Random.Range(0f - ((ConfigValueElement<float>)(object)BeamSpread).Value, ((ConfigValueElement<float>)(object)BeamSpread).Value), Random.Range(0f - ((ConfigValueElement<float>)(object)BeamSpread).Value, ((ConfigValueElement<float>)(object)BeamSpread).Value), Random.Range(0f - ((ConfigValueElement<float>)(object)BeamSpread).Value, ((ConfigValueElement<float>)(object)BeamSpread).Value)));
							if (Object.op_Implicit((Object)(object)__instance.targeter.CurrentTarget) && __instance.targeter.IsAutoAimed)
							{
								Transform transform = val.transform;
								bounds = __instance.targeter.CurrentTarget.bounds;
								transform.LookAt(((Bounds)(ref bounds)).center);
							}
							RevolverBeam component = val.GetComponent<RevolverBeam>();
							if (((ConfigValueElement<bool>)(object)Extrabeamsstylefreshness).Value)
							{
								component.sourceWeapon = __instance.gc.currentWeapon;
							}
							component.alternateStartPoint = __instance.gunBarrel.transform.position;
							component.gunVariation = __instance.gunVariation;
							if (((ConfigValueElement<int>)(object)BeamRicoAmt).Value > 0)
							{
								component.ricochetAmount = ((ConfigValueElement<int>)(object)BeamRicoAmt).Value;
							}
						}
					}
					if (!((ConfigValueElement<bool>)(object)Shootaltbeams1).Value && shotType == 1)
					{
						for (int j = 0; (float)j < num; j++)
						{
							GameObject val2 = Object.Instantiate<GameObject>(__instance.revolverBeam, ((Component)__instance.cc).transform.position, ((Component)__instance.cc).transform.rotation * Quaternion.Euler(Random.Range(0f - ((ConfigValueElement<float>)(object)BeamSpread).Value, ((ConfigValueElement<float>)(object)BeamSpread).Value), Random.Range(0f - ((ConfigValueElement<float>)(object)BeamSpread).Value, ((ConfigValueElement<float>)(object)BeamSpread).Value), Random.Range(0f - ((ConfigValueElement<float>)(object)BeamSpread).Value, ((ConfigValueElement<float>)(object)BeamSpread).Value)));
							if (Object.op_Implicit((Object)(object)__instance.targeter.CurrentTarget) && __instance.targeter.IsAutoAimed)
							{
								Transform transform2 = val2.transform;
								bounds = __instance.targeter.CurrentTarget.bounds;
								transform2.LookAt(((Bounds)(ref bounds)).center);
							}
							RevolverBeam component2 = val2.GetComponent<RevolverBeam>();
							if (((ConfigValueElement<bool>)(object)Extrabeamsstylefreshness).Value)
							{
								component2.sourceWeapon = __instance.gc.currentWeapon;
							}
							component2.alternateStartPoint = __instance.gunBarrel.transform.position;
							component2.gunVariation = __instance.gunVariation;
							if (((ConfigValueElement<int>)(object)BeamRicoAmt).Value > 0)
							{
								component2.ricochetAmount = ((ConfigValueElement<int>)(object)BeamRicoAmt).Value;
							}
						}
					}
				}
				if (!((ConfigValueElement<bool>)(object)StrongPistolbeam2).Value || !__instance.altVersion)
				{
					return;
				}
				float num2 = 0f;
				num2 = ((!hasJaket) ? ((float)((ConfigValueElement<int>)(object)Beammult2).Value) : ((float)Mathf.Clamp(((ConfigValueElement<int>)(object)Beammult2).Value, 0, 12)));
				if (((ConfigValueElement<bool>)(object)Shootaltbeams2).Value || shotType == 2)
				{
					for (int k = 0; (float)k < num2; k++)
					{
						GameObject val3 = Object.Instantiate<GameObject>(__instance.revolverBeamSuper, ((Component)__instance.cc).transform.position, ((Component)__instance.cc).transform.rotation * Quaternion.Euler(Random.Range(0f - ((ConfigValueElement<float>)(object)BeamSpread).Value, ((ConfigValueElement<float>)(object)BeamSpread).Value), Random.Range(0f - ((ConfigValueElement<float>)(object)BeamSpread).Value, ((ConfigValueElement<float>)(object)BeamSpread).Value), Random.Range(0f - ((ConfigValueElement<float>)(object)BeamSpread).Value, ((ConfigValueElement<float>)(object)BeamSpread).Value)));
						if (Object.op_Implicit((Object)(object)__instance.targeter.CurrentTarget) && __instance.targeter.IsAutoAimed)
						{
							Transform transform3 = val3.transform;
							bounds = __instance.targeter.CurrentTarget.bounds;
							transform3.LookAt(((Bounds)(ref bounds)).center);
						}
						RevolverBeam component3 = val3.GetComponent<RevolverBeam>();
						if (((ConfigValueElement<bool>)(object)Extrabeamsstylefreshness).Value)
						{
							component3.sourceWeapon = __instance.gc.currentWeapon;
						}
						component3.alternateStartPoint = __instance.gunBarrel.transform.position;
						component3.gunVariation = __instance.gunVariation;
						if (((ConfigValueElement<int>)(object)BeamRicoAmt).Value > 0)
						{
							component3.ricochetAmount = ((ConfigValueElement<int>)(object)BeamRicoAmt).Value;
						}
					}
				}
				if (((ConfigValueElement<bool>)(object)Shootaltbeams2).Value || shotType != 1)
				{
					return;
				}
				for (int l = 0; (float)l < num2; l++)
				{
					GameObject val4 = Object.Instantiate<GameObject>(__instance.revolverBeam, ((Component)__instance.cc).transform.position, ((Component)__instance.cc).transform.rotation * Quaternion.Euler(Random.Range(0f - ((ConfigValueElement<float>)(object)BeamSpread).Value, ((ConfigValueElement<float>)(object)BeamSpread).Value), Random.Range(0f - ((ConfigValueElement<float>)(object)BeamSpread).Value, ((ConfigValueElement<float>)(object)BeamSpread).Value), Random.Range(0f - ((ConfigValueElement<float>)(object)BeamSpread).Value, ((ConfigValueElement<float>)(object)BeamSpread).Value)));
					if (Object.op_Implicit((Object)(object)__instance.targeter.CurrentTarget) && __instance.targeter.IsAutoAimed)
					{
						Transform transform4 = val4.transform;
						bounds = __instance.targeter.CurrentTarget.bounds;
						transform4.LookAt(((Bounds)(ref bounds)).center);
					}
					RevolverBeam component4 = val4.GetComponent<RevolverBeam>();
					if (((ConfigValueElement<bool>)(object)Extrabeamsstylefreshness).Value)
					{
						component4.sourceWeapon = __instance.gc.currentWeapon;
					}
					component4.alternateStartPoint = __instance.gunBarrel.transform.position;
					component4.gunVariation = __instance.gunVariation;
					if (((ConfigValueElement<int>)(object)BeamRicoAmt).Value > 0)
					{
						component4.ricochetAmount = ((ConfigValueElement<int>)(object)BeamRicoAmt).Value;
					}
				}
			}

			[HarmonyPrefix]
			[HarmonyPatch(typeof(Revolver), "Update")]
			public static void revupd(Revolver __instance)
			{
				float num = 0f;
				num = ((!hasJaket) ? ((ConfigValueElement<float>)(object)firingspeed).Value : Mathf.Clamp(((ConfigValueElement<float>)(object)firingspeed).Value, 0f, 3f));
				__instance.anim.speed = num;
			}

			[HarmonyPostfix]
			[HarmonyPatch(typeof(Revolver), "Shoot")]
			public static void revsht(Revolver __instance)
			{
				__instance.shootCharge = 99f;
			}

			[HarmonyPostfix]
			[HarmonyPatch(typeof(WeaponCharges), "Update")]
			public static void upd(WeaponCharges __instance)
			{
				if (((ConfigValueElement<bool>)(object)BuffNailgun).Value)
				{
					__instance.naiAmmo = 1f;
					__instance.naiSaws = 1f;
				}
			}

			[HarmonyPrefix]
			[HarmonyPatch(typeof(Nailgun), "Shoot")]
			public static bool nailbuff(Nailgun __instance)
			{
				//IL_0145: Unknown result type (might be due to invalid IL or missing references)
				//IL_0155: Unknown result type (might be due to invalid IL or missing references)
				//IL_015a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0165: Unknown result type (might be due to invalid IL or missing references)
				//IL_0178: Unknown result type (might be due to invalid IL or missing references)
				//IL_043d: Unknown result type (might be due to invalid IL or missing references)
				//IL_044d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0452: Unknown result type (might be due to invalid IL or missing references)
				//IL_045d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0470: Unknown result type (might be due to invalid IL or missing references)
				//IL_022e: Unknown result type (might be due to invalid IL or missing references)
				//IL_023e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0243: Unknown result type (might be due to invalid IL or missing references)
				//IL_0248: Unknown result type (might be due to invalid IL or missing references)
				//IL_024d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0526: Unknown result type (might be due to invalid IL or missing references)
				//IL_0536: Unknown result type (might be due to invalid IL or missing references)
				//IL_053b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0540: Unknown result type (might be due to invalid IL or missing references)
				//IL_0545: Unknown result type (might be due to invalid IL or missing references)
				//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
				//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
				//IL_05de: Unknown result type (might be due to invalid IL or missing references)
				//IL_05e8: Unknown result type (might be due to invalid IL or missing references)
				//IL_0a03: Unknown result type (might be due to invalid IL or missing references)
				//IL_0a13: Unknown result type (might be due to invalid IL or missing references)
				//IL_0a18: Unknown result type (might be due to invalid IL or missing references)
				//IL_0a23: Unknown result type (might be due to invalid IL or missing references)
				//IL_0979: Unknown result type (might be due to invalid IL or missing references)
				//IL_0989: Unknown result type (might be due to invalid IL or missing references)
				//IL_098e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0999: Unknown result type (might be due to invalid IL or missing references)
				//IL_0a87: Unknown result type (might be due to invalid IL or missing references)
				//IL_0a9d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0aad: Unknown result type (might be due to invalid IL or missing references)
				//IL_0ab8: 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_0b23: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b33: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b38: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b3c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b4c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b51: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b56: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b5a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b5f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b7b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b80: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b84: Unknown result type (might be due to invalid IL or missing references)
				//IL_0c0c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0c16: Unknown result type (might be due to invalid IL or missing references)
				if (((ConfigValueElement<bool>)(object)projectilenails).Value || ((ConfigValueElement<bool>)(object)projectilenails1).Value)
				{
					if (((ConfigValueElement<bool>)(object)projectilenails).Value && __instance.altVersion)
					{
						int num = ((ConfigValueElement<int>)(object)additionalprojectile).Value + 1;
						Vector3 val2 = default(Vector3);
						for (int i = 0; i < num; i++)
						{
							GameObject val = null;
							if (((ConfigValueElement<AlternateProjectile>)(object)altProj).Value == AlternateProjectile.StrayProjectile)
							{
								val = projectile;
							}
							else if (((ConfigValueElement<AlternateProjectile>)(object)altProj).Value == AlternateProjectile.RevolverBeam)
							{
								val = pistolbeam;
							}
							else if (((ConfigValueElement<AlternateProjectile>)(object)altProj).Value == AlternateProjectile.Rocket)
							{
								val = rocket;
							}
							else if (((ConfigValueElement<AlternateProjectile>)(object)altProj).Value == AlternateProjectile.Grenade)
							{
								val = grenade;
							}
							if (!((Object)(object)val != (Object)null))
							{
								continue;
							}
							((Vector3)(ref val2))..ctor(Random.Range(0f - ((ConfigValueElement<float>)(object)additionalprojectilespread).Value, ((ConfigValueElement<float>)(object)additionalprojectilespread).Value), Random.Range(0f - ((ConfigValueElement<float>)(object)additionalprojectilespread).Value, ((ConfigValueElement<float>)(object)additionalprojectilespread).Value), Random.Range(0f - ((ConfigValueElement<float>)(object)additionalprojectilespread).Value, ((ConfigValueElement<float>)(object)additionalprojectilespread).Value));
							GameObject val3 = Object.Instantiate<GameObject>(val, ((Component)__instance.cc).transform.position + ((Component)__instance.cc).transform.forward, ((Component)__instance).transform.rotation);
							val3.transform.Rotate(val2);
							Projectile val4 = null;
							if (val3.TryGetComponent<Projectile>(ref val4) && (Object)(object)val4 != (Object)null)
							{
								val4.playerBullet = true;
								val4.friendly = true;
								val4.explosive = false;
								val4.damage = 0.5f + (float)(5 / num);
								if (((ConfigValueElement<bool>)(object)projsaffectstyle).Value)
								{
									val4.sourceWeapon = ((Component)__instance).gameObject;
								}
							}
							RevolverBeam val5 = null;
							if (val3.TryGetComponent<RevolverBeam>(ref val5) && (Object)(object)val5 != (Object)null)
							{
								val5.damage = 0.5f + (float)(1 / num);
								val5.alternateStartPoint = ((Component)__instance.cc).transform.position + -((Component)__instance.cc).transform.up;
								if (((ConfigValueElement<bool>)(object)projsaffectstyle).Value)
								{
									val5.sourceWeapon = ((Component)__instance).gameObject;
								}
							}
							Grenade val6 = null;
							if (val3.TryGetComponent<Grenade>(ref val6) && (Object)(object)val6 != (Object)null)
							{
								if (((ConfigValueElement<bool>)(object)projsaffectstyle).Value)
								{
									val6.sourceWeapon = ((Component)__instance).gameObject;
								}
								if (val6.rocket)
								{
									val6.totalDamageMultiplier = 0.5f + (float)(1 / num);
								}
								else
								{
									val6.rb.AddForce(((Component)val6).transform.forward * 100f, (ForceMode)2);
								}
							}
						}
					}
					if (((ConfigValueElement<bool>)(object)projectilenails1).Value && !__instance.altVersion)
					{
						int num2 = ((ConfigValueElement<int>)(object)additionalprojectile1).Value + 1;
						Vector3 val8 = default(Vector3);
						for (int j = 0; j < num2; j++)
						{
							GameObject val7 = null;
							if (((ConfigValueElement<AlternateProjectile>)(object)altProj1).Value == AlternateProjectile.StrayProjectile)
							{
								val7 = projectile;
							}
							else if (((ConfigValueElement<AlternateProjectile>)(object)altProj1).Value == AlternateProjectile.RevolverBeam)
							{
								val7 = pistolbeam;
							}
							else if (((ConfigValueElement<AlternateProjectile>)(object)altProj1).Value == AlternateProjectile.Rocket)
							{
								val7 = rocket;
							}
							else if (((ConfigValueElement<AlternateProjectile>)(object)altProj1).Value == AlternateProjectile.Grenade)
							{
								val7 = grenade;
							}
							if (!((Object)(object)val7 != (Object)null))
							{
								continue;
							}
							((Vector3)(ref val8))..ctor(Random.Range(0f - ((ConfigValueElement<float>)(object)additionalprojectilespread1).Value, ((ConfigValueElement<float>)(object)additionalprojectilespread1).Value), Random.Range(0f - ((ConfigValueElement<float>)(object)additionalprojectilespread1).Value, ((ConfigValueElement<float>)(object)additionalprojectilespread1).Value), Random.Range(0f - ((ConfigValueElement<float>)(object)additionalprojectilespread1).Value, ((ConfigValueElement<float>)(object)additionalprojectilespread1).Value));
							GameObject val9 = Object.Instantiate<GameObject>(val7, ((Component)__instance.cc).transform.position + ((Component)__instance.cc).transform.forward, ((Component)__instance).transform.rotation);
							val9.transform.Rotate(val8);
							Projectile val10 = null;
							if (val9.TryGetComponent<Projectile>(ref val10) && (Object)(object)val10 != (Object)null)
							{
								val10.playerBullet = true;
								val10.friendly = true;
								val10.explosive = false;
								val10.damage = 0.5f + (float)(5 / num2);
								if (((ConfigValueElement<bool>)(object)projsaffectstyle1).Value)
								{
									val10.sourceWeapon = ((Component)__instance).gameObject;
								}
							}
							RevolverBeam val11 = null;
							if (val9.TryGetComponent<RevolverBeam>(ref val11) && (Object)(object)val11 != (Object)null)
							{
								val11.damage = 0.5f + (float)(1 / num2);
								val11.alternateStartPoint = ((Component)__instance.cc).transform.position + -((Component)__instance.cc).transform.up;
								if (((ConfigValueElement<bool>)(object)projsaffectstyle1).Value)
								{
									val11.sourceWeapon = ((Component)__instance).gameObject;
								}
							}
							Grenade val12 = null;
							if (val9.TryGetComponent<Grenade>(ref val12) && (Object)(object)val12 != (Object)null)
							{
								if (((ConfigValueElement<bool>)(object)projsaffectstyle1).Value)
								{
									val12.sourceWeapon = ((Component)__instance).gameObject;
								}
								if (val12.rocket)
								{
									val12.totalDamageMultiplier = 0.5f + (float)(1 / num2);
								}
								else
								{
									val12.rb.AddForce(((Component)val12).transform.forward * 100f, (ForceMode)2);
								}
							}
						}
					}
					__instance.UpdateAnimationWeight();
					__instance.fireCooldown = __instance.currentFireRate;
					__instance.shotSuccesfully = true;
					if (__instance.variation == 1 && (!Object.op_Implicit((Object)(object)__instance.wid) || __instance.wid.delay == 0f))
					{
						if (__instance.altVersion)
						{
							WeaponCharges wc = __instance.wc;
							wc.naiSaws -= 1f;
						}
						else
						{
							WeaponCharges wc2 = __instance.wc;
							wc2.naiAmmo -= 1f;
						}
					}
					__instance.anim.SetTrigger("Shoot");
					__instance.barrelNum++;
					if (__instance.barrelNum >= __instance.shootPoints.Length)
					{
						__instance.barrelNum = 0;
					}
					GameObject val13 = ((!__instance.burnOut) ? Object.Instantiate<GameObject>(__instance.muzzleFlash, __instance.shootPoints[__instance.barrelNum].transform) : Object.Instantiate<GameObject>(__instance.muzzleFlash2, __instance.shootPoints[__instance.barrelNum].transform));
					if (!__instance.altVersion)
					{
						AudioSource component = val13.GetComponent<AudioSource>();
						if (__instance.burnOut)
						{
							component.volume = 0.65f - __instance.wid.delay * 2f;
							if (component.volume < 0f)
							{
								component.volume = 0f;
							}
							component.pitch = 2f;
							__instance.currentSpread = __instance.spread * 2f;
						}
						else
						{
							if (__instance.heatSinks < 1f)
							{
								component.pitch = 0.75f;
								component.volume = 0.25f - __instance.wid.delay * 2f;
								if (component.volume < 0f)
								{
									component.volume = 0f;
								}
							}
							else
							{
								component.volume = 0.65f - __instance.wid.delay * 2f;
								if (component.volume < 0f)
								{
									component.volume = 0f;
								}
							}
							__instance.currentSpread = __instance.spread;
						}
					}
					else if (__instance.burnOut)
					{
						__instance.currentSpread = 45f;
					}
					else if (__instance.altVersion && __instance.variation == 0)
					{
						if (__instance.heatSinks < 1f)
						{
							__instance.currentSpread = 45f;
						}
						else
						{
							__instance.currentSpread = Mathf.Lerp(0f, 45f, Mathf.Max(0f, __instance.heatUp - 0.25f));
						}
					}
					else
					{
						__instance.currentSpread = 0f;
					}
					GameObject val14 = null;
					if (__instance.burnOut)
					{
						bool flag = false;
						if ((__instance.altVersion && ((ConfigValueElement<bool>)(object)projectilenails).Value) || (!__instance.altVersion && ((ConfigValueElement<bool>)(object)projectilenails1).Value))
						{
							flag = true;
						}
						if (!flag)
						{
							val14 = Object.Instantiate<GameObject>(__instance.heatedNail, ((Component)__instance.cc).transform.position + ((Component)__instance.cc).transform.forward, ((Component)__instance).transform.rotation);
						}
					}
					else
					{
						bool flag2 = false;
						if ((__instance.altVersion && ((ConfigValueElement<bool>)(object)projectilenails).Value) || (!__instance.altVersion && ((ConfigValueElement<bool>)(object)projectilenails1).Value))
						{
							flag2 = true;
						}
						if (!flag2)
						{
							val14 = Object.Instantiate<GameObject>(__instance.nail, ((Component)__instance.cc).transform.position + ((Component)__instance.cc).transform.forward, ((Component)__instance).transform.rotation);
						}
					}
					if (__instance.altVersion && __instance.variation == 0 && __instance.heatSinks >= 1f)
					{
						__instance.heatUp = Mathf.MoveTowards(__instance.heatUp, 1f, 0.125f);
					}
					val14.transform.forward = ((Component)__instance.cc).transform.forward;
					if (Physics.Raycast(((Component)__instance.cc).transform.position, ((Component)__instance.cc).transform.forward, 1f, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)1))))
					{
						val14.transform.position = ((Component)__instance.cc).transform.position;
					}
					if (Object.op_Implicit((Object)(object)__instance.targeter.CurrentTarget) && __instance.targeter.IsAutoAimed)
					{
						Transform transform = val14.transform;
						Vector3 position = ((Component)__instance.cc).transform.position;
						Bounds bounds = __instance.targeter.CurrentTarget.bounds;
						Vector3 val15 = ((Bounds)(ref bounds)).center - ((Component)__instance.cc).transform.position;
						transform.position = position + ((Vector3)(ref val15)).normalized;
						Transform transform2 = val14.transform;
						bounds = __instance.targeter.CurrentTarget.bounds;
						transform2.LookAt(((Bounds)(ref bounds)).center);
					}
					val14.transform.Rotate(Random.Range((0f - __instance.currentSpread) / 3f, __instance.currentSpread / 3f), Random.Range((0f - __instance.currentSpread) / 3f, __instance.currentSpread / 3f), Random.Range((0f - __instance.currentSpread) / 3f, __instance.currentSpread / 3f));
					Rigidbody val16 = default(Rigidbody);
					if (val14.TryGetComponent<Rigidbody>(ref val16))
					{
						val16.velocity = val14.transform.forward * 200f;
					}
					Nail val17 = default(Nail);
					if (val14.TryGetComponent<Nail>(ref val17))
					{
						val17.sourceWeapon = __instance.gc.currentWeapon;
						val17.weaponType = __instance.projectileVariationTypes[__instance.variation];
						if (__instance.altVersion && __instance.variation == 0)
						{
							if (__instance.heatSinks >= 1f)
							{
								val17.hitAmount = Mathf.Lerp(3f, 1f, __instance.heatUp);
							}
							else
							{
								val17.hitAmount = 1f;
							}
						}
						if (val17.sawblade)
						{
							val17.ForceCheckSawbladeRicochet();
						}
					}
					if (!__instance.burnOut)
					{
						__instance.cc.CameraShake(0.1f);
					}
					else
					{
						__instance.cc.CameraShake(0.35f);
					}
					if (__instance.altVersion)
					{
						MonoSingleton<RumbleManager>.Instance.SetVibration(RumbleProperties.Sawblade);
					}
					return false;
				}
				return true;
			}

			[HarmonyPrefix]
			[HarmonyPatch(typeof(Shotgun), "Update")]
			public static void bsg(Shotgun __instance)
			{
				if (((ConfigValueElement<bool>)(object)ShotgunGatling).Value)
				{
					float num = 0f;
					num = ((!hasJaket) ? ((ConfigValueElement<float>)(object)ShotgunCD).Value : Mathf.Clamp(((ConfigValueElement<float>)(object)ShotgunCD).Value, 0f, 3f));
					__instance.anim.speed = num;
				}
				if (!((ConfigValueElement<bool>)(object)ShotgunGatling).Value && __instance.anim.speed != 1f)
				{
					__instance.anim.speed = 1f;
				}
			}

			[HarmonyPrefix]
			[HarmonyPatch(typeof(Shotgun), "Shoot")]
			public static bool HitscanShotgunPatch(Shotgun __instance)
			{
				//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
				//IL_0152: 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_015e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0121: Unknown result type (might be due to invalid IL or missing references)
				//IL_0126: Unknown result type (might be due to invalid IL or missing references)
				//IL_012a: 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_013f: 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_019b: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
				//IL_05bf: 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_05d9: Unknown result type (might be due to invalid IL or missing references)
				//IL_05e6: Unknown result type (might be due to invalid IL or missing references)
				//IL_05f6: Unknown result type (might be due to invalid IL or missing references)
				//IL_0603: Unknown result type (might be due to invalid IL or missing references)
				//IL_0648: Unknown result type (might be due to invalid IL or missing references)
				//IL_0655: Unknown result type (might be due to invalid IL or missing references)
				//IL_061b: Unknown result type (might be due to invalid IL or missing references)
				//IL_062b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0635: Unknown result type (might be due to invalid IL or missing references)
				//IL_063a: Unknown result type (might be due to invalid IL or missing references)
				//IL_063f: Unknown result type (might be due to invalid IL or missing references)
				//IL_037a: Unknown result type (might be due to invalid IL or missing references)
				//IL_038a: Unknown result type (might be due to invalid IL or missing references)
				//IL_069a: Unknown result type (might be due to invalid IL or missing references)
				//IL_069f: Unknown result type (might be due to invalid IL or missing references)
				//IL_06a3: Unknown result type (might be due to invalid IL or missing references)
				//IL_03ea: Unknown result type (might be due to invalid IL or missing references)
				//IL_03ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_03f3: Unknown result type (might be due to invalid IL or missing references)
				//IL_0215: Unknown result type (might be due to invalid IL or missing references)
				//IL_021a: Unknown result type (might be due to invalid IL or missing references)
				//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
				//IL_02d7: Unknown result type (might be due to invalid IL or missing references)
				//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
				//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
				//IL_02e5: Unknown result type (might be due to invalid IL or missing references)
				//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_02f6: Unknown result type (might be due to invalid IL or missing references)
				//IL_07ea: Unknown result type (might be due to invalid IL or missing references)
				//IL_07f6: Unknown result type (might be due to invalid IL or missing references)
				//IL_083a: Unknown result type (might be due to invalid IL or missing references)
				if (((ConfigValueElement<bool>)(object)HitscanShotgun).Value)
				{
					__instance.gunReady = false;
					int num = 12;
					if (__instance.variation == 1)
					{
						switch (__instance.primaryCharge)
						{
						case 0:
							num = 10;
							__instance.gunAud.pitch = Random.Range(1.15f, 1.25f);
							break;
						case 1:
							num = 16;
							__instance.gunAud.pitch = Random.Range(0.95f, 1.05f);
							break;
						case 2:
							num = 24;
							__instance.gunAud.pitch = Random.Range(0.75f, 0.85f);
							break;
						case 3:
							num = 0;
							__instance.gunAud.pitch = Random.Range(0.75f, 0.85f);
							break;
						}
					}
					MonoSingleton<CameraController>.Instance.StopShake();
					Vector3 val = __instance.cam.transform.forward;
					Bounds bounds;
					if (Object.op_Implicit((Object)(object)__instance.targeter.CurrentTarget) && __instance.targeter.IsAutoAimed)
					{
						bounds = __instance.targeter.CurrentTarget.bounds;
						val = ((Bounds)(ref bounds)).center - __instance.cam.transform.position;
					}
					__instance.rhits = Physics.RaycastAll(__instance.cam.transform.position, val, 4f, LayerMask.op_Implicit(__instance.shotgunZoneLayerMask));
					if (__instance.rhits.Length != 0)
					{
						RaycastHit[] rhits = __instance.rhits;
						for (int i = 0; i < rhits.Length; i++)
						{
							RaycastHit val2 = rhits[i];
							if (!((Component)((RaycastHit)(ref val2)).collider).gameObject.CompareTag("Body"))
							{
								continue;
							}
							EnemyIdentifierIdentifier componentInParent = ((Component)((RaycastHit)(ref val2)).collider).GetComponentInParent<EnemyIdentifierIdentifier>();
							if (!Object.op_Implicit((Object)(object)componentInParent) || !Object.op_Implicit((Object)(object)componentInParent.eid))
							{
								continue;
							}
							EnemyIdentifier eid = componentInParent.eid;
							if (!eid.dead && !eid.blessed)
							{
								AnimatorStateInfo currentAnimatorStateInfo = __instance.anim.GetCurrentAnimatorStateInfo(0);
								if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("Equip"))
								{
									MonoSingleton<StyleHUD>.Instance.AddPoints(50, "ultrakill.quickdraw", __instance.gc.currentWeapon, eid, -1, "", "");
								}
							}
							eid.hitter = "shotgunzone";
							if (!eid.hitterWeapons.Contains("shotgun" + __instance.variation))
							{
								eid.hitterWeapons.Add("shotgun" + __instance.variation);
							}
							GameObject gameObject = ((Component)((RaycastHit)(ref val2)).collider).gameObject;
							Vector3 val3 = ((Component)eid).transform.position - ((Component)__instance).transform.position;
							eid.DeliverDamage(gameObject, ((Vector3)(ref val3)).normalized * 10000f, ((RaycastHit)(ref val2)).point, 4f, false, 0f, ((Component)__instance).gameObject, false, false);
						}
					}
					MonoSingleton<RumbleManager>.Instance.SetVibrationTracked(RumbleProperties.GunFireProjectiles, ((Component)__instance).gameObject);
					if (__instance.variation != 1 || __instance.primaryCharge != 3)
					{
						for (int j = 0; j < num; j++)
						{
							GameObject val4 = Object.Instantiate<GameObject>(pistolbeam, __instance.cam.transform.position, __instance.cam.transform.rotation);
							RevolverBeam component = val4.GetComponent<RevolverBeam>();
							component.sourceWeapon = __instance.gc.currentWeapon;
							if (Object.op_Implicit((Object)(object)__instance.targeter.CurrentTarget) && __instance.targeter.IsAutoAimed)
							{
								Transform transform = val4.transform;
								bounds = __instance.targeter.CurrentTarget.bounds;
								transform.LookAt(((Bounds)(ref bounds)).center);
							}
							if (__instance.variation == 1)
							{
								switch (__instance.primaryCharge)
								{
								case 0:
									val4.transform.Rotate(Random.Range((0f - __instance.spread) / 1.5f, __instance.spread / 1.5f), Random.Range((0f - __instance.spread) / 1.5f, __instance.spread / 1.5f), Random.Range((0f - __instance.spread) / 1.5f, __instance.spread / 1.5f));
									break;
								case 1:
									val4.transform.Rotate(Random.Range(0f - __instance.spread, __instance.spread), Random.Range(0f - __instance.spread, __instance.spread), Random.Range(0f - __instance.spread, __instance.spread));
									break;
								case 2:
									val4.transform.Rotate(Random.Range((0f - __instance.spread) * 2f, __instance.spread * 2f), Random.Range((0f - __instance.spread) * 2f, __instance.spread * 2f), Random.Range((0f - __instance.spread) * 2f, __instance.spread * 2f));
									break;
								}
							}
							else
							{
								val4.transform.Rotate(Random.Range(0f - __instance.spread, __instance.spread), Random.Range(0f - __instance.spread, __instance.spread), Random.Range(0f - __instance.spread, __instance.spread));
							}
						}
					}
					else
					{
						Vector3 val5 = __instance.cam.transform.position + __instance.cam.transform.forward;
						RaycastHit val6 = default(RaycastHit);
						if (Physics.Raycast(__instance.cam.transform.position, __instance.cam.transform.forward, ref val6, 1f, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)1))))
						{
							val5 = ((RaycastHit)(ref val6)).point - __instance.cam.transform.forward * 0.1f;
						}
						GameObject val7 = Object.Instantiate<GameObject>(__instance.explosion, val5, __instance.cam.transform.rotation);
						if (Object.op_Implicit((Object)(object)__instance.targeter.CurrentTarget) && __instance.targeter.IsAutoAimed)
						{
							Transform transform2 = val7.transform;
							bounds = __instance.targeter.CurrentTarget.bounds;
							transform2.LookAt(((Bounds)(ref bounds)).center);
						}
						Explosion[] componentsInChildren = val7.GetComponentsInChildren<Explosion>();
						foreach (Explosion val8 in componentsInChildren)
						{
							val8.sourceWeapon = __instance.gc.currentWeapon;
							val8.enemyDamageMultiplier = 1f;
							val8.maxSize *= 1.5f;
							val8.damage = 50;
						}
					}
					if (__instance.variation != 1)
					{
						__instance.gunAud.pitch = Random.Range(0.95f, 1.05f);
					}
					__instance.gunAud.clip = __instance.shootSound;
					__instance.gunAud.volume = 0.45f;
					__instance.gunAud.panStereo = 0f;
					__instance.gunAud.Play();
					__instance.cc.CameraShake(1f);
					if (__instance.variation == 1)
					{
						__instance.anim.SetTrigger("PumpFire");
					}
					else
					{
						__instance.anim.SetTrigger("Fire");
					}
					Transform[] shootPoints = __instance.shootPoints;
					foreach (Transform val9 in shootPoints)
					{
						Object.Instantiate<GameObject>(__instance.muzzleFlash, ((Component)val9).transform.position, ((Component)val9).transform.rotation);
					}
					__instance.releasingHeat = false;
					__instance.tempColor.a = 1f;
					((Renderer)__instance.heatSinkSMR).sharedMaterials[3].SetColor("_TintColor", __instance.tempColor);
					if (__instance.variation == 1)
					{
						__instance.primaryCharge = 0;
					}
					return false;
				}
				return true;
			}

			[HarmonyPostfix]
			[HarmonyPatch(typeof(Grenade), "Update")]
			public static void RocketRidePatch(Grenade __instance)
			{
				if (((ConfigValueElement<bool>)(object)instafreezecharge).Value && (Object)(object)__instance.explosion != (Object)(object)__instance.superExplosion)
				{
					__instance.harmlessExplosion = __instance.explosion;
					__instance.explosion = __instance.superExplosion;
				}
				if (((ConfigValueElement<bool>)(object)infrocketride).Value)
				{
					__instance.downpull = 0f;
				}
				if (__instance.playerRiding)
				{
					((Component)__instance).GetComponent<RemoveOnTime>().time = float.PositiveInfinity;
				}
				else
				{
					((Component)__instance).GetComponent<RemoveOnTime>().time = 20f;
				}
			}

			[HarmonyPostfix]
			[HarmonyPatch(typeof(Grenade), "LateUpdate")]
			public static void HomingRockets(Grenade __instance)
			{
				//IL_002f: 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_003a: Unknown result type (might be due to invalid IL or missing references)
				//IL_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0040: Unknown result type (might be due to invalid IL or missing references)
				//IL_0041: Unknown result type (might be due to invalid IL or missing references)
				//IL_0046: 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_004e: Unknown result type (might be due to invalid IL or missing references)
				//IL_005a: Unknown result type (might be due to invalid IL or missing references)
				if (((ConfigValueElement<bool>)(object)homingrockets).Value && !__instance.enemy && __instance.rocket)
				{
					Transform transform = ((Component)__instance).transform;
					Vector3 val = bgbeam.hitPosition - transform.position;
					Quaternion val2 = Quaternion.LookRotation(val);
					transform.rotation = Quaternion.RotateTowards(transform.rotation, val2, 300f * Time.deltaTime);
				}
			}

			[HarmonyPostfix]
			[HarmonyPatch(typeof(EnemyIdentifier), "Start")]
			public static void EnemyFriendlyPatch(EnemyIdentifier __instance)
			{
				if (spawnfriendlyenemies)
				{
					__instance.attackEnemies = true;
					__instance.ignorePlayer = true;
					__instance.ignoredByEnemies = true;
				}
			}

			[HarmonyPrefix]
			[HarmonyPatch(typeof(Grenade), "OnDestroy")]
			public static void FixRocketDespawn(Grenade __instance)
			{
				//IL_002a: 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)
				if (__instance.playerRiding && !__instance.exploded)
				{
					GameObject val = Object.Instantiate<GameObject>(Fetch<GameObject>("Assets/Prefabs/Attacks and Projectiles/Rocket.prefab"), ((Component)__instance).transform.position, ((Component)__instance).transform.rotation);
					MonoSingleton<ObjectTracker>.Instance.AddGrenade(val.GetComponent<Grenade>());
					val.GetComponent<Grenade>().PlayerRideStart();
					val.GetComponent<Grenade>().totalDamageMultiplier = 0f;
					Grenade component = val.GetComponent<Grenade>();
					component.rocketSpeed *= 2f;
				}
			}

			[HarmonyPrefix]
			[HarmonyPatch(typeof(BeamgunBeam), "FixedUpdate")]
			public static bool FixedUpdatePatch(BeamgunBeam __instance)
			{
				if (!Object.op_Implicit((Object)(object)((Component)__instance).GetComponent<BeamID>()))
				{
					return true;
				}
				return false;
			}

			[HarmonyPrefix]
			[HarmonyPatch(typeof(BeamgunBeam), "Update")]
			public static bool UpdatePatch(BeamgunBeam __instance)
			{
				//IL_001d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0022: Unknown result type (might be due to invalid IL or missing references)
				//IL_005c: Unknown result type (might be due to invalid IL or missing references)
				//IL_003b: 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)
				//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_007f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0084: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
				//IL_0106: Unknown result type (might be due to invalid IL or missing references)
				//IL_0115: Unknown result type (might be due to invalid IL or missing references)
				//IL_011f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0124: Unknown result type (might be due to invalid IL or missing references)
				//IL_0129: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
				//IL_0137: Unknown result type (might be due to invalid IL or missing references)
				if (!Object.op_Implicit((Object)(object)((Component)__instance).GetComponent<BeamID>()))
				{
					return true;
				}
				if (__instance.fakeStartPoint != Vector3.zero)
				{
					__instance.line.SetPosition(0, __instance.fakeStartPoint);
				}
				else
				{
					__instance.line.SetPosition(0, ((Component)__instance.line).transform.position);
				}
				Vector3 val = ((Component)__instance).transform.forward * -1f;
				LayerMask val2 = LayerMaskDefaults.Get((LMD)3);
				if (__instance.canHitPlayer && __instance.playerDamageCooldown <= 0f)
				{
					val2 = LayerMaskDefaults.Get((LMD)6);
				}
				RaycastHit val3 = default(RaycastHit);
				if (Physics.Raycast(((Component)__instance).transform.position, ((Component)__instance).transform.forward, ref val3, float.PositiveInfinity, LayerMask.op_Implicit(val2), (QueryTriggerInteraction)1))
				{
					__instance.hitPosition = ((RaycastHit)(ref val3)).point;
					val = ((RaycastHit)(ref val3)).normal;
				}
				else
				{
					__instance.hitPosition = ((Component)MonoSingleton<CameraController>.instance).transform.position + ((Component)MonoSingleton<CameraController>.instance).transform.forward * 1000f;
				}
				__instance.line.SetPosition(1, __instance.hitPosition);
				return false;
			}

			[HarmonyPostfix]
			[HarmonyPatch(typeof(ShotgunHammer), "FixedUpdate")]
			public static void PBBuff(ShotgunHammer __instance)
			{
				if (((ConfigValueElement<bool>)(object)forcePBPlayerSpeed).Value)
				{
					__instance.currentSpeed = (float)((ConfigValueElement<int>)(object)PBPlayerSpeed).Value / 3f;
				}
			}
		}

		public static GameObject rocket;

		public static GameObject sgpellet;

		public static GameObject muzzleflash;

		public static GameObject grenade;

		public static GameObject malrailbeam;

		public static GameObject pistolbeam;

		public static float animspeed;

		public static Vector3 playerpos;

		public static GameObject[] companions;

		public static float inttimer;

		public static GameObject projectile;

		[Configgable("Player/Weapons/Pistol", "Firing speed", 0, null)]
		private static ConfigInputField<float> firingspeed = new ConfigInputField<float>(1f, (Func<float, bool>)null, (Func<string, ValueTuple<bool, float>>)null);

		[Configgable("Player/Weapons/Pistol/Extrabeams", "Extra beam spread", 0, null)]
		private static ConfigInputField<float> BeamSpread = new ConfigInputField<float>(0f, (Func<float, bool>)null, (Func<string, ValueTuple<bool, float>>)null);

		[Configgable("Player/Weapons/Pistol/Extrabeams", "Extra beams ricochet amount", 0, null)]
		private static ConfigInputField<int> BeamRicoAmt = new ConfigInputField<int>(0, (Func<int, bool>)null, (Func<string, ValueTuple<bool, int>>)null);

		[Configgable("Player/Weapons/Pistol/Extrabeams", "Extra beams affect style freshness", 0, null)]
		private static ConfigToggle Extrabeamsstylefreshness = new ConfigToggle(true);

		[Configgable("Player/Weapons/Pistol/Extrabeams", "Extra beams (default variant)", 0, null)]
		private static ConfigToggle StrongPistolbeam = new ConfigToggle(true);

		[Configgable("Player/Weapons/Pistol/Extrabeams/Extra beams (default variant) settings", "Amount of extra beams", 0, null)]
		private static ConfigInputField<int> Beammult1 = new ConfigInputField<int>(1, (Func<int, bool>)null, (Func<string, ValueTuple<bool, int>>)null);

		[Configgable("Player/Weapons/Pistol/Extrabeams/Extra beams (default variant) settings", "Shoot charged beams", 0, null)]
		private static ConfigToggle Shootaltbeams1 = new ConfigToggle(true);

		[Configgable("Player/Weapons/Pistol/Extrabeams", "Extra beams (alt variant)", 0, null)]
		private static ConfigToggle StrongPistolbeam2 = new ConfigToggle(true);

		[Configgable("Player/Weapons/Pistol/Extrabeams/Extra beams (alt variant) settings", "Amount of extra beams", 0, null)]
		private static ConfigInputField<int> Beammult2 = new ConfigInputField<int>(1, (Func<int, bool>)null, (Func<string, ValueTuple<bool, int>>)null);

		[Configgable("Player/Weapons/Pistol/Extrabeams/Extra beams (alt variant) settings", "Shoot charged beams", 0, null)]
		private static ConfigToggle Shootaltbeams2 = new ConfigToggle(true);

		[Configgable("Player/Weapons/Shotgun", "Shotgun gatling enabled", 0, null)]
		private static ConfigToggle ShotgunGatling = new ConfigToggle(true);

		[Configgable("Player/Weapons/Shotgun", null, 0, null)]
		private static ConfigInputField<float> ShotgunCD = new ConfigInputField<float>(1f, (Func<float, bool>)null, (Func<string, ValueTuple<bool, float>>)null);

		[Configgable("Player/Weapons/Shotgun", "Hitscan shotgun", 0, null)]
		private static ConfigToggle HitscanShotgun = new ConfigToggle(false);

		[Configgable("Player/Weapons/Shotgun", "No Pilebunker Cooldown", 0, "No cooldown after performing a tier 3 speed attack using the pilebunker")]
		private static ConfigToggle PBSpeed = new ConfigToggle(false);

		[Configgable("Player/Weapons/Shotgun", "Force Pilebunker player speed", 0, "Forces the weapon's gauge onto a specific power stage")]
		private static ConfigToggle forcePBPlayerSpeed = new ConfigToggle(false);

		[Configgable("Player/Weapons/Shotgun", "Forced Speed Stage", 0, "Forces the weapon's gauge onto a specific power stage")]
		private static IntegerSlider PBPlayerSpeed = new IntegerSlider(0, 0, 3);

		[Configgable("Player/Weapons/Nailgun", "Infinite nailgun ammo", 0, null)]
		private static ConfigToggle BuffNailgun = new ConfigToggle(true);

		[Configgable("Player/Weapons/Nailgun", "Sawgun shoots alternative projectiles", 0, null)]
		private static ConfigToggle projectilenails = new ConfigToggle(false);

		[Configgable("Player/Weapons/Nailgun", "Sawgun Alternate Projectile", 0, null)]
		private static ConfigDropdown<AlternateProjectile> altProj = new ConfigDropdown<AlternateProjectile>((AlternateProjectile[])Enum.GetValues(typeof(AlternateProjectile)), (string[])null, 0);

		[Configgable("Player/Weapons/Nailgun", "Additional sawgun projectiles affect style freshness", 0, null)]
		private static ConfigToggle projsaffectstyle = new ConfigToggle(true);

		[Configgable("Player/Weapons/Nailgun/Alternate projectile settings", "Amount of additional sawgun projectiles", 0, null)]
		private static ConfigInputField<int> additionalprojectile = new ConfigInputField<int>(2, (Func<int, bool>)null, (Func<string, ValueTuple<bool, int>>)null);

		[Configgable("Player/Weapons/Nailgun/Alternate projectile settings", "Additional sawgun projectile spread", 0, null)]
		private static ConfigInputField<float> additionalprojectilespread = new ConfigInputField<float>(5f, (Func<float, bool>)null, (Func<string, ValueTuple<bool, float>>)null);

		[Configgable("Player/Weapons/Nailgun", "Nailgun shoots alternative projectiles", 0, null)]
		private static ConfigToggle projectilenails1 = new ConfigToggle(false);

		[Configgable("Player/Weapons/Nailgun", "Nailgun Alternate Projectile", 0, null)]
		private static ConfigDropdown<AlternateProjectile> altProj1 = new ConfigDropdown<AlternateProjectile>((AlternateProjectile[])Enum.GetValues(typeof(AlternateProjectile)), (string[])null, 0);

		[Configgable("Player/Weapons/Nailgun", "Additional nailgun projectiles affect style freshness", 0, null)]
		private static ConfigToggle projsaffectstyle1 = new ConfigToggle(true);

		[Configgable("Player/Weapons/Nailgun/Alternate projectile settings", "Amount of additional nailgun projectiles", 0, null)]
		private static ConfigInputField<int> additionalprojectile1 = new ConfigInputField<int>(2, (Func<int, bool>)null, (Func<string, ValueTuple<bool, int>>)null);

		[Configgable("Player/Weapons/Nailgun/Alternate projectile settings", "Additional nailgun projectile spread", 0, null)]
		private static ConfigInputField<float> additionalprojectilespread1 = new ConfigInputField<float>(5f, (Func<float, bool>)null, (Func<string, ValueTuple<bool, float>>)null);

		[Configgable("Player/Weapons/Rocket launcher", "Rocket gatling enabled", 0, null)]
		private static ConfigToggle Enabled_RocketGatling = new ConfigToggle(true);

		[Configgable("Player/Weapons/Rocket launcher", "Rocket firing speed", 0, null)]
		private static ConfigInputField<float> RocketCoolDownFloat = new ConfigInputField<float>(1f, (Func<float, bool>)null, (Func<string, ValueTuple<bool, float>>)null);

		[Configgable("Player/Weapons/Rocket launcher", "Infinite rocket ride time", 0, null)]
		private static ConfigToggle infrocketride = new ConfigToggle(true);

		[Configgable("Player/Weapons/Rocket launcher", "SRS rocket launcher shoots malrails", 0, null)]
		private static ConfigToggle rocketgrenade = new ConfigToggle(false);

		[Configgable("Player/Weapons/Rocket launcher", "Rockets home in to crosshair", 0, null)]
		private static ConfigToggle homingrockets = new ConfigToggle(false);

		[Configgable("Player/Weapons/Rocket launcher", "Instant freezecharged rockets", 0, null)]
		private static ConfigToggle instafreezecharge = new ConfigToggle(false);

		[Configgable("Player/Weapons/Rocket launcher/Gasoline", "Gasoline Colour", 0, null)]
		private static ConfigColor gasColor = new ConfigColor(new Color(0.0943f, 0.0943f, 0.0943f, 1f));

		[Configgable("Player/UI", "Hud tips", 0, null)]
		private static ConfigToggle Enabled_HudTips = new ConfigToggle(true);

		[Configgable("Mutators/Explosions", "Big explosions", 0, null)]
		private static ConfigToggle bigexplosions = new ConfigToggle(false);

		[Configgable("Mutators/Explosions", "Explosion size multiplier", 0, null)]
		private static ConfigInputField<float> explosionmult = new ConfigInputField<float>(10f, (Func<float, bool>)null, (Func<string, ValueTuple<bool, float>>)null);

		[Configgable("Player/Misc", "Player emits light", 0, null)]
		private static ConfigToggle plushhat = new ConfigToggle(false);

		[Configgable("Player/Misc", "Player light intensity", 0, null)]
		private static ConfigInputField<float> lightintensity = new ConfigInputField<float>(2f, (Func<float, bool>)null, (Func<string, ValueTuple<bool, float>>)null);

		[Configgable("Player/Misc/Abilities", "Pocket rocket rides", 0, null)]
		public static ConfigToggle pocketrockets = new ConfigToggle(false);

		[Configgable("Player/Misc/Abilities", "Pocket rocket ride key", 0, null)]
		public static ConfigKeybind pocketrocketkey = new ConfigKeybind((KeyCode)98);

		public float pocketrocketdelay;

		private GameObject plush;

		private static Transform playercam;

		private InputManager inman;

		private GameObject[] objects;

		private GameObject singularity;

		public static bool spawnfriendlyenemies;

		public static Button friendlyenemybutton;

		public static TextMeshProUGUI friendlyenemytext;

		public static SpawnMenuSectionReference friendlyenemiessection;

		public static bool canpress;

		public static bool hasJaket;

		public static GameObject beamcutterbeam;

		public static BeamgunBeam bgbeam;

		private bool candoshit = false;

		public static ConfigBuilder ConfigBuilder { get; private set; }

		public void Awake()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Expected O, but got Unknown
			ConfigBuilder = new ConfigBuilder("plonk.rocketgatling", "RocketGatling");
			ConfigBuilder.Build();
		}

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

		public static void SendHudMessage(string msg, int delay, bool silent)
		{
			MonoSingleton<HudMessageReceiver>.Instance.SendHudMessage(msg, "", "", delay, silent);
		}

		public static void Log(string log, int type = 1)
		{
			switch (type)
			{
			case 1:
				Debug.Log((object)log);
				break;
			case 2:
				Debug.LogWarning((object)log);
				break;
			case 3:
				Debug.LogError((object)log);
				break;
			}
		}

		public void Start()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			Harmony val = new Harmony("plonk.rocketgatling");
			val.PatchAll();
			projectile = Fetch<GameObject>("Assets/Prefabs/Attacks and Projectiles/Projectile.prefab");
			rocket = Fetch<GameObject>("Assets/Prefabs/Attacks and Projectiles/Rocket.prefab");
			grenade = Fetch<GameObject>("Assets/Prefabs/Attacks and Projectiles/Grenade.prefab");
			malrailbeam = Fetch<GameObject>("Assets/Prefabs/Attacks and Projectiles/Hitscan Beams/Railcannon Beam Malicious.prefab");
			pistolbeam = Fetch<GameObject>("Assets/Prefabs/Attacks and Projectiles/Hitscan Beams/Revolver Beam.prefab");
		}

		private void Update()
		{
			if (!candoshit && SceneHelper.CurrentScene == "Main Menu")
			{
				candoshit = true;
			}
			if (candoshit && SceneHelper.CurrentScene != "Main Menu")
			{
				if ((Object)(object)inman == (Object)null)
				{
					inman = MonoSingleton<InputManager>.Instance;
				}
				if ((Object)(object)playercam == (Object)null)
				{
					playercam = ((Component)MonoSingleton<CameraController>.Instance).transform;
				}
				Plushhat();
				PocketRocket();
				Explosionmult();
				NoCharges();
			}
		}

		private void NoCharges()
		{
			if (!((Object)(object)MonoSingleton<WeaponCharges>.instance != (Object)null))
			{
				return;
			}
			WeaponCharges instance = MonoSingleton<WeaponCharges>.instance;
			if (((ConfigValueElement<bool>)(object)PBSpeed).Value)
			{
				for (int i = 0; i < instance.shoaltcooldowns.Length; i++)
				{
					instance.shoaltcooldowns[i] = 0f;
				}
			}
		}

		private void PocketRocket()
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			if (((ConfigValueElement<bool>)(object)pocketrockets).Value && pocketrocketdelay <= 0f && Input.GetKeyDown(((ConfigValueElement<KeyCode>)(object)pocketrocketkey).Value))
			{
				pocketrocketdelay = 0.5f;
				GameObject val = Object.Instantiate<GameObject>(rocket, playercam.position, playercam.rotation);
				Grenade component = val.GetComponent<Grenade>();
				component.PlayerRideStart();
				MonoSingleton<ObjectTracker>.instance.AddGrenade(component);
				component.totalDamageMultiplier = 0f;
				component.rocketSpeed *= 2f;
			}
			if (pocketrocketdelay > 0f)
			{
				pocketrocketdelay = Mathf.MoveTowards(pocketrocketdelay, 0f, Time.deltaTime);
			}
		}

		private void Explosionmult()
		{
			if (((ConfigValueElement<bool>)(object)bigexplosions).Value)
			{
				if (hasJaket)
				{
					float globalSizeMulti = Mathf.Clamp(((ConfigValueElement<float>)(object)explosionmult).Value, 0f, 2f);
					Explosion.globalSizeMulti = globalSizeMulti;
				}
				else
				{
					Explosion.globalSizeMulti = ((ConfigValueElement<float>)(object)explosionmult).Value;
				}
			}
			else
			{
				Explosion.globalSizeMulti = 1f;
			}
		}

		private void Plushhat()
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			if (((ConfigValueElement<bool>)(object)plushhat).Value)
			{
				if (((ConfigValueElement<bool>)(object)plushhat).Value && (Object)(object)plush == (Object)null)
				{
					GameObject val = Fetch<GameObject>("Assets/Particles/FireSimple.prefab");
					plush = Object.Instantiate<GameObject>(val, playercam.position + playercam.up, playercam.rotation, playercam);
					plush.AddComponent<Light>();
				}
				if ((Object)(object)plush != (Object)null && (Object)(object)plush.GetComponent<Light>() != (Object)null)
				{
					plush.GetComponent<Light>().range = 25f;
					plush.GetComponent<Light>().intensity = ((ConfigValueElement<float>)(object)lightintensity).Value;
					if (inttimer <= 0f)
					{
						inttimer = 0.2f;
						plush.GetComponent<Light>().color = new Color(Random.Range(0.7f, 1f), Random.Range(0.3f, 0.5f), 0f, 1f);
					}
					if (inttimer > 0f)
					{
						inttimer = Mathf.MoveTowards(inttimer, 0f, Time.deltaTime);
					}
				}
			}
			if (!((ConfigValueElement<bool>)(object)plushhat).Value && (Object)(object)plush != (Object)null)
			{
				Object.Destroy((Object)(object)plush);
			}
		}
	}
}
namespace RocketGatling
{
	internal class BeamID : MonoBehaviour
	{
	}
}