Decompiled source of V3Mod v0.2.0

V3Mod.dll

Decompiled 2 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Sandbox;
using ULTRAKILL.Cheats;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.AddressableAssets;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("V3Mod")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("V3Mod")]
[assembly: AssemblyTitle("V3Mod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace V3Mod
{
	public static class Extensions
	{
		public static Vector3 SetY(this Vector3 v, float y)
		{
			//IL_0000: 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)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			return new Vector3(v.x, y, v.z);
		}

		public static Vector3 Sqrt(Vector3 v)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			return ((Vector3)(ref v)).normalized * Mathf.Sqrt(((Vector3)(ref v)).magnitude);
		}

		public static GameObject InstantiateInactive(GameObject original)
		{
			GameObject obj = Object.Instantiate<GameObject>(original);
			obj.SetActive(false);
			return obj;
		}

		public static GameObject InstantiateInactive(GameObject original, Transform parent)
		{
			GameObject obj = Object.Instantiate<GameObject>(original, parent);
			obj.SetActive(false);
			return obj;
		}

		public static void AddToArray<T>(ref T[] array, T obj, int index)
		{
			T[] array2 = new T[Math.Max(index, array.Length) + 1];
			array2[index] = obj;
			Array.Copy(array, array2, Math.Min(index, array.Length));
			Array.Copy(array, index, array2, index + 1, array.Length - index);
			array = array2;
		}

		public static string ToHexString(this Color clr)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: 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)
			return $"#{Mathf.RoundToInt(clr.r * 255f):X2}{Mathf.RoundToInt(clr.g * 255f):X2}{Mathf.RoundToInt(clr.b * 255f):X2}{Mathf.RoundToInt(clr.a * 255f):X2}";
		}
	}
	internal class V3Assets
	{
		public static readonly Sprite v2Icon = Addressables.LoadAssetAsync<Sprite>((object)"Assets/Textures/UI/Spawn Menu/V2 2nd.png").WaitForCompletion();

		public static readonly float maxHP = 75f;

		public static GameObject BuildV3Object()
		{
			//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)
			//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_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03da: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0505: Unknown result type (might be due to invalid IL or missing references)
			//IL_0511: Unknown result type (might be due to invalid IL or missing references)
			//IL_051b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a51: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d27: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d41: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d5b: Unknown result type (might be due to invalid IL or missing references)
			//IL_104e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1090: Unknown result type (might be due to invalid IL or missing references)
			//IL_109a: Unknown result type (might be due to invalid IL or missing references)
			//IL_10ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_131c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1326: Unknown result type (might be due to invalid IL or missing references)
			//IL_1340: Unknown result type (might be due to invalid IL or missing references)
			//IL_1506: Unknown result type (might be due to invalid IL or missing references)
			//IL_1510: Unknown result type (might be due to invalid IL or missing references)
			//IL_16c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_16cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_1703: Unknown result type (might be due to invalid IL or missing references)
			//IL_1708: Unknown result type (might be due to invalid IL or missing references)
			//IL_1753: Unknown result type (might be due to invalid IL or missing references)
			//IL_1772: Unknown result type (might be due to invalid IL or missing references)
			//IL_1781: Unknown result type (might be due to invalid IL or missing references)
			//IL_178b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d22: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d27: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d59: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d5e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1da9: Unknown result type (might be due to invalid IL or missing references)
			//IL_1dc8: Unknown result type (might be due to invalid IL or missing references)
			//IL_1dd7: Unknown result type (might be due to invalid IL or missing references)
			//IL_1de1: Unknown result type (might be due to invalid IL or missing references)
			Shader shad = Addressables.LoadAssetAsync<Shader>((object)"Assets/Shaders/Main/ULTRAKILL-unlit-emissive.shader").WaitForCompletion();
			GameObject val = Extensions.InstantiateInactive(Addressables.LoadAssetAsync<GameObject>((object)"Assets/Prefabs/Enemies/V2 Green Arm Variant.prefab").WaitForCompletion());
			Object.Destroy((Object)(object)((Component)val.transform.GetChild(0)).gameObject);
			V2 component = val.GetComponent<V2>();
			V3 v = val.AddComponent<V3>();
			v.aimAtTarget = component.aimAtTarget;
			v.dashJumpSound = component.dashJumpSound;
			v.dodgeParticles = Extensions.InstantiateInactive(component.dodgeEffect, val.transform);
			MainModule main = v.dodgeParticles.GetComponent<ParticleSystem>().main;
			((MainModule)(ref main)).playOnAwake = true;
			v.gc = component.gc;
			v.jumpSound = component.jumpSound;
			v.finalWallJumpSound = Extensions.InstantiateInactive(component.jumpSound);
			v.finalWallJumpSound.GetComponent<AudioSource>().clip = MonoSingleton<NewMovement>.Instance.finalWallJump;
			v.slamHitEffect = MonoSingleton<NewMovement>.Instance.impactDust;
			v.slamParticles = Extensions.InstantiateInactive(MonoSingleton<NewMovement>.Instance.fallParticle, val.transform);
			v.slamParticles.transform.localScale = new Vector3(2f, 1f, 2f);
			v.slideParticles = Extensions.InstantiateInactive(MonoSingleton<NewMovement>.Instance.slideParticle, val.transform);
			v.slideParticles.transform.localPosition = new Vector3(0f, 1f, 2f);
			v.slideParticles.transform.localScale = new Vector3(0.75f, 0.25f, 0.75f);
			v.slideScrape = Extensions.InstantiateInactive(component.slideEffect, val.transform);
			v.smr = component.smr;
			v.stepAud = ((Component)v).gameObject.AddComponent<AudioSource>();
			PrepareAudio(v.stepAud);
			v.stepAud.volume = 0.5f;
			v.stepAud.playOnAwake = false;
			v.stepSounds = ((Component)MonoSingleton<NewMovement>.Instance.anim).GetComponent<PlayerAnimations>().footsteps;
			v.wc = component.wc;
			WeaponInfo weaponInfo = component.weapons[0].AddComponent<WeaponInfo>();
			WeaponInfo weaponInfo2 = component.weapons[1].AddComponent<WeaponInfo>();
			WeaponInfo weaponInfo3 = component.weapons[2].AddComponent<WeaponInfo>();
			v.wingChangeEffect = component.wingChangeEffect;
			v.wingTextures = component.wingTextures;
			Object.Destroy((Object)(object)component);
			BulletCheck componentInChildren = val.GetComponentInChildren<BulletCheck>();
			((Component)componentInChildren).gameObject.AddComponent<V3.BulletCheck>();
			Object.Destroy((Object)(object)componentInChildren);
			EnemyIdentifier component2 = val.GetComponent<EnemyIdentifier>();
			component2.weaknesses = new string[6] { "revolver", "nail", "saw", "drill", "shotgun", "explosion" };
			component2.weaknessMultipliers = new float[6] { 1.5f, 1.5f, 1.25f, 1.25f, 0.8f, 0.5f };
			Machine component3 = val.GetComponent<Machine>();
			component3.health = maxHP;
			component3.specialDeath = false;
			component3.simpleDeath = true;
			val.GetComponent<NavMeshAgent>().speed = 15f;
			CollectionExtensions.Do<TrailRenderer>((IEnumerable<TrailRenderer>)val.GetComponentsInChildren<TrailRenderer>(), (Action<TrailRenderer>)Object.Destroy);
			v.weapons[0] = Object.Instantiate<GameObject>(((Component)weaponInfo).gameObject, ((Component)weaponInfo).transform.parent).GetComponentInChildren<WeaponInfo>();
			WeaponInfo weaponInfo4 = v.weapons[0];
			((Object)weaponInfo4).name = "Piercer Revolver";
			Revolver component4 = AddressablesExtensions.ToAsset(MonoSingleton<GunSetter>.Instance.revolverPierce[0]).GetComponent<Revolver>();
			IEnemyWeapon enemyWeapon = weaponInfo4.EnemyWeapon;
			EnemyRevolver val2 = (EnemyRevolver)(object)((enemyWeapon is EnemyRevolver) ? enemyWeapon : null);
			((Component)val2.shootPoint.GetChild(0).GetChild(0)).transform.localScale = Vector3.one * 0.8f;
			((Renderer)((Component)val2).GetComponent<MeshRenderer>()).enabled = false;
			Transform val3 = Object.Instantiate<Transform>(((Component)component4).transform.GetChild(0), ((Component)val2).transform);
			((Component)val3.GetChild(0)).gameObject.SetActive(false);
			((Component)val3.GetChild(1)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			((Component)val3.GetChild(2)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			((Component)val3.GetChild(3)).gameObject.SetActive(false);
			((Behaviour)((Component)val3).GetComponent<Animator>()).enabled = false;
			((Behaviour)((Component)val3).GetComponent<RevolverAnimationReceiver>()).enabled = false;
			CollectionExtensions.Do<GunColorGetter>((IEnumerable<GunColorGetter>)((Component)val3).GetComponentsInChildren<GunColorGetter>(), (Action<GunColorGetter>)delegate(GunColorGetter gcg)
			{
				((Behaviour)gcg).enabled = false;
			});
			CollectionExtensions.Do<SkinnedMeshRenderer>((IEnumerable<SkinnedMeshRenderer>)((Component)val3).GetComponentsInChildren<SkinnedMeshRenderer>(), (Action<SkinnedMeshRenderer>)delegate(SkinnedMeshRenderer smr)
			{
				((Renderer)smr).material.shader = shad;
			});
			val3.localPosition = new Vector3(6.3f, -2.8f, 0f);
			val3.localRotation = Quaternion.Euler(340f, 270f, 0f);
			val3.localScale = Vector3.one * 0.65f;
			val2.bullet = PrepareBeam(component4.revolverBeam, ((Component)weaponInfo4).gameObject);
			val2.altBullet = PrepareBeam(component4.revolverBeamSuper, ((Component)weaponInfo4).gameObject);
			val2.muzzleFlash = ((Component)val2.bullet.transform.GetChild(0)).gameObject;
			((Component)val2.muzzleFlash.transform.GetChild(0)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			AudioSource obj = val2.muzzleFlash.AddComponent<AudioSource>();
			PrepareAudio(obj);
			obj.clip = component4.gunShots.First();
			obj.volume = 0.55f;
			Object.Destroy((Object)(object)((Component)val2.shootPoint.GetChild(0)).GetComponent<AudioLowPassFilter>());
			val2.muzzleFlashAlt = ((Component)val2.altBullet.transform.GetChild(0)).gameObject;
			((Component)val2.muzzleFlashAlt.transform.GetChild(0)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			AudioSource obj2 = val2.muzzleFlashAlt.AddComponent<AudioSource>();
			PrepareAudio(obj2);
			obj2.clip = component4.superGunShots.First();
			obj2.volume = 0.5f;
			weaponInfo4.drawTime = 0.3642f;
			weaponInfo4.drawTimeAlt = 0.3642f;
			weaponInfo4.cooldown = 0.5f;
			weaponInfo4.cooldownAlt = 0.5f;
			weaponInfo4.prepareTimeAlt = 0.5714286f;
			weaponInfo4.maxCharges = -1;
			weaponInfo4.maxChargesAlt = 1;
			weaponInfo4.chargeIncrease = -1f;
			weaponInfo4.chargeIncreaseAlt = 0.4f;
			weaponInfo4.normalBlocksAlt = true;
			weaponInfo4.altBlocksNormal = true;
			weaponInfo4.resetCooldownOnSwap = true;
			weaponInfo4.resetCooldownOnSwapAlt = true;
			weaponInfo4.projectileSpeed = -1f;
			weaponInfo4.projectileSpeedAlt = -1f;
			weaponInfo4.aimAtHead = true;
			weaponInfo4.aimAtHeadAlt = true;
			weaponInfo4.useGravity = false;
			weaponInfo4.useGravityAlt = false;
			v.weapons[1] = Object.Instantiate<GameObject>(((Component)v.weapons[0]).gameObject, ((Component)v.weapons[0]).transform.parent).GetComponentInChildren<WeaponInfo>();
			weaponInfo4 = v.weapons[1];
			((Object)weaponInfo4).name = "Marksman Revolver";
			Revolver component5 = AddressablesExtensions.ToAsset(MonoSingleton<GunSetter>.Instance.revolverRicochet[0]).GetComponent<Revolver>();
			IEnemyWeapon enemyWeapon2 = weaponInfo4.EnemyWeapon;
			EnemyRevolver val4 = (EnemyRevolver)(object)((enemyWeapon2 is EnemyRevolver) ? enemyWeapon2 : null);
			val4.bullet = PrepareBeam(component5.revolverBeam, ((Component)weaponInfo4).gameObject);
			val4.altBullet = component5.coin;
			val4.muzzleFlash = ((Component)val4.bullet.transform.GetChild(0)).gameObject;
			((Component)val4.muzzleFlash.transform.GetChild(0)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			AudioSource obj3 = val4.muzzleFlash.AddComponent<AudioSource>();
			PrepareAudio(obj3);
			obj3.clip = component5.gunShots.First();
			obj3.volume = 0.55f;
			val4.muzzleFlashAlt = null;
			weaponInfo4.drawTime = 0.3642f;
			weaponInfo4.drawTimeAlt = 0f;
			weaponInfo4.cooldown = 0.5f;
			weaponInfo4.cooldownAlt = 5f / 24f;
			weaponInfo4.prepareTimeAlt = 0f;
			weaponInfo4.maxCharges = -1;
			weaponInfo4.maxChargesAlt = 4;
			weaponInfo4.chargeIncrease = -1f;
			weaponInfo4.chargeIncreaseAlt = 0.25f;
			weaponInfo4.normalBlocksAlt = false;
			weaponInfo4.altBlocksNormal = false;
			weaponInfo4.resetCooldownOnSwap = true;
			weaponInfo4.resetCooldownOnSwapAlt = true;
			weaponInfo4.projectileSpeed = -1f;
			weaponInfo4.projectileSpeedAlt = 1f;
			weaponInfo4.aimAtHead = true;
			weaponInfo4.aimAtHeadAlt = false;
			weaponInfo4.useGravity = false;
			weaponInfo4.useGravityAlt = true;
			v.weapons[2] = Object.Instantiate<GameObject>(((Component)v.weapons[0]).gameObject, ((Component)v.weapons[0]).transform.parent).GetComponentInChildren<WeaponInfo>();
			weaponInfo4 = v.weapons[2];
			((Object)weaponInfo4).name = "Sharpshooter Revolver";
			Revolver component6 = AddressablesExtensions.ToAsset(MonoSingleton<GunSetter>.Instance.revolverTwirl[0]).GetComponent<Revolver>();
			IEnemyWeapon enemyWeapon3 = weaponInfo4.EnemyWeapon;
			EnemyRevolver val5 = (EnemyRevolver)(object)((enemyWeapon3 is EnemyRevolver) ? enemyWeapon3 : null);
			val5.bullet = PrepareBeam(component6.revolverBeam, ((Component)weaponInfo4).gameObject);
			val5.altBullet = PrepareBeam(component6.revolverBeamSuper, ((Component)weaponInfo4).gameObject);
			val5.altBullet.GetComponent<RevolverBeam>().ricochetAmount = 3;
			val5.muzzleFlash = ((Component)val5.bullet.transform.GetChild(0)).gameObject;
			((Component)val5.muzzleFlash.transform.GetChild(0)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			AudioSource obj4 = val5.muzzleFlash.AddComponent<AudioSource>();
			PrepareAudio(obj4);
			obj4.clip = component6.gunShots.First();
			obj4.volume = 0.55f;
			Transform child = val5.shootPoint.GetChild(0);
			AudioSource component7 = ((Component)child).GetComponent<AudioSource>();
			component7.clip = component6.chargeEffect.GetComponent<AudioSource>().clip;
			component7.volume = 0.5f;
			Object.Destroy((Object)(object)((Component)child).GetComponent<AudioLowPassFilter>());
			Object.Destroy((Object)(object)((Component)child).GetComponent<Light>());
			child.GetChild(0).GetChild(0).localScale = Vector3.zero;
			val5.muzzleFlashAlt = ((Component)val5.altBullet.transform.GetChild(0)).gameObject;
			((Component)val5.muzzleFlashAlt.transform.GetChild(0)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			AudioSource obj5 = val5.muzzleFlashAlt.AddComponent<AudioSource>();
			PrepareAudio(obj5);
			obj5.clip = component6.superGunShots.First();
			obj5.volume = 0.5f;
			AudioSource obj6 = val5.muzzleFlashAlt.AddComponent<AudioSource>();
			PrepareAudio(obj6);
			obj6.clip = component6.twirlShotSound.GetComponent<AudioSource>().clip;
			obj6.volume = 0.75f;
			weaponInfo4.drawTime = 0.3642f;
			weaponInfo4.drawTimeAlt = 0.3642f;
			weaponInfo4.cooldown = 0.5f;
			weaponInfo4.cooldownAlt = 0f;
			weaponInfo4.prepareTimeAlt = 1f;
			weaponInfo4.maxCharges = -1;
			weaponInfo4.maxChargesAlt = 3;
			weaponInfo4.chargeIncrease = -1f;
			weaponInfo4.chargeIncreaseAlt = 0.15f;
			weaponInfo4.normalBlocksAlt = true;
			weaponInfo4.altBlocksNormal = true;
			weaponInfo4.resetCooldownOnSwap = true;
			weaponInfo4.resetCooldownOnSwapAlt = true;
			weaponInfo4.projectileSpeed = -1f;
			weaponInfo4.projectileSpeedAlt = -1f;
			weaponInfo4.aimAtHead = true;
			weaponInfo4.aimAtHeadAlt = true;
			weaponInfo4.useGravity = false;
			weaponInfo4.useGravityAlt = false;
			v.weapons[3] = Object.Instantiate<GameObject>(((Component)weaponInfo2).gameObject, ((Component)weaponInfo2).transform.parent).GetComponentInChildren<WeaponInfo>();
			weaponInfo4 = v.weapons[3];
			((Object)weaponInfo4).name = "Core Eject Shotgun";
			Shotgun component8 = AddressablesExtensions.ToAsset(MonoSingleton<GunSetter>.Instance.shotgunGrenade[0]).GetComponent<Shotgun>();
			IEnemyWeapon enemyWeapon4 = weaponInfo4.EnemyWeapon;
			EnemyShotgun val6 = (EnemyShotgun)(object)((enemyWeapon4 is EnemyShotgun) ? enemyWeapon4 : null);
			Transform val7 = Object.Instantiate<Transform>(((Component)component8).transform.GetChild(2), ((Component)val6).transform);
			((Component)((Component)val6).transform.GetChild(0)).gameObject.SetActive(false);
			((Component)((Component)val6).transform.GetChild(1)).gameObject.SetActive(false);
			((Component)((Component)val6).transform.GetChild(2)).gameObject.SetActive(false);
			((Behaviour)((Component)val7).GetComponent<Animator>()).enabled = false;
			((Behaviour)((Component)val7).GetComponent<ShotgunAnimationReceiver>()).enabled = false;
			((Component)val7.GetChild(0)).gameObject.SetActive(false);
			((Component)val7.GetChild(1)).gameObject.SetActive(false);
			((Component)val7.GetChild(2)).gameObject.SetActive(false);
			((Component)val7.GetChild(3)).gameObject.SetActive(false);
			((Component)val7.GetChild(4)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			((Behaviour)((Component)val7.GetChild(4)).GetComponent<GunColorGetter>()).enabled = false;
			((Renderer)((Component)val7.GetChild(4)).GetComponent<SkinnedMeshRenderer>()).material.shader = shad;
			val7.localScale = Vector3.one;
			val7.localRotation = Quaternion.Euler(90f, 0f, 0f);
			val7.localPosition = new Vector3(0f, -7.8f, 11f);
			val6.bullet = PrepareProjectile(component8.bullet, ((Component)weaponInfo4).gameObject);
			val6.grenade = PrepareGrenade(component8.grenade, ((Component)weaponInfo4).gameObject);
			val6.muzzleFlash = CreateClone(component8.muzzleFlash, ((Component)weaponInfo4).gameObject);
			((Component)val6.muzzleFlash.transform.GetChild(0).GetChild(0)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			weaponInfo4.drawTime = 0.4496f;
			weaponInfo4.drawTimeAlt = 0.4496f;
			weaponInfo4.cooldown = 1.3315f;
			weaponInfo4.cooldownAlt = 3.0685f;
			weaponInfo4.prepareTimeAlt = 1f;
			weaponInfo4.maxCharges = -1;
			weaponInfo4.maxChargesAlt = -1;
			weaponInfo4.chargeIncrease = -1f;
			weaponInfo4.chargeIncreaseAlt = -1f;
			weaponInfo4.normalBlocksAlt = true;
			weaponInfo4.altBlocksNormal = true;
			weaponInfo4.resetCooldownOnSwap = true;
			weaponInfo4.resetCooldownOnSwapAlt = true;
			weaponInfo4.projectileSpeed = 75f;
			weaponInfo4.projectileSpeedAlt = 70f;
			weaponInfo4.aimAtHead = false;
			weaponInfo4.aimAtHeadAlt = false;
			weaponInfo4.useGravity = false;
			weaponInfo4.useGravityAlt = true;
			v.weapons[4] = Object.Instantiate<GameObject>(((Component)v.weapons[3]).gameObject, ((Component)v.weapons[3]).transform.parent).GetComponentInChildren<WeaponInfo>();
			weaponInfo4 = v.weapons[4];
			((Object)weaponInfo4).name = "Pump Charge Shotgun";
			Shotgun component9 = AddressablesExtensions.ToAsset(MonoSingleton<GunSetter>.Instance.shotgunPump[0]).GetComponent<Shotgun>();
			IEnemyWeapon enemyWeapon5 = weaponInfo4.EnemyWeapon;
			IEnemyWeapon obj7 = ((enemyWeapon5 is EnemyShotgun) ? enemyWeapon5 : null);
			((EnemyShotgun)obj7).bullet = PrepareProjectile(component9.bullet, ((Component)weaponInfo4).gameObject);
			((EnemyShotgun)obj7).grenade = null;
			((EnemyShotgun)obj7).muzzleFlash = CreateClone(component9.muzzleFlash, ((Component)weaponInfo4).gameObject);
			((Component)((EnemyShotgun)obj7).muzzleFlash.transform.GetChild(0).GetChild(0)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			weaponInfo4.drawTime = 0.4496f;
			weaponInfo4.drawTimeAlt = 0.4496f;
			weaponInfo4.cooldown = 0.9899f;
			weaponInfo4.cooldownAlt = 0f;
			weaponInfo4.prepareTimeAlt = 0.636f;
			weaponInfo4.maxCharges = -1;
			weaponInfo4.maxChargesAlt = -1;
			weaponInfo4.chargeIncrease = -1f;
			weaponInfo4.chargeIncreaseAlt = -1f;
			weaponInfo4.normalBlocksAlt = true;
			weaponInfo4.altBlocksNormal = true;
			weaponInfo4.resetCooldownOnSwap = true;
			weaponInfo4.resetCooldownOnSwapAlt = true;
			weaponInfo4.projectileSpeed = 75f;
			weaponInfo4.projectileSpeedAlt = -1f;
			weaponInfo4.aimAtHead = false;
			weaponInfo4.aimAtHeadAlt = false;
			weaponInfo4.useGravity = false;
			weaponInfo4.useGravityAlt = false;
			v.weapons[5] = Object.Instantiate<GameObject>(((Component)weaponInfo3).gameObject, ((Component)weaponInfo3).transform.parent).GetComponentInChildren<WeaponInfo>();
			weaponInfo4 = v.weapons[5];
			((Object)weaponInfo4).name = "Attractor Nailgun";
			((Component)weaponInfo4).transform.localScale = Vector3.one;
			Nailgun component10 = AddressablesExtensions.ToAsset(MonoSingleton<GunSetter>.Instance.nailMagnet[0]).GetComponent<Nailgun>();
			IEnemyWeapon enemyWeapon6 = weaponInfo4.EnemyWeapon;
			EnemyNailgun val8 = (EnemyNailgun)(object)((enemyWeapon6 is EnemyNailgun) ? enemyWeapon6 : null);
			val8.toIgnore = Array.Empty<Collider>();
			val8.shootPoint.localScale = Vector3.one * 0.4f;
			((Component)val8).transform.localScale = Vector3.one;
			val7 = Object.Instantiate<Transform>(((Component)component10).transform.GetChild(0), ((Component)val8).transform);
			((Component)((Component)val8).transform.GetChild(0)).gameObject.SetActive(false);
			((Component)((Component)val8).transform.GetChild(1)).gameObject.SetActive(false);
			((Behaviour)((Component)val7).GetComponent<Animator>()).enabled = false;
			((Behaviour)((Component)val7).GetComponent<NailgunAnimationReceiver>()).enabled = false;
			((Component)val7.GetChild(0).GetChild(0).GetChild(0)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			((Behaviour)((Component)val7.GetChild(0).GetChild(0).GetChild(0)).GetComponent<GunColorGetter>()).enabled = false;
			((Renderer)((Component)val7.GetChild(0).GetChild(0).GetChild(0)).GetComponent<MeshRenderer>()).material.shader = shad;
			((Component)val7.GetChild(0).GetChild(0).GetChild(0)
				.GetChild(0)).gameObject.SetActive(false);
			((Component)val7.GetChild(0).GetChild(0).GetChild(1)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			((Behaviour)((Component)val7.GetChild(0).GetChild(0).GetChild(1)).GetComponent<GunColorGetter>()).enabled = false;
			((Renderer)((Component)val7.GetChild(0).GetChild(0).GetChild(1)).GetComponent<MeshRenderer>()).material.shader = shad;
			((Component)val7.GetChild(0).GetChild(0).GetChild(1)
				.GetChild(0)).gameObject.SetActive(false);
			((Component)val7.GetChild(0).GetChild(0).GetChild(2)).gameObject.SetActive(false);
			((Component)val7.GetChild(0).GetChild(0).GetChild(3)).gameObject.SetActive(false);
			((Component)val7.GetChild(0).GetChild(0).GetChild(4)).gameObject.SetActive(false);
			((Component)val7.GetChild(1)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			((Behaviour)((Component)val7.GetChild(1)).GetComponent<GunColorGetter>()).enabled = false;
			((Renderer)((Component)val7.GetChild(1)).GetComponent<SkinnedMeshRenderer>()).material.shader = shad;
			((Component)val7.GetChild(2)).gameObject.SetActive(false);
			((Component)val7.GetChild(3)).gameObject.SetActive(false);
			val7.localScale = Vector3.one * 0.5f;
			val7.localPosition = new Vector3(0f, 0.01f, 0.01f);
			val8.nail = PrepareNail(component10.nail, ((Component)weaponInfo4).gameObject);
			val8.altNail = CreateClone(component10.magnetNail, ((Component)weaponInfo4).gameObject);
			val8.muzzleFlash = CreateClone(component10.muzzleFlash, ((Component)weaponInfo4).gameObject);
			((Component)val8.muzzleFlash.transform.GetChild(0).GetChild(0)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			PrepareAudio(val8.muzzleFlash.GetComponent<AudioSource>());
			weaponInfo4.drawTime = 0.4463f;
			weaponInfo4.drawTimeAlt = 0.4463f;
			weaponInfo4.cooldown = 0.04f;
			weaponInfo4.cooldownAlt = 0.1f;
			weaponInfo4.prepareTimeAlt = 0f;
			weaponInfo4.maxCharges = 100;
			weaponInfo4.maxChargesAlt = 3;
			weaponInfo4.chargeIncrease = 5f;
			weaponInfo4.chargeIncreaseAlt = 3f;
			weaponInfo4.normalBlocksAlt = false;
			weaponInfo4.altBlocksNormal = true;
			weaponInfo4.resetCooldownOnSwap = true;
			weaponInfo4.resetCooldownOnSwapAlt = true;
			weaponInfo4.projectileSpeed = 200f;
			weaponInfo4.projectileSpeedAlt = 100f;
			weaponInfo4.aimAtHead = false;
			weaponInfo4.aimAtHeadAlt = false;
			weaponInfo4.useGravity = true;
			weaponInfo4.useGravityAlt = true;
			v.weapons[6] = Object.Instantiate<GameObject>(((Component)v.weapons[5]).gameObject, ((Component)v.weapons[5]).transform.parent).GetComponentInChildren<WeaponInfo>();
			weaponInfo4 = v.weapons[6];
			((Object)weaponInfo4).name = "Overheat Nailgun";
			Nailgun component11 = AddressablesExtensions.ToAsset(MonoSingleton<GunSetter>.Instance.nailOverheat[0]).GetComponent<Nailgun>();
			IEnemyWeapon enemyWeapon7 = weaponInfo4.EnemyWeapon;
			EnemyNailgun val9 = (EnemyNailgun)(object)((enemyWeapon7 is EnemyNailgun) ? enemyWeapon7 : null);
			val9.toIgnore = Array.Empty<Collider>();
			val9.shootPoint.localScale = Vector3.one * 0.4f;
			val9.nail = PrepareNail(component11.nail, ((Component)weaponInfo4).gameObject);
			val9.altNail = PrepareNail(component11.heatedNail, ((Component)weaponInfo4).gameObject);
			val9.muzzleFlash = CreateClone(component11.muzzleFlash, ((Component)weaponInfo4).gameObject);
			((Component)val9.muzzleFlash.transform.GetChild(0).GetChild(0)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			PrepareAudio(val9.muzzleFlash.GetComponent<AudioSource>());
			weaponInfo4.drawTime = 0.4463f;
			weaponInfo4.drawTimeAlt = 0.4463f;
			weaponInfo4.cooldown = 0.04f;
			weaponInfo4.cooldownAlt = 0f;
			weaponInfo4.prepareTimeAlt = 0f;
			weaponInfo4.maxCharges = -1;
			weaponInfo4.maxChargesAlt = 2;
			weaponInfo4.chargeIncrease = -1f;
			weaponInfo4.chargeIncreaseAlt = 0.125f;
			weaponInfo4.normalBlocksAlt = false;
			weaponInfo4.altBlocksNormal = false;
			weaponInfo4.resetCooldownOnSwap = false;
			weaponInfo4.resetCooldownOnSwapAlt = false;
			weaponInfo4.projectileSpeed = 200f;
			weaponInfo4.projectileSpeedAlt = 200f;
			weaponInfo4.aimAtHead = false;
			weaponInfo4.aimAtHeadAlt = false;
			weaponInfo4.useGravity = true;
			weaponInfo4.useGravityAlt = true;
			v.weapons[7] = Object.Instantiate<GameObject>(((Component)weaponInfo).gameObject, ((Component)weaponInfo).transform.parent).GetComponentInChildren<WeaponInfo>();
			weaponInfo4 = v.weapons[7];
			((Object)weaponInfo4).name = "Electric Railcannon";
			Railcannon component12 = AddressablesExtensions.ToAsset(MonoSingleton<GunSetter>.Instance.railCannon[0]).GetComponent<Railcannon>();
			IEnemyWeapon enemyWeapon8 = weaponInfo4.EnemyWeapon;
			EnemyRevolver val10 = (EnemyRevolver)(object)((enemyWeapon8 is EnemyRevolver) ? enemyWeapon8 : null);
			((Renderer)((Component)val10).GetComponent<MeshRenderer>()).enabled = false;
			GameObject obj8 = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)"Assets/Models/Weapons/Railcannon/Railgun.fbx").WaitForCompletion(), ((Component)val10).transform);
			((Component)obj8.transform.GetChild(0).GetChild(0)).gameObject.SetActive(false);
			Material v3ElectricMat = Addressables.LoadAssetAsync<Material>((object)"Assets/Models/Weapons/Railcannon/Railcannon.mat").WaitForCompletion();
			v3ElectricMat.shader = shad;
			CollectionExtensions.Do<SkinnedMeshRenderer>((IEnumerable<SkinnedMeshRenderer>)obj8.GetComponentsInChildren<SkinnedMeshRenderer>(), (Action<SkinnedMeshRenderer>)delegate(SkinnedMeshRenderer smr)
			{
				((Renderer)smr).material = v3ElectricMat;
			});
			obj8.transform.localPosition = new Vector3(9f, 9f, 0f);
			obj8.transform.localRotation = Quaternion.Euler(0f, 180f, 100f);
			obj8.transform.localScale = Vector3.one * 10f;
			val10.bullet = PrepareBeam(component12.beam, ((Component)weaponInfo4).gameObject);
			val10.altBullet = null;
			val10.muzzleFlash = ((Component)val10.bullet.transform.GetChild(0)).gameObject;
			((Component)val10.muzzleFlash.transform.GetChild(0)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			AudioSource obj9 = val10.muzzleFlash.AddComponent<AudioSource>();
			PrepareAudio(obj9);
			obj9.clip = component12.fireSound.GetComponent<AudioSource>().clip;
			obj9.volume = 0.65f;
			val10.muzzleFlashAlt = null;
			AudioSource obj10 = ((Component)val10).gameObject.AddComponent<AudioSource>();
			PrepareAudio(obj10);
			obj10.clip = component12.fullCharge.GetComponent<AudioSource>().clip;
			obj10.volume = 0.35f;
			obj10.loop = true;
			weaponInfo4.drawTime = 1f;
			weaponInfo4.drawTimeAlt = -1f;
			weaponInfo4.cooldown = 0f;
			weaponInfo4.cooldownAlt = -1f;
			weaponInfo4.prepareTimeAlt = -1f;
			weaponInfo4.maxCharges = -1;
			weaponInfo4.maxChargesAlt = -1;
			weaponInfo4.chargeIncrease = -1f;
			weaponInfo4.chargeIncreaseAlt = -1f;
			weaponInfo4.normalBlocksAlt = false;
			weaponInfo4.altBlocksNormal = false;
			weaponInfo4.resetCooldownOnSwap = false;
			weaponInfo4.resetCooldownOnSwapAlt = false;
			weaponInfo4.projectileSpeed = -1f;
			weaponInfo4.projectileSpeedAlt = -1f;
			weaponInfo4.aimAtHead = false;
			weaponInfo4.aimAtHeadAlt = false;
			weaponInfo4.useGravity = false;
			weaponInfo4.useGravityAlt = false;
			v.weapons[8] = Object.Instantiate<GameObject>(((Component)v.weapons[7]).gameObject, ((Component)v.weapons[7]).transform.parent).GetComponentInChildren<WeaponInfo>();
			weaponInfo4 = v.weapons[8];
			((Object)weaponInfo4).name = "Screwdriver Railcannon";
			Railcannon component13 = AddressablesExtensions.ToAsset(MonoSingleton<GunSetter>.Instance.railHarpoon[0]).GetComponent<Railcannon>();
			IEnemyWeapon enemyWeapon9 = weaponInfo4.EnemyWeapon;
			IEnemyWeapon obj11 = ((enemyWeapon9 is EnemyRevolver) ? enemyWeapon9 : null);
			((EnemyRevolver)obj11).bullet = component13.beam;
			((EnemyRevolver)obj11).altBullet = null;
			((EnemyRevolver)obj11).muzzleFlash = ((Component)((EnemyRevolver)obj11).bullet.transform.GetChild(0)).gameObject;
			AudioSource obj12 = ((EnemyRevolver)obj11).muzzleFlash.AddComponent<AudioSource>();
			PrepareAudio(obj12);
			obj12.clip = component13.fireSound.GetComponent<AudioSource>().clip;
			obj12.volume = 0.65f;
			((EnemyRevolver)obj11).muzzleFlashAlt = null;
			((Component)obj11).gameObject.GetComponent<AudioSource>().clip = component13.fullCharge.GetComponent<AudioSource>().clip;
			weaponInfo4.drawTime = 1f;
			weaponInfo4.drawTimeAlt = -1f;
			weaponInfo4.cooldown = 0f;
			weaponInfo4.cooldownAlt = -1f;
			weaponInfo4.prepareTimeAlt = -1f;
			weaponInfo4.maxCharges = -1;
			weaponInfo4.maxChargesAlt = -1;
			weaponInfo4.chargeIncrease = -1f;
			weaponInfo4.chargeIncreaseAlt = -1f;
			weaponInfo4.normalBlocksAlt = false;
			weaponInfo4.altBlocksNormal = false;
			weaponInfo4.resetCooldownOnSwap = false;
			weaponInfo4.resetCooldownOnSwapAlt = false;
			weaponInfo4.projectileSpeed = 250f;
			weaponInfo4.projectileSpeedAlt = -1f;
			weaponInfo4.aimAtHead = false;
			weaponInfo4.aimAtHeadAlt = false;
			weaponInfo4.useGravity = true;
			weaponInfo4.useGravityAlt = false;
			v.weapons[9] = Object.Instantiate<GameObject>(((Component)v.weapons[7]).gameObject, ((Component)v.weapons[7]).transform.parent).GetComponentInChildren<WeaponInfo>();
			weaponInfo4 = v.weapons[9];
			((Object)weaponInfo4).name = "Malicious Railcannon";
			Railcannon component14 = AddressablesExtensions.ToAsset(MonoSingleton<GunSetter>.Instance.railMalicious[0]).GetComponent<Railcannon>();
			IEnemyWeapon enemyWeapon10 = weaponInfo4.EnemyWeapon;
			EnemyRevolver val11 = (EnemyRevolver)(object)((enemyWeapon10 is EnemyRevolver) ? enemyWeapon10 : null);
			val11.bullet = PrepareBeam(component14.beam, ((Component)weaponInfo4).gameObject);
			val11.altBullet = null;
			val11.muzzleFlash = ((Component)val11.bullet.transform.GetChild(0)).gameObject;
			((Component)val11.muzzleFlash.transform.GetChild(0)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			AudioSource obj13 = val11.muzzleFlash.AddComponent<AudioSource>();
			PrepareAudio(obj13);
			obj13.clip = component14.fireSound.GetComponent<AudioSource>().clip;
			obj13.pitch = 3f;
			val11.muzzleFlashAlt = null;
			AudioSource component15 = ((Component)val11).gameObject.GetComponent<AudioSource>();
			component15.clip = component14.fullCharge.GetComponent<AudioSource>().clip;
			component15.pitch = 2f;
			weaponInfo4.drawTime = 1f;
			weaponInfo4.drawTimeAlt = -1f;
			weaponInfo4.cooldown = 0f;
			weaponInfo4.cooldownAlt = -1f;
			weaponInfo4.prepareTimeAlt = -1f;
			weaponInfo4.maxCharges = -1;
			weaponInfo4.maxChargesAlt = -1;
			weaponInfo4.chargeIncrease = -1f;
			weaponInfo4.chargeIncreaseAlt = -1f;
			weaponInfo4.normalBlocksAlt = false;
			weaponInfo4.altBlocksNormal = false;
			weaponInfo4.resetCooldownOnSwap = false;
			weaponInfo4.resetCooldownOnSwapAlt = false;
			weaponInfo4.projectileSpeed = -1f;
			weaponInfo4.projectileSpeedAlt = -1f;
			weaponInfo4.aimAtHead = false;
			weaponInfo4.aimAtHeadAlt = false;
			weaponInfo4.useGravity = false;
			weaponInfo4.useGravityAlt = false;
			v.weapons[10] = Object.Instantiate<GameObject>(((Component)weaponInfo).gameObject, ((Component)weaponInfo).transform.parent).GetComponentInChildren<WeaponInfo>();
			weaponInfo4 = v.weapons[10];
			((Object)weaponInfo4).name = "Freezeframe Rocket Launcher";
			RocketLauncher component16 = AddressablesExtensions.ToAsset(MonoSingleton<GunSetter>.Instance.rocketBlue[0]).GetComponent<RocketLauncher>();
			IEnemyWeapon enemyWeapon11 = weaponInfo4.EnemyWeapon;
			EnemyRevolver val12 = (EnemyRevolver)(object)((enemyWeapon11 is EnemyRevolver) ? enemyWeapon11 : null);
			((Renderer)((Component)val12).GetComponent<MeshRenderer>()).enabled = false;
			GameObject obj14 = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)"Assets/Models/Weapons/RocketLauncher/RocketLauncher.fbx").WaitForCompletion(), ((Component)val12).transform);
			((Component)obj14.transform.GetChild(0)).gameObject.SetActive(false);
			Material v3FreezeframeMat = Addressables.LoadAssetAsync<Material>((object)"Assets/Models/Weapons/RocketLauncher/RocketLauncher Unlit CustomColor.mat").WaitForCompletion();
			v3FreezeframeMat.shader = shad;
			CollectionExtensions.Do<SkinnedMeshRenderer>((IEnumerable<SkinnedMeshRenderer>)obj14.GetComponentsInChildren<SkinnedMeshRenderer>(), (Action<SkinnedMeshRenderer>)delegate(SkinnedMeshRenderer smr)
			{
				((Renderer)smr).material = v3FreezeframeMat;
			});
			obj14.transform.localPosition = new Vector3(8.5f, -5.5f, 0f);
			obj14.transform.localRotation = Quaternion.Euler(0f, 180f, 125f);
			obj14.transform.localScale = Vector3.one * 10f;
			val12.bullet = PrepareGrenade(component16.rocket, ((Component)weaponInfo4).gameObject);
			val12.altBullet = null;
			val12.muzzleFlash = CreateClone(component16.muzzleFlash, ((Component)weaponInfo4).gameObject);
			AudioSource obj15 = val12.muzzleFlash.AddComponent<AudioSource>();
			PrepareAudio(obj15);
			obj15.clip = ((Component)component16).GetComponent<AudioSource>().clip;
			obj15.volume = 0.85f;
			val12.muzzleFlashAlt = null;
			weaponInfo4.drawTime = 0.25f;
			weaponInfo4.drawTimeAlt = 0f;
			weaponInfo4.cooldown = 1f;
			weaponInfo4.cooldownAlt = 0f;
			weaponInfo4.prepareTimeAlt = 0f;
			weaponInfo4.maxCharges = -1;
			weaponInfo4.maxChargesAlt = 1;
			weaponInfo4.chargeIncrease = -1f;
			weaponInfo4.chargeIncreaseAlt = 0.1f;
			weaponInfo4.normalBlocksAlt = false;
			weaponInfo4.altBlocksNormal = false;
			weaponInfo4.resetCooldownOnSwap = false;
			weaponInfo4.resetCooldownOnSwapAlt = false;
			weaponInfo4.projectileSpeed = 100f;
			weaponInfo4.projectileSpeedAlt = -1f;
			weaponInfo4.aimAtHead = false;
			weaponInfo4.aimAtHeadAlt = false;
			weaponInfo4.useGravity = false;
			weaponInfo4.useGravityAlt = false;
			v.weapons[11] = Object.Instantiate<GameObject>(((Component)v.weapons[10]).gameObject, ((Component)v.weapons[10]).transform.parent).GetComponentInChildren<WeaponInfo>();
			weaponInfo4 = v.weapons[11];
			((Object)weaponInfo4).name = "S.R.S. Cannon Rocket Launcher";
			RocketLauncher component17 = AddressablesExtensions.ToAsset(MonoSingleton<GunSetter>.Instance.rocketGreen[0]).GetComponent<RocketLauncher>();
			IEnemyWeapon enemyWeapon12 = weaponInfo4.EnemyWeapon;
			IEnemyWeapon obj16 = ((enemyWeapon12 is EnemyRevolver) ? enemyWeapon12 : null);
			((EnemyRevolver)obj16).bullet = PrepareGrenade(component17.rocket, ((Component)weaponInfo4).gameObject);
			((EnemyRevolver)obj16).altBullet = PrepareCannonball(((Component)component17.cannonBall).gameObject, ((Component)weaponInfo4).gameObject);
			((EnemyRevolver)obj16).muzzleFlash = CreateClone(component17.muzzleFlash, ((Component)weaponInfo4).gameObject);
			AudioSource obj17 = ((EnemyRevolver)obj16).muzzleFlash.AddComponent<AudioSource>();
			PrepareAudio(obj17);
			obj17.clip = ((Component)component17).GetComponent<AudioSource>().clip;
			obj17.volume = 0.85f;
			((EnemyRevolver)obj16).muzzleFlashAlt = CreateClone(component17.muzzleFlash, ((Component)weaponInfo4).gameObject);
			AudioSource obj18 = ((EnemyRevolver)obj16).muzzleFlashAlt.AddComponent<AudioSource>();
			obj18.clip = ((Component)component17).GetComponent<AudioSource>().clip;
			obj18.volume = 0.85f;
			obj18.pitch = 0.7f;
			PrepareAudio(obj18);
			weaponInfo4.drawTime = 0.25f;
			weaponInfo4.drawTimeAlt = 0.25f;
			weaponInfo4.cooldown = 1f;
			weaponInfo4.cooldownAlt = 1f;
			weaponInfo4.prepareTimeAlt = 1f;
			weaponInfo4.maxCharges = -1;
			weaponInfo4.maxChargesAlt = 1;
			weaponInfo4.chargeIncrease = -1f;
			weaponInfo4.chargeIncreaseAlt = 0.125f;
			weaponInfo4.normalBlocksAlt = true;
			weaponInfo4.altBlocksNormal = true;
			weaponInfo4.resetCooldownOnSwap = false;
			weaponInfo4.resetCooldownOnSwapAlt = false;
			weaponInfo4.projectileSpeed = 100f;
			weaponInfo4.projectileSpeedAlt = 150f;
			weaponInfo4.aimAtHead = false;
			weaponInfo4.aimAtHeadAlt = false;
			weaponInfo4.useGravity = false;
			weaponInfo4.useGravityAlt = true;
			weaponInfo.SetActive(value: false);
			weaponInfo2.SetActive(value: false);
			weaponInfo3.SetActive(value: false);
			((Object)val).name = "V3-B";
			((Object)val).hideFlags = (HideFlags)61;
			Object.DontDestroyOnLoad((Object)(object)val);
			return val;
			static GameObject CreateClone(GameObject original, GameObject newParent)
			{
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0020: Expected O, but got Unknown
				GameObject val13 = Extensions.InstantiateInactive(new GameObject(((Object)original).name + "(Parent)"), newParent.transform);
				return Object.Instantiate<GameObject>(original, val13.transform);
			}
			static void PrepareAudio(AudioSource aud)
			{
				aud.rolloffMode = (AudioRolloffMode)1;
				aud.spatialBlend = 1f;
				aud.velocityUpdateMode = (AudioVelocityUpdateMode)1;
			}
			static GameObject PrepareBeam(GameObject beam, GameObject parent)
			{
				//IL_000f: 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)
				GameObject obj23 = CreateClone(beam, parent);
				RevolverBeam component21 = obj23.GetComponent<RevolverBeam>();
				component21.beamType = (BeamType)3;
				component21.ignoreEnemyType = (EnemyType)8;
				component21.noMuzzleflash = true;
				component21.sourceWeapon = parent;
				return obj23;
			}
			static GameObject PrepareCannonball(GameObject cb, GameObject parent)
			{
				GameObject obj19 = CreateClone(cb, parent);
				obj19.GetComponent<Cannonball>().sourceWeapon = parent;
				return obj19;
			}
			static GameObject PrepareGrenade(GameObject grenade, GameObject parent)
			{
				GameObject obj21 = CreateClone(grenade, parent);
				Grenade component19 = obj21.GetComponent<Grenade>();
				component19.enemy = true;
				component19.sourceWeapon = parent;
				return obj21;
			}
			static GameObject PrepareNail(GameObject nail, GameObject parent)
			{
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				GameObject obj20 = CreateClone(nail, parent);
				Nail component18 = obj20.GetComponent<Nail>();
				component18.enemy = true;
				component18.safeEnemyType = (EnemyType)8;
				component18.sourceWeapon = parent;
				return obj20;
			}
			static GameObject PrepareProjectile(GameObject proj, GameObject parent)
			{
				//IL_002f: Unknown result type (might be due to invalid IL or missing references)
				GameObject obj22 = CreateClone(proj, parent);
				Projectile component20 = obj22.GetComponent<Projectile>();
				component20.damage *= 25f;
				component20.friendly = false;
				component20.playerBullet = false;
				component20.safeEnemyType = (EnemyType)8;
				component20.sourceWeapon = parent;
				return obj22;
			}
		}

		public static SpawnableObject BuildV3Spawnable()
		{
			//IL_0034: 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_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_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: 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_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			SpawnableObject val = ScriptableObject.CreateInstance<SpawnableObject>();
			((Object)val).name = "V3-B";
			val.identifier = "JadeH.ULTRAKILL.V3Mod.V3-B";
			val.objectName = "V3-B";
			val.gameObject = BuildV3Object();
			val.spawnableObjectType = (SpawnableObjectDataType)1;
			val.enemyType = (EnemyType)3;
			val.iconKey = ((Object)v2Icon).name;
			val.gridIcon = v2Icon;
			val.backgroundColor = new Color(0.4784f, 0.6196f, 0.851f);
			val.preview = Addressables.LoadAssetAsync<GameObject>((object)"Assets/Prefabs/Spawner Previews/V2 2nd Preview Variant.prefab").WaitForCompletion();
			string text = MonoSingleton<ColorBlindSettings>.Instance.variationColors[0].ToHexString();
			string text2 = MonoSingleton<ColorBlindSettings>.Instance.variationColors[1].ToHexString();
			string text3 = MonoSingleton<ColorBlindSettings>.Instance.variationColors[2].ToHexString();
			val.type = "SUPREME MACHINE";
			val.description = "During mankind's Hell Expeditions, the lower layers proved to be extremely difficult to traverse, even for the most well-built machines.\n\n\nFacing these challenges, engineers developed a new machine based on the older V models to combat these issues: V3.\n\n\nThe V3 model boasts a state-of-the-art armor design, allowing it to retain the benefits of both previous models' armor designs while still keeping its weight low; a critical design choice due to its new arm.\n\n\nThis new arm, nicknamed the \"<color=" + text2 + ">Whiplash</color>\" by its designer, allows it to quickly traverse steep obstacles by grabbing onto so-called \"Hookpoints\" deployed by tag-along machines that were lighter than itself.\n\n\nUnlike its predecessors, two fully-functional prototypes of this machine were made and sent into the Hell.\n\n\nThe first prototype succumbed to heatstroke in the layer of Greed after being ambushed in an unfortunate accident by a Stalker, while the second, retrofitted with a new heat-resistant coating, completed its mission by descending into the layer of Treachery.\n\n\nHowever, the whereabouts of this second prototype have been lost to time, as after reaching its destination, the Hell Expeditions were promptly cancelled, with the extinction of mankind following shortly after.";
			val.strategy = "- Despite its highly advanced armor system, V3-B does not have the capability to quickly recover from cuts, therefore making it more susceptible to piercing damage, like that from Revolver scraps and Nailgun nails.\n\n\n- Due to its heat-resistant coating, it takes less damage from heat weapons such as Shotguns and explosions.- As V3-B's health drops lower, it will become more aggressive, using its <color=" + text2 + ">Whiplash</color> to close the distance between it and its target while using fast-firing weapons to regain health.<size=50%><color=" + Color.gray.ToHexString() + ">(unimplemented rn, sorry :3)</color></size>\n\n\n- Hitting V3-B with a magnet from the <color=" + text + ">Attractor Nailgun</color> will prevent it from using its Nailguns' Nails and its Rocket Launchers' Rockets.\n\n\n- If V3-B is high in the air, it will slam to the ground to avoid staying airborne, preventing it from taking additional damage.\n\n\n- When struck by one of V3-B's <color=" + text + ">Attractor Nailgun</color> magnets, it either can be punched, shot off with any hitscan weapon, or disloged by a ground slam.\n\n\n- After being hit by V3-B's <color=" + text2 + ">Screwdriver Railcannon</color>, the screw can either be hit with the <color=" + text3 + ">Knuckleblaster</color> to destroy it, or hit with the <color=" + text + ">Feedbacker</color> to deal its remaining damage and deflect it into another enemy.";
			return val;
		}
	}
	[HarmonyPatch]
	internal class InjectMenus
	{
		private static bool spawnerInjected;

		private static bool shopInjected;

		private static readonly SpawnableObject spawnable = V3Assets.BuildV3Spawnable();

		[HarmonyPatch(typeof(SpawnMenu), "Awake")]
		[HarmonyPrefix]
		private static void InjectSpawnerArm(ref SpawnableObjectsDatabase ___objects)
		{
			if (!spawnerInjected)
			{
				Extensions.AddToArray(ref ___objects.enemies, spawnable, 13);
				spawnerInjected = true;
			}
		}

		[HarmonyPatch(typeof(EnemyInfoPage), "Start")]
		[HarmonyPrefix]
		private static void InjectShop(ref SpawnableObjectsDatabase ___objects)
		{
			if (!shopInjected)
			{
				Extensions.AddToArray(ref ___objects.enemies, spawnable, 18);
				shopInjected = true;
			}
		}
	}
	[BepInPlugin("JadeH.ULTRAKILL.V3Mod", "V3Mod", "0.2.0")]
	public class Plugin : BaseUnityPlugin
	{
		private void Awake()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			new Harmony("JadeH.ULTRAKILL.V3Mod.harmony").PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin JadeH.ULTRAKILL.V3Mod v0.2.0 is loaded!");
		}
	}
	public static class ConstInfo
	{
		public const string GUID = "JadeH.ULTRAKILL.V3Mod";

		public const string NAME = "V3Mod";

		public const string VERSION = "0.2.0";
	}
	public class V3 : MonoBehaviour, IAlter, IAlterOptions<bool>, IAlterOptions<float>
	{
		public class BulletCheck : MonoBehaviour
		{
			private V3 v3;

			private void Start()
			{
				v3 = ((Component)this).GetComponentInParent<V3>();
			}

			private void OnTriggerEnter(Collider other)
			{
				//IL_0055: Unknown result type (might be due to invalid IL or missing references)
				//IL_006c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0072: Invalid comparison between Unknown and I4
				//IL_013d: Unknown result type (might be due to invalid IL or missing references)
				//IL_009e: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00be: Unknown result type (might be due to invalid IL or missing references)
				//IL_0082: Unknown result type (might be due to invalid IL or missing references)
				//IL_0088: Invalid comparison between Unknown and I4
				//IL_01c4: 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)
				//IL_00da: 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)
				if (v3.Target == null || v3.eid.blessed)
				{
					return;
				}
				EnemyIdentifier val5 = default(EnemyIdentifier);
				EnemyIdentifierIdentifier val6 = default(EnemyIdentifierIdentifier);
				if (((Component)other).gameObject.layer == LayerMask.NameToLayer("Projectile"))
				{
					PhysicalShockwave val = default(PhysicalShockwave);
					Projectile val2 = default(Projectile);
					Nail val3 = default(Nail);
					if (((Component)other).TryGetComponent<PhysicalShockwave>(ref val))
					{
						v3.Dodge(((Component)val).transform.position, away: false);
					}
					else if ((!((Component)other).TryGetComponent<Projectile>(ref val2) || (int)val2.safeEnemyType != 8) && (!((Component)other).TryGetComponent<Nail>(ref val3) || (int)val3.safeEnemyType != 8))
					{
						v3.Dodge(((Component)v3).transform.position + ((Vector3.SignedAngle(((Component)v3).transform.forward, ((Component)other).transform.position, Vector3.up) >= 0f) ? (-((Component)v3).transform.right) : ((Component)v3).transform.right), away: false);
					}
				}
				else if (((Component)other).gameObject.layer == LayerMask.NameToLayer("Explosion"))
				{
					Explosion val4 = default(Explosion);
					if (((Component)other).TryGetComponent<Explosion>(ref val4) && !val4.harmless)
					{
						v3.Dodge(((Component)other).transform.position, away: true);
					}
				}
				else if ((((Component)other).gameObject.layer == LayerMask.NameToLayer("EnemyTrigger") || ((Component)other).gameObject.layer == LayerMask.NameToLayer("Limb")) && ((((Component)other).TryGetComponent<EnemyIdentifier>(ref val5) && (Object)(object)val5 != (Object)(object)v3.eid) || (((Component)other).TryGetComponent<EnemyIdentifierIdentifier>(ref val6) && (Object)(object)val6.eid != (Object)(object)v3.eid)))
				{
					v3.Dodge(((Component)other).transform.position, away: true);
				}
			}
		}

		private Animator anim;

		private Rigidbody rb;

		public SkinnedMeshRenderer smr;

		private EnemySimplifier[] ensims;

		public EnemyIdentifier eid;

		private Machine mac;

		public BossHealthBar bhb;

		private int difficulty;

		private int prevPlayerHP = 100;

		public float healMultiplier = 1f;

		public Texture[] wingTextures;

		public GameObject wingChangeEffect;

		public GameObject currentWingChangeEffect;

		private readonly Color[] patternColors = (Color[])(object)new Color[4]
		{
			new Color(0.9059f, 0.8118f, 0f),
			new Color(0f, 0.7333f, 0.9059f),
			new Color(0.9059f, 0.2235f, 0f),
			new Color(0f, 0.9216f, 0.1176f)
		};

		private DragBehind[] drags;

		private float stepCooldown = 0.4f;

		private float circleTimer = 5f;

		private float distancePatience;

		private float slideStopTimer;

		public float dodgeLeft;

		private float stamina = 3f;

		private int wallJumps = 3;

		private float patternCooldown;

		public bool canSlide = true;

		public bool canJump = true;

		public bool canSlam = true;

		public bool canDash = true;

		public bool sliding;

		public bool jumping;

		public bool slamming;

		private readonly float jumpPower = 135000f;

		private readonly float wallJumpPower = 300000f;

		private readonly float airAcceleration = 6000f;

		public GameObject dodgeParticles;

		public GameObject slideScrape;

		public GameObject slideParticles;

		public GameObject slamParticles;

		public GameObject slamHitEffect;

		private int prevPattern;

		private int currentPattern;

		private NavMeshAgent nma;

		public GameObject jumpSound;

		public GameObject dashJumpSound;

		public GameObject finalWallJumpSound;

		private int circleDirection = 1;

		private readonly float circleDistance = 10f;

		public GroundCheckEnemy gc;

		public GroundCheckEnemy wc;

		private float wallHitCooldown;

		public AudioSource stepAud;

		public AudioClip[] stepSounds;

		private WeaponInfo currentWeapon;

		private float weaponSwapCooldown;

		public WeaponInfo[] weapons = new WeaponInfo[12];

		public Component overrideTarget;

		private Quaternion targetRot;

		public Transform[] aimAtTarget;

		private float shootableInSightCooldown = 0.5f;

		public float rcCooldown = 16f;

		public float maxRcCooldown = 16f;

		public bool snipeGrenades = true;

		public bool snipeCoins = true;

		public bool snipeCannonballs = true;

		public bool snipeMagnets = true;

		public bool rev0 = true;

		public bool rev1 = true;

		public bool rev2 = true;

		public bool stg0 = true;

		public bool stg1 = true;

		public bool nai0 = true;

		public bool nai1 = true;

		public bool rai0 = true;

		public bool rai1 = true;

		public bool rai2 = true;

		public bool rkt0 = true;

		public bool rkt1 = true;

		public WeaponInfo[] Revolvers => new WeaponInfo[3]
		{
			weapons[0],
			weapons[1],
			weapons[2]
		};

		public WeaponInfo[] Shotguns => new WeaponInfo[2]
		{
			weapons[3],
			weapons[4]
		};

		public WeaponInfo[] Nailguns => new WeaponInfo[2]
		{
			weapons[5],
			weapons[6]
		};

		public WeaponInfo[] Railcannons => new WeaponInfo[3]
		{
			weapons[7],
			weapons[8],
			weapons[9]
		};

		public WeaponInfo[] RocketLaunchers => new WeaponInfo[2]
		{
			weapons[10],
			weapons[11]
		};

		public EnemyTarget Target => eid.target;

		public float DistanceToTarget => Vector3.Distance(((Component)this).transform.position, Target.position);

		public float HorizontalDistanceToTarget => Vector3.Distance(((Component)this).transform.position.SetY(0f), Target.position.SetY(0f));

		public string alterKey => "JadeH.ULTRAKILL.V3Mod.V3-B";

		public string alterCategoryName => "V3";

		AlterOption<bool>[] IAlterOptions<bool>.options => new AlterOption<bool>[20]
		{
			new AlterOption<bool>
			{
				name = "Slide",
				key = "slide",
				value = canSlide,
				callback = delegate(bool value)
				{
					canSlide = value;
				}
			},
			new AlterOption<bool>
			{
				name = "Jump",
				key = "jump",
				value = canJump,
				callback = delegate(bool value)
				{
					canJump = value;
				}
			},
			new AlterOption<bool>
			{
				name = "Slam",
				key = "slam",
				value = canSlam,
				callback = delegate(bool value)
				{
					canSlam = value;
				}
			},
			new AlterOption<bool>
			{
				name = "Dash",
				key = "dash",
				value = canDash,
				callback = delegate(bool value)
				{
					canDash = value;
				}
			},
			new AlterOption<bool>
			{
				name = "Snipe Grenades",
				key = "grenades",
				value = snipeGrenades,
				callback = delegate(bool value)
				{
					snipeGrenades = value;
				}
			},
			new AlterOption<bool>
			{
				name = "Snipe Coins",
				key = "coins",
				value = snipeCoins,
				callback = delegate(bool value)
				{
					snipeCoins = value;
				}
			},
			new AlterOption<bool>
			{
				name = "Snipe Cannonballs",
				key = "cannonballs",
				value = snipeCannonballs,
				callback = delegate(bool value)
				{
					snipeCannonballs = value;
				}
			},
			new AlterOption<bool>
			{
				name = "Snipe Magnets",
				key = "magnets",
				value = snipeMagnets,
				callback = delegate(bool value)
				{
					snipeMagnets = value;
				}
			},
			new AlterOption<bool>
			{
				name = "Piercer Revolver",
				key = "rev0",
				value = rev0,
				callback = delegate(bool value)
				{
					rev0 = value;
				}
			},
			new AlterOption<bool>
			{
				name = "Marksman Revolver",
				key = "rev1",
				value = rev1,
				callback = delegate(bool value)
				{
					rev1 = value;
				}
			},
			new AlterOption<bool>
			{
				name = "Sharpshooter Revolver",
				key = "rev2",
				value = rev2,
				callback = delegate(bool value)
				{
					rev2 = value;
				}
			},
			new AlterOption<bool>
			{
				name = "Core Eject Shotgun",
				key = "stg0",
				value = stg0,
				callback = delegate(bool value)
				{
					stg0 = value;
				}
			},
			new AlterOption<bool>
			{
				name = "Pump Charge Shotgun",
				key = "stg1",
				value = stg1,
				callback = delegate(bool value)
				{
					stg1 = value;
				}
			},
			new AlterOption<bool>
			{
				name = "Attractor Nailgun",
				key = "nai0",
				value = nai0,
				callback = delegate(bool value)
				{
					nai0 = value;
				}
			},
			new AlterOption<bool>
			{
				name = "Overheat Nailgun",
				key = "nai1",
				value = nai1,
				callback = delegate(bool value)
				{
					nai1 = value;
				}
			},
			new AlterOption<bool>
			{
				name = "Electric Railcannon",
				key = "rai0",
				value = rai0,
				callback = delegate(bool value)
				{
					rai0 = value;
				}
			},
			new AlterOption<bool>
			{
				name = "Screwdriver Railcannon",
				key = "rai1",
				value = rai1,
				callback = delegate(bool value)
				{
					rai1 = value;
				}
			},
			new AlterOption<bool>
			{
				name = "Malicious Railcannon",
				key = "rai2",
				value = rai2,
				callback = delegate(bool value)
				{
					rai2 = value;
				}
			},
			new AlterOption<bool>
			{
				name = "Freezeframe Rocket Launcher",
				key = "rkt0",
				value = rkt0,
				callback = delegate(bool value)
				{
					rkt0 = value;
				}
			},
			new AlterOption<bool>
			{
				name = "S.R.S. Cannon Rocket Launcher",
				key = "rkt1",
				value = rkt1,
				callback = delegate(bool value)
				{
					rkt1 = value;
				}
			}
		};

		AlterOption<float>[] IAlterOptions<float>.options => new AlterOption<float>[2]
		{
			new AlterOption<float>
			{
				name = "Rail Cooldown",
				key = "rcDelay",
				value = maxRcCooldown,
				callback = delegate(float value)
				{
					maxRcCooldown = value;
					if (rcCooldown > value)
					{
						rcCooldown = value;
					}
				}
			},
			new AlterOption<float>
			{
				name = "Healing Factor",
				key = "healMult",
				value = healMultiplier,
				callback = delegate(float value)
				{
					healMultiplier = value;
				}
			}
		};

		private void Awake()
		{
			anim = ((Component)this).GetComponentInChildren<Animator>();
			rb = ((Component)this).GetComponent<Rigidbody>();
			gc = ((Component)this).GetComponentInChildren<GroundCheckEnemy>();
			nma = ((Component)this).GetComponent<NavMeshAgent>();
			eid = ((Component)this).GetComponent<EnemyIdentifier>();
			mac = ((Component)this).GetComponent<Machine>();
			ensims = ((Component)this).GetComponentsInChildren<EnemySimplifier>();
			drags = ((Component)this).GetComponentsInChildren<DragBehind>();
		}

		private void Start()
		{
			difficulty = MonoSingleton<PrefsManager>.Instance.GetInt("difficulty", 0);
			SwitchPattern(currentPattern);
			WeaponInfo[] array = weapons;
			foreach (WeaponInfo obj in array)
			{
				obj.UpdateBuffs();
				obj.SetActive(value: false);
			}
			weapons[0].weightCalc = (V3 v3) => v3.rev0 ? 0 : 0;
			weapons[0].weightCalcAlt = (V3 v3) => v3.rev0 ? 1 : 0;
			weapons[1].weightCalc = (V3 v3) => v3.rev1 ? 0 : 0;
			weapons[1].weightCalcAlt = (V3 v3) => (v3.rev1 && v3.snipeCoins) ? 5 : 0;
			weapons[2].weightCalc = (V3 v3) => v3.rev2 ? 0 : 0;
			weapons[2].weightCalcAlt = (V3 v3) => v3.rev2 ? 1 : 0;
			weapons[3].weightCalc = (V3 v3) => (v3.stg0 && v3.DistanceToTarget <= 20f) ? 2 : 0;
			weapons[3].weightCalcAlt = delegate(V3 v3)
			{
				int num;
				if (v3.stg0)
				{
					float distanceToTarget = v3.DistanceToTarget;
					if (distanceToTarget > 6f && distanceToTarget <= 50f)
					{
						num = 1;
						goto IL_0023;
					}
				}
				num = 0;
				goto IL_0023;
				IL_0023:
				return num;
			};
			weapons[4].weightCalc = (V3 v3) => (v3.stg1 && v3.DistanceToTarget <= 20f) ? 4 : 0;
			weapons[4].weightCalcAlt = (V3 v3) => v3.stg1 ? 0 : 0;
			weapons[5].weightCalc = (V3 v3) => (v3.nai0 && v3.DistanceToTarget <= 75f && !v3.eid.stuckMagnets.Any()) ? 4 : 0;
			weapons[5].weightCalcAlt = (V3 v3) => (v3.nai0 && v3.DistanceToTarget <= 50f && ((v3.Target.isEnemy && !v3.Target.enemyIdentifier.stuckMagnets.Any()) || (v3.Target.isPlayer && !Object.op_Implicit((Object)(object)((Component)((Component)MonoSingleton<NewMovement>.Instance).transform).GetComponentInChildren<Magnet>())))) ? 5 : 0;
			weapons[6].weightCalc = (V3 v3) => v3.nai1 ? 0 : 0;
			weapons[6].weightCalcAlt = (V3 v3) => v3.nai1 ? 0 : 0;
			weapons[7].weightCalc = (V3 v3) => (v3.rai0 && v3.rcCooldown <= 0f) ? 10 : 0;
			weapons[7].weightCalcAlt = (V3 v3) => 0f;
			weapons[8].weightCalc = (V3 v3) => (v3.rai1 && v3.rcCooldown <= 0f && v3.DistanceToTarget < 40f) ? 10 : 0;
			weapons[8].weightCalcAlt = (V3 v3) => 0f;
			weapons[9].weightCalc = (V3 v3) => (v3.rai2 && v3.rcCooldown <= 0f && v3.DistanceToTarget > 13.5f) ? 10 : 0;
			weapons[9].weightCalcAlt = (V3 v3) => 0f;
			weapons[10].weightCalc = (V3 v3) => (v3.rkt0 && v3.DistanceToTarget > (float)((v3.Target.isOnGround && (v3.Target.enemyIdentifier == null || !v3.Target.enemyIdentifier.flying)) ? 6 : 12) && v3.DistanceToTarget <= 30f && !v3.eid.stuckMagnets.Any() && !MonoSingleton<WeaponCharges>.Instance.rocketFrozen) ? 1 : 0;
			weapons[10].weightCalcAlt = (V3 v3) => v3.rkt0 ? 0 : 0;
			weapons[11].weightCalc = (V3 v3) => (v3.rkt1 && v3.DistanceToTarget > (float)((v3.Target.isOnGround && (v3.Target.enemyIdentifier == null || !v3.Target.enemyIdentifier.flying)) ? 6 : 12) && v3.DistanceToTarget <= 30f && !v3.eid.stuckMagnets.Any() && !MonoSingleton<WeaponCharges>.Instance.rocketFrozen) ? 1 : 0;
			weapons[11].weightCalcAlt = (V3 v3) => (v3.rkt1 && v3.DistanceToTarget <= 75f) ? 5 : 0;
			SwitchWeapon(weapons[0]);
		}

		private void Update()
		{
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: 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_03ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_029d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bb: 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_061c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0621: Unknown result type (might be due to invalid IL or missing references)
			//IL_0626: 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_0633: Unknown result type (might be due to invalid IL or missing references)
			//IL_063e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0643: 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_064d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0652: Unknown result type (might be due to invalid IL or missing references)
			//IL_0654: Unknown result type (might be due to invalid IL or missing references)
			//IL_0656: Unknown result type (might be due to invalid IL or missing references)
			//IL_0472: Unknown result type (might be due to invalid IL or missing references)
			//IL_047d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0482: Unknown result type (might be due to invalid IL or missing references)
			//IL_048c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0491: Unknown result type (might be due to invalid IL or missing references)
			//IL_0496: Unknown result type (might be due to invalid IL or missing references)
			//IL_049b: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05db: 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_05fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0607: Unknown result type (might be due to invalid IL or missing references)
			//IL_0671: Unknown result type (might be due to invalid IL or missing references)
			//IL_0673: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04db: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ea: 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_06d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_06db: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_051b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0520: Unknown result type (might be due to invalid IL or missing references)
			//IL_0525: Unknown result type (might be due to invalid IL or missing references)
			//IL_055f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0564: Unknown result type (might be due to invalid IL or missing references)
			//IL_0574: Unknown result type (might be due to invalid IL or missing references)
			//IL_0584: Unknown result type (might be due to invalid IL or missing references)
			//IL_0964: Unknown result type (might be due to invalid IL or missing references)
			//IL_075b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0766: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0842: Unknown result type (might be due to invalid IL or missing references)
			//IL_0803: Unknown result type (might be due to invalid IL or missing references)
			//IL_080e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0819: Unknown result type (might be due to invalid IL or missing references)
			//IL_081e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0825: Unknown result type (might be due to invalid IL or missing references)
			//IL_082a: Unknown result type (might be due to invalid IL or missing references)
			//IL_082f: Unknown result type (might be due to invalid IL or missing references)
			if (rcCooldown > 0f)
			{
				rcCooldown = Mathf.MoveTowards(rcCooldown, 0f, Time.deltaTime);
			}
			if (!Object.op_Implicit((Object)(object)bhb))
			{
				bhb = ((Component)this).GetComponent<BossHealthBar>();
			}
			else if (!bhb.secondaryBar)
			{
				Object.Destroy((Object)(object)bhb);
				bhb = ((Component)this).gameObject.AddComponent<BossHealthBar>();
				bhb.bossName = "V3-B";
				bhb.secondaryBar = true;
			}
			else
			{
				bhb.SetSecondaryBarColor((rcCooldown > 0f) ? MonoSingleton<ColorBlindSettings>.Instance.railcannonChargingColor : MonoSingleton<ColorBlindSettings>.Instance.railcannonFullColor);
				bhb.UpdateSecondaryBar((maxRcCooldown > 0f) ? ((maxRcCooldown - rcCooldown) / maxRcCooldown) : 1f);
			}
			if (!sliding && stamina < 3f)
			{
				int num = difficulty;
				stamina = Mathf.MoveTowards(stamina, 3f, num switch
				{
					0 => 1.4f, 
					1 => 1.05f, 
					_ => 0.7f, 
				} * Time.deltaTime);
			}
			anim.SetBool("InAir", !gc.onGround || dodgeLeft > 0f);
			DragBehind[] array = drags;
			for (int num = 0; num < array.Length; num++)
			{
				array[num].active = !gc.onGround || dodgeLeft > 0f || sliding;
			}
			Vector3 val = rb.velocity.SetY(0f);
			if (!(((Vector3)(ref val)).magnitude > 0f))
			{
				val = nma.velocity.SetY(0f);
				if (!(((Vector3)(ref val)).magnitude > 0f))
				{
					goto IL_035a;
				}
			}
			if (!(dodgeLeft <= 0f) || !gc.onGround || sliding)
			{
				goto IL_035a;
			}
			float num2 = Quaternion.Angle(((Component)anim).transform.rotation, ((Component)this).transform.rotation);
			anim.SetLayerWeight(1, 1f);
			anim.SetLayerWeight(2, ((num2 <= 90f) ? num2 : (num2 - 180f)) / 90f);
			Animator obj = anim;
			Quaternion rotation = ((Component)anim).transform.rotation;
			float y = ((Quaternion)(ref rotation)).eulerAngles.y;
			rotation = ((Component)this).transform.rotation;
			obj.SetBool("RunningLeft", y > ((Quaternion)(ref rotation)).eulerAngles.y);
			anim.SetBool("RunningBack", num2 > 90f);
			if (stepCooldown > 0f)
			{
				stepCooldown = Mathf.MoveTowards(stepCooldown, 0f, Time.deltaTime);
			}
			else
			{
				stepAud.pitch = Random.Range(0.9f, 1.1f);
				stepAud.PlayOneShot(stepSounds[Random.Range(0, stepSounds.Length)]);
				stepCooldown = 0.4f;
			}
			goto IL_0387;
			IL_0387:
			if (MonoSingleton<NewMovement>.Instance.hp < prevPlayerHP && !MonoSingleton<NewMovement>.Instance.exploded && Vector3.Distance(((Component)this).transform.position, ((Component)MonoSingleton<NewMovement>.Instance).transform.position) < 10f)
			{
				GetHealth(prevPlayerHP - MonoSingleton<NewMovement>.Instance.hp);
			}
			prevPlayerHP = MonoSingleton<NewMovement>.Instance.hp;
			if (Target == null || ((Behaviour)nma).enabled)
			{
				SetSlide(state: false);
				return;
			}
			if (wallHitCooldown > 0f)
			{
				wallHitCooldown = Mathf.MoveTowards(wallHitCooldown, 0f, Time.deltaTime);
			}
			if (patternCooldown > 0f)
			{
				patternCooldown = Mathf.MoveTowards(patternCooldown, 0f, Time.deltaTime);
			}
			if (!sliding)
			{
				targetRot = Quaternion.LookRotation((Target.position - ((Component)this).transform.position).SetY(0f), Vector3.up);
				if (dodgeLeft <= 0f && currentPattern != 0)
				{
					if (currentPattern == 3)
					{
						((Component)this).transform.rotation = Quaternion.LookRotation((((Component)this).transform.position - Target.position).SetY(0f), Vector3.up);
					}
					else if (currentPattern == 1 || HorizontalDistanceToTarget < circleDistance)
					{
						Quaternion rotation2 = targetRot;
						((Quaternion)(ref rotation2)).eulerAngles = ((Quaternion)(ref rotation2)).eulerAngles + new Vector3(0f, (float)circleDirection * Mathf.Min(180f * HorizontalDistanceToTarget / circleDistance - 180f, 0f), 0f);
						((Component)this).transform.rotation = rotation2;
					}
					else
					{
						((Component)this).transform.rotation = targetRot;
						if (gc.onGround && !jumping && !slamming && HorizontalDistanceToTarget > 20f)
						{
							SetSlide(state: true);
						}
					}
				}
				((Component)anim).transform.rotation = Quaternion.RotateTowards(((Component)anim).transform.rotation, targetRot, Time.deltaTime * 10f * Quaternion.Angle(((Component)anim).transform.rotation, targetRot));
			}
			else
			{
				Quaternion val2 = Quaternion.LookRotation(((Component)this).transform.forward, Vector3.up);
				Quaternion val3 = Quaternion.LookRotation(Target.position - ((Component)this).transform.position, Vector3.up);
				if (Quaternion.Angle(val2, val3) > 90f || (distancePatience >= 5f && Quaternion.Angle(val2, val3) > 45f))
				{
					if (slideStopTimer > 0f)
					{
						slideStopTimer = Mathf.MoveTowards(slideStopTimer, 0f, Time.deltaTime);
					}
					else
					{
						SetSlide(state: false);
					}
				}
			}
			if (dodgeLeft <= 0f)
			{
				CheckPattern();
				RaycastHit val4 = default(RaycastHit);
				if (!jumping && Physics.Raycast(((Component)this).transform.position + Vector3.up, Vector3.down, ref val4, float.PositiveInfinity, LayerMask.GetMask(new string[2] { "Environment", "Outdoors" })) && ((RaycastHit)(ref val4)).distance > 25f)
				{
					Slam();
				}
				else if (wc.onGround && wallHitCooldown <= 0f)
				{
					if (currentPattern == 1 || Vector3.Distance(((Component)this).transform.position, Target.position) < 10f)
					{
						circleDirection = -circleDirection;
					}
					if (currentPattern == 3 || !gc.onGround)
					{
						Jump();
					}
					switch (currentPattern)
					{
					case 0:
					{
						RaycastHit val5 = default(RaycastHit);
						if (Physics.Linecast(((Component)this).transform.position, wc.ClosestPoint(), ref val5, LayerMask.GetMask(new string[2] { "Environment", "Outdoors" })))
						{
							ChangeDirection(((Component)this).transform.position + Vector3.Reflect(wc.ClosestPoint() - ((Component)this).transform.position, ((RaycastHit)(ref val5)).normal));
						}
						break;
					}
					case 2:
					case 3:
						ChangeDirection(Target.position);
						break;
					}
					wallHitCooldown = 1f;
				}
				if (DistanceToTarget > 15f)
				{
					if (distancePatience < 12f)
					{
						distancePatience = Mathf.MoveTowards(distancePatience, 12f, Time.deltaTime);
					}
					if ((distancePatience >= 4f || DistanceToTarget > 30f) && currentPattern != 2)
					{
						SwitchPattern(2);
					}
				}
				else if (distancePatience > 0f)
				{
					distancePatience = Mathf.MoveTowards(distancePatience, 0f, Time.deltaTime * 2f);
				}
			}
			if (currentPattern == 1 || DistanceToTarget < 10f)
			{
				if (circleTimer > 0f)
				{
					circleTimer = Mathf.MoveTowards(circleTimer, 0f, Time.deltaTime * ((currentPattern == 1) ? 1f : 1.5f));
				}
				else if (dodgeLeft <= 0f)
				{
					circleTimer = 1f;
					Dodge(Target.position, away: true);
					if (currentPattern != 3 && currentPattern != 1)
					{
						SwitchPattern(3);
					}
				}
			}
			else
			{
				if (circleTimer < 5f)
				{
					circleTimer = Mathf.MoveTowards(circleTimer, 5f, Time.deltaTime);
				}
				if (currentPattern == 3 && circleTimer > 2f)
				{
					CheckPattern();
					SwitchPattern(prevPattern);
				}
			}
			List<Coin> source = MonoSingleton<CoinList>.Instance.revolverCoinsList.FindAll((Coin c) => !Physics.Linecast(aimAtTarget[1].position, ((Component)c).transform.position, LayerMask.GetMask(new string[2] { "Environment", "Outdoors" })) && Vector3.Distance(((Component)c).transform.position, ((Component)this).transform.position) <= 50f && Object.op_Implicit((Object)(object)((Component)c).GetComponent<Rigidbody>()));
			List<Grenade> source2 = MonoSingleton<GrenadeList>.Instance.grenadeList.FindAll((Grenade g) => !Physics.Linecast(aimAtTarget[1].position, ((Component)g).transform.position, LayerMask.GetMask(new string[2] { "Environment", "Outdoors" })) && Vector3.Distance(((Component)g).transform.position, Target.position + Target.rigidbody.velocity) <= (from e in (g.rocket ? g.explosion : g.superExplosion).GetComponentsInChildren<Explosion>()
				where (int)e.canHit != (Target.isPlayer ? 1 : 2) && !e.harmless
				select e).Max((Explosion e) => e.maxSize) * (g.frozen ? 1.5f : 1f) && Vector3.Distance(((Component)g).transform.position, ((Component)this).transform.position + rb.velocity) > (from e in (g.rocket ? g.explosion : g.superExplosion).GetComponentsInChildren<Explosion>()
				where (int)e.canHit != 2 && !e.harmless
				select e).Max((Explosion e) => e.maxSize) * (g.frozen ? 1.5f : 1f));
			List<Cannonball> source3 = MonoSingleton<GrenadeList>.Instance.cannonballList.FindAll((Cannonball c) => !Physics.Linecast(aimAtTarget[1].position, ((Component)c).transform.position, LayerMask.GetMask(new string[2] { "Environment", "Outdoors" })) && Vector3.Distance(((Component)c).transform.position, Target.position + Target.rigidbody.velocity) <= 13.5f && Vector3.Distance(((Component)c).transform.position, ((Component)this).transform.position + rb.velocity) > 13.5f && Object.op_Implicit((Object)(object)c.sourceWeapon));
			Nail val7 = default(Nail);
			List<Magnet> source4 = Object.FindObjectsOfType<Magnet>().ToList().FindAll((Magnet m) => !Physics.Linecast(aimAtTarget[1].position, ((Component)m).transform.position, LayerMask.GetMask(new string[2] { "Environment", "Outdoors" })) && (Vector3.Distance(((Component)this).transform.position, ((Component)m).transform.position) <= 50f || Nailguns[0].chargeAlt <= 0f) && !m.onEnemy && (m.sawblades.Any((Rigidbody saw) => (Object)(object)saw != (Object)null && ((Component)saw).TryGetComponent<Nail>(ref val7) && val7.heated) || m.sawblades.Count > 5 || Traverse.Create((object)m).Field("affectedRbs").GetValue<List<Rigidbody>>()
				.Count > 20));
			if (snipeGrenades && Target.isPlayer && source2.Any((Grenade g) => g.playerRiding))
			{
				overrideTarget = (Component)(object)source2.First((Grenade g) => g.playerRiding);
			}
			else if (snipeCoins && source.Any((Coin c) => !c.shot))
			{
				overrideTarget = (Component)(object)source.First((Coin c) => !c.shot);
			}
			else if (snipeCannonballs && source3.Any())
			{
				overrideTarget = (Component)(object)source3.First();
			}
			else if (snipeGrenades && source2.Any())
			{
				overrideTarget = (Component)(object)source2.First();
			}
			else if (snipeMagnets && source4.Any())
			{
				overrideTarget = (Component)(object)source4.First();
			}
			else
			{
				overrideTarget = null;
			}
			if (Object.op_Implicit((Object)(object)overrideTarget) && (rai2 || rev0 || rev1 || rev2))
			{
				if (shootableInSightCooldown > 0f)
				{
					shootableInSightCooldown = Mathf.MoveTowards(shootableInSightCooldown, 0f, Time.deltaTime * eid.totalSpeedModifier);
					return;
				}
				if (rai2)
				{
					Component obj2 = overrideTarget;
					Grenade val6 = (Grenade)(object)((obj2 is Grenade) ? obj2 : null);
					if (val6 != null && !val6.rocket && rcCooldown <= 0f && (Object)(object)currentWeapon != (Object)(object)Railcannons[2])
					{
						SwitchWeapon(Railcannons[2]);
						goto IL_0cd1;
					}
				}
				if ((rev0 || rev1 || rev2) && !Revolvers.Contains(currentWeapon))
				{
					List<WeaponInfo> list = new List<WeaponInfo>();
					if (rev0)
					{
						list.Add(Revolvers[0]);
					}
					if (rev1)
					{
						list.Add(Revolvers[1]);
					}
					if (rev2)
					{
						list.Add(Revolvers[2]);
					}
					SwitchWeapon(list[Random.Range(0, list.Count)]);
				}
				goto IL_0cd1;
			}
			shootableInSightCooldown = 0.25f;
			if (weaponSwapCooldown > 0f)
			{
				weaponSwapCooldown = Mathf.MoveTowards(weaponSwapCooldown, 0f, Time.deltaTime * (float)((!(currentWeapon.Weight <= 0f)) ? 1 : 2) * (float)((!(currentWeapon.AltWeight <= 0f)) ? 1 : 2));
			}
			else if (!currentWeapon.chargingAlt)
			{
				float num3 = Random.Range(0f, weapons.Sum((WeaponInfo w) => w.TotalWeight));
				foreach (WeaponInfo item in weapons.Where((WeaponInfo w) => w.TotalWeight > 0f))
				{
					if (num3 < item.TotalWeight)
					{
						weaponSwapCooldown = (((Object)(object)item == (Object)(object)currentWeapon) ? 2.5f : 7.5f);
						SwitchWeapon(item);
						break;
					}
					num3 -= item.TotalWeight;
				}
			}
			if (!Target.isEnemy && Traverse.Create((object)MonoSingleton<NewMovement>.Instance).Field("hurting").GetValue<bool>())
			{
				return;
			}
			if (currentWeapon.ReadyAlt && Random.Range(0f, currentWeapon.TotalWeight) < currentWeapon.AltWeight)
			{
				if ((Object)(object)currentWeapon == (Object)(object)Revolvers[1])
				{
					ThrowCoin();
				}
				else if ((Object)(object)currentWeapon == (Object)(object)Nailguns[0])
				{
					ShootMagnet();
				}
				else if ((Object)(object)currentWeapon == (Object)(object)RocketLaunchers[1])
				{
					PrepareCannonball();
				}
				else
				{
					currentWeapon.PrepareAltFire();
				}
			}
			else
			{
				if (!currentWeapon.Ready)
				{
					return;
				}
				if ((Object)(object)currentWeapon == (Object)(object)Railcannons[1])
				{
					ShootScrew();
				}
				else
				{
					currentWeapon.Fire();
				}
				if (Railcannons.Contains(currentWeapon))
				{
					rcCooldown = maxRcCooldown;
					if (rcCooldown > 0f)
					{
						weaponSwapCooldown = 0f;
					}
				}
				else if (RocketLaunchers.Contains(currentWeapon))
				{
					CollectionExtensions.Do<WeaponInfo>((IEnumerable<WeaponInfo>)RocketLaunchers, (Action<WeaponInfo>)delegate(WeaponInfo wi)
					{
						//IL_0006: Unknown result type (might be due to invalid IL or missing references)
						//IL_000b: Unknown result type (might be due to invalid IL or missing references)
						wi.timeSinceFired = TimeSince.op_Implicit(0f);
					});
				}
			}
			return;
			IL_0cd1:
			if (currentWeapon.Ready)
			{
				currentWeapon.Fire();
				weaponSwapCooldown = 0f;
				if (Railcannons.Contains(currentWeapon))
				{
					rcCooldown = maxRcCooldown;
				}
			}
			return;
			IL_035a:
			anim.SetLayerWeight(1, 0f);
			anim.SetLayerWeight(2, 0f);
			stepCooldown = 0.4f;
			goto IL_0387;
		}

		private void ThrowCoin()
		{
			//IL_0051: 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_0075: 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_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: 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)
			if ((Object)(object)currentWeapon == (Object)(object)Revolvers[1] && currentWeapon.ReadyAlt)
			{
				currentWeapon.PrepareAltFire(fake: true);
				IEnemyWeapon enemyWeapon = currentWeapon.EnemyWeapon;
				Object.Instantiate<GameObject>(((EnemyRevolver)((enemyWeapon is EnemyRevolver) ? enemyWeapon : null)).altBullet, aimAtTarget[0].position, aimAtTarget[0].rotation).GetComponent<Rigidbody>().AddForce(aimAtTarget[0].forward * 20f + Vector3.up * 15f + rb.velocity, (ForceMode)2);
			}
		}

		private void ShootMagnet()
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)currentWeapon == (Object)(object)Nailguns[0] && currentWeapon.ReadyAlt)
			{
				currentWeapon.PrepareAltFire(fake: true);
				IEnemyWeapon enemyWeapon = currentWeapon.EnemyWeapon;
				EnemyNailgun val = (EnemyNailgun)(object)((enemyWeapon is EnemyNailgun) ? enemyWeapon : null);
				GameObject val2 = Object.Instantiate<GameObject>(val.altNail, val.shootPoint.position, val.shootPoint.rotation);
				val2.GetComponent<Rigidbody>().AddForce(aimAtTarget[1].up * 100f, (ForceMode)2);
				NoCollide(val2.GetComponent<Collider>());
			}
		}

		private void PrepareCannonball()
		{
			if ((Object)(object)currentWeapon == (Object)(object)RocketLaunchers[1] && currentWeapon.ReadyAlt)
			{
				currentWeapon.PrepareAltFire(fake: true);
				((MonoBehaviour)this).Invoke("ShootCannonball", currentWeapon.prepareTimeAlt);
			}
		}

		private void ShootCannonball()
		{
			//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)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: 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)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			IEnemyWeapon enemyWeapon = currentWeapon.EnemyWeapon;
			EnemyRevolver val = (EnemyRevolver)(object)((enemyWeapon is EnemyRevolver) ? enemyWeapon : null);
			GameObject val2 = Object.Instantiate<GameObject>(val.altBullet, val.shootPoint.position + val.shootPoint.forward, val.shootPoint.rotation);
			val2.GetComponent<Rigidbody>().AddForce(aimAtTarget[1].up * 150f, (ForceMode)2);
			NoCollide(val2.GetComponent<Collider>());
		}

		private void ShootScrew()
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)currentWeapon == (Object)(object)Railcannons[1] && currentWeapon.Ready)
			{
				currentWeapon.Fire(fake: true);
				IEnemyWeapon enemyWeapon = currentWeapon.EnemyWeapon;
				EnemyRevolver val = (EnemyRevolver)(object)((enemyWeapon is EnemyRevolver) ? enemyWeapon : null);
				GameObject val2 = Object.Instantiate<GameObject>(val.bullet, val.shootPoint.position, val.shootPoint.rotation);
				val2.GetComponent<Rigidbody>().AddForce(aimAtTarget[1].up * 250f, (ForceMode)2);
				NoCollide(val2.GetComponent<Collider>());
			}
		}

		private void NoCollide(Collider other)
		{
			Collider[] componentsInChildren = ((Component)aimAtTarget[1]).GetComponentsInChildren<Collider>();
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				Physics.IgnoreCollision(componentsInChildren[i], other, true);
			}
		}

		private void FixedUpdate()
		{
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: 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_02ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c1: 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_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: 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_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0256: Unknown result type (might be due to invalid IL or missing references)
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_0265: Unknown result type (might be due to invalid IL or missing references)
			//IL_0268: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			if (slamming && gc.onGround)
			{
				slamParticles.SetActive(false);
				Object.Instantiate<GameObject>(slamHitEffect, ((Component)this).transform.position, Quaternion.Euler(90f, 0f, 0f)).SetActive(true);
				slamming = false;
			}
			if (Target != null)
			{
				if (Physics.Linecast(aimAtTarget[0].position, Target.position, LayerMask.GetMask(new string[2] { "Environment", "Outdoors" })))
				{
					((Behaviour)nma).enabled = true;
					nma.SetDestination(Target.position);
					SetSlide(state: false);
					return;
				}
				((Behaviour)nma).enabled = false;
				rb.isKinematic = false;
				if (dodgeLeft > 0f)
				{
					rb.useGravity = false;
					rb.velocity = ((Component)this).transform.forward * nma.speed * 3f;
					dodgeLeft = Mathf.MoveTowards(dodgeLeft, 0f, Time.deltaTime);
				}
				else if (sliding)
				{
					rb.useGravity = true;
					rb.velocity = (((Component)this).transform.forward * nma.speed * 1.5f).SetY(rb.velocity.y);
					slideScrape.SetActive(gc.onGround);
				}
				else if (gc.onGround)
				{
					rb.useGravity = false;
					rb.velocity = (((Component)this).transform.forward * nma.speed).SetY(rb.velocity.y);
				}
				else if (slamming)
				{
					rb.useGravity = false;
					rb.velocity = new Vector3(0f, -100f, 0f);
				}
				else
				{
					rb.useGravity = true;
					Rigidbody obj = rb;
					Vector3 val = ((Component)this).transform.forward.SetY(0f);
					obj.AddForce(((Vector3)(ref val)).normalized * airAcceleration * Time.deltaTime);
				}
			}
			else if (gc.onGround)
			{
				rb.velocity = Vector3.zero;
			}
			else
			{
				rb.velocity = Vector3.zero.SetY(rb.velocity.y);
			}
		}

		private void LateUpdate()
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: 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_0032: 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)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: 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_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: 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_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			if (Target != null)
			{
				Vector3 val = ((currentWeapon.chargingAlt ? currentWeapon.useGravityAlt : currentWeapon.useGravity) ? (-Extensions.Sqrt(Physics.gravity)) : Vector3.zero);
				Vector3 val2;
				Vector3 val3;
				if (shootableInSightCooldown <= 0f)
				{
					val2 = overrideTarget.transform.position;
					Rigidbody component = overrideTarget.GetComponent<Rigidbody>();
					val3 = ((component != null) ? component.velocity : Vector3.zero);
				}
				else
				{
					val2 = ((currentWeapon.chargingAlt ? currentWeapon.aimAtHeadAlt : currentWeapon.aimAtHead) ? Target.headPosition : Target.position);
					Rigidbody rigidbody = Target.rigidbody;
					val3 = ((rigidbody != null) ? rigidbody.velocity : Vector3.zero);
					val += ((!Target.isOnGround && (!Object.op_Implicit((Object)(object)Target.enemyIdentifier) || !Target.enemyIdentifier.flying)) ? Extensions.Sqrt(Physics.gravity) : Vector3.zero);
				}
				aimAtTarget[0].LookAt(Target.headPosition);
				aimAtTarget[1].LookAt(val2 + (val3 + val) * (currentWeapon.chargingAlt ? currentWeapon.AltPredictAmount : currentWeapon.PredictAmount));
				aimAtTarget[1].Rotate(Vector3.right, 90f, (Space)1);
				aimAtTarget[1].Rotate(Vector3.up, 180f, (Space)1);
			}
		}

		public void Jump()
		{
			//IL_008a: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: 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_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: 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_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_0224: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: 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_0231: Unknown result type (might be due to invalid IL or missing references)
			//IL_023b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ec: 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_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			if (!canJump || jumping)
			{
				return;
			}
			if (gc.onGround)
			{
				jumping = true;
				SetSlide(state: false);
				((MonoBehaviour)this).Invoke("NotJumping", 0.25f);
				anim.SetTrigger("Jump");
				anim.SetLayerWeight(1, 1f);
				anim.SetLayerWeight(2, 0f);
				if (sliding)
				{
					Object.Instantiate<GameObject>(jumpSound, ((Component)this).transform.position, Quaternion.identity);
					rb.AddForce(Vector3.up * jumpPower * 2f);
				}
				else if (dodgeLeft > 0f && stamina >= 1f)
				{
					Object.Instantiate<GameObject>(dashJumpSound);
					rb.AddForce(Vector3.up * jumpPower * 1.5f);
					stamina -= 1f;
				}
				else
				{
					Object.Instantiate<GameObject>(jumpSound, ((Component)this).transform.position, Quaternion.identity);
					rb.AddForce(Vector3.up * jumpPower * 2.5f);
				}
			}
			else if (wc.onGround && wallJumps > 0)
			{
				jumping = true;
				SetSlide(state: false);
				((MonoBehaviour)this).Invoke("NotJumping", 0.25f);
				Object.Instantiate<GameObject>(jumpSound, ((Component)this).transform.position, Quaternion.identity).GetComponent<AudioSource>().pitch = 1.75f - 0.25f * (float)wallJumps;
				if (wallJumps == 1)
				{
					Object.Instantiate<GameObject>(finalWallJumpSound, ((Component)this).transform.position, Quaternion.identity);
				}
				CheckPattern();
				rb.velocity = Vector3.zero;
				Rigidbody obj = rb;
				Vector3 val = ((Component)this).transform.position - wc.ClosestPoint();
				obj.AddForce(((Vector3)(ref val)).normalized.SetY(1f) * wallJumpPower);
				wallJumps--;
			}
		}

		private void CheckPattern()
		{
			if (!(patternCooldown <= 0f) || !(distancePatience < 4f) || currentPattern == 3)
			{
				return;
			}
			int num = Random.Range(0, 3);
			if (num == currentPattern)
			{
				patternCooldown = Random.Range(0.5f, 1f);
				if (currentPattern == 1)
				{
					circleTimer += 1f;
				}
			}
			else
			{
				patternCooldown = Random.Range(2, 5);
				SwitchPattern(num);
			}
			if (currentPattern == 1 || DistanceToTarget < 10f)
			{
				circleDirection = ((!((float)Random.Range(0, 1) > 0.5f)) ? 1 : (-1));
			}
		}

		private void ChangeDirection(Vector3 other)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due t