Decompiled source of Play as V2 v2.4.2

v2Ultrakill/v2Ultrakill.dll

Decompiled 2 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using TMPro;
using ULTRAKILL.Cheats;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("v2Ultrakill")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Play as V2 from ULTRAKILL in the hit game ULTRAKILL.")]
[assembly: AssemblyFileVersion("2.4.2.0")]
[assembly: AssemblyInformationalVersion("2.4.2")]
[assembly: AssemblyProduct("Play as V2")]
[assembly: AssemblyTitle("v2Ultrakill")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("2.4.2.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 v2Ultrakill
{
	[BepInPlugin("v2Ultrakill", "Play as V2", "2.4.2")]
	public class MainStuff : BaseUnityPlugin
	{
		private static readonly Harmony harmony = new Harmony("v2UltrakillMainStuff");

		private static AssetBundle funnyAssets;

		internal static ManualLogSource Logger;

		private static ConfigEntry<bool> modFirstTimeTutorial;

		private GameObject firstTimePopup;

		private static bool isPatched;

		private static bool tutorialCheck;

		private static bool s5Check;

		private static bool p1Check;

		private static float bloodTank;

		private static float bloodTankTimer;

		private static bool bloodTankActivated;

		private static int playerDamage;

		private static bool shouldaDied;

		private static readonly GameObject[] hpBars = (GameObject[])(object)new GameObject[4];

		private static readonly GameObject[] afterImageBars = (GameObject[])(object)new GameObject[4];

		private static readonly GameObject[] hpRings = (GameObject[])(object)new GameObject[4];

		private static readonly GameObject[] afterImageRings = (GameObject[])(object)new GameObject[4];

		private static GameObject bloodTankGUI;

		private static Slider bloodTankActualSlider;

		private static GameObject bloodTankSliderText;

		private static GameObject bloodTankAltGUI;

		private static GameObject bloodTankAltGUIText;

		private static GameObject bloodTankAlt2GUI;

		private static GameObject bloodTankAlt2GUIText;

		private static InputManager inman;

		private static int currentVarNum;

		private static List<GameObject> spawnedArms;

		private static GameObject feedbacker;

		private static bool kbPunch;

		private static int revolverShotNumber;

		private static float revolverTimer;

		private static float shootCharge;

		private static int dualWieldCount;

		private static bool altFireShot;

		private static int rocketShotNumber;

		private static float rocketTimer;

		private static bool rocketOverheated;

		private static GameObject overheatGameObject;

		private static AudioSource overheatAudio;

		private static ParticleSystem overheatParticles;

		private static SkinnedMeshRenderer v2Renderer;

		private static EnemySimplifier enemySimplifier;

		private static bool recharging;

		private static float heatResistance;

		private static float rechargeSpeed;

		private static float difficultySpeedModifier;

		private static TimeSince hurtTimer;

		private static Slider meter;

		private static TMP_Text meterPercentage;

		private static Image greenFlash;

		private static TMP_Text meterLabel;

		private static Image screenShatter;

		private static GameObject hurtingSound;

		private static bool gotHp;

		private static int encoreHp;

		private static bool resetTimer;

		private static ConfigEntry<bool> bloodTankEnabled;

		private static ConfigEntry<KeyCode> bloodTankKeybind;

		private static ConfigEntry<bool> bloodTankGUIsEnabled;

		private static ConfigEntry<Color> bloodTankGUIColor;

		private static ConfigEntry<bool> bloodTankHUDsEnabled;

		private static ConfigEntry<Color> hp100Color;

		private static ConfigEntry<Color> hp200Color;

		private static ConfigEntry<Color> hp300Color;

		private static ConfigEntry<Color> hp400Color;

		private static ConfigEntry<Color> afterHp100Color;

		private static ConfigEntry<Color> afterHp200Color;

		private static ConfigEntry<Color> afterHp300Color;

		private static ConfigEntry<Color> afterHp400Color;

		private void Awake()
		{
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_023a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0272: Unknown result type (might be due to invalid IL or missing references)
			//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
			((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
			funnyAssets = AssetBundle.LoadFromFile(Path.Combine(ModPath(), "funnyassets"));
			Logger = ((BaseUnityPlugin)this).Logger;
			Logger.LogInfo((object)"Plugin v2Ultrakill, version 2.4.2, is loaded. You can now play as V2.");
			new Harmony("v2UltrakillSaveFileStuff").PatchAll(typeof(SaveFileStuff));
			modFirstTimeTutorial = ((BaseUnityPlugin)this).Config.Bind<bool>("Miscellaneous", "Mod Tutorial", false, "Whether or not the player has seen the initial tutorial for how to fully use the mod.\r\nIf you've found this config option and this description, you don't need to touch this setting.");
			bloodTankEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Blood Tank", "Blood Tank Enabled", true, "Toggles whether or not the Blood Tank, a reservoir of blood that can be used to regenerate health between combat encounters, is enabled.");
			bloodTankKeybind = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Blood Tank", "Blood Tank Keybind", (KeyCode)116, "Keybind to start and/or stop health regeneration from the Blood Tank.");
			bloodTankGUIsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Blood Tank", "Blood Tank GUIs", true, "Toggles whether or not GUIs indicating how full the Blood Tank is are enabled.\r\nGUIs only appear if Blood Tank is enabled.");
			bloodTankGUIColor = ((BaseUnityPlugin)this).Config.Bind<Color>("Blood Tank", "Blood Tank Meter Color", new Color(0.35f, 0f, 0f, 1f), "Color of the meter used by the Standard GUI to indicate how full the Blood Tank is.");
			bloodTankHUDsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Blood Tank", "Blood Tank HUDs", true, "Toggles whether or not HUDs indicating when the Blood Tank is activated or deactivated, voluntarily or otherwise, are enabled.\r\nHUDs only appear if Blood Tank is enabled.");
			hp100Color = ((BaseUnityPlugin)this).Config.Bind<Color>("Colors", "Health 1", new Color(1f, 0f, 0f, 1f), "Sets the color of the first standard and crosshair healthbars (1-100 HP).");
			hp200Color = ((BaseUnityPlugin)this).Config.Bind<Color>("Colors", "Health 2", new Color(1f, 0.5882f, 0f, 1f), "Sets the color of the second standard and crosshair healthbars (101-200 HP).");
			hp300Color = ((BaseUnityPlugin)this).Config.Bind<Color>("Colors", "Health 3", new Color(1f, 1f, 0f, 1f), "Sets the color of the third standard and crosshair healthbars (201-300 HP).");
			hp400Color = ((BaseUnityPlugin)this).Config.Bind<Color>("Colors", "Health 4", new Color(0f, 1f, 0f, 1f), "Sets the color of the fourth standard and crosshair healthbars (301-400 HP).");
			afterHp100Color = ((BaseUnityPlugin)this).Config.Bind<Color>("Colors", "Soft Damage 1", new Color(1f, 0.3922f, 0f, 1f), "Sets the color of the first standard and crosshair soft damage bars (1-100 HP).");
			afterHp200Color = ((BaseUnityPlugin)this).Config.Bind<Color>("Colors", "Soft Damage 2", new Color(1f, 0.3922f, 0f, 1f), "Sets the color of the second standard and crosshair soft damage bars (101-200 HP).");
			afterHp300Color = ((BaseUnityPlugin)this).Config.Bind<Color>("Colors", "Soft Damage 3", new Color(1f, 0.3922f, 0f, 1f), "Sets the color of the third standard and crosshair soft damage bars (201-300 HP).");
			afterHp400Color = ((BaseUnityPlugin)this).Config.Bind<Color>("Colors", "Soft Damage 4", new Color(1f, 0.3922f, 0f, 1f), "Sets the color of the fourth standard and crosshair soft damage bars (301-400 HP).");
		}

		private static string ModPath()
		{
			return Assembly.GetExecutingAssembly().Location.Substring(0, Assembly.GetExecutingAssembly().Location.LastIndexOf(Path.DirectorySeparatorChar));
		}

		private void Start()
		{
			SceneManager.sceneLoaded += OnSceneLoaded;
		}

		private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
		{
			if (((Scene)(ref scene)).name == "b3e7f2f8052488a45b35549efb98d902" && !modFirstTimeTutorial.Value)
			{
				FirstTimePopup();
			}
			if (isPatched)
			{
				tutorialCheck = false;
				s5Check = false;
				p1Check = false;
				if (((Scene)(ref scene)).name == "4f8ecffaa98c2614f89922daf31fa22d")
				{
					tutorialCheck = true;
				}
				if (((Scene)(ref scene)).name == "1567f75bc4488644684d7a25471dbe95")
				{
					s5Check = true;
				}
				if (((Scene)(ref scene)).name == "005a4f2ce549277458596ee0f0d6e88c")
				{
					p1Check = true;
				}
			}
		}

		private void FirstTimePopup()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: 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_008e: 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_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Expected O, but got Unknown
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Expected O, but got Unknown
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_0248: Expected O, but got Unknown
			//IL_028c: 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_02ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_02db: Unknown result type (might be due to invalid IL or missing references)
			//IL_032f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0336: Expected O, but got Unknown
			//IL_038c: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0435: Unknown result type (might be due to invalid IL or missing references)
			//IL_0497: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f2: Expected O, but got Unknown
			//IL_0548: Unknown result type (might be due to invalid IL or missing references)
			//IL_055f: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05be: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0618: 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_063b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0645: Expected O, but got Unknown
			//IL_0690: Unknown result type (might be due to invalid IL or missing references)
			//IL_0708: Unknown result type (might be due to invalid IL or missing references)
			//IL_0732: Unknown result type (might be due to invalid IL or missing references)
			firstTimePopup = new GameObject("V2 First Time Popup");
			firstTimePopup.transform.position = new Vector3(960f, 540f, 0f);
			firstTimePopup.layer = 5;
			Canvas val = firstTimePopup.AddComponent<Canvas>();
			CanvasScaler val2 = firstTimePopup.AddComponent<CanvasScaler>();
			firstTimePopup.AddComponent<GraphicRaycaster>();
			val.additionalShaderChannels = (AdditionalCanvasShaderChannels)(val.additionalShaderChannels | 1);
			val.additionalShaderChannels = (AdditionalCanvasShaderChannels)(val.additionalShaderChannels | 8);
			val.additionalShaderChannels = (AdditionalCanvasShaderChannels)(val.additionalShaderChannels | 0x10);
			val.renderMode = (RenderMode)0;
			val.scaleFactor = 1.5f;
			val.sortingOrder = 41;
			val2.matchWidthOrHeight = 0.5f;
			val2.referenceResolution = new Vector2(1280f, 720f);
			val2.screenMatchMode = (ScreenMatchMode)1;
			val2.uiScaleMode = (ScaleMode)1;
			GameObject val3 = new GameObject("Blocker");
			val3.transform.SetParent(firstTimePopup.transform, false);
			val3.layer = 5;
			RectTransform val4 = val3.AddComponent<RectTransform>();
			CanvasRenderer val5 = val3.AddComponent<CanvasRenderer>();
			Image val6 = val3.AddComponent<Image>();
			val4.sizeDelta = new Vector2(4000f, 2250f);
			val5.cullTransparentMesh = false;
			((Graphic)val6).color = new Color(0f, 0f, 0f, 0.3f);
			GameObject val7 = new GameObject("Popup Contents");
			val7.transform.SetParent(firstTimePopup.transform, false);
			val7.layer = 5;
			RectTransform val8 = val7.AddComponent<RectTransform>();
			CanvasRenderer val9 = val7.AddComponent<CanvasRenderer>();
			Image val10 = val7.AddComponent<Image>();
			val7.AddComponent<HudOpenEffect>();
			val8.sizeDelta = new Vector2(400f, 600f);
			val9.cullTransparentMesh = false;
			((Graphic)val10).color = new Color(0f, 0f, 0f, 0.8f);
			val10.overrideSprite = funnyAssets.LoadAsset<Sprite>("Round_VertHandle_Invert 1");
			val10.pixelsPerUnitMultiplier = 2f;
			val10.sprite = funnyAssets.LoadAsset<Sprite>("Round_VertHandle_Invert 1");
			val10.type = (Type)1;
			GameObject val11 = new GameObject("Image");
			val11.transform.SetParent(val7.transform, false);
			val11.layer = 5;
			RectTransform val12 = val11.AddComponent<RectTransform>();
			val11.AddComponent<CanvasRenderer>();
			Image val13 = val11.AddComponent<Image>();
			val12.anchorMax = new Vector2(1f, 1f);
			val12.anchorMin = new Vector2(0f, 0f);
			val12.sizeDelta = new Vector2(20f, 20f);
			((Graphic)val13).color = new Color(0f, 0f, 0f, 0.8f);
			val13.overrideSprite = funnyAssets.LoadAsset<Sprite>("Round_BorderLarge");
			val13.pixelsPerUnitMultiplier = 2f;
			val13.sprite = funnyAssets.LoadAsset<Sprite>("Round_BorderLarge");
			val13.type = (Type)1;
			GameObject val14 = new GameObject("Text1");
			val14.transform.SetParent(val7.transform, false);
			val14.layer = 5;
			RectTransform val15 = val14.AddComponent<RectTransform>();
			CanvasRenderer val16 = val14.AddComponent<CanvasRenderer>();
			TextMeshProUGUI val17 = val14.AddComponent<TextMeshProUGUI>();
			val14.AddComponent<HudOpenEffect>();
			val16.cullTransparentMesh = false;
			val15.anchorMax = new Vector2(1f, 1f);
			val15.anchorMin = new Vector2(0f, 1f);
			val15.pivot = new Vector2(0.5f, 1f);
			val15.sizeDelta = new Vector2(0f, 80f);
			((TMP_Text)val17).alignment = (TextAlignmentOptions)514;
			((TMP_Text)val17).font = funnyAssets.LoadAsset<TMP_FontAsset>("VCR_OSD_MONO_1");
			((TMP_Text)val17).horizontalAlignment = (HorizontalAlignmentOptions)2;
			((TMP_Text)val17).text = "WELCOME";
			((Graphic)val17).raycastTarget = false;
			((Graphic)val17).color = new Color(1f, 0f, 0f, 1f);
			((TMP_Text)val17).fontSize = 60f;
			GameObject val18 = Object.Instantiate<GameObject>(val14);
			val18.transform.SetParent(val7.transform, false);
			val18.layer = 5;
			((Object)val18).name = "Text2";
			val18.transform.localPosition = new Vector3(0f, 79f, 0f);
			TextMeshProUGUI component = val18.GetComponent<TextMeshProUGUI>();
			((Graphic)component).color = new Color(1f, 1f, 1f, 1f);
			((TMP_Text)component).fontSize = 16f;
			((TMP_Text)component).text = "to the <color=#AF190F>Play as V2</color> mod. This message being here means the mod has been <color=green>successfully installed!</color>\r\n\r\nThis mod runs in a newly created and unique save slot. Navigate to OPTIONS > SAVES, then select the slot titled <color=#AF190F>\"Updated Slot (Ver. 2)\"</color> to begin playing.\r\n\r\nThe mod is compatible with custom level loaders, although full compatibility per individual level is not guaranteed.\r\n\r\nCertain features of the mod can be customized via Configgy or your mod manager's config editor.\r\n\r\nThis mod disables Cybergrind and level score submissions.\r\n\r\nIf you would like to use this mod for content creation, please provide a link to the mod and credit KingOfKretaceous.";
			GameObject val19 = new GameObject("Close Button");
			val19.transform.SetParent(val7.transform, false);
			val19.layer = 5;
			RectTransform val20 = val19.AddComponent<RectTransform>();
			CanvasRenderer val21 = val19.AddComponent<CanvasRenderer>();
			Image val22 = val19.AddComponent<Image>();
			val19.AddComponent<HudOpenEffect>();
			Button val23 = val19.AddComponent<Button>();
			val20.anchoredPosition = new Vector2(0f, -210f);
			val20.sizeDelta = new Vector2(320f, 100f);
			val21.cullTransparentMesh = false;
			val22.overrideSprite = funnyAssets.LoadAsset<Sprite>("Round_BorderLarge");
			val22.pixelsPerUnitMultiplier = 4.05f;
			val22.sprite = funnyAssets.LoadAsset<Sprite>("Round_BorderLarge");
			val22.type = (Type)1;
			ColorBlock colors = ((Selectable)val23).colors;
			((ColorBlock)(ref colors)).highlightedColor = new Color(0.5094f, 0.5094f, 0.5094f, 1f);
			((ColorBlock)(ref colors)).pressedColor = new Color(1f, 0f, 0f, 1f);
			((ColorBlock)(ref colors)).selectedColor = new Color(0.5094f, 0.5094f, 0.5094f, 1f);
			((Selectable)val23).colors = colors;
			((UnityEvent)val23.onClick).AddListener(new UnityAction(CloseFirstTimePopup));
			GameObject val24 = Object.Instantiate<GameObject>(val18);
			val24.transform.SetParent(val19.transform, false);
			val24.layer = 5;
			((Object)val24).name = "ButtonText";
			val24.transform.localPosition = new Vector3(0f, 42f, 0f);
			TextMeshProUGUI component2 = val24.GetComponent<TextMeshProUGUI>();
			((TMP_Text)component2).fontSize = 40f;
			((TMP_Text)component2).text = "CLOSE";
			GameObject val25 = Object.Instantiate<GameObject>(val18);
			val25.transform.SetParent(val7.transform, false);
			val25.layer = 5;
			((Object)val25).name = "Text3";
			val25.transform.localPosition = new Vector3(0f, -239f, 0f);
			TextMeshProUGUI component3 = val25.GetComponent<TextMeshProUGUI>();
			((Graphic)component3).color = new Color(1f, 0f, 0f, 1f);
			((TMP_Text)component3).fontSize = 12f;
			((TMP_Text)component3).text = "This message will not appear again after being closed.";
			modFirstTimeTutorial.Value = true;
		}

		private void CloseFirstTimePopup()
		{
			firstTimePopup.SetActive(false);
		}

		private void Update()
		{
		}

		public static void SaveSlotPatchChecker(bool coolSlot)
		{
			if (isPatched != coolSlot)
			{
				if (coolSlot)
				{
					harmony.PatchAll(typeof(MainStuff));
				}
				else
				{
					harmony.UnpatchSelf();
				}
				isPatched = coolSlot;
			}
		}

		[HarmonyPatch(typeof(MainStuff), "Update")]
		[HarmonyPostfix]
		private static void UpdatePatches()
		{
			//IL_0040: 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_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: 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_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_024c: 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)
			//IL_0297: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cf: 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_0856: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)hpBars[3] != (Object)null)
			{
				((Graphic)((Component)hpBars[0].transform.Find("Fill Area").Find("Fill")).GetComponent<Image>()).color = hp100Color.Value;
				((Graphic)((Component)hpBars[1].transform.Find("Fill Area").Find("Fill")).GetComponent<Image>()).color = hp200Color.Value;
				((Graphic)((Component)hpBars[2].transform.Find("Fill Area").Find("Fill")).GetComponent<Image>()).color = hp300Color.Value;
				((Graphic)((Component)hpBars[3].transform.Find("Fill Area").Find("Fill")).GetComponent<Image>()).color = hp400Color.Value;
			}
			if ((Object)(object)hpRings[3] != (Object)null)
			{
				((Graphic)hpRings[0].GetComponent<Image>()).color = hp100Color.Value;
				((Graphic)hpRings[1].GetComponent<Image>()).color = hp200Color.Value;
				((Graphic)hpRings[2].GetComponent<Image>()).color = hp300Color.Value;
				((Graphic)hpRings[3].GetComponent<Image>()).color = hp400Color.Value;
			}
			if ((Object)(object)afterImageBars[3] != (Object)null)
			{
				((Graphic)((Component)afterImageBars[0].transform.Find("Fill Area").Find("Fill")).GetComponent<Image>()).color = afterHp100Color.Value;
				((Graphic)((Component)afterImageBars[1].transform.Find("Fill Area").Find("Fill")).GetComponent<Image>()).color = afterHp200Color.Value;
				((Graphic)((Component)afterImageBars[2].transform.Find("Fill Area").Find("Fill")).GetComponent<Image>()).color = afterHp300Color.Value;
				((Graphic)((Component)afterImageBars[3].transform.Find("Fill Area").Find("Fill")).GetComponent<Image>()).color = afterHp400Color.Value;
			}
			if ((Object)(object)afterImageRings[3] != (Object)null)
			{
				((Graphic)afterImageRings[0].GetComponent<Image>()).color = afterHp100Color.Value;
				((Graphic)afterImageRings[1].GetComponent<Image>()).color = afterHp200Color.Value;
				((Graphic)afterImageRings[2].GetComponent<Image>()).color = afterHp300Color.Value;
				((Graphic)afterImageRings[3].GetComponent<Image>()).color = afterHp400Color.Value;
			}
			if (bloodTankEnabled.Value && bloodTankGUIsEnabled.Value)
			{
				int value = Traverse.Create((object)MonoSingleton<PlayerActivatorRelay>.Instance).Field("index").GetValue<int>();
				if (!s5Check)
				{
					if ((Object)(object)bloodTankGUI != (Object)null && !bloodTankGUI.activeSelf && value >= 9)
					{
						bloodTankGUI.SetActive(true);
					}
					if ((Object)(object)bloodTankAltGUI != (Object)null && !bloodTankAltGUI.activeSelf)
					{
						bloodTankAltGUI.SetActive(true);
					}
					if ((Object)(object)bloodTankAlt2GUI != (Object)null && !bloodTankAlt2GUI.activeSelf)
					{
						bloodTankAlt2GUI.SetActive(true);
					}
				}
				if ((Object)(object)bloodTankGUI != (Object)null && bloodTankGUI.activeSelf)
				{
					((Graphic)((Selectable)bloodTankActualSlider).image).color = bloodTankGUIColor.Value;
					if (Time.timeScale != 0f)
					{
						bloodTankActualSlider.value = bloodTank;
						((TMP_Text)bloodTankSliderText.GetComponent<TextMeshProUGUI>()).text = Mathf.RoundToInt(bloodTank) + "%";
					}
				}
				if ((Object)(object)bloodTankAltGUI != (Object)null && bloodTankAltGUI.activeSelf && Time.timeScale != 0f)
				{
					((TMP_Text)bloodTankAltGUIText.GetComponent<TextMeshProUGUI>()).text = Mathf.RoundToInt(bloodTank) + "%";
				}
				if ((Object)(object)bloodTankAlt2GUI != (Object)null && bloodTankAlt2GUI.activeSelf && Time.timeScale != 0f)
				{
					((TMP_Text)bloodTankAlt2GUIText.GetComponent<TextMeshProUGUI>()).text = Mathf.RoundToInt(bloodTank) + "%";
				}
			}
			else if (!bloodTankEnabled.Value || !bloodTankGUIsEnabled.Value)
			{
				if ((Object)(object)bloodTankGUI != (Object)null && bloodTankGUI.activeSelf)
				{
					bloodTankGUI.SetActive(false);
				}
				if ((Object)(object)bloodTankAltGUI != (Object)null && bloodTankAltGUI.activeSelf)
				{
					bloodTankAltGUI.SetActive(false);
				}
				if ((Object)(object)bloodTankAlt2GUI != (Object)null && bloodTankAlt2GUI.activeSelf)
				{
					bloodTankAlt2GUI.SetActive(false);
				}
			}
			if (Time.timeScale == 0f)
			{
				return;
			}
			if (NoWeaponCooldown.NoCooldown)
			{
				revolverShotNumber = 0;
				rocketShotNumber = 0;
			}
			if ((Object)(object)MonoSingleton<GunControl>.Instance != (Object)null)
			{
				dualWieldCount = MonoSingleton<GunControl>.Instance.dualWieldCount + 1;
			}
			revolverTimer += 200f * Time.deltaTime;
			if (!altFireShot)
			{
				if (shootCharge != 100f)
				{
					if (revolverShotNumber < dualWieldCount * 3)
					{
						if (shootCharge + 575f * Time.deltaTime < 100f)
						{
							shootCharge += 575f * Time.deltaTime;
						}
						else
						{
							shootCharge = 100f;
						}
					}
					else if (shootCharge + 75f * Time.deltaTime < 100f)
					{
						shootCharge += 75f * Time.deltaTime;
					}
					else
					{
						shootCharge = 100f;
						revolverShotNumber = 0;
					}
				}
				if (dualWieldCount != 0 && revolverTimer >= (float)(revolverShotNumber * 100 / dualWieldCount))
				{
					revolverTimer = 0f;
					if (revolverShotNumber < dualWieldCount * 3)
					{
						revolverShotNumber = 0;
					}
				}
			}
			else if (revolverTimer >= 170f)
			{
				revolverTimer = 0f;
				revolverShotNumber = 0;
				altFireShot = false;
			}
			if (dualWieldCount != 0 && !rocketOverheated && rocketTimer > 0f)
			{
				rocketTimer = Mathf.MoveTowards(rocketTimer, 0f, Time.deltaTime * (float)dualWieldCount / (float)rocketShotNumber);
			}
			else if (rocketTimer == 0f && rocketShotNumber > 0)
			{
				rocketShotNumber = 0;
			}
			if ((Object)(object)MonoSingleton<NewMovement>.Instance == (Object)null)
			{
				return;
			}
			MonoSingleton<NewMovement>.Instance.antiHp = 0f;
			if (MonoSingleton<NewMovement>.Instance.rocketRides < 3)
			{
				MonoSingleton<NewMovement>.Instance.rocketRides = 3;
			}
			if (Input.GetKeyDown(bloodTankKeybind.Value) && !MonoSingleton<OptionsManager>.Instance.mainMenu && !MonoSingleton<OptionsManager>.Instance.inIntro && !MonoSingleton<OptionsManager>.Instance.paused && !GameStateManager.Instance.PlayerInputLocked)
			{
				bloodTankTimer = 0f;
				if (bloodTankActivated)
				{
					bloodTankActivated = false;
					MonoSingleton<NewMovement>.Instance.walkSpeed = 750f;
					BloodTankSendHudMessage("endManual");
					return;
				}
				if (MonoSingleton<MusicManager>.Instance.requestedThemes != 0f)
				{
					BloodTankSendHudMessage("enemiesPresent");
					return;
				}
				if (MonoSingleton<NewMovement>.Instance.hp == 400)
				{
					BloodTankSendHudMessage("fullHealth");
					return;
				}
				if (bloodTank == 0f)
				{
					BloodTankSendHudMessage("tankEmpty");
					return;
				}
				if (MonoSingleton<NewMovement>.Instance.boost || MonoSingleton<NewMovement>.Instance.jumping || MonoSingleton<NewMovement>.Instance.falling || MonoSingleton<NewMovement>.Instance.sliding)
				{
					BloodTankSendHudMessage("rapidMovement");
					return;
				}
				bloodTankActivated = true;
				MonoSingleton<NewMovement>.Instance.walkSpeed = 200f;
				BloodTankSendHudMessage("startSuccess");
			}
			if (!bloodTankActivated)
			{
				return;
			}
			if (MonoSingleton<MusicManager>.Instance.requestedThemes != 0f)
			{
				bloodTankTimer = 0f;
				bloodTankActivated = false;
				MonoSingleton<NewMovement>.Instance.walkSpeed = 750f;
				BloodTankSendHudMessage("enemiesSpawned");
				return;
			}
			if (MonoSingleton<NewMovement>.Instance.boost || MonoSingleton<NewMovement>.Instance.jumping || MonoSingleton<NewMovement>.Instance.falling || MonoSingleton<NewMovement>.Instance.sliding)
			{
				bloodTankTimer = 0f;
				bloodTankActivated = false;
				MonoSingleton<NewMovement>.Instance.walkSpeed = 750f;
				BloodTankSendHudMessage("suddenMovement");
				return;
			}
			bloodTankTimer = Mathf.MoveTowards(bloodTankTimer, 100f, Time.deltaTime * 5f);
			bloodTank = Mathf.MoveTowards(bloodTank, 0f, Time.deltaTime * 5f);
			if (bloodTankTimer >= 0.25f)
			{
				bloodTankTimer -= 0.25f;
				NewMovement instance = MonoSingleton<NewMovement>.Instance;
				instance.hp++;
				StatsManager instance2 = MonoSingleton<StatsManager>.Instance;
				instance2.stylePoints -= 25;
			}
			if (bloodTank == 0f)
			{
				bloodTankTimer = 0f;
				bloodTankActivated = false;
				MonoSingleton<NewMovement>.Instance.walkSpeed = 750f;
				BloodTankSendHudMessage("tankEmptied");
			}
			else if (MonoSingleton<NewMovement>.Instance.hp == 400)
			{
				bloodTankTimer = 0f;
				bloodTankActivated = false;
				if (bloodTank < 0.5f)
				{
					bloodTank = 0f;
					StatsManager instance3 = MonoSingleton<StatsManager>.Instance;
					instance3.stylePoints -= 25;
				}
				MonoSingleton<NewMovement>.Instance.walkSpeed = 750f;
				BloodTankSendHudMessage("healthFilled");
			}
		}

		private static void BloodTankSendHudMessage(string hudKey)
		{
			if (bloodTankHUDsEnabled.Value)
			{
				HudMessageReceiver instance = MonoSingleton<HudMessageReceiver>.Instance;
				switch (hudKey)
				{
				case "endManual":
					instance.SendHudMessage("SELFREPAIRNEXUS.REPAIRFUNC <color=#00DFFF>ENDED MANUALLY</color>\r\nPRIMARY CHASSIS: <color=yellow>PARTIALLY REPAIRED</color>\r\n<color=green>HAVE A NICE DAY!</color>", "", "", 0, true, false, true);
					break;
				case "enemiesPresent":
					instance.SendHudMessage("<color=orange>WARNING: ENEMIES DETECTED</color>\r\n<color=orange>COMBAT SYSTEMS: ENGAGED</color>\r\nSELF-REPAIR NEXUS: <color=red>REQUEST DENIED</color>", "", "", 0, true, false, true);
					break;
				case "fullHealth":
					instance.SendHudMessage("<color=red>ERROR:</color>\r\nPRIMARY CHASSIS: <color=#00DFFF>INTACT</color>\r\nSELF-REPAIR NEXUS: <color=red>REQUEST DENIED</color>", "", "", 0, true, false, true);
					break;
				case "tankEmpty":
					instance.SendHudMessage("<color=red>ERROR:</color>\r\nSECONDARY FUEL TANK: <color=red>EMPTY</color>\r\nSELF-REPAIR NEXUS: <color=red>REQUEST DENIED</color>", "", "", 0, true, false, true);
					break;
				case "rapidMovement":
					instance.SendHudMessage("<color=red>ERROR:</color>\r\n<color=orange>RAPID MOVEMENT DETECTED</color>\r\nSELF-REPAIR NEXUS: <color=red>REQUEST DENIED</color>", "", "", 0, true, false, true);
					break;
				case "startSuccess":
					instance.SendHudMessage("SELF-REPAIR NEXUS: <color=green>REQUEST ACCEPTED</color>\r\nSELFREPAIRNEXUS.REPAIRFUNC <color=#00DFFF>BEGUN</color>\r\n<color=yellow>REPAIRING PRIMARY CHASSIS...</color>", "", "", 0, true, false, false);
					break;
				case "enemiesSpawned":
					instance.SendHudMessage("<color=orange>WARNING: ENEMIES DETECTED</color>\r\n<color=orange>RE-ENGAGING COMBAT SYSTEMS...</color>\r\nSELFREPAIRNEXUS.REPAIRFUNC <color=red>ENDED FORCEFULLY</color>", "", "", 0, true, false, true);
					break;
				case "suddenMovement":
					instance.SendHudMessage("<color=orange>WARNING: SUDDEN MOVEMENT</color>\r\n<color=orange>REPAIRING PROCESS INTERRUPTED</color>\r\nSELFREPAIRNEXUS.REPAIRFUNC <color=red>ENDED FORCEFULLY</color>", "", "", 0, true, false, true);
					break;
				case "tankEmptied":
					instance.SendHudMessage("<color=red>ERROR:</color>\r\nSECONDARY FUEL TANK: <color=red>DEPLETED</color>\r\nSELFREPAIRNEXUS.REPAIRFUNC <color=red>ENDED FORCEFULLY</color>", "", "", 0, true, false, true);
					break;
				case "healthFilled":
					instance.SendHudMessage("PRIMARY CHASSIS: <color=#00DFFF>FULLY REPAIRED</color>\r\nSELFREPAIRNEXUS.REPAIRFUNC <color=#00DFFF>COMPLETE</color>\r\n<color=green>HAVE A NICE DAY!</color>", "", "", 0, true, false, true);
					break;
				}
			}
		}

		[HarmonyPatch(typeof(NewMovement), "Start")]
		[HarmonyPostfix]
		private static void SpawnPatches(NewMovement __instance)
		{
			__instance.hp = 400;
			if (tutorialCheck)
			{
				__instance.hp = 395;
			}
			revolverShotNumber = 0;
			rocketShotNumber = 0;
			bloodTank = 0f;
			bloodTankActivated = false;
		}

		[HarmonyPatch(typeof(NewMovement), "Respawn")]
		[HarmonyPostfix]
		private static void RespawnPatches(NewMovement __instance)
		{
			__instance.hp = 400;
			revolverShotNumber = 0;
			rocketShotNumber = 0;
			bloodTank = 0f;
			bloodTankActivated = false;
		}

		[HarmonyPatch(typeof(NewMovement), "GetHealth")]
		[HarmonyPrefix]
		private static void GetHealthPrefix(NewMovement __instance, int health, ref int __state)
		{
			__state = __instance.hp;
			switch (health)
			{
			case 0:
			case 100:
				break;
			case 999:
				if (bloodTank + 2f <= 100f)
				{
					bloodTank += 2f;
				}
				else
				{
					bloodTank = 100f;
				}
				break;
			default:
				if (bloodTank + (float)health / 125f <= 100f)
				{
					bloodTank += (float)health / 125f;
				}
				else
				{
					bloodTank = 100f;
				}
				break;
			}
		}

		[HarmonyPatch(typeof(NewMovement), "GetHealth")]
		[HarmonyPostfix]
		private static void DisableHealingPostfix(NewMovement __instance, int __state)
		{
			if (__instance.hp != __state)
			{
				__instance.hp = __state;
			}
		}

		[HarmonyPatch(typeof(NewMovement), "SuperCharge")]
		[HarmonyPrefix]
		private static void BloodOrbPrefix(NewMovement __instance, ref int __state)
		{
			__state = __instance.hp;
		}

		[HarmonyPatch(typeof(NewMovement), "SuperCharge")]
		[HarmonyPostfix]
		private static void BloodOrbPostfix(NewMovement __instance, int __state)
		{
			if (__state + 200 <= 400)
			{
				__instance.hp = __state + 200;
			}
			else
			{
				__instance.hp = 400;
			}
		}

		[HarmonyPatch(typeof(NewMovement), "GetHurt")]
		[HarmonyPrefix]
		private static void DamageReductionPrefix(NewMovement __instance, int damage, ref int __state)
		{
			__state = __instance.hp;
			int rankIndex = MonoSingleton<StyleHUD>.Instance.rankIndex;
			if (1 == 0)
			{
			}
			float num = rankIndex switch
			{
				7 => 0.35f, 
				6 => 0.5f, 
				5 => 0.65f, 
				4 => 0.8f, 
				3 => 0.9f, 
				_ => 1f, 
			};
			if (1 == 0)
			{
			}
			float num2 = num;
			playerDamage = Mathf.RoundToInt((float)damage * num2);
			if (__state - damage <= 0 && __state - playerDamage > 0)
			{
				shouldaDied = true;
				__instance.hp += damage + 1;
			}
			else
			{
				shouldaDied = false;
			}
		}

		[HarmonyPatch(typeof(NewMovement), "GetHurt")]
		[HarmonyPostfix]
		private static void DamageReductionPostfix(NewMovement __instance, int __state)
		{
			int num = __state - __instance.hp;
			if ((__instance.hp > 0 || shouldaDied) && num != 0)
			{
				__instance.hp = __state - playerDamage;
			}
		}

		[HarmonyPatch(typeof(HealthBar), "Start")]
		[HarmonyPostfix]
		private static void MakeNewHealthbars(HealthBar __instance)
		{
			if (Object.op_Implicit((Object)(object)((Component)__instance).transform.Find("Health Slider")))
			{
				Array.Resize(ref __instance.hpSliders, 4);
				Array.Resize(ref __instance.afterImageSliders, 4);
				hpBars[0] = ((Component)((Component)__instance).transform.Find("Health Slider")).gameObject;
				hpBars[1] = ((Component)((Component)__instance).transform.Find("Supercharge Slider")).gameObject;
				afterImageBars[0] = ((Component)((Component)__instance).transform.Find("AfterHealth Slider")).gameObject;
				afterImageBars[1] = ((Component)((Component)__instance).transform.Find("SuperAfterHealth Slider")).gameObject;
				((Component)hpBars[0].transform.Find("Fill Area").Find("Fill").Find("GreenHPFlash")).gameObject.SetActive(false);
				((Component)((Component)__instance).transform.Find("AntiHealth Slider")).gameObject.SetActive(false);
				for (int i = 2; i < 4; i++)
				{
					hpBars[i] = Object.Instantiate<GameObject>(hpBars[1]);
					((Object)hpBars[i]).name = i * 100 + 100 + " Health Slider";
					hpBars[i].transform.SetParent(((Component)__instance).transform, false);
					hpBars[i].GetComponent<Slider>().minValue = i * 100;
					hpBars[i].GetComponent<Slider>().maxValue = i * 100 + 100;
					__instance.hpSliders[i] = hpBars[i].GetComponent<Slider>();
					afterImageBars[i] = Object.Instantiate<GameObject>(afterImageBars[1]);
					((Object)afterImageBars[i]).name = i * 100 + 100 + " AfterHealth Slider";
					afterImageBars[i].transform.SetParent(((Component)__instance).transform, false);
					afterImageBars[i].GetComponent<Slider>().minValue = i * 100;
					afterImageBars[i].GetComponent<Slider>().maxValue = i * 100 + 100;
					__instance.afterImageSliders[i] = afterImageBars[i].GetComponent<Slider>();
					afterImageBars[i].transform.SetSiblingIndex(2 * i + 1);
					hpBars[i].transform.SetSiblingIndex(2 * i + 2);
				}
			}
		}

		[HarmonyPatch(typeof(HealthBar), "Update")]
		[HarmonyPostfix]
		private static void UpdateClassicHealthGUIs(HealthBar __instance)
		{
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)__instance.hpText != (Object)null))
			{
				return;
			}
			TextMeshProUGUI component = ((Component)__instance.hpText).GetComponent<TextMeshProUGUI>();
			if (!__instance.antiHpText)
			{
				if (__instance.changeTextColor)
				{
					if (MonoSingleton<NewMovement>.Instance.hp <= 100)
					{
						((Graphic)component).color = Color.red;
					}
					else if (MonoSingleton<NewMovement>.Instance.hp <= 200 && __instance.yellowColor)
					{
						((Graphic)component).color = Color.yellow;
					}
					else
					{
						((Graphic)component).color = __instance.normalTextColor;
					}
				}
				else if (__instance.normalTextColor == Color.white)
				{
					if (MonoSingleton<NewMovement>.Instance.hp <= 100)
					{
						((Graphic)component).color = Color.red;
						return;
					}
					ColorBlindSettings value = Traverse.Create((object)__instance).Field("colorBlindSettings").GetValue<ColorBlindSettings>();
					((Graphic)component).color = value.GetHudColor((HudColorType)4);
				}
			}
			else
			{
				((TMP_Text)component).text = "/400";
			}
		}

		[HarmonyPatch(typeof(Crosshair), "Start")]
		[HarmonyPostfix]
		private static void MakeNewCrosshairBars(Crosshair __instance)
		{
			if (Object.op_Implicit((Object)(object)((Component)__instance).transform.Find("HealthBars")))
			{
				Array.Resize(ref __instance.chuds, 12);
				GameObject gameObject = ((Component)((Component)__instance).transform.Find("HealthBars")).gameObject;
				SliderToFillAmount[] array = Traverse.Create((object)gameObject.GetComponent<FadeOutBars>()).Field("slids").GetValue<SliderToFillAmount[]>();
				Array.Resize(ref array, 9);
				hpRings[0] = ((Component)gameObject.transform.Find("HealthSlider")).gameObject;
				hpRings[1] = ((Component)gameObject.transform.Find("SuperchargeSlider")).gameObject;
				afterImageRings[0] = ((Component)gameObject.transform.Find("HealthSliderAfterImage")).gameObject;
				afterImageRings[1] = ((Component)gameObject.transform.Find("HealthSliderAfterImage (1)")).gameObject;
				for (int i = 2; i < 4; i++)
				{
					hpRings[i] = Object.Instantiate<GameObject>(hpRings[1]);
					((Object)hpRings[i]).name = i * 100 + 100 + "HealthSlider";
					hpRings[i].transform.SetParent(gameObject.transform, false);
					hpRings[i].GetComponent<SliderToFillAmount>().targetSlider = hpBars[i].GetComponent<Slider>();
					array[2 * i + 2] = hpRings[i].GetComponent<SliderToFillAmount>();
					__instance.chuds[2 * i + 5] = hpBars[i].GetComponent<Image>();
					afterImageRings[i] = Object.Instantiate<GameObject>(afterImageRings[1]);
					((Object)afterImageRings[i]).name = i * 100 + 100 + "HealthSliderAfterImage";
					afterImageRings[i].transform.SetParent(gameObject.transform, false);
					afterImageRings[i].GetComponent<SliderToFillAmount>().targetSlider = afterImageBars[i].GetComponent<Slider>();
					array[2 * i + 1] = afterImageRings[i].GetComponent<SliderToFillAmount>();
					__instance.chuds[2 * i + 4] = afterImageRings[i].GetComponent<Image>();
					afterImageRings[i].transform.SetSiblingIndex(2 * i + 1);
					hpRings[i].transform.SetSiblingIndex(2 * i + 2);
				}
				Traverse.Create((object)gameObject.GetComponent<FadeOutBars>()).Field("slids").SetValue((object)array);
			}
		}

		[HarmonyPatch(typeof(HudController), "Awake")]
		[HarmonyPrefix]
		private static void MakeBloodTankGUIs(HudController __instance)
		{
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_027f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0294: 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_02b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0234: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: 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_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b02: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b0c: Expected O, but got Unknown
			//IL_0b68: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b84: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b9b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bb2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bc9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0be0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bf7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c5c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c7f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c86: Expected O, but got Unknown
			//IL_0ccd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ce9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d00: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d17: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d2e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d45: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d61: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e11: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e1b: Expected O, but got Unknown
			//IL_0e71: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e8d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ea4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ebb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ed2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eee: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0315: Unknown result type (might be due to invalid IL or missing references)
			//IL_037a: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ce: Expected O, but got Unknown
			//IL_0405: Unknown result type (might be due to invalid IL or missing references)
			//IL_041c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0433: Unknown result type (might be due to invalid IL or missing references)
			//IL_0443: Unknown result type (might be due to invalid IL or missing references)
			//IL_044a: Expected O, but got Unknown
			//IL_048f: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0507: Unknown result type (might be due to invalid IL or missing references)
			//IL_056c: Unknown result type (might be due to invalid IL or missing references)
			//IL_058e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0595: Expected O, but got Unknown
			//IL_05c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0613: 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_063a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0641: Expected O, but got Unknown
			//IL_0681: Unknown result type (might be due to invalid IL or missing references)
			//IL_069d: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e2: 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_0727: Unknown result type (might be due to invalid IL or missing references)
			//IL_0734: Unknown result type (might be due to invalid IL or missing references)
			//IL_073b: Expected O, but got Unknown
			//IL_076f: Unknown result type (might be due to invalid IL or missing references)
			//IL_078b: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e7: Expected O, but got Unknown
			//IL_082c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0843: Unknown result type (might be due to invalid IL or missing references)
			//IL_085a: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0903: Expected O, but got Unknown
			//IL_0963: Unknown result type (might be due to invalid IL or missing references)
			//IL_097f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0996: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_09db: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a6b: Unknown result type (might be due to invalid IL or missing references)
			//IL_100d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1017: Expected O, but got Unknown
			//IL_1073: Unknown result type (might be due to invalid IL or missing references)
			//IL_108f: Unknown result type (might be due to invalid IL or missing references)
			//IL_10a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_10bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_10d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_10eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_1102: Unknown result type (might be due to invalid IL or missing references)
			//IL_1167: Unknown result type (might be due to invalid IL or missing references)
			//IL_118a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1191: Expected O, but got Unknown
			//IL_11d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_11f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_120b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1222: Unknown result type (might be due to invalid IL or missing references)
			//IL_1239: Unknown result type (might be due to invalid IL or missing references)
			//IL_1250: Unknown result type (might be due to invalid IL or missing references)
			//IL_126c: Unknown result type (might be due to invalid IL or missing references)
			//IL_131c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1326: Expected O, but got Unknown
			//IL_137c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1398: Unknown result type (might be due to invalid IL or missing references)
			//IL_13af: Unknown result type (might be due to invalid IL or missing references)
			//IL_13c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_13dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_13f9: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)__instance != (Object)null))
			{
				return;
			}
			if ((Object)(object)bloodTankGUI == (Object)null && ((Object)__instance).name == "HUD")
			{
				Material material = ((Graphic)((Component)((Component)__instance).transform.Find("GunCanvas").Find("StatsPanel")).GetComponent<Image>()).material;
				bloodTankGUI = new GameObject("BloodTankPanel");
				bloodTankGUI.transform.SetParent(((Component)__instance).transform.Find("GunCanvas"), false);
				bloodTankGUI.transform.localScale = new Vector3(4f, 4f, 4f);
				bloodTankGUI.layer = 13;
				GameObject[] array = Traverse.Create((object)MonoSingleton<PlayerActivatorRelay>.Instance).Field("toActivate").GetValue<GameObject[]>();
				Array.Resize(ref array, 9);
				array[8] = bloodTankGUI;
				Traverse.Create((object)MonoSingleton<PlayerActivatorRelay>.Instance).Field("toActivate").SetValue((object)array);
				RectTransform val = bloodTankGUI.AddComponent<RectTransform>();
				bloodTankGUI.AddComponent<CanvasRenderer>();
				Image val2 = bloodTankGUI.AddComponent<Image>();
				HudOpenEffect val3 = bloodTankGUI.AddComponent<HudOpenEffect>();
				bloodTankGUI.GetComponent<CanvasRenderer>().cullTransparentMesh = false;
				if (!MonoSingleton<PrefsManager>.Instance.GetBool("weaponIcons", false))
				{
					if (MonoSingleton<PrefsManager>.Instance.GetInt("speedometer", 0) == 0)
					{
						val.anchoredPosition = new Vector2(val.anchoredPosition.x - 79f, 187f);
						val.anchoredPosition3D = new Vector3(val.anchoredPosition.x, 187f, 45f);
					}
					else
					{
						val.anchoredPosition = new Vector2(val.anchoredPosition.x - 79f, 293f);
						val.anchoredPosition3D = new Vector3(val.anchoredPosition.x, 293f, 45f);
					}
				}
				else if (MonoSingleton<PrefsManager>.Instance.GetInt("speedometer", 0) == 0)
				{
					val.anchoredPosition = new Vector2(val.anchoredPosition.x - 79f, 590f);
					val.anchoredPosition3D = new Vector3(val.anchoredPosition.x, 590f, 45f);
				}
				else
				{
					val.anchoredPosition = new Vector2(val.anchoredPosition.x - 79f, 693f);
					val.anchoredPosition3D = new Vector3(val.anchoredPosition.x, 693f, 45f);
				}
				val.anchorMax = new Vector2(0f, 0f);
				val.anchorMin = new Vector2(0f, 0f);
				val.pivot = new Vector2(0f, 0f);
				val.sizeDelta = new Vector2(200f, 30f);
				val2.sprite = funnyAssets.LoadAsset<Sprite>("Round_FillLarge");
				val2.overrideSprite = funnyAssets.LoadAsset<Sprite>("Round_FillLarge");
				val2.pixelsPerUnitMultiplier = 5.4f;
				val2.type = (Type)1;
				((Graphic)val2).color = new Color(0f, 0f, 0f, 0.5f);
				((Graphic)val2).material = material;
				((Graphic)val2).raycastTarget = false;
				Traverse.Create((object)val3).Field("originalDimensions").SetValue((object)new Vector2(4f, 4f));
				GameObject val4 = new GameObject("Filler");
				val4.transform.SetParent(bloodTankGUI.transform, false);
				val4.layer = 13;
				RectTransform val5 = val4.AddComponent<RectTransform>();
				val5.anchorMax = new Vector2(1f, 1f);
				val5.anchorMin = new Vector2(0f, 0f);
				val5.sizeDelta = new Vector2(-10f, -10f);
				GameObject val6 = new GameObject("Panel");
				val6.transform.SetParent(val4.transform, false);
				val6.layer = 13;
				RectTransform val7 = val6.AddComponent<RectTransform>();
				val6.AddComponent<CanvasRenderer>();
				Image val8 = val6.AddComponent<Image>();
				val7.anchoredPosition = new Vector2(0f, -1f);
				val7.anchoredPosition3D = new Vector3(0f, -1f, 0f);
				val7.anchorMax = new Vector2(1f, 0f);
				val7.anchorMin = new Vector2(0f, 0f);
				val7.pivot = new Vector2(0.5f, 0f);
				val7.sizeDelta = new Vector2(0f, 22f);
				val8.sprite = funnyAssets.LoadAsset<Sprite>("Round_FillSmall");
				val8.overrideSprite = funnyAssets.LoadAsset<Sprite>("Round_FillSmall");
				val8.pixelsPerUnitMultiplier = 5.4f;
				val8.type = (Type)1;
				((Graphic)val8).color = new Color(0f, 0f, 0f, 0.5f);
				((Graphic)val8).material = material;
				((Graphic)val8).raycastTarget = false;
				GameObject val9 = new GameObject("Filler");
				val9.transform.SetParent(val6.transform, false);
				val9.layer = 13;
				RectTransform val10 = val9.AddComponent<RectTransform>();
				val10.anchoredPosition = new Vector2(-0.0001f, 0f);
				val10.anchoredPosition3D = new Vector3(-0.0001f, 0f, 0.0001f);
				val10.anchorMax = new Vector2(1f, 0.5f);
				val10.anchorMin = new Vector2(0f, 0.5f);
				val10.sizeDelta = new Vector2(0f, 100f);
				GameObject val11 = new GameObject("Blood Tank Slider");
				val11.transform.SetParent(val9.transform, false);
				val11.layer = 13;
				RectTransform val12 = val11.AddComponent<RectTransform>();
				bloodTankActualSlider = val11.AddComponent<Slider>();
				val12.anchoredPosition = new Vector2(0f, 0f);
				val12.anchoredPosition3D = new Vector3(0f, 0f, 0f);
				val12.anchorMax = new Vector2(1f, 0.5f);
				val12.anchorMin = new Vector2(0f, 0.5f);
				val12.sizeDelta = new Vector2(0f, 22f);
				bloodTankActualSlider.maxValue = 100f;
				((Selectable)bloodTankActualSlider).interactable = false;
				ColorBlock colors = ((Selectable)bloodTankActualSlider).colors;
				((ColorBlock)(ref colors)).colorMultiplier = 2f;
				((Selectable)bloodTankActualSlider).colors = colors;
				GameObject val13 = new GameObject("Fill Area");
				val13.transform.SetParent(val11.transform, false);
				val13.layer = 13;
				RectTransform val14 = val13.AddComponent<RectTransform>();
				val14.anchoredPosition = new Vector2(0f, 0f);
				val14.anchoredPosition3D = new Vector3(0f, 0f, 0f);
				val14.anchorMax = new Vector2(1f, 0.75f);
				val14.anchorMin = new Vector2(0f, 0.25f);
				val14.sizeDelta = new Vector2(0f, 11f);
				GameObject val15 = new GameObject("Fill");
				val15.transform.SetParent(val13.transform, false);
				val15.layer = 13;
				RectTransform val16 = val15.AddComponent<RectTransform>();
				val15.AddComponent<CanvasRenderer>();
				Image val17 = val15.AddComponent<Image>();
				val16.anchorMax = new Vector2(1f, 1f);
				val16.anchorMin = new Vector2(0f, 0f);
				val16.sizeDelta = new Vector2(0f, 0f);
				val17.sprite = funnyAssets.LoadAsset<Sprite>("Round_FillSmall");
				val17.overrideSprite = funnyAssets.LoadAsset<Sprite>("Round_FillSmall");
				val17.pixelsPerUnitMultiplier = 5.4f;
				val17.type = (Type)1;
				((Graphic)val17).color = bloodTankGUIColor.Value;
				((Graphic)val17).material = material;
				((Graphic)val17).raycastTarget = false;
				bloodTankActualSlider.fillRect = val16;
				((Selectable)bloodTankActualSlider).image = val17;
				((Selectable)bloodTankActualSlider).targetGraphic = (Graphic)(object)val17;
				bloodTankSliderText = new GameObject("Slider Text");
				bloodTankSliderText.transform.SetParent(val9.transform, false);
				bloodTankSliderText.layer = 13;
				RectTransform val18 = bloodTankSliderText.AddComponent<RectTransform>();
				bloodTankSliderText.AddComponent<CanvasRenderer>();
				ColorBlindGet val19 = bloodTankSliderText.AddComponent<ColorBlindGet>();
				TextMeshProUGUI val20 = bloodTankSliderText.AddComponent<TextMeshProUGUI>();
				val18.anchoredPosition = new Vector2(15.0002f, 0f);
				val18.anchoredPosition3D = new Vector3(15.0002f, 0f, 0.0004f);
				val18.anchorMax = new Vector2(0f, 0.5f);
				val18.anchorMin = new Vector2(0f, 0.5f);
				val18.pivot = new Vector2(0f, 0.5f);
				val18.sizeDelta = new Vector2(154.5f, 15f);
				((TMP_Text)val20).alignment = (TextAlignmentOptions)4097;
				((TMP_Text)val20).characterSpacing = -5f;
				((TMP_Text)val20).enableAutoSizing = true;
				((TMP_Text)val20).font = funnyAssets.LoadAsset<TMP_FontAsset>("VCR_OSD_MONO_1");
				((TMP_Text)val20).fontSizeMax = 200f;
				((TMP_Text)val20).fontSizeMin = 5f;
				((TMP_Text)val20).text = Mathf.RoundToInt(bloodTank) + "%";
				((Graphic)val20).raycastTarget = false;
				val19.hct = (HudColorType)4;
				Array.Resize(ref __instance.hudBackgrounds, 13);
				__instance.hudBackgrounds[12] = val2;
				Array.Resize(ref __instance.textElements, 4);
				__instance.textElements[3] = (TMP_Text)(object)val20;
				bloodTankGUI.SetActive(false);
			}
			if ((Object)(object)bloodTankAltGUI == (Object)null && ((Object)__instance).name == "AltHud")
			{
				Material material2 = ((Graphic)((Component)((Component)__instance).transform.Find("Filler").Find("Health")).GetComponent<Image>()).material;
				bloodTankAltGUI = new GameObject("BloodTank");
				bloodTankAltGUI.transform.SetParent(((Component)__instance).transform.Find("Filler"), false);
				bloodTankAltGUI.layer = 5;
				RectTransform val21 = bloodTankAltGUI.AddComponent<RectTransform>();
				bloodTankAltGUI.AddComponent<CanvasRenderer>();
				Image val22 = bloodTankAltGUI.AddComponent<Image>();
				val21.anchoredPosition = new Vector2(-360f, 0f);
				val21.anchoredPosition3D = new Vector3(-360f, 0f, 0f);
				val21.anchorMax = new Vector2(0.5f, 0f);
				val21.anchorMin = new Vector2(0.5f, 0f);
				val21.pivot = new Vector2(0.5f, 0f);
				val21.sizeDelta = new Vector2(77.5f, 80f);
				((Transform)val21).localPosition = new Vector3(360f, -360f);
				val22.sprite = funnyAssets.LoadAsset<Sprite>("Round_FillLarge");
				val22.overrideSprite = funnyAssets.LoadAsset<Sprite>("Round_FillLarge");
				val22.pixelsPerUnitMultiplier = 5.4f;
				val22.type = (Type)1;
				((Graphic)val22).color = new Color(0f, 0f, 0f, 0.5f);
				((Graphic)val22).material = material2;
				((Graphic)val22).raycastTarget = false;
				GameObject val23 = new GameObject("Title");
				val23.transform.SetParent(bloodTankAltGUI.transform, false);
				val23.layer = 5;
				RectTransform val24 = val23.AddComponent<RectTransform>();
				val23.AddComponent<CanvasRenderer>();
				TextMeshProUGUI val25 = val23.AddComponent<TextMeshProUGUI>();
				val24.anchoredPosition = new Vector2(0f, -2.8571f);
				val24.anchoredPosition3D = new Vector3(0f, -2.8571f, 0f);
				val24.anchorMax = new Vector2(0.5f, 1f);
				val24.anchorMin = new Vector2(0.5f, 1f);
				val24.pivot = new Vector2(0.5f, 1f);
				val24.sizeDelta = new Vector2(70f, 24f);
				((Transform)val24).localPosition = new Vector3(0f, 77.1429f, 0f);
				((TMP_Text)val25).alignment = (TextAlignmentOptions)258;
				((TMP_Text)val25).characterWidthAdjustment = 50f;
				((TMP_Text)val25).enableAutoSizing = true;
				((TMP_Text)val25).enableKerning = true;
				((TMP_Text)val25).enableWordWrapping = true;
				((TMP_Text)val25).font = funnyAssets.LoadAsset<TMP_FontAsset>("VCR_OSD_MONO_1");
				((TMP_Text)val25).fontMaterial = funnyAssets.LoadAsset<Material>("VCR_OSD_MONO Outline");
				((TMP_Text)val25).fontSize = 24f;
				((TMP_Text)val25).fontSizeMax = 24f;
				((TMP_Text)val25).fontSizeMin = 24f;
				((TMP_Text)val25).horizontalAlignment = (HorizontalAlignmentOptions)2;
				((TMP_Text)val25).text = "BLOOD";
				bloodTankAltGUIText = new GameObject("Text (TMP)");
				bloodTankAltGUIText.transform.SetParent(bloodTankAltGUI.transform, false);
				bloodTankAltGUIText.layer = 5;
				RectTransform val26 = bloodTankAltGUIText.AddComponent<RectTransform>();
				bloodTankAltGUIText.AddComponent<CanvasRenderer>();
				TextMeshProUGUI val27 = bloodTankAltGUIText.AddComponent<TextMeshProUGUI>();
				val26.anchoredPosition = new Vector2(0f, -17.5002f);
				val26.anchoredPosition3D = new Vector3(0f, -17.5002f, 0f);
				val26.anchorMax = new Vector2(1f, 1f);
				val26.anchorMin = new Vector2(0f, 0f);
				val26.sizeDelta = new Vector2(0f, -34.9996f);
				((Transform)val26).localPosition = new Vector3(0f, 22.4998f, 0f);
				((TMP_Text)val27).alignment = (TextAlignmentOptions)258;
				((TMP_Text)val27).enableAutoSizing = true;
				((TMP_Text)val27).font = funnyAssets.LoadAsset<TMP_FontAsset>("VCR_OSD_MONO_1");
				((TMP_Text)val27).fontMaterial = funnyAssets.LoadAsset<Material>("VCR_OSD_MONO Outline");
				((TMP_Text)val27).fontSize = 36f;
				((TMP_Text)val27).fontSizeMax = 36f;
				((TMP_Text)val27).fontSizeMin = 18f;
				((TMP_Text)val27).horizontalAlignment = (HorizontalAlignmentOptions)2;
				((TMP_Text)val27).text = Mathf.RoundToInt(bloodTank) + "%";
				Array.Resize(ref __instance.hudBackgrounds, 10);
				__instance.hudBackgrounds[9] = val22;
				bloodTankAltGUI.SetActive(false);
			}
			if ((Object)(object)bloodTankAlt2GUI == (Object)null && ((Object)__instance).name == "AltHud (2)")
			{
				Material material3 = ((Graphic)((Component)((Component)__instance).transform.Find("Filler").Find("Health (1)")).GetComponent<Image>()).material;
				bloodTankAlt2GUI = new GameObject("BloodTank");
				bloodTankAlt2GUI.transform.SetParent(((Component)__instance).transform.Find("Filler"), false);
				bloodTankAlt2GUI.layer = 5;
				RectTransform val28 = bloodTankAlt2GUI.AddComponent<RectTransform>();
				bloodTankAlt2GUI.AddComponent<CanvasRenderer>();
				Image val29 = bloodTankAlt2GUI.AddComponent<Image>();
				val28.anchoredPosition = new Vector2(-360f, 0f);
				val28.anchoredPosition3D = new Vector3(-360f, 0f, 0f);
				val28.anchorMax = new Vector2(0.5f, 0f);
				val28.anchorMin = new Vector2(0.5f, 0f);
				val28.pivot = new Vector2(0.5f, 0f);
				val28.sizeDelta = new Vector2(77.5f, 80f);
				((Transform)val28).localPosition = new Vector3(360f, -360f);
				val29.sprite = funnyAssets.LoadAsset<Sprite>("Round_FillLarge");
				val29.overrideSprite = funnyAssets.LoadAsset<Sprite>("Round_FillLarge");
				val29.pixelsPerUnitMultiplier = 5.4f;
				val29.type = (Type)1;
				((Graphic)val29).color = new Color(0f, 0f, 0f, 0.5f);
				((Graphic)val29).material = material3;
				((Graphic)val29).raycastTarget = false;
				GameObject val30 = new GameObject("Title");
				val30.transform.SetParent(bloodTankAlt2GUI.transform, false);
				val30.layer = 5;
				RectTransform val31 = val30.AddComponent<RectTransform>();
				val30.AddComponent<CanvasRenderer>();
				TextMeshProUGUI val32 = val30.AddComponent<TextMeshProUGUI>();
				val31.anchoredPosition = new Vector2(0f, -2.8571f);
				val31.anchoredPosition3D = new Vector3(0f, -2.8571f, 0f);
				val31.anchorMax = new Vector2(0.5f, 1f);
				val31.anchorMin = new Vector2(0.5f, 1f);
				val31.pivot = new Vector2(0.5f, 1f);
				val31.sizeDelta = new Vector2(70f, 24f);
				((Transform)val31).localPosition = new Vector3(0f, 77.1429f, 0f);
				((TMP_Text)val32).alignment = (TextAlignmentOptions)258;
				((TMP_Text)val32).characterWidthAdjustment = 50f;
				((TMP_Text)val32).enableAutoSizing = true;
				((TMP_Text)val32).enableKerning = true;
				((TMP_Text)val32).enableWordWrapping = true;
				((TMP_Text)val32).font = funnyAssets.LoadAsset<TMP_FontAsset>("VCR_OSD_MONO_1");
				((TMP_Text)val32).fontMaterial = funnyAssets.LoadAsset<Material>("VCR_OSD_MONO Outline");
				((TMP_Text)val32).fontSize = 24f;
				((TMP_Text)val32).fontSizeMax = 24f;
				((TMP_Text)val32).fontSizeMin = 24f;
				((TMP_Text)val32).horizontalAlignment = (HorizontalAlignmentOptions)2;
				((TMP_Text)val32).text = "BLOOD";
				bloodTankAlt2GUIText = new GameObject("Text (TMP)");
				bloodTankAlt2GUIText.transform.SetParent(bloodTankAlt2GUI.transform, false);
				bloodTankAlt2GUIText.layer = 5;
				RectTransform val33 = bloodTankAlt2GUIText.AddComponent<RectTransform>();
				bloodTankAlt2GUIText.AddComponent<CanvasRenderer>();
				TextMeshProUGUI val34 = bloodTankAlt2GUIText.AddComponent<TextMeshProUGUI>();
				val33.anchoredPosition = new Vector2(0f, -17.5002f);
				val33.anchoredPosition3D = new Vector3(0f, -17.5002f, 0f);
				val33.anchorMax = new Vector2(1f, 1f);
				val33.anchorMin = new Vector2(0f, 0f);
				val33.sizeDelta = new Vector2(0f, -34.9996f);
				((Transform)val33).localPosition = new Vector3(0f, 22.4998f, 0f);
				((TMP_Text)val34).alignment = (TextAlignmentOptions)258;
				((TMP_Text)val34).enableAutoSizing = true;
				((TMP_Text)val34).font = funnyAssets.LoadAsset<TMP_FontAsset>("VCR_OSD_MONO_1");
				((TMP_Text)val34).fontMaterial = funnyAssets.LoadAsset<Material>("VCR_OSD_MONO Outline");
				((TMP_Text)val34).fontSize = 36f;
				((TMP_Text)val34).fontSizeMax = 36f;
				((TMP_Text)val34).fontSizeMin = 18f;
				((TMP_Text)val34).horizontalAlignment = (HorizontalAlignmentOptions)2;
				((TMP_Text)val34).text = Mathf.RoundToInt(bloodTank) + "%";
				Array.Resize(ref __instance.hudBackgrounds, 10);
				__instance.hudBackgrounds[9] = val29;
				bloodTankAlt2GUI.SetActive(false);
			}
		}

		[HarmonyPatch(typeof(Speedometer), "OnPrefChanged")]
		[HarmonyPostfix]
		private static void AdjustBloodTankGUIPos()
		{
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: 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_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: 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_0070: 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)
			if (!((Object)(object)bloodTankGUI != (Object)null))
			{
				return;
			}
			RectTransform component = bloodTankGUI.GetComponent<RectTransform>();
			if (!MonoSingleton<PrefsManager>.Instance.GetBool("weaponIcons", false))
			{
				if (MonoSingleton<PrefsManager>.Instance.GetInt("speedometer", 0) == 0)
				{
					component.anchoredPosition = new Vector2(component.anchoredPosition.x, 187f);
					component.anchoredPosition3D = new Vector3(component.anchoredPosition.x, 187f, 45f);
				}
				else
				{
					component.anchoredPosition = new Vector2(component.anchoredPosition.x, 293f);
					component.anchoredPosition3D = new Vector3(component.anchoredPosition.x, 293f, 45f);
				}
			}
			else if (MonoSingleton<PrefsManager>.Instance.GetInt("speedometer", 0) == 0)
			{
				component.anchoredPosition = new Vector2(component.anchoredPosition.x, 590f);
				component.anchoredPosition3D = new Vector3(component.anchoredPosition.x, 590f, 45f);
			}
			else
			{
				component.anchoredPosition = new Vector2(component.anchoredPosition.x, 693f);
				component.anchoredPosition3D = new Vector3(component.anchoredPosition.x, 693f, 45f);
			}
		}

		[HarmonyPatch(typeof(FistControl), "Start")]
		[HarmonyPrefix]
		private static void SwapKnuckleblasterAndFeedbacker(FistControl __instance)
		{
			AssetReference blueArm = __instance.blueArm;
			AssetReference redArm = __instance.redArm;
			__instance.blueArm = redArm;
			__instance.redArm = blueArm;
		}

		[HarmonyPatch(typeof(FistControl), "Update")]
		[HarmonyPrefix]
		private static bool FistControlUpdatePrefix(FistControl __instance)
		{
			inman = Traverse.Create((object)__instance).Field("inman").GetValue<InputManager>();
			currentVarNum = Traverse.Create((object)__instance).Field("currentVarNum").GetValue<int>();
			spawnedArms = Traverse.Create((object)__instance).Field("spawnedArms").GetValue<List<GameObject>>();
			return false;
		}

		[HarmonyPatch(typeof(FistControl), "Update")]
		[HarmonyPostfix]
		private static void FistControlUpdatePostfix(FistControl __instance)
		{
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: 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_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0328: Unknown result type (might be due to invalid IL or missing references)
			//IL_032e: Invalid comparison between Unknown and I4
			//IL_033b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0341: Invalid comparison between Unknown and I4
			if (__instance.fistCooldown > -1f)
			{
				__instance.fistCooldown = Mathf.MoveTowards(__instance.fistCooldown, 0f, Time.deltaTime * 2f);
			}
			float punchStamina = MonoSingleton<WeaponCharges>.Instance.punchStamina;
			if (!MonoSingleton<OptionsManager>.Instance.paused && __instance.fistCooldown <= 0f && punchStamina >= 1f)
			{
				FistActions fist = inman.InputSource.Actions.Fist;
				if (((FistActions)(ref fist)).PunchKnuckleblaster.WasPerformedThisFrame() && (currentVarNum == 0 || __instance.ForceArm(0, false)))
				{
					Punch currentPunch = __instance.currentPunch;
					fist = MonoSingleton<InputManager>.Instance.InputSource.Actions.Fist;
					currentPunch.heldAction = ((FistActions)(ref fist)).PunchKnuckleblaster;
					__instance.currentPunch.PunchStart();
				}
				fist = inman.InputSource.Actions.Fist;
				if (((FistActions)(ref fist)).PunchFeedbacker.WasPerformedThisFrame() && (currentVarNum == 1 || __instance.ForceArm(1, false)))
				{
					Punch currentPunch2 = __instance.currentPunch;
					fist = MonoSingleton<InputManager>.Instance.InputSource.Actions.Fist;
					currentPunch2.heldAction = ((FistActions)(ref fist)).PunchFeedbacker;
					__instance.currentPunch.PunchStart();
				}
			}
			if ((Object)(object)MonoSingleton<OptionsManager>.Instance == (Object)null || MonoSingleton<OptionsManager>.Instance.mainMenu || MonoSingleton<OptionsManager>.Instance.inIntro || MonoSingleton<OptionsManager>.Instance.paused || ((Object)(object)MonoSingleton<ScanningStuff>.Instance != (Object)null && MonoSingleton<ScanningStuff>.Instance.IsReading) || GameStateManager.Instance.PlayerInputLocked)
			{
				return;
			}
			if (MonoSingleton<InputManager>.Instance.InputSource.Fire2.IsPressed && __instance.shopping)
			{
				Traverse.Create((object)__instance).Field("zooming").SetValue((object)true);
				MonoSingleton<CameraController>.Instance.Zoom(MonoSingleton<CameraController>.Instance.defaultFov / 2f);
			}
			else if (Traverse.Create((object)__instance).Field("zooming").GetValue<bool>())
			{
				Traverse.Create((object)__instance).Field("zooming").SetValue((object)false);
				MonoSingleton<CameraController>.Instance.StopZoom();
			}
			if (spawnedArms.Count > 1 && !__instance.shopping && ((Object)(object)MonoSingleton<SpawnMenu>.Instance == (Object)null || !((Component)MonoSingleton<SpawnMenu>.Instance).gameObject.activeInHierarchy))
			{
				if (MonoSingleton<InputManager>.Instance.InputSource.ChangeFist.WasPerformedThisFrame)
				{
					__instance.ScrollArm();
				}
			}
			else if (spawnedArms.Count > 0 && (Object)(object)__instance.currentPunch == (Object)null)
			{
				__instance.ArmChange(0);
			}
			if (spawnedArms.Count == 0 && MonoSingleton<InputManager>.Instance.InputSource.Punch.WasPerformedThisFrame && (__instance.forcedLoadout == null || (int)__instance.forcedLoadout.arm.blueVariant != 2 || (int)__instance.forcedLoadout.arm.redVariant != 2))
			{
				MonoSingleton<HudMessageReceiver>.Instance.SendHudMessage("<color=red>CAN'T PUNCH IF YOU HAVE NO ARM EQUIPPED, DUMBASS</color>\nArms can be re-equipped at the shop", "", "", 0, false, false, true);
			}
		}

		[HarmonyPatch(typeof(HudController), "UpdateFistIcon")]
		[HarmonyPostfix]
		private static void SwapFistIcon(HudController __instance, int current)
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			switch (current)
			{
			case 0:
				__instance.fistFill.sprite = __instance.fistIcons[1];
				__instance.fistBackground.sprite = __instance.fistIcons[1];
				MonoSingleton<FistControl>.Instance.fistIconColor = MonoSingleton<ColorBlindSettings>.Instance.variationColors[2];
				break;
			case 1:
				__instance.fistFill.sprite = __instance.fistIcons[0];
				__instance.fistBackground.sprite = __instance.fistIcons[0];
				MonoSingleton<FistControl>.Instance.fistIconColor = MonoSingleton<ColorBlindSettings>.Instance.variationColors[0];
				break;
			}
		}

		[HarmonyPatch(typeof(HudController), "Awake")]
		[HarmonyPostfix]
		private static void SwapClassicFistIconAwake(HudController __instance)
		{
			switch (Traverse.Create((object)MonoSingleton<FistControl>.Instance).Field("currentVarNum").GetValue<int>())
			{
			case 0:
				__instance.fistFill.sprite = __instance.fistIcons[1];
				__instance.fistBackground.sprite = __instance.fistIcons[1];
				break;
			case 1:
				__instance.fistFill.sprite = __instance.fistIcons[0];
				__instance.fistBackground.sprite = __instance.fistIcons[0];
				break;
			}
		}

		[HarmonyPatch(typeof(VariationInfo), "Start")]
		[HarmonyPrefix]
		private static void SwapArmsInShop(VariationInfo __instance)
		{
			string name = ((Object)((Component)__instance).transform).name;
			string text = name;
			if (!(text == "Arm Panel (Red)"))
			{
				if (text == "Arm Panel (Blue)")
				{
					__instance.weaponName = "arm1";
					((Component)__instance).transform.SetSiblingIndex(1);
				}
			}
			else
			{
				__instance.weaponName = "arm0";
				((Component)__instance).transform.SetSiblingIndex(0);
			}
		}

		[HarmonyPatch(typeof(FistControl), "ForceArm")]
		[HarmonyPostfix]
		private static void FeedbackerAnimationsClairdeLune(FistControl __instance, int varNum, bool animation)
		{
			if (varNum == 1 && animation)
			{
				List<GameObject> value = Traverse.Create((object)__instance).Field("spawnedArms").GetValue<List<GameObject>>();
				int value2 = Traverse.Create((object)__instance).Field("currentOrderNum").GetValue<int>();
				Punch punch = default(Punch);
				if (value[value2].TryGetComponent<Punch>(ref punch))
				{
					((MonoBehaviour)__instance).StartCoroutine((IEnumerator)FeedbackerPunches(punch));
				}
			}
		}

		[HarmonyPatch(typeof(ObjectActivator), "Start")]
		[HarmonyPrefix]
		private static void FeedbackerDropClairdeLune(ObjectActivator __instance)
		{
			//IL_00a9: 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)
			if (((Object)((Component)__instance).transform).name == "V2 Deactivator")
			{
				SkinnedMeshRenderer component = ((Component)((Component)__instance).transform.parent.Find("RedArmPickup").Find("redarmlp").Find("arm_lp")).GetComponent<SkinnedMeshRenderer>();
				if ((Object)(object)component != (Object)null)
				{
					component.rootBone = null;
					component.sharedMesh = funnyAssets.LoadAsset<Mesh>("Feedbacker");
					((Renderer)component).materials[0].mainTexture = (Texture)(object)funnyAssets.LoadAsset<Texture2D>("T_Feedbacker");
					((Component)component).transform.localScale = new Vector3(4f, 4f, 4f);
					((Component)component).transform.localRotation = Quaternion.Euler(55f, 180f, 180f);
				}
			}
		}

		private static IEnumerator<WaitForSecondsRealtime> FeedbackerPunches(Punch punch)
		{
			AudioSource aud = Traverse.Create((object)punch).Field("aud").GetValue<AudioSource>();
			punch.anim.Play("Jab", 0, 0f);
			aud.Play();
			yield return new WaitForSecondsRealtime(1f);
			punch.anim.Play("Hook", 0, 0.05f);
			aud.Play();
		}

		private static void InstantiateFeedbacker(SkinnedMeshRenderer renderer, EnemySimplifier enemySimplifier)
		{
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Expected O, but got Unknown
			//IL_011a: 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_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			Material[] materials = ((Renderer)renderer).materials;
			materials[2] = funnyAssets.LoadAsset<Material>("Smoke");
			((Renderer)renderer).materials = materials;
			((Renderer)renderer).materials[2].color = new Color(1f, 1f, 1f, 0f);
			if ((Object)(object)enemySimplifier != (Object)null)
			{
				enemySimplifier.simplifiedMaterial3 = funnyAssets.LoadAsset<Material>("Smoke");
				enemySimplifier.simplifiedMaterial3.color = new Color(1.3f, 0.6f, 0.6f, 0f);
			}
			feedbacker = new GameObject("LeftArm");
			feedbacker.transform.SetParent(((Component)renderer).transform.parent.Find("metarig").Find("spine").Find("spine.001")
				.Find("spine.002")
				.Find("spine.003")
				.Find("shoulder.L")
				.Find("upper_arm.L"), false);
			feedbacker.transform.localScale = new Vector3(4f, 4f, 4f);
			feedbacker.transform.localPosition = new Vector3(0.02f, 0f, 0f);
			feedbacker.transform.localRotation = Quaternion.Euler(90f, 180f, 0f);
			SkinnedMeshRenderer val = feedbacker.AddComponent<SkinnedMeshRenderer>();
			((Renderer)val).material.mainTexture = (Texture)(object)funnyAssets.LoadAsset<Texture2D>("T_Feedbacker");
			((Renderer)val).material.color = new Color(1f, 1f, 1f, 1f);
			((Renderer)val).material.shader = ((Renderer)renderer).material.shader;
			val.sharedMesh = funnyAssets.LoadAsset<Mesh>("Feedbacker");
		}

		[HarmonyPatch(typeof(Machine), "GetHurt")]
		[HarmonyPrefix]
		private static void FeedbackerEnrageClairdeSoleil(Machine __instance)
		{
			V2 value = Traverse.Create((object)__instance).Field("v2").GetValue<V2>();
			EnemyIdentifier value2 = Traverse.Create((object)__instance).Field("eid").GetValue<EnemyIdentifier>();
			if ((Object)(object)value != (Object)null && value.secondEncounter && value2.hitter == "heavypunch")
			{
				kbPunch = true;
			}
			else
			{
				kbPunch = false;
			}
			if ((Object)(object)value != (Object)null && value.secondEncounter && value2.hitter == "punch")
			{
				kbPunch = false;
				value.InstaEnrage();
			}
		}

		[HarmonyPatch(typeof(V2), "InstaEnrage")]
		[HarmonyPrefix]
		private static bool V2InstaEnragePrefix()
		{
			if (kbPunch)
			{
				return false;
			}
			return true;
		}

		[HarmonyPatch(typeof(Revolver), "Update")]
		[HarmonyPostfix]
		private static void V2RevolverUpdate(Revolver __instance)
		{
			if (Time.timeScale != 0f && !__instance.altVersion)
			{
				__instance.shootCharge = shootCharge;
				if (__instance.shootCharge == 100f)
				{
					Traverse.Create((object)__instance).Field("gunReady").SetValue((object)true);
				}
			}
		}

		[HarmonyPatch(typeof(Revolver), "Shoot")]
		[HarmonyPrefix]
		private static void V2RevolverShoot(Revolver __instance, int shotType)
		{
			if (__instance.altVersion)
			{
				return;
			}
			revolverTimer = 0f;
			shootCharge = 0f;
			switch (shotType)
			{
			case 1:
				if (revolverShotNumber < dualWieldCount * 3)
				{
					revolverShotNumber++;
				}
				else
				{
					revolverShotNumber = 1;
				}
				break;
			case 2:
				altFireShot = true;
				break;
			}
			if (revolverShotNumber == dualWieldCount * 3 && __instance.gunVariation == 0 && __instance.pierceCharge >= 50f)
			{
				Traverse.Create((object)__instance).Field("pierceReady").SetValue((object)false);
				__instance.pierceCharge = 50f;
			}
		}

		[HarmonyPatch(typeof(Revolver), "Start")]
		[HarmonyPostfix]
		private static void V2RevolverStart(Revolver __instance)
		{
			if (!__instance.altVersion && revolverShotNumber == dualWieldCount * 3)
			{
				__instance.shootCharge = shootCharge;
				Traverse.Create((object)__instance).Field("shootReady").SetValue((object)false);
				if (__instance.gunVariation == 0)
				{
					Traverse.Create((object)__instance).Field("pierceReady").SetValue((object)false);
					__instance.pierceCharge = shootCharge / 2f + 50f;
				}
			}
		}

		[HarmonyPatch(typeof(Revolver), "OnEnable")]
		[HarmonyPostfix]
		private static void V2RevolverOnEnable(Revolver __instance)
		{
			if (!__instance.altVersion && revolverShotNumber == dualWieldCount * 3)
			{
				__instance.shootCharge = shootCharge;
				Traverse.Create((object)__instance).Field("shootReady").SetValue((object)false);
				if (__instance.gunVariation == 0)
				{
					Traverse.Create((object)__instance).Field("pierceReady").SetValue((object)false);
					__instance.pierceCharge = shootCharge / 2f + 50f;
				}
			}
		}

		[HarmonyPatch(typeof(RocketLauncher), "Shoot")]
		[HarmonyPrefix]
		private static void JohninatorRocketShoot(RocketLauncher __instance)
		{
			rocketTimer = 1f;
			rocketShotNumber++;
			if (rocketShotNumber < 3)
			{
				__instance.rateOfFire = 0.2f;
				return;
			}
			__instance.rateOfFire = 3.5f;
			rocketOverheated = true;
		}

		[HarmonyPatch(typeof(RocketLauncher), "Update")]
		[HarmonyPrefix]
		private static void JohninatorRocketUpdate(RocketLauncher __instance)
		{
			if (Time.timeScale == 0f)
			{
				overheatAudio.Pause();
				return;
			}
			if ((Object)(object)overheatGameObject == (Object)null)
			{
				InstantiateSmoke(__instance);
			}
			if (rocketTimer == 0f && rocketShotNumber > 0)
			{
				Traverse.Create((object)__instance).Field("cooldown").SetValue((object)0);
				rocketShotNumber = 0;
			}
			if (!rocketOverheated)
			{
				return;
			}
			if (!overheatAudio.isPlaying)
			{
				overheatAudio.Play();
				overheatParticles.Play();
			}
			if (Traverse.Create((object)__instance).Field("cooldown").GetValue<float>() == 0f)
			{
				rocketOverheated = false;
				rocketTimer = 0f;
				rocketShotNumber = 0;
				if (overheatAudio.isPlaying)
				{
					overheatAudio.Stop();
					overheatParticles.Stop();
				}
			}
		}

		[HarmonyPatch(typeof(RocketLauncher), "OnEnable")]
		[HarmonyPostfix]
		private static void JohninatorRocketOnEnable(RocketLauncher __instance)
		{
			if ((Object)(object)overheatGameObject == (Object)null)
			{
				InstantiateSmoke(__instance);
			}
			if (rocketOverheated && Traverse.Create((object)__instance).Field("cooldown").GetValue<float>() == 0.25f)
			{
				rocketOverheated = false;
				rocketTimer = 0f;
				rocketShotNumber = 0;
				if (overheatAudio.isPlaying)
				{
					overheatAudio.Stop();
					overheatParticles.Stop();
				}
			}
			if (!rocketOverheated)
			{
				__instance.rateOfFire = 0.2f;
			}
		}

		[HarmonyPatch(typeof(RocketLauncher), "OnDisable")]
		[HarmonyPostfix]
		private static void JohninatorRocketOnDisable()
		{
			if ((Object)(object)overheatGameObject != (Object)null)
			{
				Object.Destroy((Object)(object)overheatGameObject);
				overheatGameObject = null;
				overheatAudio = null;
				overheatParticles = null;
			}
		}

		[HarmonyPatch(typeof(RocketLauncher), "ShootCannonball")]
		[HarmonyPrefix]
		private static void JohninatorRocketShootCannonball(RocketLauncher __instance)
		{
			if (!rocketOverheated || (rocketOverheated && Traverse.Create((object)__instance).Field("cooldown").GetValue<float>() <= 1f))
			{
				__instance.rateOfFire = 1f;
			}
		}

		private static void InstantiateSmoke(RocketLauncher __instance)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Expected O, but got Unknown
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: 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_02a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
			overheatGameObject = new GameObject("JohninatorParticleSystem");
			overheatAudio = overheatGameObject.AddComponent<AudioSource>();
			overheatParticles = overheatGameObject.AddComponent<ParticleSystem>();
			ParticleSystemRenderer component = overheatGameObject.GetComponent<ParticleSystemRenderer>();
			((Renderer)component).material = funnyAssets.LoadAsset<Material>("Smoke");
			((Renderer)component).material.color = new Color(1f, 1f, 1f, 0.502f);
			((Renderer)component).material.globalIlluminationFlags = (MaterialGlobalIlluminationFlags)4;
			LocalKeyword val = default(LocalKeyword);
			((LocalKeyword)(ref val))..ctor(((Renderer)component).material.shader, "_ALPHABLEND_ON");
			LocalKeyword val2 = default(LocalKeyword);
			((LocalKeyword)(ref val2))..ctor(((Renderer)component).material.shader, "_ALPHABLEND_ON");
			LocalKeyword val3 = default(LocalKeyword);
			((LocalKeyword)(ref val3))..ctor(((Renderer)component).material.shader, "_ALPHABLEND_ON");
			((Renderer)component).material.DisableLocalKeyword(val);
			((Renderer)component).material.EnableLocalKeyword(val2);
			((Renderer)component).material.EnableLocalKeyword(val3);
			overheatAudio.clip = funnyAssets.LoadAsset<AudioClip>("steamLoop3.wav");
			overheatAudio.loop = true;
			overheatAudio.panStereo = 0.1f;
			overheatAudio.pitch = 0.75f;
			overheatAudio.playOnAwake = false;
			overheatAudio.volume = 0.75f;
			overheatAudio.outputAudioMixerGroup = ((Component)__instance).GetComponent<AudioSource>().outputAudioMixerGroup;
			ColorOverLifetimeModule colorOverLifetime = overheatParticles.colorOverLifetime;
			((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true;
			Gradient val4 = new Gradient();
			val4.SetKeys((GradientColorKey[])(object)new GradientColorKey[2]
			{
				new GradientColorKey(Color.white, 0f),
				new GradientColorKey(Color.white, 1f)
			}, (GradientAlphaKey[])(object)new GradientAlphaKey[2]
			{
				new GradientAlphaKey(1f, 0f),
				new GradientAlphaKey(0f, 1f)
			});
			((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val4);
			overheatParticles.emissionRate = 125f;
			overheatParticles.playOnAwake = false;
			overheatParticles.startLifetime = 0.25f;
			overheatParticles.startSize = 2.5f;
			overheatParticles.startSpeed = 50f;
			overheatGameObject.layer = 13;
			overheatGameObject.transform.SetParent(((Component)__instance).transform.Find("RocketLauncher").Find("Armature").Find("Body_Bone"));
			overheatGameObject.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f);
			overheatGameObject.transform.localPosition = new Vector3(0f, 0.355f, -0.1f);
			overheatGameObject.transform.localRotation = Quaternion.Euler(325f, 215f, 0f);
			overheatParticles.Stop();
		}

		[HarmonyPatch(typeof(Revolver), "OnEnable")]
		[HarmonyPostfix]
		private static void RevolverArmRenderers(Revolver __instance)
		{
			if (Object.op_Implicit((Object)(object)((Component)__instance).transform.Find("Revolver_Rerigged_Alternate")))
			{
				((Renderer)((Component)((Component)__instance).transform.Find("Revolver_Rerigged_Alternate").Find("RightArm")).GetComponent<SkinnedMeshRenderer>()).materials[0].mainTexture = (Texture)(object)funnyAssets.LoadAsset<Texture2D>("T_MainArm_V2");
			}
			else if (Object.op_Implicit((Object)(object)((Component)__instance).transform.Find("Revolver_Rerigged_Standard")))
			{
				((Renderer)((Component)((Component)__instance).transform.Find("Revolver_Rerigged_Standard").Find("RightArm")).GetComponent<SkinnedMeshRenderer>()).materials[0].mainTexture = (Texture)(object)funnyAssets.LoadAsset<Texture2D>("T_MainArm_V2");
			}
		}

		[HarmonyPatch(typeof(FishingRodWeapon), "Awake")]
		[HarmonyPostfix]
		private static void OtherArmRenderers(Revolver __instance)
		{
			if (Object.op_Implicit((Object)(object)((Component)__instance).transform.Find("AltRevolver_NewArm")))
			{
				((Renderer)((Component)((Component)__instance).transform.Find("AltRevolver_NewArm").Find("RightArm")).GetComponent<SkinnedMeshRenderer>()).materials[0].mainTexture = (Texture)(object)funnyAssets.LoadAsset<Texture2D>("T_MainArm_V2");
			}
			else if (Object.op_Implicit((Object)(object)((Component)__instance).transform.Find("Revolver_Rerigged_Alternate")))
			{
				((Renderer)((Component)((Component)__instance).transform.Find("Revolver_Rerigged_Alternate").Find("RightArm")).GetComponent<SkinnedMeshRenderer>()).materials[0].mainTexture = (Texture)(object)funnyAssets.LoadAsset<Texture2D>("T_MainArm_V2");
			}
		}

		[HarmonyPatch(typeof(PlatformerMovement), "Awake")]
		[HarmonyPostfix]
		private static void ClashModeRenderer(PlatformerMovement __instance)
		{
			SkinnedMeshRenderer component = ((Component)((Component)__instance).transform.Find("v1_combined").Find("v1_mdl")).GetComponent<SkinnedMeshRenderer>();
			for (int i = 0; i < 9; i++)
			{
				Material val = ((Renderer)component).materials[i];
				if (1 == 0)
				{
				}
				Texture2D mainTexture = ((i != 0) ? funnyAssets.LoadAsset<Texture2D>("v2_wingcolour_tex_new") : funnyAssets.LoadAsset<Texture2D>("v2colour_tex 1"));
				if (1 == 0)
				{
				}
				val.mainTexture = (Texture)(object)mainTexture;
			}
		}

		[HarmonyPatch(typeof(ClashModePickup), "Activate")]
		[HarmonyPostfix]
		private static void ClashDanceRenderer(ClashModePickup __instance)
		{
			GameObject value = Traverse.Create((object)__instance).Field("dancer").GetValue<GameObject>();
			SkinnedMeshRenderer component = ((Component)value.transform.Find("v1_combined").Find("v1_mdl")).GetComponent<SkinnedMeshRenderer>();
			for (int i = 0; i < 9; i++)
			{
				Material val = ((Renderer)component).materials[i];
				if (1 == 0)
				{
				}
				Texture2D mainTexture = ((i != 0) ? funnyAssets.LoadAsset<Texture2D>("v2_wingcolour_tex_new") : funnyAssets.LoadAsset<Texture2D>("v2colour_tex 1"));
				if (1 == 0)
				{
				}
				val.mainTexture = (Texture)(object)mainTexture;
			}
		}

		[HarmonyPatch(typeof(V2), "Awake")]
		[HarmonyPrefix]
		private static void V2AwakePrefix(V2 __instance)
		{
			if (Object.op_Implicit((Object)(object)((Component)__instance).transform.Find("v2_GreenArm")))
			{
				v2Renderer = ((Component)((Component)__instance).transform.Find("v2_GreenArm").Find("v2_mdl")).GetComponent<SkinnedMeshRenderer>();
				enemySimplifier = ((Component)((Component)__instance).transform.Find("v2_GreenArm").Find("v2_mdl")).GetComponent<EnemySimplifier>();
			}
			else if (Object.op_Implicit((Object)(object)((Component)__instance).transform.Find("v2_combined")))
			{
				v2Renderer = ((Component)((Component)__instance).transform.Find("v2_combined").Find("v2_mdl")).GetComponent<SkinnedMeshRenderer>();
				enemySimplifier = ((Component)((Component)__instance).transform.Find("v2_combined").Find("v2_mdl")).GetComponent<EnemySimplifier>();
				InstantiateFeedbacker(v2Renderer, enemySimplifier);
			}
			else
			{
				v2Renderer = null;
				enemySimplifier = null;
			}
			if (!(((Object)((Component)__instance).transform).name == "V3"))
			{
				__instance.wingTextures[0] = (Texture)(object)funnyAssets.LoadAsset<Texture2D>("v1_wingcolour_tex_new");
				__instance.wingTextures[1] = (Texture)(object)funnyAssets.LoadAsset<Texture2D>("v1_wingcolour_tex 1_new");
				__instance.wingTextures[2] = (Texture)(object)funnyAssets.LoadAsset<Texture2D>("v1_wingcolour_tex 2_new");
				__instance.wingTextures[3] = (Texture)(object)funnyAssets.LoadAsset<Texture2D>("v1_wingcolour_tex 3_new");
			}
		}

		[HarmonyPatch(typeof(V2), "Awake")]
		[HarmonyPostfix]
		private static void V2AwakePostfix(V2 __instance)
		{
			if (!(((Object)((Component)__instance).transform).name == "V3"))
			{
				((Renderer)v2Renderer).materials[0].mainTexture = (Texture)(object)funnyAssets.LoadAsset<Texture2D>("v1colour_tex");
				enemySimplifier.enragedMaterial = ((Renderer)v2Renderer).materials[0];
				BossHealthBar value = Traverse.Create((object)__instance).Field("bhb").GetValue<BossHealthBar>();
				if ((Object)(object)value != (Object)null && value.bossName == "V2")
				{
					value.bossName = "V1";
				}
			}
		}

		[HarmonyPatch(typeof(V2), "Update")]
		[HarmonyPostfix]
		private static void V2EnrageUnEnrage(V2 __instance)
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: 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_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			if (Time.timeScale == 0f)
			{
				return;
			}
			if (__instance.isEnraged && ((Renderer)v2Renderer).materials[0].color.r != 2f)
			{
				((Renderer)v2Renderer).materials[0].color = new Color(2f, 0f, 0f, 1f);
				((Renderer)v2Renderer).materials[1].color = new Color(2f, 0f, 0f, 1f);
				if (Object.op_Implicit((Object)(object)feedbacker) && ((Renderer)feedbacker.GetComponent<SkinnedMeshRenderer>()).materials[0].color.r != 2f)
				{
					((Renderer)feedbacker.GetComponent<SkinnedMeshRenderer>()).materials[0].color = new Color(2f, 0f, 0f, 1f);
				}
			}
			else if (!__instance.isEnraged && ((Renderer)v2Renderer).materials[0].color.r != 1f)
			{
				((Renderer)v2Renderer).materials[0].color = new Color(1f, 1f, 1f, 1f);
				((Renderer)v2Renderer).materials[1].color = new Color(1f, 1f, 1f, 1f);
				if (Object.op_Implicit((Object)(object)feedbacker) && ((Renderer)feedbacker.GetComponent<SkinnedMeshRenderer>()).materials[0].color.r != 1f)
				{
					((Renderer)feedbacker.GetComponent<SkinnedMeshRenderer>()).materials[0].color = new Color(1f, 1f, 1f, 1f);
				}
			}
		}

		[HarmonyPatch(typeof(ObjectActivator), "Start")]
		[HarmonyPostfix]
		private static void V2Cutscenes(ObjectActivator __instance)
		{
			if ((Object)(object)((Component)__instance).transform.parent != (Object)null && ((Object)((Component)__inst