Decompiled source of Jade Harley V3Mod v0.1.0

V3Mod.dll

Decompiled a year 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 ULTRAKILL.Cheats;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.AddressableAssets;
using plog;
using plog.Models;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("V3Mod")]
[assembly: AssemblyConfiguration("Debug")]
[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 ConstInfo
	{
		public const string GUID = "JadeH.ULTRAKILL.V3Mod";

		public const string NAME = "V3Mod";

		public const string VERSION = "1.0.0";
	}
	public static class Extensions
	{
		public static Vector3 SetY(this Vector3 v, float y)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: 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)
			//IL_0016: 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_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			return ((Vector3)(ref v)).normalized * Mathf.Sqrt(((Vector3)(ref v)).magnitude);
		}

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

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

		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 ToHex(this Color clr)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			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 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_0021: 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_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0401: Unknown result type (might be due to invalid IL or missing references)
			//IL_041f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0424: Unknown result type (might be due to invalid IL or missing references)
			//IL_045a: Unknown result type (might be due to invalid IL or missing references)
			//IL_045f: Unknown result type (might be due to invalid IL or missing references)
			//IL_04aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_04dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a70: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d70: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d8b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0da6: Unknown result type (might be due to invalid IL or missing references)
			//IL_10cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_1112: Unknown result type (might be due to invalid IL or missing references)
			//IL_111c: Unknown result type (might be due to invalid IL or missing references)
			//IL_112e: Unknown result type (might be due to invalid IL or missing references)
			//IL_13a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_13b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_13cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_15ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_15b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_178a: Unknown result type (might be due to invalid IL or missing references)
			//IL_178f: Unknown result type (might be due to invalid IL or missing references)
			//IL_17cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_17d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_181b: Unknown result type (might be due to invalid IL or missing references)
			//IL_183c: Unknown result type (might be due to invalid IL or missing references)
			//IL_184e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1858: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e5b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e60: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e96: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e9b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1ee6: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f07: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f19: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f23: Unknown result type (might be due to invalid IL or missing references)
			Shader shader = 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.2f, 0.8f, 0.5f };
			Machine component3 = val.GetComponent<Machine>();
			component3.health = 100f;
			component3.specialDeath = false;
			component3.simpleDeath = true;
			NavMeshAgent component4 = val.GetComponent<NavMeshAgent>();
			component4.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 component5 = 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;
			GameObject val3 = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)"Assets/Models/Weapons/Revolver/Revolver_Rerigged_Standard.fbx").WaitForCompletion(), ((Component)val2).transform);
			((Component)val3.transform.GetChild(3)).gameObject.SetActive(false);
			Material v3PiercerMat = Addressables.LoadAssetAsync<Material>((object)"Assets/Models/Weapons/Revolver/Pistol New CustomColor.mat").WaitForCompletion();
			v3PiercerMat.shader = shader;
			CollectionExtensions.Do<SkinnedMeshRenderer>((IEnumerable<SkinnedMeshRenderer>)val3.GetComponentsInChildren<SkinnedMeshRenderer>(), (Action<SkinnedMeshRenderer>)delegate(SkinnedMeshRenderer smr)
			{
				((Renderer)smr).material = v3PiercerMat;
			});
			val3.transform.localPosition = new Vector3(6.3f, -2.8f, 0f);
			val3.transform.localRotation = Quaternion.Euler(340f, 270f, 0f);
			val3.transform.localScale = Vector3.one * 0.65f;
			val2.bullet = PrepareBeam(component5.revolverBeam, ((Component)weaponInfo4).gameObject);
			val2.altBullet = PrepareBeam(component5.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 val4 = val2.muzzleFlash.AddComponent<AudioSource>();
			PrepareAudio(val4);
			val4.clip = component5.gunShots.First();
			val4.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" });
			val4 = val2.muzzleFlashAlt.AddComponent<AudioSource>();
			PrepareAudio(val4);
			val4.clip = component5.superGunShots.First();
			val4.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;
			V3.Log.Info("Piercer made!", Array.Empty<Tag>());
			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 component6 = AddressablesExtensions.ToAsset(MonoSingleton<GunSetter>.Instance.revolverRicochet[0]).GetComponent<Revolver>();
			IEnemyWeapon enemyWeapon2 = weaponInfo4.EnemyWeapon;
			EnemyRevolver val5 = (EnemyRevolver)(object)((enemyWeapon2 is EnemyRevolver) ? enemyWeapon2 : null);
			val5.bullet = PrepareBeam(component6.revolverBeam, ((Component)weaponInfo4).gameObject);
			val5.altBullet = component6.coin;
			val5.muzzleFlash = ((Component)val5.bullet.transform.GetChild(0)).gameObject;
			((Component)val5.muzzleFlash.transform.GetChild(0)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			val4 = val5.muzzleFlash.AddComponent<AudioSource>();
			PrepareAudio(val4);
			val4.clip = component6.gunShots.First();
			val4.volume = 0.55f;
			val5.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;
			V3.Log.Info("Marksman made!", Array.Empty<Tag>());
			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 component7 = AddressablesExtensions.ToAsset(MonoSingleton<GunSetter>.Instance.revolverTwirl[0]).GetComponent<Revolver>();
			IEnemyWeapon enemyWeapon3 = weaponInfo4.EnemyWeapon;
			EnemyRevolver val6 = (EnemyRevolver)(object)((enemyWeapon3 is EnemyRevolver) ? enemyWeapon3 : null);
			val6.bullet = PrepareBeam(component7.revolverBeam, ((Component)weaponInfo4).gameObject);
			val6.altBullet = PrepareBeam(component7.revolverBeamSuper, ((Component)weaponInfo4).gameObject);
			val6.altBullet.GetComponent<RevolverBeam>().ricochetAmount = 3;
			val6.muzzleFlash = ((Component)val6.bullet.transform.GetChild(0)).gameObject;
			((Component)val6.muzzleFlash.transform.GetChild(0)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			val4 = val6.muzzleFlash.AddComponent<AudioSource>();
			PrepareAudio(val4);
			val4.clip = component7.gunShots.First();
			val4.volume = 0.55f;
			Transform child = val6.shootPoint.GetChild(0);
			val4 = ((Component)child).GetComponent<AudioSource>();
			val4.clip = component7.chargeEffect.GetComponent<AudioSource>().clip;
			val4.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;
			val6.muzzleFlashAlt = ((Component)val6.altBullet.transform.GetChild(0)).gameObject;
			((Component)val6.muzzleFlashAlt.transform.GetChild(0)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			val4 = val6.muzzleFlashAlt.AddComponent<AudioSource>();
			PrepareAudio(val4);
			val4.clip = component7.superGunShots.First();
			val4.volume = 0.5f;
			val4 = val6.muzzleFlashAlt.AddComponent<AudioSource>();
			PrepareAudio(val4);
			val4.clip = component7.twirlShotSound.GetComponent<AudioSource>().clip;
			val4.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;
			V3.Log.Info("Sharpshooter made!", Array.Empty<Tag>());
			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 val7 = (EnemyShotgun)(object)((enemyWeapon4 is EnemyShotgun) ? enemyWeapon4 : null);
			Transform val8 = Object.Instantiate<Transform>(((Component)component8).transform.GetChild(2), ((Component)val7).transform);
			((Component)((Component)val7).transform.GetChild(0)).gameObject.SetActive(false);
			((Component)((Component)val7).transform.GetChild(1)).gameObject.SetActive(false);
			((Component)((Component)val7).transform.GetChild(2)).gameObject.SetActive(false);
			((Behaviour)((Component)val8).GetComponent<Animator>()).enabled = false;
			((Behaviour)((Component)val8).GetComponent<ShotgunAnimationReceiver>()).enabled = false;
			((Component)val8.GetChild(0)).gameObject.SetActive(false);
			((Component)val8.GetChild(1)).gameObject.SetActive(false);
			((Component)val8.GetChild(2)).gameObject.SetActive(false);
			((Component)val8.GetChild(3)).gameObject.SetActive(false);
			((Component)val8.GetChild(4)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			((Behaviour)((Component)val8.GetChild(4)).GetComponent<GunColorGetter>()).enabled = false;
			((Renderer)((Component)val8.GetChild(4)).GetComponent<SkinnedMeshRenderer>()).material.shader = shader;
			val8.localScale = Vector3.one;
			val8.localRotation = Quaternion.Euler(90f, 0f, 0f);
			val8.localPosition = new Vector3(0f, -7.8f, 11f);
			val7.bullet = PrepareProjectile(component8.bullet, ((Component)weaponInfo4).gameObject);
			val7.grenade = PrepareGrenade(component8.grenade, ((Component)weaponInfo4).gameObject);
			val7.muzzleFlash = CreateClone(component8.muzzleFlash, ((Component)weaponInfo4).gameObject);
			((Component)val7.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;
			V3.Log.Info("Core Eject made!", Array.Empty<Tag>());
			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;
			EnemyShotgun val9 = (EnemyShotgun)(object)((enemyWeapon5 is EnemyShotgun) ? enemyWeapon5 : null);
			val9.bullet = PrepareProjectile(component9.bullet, ((Component)weaponInfo4).gameObject);
			val9.grenade = null;
			val9.muzzleFlash = CreateClone(component9.muzzleFlash, ((Component)weaponInfo4).gameObject);
			((Component)val9.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;
			V3.Log.Info("Pump Charge made!", Array.Empty<Tag>());
			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 val10 = (EnemyNailgun)(object)((enemyWeapon6 is EnemyNailgun) ? enemyWeapon6 : null);
			val10.toIgnore = Array.Empty<Collider>();
			val10.shootPoint.localScale = Vector3.one * 0.4f;
			((Component)val10).transform.localScale = Vector3.one;
			val8 = Object.Instantiate<Transform>(((Component)component10).transform.GetChild(0), ((Component)val10).transform);
			((Component)((Component)val10).transform.GetChild(0)).gameObject.SetActive(false);
			((Component)((Component)val10).transform.GetChild(1)).gameObject.SetActive(false);
			((Behaviour)((Component)val8).GetComponent<Animator>()).enabled = false;
			((Behaviour)((Component)val8).GetComponent<NailgunAnimationReceiver>()).enabled = false;
			((Component)val8.GetChild(0).GetChild(0).GetChild(0)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			((Behaviour)((Component)val8.GetChild(0).GetChild(0).GetChild(0)).GetComponent<GunColorGetter>()).enabled = false;
			((Renderer)((Component)val8.GetChild(0).GetChild(0).GetChild(0)).GetComponent<MeshRenderer>()).material.shader = shader;
			((Component)val8.GetChild(0).GetChild(0).GetChild(0)
				.GetChild(0)).gameObject.SetActive(false);
			((Component)val8.GetChild(0).GetChild(0).GetChild(1)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			((Behaviour)((Component)val8.GetChild(0).GetChild(0).GetChild(1)).GetComponent<GunColorGetter>()).enabled = false;
			((Renderer)((Component)val8.GetChild(0).GetChild(0).GetChild(1)).GetComponent<MeshRenderer>()).material.shader = shader;
			((Component)val8.GetChild(0).GetChild(0).GetChild(1)
				.GetChild(0)).gameObject.SetActive(false);
			((Component)val8.GetChild(0).GetChild(0).GetChild(2)).gameObject.SetActive(false);
			((Component)val8.GetChild(0).GetChild(0).GetChild(3)).gameObject.SetActive(false);
			((Component)val8.GetChild(0).GetChild(0).GetChild(4)).gameObject.SetActive(false);
			((Component)val8.GetChild(1)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			((Behaviour)((Component)val8.GetChild(1)).GetComponent<GunColorGetter>()).enabled = false;
			((Renderer)((Component)val8.GetChild(1)).GetComponent<SkinnedMeshRenderer>()).material.shader = shader;
			((Component)val8.GetChild(2)).gameObject.SetActive(false);
			((Component)val8.GetChild(3)).gameObject.SetActive(false);
			val8.localScale = Vector3.one * 0.5f;
			val8.localPosition = new Vector3(0f, 0.01f, 0.01f);
			val10.nail = PrepareNail(component10.nail, ((Component)weaponInfo4).gameObject);
			val10.altNail = CreateClone(component10.magnetNail, ((Component)weaponInfo4).gameObject);
			val10.muzzleFlash = CreateClone(component10.muzzleFlash, ((Component)weaponInfo4).gameObject);
			((Component)val10.muzzleFlash.transform.GetChild(0).GetChild(0)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			val4 = val10.muzzleFlash.GetComponent<AudioSource>();
			PrepareAudio(val4);
			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;
			V3.Log.Info("Attractor made!", Array.Empty<Tag>());
			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 val11 = (EnemyNailgun)(object)((enemyWeapon7 is EnemyNailgun) ? enemyWeapon7 : null);
			val11.toIgnore = Array.Empty<Collider>();
			val11.shootPoint.localScale = Vector3.one * 0.4f;
			val11.nail = PrepareNail(component11.nail, ((Component)weaponInfo4).gameObject);
			val11.altNail = PrepareNail(component11.heatedNail, ((Component)weaponInfo4).gameObject);
			val11.muzzleFlash = CreateClone(component11.muzzleFlash, ((Component)weaponInfo4).gameObject);
			((Component)val11.muzzleFlash.transform.GetChild(0).GetChild(0)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			val4 = val11.muzzleFlash.GetComponent<AudioSource>();
			PrepareAudio(val4);
			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;
			V3.Log.Info("Overheat made!", Array.Empty<Tag>());
			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 val12 = (EnemyRevolver)(object)((enemyWeapon8 is EnemyRevolver) ? enemyWeapon8 : null);
			((Renderer)((Component)val12).GetComponent<MeshRenderer>()).enabled = false;
			GameObject val13 = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)"Assets/Models/Weapons/Railcannon/Railgun.fbx").WaitForCompletion(), ((Component)val12).transform);
			((Component)val13.transform.GetChild(0).GetChild(0)).gameObject.SetActive(false);
			Material v3ElectricMat = Addressables.LoadAssetAsync<Material>((object)"Assets/Models/Weapons/Railcannon/Railcannon.mat").WaitForCompletion();
			v3ElectricMat.shader = shader;
			CollectionExtensions.Do<SkinnedMeshRenderer>((IEnumerable<SkinnedMeshRenderer>)val13.GetComponentsInChildren<SkinnedMeshRenderer>(), (Action<SkinnedMeshRenderer>)delegate(SkinnedMeshRenderer smr)
			{
				((Renderer)smr).material = v3ElectricMat;
			});
			val13.transform.localPosition = new Vector3(9f, 9f, 0f);
			val13.transform.localRotation = Quaternion.Euler(0f, 180f, 100f);
			val13.transform.localScale = Vector3.one * 10f;
			val12.bullet = PrepareBeam(component12.beam, ((Component)weaponInfo4).gameObject);
			val12.altBullet = null;
			val12.muzzleFlash = ((Component)val12.bullet.transform.GetChild(0)).gameObject;
			((Component)val12.muzzleFlash.transform.GetChild(0)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			val4 = val12.muzzleFlash.AddComponent<AudioSource>();
			PrepareAudio(val4);
			val4.clip = component12.fireSound.GetComponent<AudioSource>().clip;
			val4.volume = 0.65f;
			val12.muzzleFlashAlt = null;
			val4 = ((Component)val12).gameObject.AddComponent<AudioSource>();
			PrepareAudio(val4);
			val4.clip = component12.fullCharge.GetComponent<AudioSource>().clip;
			val4.volume = 0.35f;
			val4.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;
			V3.Log.Info("Electric made!", Array.Empty<Tag>());
			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;
			EnemyRevolver val14 = (EnemyRevolver)(object)((enemyWeapon9 is EnemyRevolver) ? enemyWeapon9 : null);
			val14.bullet = component13.beam;
			val14.altBullet = null;
			val14.muzzleFlash = ((Component)val14.bullet.transform.GetChild(0)).gameObject;
			val4 = val14.muzzleFlash.AddComponent<AudioSource>();
			PrepareAudio(val4);
			val4.clip = component13.fireSound.GetComponent<AudioSource>().clip;
			val4.volume = 0.65f;
			val14.muzzleFlashAlt = null;
			val4 = ((Component)val14).gameObject.GetComponent<AudioSource>();
			val4.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;
			V3.Log.Info("Screwdriver made!", Array.Empty<Tag>());
			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 val15 = (EnemyRevolver)(object)((enemyWeapon10 is EnemyRevolver) ? enemyWeapon10 : null);
			val15.bullet = PrepareBeam(component14.beam, ((Component)weaponInfo4).gameObject);
			val15.altBullet = null;
			val15.muzzleFlash = ((Component)val15.bullet.transform.GetChild(0)).gameObject;
			((Component)val15.muzzleFlash.transform.GetChild(0)).gameObject.layer = LayerMask.GetMask(new string[1] { "Default" });
			val4 = val15.muzzleFlash.AddComponent<AudioSource>();
			PrepareAudio(val4);
			val4.clip = component14.fireSound.GetComponent<AudioSource>().clip;
			val4.pitch = 3f;
			val15.muzzleFlashAlt = null;
			val4 = ((Component)val15).gameObject.GetComponent<AudioSource>();
			val4.clip = component14.fullCharge.GetComponent<AudioSource>().clip;
			val4.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;
			V3.Log.Info("Malicious made!", Array.Empty<Tag>());
			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 component15 = AddressablesExtensions.ToAsset(MonoSingleton<GunSetter>.Instance.rocketBlue[0]).GetComponent<RocketLauncher>();
			IEnemyWeapon enemyWeapon11 = weaponInfo4.EnemyWeapon;
			EnemyRevolver val16 = (EnemyRevolver)(object)((enemyWeapon11 is EnemyRevolver) ? enemyWeapon11 : null);
			((Renderer)((Component)val16).GetComponent<MeshRenderer>()).enabled = false;
			GameObject val17 = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)"Assets/Models/Weapons/RocketLauncher/RocketLauncher.fbx").WaitForCompletion(), ((Component)val16).transform);
			((Component)val17.transform.GetChild(0)).gameObject.SetActive(false);
			Material v3FreezeframeMat = Addressables.LoadAssetAsync<Material>((object)"Assets/Models/Weapons/RocketLauncher/RocketLauncher Unlit CustomColor.mat").WaitForCompletion();
			v3FreezeframeMat.shader = shader;
			CollectionExtensions.Do<SkinnedMeshRenderer>((IEnumerable<SkinnedMeshRenderer>)val17.GetComponentsInChildren<SkinnedMeshRenderer>(), (Action<SkinnedMeshRenderer>)delegate(SkinnedMeshRenderer smr)
			{
				((Renderer)smr).material = v3FreezeframeMat;
			});
			val17.transform.localPosition = new Vector3(8.5f, -5.5f, 0f);
			val17.transform.localRotation = Quaternion.Euler(0f, 180f, 125f);
			val17.transform.localScale = Vector3.one * 10f;
			val16.bullet = PrepareGrenade(component15.rocket, ((Component)weaponInfo4).gameObject);
			val16.altBullet = null;
			val16.muzzleFlash = CreateClone(component15.muzzleFlash, ((Component)weaponInfo4).gameObject);
			val4 = val16.muzzleFlash.AddComponent<AudioSource>();
			PrepareAudio(val4);
			val4.clip = ((Component)component15).GetComponent<AudioSource>().clip;
			val4.volume = 0.85f;
			val16.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;
			V3.Log.Info("Freezeframe made!", Array.Empty<Tag>());
			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 component16 = AddressablesExtensions.ToAsset(MonoSingleton<GunSetter>.Instance.rocketGreen[0]).GetComponent<RocketLauncher>();
			IEnemyWeapon enemyWeapon12 = weaponInfo4.EnemyWeapon;
			EnemyRevolver val18 = (EnemyRevolver)(object)((enemyWeapon12 is EnemyRevolver) ? enemyWeapon12 : null);
			val18.bullet = PrepareGrenade(component16.rocket, ((Component)weaponInfo4).gameObject);
			val18.altBullet = PrepareCannonball(((Component)component16.cannonBall).gameObject, ((Component)weaponInfo4).gameObject);
			val18.muzzleFlash = CreateClone(component16.muzzleFlash, ((Component)weaponInfo4).gameObject);
			val4 = val18.muzzleFlash.AddComponent<AudioSource>();
			PrepareAudio(val4);
			val4.clip = ((Component)component16).GetComponent<AudioSource>().clip;
			val4.volume = 0.85f;
			val18.muzzleFlashAlt = CreateClone(component16.muzzleFlash, ((Component)weaponInfo4).gameObject);
			val4 = val18.muzzleFlashAlt.AddComponent<AudioSource>();
			val4.clip = ((Component)component16).GetComponent<AudioSource>().clip;
			val4.volume = 0.85f;
			val4.pitch = 0.7f;
			PrepareAudio(val4);
			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;
			V3.Log.Info("S.R.S. Cannon made!", Array.Empty<Tag>());
			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_0011: Unknown result type (might be due to invalid IL or missing references)
				//IL_0021: Expected O, but got Unknown
				GameObject val23 = Extensions.InstantiateInactive(new GameObject(((Object)original).name + "(Parent)"), newParent.transform);
				return Object.Instantiate<GameObject>(original, val23.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_0012: Unknown result type (might be due to invalid IL or missing references)
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				GameObject val24 = CreateClone(beam, parent);
				RevolverBeam component21 = val24.GetComponent<RevolverBeam>();
				component21.beamType = (BeamType)3;
				component21.ignoreEnemyType = (EnemyType)8;
				component21.noMuzzleflash = true;
				component21.sourceWeapon = parent;
				return val24;
			}
			static GameObject PrepareCannonball(GameObject cb, GameObject parent)
			{
				GameObject val19 = CreateClone(cb, parent);
				Cannonball component17 = val19.GetComponent<Cannonball>();
				component17.sourceWeapon = parent;
				return val19;
			}
			static GameObject PrepareGrenade(GameObject grenade, GameObject parent)
			{
				GameObject val21 = CreateClone(grenade, parent);
				Grenade component19 = val21.GetComponent<Grenade>();
				component19.enemy = true;
				component19.sourceWeapon = parent;
				return val21;
			}
			static GameObject PrepareNail(GameObject nail, GameObject parent)
			{
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				GameObject val20 = CreateClone(nail, parent);
				Nail component18 = val20.GetComponent<Nail>();
				component18.enemy = true;
				component18.safeEnemyType = (EnemyType)8;
				component18.sourceWeapon = parent;
				return val20;
			}
			static GameObject PrepareProjectile(GameObject proj, GameObject parent)
			{
				//IL_0032: Unknown result type (might be due to invalid IL or missing references)
				GameObject val22 = CreateClone(proj, parent);
				Projectile component20 = val22.GetComponent<Projectile>();
				component20.damage *= 25f;
				component20.friendly = false;
				component20.playerBullet = false;
				component20.safeEnemyType = (EnemyType)8;
				component20.sourceWeapon = parent;
				return val22;
			}
		}

		public static SpawnableObject BuildV3Spawnable()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: 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_0111: 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].ToHex();
			string text2 = MonoSingleton<ColorBlindSettings>.Instance.variationColors[1].ToHex();
			string text3 = MonoSingleton<ColorBlindSettings>.Instance.variationColors[2].ToHex();
			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 the Shotguns as well as 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.ToHex() + ">(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", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		private void Awake()
		{
			//IL_0006: 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 v1.0.0 is loaded!");
		}
	}
	public class V3 : MonoBehaviour
	{
		public class BulletCheck : MonoBehaviour
		{
			private V3 v3;

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

			private void OnTriggerEnter(Collider other)
			{
				//IL_0065: 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_01a5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
				//IL_0106: Unknown result type (might be due to invalid IL or missing references)
				//IL_010b: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c1: 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_0139: Unknown result type (might be due to invalid IL or missing references)
				//IL_013e: 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_0143: Unknown result type (might be due to invalid IL or missing references)
				//IL_0255: Unknown result type (might be due to invalid IL or missing references)
				if (v3.Target == null)
				{
					return;
				}
				if (((Component)other).gameObject.layer == LayerMask.NameToLayer("Projectile"))
				{
					PhysicalShockwave component = ((Component)other).GetComponent<PhysicalShockwave>();
					Projectile component2 = ((Component)other).GetComponent<Projectile>();
					Nail component3 = ((Component)other).GetComponent<Nail>();
					if (Object.op_Implicit((Object)(object)component))
					{
						v3.Dodge(((Component)component).transform.position, away: false);
					}
					else if (!v3.eid.blessed && ((component2 != null) ? new EnemyType?(component2.safeEnemyType) : component3?.safeEnemyType) != (EnemyType?)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 component4 = ((Component)other).GetComponent<Explosion>();
					if (Object.op_Implicit((Object)(object)component4) && !component4.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"))
				{
					EnemyIdentifier val = ((Component)other).gameObject.GetComponent<EnemyIdentifier>() ?? ((Component)other).gameObject.GetComponent<EnemyIdentifierIdentifier>()?.eid;
					if ((Object)(object)val != (Object)(object)v3.eid && !v3.eid.blessed)
					{
						v3.Dodge(((Component)other).transform.position, away: true);
					}
				}
			}
		}

		public static readonly Logger Log = new Logger("V3Mod");

		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 readonly float healDist = 10f;

		private int prevPlayerHP = 100;

		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 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 float weaponSwapCooldown;

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

		private WeaponInfo currentWeapon;

		public Component overrideTarget;

		private Quaternion targetRot;

		public Transform[] aimAtTarget;

		private float shootableInSightCooldown = 0.5f;

		public float rcCharge;

		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));

		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 weaponInfo in array)
			{
				weaponInfo.UpdateBuffs();
				weaponInfo.SetActive(value: false);
			}
			weapons[0].weightCalc = (V3 v3) => 0f;
			weapons[0].weightCalcAlt = (V3 v3) => 1f;
			weapons[1].weightCalc = (V3 v3) => 0f;
			weapons[1].weightCalcAlt = (V3 v3) => 2f;
			weapons[2].weightCalc = (V3 v3) => 0f;
			weapons[2].weightCalcAlt = (V3 v3) => 1f;
			weapons[3].weightCalc = (V3 v3) => (v3.DistanceToTarget <= 20f) ? 2 : 0;
			weapons[3].weightCalcAlt = delegate(V3 v3)
			{
				float distanceToTarget = v3.DistanceToTarget;
				return (distanceToTarget > 6f && distanceToTarget <= 50f) ? 1 : 0;
			};
			weapons[4].weightCalc = (V3 v3) => (v3.DistanceToTarget <= 20f) ? 4 : 0;
			weapons[4].weightCalcAlt = (V3 v3) => 0f;
			weapons[5].weightCalc = (V3 v3) => (v3.DistanceToTarget <= 75f && !v3.eid.stuckMagnets.Any()) ? 4 : 0;
			weapons[5].weightCalcAlt = (V3 v3) => (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) => 0f;
			weapons[6].weightCalcAlt = (V3 v3) => 0f;
			weapons[7].weightCalc = (V3 v3) => (v3.rcCharge >= 1f) ? 10 : 0;
			weapons[7].weightCalcAlt = (V3 v3) => 0f;
			weapons[8].weightCalc = (V3 v3) => (v3.rcCharge >= 1f && v3.DistanceToTarget < 40f) ? 10 : 0;
			weapons[8].weightCalcAlt = (V3 v3) => 0f;
			weapons[9].weightCalc = (V3 v3) => (v3.rcCharge >= 1f && v3.DistanceToTarget > 13.5f) ? 10 : 0;
			weapons[9].weightCalcAlt = (V3 v3) => 0f;
			weapons[10].weightCalc = (V3 v3) => (v3.DistanceToTarget > (float)((v3.Target.isOnGround && (Target.enemyIdentifier == null || !Target.enemyIdentifier.flying)) ? 6 : 12) && v3.DistanceToTarget <= 30f && !v3.eid.stuckMagnets.Any() && !MonoSingleton<WeaponCharges>.Instance.rocketFrozen) ? 1 : 0;
			weapons[10].weightCalcAlt = (V3 v3) => 0f;
			weapons[11].weightCalc = (V3 v3) => (v3.DistanceToTarget > (float)((v3.Target.isOnGround && (Target.enemyIdentifier == null || !Target.enemyIdentifier.flying)) ? 6 : 12) && v3.DistanceToTarget <= 30f && !v3.eid.stuckMagnets.Any() && !MonoSingleton<WeaponCharges>.Instance.rocketFrozen) ? 1 : 0;
			weapons[11].weightCalcAlt = (V3 v3) => (v3.DistanceToTarget <= 75f) ? 5 : 0;
			SwitchWeapon(0);
		}

		private void Update()
		{
			//IL_00ce: 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_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_020c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0266: Unknown result type (might be due to invalid IL or missing references)
			//IL_0271: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cc: 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_07e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_07eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f8: 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_0808: Unknown result type (might be due to invalid IL or missing references)
			//IL_080d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0812: Unknown result type (might be due to invalid IL or missing references)
			//IL_0817: Unknown result type (might be due to invalid IL or missing references)
			//IL_0819: Unknown result type (might be due to invalid IL or missing references)
			//IL_081b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0606: Unknown result type (might be due to invalid IL or missing references)
			//IL_0611: Unknown result type (might be due to invalid IL or missing references)
			//IL_0616: Unknown result type (might be due to invalid IL or missing references)
			//IL_0620: Unknown result type (might be due to invalid IL or missing references)
			//IL_0625: Unknown result type (might be due to invalid IL or missing references)
			//IL_062a: Unknown result type (might be due to invalid IL or missing references)
			//IL_062f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0836: Unknown result type (might be due to invalid IL or missing references)
			//IL_0838: Unknown result type (might be due to invalid IL or missing references)
			//IL_0797: Unknown result type (might be due to invalid IL or missing references)
			//IL_079d: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07be: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c9: 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_067e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0683: Unknown result type (might be due to invalid IL or missing references)
			//IL_068d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0692: Unknown result type (might be due to invalid IL or missing references)
			//IL_0697: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_08cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0737: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_070e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0713: Unknown result type (might be due to invalid IL or missing references)
			//IL_0724: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bcf: Unknown result type (might be due to invalid IL or missing references)
			//IL_095b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0966: Unknown result type (might be due to invalid IL or missing references)
			//IL_09e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_09f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a69: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a26: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a31: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a3c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a41: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a48: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a4d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a52: Unknown result type (might be due to invalid IL or missing references)
			if (rcCharge < 1f)
			{
				rcCharge = Mathf.MoveTowards(rcCharge, 1f, Time.deltaTime / 16f);
			}
			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((rcCharge < 1f) ? MonoSingleton<ColorBlindSettings>.Instance.railcannonChargingColor : MonoSingleton<ColorBlindSettings>.Instance.railcannonFullColor);
				bhb.UpdateSecondaryBar(rcCharge);
			}
			if (!sliding && stamina < 3f)
			{
				int num = difficulty;
				if (1 == 0)
				{
				}
				float num2 = num switch
				{
					0 => 1.4f, 
					1 => 1.05f, 
					_ => 0.7f, 
				};
				if (1 == 0)
				{
				}
				float num3 = num2;
				stamina = Mathf.MoveTowards(stamina, 3f, num3 * Time.deltaTime);
			}
			anim.SetBool("InAir", !gc.onGround || dodgeLeft > 0f);
			DragBehind[] array = drags;
			foreach (DragBehind val in array)
			{
				val.active = !gc.onGround || dodgeLeft > 0f || sliding;
			}
			Vector3 val2 = rb.velocity.SetY(0f);
			if (!(((Vector3)(ref val2)).magnitude > 0f))
			{
				val2 = nma.velocity.SetY(0f);
				if (!(((Vector3)(ref val2)).magnitude > 0f))
				{
					goto IL_0399;
				}
			}
			if (!(dodgeLeft <= 0f) || !gc.onGround || sliding)
			{
				goto IL_0399;
			}
			float num4 = Quaternion.Angle(((Component)anim).transform.rotation, ((Component)this).transform.rotation);
			anim.SetLayerWeight(1, 1f);
			anim.SetLayerWeight(2, ((num4 <= 90f) ? num4 : (num4 - 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", num4 > 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_03ca;
			IL_0399:
			anim.SetLayerWeight(1, 0f);
			anim.SetLayerWeight(2, 0f);
			stepCooldown = 0.4f;
			goto IL_03ca;
			IL_03ca:
			if (mac.health < 10f)
			{
				foreach (Bloodsplatter item in from bs in Object.FindObjectsOfType<Bloodsplatter>()
					where Vector3.Distance(((Component)this).transform.position, ((Component)bs).transform.position) < healDist && bs.ready && bs.hpAmount > 0
					select bs)
				{
					Traverse val3 = Traverse.Create((object)item);
					if ((bool)val3.Field("canCollide").GetValue() && (int)val3.Field("eidID").GetValue() != ((Object)eid).GetInstanceID())
					{
						val3.Method("DisableCollider", Array.Empty<object>()).GetValue();
						mac.health = Mathf.MoveTowards(mac.health, 10f, (float)item.hpAmount / 10f);
					}
				}
				if (Vector3.Distance(((Component)this).transform.position, ((Component)MonoSingleton<NewMovement>.Instance).transform.position) < healDist && MonoSingleton<NewMovement>.Instance.hp < prevPlayerHP && !MonoSingleton<NewMovement>.Instance.exploded)
				{
					mac.health = Mathf.MoveTowards(mac.health, 10f, (float)(prevPlayerHP - MonoSingleton<NewMovement>.Instance.hp) / 10f);
				}
			}
			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 val4 = Quaternion.LookRotation(((Component)this).transform.forward, Vector3.up);
				Quaternion val5 = Quaternion.LookRotation(Target.position - ((Component)this).transform.position, Vector3.up);
				if (Quaternion.Angle(val4, val5) > 90f || (distancePatience >= 5f && Quaternion.Angle(val4, val5) > 45f))
				{
					if (slideStopTimer > 0f)
					{
						slideStopTimer = Mathf.MoveTowards(slideStopTimer, 0f, Time.deltaTime);
					}
					else
					{
						SetSlide(state: false);
					}
				}
			}
			if (dodgeLeft <= 0f)
			{
				CheckPattern();
				RaycastHit val6 = default(RaycastHit);
				if (!jumping && Physics.Raycast(((Component)this).transform.position + Vector3.up, Vector3.down, ref val6, float.PositiveInfinity, LayerMask.GetMask(new string[2] { "Environment", "Outdoors" })) && ((RaycastHit)(ref val6)).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 val7 = default(RaycastHit);
						if (Physics.Linecast(((Component)this).transform.position, wc.ClosestPoint(), ref val7, LayerMask.GetMask(new string[2] { "Environment", "Outdoors" })))
						{
							ChangeDirection(((Component)this).transform.position + Vector3.Reflect(wc.ClosestPoint() - ((Component)this).transform.position, ((RaycastHit)(ref val7)).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" })) && 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));
			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);
			if (Target.isPlayer && source2.Any((Grenade g) => g.playerRiding))
			{
				overrideTarget = (Component)(object)source2.First((Grenade g) => g.playerRiding);
			}
			else if (source.Any((Coin c) => !c.shot))
			{
				overrideTarget = (Component)(object)source.First((Coin c) => !c.shot);
			}
			else if (source3.Any())
			{
				overrideTarget = (Component)(object)source3.First();
			}
			else if (source2.Any())
			{
				overrideTarget = (Component)(object)source2.First();
			}
			else if (source4.Any())
			{
				overrideTarget = (Component)(object)source4.First();
			}
			else
			{
				overrideTarget = null;
			}
			if (Object.op_Implicit((Object)(object)overrideTarget))
			{
				if (shootableInSightCooldown > 0f)
				{
					shootableInSightCooldown = Mathf.MoveTowards(shootableInSightCooldown, 0f, Time.deltaTime * eid.totalSpeedModifier);
					return;
				}
				Component obj2 = overrideTarget;
				Grenade val8 = (Grenade)(object)((obj2 is Grenade) ? obj2 : null);
				if (val8 != null && !val8.rocket && rcCharge >= 1f && (Object)(object)currentWeapon != (Object)(object)weapons[9])
				{
					SwitchWeapon(Railcannons[2]);
				}
				else if (!Revolvers.Contains(currentWeapon))
				{
					int num5 = Random.Range(0, 3);
					if (1 == 0)
					{
					}
					int index = num5 switch
					{
						0 => 0, 
						1 => 3, 
						2 => 4, 
						_ => 0, 
					};
					if (1 == 0)
					{
					}
					SwitchWeapon(index);
				}
				if (currentWeapon.Ready)
				{
					currentWeapon.Fire();
					weaponSwapCooldown = 0f;
					if ((Object)(object)currentWeapon == (Object)(object)weapons[9])
					{
						rcCharge -= 1f;
					}
				}
				return;
			}
			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 num6 = Random.Range(0f, weapons.Sum((WeaponInfo w) => w.TotalWeight));
				foreach (WeaponInfo item2 in weapons.Where((WeaponInfo w) => w.TotalWeight > 0f))
				{
					if (num6 < item2.TotalWeight)
					{
						weaponSwapCooldown = (((Object)(object)item2 == (Object)(object)currentWeapon) ? 2.5f : 7.5f);
						SwitchWeapon(item2);
						break;
					}
					num6 -= item2.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))
				{
					rcCharge -= 1f;
					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);
					});
				}
			}
		}

		private void ThrowCoin()
		{
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: 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_0089: 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_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			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_0053: 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_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			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_001e: 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_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			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_0053: 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_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			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>();
			Collider[] array = componentsInChildren;
			foreach (Collider val in array)
			{
				Physics.IgnoreCollision(val, other, true);
			}
		}

		private void FixedUpdate()
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0308: Unknown result type (might be due to invalid IL or missing references)
			//IL_0313: Unknown result type (might be due to invalid IL or missing references)
			//IL_031d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: 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_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: 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_02a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b2: 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_02c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: 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_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: 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_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: 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_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: 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_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: 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);
			}
		}

		private void SwitchWeapon(int index)
		{
			if ((Object)(object)currentWeapon != (Object)(object)weapons[index])
			{
				currentWeapon = weapons[index];
				WeaponInfo[] array = weapons;
				foreach (WeaponInfo weaponInfo in array)
				{
					weaponInfo.SetActive(value: false);
				}
				weapons[index].SetActive(value: true);
				Log.Info($"Switched to {((Component)currentWeapon).gameObject}", Array.Empty<Tag>());
			}
		}

		private void SwitchWeapon(WeaponInfo weapon)
		{
			if ((Object)(object)currentWeapon != (Object)(object)weapon)
			{
				currentWeapon = weapon;
				WeaponInfo[] array = weapons;
				foreach (WeaponInfo weaponInfo in array)
				{
					weaponInfo.SetActive(value: false);
				}
				weapon.SetActive(value: true);
				Log.Info($"Switched to {((Component)currentWeapon).gameObject}", Array.Empty<Tag>());
			}
		}

		public void Jump()
		{
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: 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_024e: 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_0270: Unknown result type (might be due to invalid IL or missing references)
			//IL_0275: Unknown result type (might be due to invalid IL or missing references)
			//IL_027a: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0288: Unknown result type (might be due to invalid IL or missing references)
			//IL_0293: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: 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_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: 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)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			if (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);
				}
				Log.Info("Jumped!", Array.Empty<Tag>());
			}
			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--;
				Log.Info($"Walljumped!\n{wallJumps} walljumps remaining.", Array.Empty<Tag>());
			}
		}

		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));
			}
			Log.Info("Pattern checked!", Array.Empty<Tag>());
		}

		private void ChangeDirection(Vector3 other)
		{
			//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_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: 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_003f: Unknown result type (might be due to invalid IL or missing references)
			Quaternion rotation = ((Component)anim).transform.rotation;
			((Component)this).transform.LookAt(other.SetY(((Component)this).transform.position.y));
			((Component)anim).transform.rotation = rotation;
		}

		public void Slam()
		{
			if (!slamming)
			{
				SetSlide(state: false);
				slamming = true;
				slamParticles.SetActive(true);
				Log.Info("Did a slam!", Array.Empty<Tag>());
			}
		}

		public void Dodge(Vector3 direction, bool away)
		{
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: 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_0075: 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_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: 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)
			if (stamina >= 1f)
			{
				SetSlide(state: false);
				slamming = false;
				stamina -= 1f;
				dodgeLeft = 0.25f;
				eid.Bless(false);
				((MonoBehaviour)this).Invoke("UnBless", dodgeLeft);
				Vector3 val = ((!away) ? (direction - ((Component)this).transform.position) : (((Component)this).transform.position - direction));
				ChangeDirection(((Component)this).transform.position + val);
				Object.Instantiate<GameObject>(dodgeParticles, ((Component)this).transform).SetActive(true);
				anim.SetTrigger("Jump");
				Log.Info($"Dodged!\nStamina is now {stamina}.", Array.Empty<Tag>());
			}
		}

		private void UnBless()
		{
			eid.Unbless(false);
		}

		private void NotJumping()
		{
			jumping = false;
		}

		private void SetSlide(bool state)
		{
			if (sliding != state)
			{
				sliding = state;
				anim.SetBool("Sliding", state);
				slideParticles.SetActive(state);
				if (state)
				{
					Log.Info("Started sliding!", Array.Empty<Tag>());
					slideStopTimer = 0.2f;
				}
				else
				{
					slideScrape.SetActive(false);
					Log.Info("Stopped sliding!", Array.Empty<Tag>());
					CheckPattern();
				}
			}
		}

		public void SwitchPattern(int pattern)
		{
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			if (currentPattern == pattern)
			{
				return;
			}
			prevPattern = currentPattern;
			currentPattern = pattern;
			if ((Object)(object)currentWingChangeEffect != (Object)null)
			{
				Object.Destroy((Object)(object)currentWingChangeEffect);
			}
			EnemySimplifier[] array = ensims;
			EnemySimplifier[] array2 = array;
			foreach (EnemySimplifier val in array2)
			{
				if (val.matList != null && val.matList.Length > 1)
				{
					val.matList[1].mainTexture = wingTextures[pattern];
				}
			}
			currentWingChangeEffect = Object.Instantiate<GameObject>(win