Decompiled source of FixHunk v0.0.1

FixHunk.dll

Decompiled a year ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using HunkMod;
using HunkMod.Modules;
using HunkMod.Modules.Components;
using HunkMod.Modules.Survivors;
using Microsoft.CodeAnalysis;
using On.EntityStates.AcidLarva;
using On.EntityStates.BeetleGuardMonster;
using On.EntityStates.BeetleMonster;
using On.EntityStates.Bison;
using On.EntityStates.BrotherMonster;
using On.EntityStates.ClayBruiser.Weapon;
using On.EntityStates.ClayGrenadier;
using On.EntityStates.GlobalSkills.LunarDetonator;
using On.EntityStates.GlobalSkills.LunarNeedle;
using On.EntityStates.GolemMonster;
using On.EntityStates.JellyfishMonster;
using On.EntityStates.LemurianBruiserMonster;
using On.EntityStates.MiniMushroom;
using On.EntityStates.Missions.BrotherEncounter;
using On.EntityStates.ParentMonster;
using On.RoR2;
using On.RoR2.CameraModes;
using On.RoR2.UI;
using On.RoR2.UI.MainMenu;
using RoR2;
using RoR2.UI;
using UnityEngine;

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

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace FixHunk
{
	[BepInPlugin("_score.FixHunk", "FixHunk", "0.0.1")]
	public class FixHunkPlugin : BaseUnityPlugin
	{
		public const string PluginGUID = "_score.FixHunk";

		public const string PluginAuthor = "score";

		public const string PluginName = "FixHunk";

		public const string PluginVersion = "0.0.1";

		public void Awake()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			if (AccessTools.Field(typeof(MainPlugin), "MODVERSION").GetValue(null) as string == "2.4.4")
			{
				new Harmony("_score.FixHunk").CreateClassProcessor(typeof(Fix)).Patch();
				return;
			}
			Debug.LogError((object)"Hunk is fixed, uninstall this mod :)");
			Object.Destroy((Object)(object)this);
		}
	}
	[HarmonyPatch]
	public class Fix
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_CollectLookInput <0>__CameraModeBase_CollectLookInput;

			public static Action<DamageReport> <1>__GlobalEventManager_onCharacterDeathGlobal;

			public static hook_Start <2>__AddBadgeStart;

			public static Action<Inventory> <3>__ValidateBadge;

			public static Action<HUD> <4>__HUDSetup;

			public static hook_OnTeamLevelUp <5>__GlobalEventManager_OnTeamLevelUp;

			public static hook_OnInteractionBegin <6>__GlobalEventManager_OnInteractionBegin;

			public static hook_OnKilledServer <7>__DeathRewards_OnKilledServer;

			public static hook_ShowCurrentNotification <8>__NotificationUIController_ShowCurrentNotification;

			public static hook_Open <9>__ChestBehavior_Open;

			public static hook_ItemDrop <10>__ChestBehavior_ItemDrop;

			public static hook_Roll <11>__ChestBehavior_Roll;

			public static hook_CoinDrop <12>__BarrelInteraction_CoinDrop;

			public static hook_DropPickup <13>__ShopTerminalBehavior_DropPickup;

			public static hook_EjectPickupServer <14>__RouletteChestController_EjectPickupServer;

			public static hook_OnInteractionBegin <15>__PurchaseInteraction_OnInteractionBegin;

			public static hook_OnCollisionEnter <16>__PickupDropletController_OnCollisionEnter;

			public static hook_ApplyAmmoPack <17>__SkillLocator_ApplyAmmoPack;

			public static hook_UpdateOverlays <18>__CharacterModel_UpdateOverlays2;

			public static hook_UpdateOverlays <19>__CharacterModel_UpdateOverlays;

			public static hook_TakeDamage <20>__HealthComponent_TakeDamage;

			public static hook_ShrineRestackInventory <21>__Inventory_ShrineRestackInventory;

			public static Action<List<CostTypeDef>> <22>__AddHeartCostType;

			public static Action<List<CostTypeDef>> <23>__AddSpadeCostType;

			public static Action<List<CostTypeDef>> <24>__AddDiamondCostType;

			public static Action<List<CostTypeDef>> <25>__AddClubCostType;

			public static Action<List<CostTypeDef>> <26>__AddStarCostType;

			public static Action<List<CostTypeDef>> <27>__AddWristbandCostType;

			public static Action<List<CostTypeDef>> <28>__AddStarsBadgeCostType;

			public static Action<List<CostTypeDef>> <29>__AddSampleCostType;

			public static hook_OnDeathStart <30>__CharacterBody_OnDeathStart;

			public static hook_OnBodyDeath <31>__CharacterMaster_OnBodyDeath;

			public static hook_UpdateLastHitTime <32>__HealthComponent_UpdateLastHitTime;

			public static hook_TakeDamage <33>__TVirusDeathOn;

			public static Action<DamageReport> <34>__TVirusDeathDefied;

			public static hook_Start <35>__SceneDirector_Start;

			public static hook_Start <36>__Run_Start;

			public static hook_GetObjectiveSources <37>__ObjectivePanelController_GetObjectiveSources;

			public static hook_OnEnter <38>__Phase4_OnEnter;

			public static hook_AttemptGrant <39>__GenericPickupController_AttemptGrant;

			public static hook_Update <40>__HealthBar_Update;

			public static hook_GetBestBodyName <41>__MakeInfectedName;

			public static hook_Rebuild <42>__LoadoutPanelController_Rebuild;

			public static hook_FixedUpdate <43>__Charge_FixedUpdate;

			public static hook_FixedUpdate <44>__MinigunFire_FixedUpdate;

			public static hook_FixedUpdate <45>__WeaponSlam_FixedUpdate;

			public static hook_FixedUpdate <46>__GroundSlam_FixedUpdate;

			public static hook_FixedUpdate <47>__GroundSlam_FixedUpdate1;

			public static hook_FixedUpdate <48>__JellyNova_FixedUpdate;

			public static hook_FixedUpdate <49>__LarvaLeap_FixedUpdate;

			public static hook_FixedUpdate <50>__ChargeLaser_FixedUpdate;

			public static hook_FixedUpdate <51>__Flamebreath_FixedUpdate;

			public static hook_FixedUpdate <52>__ChargeMegaFireball_FixedUpdate;

			public static hook_FixedUpdate <53>__FaceSlam_FixedUpdate;

			public static hook_FixedUpdate <54>__SporeGrenade_FixedUpdate;

			public static hook_FixedUpdate <55>__HeadbuttState_FixedUpdate;

			public static hook_OnEnter <56>__FireMegaFireball_OnEnter;

			public static hook_FireFlame <57>__Flamebreath_FireFlame;

			public static hook_BeginEscapeSequence <58>__EscapeSequenceController_BeginEscapeSequence;

			public static hook_OnSkillActivated <59>__CharacterBody_OnSkillActivated;

			public static hook_Start <60>__ShakeEmitter_Start;

			public static hook_OnAllEnemiesDefeatedServer <61>__InfiniteTowerBossWaveController_OnAllEnemiesDefeatedServer;

			public static hook_Awake <62>__BaseMainMenuScreen_Awake;

			public static hook_Update <63>__BaseMainMenuScreen_Update;

			public static hook_OnEnter <64>__PlayVisionsAnimation;

			public static hook_PlayChargeAnimation <65>__PlayChargeLunarAnimation;

			public static hook_PlayThrowAnimation <66>__PlayThrowLunarAnimation;

			public static hook_OnEnter <67>__PlayRuinAnimation;
		}

		[HarmonyPatch(typeof(MainPlugin), "LateSetup")]
		[HarmonyPrefix]
		public static bool Patch2()
		{
			return false;
		}

		[HarmonyPatch(typeof(Hunk), "Hook")]
		[HarmonyPrefix]
		public static bool Patch()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Expected O, but got Unknown
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Expected O, but got Unknown
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Expected O, but got Unknown
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Expected O, but got Unknown
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Expected O, but got Unknown
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Expected O, but got Unknown
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Expected O, but got Unknown
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Expected O, but got Unknown
			//IL_0190: 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_019b: Expected O, but got Unknown
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Expected O, but got Unknown
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01db: Expected O, but got Unknown
			//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Expected O, but got Unknown
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_0215: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Expected O, but got Unknown
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_023b: Expected O, but got Unknown
			//IL_025c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_0267: Expected O, but got Unknown
			//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_02af: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b5: Expected O, but got Unknown
			//IL_028a: Unknown result type (might be due to invalid IL or missing references)
			//IL_028f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0295: Expected O, but got Unknown
			//IL_02ca: 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_02d5: Expected O, but got Unknown
			//IL_0412: Unknown result type (might be due to invalid IL or missing references)
			//IL_0417: Unknown result type (might be due to invalid IL or missing references)
			//IL_041d: Expected O, but got Unknown
			//IL_0432: Unknown result type (might be due to invalid IL or missing references)
			//IL_0437: Unknown result type (might be due to invalid IL or missing references)
			//IL_043d: Expected O, but got Unknown
			//IL_0452: Unknown result type (might be due to invalid IL or missing references)
			//IL_0457: Unknown result type (might be due to invalid IL or missing references)
			//IL_045d: Expected O, but got Unknown
			//IL_0472: Unknown result type (might be due to invalid IL or missing references)
			//IL_0477: Unknown result type (might be due to invalid IL or missing references)
			//IL_047d: Expected O, but got Unknown
			//IL_04b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bd: Expected O, but got Unknown
			//IL_04d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04dd: Expected O, but got Unknown
			//IL_04f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fd: Expected O, but got Unknown
			//IL_0512: Unknown result type (might be due to invalid IL or missing references)
			//IL_0517: Unknown result type (might be due to invalid IL or missing references)
			//IL_051d: Expected O, but got Unknown
			//IL_0532: Unknown result type (might be due to invalid IL or missing references)
			//IL_0537: Unknown result type (might be due to invalid IL or missing references)
			//IL_053d: Expected O, but got Unknown
			//IL_0552: Unknown result type (might be due to invalid IL or missing references)
			//IL_0557: Unknown result type (might be due to invalid IL or missing references)
			//IL_055d: Expected O, but got Unknown
			//IL_0572: Unknown result type (might be due to invalid IL or missing references)
			//IL_0577: Unknown result type (might be due to invalid IL or missing references)
			//IL_057d: Expected O, but got Unknown
			//IL_0592: Unknown result type (might be due to invalid IL or missing references)
			//IL_0597: Unknown result type (might be due to invalid IL or missing references)
			//IL_059d: Expected O, but got Unknown
			//IL_05b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bd: Expected O, but got Unknown
			//IL_05d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05dd: Expected O, but got Unknown
			//IL_05f2: 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_05fd: Expected O, but got Unknown
			//IL_0612: Unknown result type (might be due to invalid IL or missing references)
			//IL_0617: Unknown result type (might be due to invalid IL or missing references)
			//IL_061d: Expected O, but got Unknown
			//IL_0632: Unknown result type (might be due to invalid IL or missing references)
			//IL_0637: Unknown result type (might be due to invalid IL or missing references)
			//IL_063d: Expected O, but got Unknown
			//IL_0652: Unknown result type (might be due to invalid IL or missing references)
			//IL_0657: Unknown result type (might be due to invalid IL or missing references)
			//IL_065d: Expected O, but got Unknown
			//IL_0672: Unknown result type (might be due to invalid IL or missing references)
			//IL_0677: Unknown result type (might be due to invalid IL or missing references)
			//IL_067d: Expected O, but got Unknown
			//IL_0692: Unknown result type (might be due to invalid IL or missing references)
			//IL_0697: Unknown result type (might be due to invalid IL or missing references)
			//IL_069d: Expected O, but got Unknown
			//IL_06b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_06bd: Expected O, but got Unknown
			//IL_06d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_06dd: Expected O, but got Unknown
			//IL_06f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_06fd: Expected O, but got Unknown
			//IL_0712: Unknown result type (might be due to invalid IL or missing references)
			//IL_0717: Unknown result type (might be due to invalid IL or missing references)
			//IL_071d: Expected O, but got Unknown
			//IL_0759: Unknown result type (might be due to invalid IL or missing references)
			//IL_075e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0764: Expected O, but got Unknown
			//IL_0739: Unknown result type (might be due to invalid IL or missing references)
			//IL_073e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0744: Expected O, but got Unknown
			//IL_0779: Unknown result type (might be due to invalid IL or missing references)
			//IL_077e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0784: Expected O, but got Unknown
			//IL_0799: Unknown result type (might be due to invalid IL or missing references)
			//IL_079e: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a4: Expected O, but got Unknown
			//IL_07b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_07be: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c4: Expected O, but got Unknown
			//IL_0805: Unknown result type (might be due to invalid IL or missing references)
			//IL_080a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0810: Expected O, but got Unknown
			//IL_07e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f0: Expected O, but got Unknown
			//IL_0825: Unknown result type (might be due to invalid IL or missing references)
			//IL_082a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0830: Expected O, but got Unknown
			//IL_0845: Unknown result type (might be due to invalid IL or missing references)
			//IL_084a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0850: Expected O, but got Unknown
			//IL_0865: Unknown result type (might be due to invalid IL or missing references)
			//IL_086a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0870: Expected O, but got Unknown
			//IL_0885: Unknown result type (might be due to invalid IL or missing references)
			//IL_088a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0890: Expected O, but got Unknown
			//IL_08a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_08aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b0: Expected O, but got Unknown
			//IL_08c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d0: Expected O, but got Unknown
			object obj = <>O.<0>__CameraModeBase_CollectLookInput;
			if (obj == null)
			{
				hook_CollectLookInput val = Hunk.CameraModeBase_CollectLookInput;
				<>O.<0>__CameraModeBase_CollectLookInput = val;
				obj = (object)val;
			}
			CameraModeBase.CollectLookInput += (hook_CollectLookInput)obj;
			GlobalEventManager.onCharacterDeathGlobal += Hunk.GlobalEventManager_onCharacterDeathGlobal;
			object obj2 = <>O.<2>__AddBadgeStart;
			if (obj2 == null)
			{
				hook_Start val2 = Hunk.AddBadgeStart;
				<>O.<2>__AddBadgeStart = val2;
				obj2 = (object)val2;
			}
			CharacterBody.Start += (hook_Start)obj2;
			Inventory.onInventoryChangedGlobal += Hunk.ValidateBadge;
			HUD.onHudTargetChangedGlobal += Hunk.HUDSetup;
			object obj3 = <>O.<5>__GlobalEventManager_OnTeamLevelUp;
			if (obj3 == null)
			{
				hook_OnTeamLevelUp val3 = Hunk.GlobalEventManager_OnTeamLevelUp;
				<>O.<5>__GlobalEventManager_OnTeamLevelUp = val3;
				obj3 = (object)val3;
			}
			GlobalEventManager.OnTeamLevelUp += (hook_OnTeamLevelUp)obj3;
			object obj4 = <>O.<6>__GlobalEventManager_OnInteractionBegin;
			if (obj4 == null)
			{
				hook_OnInteractionBegin val4 = Hunk.GlobalEventManager_OnInteractionBegin;
				<>O.<6>__GlobalEventManager_OnInteractionBegin = val4;
				obj4 = (object)val4;
			}
			GlobalEventManager.OnInteractionBegin += (hook_OnInteractionBegin)obj4;
			object obj5 = <>O.<7>__DeathRewards_OnKilledServer;
			if (obj5 == null)
			{
				hook_OnKilledServer val5 = Hunk.DeathRewards_OnKilledServer;
				<>O.<7>__DeathRewards_OnKilledServer = val5;
				obj5 = (object)val5;
			}
			DeathRewards.OnKilledServer += (hook_OnKilledServer)obj5;
			object obj6 = <>O.<8>__NotificationUIController_ShowCurrentNotification;
			if (obj6 == null)
			{
				hook_ShowCurrentNotification val6 = Hunk.NotificationUIController_ShowCurrentNotification;
				<>O.<8>__NotificationUIController_ShowCurrentNotification = val6;
				obj6 = (object)val6;
			}
			NotificationUIController.ShowCurrentNotification += (hook_ShowCurrentNotification)obj6;
			object obj7 = <>O.<9>__ChestBehavior_Open;
			if (obj7 == null)
			{
				hook_Open val7 = Hunk.ChestBehavior_Open;
				<>O.<9>__ChestBehavior_Open = val7;
				obj7 = (object)val7;
			}
			ChestBehavior.Open += (hook_Open)obj7;
			object obj8 = <>O.<10>__ChestBehavior_ItemDrop;
			if (obj8 == null)
			{
				hook_ItemDrop val8 = Hunk.ChestBehavior_ItemDrop;
				<>O.<10>__ChestBehavior_ItemDrop = val8;
				obj8 = (object)val8;
			}
			ChestBehavior.ItemDrop += (hook_ItemDrop)obj8;
			object obj9 = <>O.<11>__ChestBehavior_Roll;
			if (obj9 == null)
			{
				hook_Roll val9 = Hunk.ChestBehavior_Roll;
				<>O.<11>__ChestBehavior_Roll = val9;
				obj9 = (object)val9;
			}
			ChestBehavior.Roll += (hook_Roll)obj9;
			object obj10 = <>O.<12>__BarrelInteraction_CoinDrop;
			if (obj10 == null)
			{
				hook_CoinDrop val10 = Hunk.BarrelInteraction_CoinDrop;
				<>O.<12>__BarrelInteraction_CoinDrop = val10;
				obj10 = (object)val10;
			}
			BarrelInteraction.CoinDrop += (hook_CoinDrop)obj10;
			object obj11 = <>O.<13>__ShopTerminalBehavior_DropPickup;
			if (obj11 == null)
			{
				hook_DropPickup val11 = Hunk.ShopTerminalBehavior_DropPickup;
				<>O.<13>__ShopTerminalBehavior_DropPickup = val11;
				obj11 = (object)val11;
			}
			ShopTerminalBehavior.DropPickup += (hook_DropPickup)obj11;
			object obj12 = <>O.<14>__RouletteChestController_EjectPickupServer;
			if (obj12 == null)
			{
				hook_EjectPickupServer val12 = Hunk.RouletteChestController_EjectPickupServer;
				<>O.<14>__RouletteChestController_EjectPickupServer = val12;
				obj12 = (object)val12;
			}
			RouletteChestController.EjectPickupServer += (hook_EjectPickupServer)obj12;
			object obj13 = <>O.<15>__PurchaseInteraction_OnInteractionBegin;
			if (obj13 == null)
			{
				hook_OnInteractionBegin val13 = Hunk.PurchaseInteraction_OnInteractionBegin;
				<>O.<15>__PurchaseInteraction_OnInteractionBegin = val13;
				obj13 = (object)val13;
			}
			PurchaseInteraction.OnInteractionBegin += (hook_OnInteractionBegin)obj13;
			object obj14 = <>O.<16>__PickupDropletController_OnCollisionEnter;
			if (obj14 == null)
			{
				hook_OnCollisionEnter val14 = Hunk.PickupDropletController_OnCollisionEnter;
				<>O.<16>__PickupDropletController_OnCollisionEnter = val14;
				obj14 = (object)val14;
			}
			PickupDropletController.OnCollisionEnter += (hook_OnCollisionEnter)obj14;
			object obj15 = <>O.<17>__SkillLocator_ApplyAmmoPack;
			if (obj15 == null)
			{
				hook_ApplyAmmoPack val15 = Hunk.SkillLocator_ApplyAmmoPack;
				<>O.<17>__SkillLocator_ApplyAmmoPack = val15;
				obj15 = (object)val15;
			}
			SkillLocator.ApplyAmmoPack += (hook_ApplyAmmoPack)obj15;
			if (Config.fancyShieldGlobal.Value)
			{
				object obj16 = <>O.<18>__CharacterModel_UpdateOverlays2;
				if (obj16 == null)
				{
					hook_UpdateOverlays val16 = Hunk.CharacterModel_UpdateOverlays2;
					<>O.<18>__CharacterModel_UpdateOverlays2 = val16;
					obj16 = (object)val16;
				}
				CharacterModel.UpdateOverlays += (hook_UpdateOverlays)obj16;
			}
			else if (Config.fancyShield.Value)
			{
				object obj17 = <>O.<19>__CharacterModel_UpdateOverlays;
				if (obj17 == null)
				{
					hook_UpdateOverlays val17 = Hunk.CharacterModel_UpdateOverlays;
					<>O.<19>__CharacterModel_UpdateOverlays = val17;
					obj17 = (object)val17;
				}
				CharacterModel.UpdateOverlays += (hook_UpdateOverlays)obj17;
			}
			object obj18 = <>O.<20>__HealthComponent_TakeDamage;
			if (obj18 == null)
			{
				hook_TakeDamage val18 = Hunk.HealthComponent_TakeDamage;
				<>O.<20>__HealthComponent_TakeDamage = val18;
				obj18 = (object)val18;
			}
			HealthComponent.TakeDamage += (hook_TakeDamage)obj18;
			object obj19 = <>O.<21>__Inventory_ShrineRestackInventory;
			if (obj19 == null)
			{
				hook_ShrineRestackInventory val19 = Hunk.Inventory_ShrineRestackInventory;
				<>O.<21>__Inventory_ShrineRestackInventory = val19;
				obj19 = (object)val19;
			}
			Inventory.ShrineRestackInventory += (hook_ShrineRestackInventory)obj19;
			CostTypeCatalog.modHelper.getAdditionalEntries += Hunk.AddHeartCostType;
			CostTypeCatalog.modHelper.getAdditionalEntries += Hunk.AddSpadeCostType;
			CostTypeCatalog.modHelper.getAdditionalEntries += Hunk.AddDiamondCostType;
			CostTypeCatalog.modHelper.getAdditionalEntries += Hunk.AddClubCostType;
			CostTypeCatalog.modHelper.getAdditionalEntries += Hunk.AddStarCostType;
			CostTypeCatalog.modHelper.getAdditionalEntries += Hunk.AddWristbandCostType;
			CostTypeCatalog.modHelper.getAdditionalEntries += Hunk.AddStarsBadgeCostType;
			CostTypeCatalog.modHelper.getAdditionalEntries += Hunk.AddSampleCostType;
			object obj20 = <>O.<30>__CharacterBody_OnDeathStart;
			if (obj20 == null)
			{
				hook_OnDeathStart val20 = Hunk.CharacterBody_OnDeathStart;
				<>O.<30>__CharacterBody_OnDeathStart = val20;
				obj20 = (object)val20;
			}
			CharacterBody.OnDeathStart += (hook_OnDeathStart)obj20;
			object obj21 = <>O.<31>__CharacterMaster_OnBodyDeath;
			if (obj21 == null)
			{
				hook_OnBodyDeath val21 = Hunk.CharacterMaster_OnBodyDeath;
				<>O.<31>__CharacterMaster_OnBodyDeath = val21;
				obj21 = (object)val21;
			}
			CharacterMaster.OnBodyDeath += (hook_OnBodyDeath)obj21;
			object obj22 = <>O.<32>__HealthComponent_UpdateLastHitTime;
			if (obj22 == null)
			{
				hook_UpdateLastHitTime val22 = HealthComponent_UpdateLastHitTime;
				<>O.<32>__HealthComponent_UpdateLastHitTime = val22;
				obj22 = (object)val22;
			}
			HealthComponent.UpdateLastHitTime += (hook_UpdateLastHitTime)obj22;
			object obj23 = <>O.<33>__TVirusDeathOn;
			if (obj23 == null)
			{
				hook_TakeDamage val23 = Hunk.TVirusDeathOn;
				<>O.<33>__TVirusDeathOn = val23;
				obj23 = (object)val23;
			}
			HealthComponent.TakeDamage += (hook_TakeDamage)obj23;
			GlobalEventManager.onCharacterDeathGlobal += Hunk.TVirusDeathDefied;
			object obj24 = <>O.<35>__SceneDirector_Start;
			if (obj24 == null)
			{
				hook_Start val24 = Hunk.SceneDirector_Start;
				<>O.<35>__SceneDirector_Start = val24;
				obj24 = (object)val24;
			}
			SceneDirector.Start += (hook_Start)obj24;
			object obj25 = <>O.<36>__Run_Start;
			if (obj25 == null)
			{
				hook_Start val25 = Hunk.Run_Start;
				<>O.<36>__Run_Start = val25;
				obj25 = (object)val25;
			}
			Run.Start += (hook_Start)obj25;
			object obj26 = <>O.<37>__ObjectivePanelController_GetObjectiveSources;
			if (obj26 == null)
			{
				hook_GetObjectiveSources val26 = Hunk.ObjectivePanelController_GetObjectiveSources;
				<>O.<37>__ObjectivePanelController_GetObjectiveSources = val26;
				obj26 = (object)val26;
			}
			ObjectivePanelController.GetObjectiveSources += (hook_GetObjectiveSources)obj26;
			object obj27 = <>O.<38>__Phase4_OnEnter;
			if (obj27 == null)
			{
				hook_OnEnter val27 = Hunk.Phase4_OnEnter;
				<>O.<38>__Phase4_OnEnter = val27;
				obj27 = (object)val27;
			}
			Phase4.OnEnter += (hook_OnEnter)obj27;
			object obj28 = <>O.<39>__GenericPickupController_AttemptGrant;
			if (obj28 == null)
			{
				hook_AttemptGrant val28 = Hunk.GenericPickupController_AttemptGrant;
				<>O.<39>__GenericPickupController_AttemptGrant = val28;
				obj28 = (object)val28;
			}
			GenericPickupController.AttemptGrant += (hook_AttemptGrant)obj28;
			object obj29 = <>O.<40>__HealthBar_Update;
			if (obj29 == null)
			{
				hook_Update val29 = Hunk.HealthBar_Update;
				<>O.<40>__HealthBar_Update = val29;
				obj29 = (object)val29;
			}
			HealthBar.Update += (hook_Update)obj29;
			object obj30 = <>O.<41>__MakeInfectedName;
			if (obj30 == null)
			{
				hook_GetBestBodyName val30 = Hunk.MakeInfectedName;
				<>O.<41>__MakeInfectedName = val30;
				obj30 = (object)val30;
			}
			Util.GetBestBodyName += (hook_GetBestBodyName)obj30;
			object obj31 = <>O.<42>__LoadoutPanelController_Rebuild;
			if (obj31 == null)
			{
				hook_Rebuild val31 = Hunk.LoadoutPanelController_Rebuild;
				<>O.<42>__LoadoutPanelController_Rebuild = val31;
				obj31 = (object)val31;
			}
			LoadoutPanelController.Rebuild += (hook_Rebuild)obj31;
			object obj32 = <>O.<43>__Charge_FixedUpdate;
			if (obj32 == null)
			{
				hook_FixedUpdate val32 = Hunk.Charge_FixedUpdate;
				<>O.<43>__Charge_FixedUpdate = val32;
				obj32 = (object)val32;
			}
			Charge.FixedUpdate += (hook_FixedUpdate)obj32;
			object obj33 = <>O.<44>__MinigunFire_FixedUpdate;
			if (obj33 == null)
			{
				hook_FixedUpdate val33 = Hunk.MinigunFire_FixedUpdate;
				<>O.<44>__MinigunFire_FixedUpdate = val33;
				obj33 = (object)val33;
			}
			MinigunFire.FixedUpdate += (hook_FixedUpdate)obj33;
			object obj34 = <>O.<45>__WeaponSlam_FixedUpdate;
			if (obj34 == null)
			{
				hook_FixedUpdate val34 = Hunk.WeaponSlam_FixedUpdate;
				<>O.<45>__WeaponSlam_FixedUpdate = val34;
				obj34 = (object)val34;
			}
			WeaponSlam.FixedUpdate += (hook_FixedUpdate)obj34;
			object obj35 = <>O.<46>__GroundSlam_FixedUpdate;
			if (obj35 == null)
			{
				hook_FixedUpdate val35 = Hunk.GroundSlam_FixedUpdate;
				<>O.<46>__GroundSlam_FixedUpdate = val35;
				obj35 = (object)val35;
			}
			GroundSlam.FixedUpdate += (hook_FixedUpdate)obj35;
			object obj36 = <>O.<47>__GroundSlam_FixedUpdate1;
			if (obj36 == null)
			{
				hook_FixedUpdate val36 = Hunk.GroundSlam_FixedUpdate1;
				<>O.<47>__GroundSlam_FixedUpdate1 = val36;
				obj36 = (object)val36;
			}
			GroundSlam.FixedUpdate += (hook_FixedUpdate)obj36;
			object obj37 = <>O.<48>__JellyNova_FixedUpdate;
			if (obj37 == null)
			{
				hook_FixedUpdate val37 = Hunk.JellyNova_FixedUpdate;
				<>O.<48>__JellyNova_FixedUpdate = val37;
				obj37 = (object)val37;
			}
			JellyNova.FixedUpdate += (hook_FixedUpdate)obj37;
			object obj38 = <>O.<49>__LarvaLeap_FixedUpdate;
			if (obj38 == null)
			{
				hook_FixedUpdate val38 = Hunk.LarvaLeap_FixedUpdate;
				<>O.<49>__LarvaLeap_FixedUpdate = val38;
				obj38 = (object)val38;
			}
			LarvaLeap.FixedUpdate += (hook_FixedUpdate)obj38;
			object obj39 = <>O.<50>__ChargeLaser_FixedUpdate;
			if (obj39 == null)
			{
				hook_FixedUpdate val39 = Hunk.ChargeLaser_FixedUpdate;
				<>O.<50>__ChargeLaser_FixedUpdate = val39;
				obj39 = (object)val39;
			}
			ChargeLaser.FixedUpdate += (hook_FixedUpdate)obj39;
			object obj40 = <>O.<51>__Flamebreath_FixedUpdate;
			if (obj40 == null)
			{
				hook_FixedUpdate val40 = Hunk.Flamebreath_FixedUpdate;
				<>O.<51>__Flamebreath_FixedUpdate = val40;
				obj40 = (object)val40;
			}
			Flamebreath.FixedUpdate += (hook_FixedUpdate)obj40;
			object obj41 = <>O.<52>__ChargeMegaFireball_FixedUpdate;
			if (obj41 == null)
			{
				hook_FixedUpdate val41 = Hunk.ChargeMegaFireball_FixedUpdate;
				<>O.<52>__ChargeMegaFireball_FixedUpdate = val41;
				obj41 = (object)val41;
			}
			ChargeMegaFireball.FixedUpdate += (hook_FixedUpdate)obj41;
			object obj42 = <>O.<53>__FaceSlam_FixedUpdate;
			if (obj42 == null)
			{
				hook_FixedUpdate val42 = Hunk.FaceSlam_FixedUpdate;
				<>O.<53>__FaceSlam_FixedUpdate = val42;
				obj42 = (object)val42;
			}
			FaceSlam.FixedUpdate += (hook_FixedUpdate)obj42;
			object obj43 = <>O.<54>__SporeGrenade_FixedUpdate;
			if (obj43 == null)
			{
				hook_FixedUpdate val43 = Hunk.SporeGrenade_FixedUpdate;
				<>O.<54>__SporeGrenade_FixedUpdate = val43;
				obj43 = (object)val43;
			}
			SporeGrenade.FixedUpdate += (hook_FixedUpdate)obj43;
			if (MainPlugin.infernoInstalled)
			{
				object obj44 = <>O.<55>__HeadbuttState_FixedUpdate;
				if (obj44 == null)
				{
					hook_FixedUpdate val44 = Hunk.HeadbuttState_FixedUpdate;
					<>O.<55>__HeadbuttState_FixedUpdate = val44;
					obj44 = (object)val44;
				}
				HeadbuttState.FixedUpdate += (hook_FixedUpdate)obj44;
			}
			object obj45 = <>O.<56>__FireMegaFireball_OnEnter;
			if (obj45 == null)
			{
				hook_OnEnter val45 = Hunk.FireMegaFireball_OnEnter;
				<>O.<56>__FireMegaFireball_OnEnter = val45;
				obj45 = (object)val45;
			}
			FireMegaFireball.OnEnter += (hook_OnEnter)obj45;
			object obj46 = <>O.<57>__Flamebreath_FireFlame;
			if (obj46 == null)
			{
				hook_FireFlame val46 = Hunk.Flamebreath_FireFlame;
				<>O.<57>__Flamebreath_FireFlame = val46;
				obj46 = (object)val46;
			}
			Flamebreath.FireFlame += (hook_FireFlame)obj46;
			object obj47 = <>O.<58>__EscapeSequenceController_BeginEscapeSequence;
			if (obj47 == null)
			{
				hook_BeginEscapeSequence val47 = Hunk.EscapeSequenceController_BeginEscapeSequence;
				<>O.<58>__EscapeSequenceController_BeginEscapeSequence = val47;
				obj47 = (object)val47;
			}
			EscapeSequenceController.BeginEscapeSequence += (hook_BeginEscapeSequence)obj47;
			object obj48 = <>O.<59>__CharacterBody_OnSkillActivated;
			if (obj48 == null)
			{
				hook_OnSkillActivated val48 = Hunk.CharacterBody_OnSkillActivated;
				<>O.<59>__CharacterBody_OnSkillActivated = val48;
				obj48 = (object)val48;
			}
			CharacterBody.OnSkillActivated += (hook_OnSkillActivated)obj48;
			if (Config.reduceScreenShake.Value)
			{
				object obj49 = <>O.<60>__ShakeEmitter_Start;
				if (obj49 == null)
				{
					hook_Start val49 = Hunk.ShakeEmitter_Start;
					<>O.<60>__ShakeEmitter_Start = val49;
					obj49 = (object)val49;
				}
				ShakeEmitter.Start += (hook_Start)obj49;
			}
			object obj50 = <>O.<61>__InfiniteTowerBossWaveController_OnAllEnemiesDefeatedServer;
			if (obj50 == null)
			{
				hook_OnAllEnemiesDefeatedServer val50 = Hunk.InfiniteTowerBossWaveController_OnAllEnemiesDefeatedServer;
				<>O.<61>__InfiniteTowerBossWaveController_OnAllEnemiesDefeatedServer = val50;
				obj50 = (object)val50;
			}
			InfiniteTowerBossWaveController.OnAllEnemiesDefeatedServer += (hook_OnAllEnemiesDefeatedServer)obj50;
			object obj51 = <>O.<62>__BaseMainMenuScreen_Awake;
			if (obj51 == null)
			{
				hook_Awake val51 = Hunk.BaseMainMenuScreen_Awake;
				<>O.<62>__BaseMainMenuScreen_Awake = val51;
				obj51 = (object)val51;
			}
			BaseMainMenuScreen.Awake += (hook_Awake)obj51;
			object obj52 = <>O.<63>__BaseMainMenuScreen_Update;
			if (obj52 == null)
			{
				hook_Update val52 = Hunk.BaseMainMenuScreen_Update;
				<>O.<63>__BaseMainMenuScreen_Update = val52;
				obj52 = (object)val52;
			}
			BaseMainMenuScreen.Update += (hook_Update)obj52;
			object obj53 = <>O.<64>__PlayVisionsAnimation;
			if (obj53 == null)
			{
				hook_OnEnter val53 = Hunk.PlayVisionsAnimation;
				<>O.<64>__PlayVisionsAnimation = val53;
				obj53 = (object)val53;
			}
			FireLunarNeedle.OnEnter += (hook_OnEnter)obj53;
			object obj54 = <>O.<65>__PlayChargeLunarAnimation;
			if (obj54 == null)
			{
				hook_PlayChargeAnimation val54 = Hunk.PlayChargeLunarAnimation;
				<>O.<65>__PlayChargeLunarAnimation = val54;
				obj54 = (object)val54;
			}
			ChargeLunarSecondary.PlayChargeAnimation += (hook_PlayChargeAnimation)obj54;
			object obj55 = <>O.<66>__PlayThrowLunarAnimation;
			if (obj55 == null)
			{
				hook_PlayThrowAnimation val55 = Hunk.PlayThrowLunarAnimation;
				<>O.<66>__PlayThrowLunarAnimation = val55;
				obj55 = (object)val55;
			}
			ThrowLunarSecondary.PlayThrowAnimation += (hook_PlayThrowAnimation)obj55;
			object obj56 = <>O.<67>__PlayRuinAnimation;
			if (obj56 == null)
			{
				hook_OnEnter val56 = Hunk.PlayRuinAnimation;
				<>O.<67>__PlayRuinAnimation = val56;
				obj56 = (object)val56;
			}
			Detonate.OnEnter += (hook_OnEnter)obj56;
			return false;
		}

		public static void HealthComponent_UpdateLastHitTime(orig_UpdateLastHitTime orig, HealthComponent self, float damageValue, Vector3 damagePosition, bool damageIsSilent, GameObject attacker, bool delayedDamage, bool firstHitOfDelayedDamage)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, damageValue, damagePosition, damageIsSilent, attacker, delayedDamage, firstHitOfDelayedDamage);
			if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body) && ((Object)((Component)self.body).gameObject).name.Contains("RobNemesis") && self.health <= 0f)
			{
				self.health = 1f;
			}
			if (!Object.op_Implicit((Object)(object)self) || !Object.op_Implicit((Object)(object)self.body) || (!self.body.HasBuff(Hunk.infectedBuff2) && !self.body.HasBuff(Hunk.infectedBuff3)) || !(self.health <= 0f) || !Object.op_Implicit((Object)(object)self.body.master))
			{
				return;
			}
			TVirusMaster component = ((Component)self.body.master).GetComponent<TVirusMaster>();
			if (Object.op_Implicit((Object)(object)component) && component.revivalCount > 0)
			{
				self.health = 1f;
				return;
			}
			CVirusMaster component2 = ((Component)self.body.master).GetComponent<CVirusMaster>();
			if (Object.op_Implicit((Object)(object)component2) && component2.revivalCount > 0)
			{
				self.health = 1f;
			}
		}
	}
}