Decompiled source of BananaWeapons v1.0.1

Banana Weapons.dll

Decompiled a month ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using Banana_Weapons;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using ULTRAKILL.Cheats;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("Banana_Weapons")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Banana_Weapons")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("d12fef8e-3ff5-4c3b-835d-5b6777a60cd6")]
[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]
public class car : MonoBehaviour
{
	public Rigidbody rigid;

	public WheelCollider wheel1;

	public WheelCollider wheel2;

	public WheelCollider wheel3;

	public WheelCollider wheel4;

	public float drivespeed;

	public float steerspeed;

	private float horizontalInput;

	private float verticalInput;

	public bool activated;

	private InputManager inman;

	public float DamageToEnemies;

	public GameObject ExplosionOnCrash;

	public float speed;

	public void ActivateCar()
	{
		activated = true;
		((Component)MonoSingleton<NewMovement>.instance).gameObject.SetActive(false);
	}

	private void Start()
	{
		inman = MonoSingleton<InputManager>.Instance;
		Banana_WeaponsPlugin.cars.Add(this);
	}

	private void Update()
	{
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Unknown result type (might be due to invalid IL or missing references)
		if (activated)
		{
			horizontalInput = inman.InputSource.Move.ReadValue<Vector2>().x;
			verticalInput = inman.InputSource.Move.ReadValue<Vector2>().y;
			Vector3 velocity = rigid.velocity;
			speed = ((Vector3)(ref velocity)).magnitude;
			if (!inman.PerformingCheatMenuCombo() && inman.InputSource.NextVariation.WasPerformedThisFrame)
			{
				activated = false;
				((Component)MonoSingleton<NewMovement>.instance).gameObject.SetActive(true);
				((Component)MonoSingleton<NewMovement>.instance).transform.position = ((Component)this).transform.position;
			}
		}
	}

	private void FixedUpdate()
	{
		if (activated)
		{
			float motorTorque = verticalInput * drivespeed;
			wheel1.motorTorque = motorTorque;
			wheel2.motorTorque = motorTorque;
			wheel3.motorTorque = motorTorque;
			wheel4.motorTorque = motorTorque;
			wheel1.steerAngle = steerspeed * horizontalInput;
			wheel2.steerAngle = steerspeed * horizontalInput;
		}
	}
}
[HarmonyPatch(typeof(OutOfBounds), "OnTriggerEnter")]
public class OutOfBoundsPatch
{
	public static bool Prefix(OutOfBounds __instance, Collider other)
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Invalid comparison between Unknown and I4
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
		if (!((Component)other).gameObject.CompareTag("Player") || (int)__instance.targets == 2)
		{
			return true;
		}
		if ((Object)(object)((Component)other).transform.parent == (Object)null)
		{
			return true;
		}
		car car2 = default(car);
		if (((Component)((Component)other).transform.parent).TryGetComponent<car>(ref car2))
		{
			Object.Instantiate<GameObject>(car2.ExplosionOnCrash, ((Component)car2).transform.position, Quaternion.identity);
			if (car2.activated)
			{
				((Component)MonoSingleton<NewMovement>.instance).gameObject.SetActive(true);
				((Component)MonoSingleton<NewMovement>.instance).transform.position = ((Component)car2).transform.position;
			}
			Banana_WeaponsPlugin.cars.Remove(car2);
			Object.Destroy((Object)(object)((Component)car2).gameObject);
			return false;
		}
		return true;
	}
}
[HarmonyPatch(typeof(Projectile), "TimeToDie")]
public class TimeToDiePatch
{
	public static bool Prefix(Projectile __instance)
	{
		if ((Object)(object)__instance.nmov == (Object)null)
		{
			__instance.hittingPlayer = false;
			return false;
		}
		return true;
	}
}
[HarmonyPatch(typeof(PlayerTracker))]
public class PlayerTrackerPatch
{
	[HarmonyPatch("GetPlayer")]
	[HarmonyPostfix]
	public static void GetPlayer_Postfix(ref Transform __result)
	{
		foreach (car car in Banana_WeaponsPlugin.cars)
		{
			if ((Object)(object)car != (Object)null && car.activated)
			{
				__result = ((Component)car).transform;
				break;
			}
		}
	}

	[HarmonyPatch("GetPlayerVelocity")]
	[HarmonyPostfix]
	public static void GetPlayerVelocity_Postfix(ref Vector3 __result)
	{
		//IL_0036: 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)
		foreach (car car in Banana_WeaponsPlugin.cars)
		{
			if ((Object)(object)car != (Object)null && car.activated)
			{
				__result = car.rigid.velocity;
				break;
			}
		}
	}

	[HarmonyPatch("PredictPlayerPosition")]
	[HarmonyPostfix]
	public static void PredictPlayerPosition_Postfix(ref Vector3 __result, float time)
	{
		//IL_0036: 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_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		foreach (car car in Banana_WeaponsPlugin.cars)
		{
			if ((Object)(object)car != (Object)null && car.activated)
			{
				__result = ((Component)car).transform.position + car.rigid.velocity * time;
				break;
			}
		}
	}
}
public class wheel : MonoBehaviour
{
	public WheelCollider wheelCollider;

	public Transform wheelMesh;

	public bool wheelTurn;

	private void Update()
	{
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: 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)
		if (wheelTurn)
		{
			wheelMesh.localEulerAngles = new Vector3(wheelMesh.localEulerAngles.x, wheelCollider.steerAngle - wheelMesh.localEulerAngles.z, wheelMesh.localEulerAngles.z);
		}
		wheelMesh.Rotate(wheelCollider.rpm / 60f * 360f * Time.deltaTime, 0f, 0f);
	}
}
namespace Banana_Weapons
{
	[BepInPlugin("com.michi.Banana_Weapons", "Banana_Weapons", "1.0.0")]
	public class Banana_WeaponsPlugin : BaseUnityPlugin
	{
		[HarmonyPatch(typeof(FistControl), "ResetFists")]
		public static class FistControl_ResetFists_Patch
		{
			public static void Postfix(FistControl __instance)
			{
				if ((Object)(object)__instance == (Object)null || addedArms == null)
				{
					return;
				}
				for (int i = 0; i < addedArms.Count; i++)
				{
					if ((Object)(object)addedArms[i] != (Object)null)
					{
						GameObject item = Object.Instantiate<GameObject>(addedArms[i], ((Component)__instance).transform);
						__instance.spawnedArms.Add(item);
						__instance.spawnedArmNums.Add(i + 3);
					}
				}
			}
		}

		[HarmonyPatch(typeof(Punch), "Start")]
		public static class StartPunch
		{
			[HarmonyPrefix]
			public static bool Prefix(Punch __instance)
			{
				Debug.Log((object)("aaaaaaaaaaaa" + ((Object)((Component)__instance).gameObject).name));
				if (((Object)((Component)__instance).gameObject).name != "GigaArm(Clone)")
				{
					return true;
				}
				Debug.Log((object)("aaaaaaaaaaaa" + ((Object)((Component)__instance).gameObject).name));
				__instance.holdingInput = false;
				if ((Object)(object)__instance.fc == (Object)null)
				{
					__instance.fc = MonoSingleton<FistControl>.Instance;
				}
				__instance.damage = 20f;
				__instance.screenShakeMultiplier = 16f;
				__instance.force = 800f;
				__instance.tryForExplode = true;
				__instance.cooldownCost = 0f;
				__instance.hitter = "heavypunch";
				return false;
			}
		}

		[HarmonyPatch(typeof(Punch), "Start")]
		public static class StartPunchSaitama
		{
			[HarmonyPrefix]
			public static bool Prefix(Punch __instance)
			{
				Debug.Log((object)("aaaaaaaaaaaa" + ((Object)((Component)__instance).gameObject).name));
				if (((Object)((Component)__instance).gameObject).name != "Arm Saitama(Clone)")
				{
					return true;
				}
				Debug.Log((object)("aaaaaaaaaaaa" + ((Object)((Component)__instance).gameObject).name));
				__instance.holdingInput = false;
				if ((Object)(object)__instance.fc == (Object)null)
				{
					__instance.fc = MonoSingleton<FistControl>.Instance;
				}
				__instance.damage = 50000f;
				__instance.screenShakeMultiplier = 1f;
				__instance.force = 8000f;
				__instance.tryForExplode = true;
				__instance.cooldownCost = 0f;
				__instance.hitter = "heavypunch";
				return false;
			}
		}

		[HarmonyPatch(typeof(Punch), "Start")]
		public static class BlastCheckSaitama
		{
			[HarmonyPrefix]
			public static bool Prefix(Punch __instance)
			{
				//IL_0076: Unknown result type (might be due to invalid IL or missing references)
				//IL_0085: Unknown result type (might be due to invalid IL or missing references)
				//IL_008f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0094: Unknown result type (might be due to invalid IL or missing references)
				//IL_0099: Unknown result type (might be due to invalid IL or missing references)
				//IL_009f: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ae: 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_00ff: Unknown result type (might be due to invalid IL or missing references)
				//IL_010a: 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_00e3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
				Debug.Log((object)("aaaaaaaaaaaa" + ((Object)((Component)__instance).gameObject).name));
				if (((Object)((Component)__instance).gameObject).name != "Arm Saitama(Clone)")
				{
					return true;
				}
				Debug.Log((object)("aaaaaaaaaaaa" + ((Object)((Component)__instance).gameObject).name));
				if (__instance.heldAction.IsPressed())
				{
					__instance.holdingInput = false;
					Vector3 val = MonoSingleton<CameraController>.Instance.GetDefaultPos() + ((Component)MonoSingleton<CameraController>.Instance).transform.forward * 2f;
					RaycastHit val2 = default(RaycastHit);
					if (Physics.Raycast(MonoSingleton<CameraController>.Instance.GetDefaultPos(), ((Component)MonoSingleton<CameraController>.Instance).transform.forward, ref val2, 2f, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)2))))
					{
						val = ((RaycastHit)(ref val2)).point - __instance.camObj.transform.forward * 0.1f;
					}
					Object.Instantiate<GameObject>(__instance.blastWave, val, ((Component)MonoSingleton<CameraController>.Instance).transform.rotation);
				}
				return false;
			}
		}

		[HarmonyPatch]
		public static class ParryExplosionPunch
		{
			[HarmonyPatch(typeof(Punch), "TryParryProjectile")]
			[HarmonyPrefix]
			public static bool Prefix(Punch __instance, Transform target)
			{
				Debug.Log((object)("aaaaaaaaaaaa" + ((Object)((Component)__instance).gameObject).name));
				if (((Object)((Component)__instance).gameObject).name != "GigaArm(Clone)")
				{
					return true;
				}
				Explosion val = default(Explosion);
				if (((Component)target).TryGetComponent<Explosion>(ref val))
				{
					if (val.damage == 0)
					{
						return true;
					}
					ParryExplosive(val, __instance);
					__instance.hitSomething = true;
					__instance.parriedSomething = true;
					return true;
				}
				return true;
			}

			private static void ParryExplosive(Explosion explosive, Punch __instance)
			{
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				explosive.speed *= -1f;
				explosive.damage *= 2;
				explosive.canHit = (AffectedSubjects)2;
				__instance.parriedSomething = true;
				__instance.hitSomething = true;
				__instance.activeFrames = 0;
				__instance.anim.Play("Hook", 0, 0.065f);
				__instance.aud.pitch = Random.Range(0.7f, 0.8f);
				MonoSingleton<NewMovement>.Instance.Parry((EnemyIdentifier)null, "");
			}

			[HarmonyPatch(typeof(Explosion), "FixedUpdate")]
			[HarmonyPostfix]
			public static void Postfix(Explosion __instance)
			{
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				if (((Component)__instance).transform.localScale.x <= 0f)
				{
					__instance.harmless = true;
					((Collider)__instance.scol).enabled = false;
					__instance.fading = true;
					__instance.speed /= 4f;
				}
			}
		}

		private const string MyGUID = "com.michi.Banana_Weapons";

		private const string PluginName = "Banana_Weapons";

		private const string VersionString = "1.0.0";

		private static readonly Harmony Harmony = new Harmony("com.michi.Banana_Weapons");

		public static ManualLogSource Log = new ManualLogSource("Banana_Weapons");

		private static List<GameObject> addedArms = new List<GameObject>();

		private List<GameObject> BundleArms = new List<GameObject>();

		private static List<GameObject> addedWeapons = new List<GameObject>();

		private List<GameObject> BundleWeapons = new List<GameObject>();

		public static List<car> cars = new List<car>();

		private void Awake()
		{
			try
			{
				((BaseUnityPlugin)this).Logger.LogInfo((object)"PluginName: Banana_Weapons, VersionString: 1.0.0 is loading...");
				Harmony.PatchAll();
				Log = ((BaseUnityPlugin)this).Logger;
				Assembly executingAssembly = Assembly.GetExecutingAssembly();
				using (Stream stream = executingAssembly.GetManifestResourceStream("Banana_Weapons.Bundles.arms"))
				{
					if (stream == null)
					{
						((BaseUnityPlugin)this).Logger.LogError((object)"Failed to load asset bundle stream: Resource not found");
						return;
					}
					AssetBundle val = AssetBundle.LoadFromStream(stream);
					if ((Object)(object)val == (Object)null)
					{
						((BaseUnityPlugin)this).Logger.LogError((object)"Failed to load asset bundle from stream");
						return;
					}
					GameObject[] array = val.LoadAllAssets<GameObject>();
					if (array == null || array.Length == 0)
					{
						((BaseUnityPlugin)this).Logger.LogError((object)"No GameObjects found in asset bundle");
						val.Unload(false);
						return;
					}
					BundleArms.AddRange(array);
					val.Unload(false);
				}
				using (Stream stream2 = executingAssembly.GetManifestResourceStream("Banana_Weapons.Bundles.weapons"))
				{
					if (stream2 == null)
					{
						((BaseUnityPlugin)this).Logger.LogError((object)"Failed to load asset bundle stream: Resource not found");
						return;
					}
					AssetBundle val2 = AssetBundle.LoadFromStream(stream2);
					if ((Object)(object)val2 == (Object)null)
					{
						((BaseUnityPlugin)this).Logger.LogError((object)"Failed to load asset bundle from stream");
						return;
					}
					GameObject[] array2 = val2.LoadAllAssets<GameObject>();
					if (array2 == null || array2.Length == 0)
					{
						((BaseUnityPlugin)this).Logger.LogError((object)"No GameObjects found in asset bundle");
						val2.Unload(false);
						return;
					}
					BundleWeapons.AddRange(array2);
					val2.Unload(false);
				}
				((BaseUnityPlugin)this).Logger.LogInfo((object)$"Successfully loaded {BundleArms.Count} arms from bundle");
				((BaseUnityPlugin)this).Logger.LogInfo((object)$"Successfully loaded {BundleWeapons.Count} weapons from bundle");
				((BaseUnityPlugin)this).Logger.LogInfo((object)"PluginName: Banana_Weapons, VersionString: 1.0.0 is loaded.");
			}
			catch (Exception ex)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)("Error during plugin initialization: " + ex.Message + "\n" + ex.StackTrace));
			}
			Assembly executingAssembly2 = Assembly.GetExecutingAssembly();
			SceneManager.sceneLoaded += SceneManager_sceneLoaded;
		}

		private void SceneManager_sceneLoaded(Scene arg0, LoadSceneMode arg1)
		{
			addedArms.Clear();
			addedWeapons.Clear();
		}

		public static GameObject MakeGun(int var, GameObject original)
		{
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)MonoSingleton<GunControl>.Instance == (Object)null || (Object)(object)MonoSingleton<StyleHUD>.Instance == (Object)null)
			{
				return null;
			}
			if (!((Behaviour)MonoSingleton<GunControl>.Instance).enabled || !((Behaviour)MonoSingleton<StyleHUD>.Instance).enabled)
			{
				return null;
			}
			GameObject val = Object.Instantiate<GameObject>(original);
			if ((Object)(object)val == (Object)null)
			{
				return null;
			}
			Vector3 position = val.transform.position;
			Quaternion rotation = val.transform.rotation;
			val.transform.parent = ((Component)MonoSingleton<GunControl>.Instance).transform;
			val.transform.localPosition = position;
			val.transform.localRotation = rotation;
			MonoSingleton<GunControl>.Instance.slots[var].Add(val);
			MonoSingleton<GunControl>.Instance.allWeapons.Add(val);
			MonoSingleton<GunControl>.Instance.slotDict.Add(val, var);
			MonoSingleton<StyleHUD>.Instance.weaponFreshness.Add(val, 10f);
			val.SetActive(false);
			MonoSingleton<GunControl>.Instance.noWeapons = false;
			MonoSingleton<GunControl>.Instance.YesWeapon();
			for (int i = 0; i < ((Component)MonoSingleton<GunControl>.Instance).transform.childCount; i++)
			{
				((Component)((Component)MonoSingleton<GunControl>.Instance).transform.GetChild(i)).gameObject.SetActive(false);
			}
			return val;
		}

		private void Update()
		{
			if (BundleArms == null || BundleArms.Count == 0)
			{
				return;
			}
			foreach (GameObject bundleArm in BundleArms)
			{
				if ((Object)(object)bundleArm != (Object)null && !addedArms.Contains(bundleArm))
				{
					AddArm(bundleArm, 3);
				}
			}
			if (BundleWeapons == null || BundleWeapons.Count == 0)
			{
				return;
			}
			foreach (GameObject bundleWeapon in BundleWeapons)
			{
				if ((Object)(object)bundleWeapon != (Object)null && !addedWeapons.Contains(bundleWeapon))
				{
					addedWeapons.Add(bundleWeapon);
					MakeGun(5, bundleWeapon);
				}
			}
		}

		public void AddArm(GameObject arm, int slot)
		{
			if (!((Object)(object)arm == (Object)null))
			{
				addedArms.Add(arm);
				FistControl instance = MonoSingleton<FistControl>.Instance;
				if ((Object)(object)instance != (Object)null)
				{
					instance.ResetFists();
				}
			}
		}
	}
	public static class ProjectilePatches
	{
		[HarmonyPatch(typeof(Projectile), "Collided")]
		public static class ProjectileCollisionPatch
		{
			[HarmonyPrefix]
			public static bool CantDestroy(Projectile __instance, Collider other)
			{
				//IL_0059: Unknown result type (might be due to invalid IL or missing references)
				//IL_005f: Invalid comparison between Unknown and I4
				//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
				//IL_0100: Unknown result type (might be due to invalid IL or missing references)
				//IL_010a: 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_01f0: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
				//IL_0280: 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_0290: Unknown result type (might be due to invalid IL or missing references)
				//IL_029b: Unknown result type (might be due to invalid IL or missing references)
				//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
				//IL_0245: Unknown result type (might be due to invalid IL or missing references)
				//IL_024b: Invalid comparison between Unknown and I4
				//IL_02d0: 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_02f8: Unknown result type (might be due to invalid IL or missing references)
				//IL_0303: Unknown result type (might be due to invalid IL or missing references)
				//IL_0308: Unknown result type (might be due to invalid IL or missing references)
				//IL_0323: Unknown result type (might be due to invalid IL or missing references)
				//IL_0328: Unknown result type (might be due to invalid IL or missing references)
				//IL_0971: Unknown result type (might be due to invalid IL or missing references)
				//IL_097b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0420: Unknown result type (might be due to invalid IL or missing references)
				//IL_0426: Unknown result type (might be due to invalid IL or missing references)
				//IL_042e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0435: Unknown result type (might be due to invalid IL or missing references)
				//IL_08b0: Unknown result type (might be due to invalid IL or missing references)
				//IL_085c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0861: Invalid comparison between I4 and Unknown
				//IL_08f8: Unknown result type (might be due to invalid IL or missing references)
				//IL_08df: Unknown result type (might be due to invalid IL or missing references)
				//IL_05ee: Unknown result type (might be due to invalid IL or missing references)
				//IL_05f3: Unknown result type (might be due to invalid IL or missing references)
				//IL_05f7: Unknown result type (might be due to invalid IL or missing references)
				//IL_0601: Unknown result type (might be due to invalid IL or missing references)
				//IL_060c: Unknown result type (might be due to invalid IL or missing references)
				//IL_06b7: Unknown result type (might be due to invalid IL or missing references)
				//IL_06bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_06c0: Unknown result type (might be due to invalid IL or missing references)
				//IL_06ca: Unknown result type (might be due to invalid IL or missing references)
				//IL_06d5: Unknown result type (might be due to invalid IL or missing references)
				//IL_065a: Unknown result type (might be due to invalid IL or missing references)
				//IL_065f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0663: Unknown result type (might be due to invalid IL or missing references)
				//IL_066d: 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)
				if (__instance.bulletType != "NoDissapear")
				{
					return true;
				}
				if (!__instance.friendly && !__instance.hittingPlayer && ((Component)other).gameObject.CompareTag("Player"))
				{
					if (!__instance.target.isPlayer || (int)MonoSingleton<PlayerTracker>.Instance.playerType != 1)
					{
						if (__instance.spreaded)
						{
							ProjectileSpread componentInParent = ((Component)__instance).GetComponentInParent<ProjectileSpread>();
							if ((Object)(object)componentInParent != (Object)null && componentInParent.parried)
							{
								return false;
							}
						}
						__instance.hittingPlayer = true;
						__instance.rb.velocity = Vector3.zero;
						if (__instance.keepTrail)
						{
							__instance.KeepTrail();
						}
						((Component)__instance).transform.position = new Vector3(((Component)other).transform.position.x, ((Component)__instance).transform.position.y, ((Component)other).transform.position.z);
						__instance.nmov = ((Component)other).gameObject.GetComponentInParent<NewMovement>();
						((MonoBehaviour)__instance).Invoke("RecheckPlayerHit", 0.05f);
						return false;
					}
					MonoSingleton<PlatformerMovement>.Instance.Explode(false);
					if (__instance.explosive)
					{
						__instance.Explode();
						return false;
					}
					if (__instance.keepTrail)
					{
						__instance.KeepTrail();
					}
					__instance.CreateExplosionEffect();
					return false;
				}
				if (!__instance.canHitCoin || !((Component)other).gameObject.CompareTag("Coin"))
				{
					EnemyIdentifierIdentifier val = default(EnemyIdentifierIdentifier);
					EnemyIdentifierIdentifier val2 = default(EnemyIdentifierIdentifier);
					Vector3 val4;
					if ((((Component)other).gameObject.CompareTag("Armor") && (__instance.friendly || !((Component)other).TryGetComponent<EnemyIdentifierIdentifier>(ref val) || !Object.op_Implicit((Object)(object)val.eid) || val.eid.enemyType != __instance.safeEnemyType)) || (__instance.boosted && ((Component)other).gameObject.layer == 11 && ((Component)other).gameObject.CompareTag("Body") && ((Component)other).TryGetComponent<EnemyIdentifierIdentifier>(ref val2) && Object.op_Implicit((Object)(object)val2.eid) && (int)val2.eid.enemyType == 4 && !val2.eid.isGasolined))
					{
						RaycastHit val3 = default(RaycastHit);
						if (!__instance.alreadyDeflectedBy.Contains(other) && Physics.Raycast(((Component)__instance).transform.position - ((Component)__instance).transform.forward, ((Component)__instance).transform.forward, ref val3, float.PositiveInfinity, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)3))))
						{
							Transform transform = ((Component)__instance).transform;
							val4 = Vector3.Reflect(((Component)__instance).transform.forward, ((RaycastHit)(ref val3)).normal);
							transform.forward = ((Vector3)(ref val4)).normalized;
							((Component)__instance).transform.position = ((RaycastHit)(ref val3)).point + ((Component)__instance).transform.forward;
							Object.Instantiate<GameObject>(MonoSingleton<DefaultReferenceManager>.Instance.ineffectiveSound, ((Component)__instance).transform.position, Quaternion.identity);
							__instance.alreadyDeflectedBy.Add(other);
							return false;
						}
					}
					else if (__instance.active && (((Component)other).gameObject.CompareTag("Head") || ((Component)other).gameObject.CompareTag("Body") || ((Component)other).gameObject.CompareTag("Limb") || ((Component)other).gameObject.CompareTag("EndLimb")) && !((Component)other).gameObject.CompareTag("Armor"))
					{
						EnemyIdentifierIdentifier componentInParent2 = ((Component)other).gameObject.GetComponentInParent<EnemyIdentifierIdentifier>();
						EnemyIdentifier val5 = null;
						if ((Object)(object)componentInParent2 != (Object)null && (Object)(object)componentInParent2.eid != (Object)null)
						{
							val5 = componentInParent2.eid;
						}
						if ((Object)(object)val5 != (Object)null && (__instance.alreadyHitEnemies.Count == 0 || !__instance.alreadyHitEnemies.Contains(val5)) && ((val5.enemyType != __instance.safeEnemyType && !EnemyIdentifier.CheckHurtException(__instance.safeEnemyType, val5.enemyType, __instance.target)) || (__instance.friendly && !val5.immuneToFriendlyFire) || __instance.playerBullet || __instance.parried))
						{
							if (__instance.explosive)
							{
								__instance.Explode();
							}
							bool flag = false;
							bool dead = val5.dead;
							if (__instance.playerBullet)
							{
								val5.hitter = __instance.bulletType;
								if (!val5.hitterWeapons.Contains(__instance.weaponType))
								{
									val5.hitterWeapons.Add(__instance.weaponType);
								}
							}
							else if (!__instance.friendly)
							{
								val5.hitter = "enemy";
							}
							else
							{
								val5.hitter = "projectile";
								flag = true;
							}
							if (__instance.boosted && !val5.blessed && !val5.dead)
							{
								MonoSingleton<StyleHUD>.Instance.AddPoints(90, "ultrakill.projectileboost", __instance.sourceWeapon, val5, -1, "", "");
							}
							bool flag2 = true;
							if (__instance.spreaded)
							{
								ProjectileSpread componentInParent3 = ((Component)__instance).GetComponentInParent<ProjectileSpread>();
								if ((Object)(object)componentInParent3 != (Object)null)
								{
									if (componentInParent3.hitEnemies.Contains(val5))
									{
										flag2 = false;
									}
									else
									{
										componentInParent3.hitEnemies.Add(val5);
									}
								}
							}
							if (!__instance.explosive)
							{
								if (flag2)
								{
									if (__instance.playerBullet)
									{
										EnemyIdentifier obj = val5;
										GameObject gameObject = ((Component)other).gameObject;
										val4 = __instance.rb.velocity;
										obj.DeliverDamage(gameObject, ((Vector3)(ref val4)).normalized * 2500f, ((Component)__instance).transform.position, __instance.damage / 4f * __instance.enemyDamageMultiplier, flag, 0f, __instance.sourceWeapon, false, false);
									}
									else if (__instance.friendly)
									{
										EnemyIdentifier obj2 = val5;
										GameObject gameObject2 = ((Component)other).gameObject;
										val4 = __instance.rb.velocity;
										obj2.DeliverDamage(gameObject2, ((Vector3)(ref val4)).normalized * 10000f, ((Component)__instance).transform.position, __instance.damage / 4f * __instance.enemyDamageMultiplier, flag, 0f, __instance.sourceWeapon, false, false);
									}
									else
									{
										EnemyIdentifier obj3 = val5;
										GameObject gameObject3 = ((Component)other).gameObject;
										val4 = __instance.rb.velocity;
										obj3.DeliverDamage(gameObject3, ((Vector3)(ref val4)).normalized * 100f, ((Component)__instance).transform.position, __instance.damage / 10f * __instance.enemyDamageMultiplier, flag, 0f, __instance.sourceWeapon, false, false);
									}
								}
								__instance.CreateExplosionEffect();
							}
							if (__instance.keepTrail)
							{
								__instance.KeepTrail();
							}
							if (!dead)
							{
								MonoSingleton<TimeController>.Instance.HitStop(0.005f);
							}
							if (!dead || ((Component)other).gameObject.layer == 11 || __instance.boosted)
							{
								return false;
							}
							__instance.alreadyHitEnemies.Add(val5);
							__instance.active = true;
							return false;
						}
					}
					else
					{
						if (!__instance.hittingPlayer && (((Component)other).gameObject.layer == 8 || ((Component)other).gameObject.layer == 24) && __instance.active)
						{
							Breakable component = ((Component)other).gameObject.GetComponent<Breakable>();
							if ((Object)(object)component != (Object)null && !component.precisionOnly && (component.weak || __instance.strong))
							{
								component.Break();
							}
							Bleeder val6 = default(Bleeder);
							if (((Component)other).gameObject.TryGetComponent<Bleeder>(ref val6))
							{
								bool flag3 = false;
								if (!__instance.friendly && !__instance.playerBullet && val6.ignoreTypes.Length != 0)
								{
									EnemyType[] ignoreTypes = val6.ignoreTypes;
									for (int i = 0; i < ignoreTypes.Length; i++)
									{
										if ((int)ignoreTypes[i] == (int)__instance.safeEnemyType)
										{
											flag3 = true;
											break;
										}
									}
								}
								if (!flag3)
								{
									if (__instance.damage <= 10f)
									{
										val6.GetHit(((Component)__instance).transform.position, (GoreType)2, false);
									}
									else if (__instance.damage <= 30f)
									{
										val6.GetHit(((Component)__instance).transform.position, (GoreType)1, false);
									}
									else
									{
										val6.GetHit(((Component)__instance).transform.position, (GoreType)0, false);
									}
								}
							}
							if (__instance.explosive)
							{
								__instance.Explode();
							}
							else if (__instance.keepTrail)
							{
								__instance.KeepTrail();
							}
							return false;
						}
						if (((Component)other).gameObject.layer == 0)
						{
							Rigidbody componentInParent4 = ((Component)other).GetComponentInParent<Rigidbody>();
							if ((Object)(object)componentInParent4 != (Object)null)
							{
								componentInParent4.AddForce(((Component)__instance).transform.forward * 1000f);
							}
						}
					}
					return false;
				}
				Coin component2 = ((Component)other).gameObject.GetComponent<Coin>();
				if (Object.op_Implicit((Object)(object)component2) && !component2.shot)
				{
					if (!__instance.friendly)
					{
						if (__instance.target != null)
						{
							component2.customTarget = __instance.target;
						}
						component2.DelayedEnemyReflect();
					}
					else
					{
						component2.DelayedReflectRevolver(((Component)component2).transform.position, (GameObject)null);
					}
				}
				if (__instance.explosive)
				{
					__instance.Explode();
					return false;
				}
				if (__instance.keepTrail)
				{
					__instance.KeepTrail();
				}
				__instance.CreateExplosionEffect();
				return false;
			}
		}
	}
	[HarmonyPatch(typeof(GameStateManager))]
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	public class dontsubmit
	{
		public static bool Prefix(ref bool __result)
		{
			__result = false;
			return false;
		}
	}
}
namespace Banana_Weapons.MonoBehaviours
{
	internal class AirStrikeSpawner : MonoBehaviour
	{
		public GameObject airstrike1;

		public GameObject airstrike2;

		public bool CanFireAgain = true;

		private GunControl gc;

		private InputManager inman;

		private Animator animator;

		private void Start()
		{
			gc = MonoSingleton<GunControl>.Instance;
			inman = MonoSingleton<InputManager>.Instance;
			animator = ((Component)this).GetComponent<Animator>();
		}

		public void SpawnAirstrike(Transform pos)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: 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_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			RaycastHit val = default(RaycastHit);
			if (Physics.Raycast(((Component)MonoSingleton<CameraController>.instance).transform.position, ((Component)MonoSingleton<CameraController>.instance).transform.forward, ref val, 500f, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)3))))
			{
				Object.Instantiate<GameObject>(airstrike1, ((RaycastHit)(ref val)).point, Quaternion.identity);
			}
		}

		public void SpawnOtherAirStrike()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: 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_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			RaycastHit val = default(RaycastHit);
			if (Physics.Raycast(((Component)MonoSingleton<CameraController>.instance).transform.position, ((Component)MonoSingleton<CameraController>.instance).transform.forward, ref val, 500f, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)3))))
			{
				Object.Instantiate<GameObject>(airstrike2, ((RaycastHit)(ref val)).point, Quaternion.identity);
			}
		}

		private void Update()
		{
			if (gc.activated && CanFireAgain)
			{
				if (inman.InputSource.Fire2.WasCanceledThisFrame)
				{
					CanFireAgain = false;
					animator.SetTrigger("Fire2");
				}
				else if (!inman.PerformingCheatMenuCombo() && inman.InputSource.Fire1.IsPressed)
				{
					CanFireAgain = false;
					animator.SetTrigger("Fire1");
				}
			}
		}

		public void SetCanFireAgain()
		{
			CanFireAgain = true;
		}
	}
	internal class AutoHomers : MonoBehaviour
	{
		private Projectile proj;

		private float updateInterval = 1f;

		private float nextUpdateTime;

		private EnemyIdentifier nearestEnemy;

		public static T GetNearest<T>(Vector3 position) where T : MonoBehaviour
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			return (from obj in Object.FindObjectsOfType<T>()
				orderby Vector3.Distance(position, ((Component)(object)obj).transform.position)
				select obj).FirstOrDefault();
		}

		public static T GetNearestInRange<T>(Vector3 position, float maxRange) where T : MonoBehaviour
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			return (from obj in Object.FindObjectsOfType<T>()
				where Vector3.Distance(position, ((Component)(object)obj).transform.position) <= maxRange
				orderby Vector3.Distance(position, ((Component)(object)obj).transform.position)
				select obj).FirstOrDefault();
		}

		public static T GetNearestWithFilter<T>(Vector3 position, Func<T, bool> filter) where T : MonoBehaviour
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			return (from obj in Object.FindObjectsOfType<T>().Where(filter)
				orderby Vector3.Distance(position, ((Component)(object)obj).transform.position)
				select obj).FirstOrDefault();
		}

		private void Awake()
		{
			proj = ((Component)this).GetComponent<Projectile>();
			UpdateTarget();
		}

		private void FixedUpdate()
		{
			if (Time.time >= nextUpdateTime)
			{
				nextUpdateTime = Time.time + updateInterval;
				UpdateTarget();
			}
		}

		private void UpdateTarget()
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)nearestEnemy != (Object)null && !nearestEnemy.dead)
			{
				AssignTarget(nearestEnemy);
				return;
			}
			nearestEnemy = AutoHomers.GetNearestWithFilter<EnemyIdentifier>(((Component)this).transform.position, (Func<EnemyIdentifier, bool>)((EnemyIdentifier x) => (Object)(object)x != (Object)null && !x.dead));
			if ((Object)(object)nearestEnemy != (Object)null)
			{
				AssignTarget(nearestEnemy);
			}
		}

		private void AssignTarget(EnemyIdentifier enemy)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			proj.target = new EnemyTarget(enemy)
			{
				isPlayer = false,
				enemyIdentifier = enemy,
				targetTransform = ((Component)enemy).transform
			};
		}
	}
	internal class BadToTheBoneGun : MonoBehaviour
	{
		public GameObject SkullProjectile;

		public Transform SkullSpawnPoint;

		public bool CanFireAgain = true;

		private GunControl gc;

		private InputManager inman;

		private Animator animator;

		private void Start()
		{
			gc = MonoSingleton<GunControl>.Instance;
			inman = MonoSingleton<InputManager>.Instance;
			animator = ((Component)this).GetComponent<Animator>();
			SkullSpawnPoint = ((Component)MonoSingleton<CameraController>.instance).transform;
		}

		public void LaunchPurple()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Object.Instantiate<GameObject>(SkullProjectile, SkullSpawnPoint.position, SkullSpawnPoint.rotation);
			val.transform.forward = SkullSpawnPoint.forward;
		}

		private void Update()
		{
			if (gc.activated && CanFireAgain && !inman.PerformingCheatMenuCombo() && inman.InputSource.Fire1.IsPressed)
			{
				CanFireAgain = false;
				animator.SetTrigger("Fire1");
			}
		}

		public void SetCanFireAgain()
		{
			CanFireAgain = true;
		}
	}
	internal class BananastudioWeapon : MonoBehaviour
	{
		private class CheatSequence
		{
			public string Name { get; private set; }

			public KeyCode[] Sequence { get; private set; }

			public Action OnComplete { get; private set; }

			public CheatSequence(string name, KeyCode[] sequence, Action onComplete)
			{
				Name = name;
				Sequence = sequence;
				OnComplete = onComplete;
			}
		}

		public GameObject MassiveExplosion;

		public GameObject PlushySpawner;

		public GameObject Sisyphus;

		public GameObject smallBananas;

		private GunControl gc;

		private InputManager inman;

		private readonly List<CheatSequence> cheatSequences = new List<CheatSequence>();

		private Dictionary<CheatSequence, int> sequenceIndexes = new Dictionary<CheatSequence, int>();

		public Transform beam;

		private void Awake()
		{
			gc = MonoSingleton<GunControl>.Instance;
			inman = MonoSingleton<InputManager>.Instance;
			List<CheatSequence> list = cheatSequences;
			KeyCode[] array = new KeyCode[6];
			RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
			list.Add(new CheatSequence("Banana", (KeyCode[])(object)array, delegate
			{
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				Object.Instantiate<GameObject>(MassiveExplosion, ((Component)this).transform.position, Quaternion.identity);
			}));
			List<CheatSequence> list2 = cheatSequences;
			KeyCode[] array2 = new KeyCode[6];
			RuntimeHelpers.InitializeArray(array2, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
			list2.Add(new CheatSequence("Plushies", (KeyCode[])(object)array2, delegate
			{
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				Object.Instantiate<GameObject>(PlushySpawner, ((Component)this).transform.position, Quaternion.identity);
			}));
			List<CheatSequence> list3 = cheatSequences;
			KeyCode[] array3 = new KeyCode[8];
			RuntimeHelpers.InitializeArray(array3, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
			list3.Add(new CheatSequence("Sisyphus", (KeyCode[])(object)array3, delegate
			{
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				Object.Instantiate<GameObject>(Sisyphus, ((Component)this).transform.position, Quaternion.identity);
			}));
			foreach (CheatSequence cheatSequence in cheatSequences)
			{
				sequenceIndexes[cheatSequence] = 0;
			}
		}

		private static bool TryGetKeyboardButton(KeyCode keyCode, out ButtonControl button)
		{
			//IL_0018: 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_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Invalid comparison between Unknown and I4
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Invalid comparison between Unknown and I4
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Invalid comparison between Unknown and I4
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Invalid comparison between Unknown and I4
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Invalid comparison between Unknown and I4
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Invalid comparison between Unknown and I4
			//IL_002f: 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_005c: Expected I4, but got Unknown
			button = null;
			if (Keyboard.current == null)
			{
				return false;
			}
			if ((int)keyCode <= 112)
			{
				if ((int)keyCode != 97)
				{
					if ((int)keyCode != 98)
					{
						switch (keyCode - 104)
						{
						case 6:
							break;
						case 8:
							goto IL_00a6;
						case 4:
							goto IL_00b4;
						case 0:
							goto IL_00de;
						case 1:
							goto IL_00fa;
						default:
							goto IL_0108;
						}
						button = (ButtonControl)(object)Keyboard.current.nKey;
					}
					else
					{
						button = (ButtonControl)(object)Keyboard.current.bKey;
					}
				}
				else
				{
					button = (ButtonControl)(object)Keyboard.current.aKey;
				}
			}
			else if ((int)keyCode != 115)
			{
				if ((int)keyCode != 117)
				{
					if ((int)keyCode != 121)
					{
						goto IL_0108;
					}
					button = (ButtonControl)(object)Keyboard.current.yKey;
				}
				else
				{
					button = (ButtonControl)(object)Keyboard.current.uKey;
				}
			}
			else
			{
				button = (ButtonControl)(object)Keyboard.current.sKey;
			}
			goto IL_010c;
			IL_010c:
			return button != null;
			IL_00b4:
			button = (ButtonControl)(object)Keyboard.current.lKey;
			goto IL_010c;
			IL_00fa:
			button = (ButtonControl)(object)Keyboard.current.iKey;
			goto IL_010c;
			IL_0108:
			return false;
			IL_00de:
			button = (ButtonControl)(object)Keyboard.current.hKey;
			goto IL_010c;
			IL_00a6:
			button = (ButtonControl)(object)Keyboard.current.pKey;
			goto IL_010c;
		}

		private void ProcessInput()
		{
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Invalid comparison between Unknown and I4
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Invalid comparison between Unknown and I4
			if (Keyboard.current == null)
			{
				return;
			}
			ButtonControl val = null;
			KeyCode? val2 = null;
			foreach (CheatSequence cheatSequence in cheatSequences)
			{
				KeyCode[] sequence = cheatSequence.Sequence;
				foreach (KeyCode val3 in sequence)
				{
					if (TryGetKeyboardButton(val3, out var button) && button.wasPressedThisFrame)
					{
						val = button;
						val2 = val3;
						break;
					}
				}
				if (val2.HasValue)
				{
					break;
				}
			}
			foreach (CheatSequence cheatSequence2 in cheatSequences)
			{
				int num = sequenceIndexes[cheatSequence2];
				if (val2.HasValue && num < cheatSequence2.Sequence.Length && (int)val2.Value == (int)cheatSequence2.Sequence[num])
				{
					sequenceIndexes[cheatSequence2] = num + 1;
					if (sequenceIndexes[cheatSequence2] == cheatSequence2.Sequence.Length)
					{
						Debug.Log((object)("Cheat Sequence '" + cheatSequence2.Name + "' completed!"));
						cheatSequence2.OnComplete?.Invoke();
						ResetAllSequences();
					}
				}
				else if (val != null && (!val2.HasValue || num >= cheatSequence2.Sequence.Length || (int)val2.Value != (int)cheatSequence2.Sequence[num]))
				{
					sequenceIndexes[cheatSequence2] = 0;
				}
			}
		}

		private void ResetAllSequences()
		{
			foreach (CheatSequence cheatSequence in cheatSequences)
			{
				sequenceIndexes[cheatSequence] = 0;
			}
		}

		public void AddCheatSequence(string name, KeyCode[] sequence, Action onComplete)
		{
			CheatSequence cheatSequence = new CheatSequence(name, sequence, onComplete);
			cheatSequences.Add(cheatSequence);
			sequenceIndexes[cheatSequence] = 0;
		}

		private void Update()
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: 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_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: 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)
			if (gc.activated)
			{
				ProcessInput();
				if (inman.InputSource.Fire2.IsPressed)
				{
					Object.Instantiate<GameObject>(smallBananas, ((Component)this).transform.position, Quaternion.identity);
				}
				if (inman.InputSource.Fire1.IsPressed)
				{
					((Component)beam).gameObject.SetActive(true);
				}
				else
				{
					((Component)beam).gameObject.SetActive(false);
				}
				RaycastHit val = default(RaycastHit);
				if (Physics.Raycast(((Component)MonoSingleton<CameraController>.instance).transform.position, ((Component)MonoSingleton<CameraController>.instance).transform.forward, ref val, 500f, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)3))))
				{
					beam.forward = ((RaycastHit)(ref val)).point - ((Component)MonoSingleton<CameraController>.instance).transform.position;
				}
				else
				{
					beam.rotation = Quaternion.Euler(0f, 90f, 0f);
				}
			}
		}
	}
	internal class CameraThirdPersonThing : MonoBehaviour
	{
		[SerializeField]
		private Transform target;

		[SerializeField]
		private float distanceFromTarget = 5f;

		[SerializeField]
		private float rotationSpeed = 5f;

		[SerializeField]
		private Vector2 pitchLimits = new Vector2(-30f, 60f);

		private float currentYaw = 0f;

		private float currentPitch = 20f;

		public void Start()
		{
			if ((Object)(object)target == (Object)null)
			{
				Debug.LogError((object)"CameraThirdPersonThing: Target not assigned!");
			}
		}

		public void Update()
		{
			if (!((Object)(object)target == (Object)null))
			{
				float axis = Input.GetAxis("Mouse X");
				float axis2 = Input.GetAxis("Mouse Y");
				currentYaw += axis * rotationSpeed;
				currentPitch -= axis2 * rotationSpeed;
				currentPitch = Mathf.Clamp(currentPitch, pitchLimits.x, pitchLimits.y);
			}
		}

		public void LateUpdate()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: 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_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)target == (Object)null))
			{
				Quaternion val = Quaternion.Euler(currentPitch, currentYaw, 0f);
				Vector3 val2 = val * new Vector3(0f, 0f, 0f - distanceFromTarget);
				((Component)this).transform.position = target.position + val2;
				((Component)this).transform.LookAt(target.position);
			}
		}
	}
	internal class CarPlacer : MonoBehaviour
	{
		public List<GameObject> Cars;

		public List<GameObject> CarPreviews;

		public bool CanFireAgain = true;

		private int currentCarIndex = 0;

		private GunControl gc;

		private InputManager inman;

		private void Start()
		{
			gc = MonoSingleton<GunControl>.Instance;
			inman = MonoSingleton<InputManager>.Instance;
		}

		private void Update()
		{
			//IL_006e: 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_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			if (gc.activated && CanFireAgain)
			{
				if (!inman.PerformingCheatMenuCombo() && inman.InputSource.Fire1.WasPerformedThisFrame)
				{
					CanFireAgain = false;
					Object.Instantiate<GameObject>(Cars[currentCarIndex], ((Component)MonoSingleton<NewMovement>.Instance).transform.position + ((Component)MonoSingleton<NewMovement>.Instance).transform.right * 5f, ((Component)MonoSingleton<NewMovement>.Instance).transform.rotation);
					((MonoBehaviour)this).Invoke("SetCanFireAgain", 0.05f);
				}
				if (!inman.PerformingCheatMenuCombo() && inman.InputSource.Fire2.WasPerformedThisFrame)
				{
					SwitchCar();
				}
			}
		}

		private void SwitchCar()
		{
			CarPreviews[currentCarIndex].SetActive(false);
			currentCarIndex = (currentCarIndex + 1) % Cars.Count;
			CarPreviews[currentCarIndex].SetActive(true);
		}

		public void SetCanFireAgain()
		{
			CanFireAgain = true;
		}
	}
	internal class CentaurBeamThing : MonoBehaviour
	{
		public GameObject CentaurBeam;

		public Transform CentaurBeamSpawnPoint;

		public bool CanFireAgain = true;

		private GunControl gc;

		private InputManager inman;

		private Animator animator;

		private WeaponCharges wc;

		private void Start()
		{
			gc = MonoSingleton<GunControl>.Instance;
			inman = MonoSingleton<InputManager>.Instance;
			animator = ((Component)this).GetComponent<Animator>();
			wc = MonoSingleton<WeaponCharges>.Instance;
		}

		public void LaunchBeam()
		{
			//IL_001d: 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)
			wc.raicharge = 0f;
			GameObject val = Object.Instantiate<GameObject>(CentaurBeam, CentaurBeamSpawnPoint.position, CentaurBeamSpawnPoint.rotation);
		}

		private void Update()
		{
			float raicharge = wc.raicharge;
			if ((!(raicharge < 5f) || NoWeaponCooldown.NoCooldown) && gc.activated && CanFireAgain && !inman.PerformingCheatMenuCombo() && inman.InputSource.Fire1.IsPressed)
			{
				CanFireAgain = false;
				animator.SetTrigger("Throw");
			}
		}

		public void SetCanFireAgain()
		{
			CanFireAgain = true;
		}
	}
	internal class FerrymanOarWeapon : MonoBehaviour
	{
		public GameObject explosion;

		public GameObject explosionLightning;

		public Transform ExplosionSpawnPos;

		public bool CanFireAgain = true;

		private GunControl gc;

		private InputManager inman;

		private Animator animator;

		private void Start()
		{
			gc = MonoSingleton<GunControl>.Instance;
			inman = MonoSingleton<InputManager>.Instance;
			animator = ((Component)this).GetComponent<Animator>();
		}

		public void SpawnExplosionAndParry(Transform pos)
		{
			//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)
			Object.Instantiate<GameObject>(explosion, ExplosionSpawnPos.position, Quaternion.identity);
		}

		public void SpawnLightning()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: 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_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			RaycastHit val = default(RaycastHit);
			if (Physics.Raycast(((Component)MonoSingleton<CameraController>.instance).transform.position, ((Component)MonoSingleton<CameraController>.instance).transform.forward, ref val, 500f, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)3))))
			{
				Object.Instantiate<GameObject>(explosionLightning, ((RaycastHit)(ref val)).point, Quaternion.identity);
			}
		}

		private void Update()
		{
			if (gc.activated && CanFireAgain)
			{
				if (inman.InputSource.Fire2.WasCanceledThisFrame)
				{
					CanFireAgain = false;
					animator.SetTrigger("Fire2");
				}
				else if (!inman.PerformingCheatMenuCombo() && inman.InputSource.Fire1.IsPressed)
				{
					CanFireAgain = false;
					animator.SetTrigger("Fire1lol");
				}
			}
		}

		public void SetCanFireAgain()
		{
			CanFireAgain = true;
		}
	}
	internal class HollowPurple : MonoBehaviour
	{
		public GameObject PurpleProjectile;

		public Transform PurpleSpawnPoint;

		public bool CanFireAgain = true;

		private GunControl gc;

		private InputManager inman;

		private Animator animator;

		private void Start()
		{
			gc = MonoSingleton<GunControl>.Instance;
			inman = MonoSingleton<InputManager>.Instance;
			animator = ((Component)this).GetComponent<Animator>();
		}

		public void LaunchPurple()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Object.Instantiate<GameObject>(PurpleProjectile, PurpleSpawnPoint.position, PurpleSpawnPoint.rotation);
			val.transform.forward = PurpleSpawnPoint.forward;
		}

		private void Update()
		{
			if (gc.activated && CanFireAgain && !inman.PerformingCheatMenuCombo() && inman.InputSource.Fire1.IsPressed)
			{
				CanFireAgain = false;
				animator.SetTrigger("Fire1lol");
			}
		}

		public void SetCanFireAgain()
		{
			CanFireAgain = true;
		}
	}
	internal class Maxwell : MonoBehaviour
	{
		public GameObject MiniCats;

		public GameObject MiniCatsSpawnPoint;

		public bool CanFireAgain = true;

		public AudioClip Miauw;

		private GunControl gc;

		private InputManager inman;

		private Animator animator;

		private AudioSource Sounds;

		private bool isFiring;

		private void Start()
		{
			gc = MonoSingleton<GunControl>.Instance;
			inman = MonoSingleton<InputManager>.Instance;
			animator = ((Component)this).GetComponent<Animator>();
			Sounds = ((Component)this).GetComponent<AudioSource>();
		}

		public void StartBarrage()
		{
			isFiring = true;
		}

		public void EndBarrage()
		{
			isFiring = false;
		}

		public void Meow()
		{
			Sounds.PlayOneShot(Miauw);
		}

		private void Update()
		{
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			if (gc.activated && CanFireAgain)
			{
				if (inman.InputSource.Fire2.WasCanceledThisFrame)
				{
					CanFireAgain = false;
					animator.SetTrigger("Fire2");
				}
				if (inman.InputSource.Fire1.IsPressed)
				{
					CanFireAgain = false;
					animator.SetTrigger("Fire1");
				}
			}
			if (isFiring && !MonoSingleton<OptionsManager>.Instance.paused)
			{
				Object.Instantiate<GameObject>(MiniCats, MiniCatsSpawnPoint.transform.position, MiniCatsSpawnPoint.transform.rotation);
				Meow();
			}
		}

		public void SetCanFireAgain()
		{
			CanFireAgain = true;
		}
	}
	internal class MissippiQueen : MonoBehaviour
	{
		public GameObject bulet;

		public Transform buletspawn;

		public bool CanFireAgain = true;

		private bool wasMusicOff;

		private GunControl gc;

		private InputManager inman;

		private Animator animator;

		private AudioSource music;

		private void Start()
		{
			gc = MonoSingleton<GunControl>.Instance;
			inman = MonoSingleton<InputManager>.Instance;
			animator = ((Component)this).GetComponent<Animator>();
			music = ((Component)this).GetComponent<AudioSource>();
		}

		public void SHoot()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Object.Instantiate<GameObject>(bulet, ((Component)MonoSingleton<CameraController>.Instance).transform.position, buletspawn.rotation);
			val.transform.forward = ((Component)MonoSingleton<CameraController>.Instance).transform.forward;
		}

		private void Update()
		{
			if (gc.activated && CanFireAgain && !inman.PerformingCheatMenuCombo() && inman.InputSource.Fire1.IsPressed)
			{
				music.Play();
				CanFireAgain = false;
				animator.SetTrigger("Pew");
				((Behaviour)MonoSingleton<CameraController>.Instance).enabled = false;
				MonoSingleton<TimeController>.Instance.timeScaleModifier = 0.05f;
				MonoSingleton<TimeController>.Instance.RestoreTime();
				wasMusicOff = MonoSingleton<MusicManager>.Instance.off;
				MonoSingleton<MusicManager>.Instance.StopMusic();
			}
		}

		private void OnDisable()
		{
			MonoSingleton<TimeController>.Instance.timeScaleModifier = 1f;
			MonoSingleton<TimeController>.Instance.RestoreTime();
			((Behaviour)MonoSingleton<CameraController>.Instance).enabled = true;
		}

		public void SetCanFireAgain()
		{
			music.Stop();
			((Behaviour)MonoSingleton<CameraController>.Instance).enabled = true;
			CanFireAgain = true;
			MonoSingleton<TimeController>.Instance.timeScaleModifier = 1f;
			MonoSingleton<TimeController>.Instance.RestoreTime();
			if (!wasMusicOff && !MonoSingleton<MusicManager>.Instance.off)
			{
				MonoSingleton<MusicManager>.Instance.StartMusic();
			}
		}
	}
	[HarmonyPatch(typeof(PlayerTracker), "ChangeToPlatformer", new Type[] { typeof(bool) })]
	public class FixPlatform
	{
		public static void Prefix()
		{
			((Behaviour)MonoSingleton<CameraController>.Instance).enabled = true;
			MonoSingleton<TimeController>.Instance.timeScaleModifier = 1f;
			MonoSingleton<TimeController>.Instance.RestoreTime();
			MonoSingleton<MusicManager>.Instance.StopMusic();
		}
	}
	internal class PromptThing : MonoBehaviour
	{
		public UltrakillEvent OnPrompted;

		public float range = 5f;

		public bool activated;

		private InputManager inman;

		private void Start()
		{
			inman = MonoSingleton<InputManager>.Instance;
		}

		private void Update()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			if (Vector3.Distance(((Component)this).transform.position, ((Component)MonoSingleton<NewMovement>.instance).transform.position) <= range && !inman.PerformingCheatMenuCombo() && inman.InputSource.NextVariation.WasPerformedThisFrame && !activated)
			{
				UltrakillEvent onPrompted = OnPrompted;
				if (onPrompted != null)
				{
					onPrompted.Invoke();
				}
				activated = true;
			}
			else if (Vector3.Distance(((Component)this).transform.position, ((Component)MonoSingleton<NewMovement>.instance).transform.position) <= range && !inman.PerformingCheatMenuCombo() && inman.InputSource.NextVariation.WasPerformedThisFrame)
			{
				UltrakillEvent onPrompted2 = OnPrompted;
				if (onPrompted2 != null)
				{
					onPrompted2.Revert();
				}
				activated = false;
			}
		}

		private void OnGizmosDrawSelected()
		{
			//IL_0001: 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)
			Gizmos.color = Color.yellow;
			Gizmos.DrawWireSphere(((Component)this).transform.position, range);
		}
	}
	internal class TaxTime : MonoBehaviour
	{
		public GameObject Cell;

		public bool CanFireAgain = true;

		private GunControl gc;

		private InputManager inman;

		private Animator animator;

		private AudioSource jail;

		private void Start()
		{
			gc = MonoSingleton<GunControl>.Instance;
			inman = MonoSingleton<InputManager>.Instance;
			animator = ((Component)this).GetComponent<Animator>();
			jail = ((Component)this).GetComponent<AudioSource>();
		}

		public void SpawnLightning()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: 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_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			RaycastHit val = default(RaycastHit);
			if (Physics.Raycast(((Component)MonoSingleton<CameraController>.instance).transform.position, ((Component)MonoSingleton<CameraController>.instance).transform.forward, ref val, 500f, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)0))) && (Object)(object)((Component)((RaycastHit)(ref val)).collider).gameObject.GetComponent<EnemyIdentifierIdentifier>() != (Object)null)
			{
				((Component)((RaycastHit)(ref val)).collider).gameObject.GetComponent<EnemyIdentifierIdentifier>().eid.ignorePlayer = true;
				((Component)((RaycastHit)(ref val)).collider).gameObject.GetComponent<EnemyIdentifierIdentifier>().eid.attackEnemies = false;
				Object.Instantiate<GameObject>(Cell, ((Component)((Component)((RaycastHit)(ref val)).collider).gameObject.GetComponent<EnemyIdentifierIdentifier>().eid).transform.position, Quaternion.identity);
			}
		}

		private void Update()
		{
			if (gc.activated && CanFireAgain && inman.InputSource.Fire2.WasCanceledThisFrame)
			{
				CanFireAgain = false;
				animator.SetTrigger("Jail");
				jail.Play();
			}
		}

		public void SetCanFireAgain()
		{
			CanFireAgain = true;
		}
	}
}
namespace Banana_Weapons.MonoBehaviours.CarThings
{
	internal class Bumper : MonoBehaviour
	{
		public car TheCar;

		public float SpeedToDamage;

		private void OnTriggerEnter(Collider other)
		{
			//IL_0227: Unknown result type (might be due to invalid IL or missing references)
			//IL_022c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: 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_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_026f: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)$"Speed check: Required {SpeedToDamage}, Current {TheCar.speed}");
			if (TheCar.speed < SpeedToDamage)
			{
				return;
			}
			if (((Component)other).gameObject.CompareTag("Head") || ((Component)other).gameObject.CompareTag("Body") || ((Component)other).gameObject.CompareTag("Limb") || ((Component)other).gameObject.CompareTag("EndLimb"))
			{
				Debug.Log((object)"Hit enemy part");
				EnemyIdentifierIdentifier componentInParent = ((Component)other).gameObject.GetComponentInParent<EnemyIdentifierIdentifier>();
				if ((Object)(object)componentInParent != (Object)null && (Object)(object)componentInParent.eid != (Object)null)
				{
					EnemyIdentifier eid = componentInParent.eid;
					Vector3 val = ((Component)TheCar).transform.forward * TheCar.speed * 100f;
					Debug.Log((object)$"Delivering {TheCar.DamageToEnemies} damage");
					eid.DeliverDamage(((Component)other).gameObject, val, ((Component)this).transform.position, TheCar.DamageToEnemies * (TheCar.speed / SpeedToDamage), true, 0f, (GameObject)null, false, false);
					if (!eid.dead)
					{
						MonoSingleton<TimeController>.Instance.HitStop(0.05f);
						MonoSingleton<StyleHUD>.Instance.AddPoints(Mathf.Max(1, Mathf.RoundToInt(TheCar.speed * 15f)), "RUN OVER", ((Component)this).gameObject, eid, -1, "", "");
					}
				}
			}
			else if ((TheCar.speed >= SpeedToDamage * 2f && ((Component)other).gameObject.layer == 8) || ((Component)other).gameObject.layer == 24)
			{
				Object.Instantiate<GameObject>(TheCar.ExplosionOnCrash, ((Component)TheCar).transform.position, Quaternion.identity);
				if (TheCar.activated)
				{
					((Component)MonoSingleton<NewMovement>.instance).gameObject.SetActive(true);
					((Component)MonoSingleton<NewMovement>.instance).transform.position = ((Component)TheCar).transform.position;
				}
				Banana_WeaponsPlugin.cars.Remove(TheCar);
				Object.Destroy((Object)(object)((Component)TheCar).gameObject);
			}
		}
	}
}