Decompiled source of ChunkyMode v0.4.7

ChunkyMode.dll

Decompiled a day ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.Seeker;
using EntityStates.Treebot.TreebotFlower;
using HDeMods.CM;
using HDeMods.HurricaneOptionalMods;
using HG.Reflection;
using HarmonyLib;
using IL.EntityStates.Seeker;
using IL.EntityStates.Treebot.TreebotFlower;
using IL.EntityStates.VoidSurvivor.Weapon;
using IL.RoR2;
using IL.RoR2.Projectile;
using MaterialHud;
using Microsoft.CodeAnalysis;
using ModdedEntityStates.Aliem;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using MonoMod.RuntimeDetour;
using On.RoR2;
using ProperSave;
using ProperSave.Data;
using R2API;
using RedGuyMod.Content;
using RiskOfOptions;
using RiskOfOptions.Components.Options;
using RiskOfOptions.Components.Panel;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.Orbs;
using RoR2.Projectile;
using SS2.Survivors;
using SubmarinerMod.SubmarinerCharacter;
using UnityEngine;
using UnityEngine.Bindings;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.Serialization;

[assembly: OptIn]
[assembly: IgnoresAccessChecksTo("RiskOfOptions")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyInformationalVersion("1.0.0+a9fed24b96e13cf5f489a1f0d38e53beff9df93e")]
[assembly: AssemblyProduct("ChunkyMode")]
[assembly: AssemblyTitle("ChunkyMode")]
[assembly: AssemblyCompany("ChunkyMode")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[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
{
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace HDeMods
{
	public static class Hurricane
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_Init <0>__VerifyInterloper;

			public static Action<Run, RuleBook> <1>__Run_onRunSetRuleBookGlobal;

			public static Action<Run> <2>__Run_onRunStartGlobal;

			public static Action<Run> <3>__Run_onRunDestroyGlobal;

			public static Action <4>__GenerateCache;

			public static RoO.LogFunc <5>__Error;

			public static RoO.LogFunc <6>__Debug;

			public static UnityAction <7>__ResetToDefault;

			public static StatHookEventHandler <8>__RecalculateStatsAPI_GetStatCoefficients;

			public static UpdateHealthEventHandler <9>__ShieldRechargeAndBarrierDecayRate;

			public static Manipulator <10>__REXHealPulse;

			public static Manipulator <11>__REXPrimaryAttack;

			public static Manipulator <12>__AcridRegenBuff;

			public static Manipulator <13>__CaptainWardBuff;

			public static Manipulator <14>__VoidFiendSuppressBuff;

			public static Manipulator <15>__SeekerUnseenHandBuff;

			public static Manipulator <16>__SeekerMeditateBuff;

			public static Manipulator <17>__FalseSonLunarTamperingBuff;

			public static Manipulator <18>__ChefSotSChefsKissBuff;

			public static Action<SceneDirector> <19>__SceneDirector_onPrePopulateSceneServer;

			public static hook_Awake <20>__CombatDirector_Awake;

			public static HealEventHandler <21>__HealingOverride;

			public static hook_BeginStage <22>__Run_BeginStage;

			public static Action<CharacterBody> <23>__TrackShittersAdd;

			public static Action<CharacterBody> <24>__TrackShittersRemove;

			public static Action<InfiniteTowerWaveController> <25>__OnAllEnemiesDefeatedServer;

			public static hook_BeginNextWave <26>__InfiniteTowerRun_BeginNextWave;

			public static Manipulator <27>__InfiniteTowerWaveController_Initialize;

			public static Manipulator <28>__InfiniteTowerWaveController_FixedUpdate;

			public static Manipulator <29>__ExtractRNGFromCombatDirector;

			public static hook_PrepareNewMonsterWave <30>__CombatDirector_PrepareNewMonsterWave;
		}

		public static AssetBundle HurricaneBundle;

		public static DifficultyDef LegacyDifficultyDef;

		public static DifficultyIndex LegacyDifficultyIndex;

		public static GameObject HurricaneInfo;

		private static GameObject m_hurricaneInfo;

		private static bool shouldRun;

		private static int ogMonsterCap;

		private static int ogRunLevelCap;

		internal static bool isSimulacrumRun;

		internal static int totalBlindPest;

		internal static int totalLemurians;

		internal static bool waveStarted;

		private static float enemyYapTimer;

		public static ConfigEntry<bool> doHealingBuffs { get; set; }

		public static ConfigEntry<bool> doEnemyLimitBoost { get; set; }

		public static ConfigEntry<bool> doGoldPenalty { get; set; }

		public static ConfigEntry<bool> doEnemyNerfs { get; set; }

		public static ConfigEntry<float> enemyChanceToYap { get; set; }

		public static ConfigEntry<float> enemyYapCooldown { get; set; }

		public static ConfigEntry<bool> limitPest { get; set; }

		public static ConfigEntry<float> limitPestAmount { get; set; }

		internal static void StartUp()
		{
			if (!File.Exists(Assembly.GetExecutingAssembly().Location.Replace("ChunkyMode.dll", "chunkydifficon")))
			{
				Log.Fatal("Could not load asset bundle, aborting!");
				return;
			}
			HurricaneBundle = AssetBundle.LoadFromFile(Assembly.GetExecutingAssembly().Location.Replace("ChunkyMode.dll", "chunkydifficon"));
			CreateNetworkObject();
			AddHooks();
		}

		private static void CreateNetworkObject()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			GameObject val = new GameObject("thing");
			val.AddComponent<NetworkIdentity>();
			HurricaneInfo = PrefabAPI.InstantiateClone(val, "ChunkyRunInfo");
			Object.Destroy((Object)(object)val);
			HurricaneInfo.AddComponent<HurricaneRunInfo>();
			ChatMessageBase.chatMessageTypeToIndex.Add(typeof(HurricaneChatEnemyYap), (byte)ChatMessageBase.chatMessageIndexToType.Count);
			ChatMessageBase.chatMessageIndexToType.Add(typeof(HurricaneChatEnemyYap));
		}

		private static void AddHooks()
		{
			//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
			object obj = <>O.<0>__VerifyInterloper;
			if (obj == null)
			{
				hook_Init val = VerifyInterloper;
				<>O.<0>__VerifyInterloper = val;
				obj = (object)val;
			}
			RewiredIntegrationManager.Init += (hook_Init)obj;
			Run.onRunSetRuleBookGlobal += Run_onRunSetRuleBookGlobal;
			Run.onRunStartGlobal += Run_onRunStartGlobal;
			Run.onRunDestroyGlobal += Run_onRunDestroyGlobal;
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(HurricaneCachedIndexes.GenerateCache));
			if (Starstorm2.Enabled)
			{
				Starstorm2.GenerateHooks();
			}
			if (AlienHominid.Enabled)
			{
				AlienHominid.GenerateHooks();
			}
			if (Ravager.Enabled)
			{
				Ravager.GenerateHooks();
			}
			if (Submariner.Enabled)
			{
				Submariner.GenerateHooks();
			}
		}

		private static void RemoveHooks()
		{
			Run.onRunSetRuleBookGlobal -= Run_onRunSetRuleBookGlobal;
			Run.onRunStartGlobal -= Run_onRunStartGlobal;
			Run.onRunDestroyGlobal -= Run_onRunDestroyGlobal;
			RoR2Application.onLoad = (Action)Delegate.Remove(RoR2Application.onLoad, new Action(HurricaneCachedIndexes.GenerateCache));
		}

		private static void VerifyInterloper(orig_Init init)
		{
			if (!InterlopingArtifactPlugin.startupSuccess)
			{
				Log.Fatal("Artifact of Interloping did not start up successfully, aborting!");
				RemoveHooks();
				init.Invoke();
				return;
			}
			BindSettings();
			AddHurricaneDifficulty();
			AddLegacyDifficulty();
			if (RoO.Enabled)
			{
				AddOptions();
			}
			if (Saving.Enabled)
			{
				Saving.SetUp();
			}
			if (RiskUI.Enabled)
			{
				RiskUI.AddLegacyDifficulty();
			}
			init.Invoke();
		}

		private static void AddHurricaneDifficulty()
		{
		}

		private static void AddLegacyDifficulty()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Expected O, but got Unknown
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			LegacyDifficultyDef = new DifficultyDef(4f, "CHUNKYMODEDIFFMOD_INTERNAL_NAME", "CHUNKYMODEDIFFMOD_ICON", "HURRICANE_DIFF_DESCRIPTION", Color32.op_Implicit(new Color32((byte)61, (byte)25, byte.MaxValue, byte.MaxValue)), "cm", true)
			{
				iconSprite = HurricaneBundle.LoadAsset<Sprite>("texChunkyModeDiffIcon"),
				foundIconSprite = true
			};
			LegacyDifficultyIndex = DifficultyAPI.AddDifficulty(LegacyDifficultyDef);
		}

		public static void BindSettings()
		{
			doHealingBuffs = ((BaseUnityPlugin)HurricanePlugin.instance).Config.Bind<bool>("Unlisted Difficulty Modifiers", "Do Healing Buffs", true, "Enables buffs to some survivor healing skills. Disable if you want a harder challenge.");
			doEnemyLimitBoost = ((BaseUnityPlugin)HurricanePlugin.instance).Config.Bind<bool>("Unlisted Difficulty Modifiers", "Do Enemy Limit Boost", true, "Enables enemy limit increase. If your computer is struggling to run on Chunky Mode, consider disabling this.");
			doGoldPenalty = ((BaseUnityPlugin)HurricanePlugin.instance).Config.Bind<bool>("Unlisted Difficulty Modifiers", "Do Gold Penalty", true, "Enables a -10% gold penalty. Disable to speed up gameplay.");
			doEnemyNerfs = ((BaseUnityPlugin)HurricanePlugin.instance).Config.Bind<bool>("Unlisted Difficulty Modifiers", "Do Enemy Nerfs", true, "Enables enemy nerfs. Disable if you like unreactable Wandering Vagrants.");
			enemyChanceToYap = ((BaseUnityPlugin)HurricanePlugin.instance).Config.Bind<float>("Yapping", "Enemy Yap Chance", 0.03f, "The probability of enemies to yap. Set to 0 to stop the yapping.");
			enemyYapCooldown = ((BaseUnityPlugin)HurricanePlugin.instance).Config.Bind<float>("Yapping", "Enemy Yap Cooldown", 30f, "The amount of time before enemies are allowed to yap again. Set to 0 for turbo yapping.");
			limitPest = ((BaseUnityPlugin)HurricanePlugin.instance).Config.Bind<bool>("Simulacrum", "Limit Blind Pest", true, "Enable Blind Pest limit in Simulacrum. This also affects Lemurians.");
			limitPestAmount = ((BaseUnityPlugin)HurricanePlugin.instance).Config.Bind<float>("Simulacrum", "Blind Pest Amount", 10f, "The percentage of enemies that are allowed to be blind pest. Only affects Simulacrum.");
			HurricaneSurvivorBuffs.RegisterOptions();
		}

		private static void ClampConfigOptions()
		{
			enemyChanceToYap.Value = Math.Clamp(enemyChanceToYap.Value, 0f, 100f);
			enemyYapCooldown.Value = Math.Clamp(enemyYapCooldown.Value, 0f, 600f);
			limitPestAmount.Value = Math.Clamp(limitPestAmount.Value, 0f, 100f);
			HurricaneSurvivorBuffs.ClampValues();
		}

		private static void AddOptions()
		{
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Expected O, but got Unknown
			//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_00fc: Expected O, but got Unknown
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Expected O, but got Unknown
			RoO.Init("com.HDeDeDe.ChunkyMode", "ChunkyMode", Log.Error, Log.Debug);
			RoO.AddCheck(doHealingBuffs);
			RoO.AddCheck(doEnemyLimitBoost);
			RoO.AddCheck(doGoldPenalty);
			RoO.AddCheck(doEnemyNerfs);
			object obj = <>O.<7>__ResetToDefault;
			if (obj == null)
			{
				UnityAction val = RoO.ResetToDefault;
				<>O.<7>__ResetToDefault = val;
				obj = (object)val;
			}
			RoO.AddButton("Reset to default", "Unlisted Difficulty Modifiers", (UnityAction)obj);
			RoO.AddFloatStep(enemyChanceToYap, 0f, 100f, 0.01f, "{0}%");
			RoO.AddFloatStep(enemyYapCooldown, 0f, 600f, 1f, "{0}");
			object obj2 = <>O.<7>__ResetToDefault;
			if (obj2 == null)
			{
				UnityAction val2 = RoO.ResetToDefault;
				<>O.<7>__ResetToDefault = val2;
				obj2 = (object)val2;
			}
			RoO.AddButton("Reset to default", "Yapping", (UnityAction)obj2);
			RoO.AddCheck(limitPest);
			RoO.AddFloatStep(limitPestAmount, 0f, 100f, 1f);
			object obj3 = <>O.<7>__ResetToDefault;
			if (obj3 == null)
			{
				UnityAction val3 = RoO.ResetToDefault;
				<>O.<7>__ResetToDefault = val3;
				obj3 = (object)val3;
			}
			RoO.AddButton("Reset to default", "Simulacrum", (UnityAction)obj3);
			HurricaneSurvivorBuffs.RegisterRiskOfOptions();
			RoO.SetSprite(HurricaneBundle.LoadAsset<Sprite>("texChunkyModeDiffIcon"));
			RoO.SetDescriptionToken("HURRICANE_RISK_OF_OPTIONS_DESCRIPTION");
		}

		internal static void Run_onRunSetRuleBookGlobal(Run arg1, RuleBook arg2)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			if (arg1.selectedDifficulty == LegacyDifficultyIndex)
			{
				if (((object)arg1).GetType() == typeof(InfiniteTowerRun))
				{
					isSimulacrumRun = true;
				}
				InterlopingArtifact.HurricaneRun = true;
			}
		}

		internal static void Run_onRunStartGlobal(Run run)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: 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_0075: Expected O, but got Unknown
			//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ca: Expected O, but got Unknown
			//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f9: Expected O, but got Unknown
			//IL_045e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0463: Unknown result type (might be due to invalid IL or missing references)
			//IL_0469: Expected O, but got Unknown
			//IL_030e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0313: Unknown result type (might be due to invalid IL or missing references)
			//IL_0319: Expected O, but got Unknown
			//IL_047e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0483: Unknown result type (might be due to invalid IL or missing references)
			//IL_0489: Expected O, but got Unknown
			//IL_032e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0333: Unknown result type (might be due to invalid IL or missing references)
			//IL_0339: Expected O, but got Unknown
			//IL_049e: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a9: Expected O, but got Unknown
			//IL_034e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0353: Unknown result type (might be due to invalid IL or missing references)
			//IL_0359: Expected O, but got Unknown
			//IL_036e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0373: Unknown result type (might be due to invalid IL or missing references)
			//IL_0379: Expected O, but got Unknown
			//IL_038e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0393: Unknown result type (might be due to invalid IL or missing references)
			//IL_0399: Expected O, but got Unknown
			//IL_03ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b9: Expected O, but got Unknown
			//IL_0538: Unknown result type (might be due to invalid IL or missing references)
			//IL_053d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0543: Expected O, but got Unknown
			//IL_03ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d9: Expected O, but got Unknown
			//IL_0558: Unknown result type (might be due to invalid IL or missing references)
			//IL_055d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0563: Expected O, but got Unknown
			//IL_03ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f9: Expected O, but got Unknown
			//IL_0578: Unknown result type (might be due to invalid IL or missing references)
			//IL_057d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0583: Expected O, but got Unknown
			//IL_0598: Unknown result type (might be due to invalid IL or missing references)
			//IL_059d: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a3: Expected O, but got Unknown
			//IL_05b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c3: Expected O, but got Unknown
			shouldRun = false;
			totalBlindPest = 0;
			totalLemurians = 0;
			ogRunLevelCap = Run.ambientLevelCap;
			ogMonsterCap = TeamCatalog.GetTeamDef((TeamIndex)2).softCharacterLimit;
			if (run.selectedDifficulty != LegacyDifficultyIndex)
			{
				return;
			}
			Log.Info("Chunky Mode Run started");
			shouldRun = true;
			Run.ambientLevelCap += 9900;
			object obj = <>O.<8>__RecalculateStatsAPI_GetStatCoefficients;
			if (obj == null)
			{
				StatHookEventHandler val = RecalculateStatsAPI_GetStatCoefficients;
				<>O.<8>__RecalculateStatsAPI_GetStatCoefficients = val;
				obj = (object)val;
			}
			RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj;
			if (!NetworkServer.active)
			{
				return;
			}
			m_hurricaneInfo = Object.Instantiate<GameObject>(HurricaneInfo);
			NetworkServer.Spawn(m_hurricaneInfo);
			if (!HurricaneRunInfo.preSet)
			{
				((BaseUnityPlugin)HurricanePlugin.instance).Config.Reload();
				ClampConfigOptions();
				HurricaneRunInfo.instance.doEnemyLimitBoost = doEnemyLimitBoost.Value;
				HurricaneRunInfo.instance.doHealingBuffs = doHealingBuffs.Value;
				HurricaneRunInfo.instance.doGoldPenalty = doGoldPenalty.Value;
				HurricaneRunInfo.instance.NetworkdoEnemyNerfs = doEnemyNerfs.Value;
				HurricaneRunInfo.instance.enemyChanceToYap = enemyChanceToYap.Value;
				HurricaneRunInfo.instance.enemyYapCooldown = enemyYapCooldown.Value;
				HurricaneRunInfo.instance.limitPest = limitPest.Value;
				HurricaneRunInfo.instance.limitPestAmount = limitPestAmount.Value;
				HurricaneRunInfo.instance.rexHealOverride = HurricaneSurvivorBuffs.RexHealOverride.Value;
				HurricaneRunInfo.instance.acridHealOverride = HurricaneSurvivorBuffs.AcridHealOverride.Value;
				HurricaneRunInfo.instance.captainHealOverride = HurricaneSurvivorBuffs.CaptainHealOverride.Value;
				HurricaneRunInfo.instance.voidFiendHealOverride = HurricaneSurvivorBuffs.VoidFiendHealOverride.Value;
				HurricaneRunInfo.instance.seekerHealOverride = HurricaneSurvivorBuffs.SeekerHealOverride.Value;
				HurricaneRunInfo.instance.falseSonHealOverride = HurricaneSurvivorBuffs.FalseSonHealOverride.Value;
				HurricaneRunInfo.instance.chefSotSHealOverride = HurricaneSurvivorBuffs.ChefSotSHealOverride.Value;
				HurricaneRunInfo.instance.chirrHealOverride = HurricaneSurvivorBuffs.ChirrHealOverride.Value;
				HurricaneRunInfo.instance.aliemHealOverride = HurricaneSurvivorBuffs.AliemHealOverride.Value;
				HurricaneRunInfo.instance.submarinerHealOverride = HurricaneSurvivorBuffs.SubmarinerHealOverride.Value;
				HurricaneRunInfo.instance.ravagerHealOverride = HurricaneSurvivorBuffs.RavagerHealOverride.Value;
				HurricaneRunInfo.instance.paladinBarrierOverride = HurricaneSurvivorBuffs.PaladinBarrierOverride.Value / 100f;
			}
			if (HurricaneRunInfo.instance.doEnemyLimitBoost)
			{
				TeamCatalog.GetTeamDef((TeamIndex)2).softCharacterLimit = (int)((double)ogMonsterCap * 1.5);
				TeamCatalog.GetTeamDef((TeamIndex)4).softCharacterLimit = (int)((double)ogMonsterCap * 1.5);
				TeamCatalog.GetTeamDef((TeamIndex)3).softCharacterLimit = (int)((double)ogMonsterCap * 1.5);
			}
			object obj2 = <>O.<9>__ShieldRechargeAndBarrierDecayRate;
			if (obj2 == null)
			{
				UpdateHealthEventHandler val2 = HurricaneILHooks.ShieldRechargeAndBarrierDecayRate;
				<>O.<9>__ShieldRechargeAndBarrierDecayRate = val2;
				obj2 = (object)val2;
			}
			HealthComponentAPI.GetHealthStats += (UpdateHealthEventHandler)obj2;
			if (HurricaneRunInfo.instance.doHealingBuffs)
			{
				object obj3 = <>O.<10>__REXHealPulse;
				if (obj3 == null)
				{
					Manipulator val3 = HurricaneILHooks.REXHealPulse;
					<>O.<10>__REXHealPulse = val3;
					obj3 = (object)val3;
				}
				TreebotFlower2Projectile.HealPulse += (Manipulator)obj3;
				object obj4 = <>O.<11>__REXPrimaryAttack;
				if (obj4 == null)
				{
					Manipulator val4 = HurricaneILHooks.REXPrimaryAttack;
					<>O.<11>__REXPrimaryAttack = val4;
					obj4 = (object)val4;
				}
				ProjectileHealOwnerOnDamageInflicted.OnDamageInflictedServer += (Manipulator)obj4;
				object obj5 = <>O.<12>__AcridRegenBuff;
				if (obj5 == null)
				{
					Manipulator val5 = HurricaneILHooks.AcridRegenBuff;
					<>O.<12>__AcridRegenBuff = val5;
					obj5 = (object)val5;
				}
				CharacterBody.RecalculateStats += (Manipulator)obj5;
				object obj6 = <>O.<13>__CaptainWardBuff;
				if (obj6 == null)
				{
					Manipulator val6 = HurricaneILHooks.CaptainWardBuff;
					<>O.<13>__CaptainWardBuff = val6;
					obj6 = (object)val6;
				}
				HealingWard.HealOccupants += (Manipulator)obj6;
				object obj7 = <>O.<14>__VoidFiendSuppressBuff;
				if (obj7 == null)
				{
					Manipulator val7 = HurricaneILHooks.VoidFiendSuppressBuff;
					<>O.<14>__VoidFiendSuppressBuff = val7;
					obj7 = (object)val7;
				}
				CrushBase.OnEnter += (Manipulator)obj7;
				object obj8 = <>O.<15>__SeekerUnseenHandBuff;
				if (obj8 == null)
				{
					Manipulator val8 = HurricaneILHooks.SeekerUnseenHandBuff;
					<>O.<15>__SeekerUnseenHandBuff = val8;
					obj8 = (object)val8;
				}
				UnseenHandHealingProjectile.OnDamageInflictedServer += (Manipulator)obj8;
				object obj9 = <>O.<16>__SeekerMeditateBuff;
				if (obj9 == null)
				{
					Manipulator val9 = HurricaneILHooks.SeekerMeditateBuff;
					<>O.<16>__SeekerMeditateBuff = val9;
					obj9 = (object)val9;
				}
				MeditationUI.Update += (Manipulator)obj9;
				object obj10 = <>O.<17>__FalseSonLunarTamperingBuff;
				if (obj10 == null)
				{
					Manipulator val10 = HurricaneILHooks.FalseSonLunarTamperingBuff;
					<>O.<17>__FalseSonLunarTamperingBuff = val10;
					obj10 = (object)val10;
				}
				CharacterBody.RecalculateStats += (Manipulator)obj10;
				object obj11 = <>O.<18>__ChefSotSChefsKissBuff;
				if (obj11 == null)
				{
					Manipulator val11 = HurricaneILHooks.ChefSotSChefsKissBuff;
					<>O.<18>__ChefSotSChefsKissBuff = val11;
					obj11 = (object)val11;
				}
				GlobalEventManager.OnCharacterDeath += (Manipulator)obj11;
				if (Starstorm2.Enabled)
				{
					Starstorm2.SetHooks();
				}
				if (AlienHominid.Enabled)
				{
					AlienHominid.SetHooks();
				}
				if (Ravager.Enabled)
				{
					Ravager.SetHooks();
				}
				if (Submariner.Enabled)
				{
					Submariner.SetHooks();
				}
			}
			SceneDirector.onPrePopulateSceneServer += SceneDirector_onPrePopulateSceneServer;
			object obj12 = <>O.<20>__CombatDirector_Awake;
			if (obj12 == null)
			{
				hook_Awake val12 = CombatDirector_Awake;
				<>O.<20>__CombatDirector_Awake = val12;
				obj12 = (object)val12;
			}
			CombatDirector.Awake += (hook_Awake)obj12;
			object obj13 = <>O.<21>__HealingOverride;
			if (obj13 == null)
			{
				HealEventHandler val13 = HurricaneILHooks.HealingOverride;
				<>O.<21>__HealingOverride = val13;
				obj13 = (object)val13;
			}
			HealthComponentAPI.GetHealStats += (HealEventHandler)obj13;
			object obj14 = <>O.<22>__Run_BeginStage;
			if (obj14 == null)
			{
				hook_BeginStage val14 = Run_BeginStage;
				<>O.<22>__Run_BeginStage = val14;
				obj14 = (object)val14;
			}
			Run.BeginStage += (hook_BeginStage)obj14;
			if (isSimulacrumRun)
			{
				waveStarted = false;
				if (HurricaneRunInfo.instance.limitPest)
				{
					CharacterBody.onBodyStartGlobal += TrackShittersAdd;
					CharacterBody.onBodyDestroyGlobal += TrackShittersRemove;
				}
				InfiniteTowerRun.onAllEnemiesDefeatedServer += HurricaneSimulacrum.OnAllEnemiesDefeatedServer;
				object obj15 = <>O.<26>__InfiniteTowerRun_BeginNextWave;
				if (obj15 == null)
				{
					hook_BeginNextWave val15 = HurricaneSimulacrum.InfiniteTowerRun_BeginNextWave;
					<>O.<26>__InfiniteTowerRun_BeginNextWave = val15;
					obj15 = (object)val15;
				}
				InfiniteTowerRun.BeginNextWave += (hook_BeginNextWave)obj15;
				object obj16 = <>O.<27>__InfiniteTowerWaveController_Initialize;
				if (obj16 == null)
				{
					Manipulator val16 = HurricaneSimulacrum.InfiniteTowerWaveController_Initialize;
					<>O.<27>__InfiniteTowerWaveController_Initialize = val16;
					obj16 = (object)val16;
				}
				InfiniteTowerWaveController.Initialize += (Manipulator)obj16;
				object obj17 = <>O.<28>__InfiniteTowerWaveController_FixedUpdate;
				if (obj17 == null)
				{
					Manipulator val17 = HurricaneSimulacrum.InfiniteTowerWaveController_FixedUpdate;
					<>O.<28>__InfiniteTowerWaveController_FixedUpdate = val17;
					obj17 = (object)val17;
				}
				InfiniteTowerWaveController.FixedUpdate += (Manipulator)obj17;
				object obj18 = <>O.<29>__ExtractRNGFromCombatDirector;
				if (obj18 == null)
				{
					Manipulator val18 = HurricaneSimulacrum.ExtractRNGFromCombatDirector;
					<>O.<29>__ExtractRNGFromCombatDirector = val18;
					obj18 = (object)val18;
				}
				CombatDirector.AttemptSpawnOnTarget += (Manipulator)obj18;
				object obj19 = <>O.<30>__CombatDirector_PrepareNewMonsterWave;
				if (obj19 == null)
				{
					hook_PrepareNewMonsterWave val19 = HurricaneSimulacrum.CombatDirector_PrepareNewMonsterWave;
					<>O.<30>__CombatDirector_PrepareNewMonsterWave = val19;
					obj19 = (object)val19;
				}
				CombatDirector.PrepareNewMonsterWave += (hook_PrepareNewMonsterWave)obj19;
			}
		}

		internal static void Run_onRunDestroyGlobal(Run run)
		{
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Expected O, but got Unknown
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Expected O, but got Unknown
			//IL_00b8: 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_00c3: Expected O, but got Unknown
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Expected O, but got Unknown
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Expected O, but got Unknown
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Expected O, but got Unknown
			//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_0143: Expected O, but got Unknown
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Expected O, but got Unknown
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Expected O, but got Unknown
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Expected O, but got Unknown
			//IL_01e8: 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_01f3: Expected O, but got Unknown
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0213: Expected O, but got Unknown
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Expected O, but got Unknown
			//IL_0268: Unknown result type (might be due to invalid IL or missing references)
			//IL_026d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: Expected O, but got Unknown
			//IL_02e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f3: Expected O, but got Unknown
			//IL_0308: Unknown result type (might be due to invalid IL or missing references)
			//IL_030d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0313: Expected O, but got Unknown
			//IL_0328: Unknown result type (might be due to invalid IL or missing references)
			//IL_032d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0333: Expected O, but got Unknown
			//IL_0348: Unknown result type (might be due to invalid IL or missing references)
			//IL_034d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0353: Expected O, but got Unknown
			//IL_0368: Unknown result type (might be due to invalid IL or missing references)
			//IL_036d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0373: Expected O, but got Unknown
			if (shouldRun)
			{
				Log.Info("Chunky Mode Run ended");
				shouldRun = false;
				isSimulacrumRun = false;
				HurricaneRunInfo.preSet = false;
				Run.ambientLevelCap = ogRunLevelCap;
				Object.Destroy((Object)(object)m_hurricaneInfo);
				TeamCatalog.GetTeamDef((TeamIndex)2).softCharacterLimit = ogMonsterCap;
				TeamCatalog.GetTeamDef((TeamIndex)4).softCharacterLimit = ogMonsterCap;
				TeamCatalog.GetTeamDef((TeamIndex)3).softCharacterLimit = ogMonsterCap;
				object obj = <>O.<9>__ShieldRechargeAndBarrierDecayRate;
				if (obj == null)
				{
					UpdateHealthEventHandler val = HurricaneILHooks.ShieldRechargeAndBarrierDecayRate;
					<>O.<9>__ShieldRechargeAndBarrierDecayRate = val;
					obj = (object)val;
				}
				HealthComponentAPI.GetHealthStats -= (UpdateHealthEventHandler)obj;
				object obj2 = <>O.<10>__REXHealPulse;
				if (obj2 == null)
				{
					Manipulator val2 = HurricaneILHooks.REXHealPulse;
					<>O.<10>__REXHealPulse = val2;
					obj2 = (object)val2;
				}
				TreebotFlower2Projectile.HealPulse -= (Manipulator)obj2;
				object obj3 = <>O.<11>__REXPrimaryAttack;
				if (obj3 == null)
				{
					Manipulator val3 = HurricaneILHooks.REXPrimaryAttack;
					<>O.<11>__REXPrimaryAttack = val3;
					obj3 = (object)val3;
				}
				ProjectileHealOwnerOnDamageInflicted.OnDamageInflictedServer -= (Manipulator)obj3;
				object obj4 = <>O.<12>__AcridRegenBuff;
				if (obj4 == null)
				{
					Manipulator val4 = HurricaneILHooks.AcridRegenBuff;
					<>O.<12>__AcridRegenBuff = val4;
					obj4 = (object)val4;
				}
				CharacterBody.RecalculateStats -= (Manipulator)obj4;
				object obj5 = <>O.<13>__CaptainWardBuff;
				if (obj5 == null)
				{
					Manipulator val5 = HurricaneILHooks.CaptainWardBuff;
					<>O.<13>__CaptainWardBuff = val5;
					obj5 = (object)val5;
				}
				HealingWard.HealOccupants -= (Manipulator)obj5;
				object obj6 = <>O.<14>__VoidFiendSuppressBuff;
				if (obj6 == null)
				{
					Manipulator val6 = HurricaneILHooks.VoidFiendSuppressBuff;
					<>O.<14>__VoidFiendSuppressBuff = val6;
					obj6 = (object)val6;
				}
				CrushBase.OnEnter -= (Manipulator)obj6;
				object obj7 = <>O.<15>__SeekerUnseenHandBuff;
				if (obj7 == null)
				{
					Manipulator val7 = HurricaneILHooks.SeekerUnseenHandBuff;
					<>O.<15>__SeekerUnseenHandBuff = val7;
					obj7 = (object)val7;
				}
				UnseenHandHealingProjectile.OnDamageInflictedServer -= (Manipulator)obj7;
				object obj8 = <>O.<16>__SeekerMeditateBuff;
				if (obj8 == null)
				{
					Manipulator val8 = HurricaneILHooks.SeekerMeditateBuff;
					<>O.<16>__SeekerMeditateBuff = val8;
					obj8 = (object)val8;
				}
				MeditationUI.Update -= (Manipulator)obj8;
				object obj9 = <>O.<17>__FalseSonLunarTamperingBuff;
				if (obj9 == null)
				{
					Manipulator val9 = HurricaneILHooks.FalseSonLunarTamperingBuff;
					<>O.<17>__FalseSonLunarTamperingBuff = val9;
					obj9 = (object)val9;
				}
				CharacterBody.RecalculateStats -= (Manipulator)obj9;
				object obj10 = <>O.<18>__ChefSotSChefsKissBuff;
				if (obj10 == null)
				{
					Manipulator val10 = HurricaneILHooks.ChefSotSChefsKissBuff;
					<>O.<18>__ChefSotSChefsKissBuff = val10;
					obj10 = (object)val10;
				}
				GlobalEventManager.OnCharacterDeath -= (Manipulator)obj10;
				if (Starstorm2.Enabled)
				{
					Starstorm2.RemoveHooks();
				}
				if (AlienHominid.Enabled)
				{
					AlienHominid.RemoveHooks();
				}
				if (Ravager.Enabled)
				{
					Ravager.RemoveHooks();
				}
				if (Submariner.Enabled)
				{
					Submariner.RemoveHooks();
				}
				object obj11 = <>O.<8>__RecalculateStatsAPI_GetStatCoefficients;
				if (obj11 == null)
				{
					StatHookEventHandler val11 = RecalculateStatsAPI_GetStatCoefficients;
					<>O.<8>__RecalculateStatsAPI_GetStatCoefficients = val11;
					obj11 = (object)val11;
				}
				RecalculateStatsAPI.GetStatCoefficients -= (StatHookEventHandler)obj11;
				object obj12 = <>O.<21>__HealingOverride;
				if (obj12 == null)
				{
					HealEventHandler val12 = HurricaneILHooks.HealingOverride;
					<>O.<21>__HealingOverride = val12;
					obj12 = (object)val12;
				}
				HealthComponentAPI.GetHealStats -= (HealEventHandler)obj12;
				object obj13 = <>O.<20>__CombatDirector_Awake;
				if (obj13 == null)
				{
					hook_Awake val13 = CombatDirector_Awake;
					<>O.<20>__CombatDirector_Awake = val13;
					obj13 = (object)val13;
				}
				CombatDirector.Awake -= (hook_Awake)obj13;
				SceneDirector.onPrePopulateSceneServer -= SceneDirector_onPrePopulateSceneServer;
				object obj14 = <>O.<22>__Run_BeginStage;
				if (obj14 == null)
				{
					hook_BeginStage val14 = Run_BeginStage;
					<>O.<22>__Run_BeginStage = val14;
					obj14 = (object)val14;
				}
				Run.BeginStage -= (hook_BeginStage)obj14;
				CharacterBody.onBodyStartGlobal -= TrackShittersAdd;
				CharacterBody.onBodyDestroyGlobal -= TrackShittersRemove;
				InfiniteTowerRun.onAllEnemiesDefeatedServer -= HurricaneSimulacrum.OnAllEnemiesDefeatedServer;
				object obj15 = <>O.<26>__InfiniteTowerRun_BeginNextWave;
				if (obj15 == null)
				{
					hook_BeginNextWave val15 = HurricaneSimulacrum.InfiniteTowerRun_BeginNextWave;
					<>O.<26>__InfiniteTowerRun_BeginNextWave = val15;
					obj15 = (object)val15;
				}
				InfiniteTowerRun.BeginNextWave -= (hook_BeginNextWave)obj15;
				object obj16 = <>O.<27>__InfiniteTowerWaveController_Initialize;
				if (obj16 == null)
				{
					Manipulator val16 = HurricaneSimulacrum.InfiniteTowerWaveController_Initialize;
					<>O.<27>__InfiniteTowerWaveController_Initialize = val16;
					obj16 = (object)val16;
				}
				InfiniteTowerWaveController.Initialize -= (Manipulator)obj16;
				object obj17 = <>O.<28>__InfiniteTowerWaveController_FixedUpdate;
				if (obj17 == null)
				{
					Manipulator val17 = HurricaneSimulacrum.InfiniteTowerWaveController_FixedUpdate;
					<>O.<28>__InfiniteTowerWaveController_FixedUpdate = val17;
					obj17 = (object)val17;
				}
				InfiniteTowerWaveController.FixedUpdate -= (Manipulator)obj17;
				object obj18 = <>O.<29>__ExtractRNGFromCombatDirector;
				if (obj18 == null)
				{
					Manipulator val18 = HurricaneSimulacrum.ExtractRNGFromCombatDirector;
					<>O.<29>__ExtractRNGFromCombatDirector = val18;
					obj18 = (object)val18;
				}
				CombatDirector.AttemptSpawnOnTarget -= (Manipulator)obj18;
				object obj19 = <>O.<30>__CombatDirector_PrepareNewMonsterWave;
				if (obj19 == null)
				{
					hook_PrepareNewMonsterWave val19 = HurricaneSimulacrum.CombatDirector_PrepareNewMonsterWave;
					<>O.<30>__CombatDirector_PrepareNewMonsterWave = val19;
					obj19 = (object)val19;
				}
				CombatDirector.PrepareNewMonsterWave -= (hook_PrepareNewMonsterWave)obj19;
			}
		}

		internal static void TrackShittersAdd(CharacterBody body)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			if (body.bodyIndex == HurricaneCachedIndexes.bodyCache[BodyCache.FlyingVermin])
			{
				totalBlindPest++;
			}
			if (body.bodyIndex == HurricaneCachedIndexes.bodyCache[BodyCache.Lemurian])
			{
				totalLemurians++;
			}
		}

		internal static void TrackShittersRemove(CharacterBody body)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			if (body.bodyIndex == HurricaneCachedIndexes.bodyCache[BodyCache.FlyingVermin])
			{
				totalBlindPest--;
			}
			if (body.bodyIndex == HurricaneCachedIndexes.bodyCache[BodyCache.Lemurian])
			{
				totalLemurians--;
			}
		}

		public static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Invalid comparison between Unknown and I4
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)sender))
			{
				return;
			}
			if ((int)sender.teamComponent.teamIndex == 1)
			{
				args.baseCurseAdd += InterRunInfo.instance.allyCurse;
				return;
			}
			if (NetworkServer.active)
			{
				float num = Random.Range(0f, 1f);
				float num2 = HurricaneRunInfo.instance.enemyChanceToYap / 100f;
				if (InterRunInfo.instance.loiterPenaltyActive)
				{
					num2 *= 2f;
				}
				if (num < num2 && HurricaneRunInfo.instance.enemyChanceToYap > 0f && enemyYapTimer < Run.instance.NetworkfixedTime)
				{
					enemyYapTimer = Run.instance.NetworkfixedTime + HurricaneRunInfo.instance.enemyYapCooldown;
					List<BuffIndex> list = new List<BuffIndex>();
					if (sender.isElite)
					{
						list.AddRange(((IEnumerable<BuffIndex>)BuffCatalog.eliteBuffIndices).Where((Func<BuffIndex, bool>)sender.HasBuff));
					}
					HurricaneYap.DoYapping(sender.baseNameToken, list);
				}
			}
			if (!HurricaneRunInfo.instance.doEnemyNerfs)
			{
				args.attackSpeedMultAdd += 0.5f;
				args.moveSpeedMultAdd += 0.4f;
				args.cooldownReductionAdd += 0.5f;
				return;
			}
			HurricaneCachedIndexes.bodyIndex.TryGetValue(sender.bodyIndex, out var value);
			switch (value)
			{
			case BodyCache.BeetleGuard:
				args.moveSpeedMultAdd += 0.4f;
				args.cooldownReductionAdd += 0.5f;
				break;
			case BodyCache.Vagrant:
				args.attackSpeedMultAdd += 0.25f;
				args.moveSpeedMultAdd += 0.4f;
				args.cooldownReductionAdd += 0.5f;
				break;
			case BodyCache.Bell:
				args.attackSpeedMultAdd += 2f;
				args.moveSpeedMultAdd += 0.4f;
				args.cooldownMultAdd += 0.25f;
				break;
			case BodyCache.RobNemesis:
				args.attackSpeedMultAdd += 0.25f;
				args.moveSpeedMultAdd += 0.15f;
				args.cooldownReductionAdd += 0.5f;
				break;
			case BodyCache.SigmaConstruct:
				args.attackSpeedMultAdd += 0.25f;
				args.cooldownReductionAdd += 0.5f;
				break;
			case BodyCache.FlyingVermin:
				args.attackSpeedMultAdd += 0.15f;
				args.moveSpeedMultAdd += 0.4f;
				break;
			case BodyCache.Bison:
				args.attackSpeedMultAdd += 2f;
				args.moveSpeedMultAdd += 0.4f;
				args.cooldownReductionAdd += 0.5f;
				break;
			default:
				args.attackSpeedMultAdd += 0.5f;
				args.moveSpeedMultAdd += 0.4f;
				args.cooldownReductionAdd += 0.5f;
				break;
			}
		}

		internal static void CombatDirector_Awake(orig_Awake origAwake, CombatDirector self)
		{
			self.creditMultiplier *= 1.1f;
			if (HurricaneRunInfo.instance.doGoldPenalty && !isSimulacrumRun)
			{
				self.goldRewardCoefficient *= 0.9f;
			}
			origAwake.Invoke(self);
		}

		internal static void SceneDirector_onPrePopulateSceneServer(SceneDirector self)
		{
			self.interactableCredit = (int)((double)self.interactableCredit * 1.2);
			Log.Info("Updated Credits: " + self.interactableCredit);
		}

		internal static void Run_BeginStage(orig_BeginStage beginStage, Run self)
		{
			enemyYapTimer = self.NetworkfixedTime + 10f;
			beginStage.Invoke(self);
		}
	}
	internal enum BodyCache
	{
		None,
		BeetleGuard,
		Vagrant,
		Bell,
		RobNemesis,
		SigmaConstruct,
		FlyingVermin,
		Bison,
		Lemurian,
		RobPaladin
	}
	internal static class HurricaneCachedIndexes
	{
		public static readonly Dictionary<BodyIndex, BodyCache> bodyIndex = new Dictionary<BodyIndex, BodyCache>();

		public static readonly Dictionary<BodyCache, BodyIndex> bodyCache = new Dictionary<BodyCache, BodyIndex>();

		public static int injector;

		private static RuleChoiceDef legacyChoiceDef;

		public static void GenerateCache()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			injector = ProjectileCatalog.FindProjectileIndex("SyringeProjectileHealing");
			AddToCollection(BodyCatalog.FindBodyIndex("BeetleGuardBody"), BodyCache.BeetleGuard);
			AddToCollection(BodyCatalog.FindBodyIndex("VagrantBody"), BodyCache.Vagrant);
			AddToCollection(BodyCatalog.FindBodyIndex("BellBody"), BodyCache.Bell);
			AddToCollection(BodyCatalog.FindBodyIndex("FlyingVerminBody"), BodyCache.FlyingVermin);
			AddToCollection(BodyCatalog.FindBodyIndex("BisonBody"), BodyCache.Bison);
			AddToCollection(BodyCatalog.FindBodyIndex("LemurianBody"), BodyCache.Lemurian);
			AddToCollection(BodyCatalog.FindBodyIndex("RobPaladinBody"), BodyCache.RobPaladin);
			if (Hunk.Enabled)
			{
				AddToCollection(BodyCatalog.FindBodyIndex("RobNemesisPlayerBody"), BodyCache.RobNemesis);
			}
			if (Spikestrip.Enabled)
			{
				AddToCollection(BodyCatalog.FindBodyIndex("SigmaConstructBody"), BodyCache.SigmaConstruct);
			}
			legacyChoiceDef = RuleCatalog.FindChoiceDef("Difficulty.ChunkyMode");
			legacyChoiceDef.availableInSinglePlayer = true;
			legacyChoiceDef.availableInMultiPlayer = true;
			Hurricane.LegacyDifficultyDef.nameToken = "CHUNKYMODEDIFFMOD_NAME";
		}

		private static void AddToCollection(BodyIndex index, BodyCache cache)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			bodyIndex.Add(index, cache);
			bodyCache.Add(cache, index);
		}
	}
	public class HurricaneChatEnemyYap : ChatMessageBase
	{
		public string baseToken;

		public string enemyToken;

		private int m_eliteLength;

		public List<BuffIndex> eliteAffix = new List<BuffIndex>();

		public override string ConstructChatString()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			string text = Language.GetString(enemyToken);
			foreach (BuffIndex item in eliteAffix)
			{
				text = Language.GetStringFormatted(BuffCatalog.GetBuffDef(item).eliteDef.modifierToken, new object[1] { text });
			}
			return Language.GetStringFormatted("HURRICANE_YAP_FORMAT", new object[2]
			{
				Language.GetStringFormatted(text, Array.Empty<object>()),
				Language.GetString(baseToken)
			});
		}

		public override void Serialize(NetworkWriter writer)
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Expected I4, but got Unknown
			writer.Write(baseToken);
			writer.Write(enemyToken);
			writer.Write(eliteAffix.Count);
			foreach (BuffIndex item in eliteAffix)
			{
				writer.Write((int)item);
			}
		}

		public override void Deserialize(NetworkReader reader)
		{
			baseToken = reader.ReadString();
			enemyToken = reader.ReadString();
			m_eliteLength = reader.ReadInt32();
			if (m_eliteLength != 0)
			{
				for (int i = 0; i < m_eliteLength; i++)
				{
					eliteAffix.Add((BuffIndex)reader.ReadInt32());
				}
			}
		}
	}
	internal static class HurricaneYap
	{
		public static void DoYapping([NotNull("ArgumentNullException")] string enemyToken, List<BuffIndex> eliteAffix)
		{
			string baseToken = (Random.RandomRangeInt(0, 100000) % 16) switch
			{
				0 => "BROTHER_SPAWN_PHASE1_1", 
				1 => "BROTHER_SPAWN_PHASE1_2", 
				2 => "BROTHER_SPAWN_PHASE1_3", 
				3 => "BROTHER_SPAWN_PHASE1_4", 
				4 => "BROTHER_DAMAGEDEALT_7", 
				5 => "BROTHER_DAMAGEDEALT_6", 
				6 => "BROTHER_DAMAGEDEALT_2", 
				7 => "BROTHER_KILL_1", 
				8 => "BROTHER_DAMAGEDEALT_3", 
				9 => "FALSESONBOSS_SPAWN_3", 
				10 => "FALSESONBOSS_EARLYPHASE_HURT_2", 
				11 => "FALSESONBOSS_EARLYPHASE_HURT_7", 
				12 => "FALSESONBOSS_FINALPHASE_HURT_6", 
				13 => "FALSESONBOSS_EARLYPHASE_PLAYERDEATH_4", 
				14 => "FALSESONBOSS_EARLYPHASE_PLAYERDEATH_5", 
				15 => "FALSESONBOSS_DRONEDEATH_2", 
				_ => "", 
			};
			Chat.SendBroadcastChat((ChatMessageBase)(object)new HurricaneChatEnemyYap
			{
				baseToken = baseToken,
				enemyToken = enemyToken,
				eliteAffix = eliteAffix
			});
		}
	}
	internal static class HurricaneILHooks
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static Manipulator <0>__ChefSotSChefsKissBuff;
		}

		private static readonly float shieldRechargeOverride = -0.5f;

		private static readonly float barrierDecayOverride = 1f;

		public static void HealingOverride(HealthComponent sender, HealEventArgs args)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Invalid comparison between Unknown and I4
			if ((int)sender.body.teamComponent.teamIndex == 1 && (!Hurricane.isSimulacrumRun || Hurricane.waveStarted))
			{
				args.enableEclipseHealReduction = true;
			}
		}

		public static void ShieldRechargeAndBarrierDecayRate(HealthComponent sender, UpdateHealthEventArgs args)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Invalid comparison between Unknown and I4
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			if ((int)sender.body.teamComponent.teamIndex == 1)
			{
				float num = barrierDecayOverride;
				if (sender.body.bodyIndex == HurricaneCachedIndexes.bodyCache[BodyCache.RobPaladin])
				{
					num -= HurricaneRunInfo.instance.paladinBarrierOverride;
				}
				args.barrierDecayRateMultAdd += num;
				if (!Hurricane.isSimulacrumRun || Hurricane.waveStarted)
				{
					args.shieldRechargeRateMultAdd += shieldRechargeOverride;
				}
			}
		}

		public static void REXHealPulse(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			if (!val.TryGotoNext(new Func<Instruction, bool>[5]
			{
				(Instruction x) => ILPatternMatchingExt.MatchConvR4(x),
				(Instruction x) => ILPatternMatchingExt.MatchMul(x),
				(Instruction x) => ILPatternMatchingExt.MatchStfld<HealOrb>(x, "healValue"),
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 2),
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.3f)
			}))
			{
				Log.Error("Failed to hook Tangling Growth!");
				return;
			}
			val.Index += 2;
			val.Emit(OpCodes.Ldarg_0);
			val.EmitDelegate<Func<float, TreebotFlower2Projectile, float>>((Func<float, TreebotFlower2Projectile, float>)delegate(float toHeal, TreebotFlower2Projectile tbf)
			{
				//IL_002f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0035: Invalid comparison between Unknown and I4
				if (!Object.op_Implicit((Object)(object)tbf.owner))
				{
					return toHeal;
				}
				if (Hurricane.isSimulacrumRun && !Hurricane.waveStarted)
				{
					return toHeal;
				}
				return ((int)tbf.owner.GetComponent<CharacterBody>().teamComponent.teamIndex != 1) ? toHeal : (toHeal * HurricaneRunInfo.instance.rexHealOverride);
			});
		}

		public static void REXPrimaryAttack(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			if (!val.TryGotoNext(new Func<Instruction, bool>[5]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdfld<ProjectileHealOwnerOnDamageInflicted>(x, "fractionOfDamage"),
				(Instruction x) => ILPatternMatchingExt.MatchMul(x),
				(Instruction x) => ILPatternMatchingExt.MatchStfld<HealOrb>(x, "healValue"),
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 1),
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.3f)
			}))
			{
				Log.Error("Failed to hook DIRECTIVE: Inject!");
				return;
			}
			val.Index += 2;
			val.Emit(OpCodes.Ldarg_0);
			val.EmitDelegate<Func<float, ProjectileHealOwnerOnDamageInflicted, float>>((Func<float, ProjectileHealOwnerOnDamageInflicted, float>)delegate(float toHeal, ProjectileHealOwnerOnDamageInflicted self)
			{
				//IL_0039: Unknown result type (might be due to invalid IL or missing references)
				//IL_003f: Invalid comparison between Unknown and I4
				if (Hurricane.isSimulacrumRun && !Hurricane.waveStarted)
				{
					return toHeal;
				}
				if (self.projectileController.catalogIndex != HurricaneCachedIndexes.injector)
				{
					return toHeal;
				}
				return ((int)self.projectileController.owner.GetComponent<CharacterBody>().teamComponent.teamIndex != 1) ? toHeal : (toHeal * HurricaneRunInfo.instance.rexHealOverride);
			});
		}

		public static void AcridRegenBuff(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			if (!val.TryGotoNext(new Func<Instruction, bool>[7]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCall<CharacterBody>(x, "GetBuffCount"),
				(Instruction x) => ILPatternMatchingExt.MatchConvR4(x),
				(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
				(Instruction x) => ILPatternMatchingExt.MatchCall<CharacterBody>(x, "get_maxHealth"),
				(Instruction x) => ILPatternMatchingExt.MatchMul(x),
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.1f),
				(Instruction x) => ILPatternMatchingExt.MatchMul(x)
			}))
			{
				Log.Error("Failed to hook CrocoRegen!");
				return;
			}
			val.Index += 6;
			val.Emit(OpCodes.Ldarg_0);
			val.EmitDelegate<Func<float, CharacterBody, float>>((Func<float, CharacterBody, float>)delegate(float toHeal, CharacterBody cb)
			{
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: Invalid comparison between Unknown and I4
				if (Hurricane.isSimulacrumRun && !Hurricane.waveStarted)
				{
					return toHeal;
				}
				return ((int)cb.teamComponent.teamIndex != 1) ? toHeal : (toHeal * HurricaneRunInfo.instance.acridHealOverride);
			});
		}

		public static void CaptainWardBuff(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdfld<HealingWard>(x, "healFraction")
			}))
			{
				Log.Error("Failed to hook HealingWard!");
				return;
			}
			val.Emit(OpCodes.Ldarg_0);
			val.EmitDelegate<Func<float, HealingWard, float>>((Func<float, HealingWard, float>)delegate(float toHeal, HealingWard hw)
			{
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: Invalid comparison between Unknown and I4
				if (Hurricane.isSimulacrumRun && !Hurricane.waveStarted)
				{
					return toHeal;
				}
				if ((int)hw.teamFilter.teamIndex != 1)
				{
					return toHeal;
				}
				return (((Object)hw).name != "CaptainHealingWard(Clone)") ? toHeal : (toHeal * HurricaneRunInfo.instance.captainHealOverride);
			});
		}

		public static void VoidFiendSuppressBuff(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			if (!val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0),
				(Instruction x) => ILPatternMatchingExt.MatchCallvirt<HealthComponent>(x, "HealFraction")
			}))
			{
				Log.Error("Failed to hook Suppress!");
				return;
			}
			val.Emit(OpCodes.Ldarg_0);
			val.EmitDelegate<Func<float, EntityState, float>>((Func<float, EntityState, float>)delegate(float toHeal, EntityState es)
			{
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: Invalid comparison between Unknown and I4
				if (Hurricane.isSimulacrumRun && !Hurricane.waveStarted)
				{
					return toHeal;
				}
				return ((int)es.teamComponent.teamIndex != 1) ? toHeal : (toHeal * HurricaneRunInfo.instance.voidFiendHealOverride);
			});
		}

		public static void SeekerUnseenHandBuff(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdfld<DamageReport>(x, "damageDealt")
			}))
			{
				Log.Error("Failed to hook Unseen Hand Healing!");
				return;
			}
			val.Emit(OpCodes.Ldloc_1);
			val.EmitDelegate<Func<float, CharacterBody, float>>((Func<float, CharacterBody, float>)delegate(float toHeal, CharacterBody cb)
			{
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: Invalid comparison between Unknown and I4
				if (Hurricane.isSimulacrumRun && !Hurricane.waveStarted)
				{
					return toHeal;
				}
				return ((int)cb.teamComponent.teamIndex != 1) ? toHeal : (toHeal * HurricaneRunInfo.instance.seekerHealOverride);
			});
		}

		public static void SeekerMeditateBuff(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdfld<MeditationUI>(x, "healingExplosionAmount")
			}))
			{
				Log.Error("Failed to hook Meditate!");
				return;
			}
			val.Emit(OpCodes.Ldarg_0);
			val.EmitDelegate<Func<float, EntityState, float>>((Func<float, EntityState, float>)delegate(float toHeal, EntityState es)
			{
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: Invalid comparison between Unknown and I4
				if (Hurricane.isSimulacrumRun && !Hurricane.waveStarted)
				{
					return toHeal;
				}
				return ((int)es.teamComponent.teamIndex != 1) ? toHeal : (toHeal * HurricaneRunInfo.instance.seekerHealOverride);
			});
		}

		public static void FalseSonLunarTamperingBuff(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdfld<CharacterBody>(x, "tamperedHeartRegenBonus")
			}))
			{
				Log.Error("Failed to hook Tampered Heart Regen!");
				return;
			}
			val.Emit(OpCodes.Ldarg_0);
			val.EmitDelegate<Func<float, CharacterBody, float>>((Func<float, CharacterBody, float>)delegate(float toHeal, CharacterBody cb)
			{
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: Invalid comparison between Unknown and I4
				if (Hurricane.isSimulacrumRun && !Hurricane.waveStarted)
				{
					return toHeal;
				}
				return ((int)cb.teamComponent.teamIndex != 1) ? toHeal : (toHeal * HurricaneRunInfo.instance.falseSonHealOverride);
			});
		}

		public static void ChefSotSChefsKissBuff(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 68),
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 44)
			}))
			{
				Log.Error("Failed to hook Chef's Kiss!");
				return;
			}
			val.Emit(OpCodes.Ldarg_1);
			val.EmitDelegate<Func<float, DamageReport, float>>((Func<float, DamageReport, float>)delegate(float toHeal, DamageReport dr)
			{
				//IL_001b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0021: Invalid comparison between Unknown and I4
				if (Hurricane.isSimulacrumRun && !Hurricane.waveStarted)
				{
					return toHeal;
				}
				return ((int)dr.attackerBody.teamComponent.teamIndex != 1) ? toHeal : (toHeal * HurricaneRunInfo.instance.chefSotSHealOverride);
			});
			if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 68),
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 45)
			}))
			{
				Log.Error("Failed to hook Chef's Kiss!");
				object obj = <>O.<0>__ChefSotSChefsKissBuff;
				if (obj == null)
				{
					Manipulator val2 = ChefSotSChefsKissBuff;
					<>O.<0>__ChefSotSChefsKissBuff = val2;
					obj = (object)val2;
				}
				GlobalEventManager.OnCharacterDeath -= (Manipulator)obj;
				return;
			}
			val.Emit(OpCodes.Ldarg_1);
			val.EmitDelegate<Func<float, DamageReport, float>>((Func<float, DamageReport, float>)delegate(float toHeal, DamageReport dr)
			{
				//IL_001b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0021: Invalid comparison between Unknown and I4
				if (Hurricane.isSimulacrumRun && !Hurricane.waveStarted)
				{
					return toHeal;
				}
				return ((int)dr.attackerBody.teamComponent.teamIndex != 1) ? toHeal : (toHeal * HurricaneRunInfo.instance.chefSotSHealOverride);
			});
		}
	}
	internal class LocalizedCheckBoxOption : CheckBoxOption
	{
		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public LocalizedCheckBoxOption(ConfigEntry<bool> configEntry, bool restart)
			: base(configEntry, restart)
		{
			Language.onCurrentLanguageChanged += ResetDescription;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public override void RegisterTokens()
		{
			((BaseOption)this).Description = Language.GetString(((BaseOption)this).GetDescriptionToken());
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private void ResetDescription()
		{
			((BaseOption)this).Description = Language.GetString(((BaseOption)this).GetDescriptionToken());
		}
	}
	internal class LocalizedIntSliderOption : IntSliderOption
	{
		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public LocalizedIntSliderOption(ConfigEntry<int> configEntry, IntSliderConfig config)
			: base(configEntry, config)
		{
			Language.onCurrentLanguageChanged += ResetDescription;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public override void RegisterTokens()
		{
			((BaseOption)this).Description = Language.GetString(((BaseOption)this).GetDescriptionToken());
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private void ResetDescription()
		{
			((BaseOption)this).Description = Language.GetString(((BaseOption)this).GetDescriptionToken());
		}
	}
	internal class LocalizedSliderOption : SliderOption
	{
		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public LocalizedSliderOption(ConfigEntry<float> configEntry, SliderConfig config)
			: base(configEntry, config)
		{
			Language.onCurrentLanguageChanged += ResetDescription;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public override void RegisterTokens()
		{
			((BaseOption)this).Description = Language.GetString(((BaseOption)this).GetDescriptionToken());
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private void ResetDescription()
		{
			((BaseOption)this).Description = Language.GetString(((BaseOption)this).GetDescriptionToken());
		}
	}
	internal class LocalizedSliderStepOption : StepSliderOption
	{
		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public LocalizedSliderStepOption(ConfigEntry<float> configEntry, StepSliderConfig config)
			: base(configEntry, config)
		{
			Language.onCurrentLanguageChanged += ResetDescription;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public override void RegisterTokens()
		{
			((BaseOption)this).Description = Language.GetString(((BaseOption)this).GetDescriptionToken());
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private void ResetDescription()
		{
			((BaseOption)this).Description = Language.GetString(((BaseOption)this).GetDescriptionToken());
		}
	}
	internal class LocalizedButtonOption : GenericButtonOption
	{
		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public LocalizedButtonOption(string name, string category, string description, string buttonText, UnityAction onButtonPressed)
			: base(name, category, description, buttonText, onButtonPressed)
		{
			Language.onCurrentLanguageChanged += ResetDescription;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public override void RegisterTokens()
		{
			((BaseOption)this).Description = Language.GetString(((BaseOption)this).GetDescriptionToken());
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private void ResetDescription()
		{
			((BaseOption)this).Description = Language.GetString(((BaseOption)this).GetDescriptionToken());
		}
	}
	internal class HurricaneRunInfo : NetworkBehaviour
	{
		public static HurricaneRunInfo instance;

		public static bool preSet;

		public static HurricaneSaveData saveData;

		[FormerlySerializedAs("doNerfsThisRun")]
		[SyncVar]
		public bool doEnemyNerfs;

		[FormerlySerializedAs("doGoldThisRun")]
		public bool doGoldPenalty;

		[FormerlySerializedAs("doHealBuffThisRun")]
		public bool doHealingBuffs;

		[FormerlySerializedAs("doEnemyBoostThisRun")]
		public bool doEnemyLimitBoost;

		[FormerlySerializedAs("enemyChanceToYapThisRun")]
		public float enemyChanceToYap;

		[FormerlySerializedAs("enemyYapCooldownThisRun")]
		public float enemyYapCooldown;

		[FormerlySerializedAs("limitPestsThisRun")]
		public bool limitPest;

		[FormerlySerializedAs("limitPestsAmountThisRun")]
		public float limitPestAmount;

		public float rexHealOverride;

		public float acridHealOverride;

		public float captainHealOverride;

		public float voidFiendHealOverride;

		public float seekerHealOverride;

		public float falseSonHealOverride;

		public float chefSotSHealOverride;

		public float chirrHealOverride;

		public float aliemHealOverride;

		public float submarinerHealOverride;

		public float ravagerHealOverride;

		public float paladinBarrierOverride;

		public bool NetworkdoEnemyNerfs
		{
			get
			{
				return doEnemyNerfs;
			}
			[param: In]
			set
			{
				((NetworkBehaviour)this).SetSyncVar<bool>(value, ref doEnemyNerfs, 1u);
			}
		}

		public void Awake()
		{
			instance = this;
			Object.DontDestroyOnLoad((Object)(object)this);
			if (preSet)
			{
				doEnemyLimitBoost = saveData.doEnemyLimitBoost;
				doHealingBuffs = saveData.doHealingBuffs;
				doGoldPenalty = saveData.doGoldPenalty;
				NetworkdoEnemyNerfs = saveData.doEnemyNerfs;
				enemyChanceToYap = saveData.enemyChanceToYap;
				enemyYapCooldown = saveData.enemyYapCooldown;
				limitPest = saveData.limitPest;
				limitPestAmount = saveData.limitPestAmount;
				rexHealOverride = saveData.rexHealOverride;
				acridHealOverride = saveData.acridHealOverride;
				captainHealOverride = saveData.captainHealOverride;
				voidFiendHealOverride = saveData.voidFiendHealOverride;
				seekerHealOverride = saveData.seekerHealOverride;
				falseSonHealOverride = saveData.falseSonHealOverride;
				chefSotSHealOverride = saveData.chefSotSHealOverride;
				chirrHealOverride = saveData.chirrHealOverride;
				aliemHealOverride = saveData.aliemHealOverride;
				submarinerHealOverride = saveData.submarinerHealOverride;
				ravagerHealOverride = saveData.ravagerHealOverride;
				paladinBarrierOverride = saveData.paladinBarrierOverride;
			}
		}

		private void UNetVersion()
		{
		}

		public override bool OnSerialize(NetworkWriter writer, bool forceAll)
		{
			if (forceAll)
			{
				writer.Write(doEnemyNerfs);
				return true;
			}
			bool flag = false;
			if ((((NetworkBehaviour)this).syncVarDirtyBits & (true ? 1u : 0u)) != 0)
			{
				if (!flag)
				{
					writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits);
					flag = true;
				}
				writer.Write(doEnemyNerfs);
			}
			if (!flag)
			{
				writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits);
			}
			return flag;
		}

		public override void OnDeserialize(NetworkReader reader, bool initialState)
		{
			if (initialState)
			{
				doEnemyNerfs = reader.ReadBoolean();
				return;
			}
			int num = (int)reader.ReadPackedUInt32();
			if (((uint)num & (true ? 1u : 0u)) != 0)
			{
				doEnemyNerfs = reader.ReadBoolean();
			}
		}
	}
	public struct HurricaneSaveData
	{
		[DataMember(Name = "validCheck")]
		public bool isValidSave;

		[DataMember(Name = "gold")]
		public bool doGoldPenalty;

		[DataMember(Name = "nerf")]
		public bool doEnemyNerfs;

		[DataMember(Name = "heal")]
		public bool doHealingBuffs;

		[DataMember(Name = "boost")]
		public bool doEnemyLimitBoost;

		[DataMember(Name = "yapChance")]
		public float enemyChanceToYap;

		[DataMember(Name = "yapTime")]
		public float enemyYapCooldown;

		[DataMember(Name = "exLimitPest")]
		public bool limitPest;

		[DataMember(Name = "exPestCount")]
		public float limitPestAmount;

		[DataMember(Name = "rexHeal")]
		public float rexHealOverride;

		[DataMember(Name = "acridHeal")]
		public float acridHealOverride;

		[DataMember(Name = "captainHeal")]
		public float captainHealOverride;

		[DataMember(Name = "voidFiendHeal")]
		public float voidFiendHealOverride;

		[DataMember(Name = "seekerHeal")]
		public float seekerHealOverride;

		[DataMember(Name = "falseSonHeal")]
		public float falseSonHealOverride;

		[DataMember(Name = "chefSotSHeal")]
		public float chefSotSHealOverride;

		[DataMember(Name = "chirrHeal")]
		public float chirrHealOverride;

		[DataMember(Name = "aliemHeal")]
		public float aliemHealOverride;

		[DataMember(Name = "submarinerHeal")]
		public float submarinerHealOverride;

		[DataMember(Name = "ravagerHeal")]
		public float ravagerHealOverride;

		[DataMember(Name = "paladinBarrier")]
		public float paladinBarrierOverride;
	}
	internal static class HurricaneSimulacrum
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static Manipulator <0>__ExtractRNGFromCombatDirector;
		}

		private static bool rngExtracted;

		private static Xoroshiro128Plus rng;

		public static void OnAllEnemiesDefeatedServer(InfiniteTowerWaveController waveController)
		{
			Hurricane.waveStarted = false;
		}

		public static void InfiniteTowerRun_BeginNextWave(orig_BeginNextWave beginNextWave, InfiniteTowerRun self)
		{
			Hurricane.waveStarted = true;
			beginNextWave.Invoke(self);
		}

		public static void InfiniteTowerWaveController_Initialize(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdfld<Run>(x, "difficultyCoefficient")
			}))
			{
				Log.Fatal("Failed to hook into InfiniteTowerWaveController.Initialize!");
				return;
			}
			val.EmitDelegate<Func<float, float>>((Func<float, float>)((float b) => b * 1.1f));
		}

		public static void InfiniteTowerWaveController_FixedUpdate(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdfld<InfiniteTowerWaveController>(x, "maxSquadSize")
			}))
			{
				Log.Fatal("Failed to hook into InfiniteTowerWaveController.FixedUpdate!");
				return;
			}
			val.EmitDelegate<Func<int, int>>((Func<int, int>)((int b) => (!HurricaneRunInfo.instance.doEnemyLimitBoost) ? b : ((int)((float)b * 1.5f))));
		}

		public static void ExtractRNGFromCombatDirector(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdfld<CombatDirector>(x, "rng")
			}))
			{
				Log.Error("Could not get RNG! Uninstalling hook!");
				object obj = <>O.<0>__ExtractRNGFromCombatDirector;
				if (obj == null)
				{
					Manipulator val2 = ExtractRNGFromCombatDirector;
					<>O.<0>__ExtractRNGFromCombatDirector = val2;
					obj = (object)val2;
				}
				CombatDirector.AttemptSpawnOnTarget -= (Manipulator)obj;
				rngExtracted = false;
			}
			else
			{
				val.EmitDelegate<Func<Xoroshiro128Plus, Xoroshiro128Plus>>((Func<Xoroshiro128Plus, Xoroshiro128Plus>)delegate(Xoroshiro128Plus rngThing)
				{
					rng = rngThing;
					rngExtracted = true;
					return rngThing;
				});
			}
		}

		public static void CombatDirector_PrepareNewMonsterWave(orig_PrepareNewMonsterWave prep, CombatDirector self, DirectorCard card)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			if (!HurricaneRunInfo.instance.limitPest || !rngExtracted)
			{
				prep.Invoke(self, card);
				return;
			}
			GameObject bodyPrefab = BodyCatalog.GetBodyPrefab(HurricaneCachedIndexes.bodyCache[BodyCache.FlyingVermin]);
			GameObject bodyPrefab2 = BodyCatalog.GetBodyPrefab(HurricaneCachedIndexes.bodyCache[BodyCache.Lemurian]);
			GameObject bodyPrefab3 = card.spawnCard.prefab.GetComponent<CharacterMaster>().bodyPrefab;
			while ((Object)(object)bodyPrefab3 == (Object)(object)bodyPrefab || (Object)(object)bodyPrefab3 == (Object)(object)bodyPrefab2)
			{
				int num = 0;
				num += TeamComponent.GetTeamMembers((TeamIndex)2).Count;
				num += TeamComponent.GetTeamMembers((TeamIndex)4).Count;
				num += TeamComponent.GetTeamMembers((TeamIndex)3).Count;
				int num2 = (int)((float)num * (HurricaneRunInfo.instance.limitPestAmount / 100f));
				if ((Hurricane.totalBlindPest <= num2 || !((Object)(object)bodyPrefab3 == (Object)(object)bodyPrefab)) && (Hurricane.totalLemurians <= num2 || !((Object)(object)bodyPrefab3 == (Object)(object)bodyPrefab2)))
				{
					break;
				}
				Log.Warning("Too many bastards. Generating new director card.");
				card = GenerateNewDirectorCard();
				bodyPrefab3 = card.spawnCard.prefab.GetComponent<CharacterMaster>().bodyPrefab;
			}
			prep.Invoke(self, card);
		}

		private static DirectorCard GenerateNewDirectorCard()
		{
			return ClassicStageInfo.instance.monsterSelection.Evaluate(rng.nextNormalizedFloat);
		}
	}
	internal static class HurricaneSurvivorBuffs
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static UnityAction <0>__ResetToDefault;
		}

		public static ConfigEntry<float> RexHealOverride { get; set; }

		public static ConfigEntry<float> AcridHealOverride { get; set; }

		public static ConfigEntry<float> CaptainHealOverride { get; set; }

		public static ConfigEntry<float> VoidFiendHealOverride { get; set; }

		public static ConfigEntry<float> SeekerHealOverride { get; set; }

		public static ConfigEntry<float> FalseSonHealOverride { get; set; }

		public static ConfigEntry<float> ChefSotSHealOverride { get; set; }

		public static ConfigEntry<float> ChirrHealOverride { get; set; }

		public static ConfigEntry<float> AliemHealOverride { get; set; }

		public static ConfigEntry<float> SubmarinerHealOverride { get; set; }

		public static ConfigEntry<float> RavagerHealOverride { get; set; }

		public static ConfigEntry<float> PaladinBarrierOverride { get; set; }

		public static void ClampValues()
		{
			RexHealOverride.Value = Math.Clamp(RexHealOverride.Value, 0.5f, 2f);
			AcridHealOverride.Value = Math.Clamp(AcridHealOverride.Value, 0.5f, 2f);
			CaptainHealOverride.Value = Math.Clamp(CaptainHealOverride.Value, 0.5f, 2f);
			VoidFiendHealOverride.Value = Math.Clamp(VoidFiendHealOverride.Value, 0.5f, 2f);
			SeekerHealOverride.Value = Math.Clamp(SeekerHealOverride.Value, 0.5f, 2f);
			FalseSonHealOverride.Value = Math.Clamp(FalseSonHealOverride.Value, 0.5f, 2f);
			ChefSotSHealOverride.Value = Math.Clamp(ChefSotSHealOverride.Value, 0.5f, 2f);
			ChirrHealOverride.Value = Math.Clamp(ChirrHealOverride.Value, 0.5f, 2f);
			AliemHealOverride.Value = Math.Clamp(AliemHealOverride.Value, 0.5f, 2f);
			SubmarinerHealOverride.Value = Math.Clamp(SubmarinerHealOverride.Value, 0.5f, 2f);
			RavagerHealOverride.Value = Math.Clamp(RavagerHealOverride.Value, 0.5f, 2f);
			PaladinBarrierOverride.Value = Math.Clamp(PaladinBarrierOverride.Value, 0f, 100f);
		}

		public static void RegisterOptions()
		{
			RexHealOverride = ((BaseUnityPlugin)HurricanePlugin.instance).Config.Bind<float>("Healing Buffs", "REX Override", 1.5f, "The amount to multiply Tangling Growth and DIRECTIVE: Inject healing by.");
			AcridHealOverride = ((BaseUnityPlugin)HurricanePlugin.instance).Config.Bind<float>("Healing Buffs", "Acrid Override", 2f, "The amount to multiply regenerative buff healing by.");
			CaptainHealOverride = ((BaseUnityPlugin)HurricanePlugin.instance).Config.Bind<float>("Healing Buffs", "Captain Override", 1f, "The amount to multiply healing beacon healing by.");
			VoidFiendHealOverride = ((BaseUnityPlugin)HurricanePlugin.instance).Config.Bind<float>("Healing Buffs", "Void Fiend Override", 1f, "The amount to multiply 【Sup??ress』 healing by.");
			SeekerHealOverride = ((BaseUnityPlugin)HurricanePlugin.instance).Config.Bind<float>("Healing Buffs", "Seeker Override", 1.5f, "The amount to multiply Unseen Hand and Meditate healing by.");
			FalseSonHealOverride = ((BaseUnityPlugin)HurricanePlugin.instance).Config.Bind<float>("Healing Buffs", "False Son Override", 1f, "The amount to multiply Lunar Tampering healing by.");
			ChefSotSHealOverride = ((BaseUnityPlugin)HurricanePlugin.instance).Config.Bind<float>("Healing Buffs", "Chef Override", 2f, "The amount to multiply Chef's Kiss healing by.");
			ChirrHealOverride = ((BaseUnityPlugin)HurricanePlugin.instance).Config.Bind<float>("Healing Buffs", "Chirr Override", 2f, "The amount to multiply Soothing Venom buff healing by.");
			AliemHealOverride = ((BaseUnityPlugin)HurricanePlugin.instance).Config.Bind<float>("Healing Buffs", "Alien Hominid Override", 2f, "The amount to multiply Chomp healing by.");
			SubmarinerHealOverride = ((BaseUnityPlugin)HurricanePlugin.instance).Config.Bind<float>("Healing Buffs", "Submariner Override", 2f, "The amount to multiply N'kuhanna's Restoration healing by.");
			RavagerHealOverride = ((BaseUnityPlugin)HurricanePlugin.instance).Config.Bind<float>("Healing Buffs", "Ravager Override", 1.5f, "The amount to multiply Consume healing by.");
			PaladinBarrierOverride = ((BaseUnityPlugin)HurricanePlugin.instance).Config.Bind<float>("Healing Buffs", "Paladin Override", 81f, "The amount to subtract from barrier decay rate multiplier.");
		}

		public static void RegisterRiskOfOptions()
		{
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Expected O, but got Unknown
			string format = "{0}x";
			RoO.AddFloatStep(RexHealOverride, 0.5f, 2f, 0.025f, format);
			RoO.AddFloatStep(AcridHealOverride, 0.5f, 2f, 0.025f, format);
			RoO.AddFloatStep(CaptainHealOverride, 0.5f, 2f, 0.025f, format);
			RoO.AddFloatStep(VoidFiendHealOverride, 0.5f, 2f, 0.025f, format);
			RoO.AddFloatStep(SeekerHealOverride, 0.5f, 2f, 0.025f, format);
			RoO.AddFloatStep(FalseSonHealOverride, 0.5f, 2f, 0.025f, format);
			RoO.AddFloatStep(ChefSotSHealOverride, 0.5f, 2f, 0.025f, format);
			RoO.AddFloatStep(ChirrHealOverride, 0.5f, 2f, 0.025f, format);
			RoO.AddFloatStep(AliemHealOverride, 0.5f, 2f, 0.025f, format);
			RoO.AddFloatStep(SubmarinerHealOverride, 0.5f, 2f, 0.025f, format);
			RoO.AddFloatStep(RavagerHealOverride, 0.5f, 2f, 0.025f, format);
			RoO.AddFloatStep(PaladinBarrierOverride, 0f, 100f, 1f, "{0}%");
			object obj = <>O.<0>__ResetToDefault;
			if (obj == null)
			{
				UnityAction val = RoO.ResetToDefault;
				<>O.<0>__ResetToDefault = val;
				obj = (object)val;
			}
			RoO.AddButton("Reset to default", "Healing Buffs", (UnityAction)obj);
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.HDeDeDe.ChunkyMode", "ChunkyMode", "0.4.7")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class HurricanePlugin : BaseUnityPlugin
	{
		public const string PluginGUID = "com.HDeDeDe.ChunkyMode";

		public const string PluginAuthor = "HDeDeDe";

		public const string PluginName = "ChunkyMode";

		public const string PluginVersion = "0.4.7";

		public static HurricanePlugin instance;

		private void Awake()
		{
			if ((Object)(object)instance != (Object)null)
			{
				Log.Error("There can be only 1 instance of ChunkyMode!");
				Object.Destroy((Object)(object)this);
			}
			else
			{
				Log.Init(((BaseUnityPlugin)this).Logger);
				instance = this;
				Hurricane.StartUp();
			}
		}
	}
}
namespace HDeMods.CM
{
	internal static class Log
	{
		private static ManualLogSource logSource;

		internal static void Init(ManualLogSource log)
		{
			logSource = log;
		}

		internal static void Debug(object data)
		{
			logSource.LogDebug(data);
		}

		internal static void Error(object data)
		{
			logSource.LogError(data);
		}

		internal static void Fatal(object data)
		{
			logSource.LogFatal(data);
		}

		internal static void Info(object data)
		{
			logSource.LogInfo(data);
		}

		internal static void Message(object data)
		{
			logSource.LogMessage(data);
		}

		internal static void Warning(object data)
		{
			logSource.LogWarning(data);
		}
	}
}
namespace HDeMods.HurricaneOptionalMods
{
	internal static class Hunk
	{
		public static bool Enabled => Chainloader.PluginInfos.ContainsKey("com.rob.Hunk");
	}
	internal static class Spikestrip
	{
		private static string unusedString = "https://github.com/HDeDeDe/ChunkyMode/blob/main/Resources/922279cb37ba22c549cb24845246cab250b7a671b7e1997d10e742e81c945785_1.jpg?raw=true";

		public static bool Enabled => Chainloader.PluginInfos.ContainsKey("_com.prodzpod.ProdzpodSpikestripContent");
	}
	internal static class RiskUI
	{
		public static bool Enabled => Chainloader.PluginInfos.ContainsKey("bubbet.riskui");

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void AddLegacyDifficulty()
		{
			RiskUIPlugin.DifficultyIconMap["CHUNKYMODEDIFFMOD_NAME"] = Hurricane.HurricaneBundle.LoadAsset<Sprite>("texChunkyModeRiskUI");
		}
	}
	internal static class Starstorm2
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static Manipulator <0>__BuffChirr;
		}

		private static ILHook chirrHook;

		public static bool Enabled => Chainloader.PluginInfos.ContainsKey("com.TeamMoonstorm");

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void GenerateHooks()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			MethodInfo methodInfo = AccessTools.Method(typeof(Chirr), "ModifyStats", (Type[])null, (Type[])null);
			object obj = <>O.<0>__BuffChirr;
			if (obj == null)
			{
				Manipulator val = BuffChirr;
				<>O.<0>__BuffChirr = val;
				obj = (object)val;
			}
			chirrHook = new ILHook((MethodBase)methodInfo, (Manipulator)obj);
			chirrHook.Undo();
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void SetHooks()
		{
			chirrHook.Apply();
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void RemoveHooks()
		{
			chirrHook.Undo();
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private static void BuffChirr(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "SS2.Survivors.Chirr", "_percentHealthRegen")
			}))
			{
				Log.Error("Failed to hook Soothing Venom buff!");
				return;
			}
			val.Emit(OpCodes.Ldarg_1);
			val.EmitDelegate<Func<float, CharacterBody, float>>((Func<float, CharacterBody, float>)delegate(float toHeal, CharacterBody cb)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_000c: Invalid comparison between Unknown and I4
				if ((int)cb.teamComponent.teamIndex != 1)
				{
					return toHeal;
				}
				return (Hurricane.isSimulacrumRun && !Hurricane.waveStarted) ? toHeal : (toHeal * HurricaneRunInfo.instance.chirrHealOverride);
			});
		}
	}
	internal static class AlienHominid
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static Manipulator <0>__BuffAliem;
		}

		private static ILHook aliemHook;

		public static bool Enabled => Chainloader.PluginInfos.ContainsKey("com.TheTimeSweeper.Aliem");

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void GenerateHooks()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			MethodInfo methodInfo = AccessTools.Method(typeof(AliemRidingChomp), "FuckinHealInMultiplayerPlease", (Type[])null, (Type[])null);
			object obj = <>O.<0>__BuffAliem;
			if (obj == null)
			{
				Manipulator val = BuffAliem;
				<>O.<0>__BuffAliem = val;
				obj = (object)val;
			}
			aliemHook = new ILHook((MethodBase)methodInfo, (Manipulator)obj);
			aliemHook.Undo();
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void SetHooks()
		{
			aliemHook.Apply();
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void RemoveHooks()
		{
			aliemHook.Undo();
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private static void BuffAliem(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "AliemMod.Content.AliemConfig", "M3_Chomp_Healing")
			}))
			{
				Log.Error("Failed to hook Chomp!");
				return;
			}
			int index = val.Index;
			val.Index = index + 1;
			val.Emit(OpCodes.Ldarg_0);
			val.EmitDelegate<Func<float, EntityState, float>>((Func<float, EntityState, float>)delegate(float toHeal, EntityState es)
			{
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				//IL_0018: Invalid comparison between Unknown and I4
				HealthComponent healthComponent = es.healthComponent;
				if ((int)healthComponent.body.teamComponent.teamIndex != 1)
				{
					return toHeal;
				}
				return (Hurricane.isSimulacrumRun && !Hurricane.waveStarted) ? toHeal : (toHeal * HurricaneRunInfo.instance.aliemHealOverride);
			});
		}
	}
	internal static class Ravager
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static Manipulator <0>__BuffRavager;
		}

		private static ILHook ravagerHook;

		public static bool Enabled => Chainloader.PluginInfos.ContainsKey("com.rob.Ravager");

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void GenerateHooks()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			MethodInfo methodInfo = AccessTools.Method(typeof(ConsumeOrb), "OnArrival", (Type[])null, (Type[])null);
			object obj = <>O.<0>__BuffRavager;
			if (obj == null)
			{
				Manipulator val = BuffRavager;
				<>O.<0>__BuffRavager = val;
				obj = (object)val;
			}
			ravagerHook = new ILHook((MethodBase)methodInfo, (Manipulator)obj);
			ravagerHook.Undo();
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void SetHooks()
		{
			ravagerHook.Apply();
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void RemoveHooks()
		{
			ravagerHook.Undo();
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private static void BuffRavager(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[3]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdfld<HurtBox>(x, "healthComponent"),
				(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
				(Instruction x) => ILPatternMatchingExt.MatchLdfld<ConsumeOrb>(x, "healOverride")
			}))
			{
				Log.Error("Failed to hook ConsumeOrb!");
				return;
			}
			val.Emit(OpCodes.Ldarg_0);
			val.EmitDelegate<Func<float, Orb, float>>((Func<float, Orb, float>)delegate(float toHeal, Orb orb)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_000c: Invalid comparison between Unknown and I4
				if ((int)orb.target.teamIndex != 1)
				{
					return toHeal;
				}
				return (Hurricane.isSimulacrumRun && !Hurricane.waveStarted) ? toHeal : (toHeal * HurricaneRunInfo.instance.ravagerHealOverride);
			});
			float num = default(float);
			if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdfld<HurtBox>(x, "healthComponent"),
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, ref num)
			}))
			{
				Log.Error("Failed to hook ConsumeOrb!");
				return;
			}
			val.Emit(OpCodes.Ldarg_0);
			val.EmitDelegate<Func<float, Orb, float>>((Func<float, Orb, float>)delegate(float toHeal, Orb orb)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_000c: Invalid comparison between Unknown and I4
				if ((int)orb.target.teamIndex != 1)
				{
					return toHeal;
				}
				return (Hurricane.isSimulacrumRun && !Hurricane.waveStarted) ? toHeal : (toHeal * HurricaneRunInfo.instance.ravagerHealOverride);
			});
		}
	}
	internal static class Submariner
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static Manipulator <0>__BuffSubmariner;
		}

		private static ILHook submarinerHook;

		public static bool Enabled => Chainloader.PluginInfos.ContainsKey("com.kenko.Submariner");

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void GenerateHooks()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			MethodInfo methodInfo = AccessTools.Method(typeof(SubmarinerSurvivor), "CharacterBody_RecalculateStats", (Type[])null, (Type[])null);
			object obj = <>O.<0>__BuffSubmariner;
			if (obj == null)
			{
				Manipulator val = BuffSubmariner;
				<>O.<0>__BuffSubmariner = val;
				obj = (object)val;
			}
			submarinerHook = new ILHook((MethodBase)methodInfo, (Manipulator)obj);
			submarinerHook.Undo();
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void SetHooks()
		{
			submarinerHook.Apply();
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void RemoveHooks()
		{
			submarinerHook.Undo();
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private static void BuffSubmariner(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[3]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "SubmarinerMod.SubmarinerCharacter.Content.SubmarinerBuffs", "SubmarinerRegenBuff"),
				(Instruction x) => ILPatternMatchingExt.MatchCallvirt<CharacterBody>(x, "GetBuffCount"),
				(Instruction x) => ILPatternMatchingExt.MatchConvR4(x)
			}))
			{
				Log.Error("Failed to hook Submariner Recalculate Stats!");
				return;
			}
			val.Emit(OpCodes.Ldarg_2);
			val.EmitDelegate<Func<float, CharacterBody, float>>((Func<float, CharacterBody, float>)delegate(float toHeal, CharacterBody cb)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				//IL_000c: Invalid comparison between Unknown and I4
				if ((int)cb.teamComponent.teamIndex != 1)
				{
					return toHeal;
				}
				return (Hurricane.isSimulacrumRun && !Hurricane.waveStarted) ? toHeal : (toHeal * HurricaneRunInfo.instance.submarinerHealOverride);
			});
		}
	}
	internal static class RoO
	{
		public delegate void LogFunc(object data);

		private static string modGUID;

		private static string modNAME;

		private static LogFunc logError;

		private static bool initialized;

		public static bool Enabled => Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions");

		public static void Init(string modGuid, string modName, LogFunc errorFunc, LogFunc debugFunc = null)
		{
			logError = errorFunc;
			modGUID = modGuid;
			modNAME = modName;
			if (!Enabled)
			{
				logError("Risk of Options is not present, the author of " + modNAME + " did not check for this! Mod GUID: " + modGUID);
			}
			else
			{
				initialized = true;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void AddCheck(ConfigEntry<bool> option, bool requireRestart = false)
		{
			if (initialized)
			{
				LocalizedCheckBoxOption localizedCheckBoxOption = new LocalizedCheckBoxOption(option, requireRestart);
				ModSettingsManager.AddOption((BaseOption)(object)localizedCheckBoxOption, modGUID, modNAME);
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void AddInt(ConfigEntry<int> option, int minimum, int maximum)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			if (initialized)
			{
				LocalizedIntSliderOption localizedIntSliderOption = new LocalizedIntSliderOption(option, new IntSliderConfig
				{
					min = minimum,
					max = maximum
				});
				ModSettingsManager.AddOption((BaseOption)(object)localizedIntSliderOption, modGUID, modNAME);
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void AddFloat(ConfigEntry<float> option, float minimum, float maximum, string format = "{0:0}%")
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			if (initialized)
			{
				LocalizedSliderOption localizedSliderOption = new LocalizedSliderOption(option, new SliderConfig
				{
					min = minimum,
					max = maximum,
					FormatString = format
				});
				ModSettingsManager.AddOption((BaseOption)(object)localizedSliderOption, modGUID, modNAME);
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void AddFloatStep(ConfigEntry<float> option, float minimum, float maximum, float step, string format = "{0:0}%")
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			if (initialized)
			{
				LocalizedSliderStepOption localizedSliderStepOption = new LocalizedSliderStepOption(option, new StepSliderConfig
				{
					min = minimum,
					max = maximum,
					FormatString = format,
					increment = step
				});
				ModSettingsManager.AddOption((BaseOption)(object)localizedSliderStepOption, modGUID, modNAME);
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void AddButton(string name, string category, UnityAction onButtonPressed)
		{
			if (initialized)
			{
				LocalizedButtonOption localizedButtonOption = new LocalizedButtonOption(name, category, "", "", onButtonPressed);
				ModSettingsManager.AddOption((BaseOption)(object)localizedButtonOption, modGUID, modNAME);
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void SetSprite(Sprite sprite)
		{
			ModSettingsManager.SetModIcon(sprite);
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void SetDescriptionToken(string description)
		{
			ModSettingsManager.SetModDescriptionToken(description);
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void ResetToDefault()
		{
			if (!initialized)
			{
				return;
			}
			GameObject val = GameObject.Find("SettingsPanelTitle(Clone)");
			if ((Object)(object)val == (Object)null)
			{
				val = GameObject.Find("SettingsPanel(Clone)");
			}
			ModOptionPanelController component = val.GetComponent<ModOptionPanelController>