Decompiled source of InfernoMithrixStandalone v1.0.1

InfernoMithrixStandalone.dll

Decompiled 9 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.BrotherHaunt;
using EntityStates.BrotherMonster;
using EntityStates.BrotherMonster.Weapon;
using EntityStates.Missions.BrotherEncounter;
using Microsoft.CodeAnalysis;
using On.EntityStates.BrotherHaunt;
using On.EntityStates.BrotherMonster;
using On.EntityStates.BrotherMonster.Weapon;
using On.EntityStates.Missions.BrotherEncounter;
using On.RoR2;
using On.RoR2.Projectile;
using R2API;
using RoR2;
using RoR2.CharacterAI;
using RoR2.Projectile;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.SceneManagement;

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

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace InfernoMithrixStandalone
{
	public static class AI
	{
		public static void Init()
		{
			CharacterMaster.onStartGlobal += CharacterMaster_onStartGlobal;
		}

		private static void CharacterMaster_onStartGlobal(CharacterMaster master)
		{
			//IL_0314: 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)
			CharacterBody body = master.GetBody();
			if (!Object.op_Implicit((Object)(object)body))
			{
				return;
			}
			BaseAI component = ((Component)master).GetComponent<BaseAI>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				return;
			}
			string name = ((Object)master).name;
			string text = name;
			if (!(text == "BrotherMaster(Clone)"))
			{
				if (text == "BrotherHurtMaster(Clone)")
				{
					master.inventory.GiveItem(Items.TeleportWhenOob, 1);
					body.levelMoveSpeed = Main.LevelMoveSpeed.Value;
					body.levelRegen = Main.LevelRegen.Value;
					body.levelAttackSpeed = Main.LevelAttackSpeed.Value;
					component.fullVision = true;
					component.aimVectorDampTime = Mathf.Max(0.001f, 0.031f - 0.0001f * Main.AIScaling.Value * (float)Run.instance.stageClearCount);
					component.aimVectorMaxSpeed = 250f + 20f * Main.AIScaling.Value * (float)Run.instance.stageClearCount;
					component.enemyAttentionDuration = 1.5f;
					AISkillDriver val = (from x in ((Component)master).GetComponents<AISkillDriver>()
						where x.customName == "SlamGround"
						select x).First();
					val.maxUserHealthFraction = float.PositiveInfinity;
					val.movementType = (MovementType)2;
					AISkillDriver val2 = (from x in ((Component)master).GetComponents<AISkillDriver>()
						where x.customName == "Shoot"
						select x).First();
					val2.movementType = (MovementType)2;
					master.inventory.GiveItem(Items.PrimaryStockItemDef, 6);
					master.inventory.GiveItem(Items.AllCooldownItemDef, 5);
				}
				return;
			}
			master.inventory.GiveItem(Items.TeleportWhenOob, 1);
			body.levelMoveSpeed = Main.LevelMoveSpeed.Value;
			body.levelRegen = Main.LevelRegen.Value;
			body.levelAttackSpeed = Main.LevelAttackSpeed.Value;
			component.fullVision = true;
			component.aimVectorDampTime = Mathf.Max(0.001f, 0.031f - 0.0001f * Main.AIScaling.Value * (float)Run.instance.stageClearCount);
			component.aimVectorMaxSpeed = 250f + 20f * Main.AIScaling.Value * (float)Run.instance.stageClearCount;
			component.enemyAttentionDuration = 1.5f;
			AISkillDriver val3 = (from x in ((Component)master).GetComponents<AISkillDriver>()
				where x.customName == "Sprint and FireLunarShards"
				select x).First();
			val3.minDistance = 0f;
			val3.maxUserHealthFraction = float.PositiveInfinity;
			AISkillDriver val4 = (from x in ((Component)master).GetComponents<AISkillDriver>()
				where x.customName == "Sprint After Target"
				select x).First();
			val4.minDistance = 40f - Main.AIScaling.Value * (float)Run.instance.stageClearCount;
			AISkillDriver val5 = (from x in ((Component)master).GetComponents<AISkillDriver>()
				where x.customName == "DashStrafe"
				select x).First();
			val5.nextHighPriorityOverride = val3;
			master.inventory.GiveItem(Items.UtilityStockItemDef, 1);
			master.inventory.GiveItem(Items.SpecialStockItemDef, 1);
			master.inventory.GiveItem(Items.AllCooldownItemDef, 10);
		}
	}
	public static class Body
	{
		public static void Init()
		{
			CharacterBody.onBodyAwakeGlobal += CharacterBody_onBodyAwakeGlobal;
		}

		private static void CharacterBody_onBodyAwakeGlobal(CharacterBody body)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: 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_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			if (body.bodyIndex == Main.mithrixBody && body.bodyIndex == Main.mithrixPhase4Body)
			{
				SetStateOnHurt component = ((Component)body).GetComponent<SetStateOnHurt>();
				CharacterDirection component2 = ((Component)body).GetComponent<CharacterDirection>();
				if ((Object)(object)component2 != (Object)null)
				{
					component2.turnSpeed = 360f;
				}
				if ((Object)(object)component != (Object)null)
				{
					component.canBeHitStunned = false;
				}
				if (body.bodyIndex == Main.mithrixBody)
				{
					body.baseAcceleration = 200f;
					body.baseMoveSpeed = 17f;
					body.baseMaxHealth = 800f;
					body.levelMaxHealth = 240f;
					body.bodyFlags = (BodyFlags)(body.bodyFlags | 1);
					body.bodyFlags = (BodyFlags)(body.bodyFlags | 0x20);
				}
				if (body.bodyIndex == Main.mithrixPhase4Body)
				{
					body.baseMaxHealth = 500f;
					body.levelMaxHealth = 150f;
					body.baseMoveSpeed = 10f;
					body.sprintingSpeedMultiplier = 1.45f;
					body.baseDamage = 5f;
					body.levelDamage = 1f;
					body.bodyFlags = (BodyFlags)(body.bodyFlags | 1);
					body.bodyFlags = (BodyFlags)(body.bodyFlags | 0x20);
				}
			}
		}
	}
	public static class Items
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_RecalculateStats <0>__AddStock;

			public static StatHookEventHandler <1>__ChangeCDR;
		}

		private const string PrimaryStockItemName = "InfernoMithrixStandalone: +1 Primary Stock";

		private const string PrimaryStockItemLangTokenName = "INFERNO_MITHRIX_STANDALONE_PRIMARYSTOCK";

		private const string PrimaryStockItemPickupDesc = "Racecar";

		private const string PrimaryStockItemFullDescription = "15:21";

		private const string SecondaryStockItemName = "InfernoMithrixStandalone: +1 Secondary Stock";

		private const string SecondaryStockItemLangTokenName = "INFERNO_MITHRIX_STANDALONE_SECONDARYSTOCK";

		private const string SecondaryStockItemPickupDesc = "Omega";

		private const string SecondaryStockItemFullDescription = "11:44";

		private const string UtilityStockItemName = "InfernoMithrixStandalone: +1 Utility Stock";

		private const string UtilityStockItemLangTokenName = "INFERNO_MITHRIX_STANDALONE_UTILITYSTOCK";

		private const string UtilityStockItemPickupDesc = "Reptile";

		private const string UtilityStockItemFullDescription = "16:44";

		private const string SpecialStockItemName = "InfernoMithrixStandalone: +1 Special Stock";

		private const string SpecialStockItemLangTokenName = "INFERNO_MITHRIX_STANDALONE_SPECIALSTOCK";

		private const string SpecialStockItemPickupDesc = "Dracul Gras";

		private const string SpecialStockItemFullDescription = "12:22";

		private const string AllCooldownItemName = "InfernoMithrixStandalone: +1% All CDR";

		private const string AllCooldownItemLangTokenName = "INFERNO_MITHRIX_STANDALONE_ALLCDR";

		private const string AllCooldownItemPickupDesc = "Periphery VI When";

		private const string AllCooldownItemFullDescription = "???:???";

		public static ItemTier Tier;

		public static ItemDef PrimaryStockItemDef;

		public static ItemDef SecondaryStockItemDef;

		public static ItemDef UtilityStockItemDef;

		public static ItemDef SpecialStockItemDef;

		public static ItemDef AllCooldownItemDef;

		public static ItemTag[] ItemTags { get; set; } = (ItemTag[])(object)new ItemTag[0];


		public static void Init()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Expected O, but got Unknown
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Expected O, but got Unknown
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: Unknown result type (might be due to invalid IL or missing references)
			//IL_0242: Expected O, but got Unknown
			//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: 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_02f7: Expected O, but got Unknown
			//IL_035e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0363: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ac: Expected O, but got Unknown
			//IL_03bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c8: Expected O, but got Unknown
			//IL_03de: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e9: Expected O, but got Unknown
			ItemTags = new List<ItemTag>(ItemTags) { (ItemTag)4 }.ToArray();
			Tier = (ItemTier)5;
			PrimaryStockItemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)PrimaryStockItemDef).name = "ITEM_INFERNO_MITHRIX_STANDALONE_PRIMARYSTOCK";
			PrimaryStockItemDef.nameToken = "ITEM_INFERNO_MITHRIX_STANDALONE_PRIMARYSTOCK_NAME";
			PrimaryStockItemDef.pickupToken = "ITEM_INFERNO_MITHRIX_STANDALONE_PRIMARYSTOCK_PICKUP";
			PrimaryStockItemDef.descriptionToken = "ITEM_INFERNO_MITHRIX_STANDALONE_PRIMARYSTOCK_DESCRIPTION";
			PrimaryStockItemDef.hidden = true;
			PrimaryStockItemDef.tags = ItemTags;
			PrimaryStockItemDef.deprecatedTier = Tier;
			LanguageAPI.Add("ITEM_INFERNO_MITHRIX_STANDALONE_PRIMARYSTOCK_NAME", "InfernoMithrixStandalone: +1 Primary Stock");
			LanguageAPI.Add("ITEM_INFERNO_MITHRIX_STANDALONE_PRIMARYSTOCK_PICKUP", "Racecar");
			LanguageAPI.Add("ITEM_INFERNO_MITHRIX_STANDALONE_PRIMARYSTOCK_DESCRIPTION", "15:21");
			ItemAPI.Add(new CustomItem(PrimaryStockItemDef, CreateItemDisplayRules()));
			SecondaryStockItemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)SecondaryStockItemDef).name = "ITEM_INFERNO_MITHRIX_STANDALONE_SECONDARYSTOCK";
			SecondaryStockItemDef.nameToken = "ITEM_INFERNO_MITHRIX_STANDALONE_SECONDARYSTOCK_NAME";
			SecondaryStockItemDef.pickupToken = "ITEM_INFERNO_MITHRIX_STANDALONE_SECONDARYSTOCK_PICKUP";
			SecondaryStockItemDef.descriptionToken = "ITEM_INFERNO_MITHRIX_STANDALONE_SECONDARYSTOCK_DESCRIPTION";
			SecondaryStockItemDef.hidden = true;
			SecondaryStockItemDef.tags = ItemTags;
			SecondaryStockItemDef.deprecatedTier = Tier;
			LanguageAPI.Add("ITEM_INFERNO_MITHRIX_STANDALONE_SECONDARYSTOCK_NAME", "InfernoMithrixStandalone: +1 Secondary Stock");
			LanguageAPI.Add("ITEM_INFERNO_MITHRIX_STANDALONE_SECONDARYSTOCK_PICKUP", "Omega");
			LanguageAPI.Add("ITEM_INFERNO_MITHRIX_STANDALONE_SECONDARYSTOCK_DESCRIPTION", "11:44");
			ItemAPI.Add(new CustomItem(SecondaryStockItemDef, CreateItemDisplayRules()));
			UtilityStockItemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)UtilityStockItemDef).name = "ITEM_INFERNO_MITHRIX_STANDALONE_UTILITYSTOCK";
			UtilityStockItemDef.nameToken = "ITEM_INFERNO_MITHRIX_STANDALONE_UTILITYSTOCK_NAME";
			UtilityStockItemDef.pickupToken = "ITEM_INFERNO_MITHRIX_STANDALONE_UTILITYSTOCK_PICKUP";
			UtilityStockItemDef.descriptionToken = "ITEM_INFERNO_MITHRIX_STANDALONE_UTILITYSTOCK_DESCRIPTION";
			UtilityStockItemDef.hidden = true;
			UtilityStockItemDef.tags = ItemTags;
			UtilityStockItemDef.deprecatedTier = Tier;
			LanguageAPI.Add("ITEM_INFERNO_MITHRIX_STANDALONE_UTILITYSTOCK_NAME", "InfernoMithrixStandalone: +1 Utility Stock");
			LanguageAPI.Add("ITEM_INFERNO_MITHRIX_STANDALONE_UTILITYSTOCK_PICKUP", "Reptile");
			LanguageAPI.Add("ITEM_INFERNO_MITHRIX_STANDALONE_UTILITYSTOCK_DESCRIPTION", "16:44");
			ItemAPI.Add(new CustomItem(UtilityStockItemDef, CreateItemDisplayRules()));
			SpecialStockItemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)SpecialStockItemDef).name = "ITEM_INFERNO_MITHRIX_STANDALONE_SPECIALSTOCK";
			SpecialStockItemDef.nameToken = "ITEM_INFERNO_MITHRIX_STANDALONE_SPECIALSTOCK_NAME";
			SpecialStockItemDef.pickupToken = "ITEM_INFERNO_MITHRIX_STANDALONE_SPECIALSTOCK_PICKUP";
			SpecialStockItemDef.descriptionToken = "ITEM_INFERNO_MITHRIX_STANDALONE_SPECIALSTOCK_DESCRIPTION";
			SpecialStockItemDef.hidden = true;
			SpecialStockItemDef.tags = ItemTags;
			SpecialStockItemDef.deprecatedTier = Tier;
			LanguageAPI.Add("ITEM_INFERNO_MITHRIX_STANDALONE_SPECIALSTOCK_NAME", "InfernoMithrixStandalone: +1 Special Stock");
			LanguageAPI.Add("ITEM_INFERNO_MITHRIX_STANDALONE_SPECIALSTOCK_PICKUP", "Dracul Gras");
			LanguageAPI.Add("ITEM_INFERNO_MITHRIX_STANDALONE_SPECIALSTOCK_DESCRIPTION", "12:22");
			ItemAPI.Add(new CustomItem(SpecialStockItemDef, CreateItemDisplayRules()));
			AllCooldownItemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)AllCooldownItemDef).name = "ITEM_INFERNO_MITHRIX_STANDALONE_ALLCDR";
			AllCooldownItemDef.nameToken = "ITEM_INFERNO_MITHRIX_STANDALONE_ALLCDR_NAME";
			AllCooldownItemDef.pickupToken = "ITEM_INFERNO_MITHRIX_STANDALONE_ALLCDR_PICKUP";
			AllCooldownItemDef.descriptionToken = "ITEM_INFERNO_MITHRIX_STANDALONE_ALLCDR_DESCRIPTION";
			AllCooldownItemDef.hidden = true;
			AllCooldownItemDef.tags = ItemTags;
			AllCooldownItemDef.deprecatedTier = Tier;
			LanguageAPI.Add("ITEM_INFERNO_MITHRIX_STANDALONE_ALLCDR_NAME", "InfernoMithrixStandalone: +1% All CDR");
			LanguageAPI.Add("ITEM_INFERNO_MITHRIX_STANDALONE_ALLCDR_PICKUP", "Periphery VI When");
			LanguageAPI.Add("ITEM_INFERNO_MITHRIX_STANDALONE_ALLCDR_DESCRIPTION", "???:???");
			ItemAPI.Add(new CustomItem(AllCooldownItemDef, CreateItemDisplayRules()));
			object obj = <>O.<0>__AddStock;
			if (obj == null)
			{
				hook_RecalculateStats val = AddStock;
				<>O.<0>__AddStock = val;
				obj = (object)val;
			}
			CharacterBody.RecalculateStats += (hook_RecalculateStats)obj;
			object obj2 = <>O.<1>__ChangeCDR;
			if (obj2 == null)
			{
				StatHookEventHandler val2 = ChangeCDR;
				<>O.<1>__ChangeCDR = val2;
				obj2 = (object)val2;
			}
			RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj2;
		}

		public static void ChangeCDR(CharacterBody sender, StatHookEventArgs args)
		{
			if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory))
			{
				int itemCount = sender.inventory.GetItemCount(AllCooldownItemDef);
				if (itemCount > 0)
				{
					args.cooldownMultAdd -= 0.01f * (float)itemCount;
				}
			}
		}

		public static void AddStock(orig_RecalculateStats orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.inventory) && Object.op_Implicit((Object)(object)self.skillLocator))
			{
				SkillLocator skillLocator = self.skillLocator;
				if (Object.op_Implicit((Object)(object)skillLocator.primary))
				{
					skillLocator.primary.SetBonusStockFromBody(skillLocator.primary.bonusStockFromBody + self.inventory.GetItemCount(PrimaryStockItemDef));
				}
				if (Object.op_Implicit((Object)(object)skillLocator.secondary))
				{
					skillLocator.secondary.SetBonusStockFromBody(skillLocator.secondary.bonusStockFromBody + self.inventory.GetItemCount(SecondaryStockItemDef));
				}
				if (Object.op_Implicit((Object)(object)skillLocator.utility))
				{
					skillLocator.utility.SetBonusStockFromBody(skillLocator.utility.bonusStockFromBody + self.inventory.GetItemCount(UtilityStockItemDef));
				}
				if (Object.op_Implicit((Object)(object)skillLocator.special))
				{
					skillLocator.special.SetBonusStockFromBody(skillLocator.special.bonusStockFromBody + self.inventory.GetItemCount(SpecialStockItemDef));
				}
			}
		}

		public static ItemDisplayRuleDict CreateItemDisplayRules()
		{
			return null;
		}
	}
	[BepInPlugin("HIFU.InfernoMithrixStandalone", "InfernoMithrixStandalone", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Main : BaseUnityPlugin
	{
		public const string PluginGUID = "HIFU.InfernoMithrixStandalone";

		public const string PluginAuthor = "HIFU";

		public const string PluginName = "InfernoMithrixStandalone";

		public const string PluginVersion = "1.0.0";

		public static ManualLogSource IMSLogger;

		public static BodyIndex mithrixBody;

		public static BodyIndex mithrixPhase4Body;

		public static bool hasFired;

		public static GameObject Ramp1;

		public static GameObject Ramp2;

		public static GameObject Ramp3;

		public static GameObject Rocks;

		public static int ShardCount;

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

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

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

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

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

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

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

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

		public void Awake()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			IMSLogger = ((BaseUnityPlugin)this).Logger;
			BodyCatalog.Init += new hook_Init(BodyCatalog_Init);
			LevelMoveSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Enemy Move Speed Scaling", 0.12f, "Adds move speed to each monster every level. Vanilla is 0");
			LevelRegen = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Enemy Regen Scaling", 0.12f, "Adds health regen to each monster every level. Vanilla is 0");
			LevelAttackSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Enemy Attack Speed Scaling", 0.003f, "Adds attack speed to each monster every level. Vanilla is 0");
			LoopArmor = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Enemy Armor Scaling", 10f, "Adds armor to each monster every completed loop. Vanilla is 0");
			BossHp = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Boss Health Scaling", 0.07f, "Adds % max hp to each boss every completed stage. Vanilla is 0");
			StageCooldownReduction = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Enemy Cooldown Reduction Scaling", 0.01f, "Adds % cooldown reduction to each monster every completed stage. Vanilla is 0");
			ProjectileSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("General II", "Enemy Projectile Speed", 1.25f, "Sets the projectile speed multiplier. Vanilla is 1");
			AIScaling = ((BaseUnityPlugin)this).Config.Bind<float>("General II", "AI Scaling Coefficient", 1f, "Adds to AI aim and range every cleared stage. Only works with AI Changes enabled. Vanilla is false");
			Items.Init();
			AI.Init();
			Body.Init();
			Skills.Init();
		}

		private void BodyCatalog_Init(orig_Init orig)
		{
			//IL_000d: 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)
			//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)
			orig.Invoke();
			mithrixBody = BodyCatalog.FindBodyIndex("BrotherBody");
			mithrixPhase4Body = BodyCatalog.FindBodyIndex("BrotherHurtBody");
		}
	}
	public static class Skills
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_OnEnter <0>__FireRandomProjectiles;

			public static hook_OnEnter <1>__BaseSlideState;

			public static hook_OnEnter <2>__ExitSkyLeap;

			public static hook_OnEnter <3>__FistSlam;

			public static hook_OnEnter <4>__HoldSkyLeap;

			public static hook_OnEnter <5>__SlideIntroState;

			public static hook_OnEnter <6>__SpellChannelEnterState;

			public static hook_OnEnter <7>__SpellChannelExitState;

			public static hook_OnEnter <8>__SpellChannelState;

			public static hook_OnEnter <9>__SprintBash;

			public static hook_OnEnter <10>__StaggerEnter;

			public static hook_OnEnter <11>__StaggerExit;

			public static hook_OnEnter <12>__StaggerLoop;

			public static hook_OnEnter <13>__TrueDeathState;

			public static hook_OnEnter <14>__UltChannelState;

			public static hook_FireWave <15>__FireWave;

			public static hook_OnEnter <16>__FireLunarShards;

			public static hook_FixedUpdate <17>__WeaponSlam2;

			public static hook_OnEnter <18>__WeaponSlam;

			public static hook_OnEnter <19>__Phase1;

			public static hook_OnEnter <20>__Phase2;

			public static hook_OnEnter <21>__Phase3;

			public static hook_OnEnter <22>__Phase4;

			public static hook_Start <23>__SpeedUpProjectiles;

			public static hook_Start <24>__SpeedUpProjectiles2;

			public static hook_Start <25>__CacheObjects;

			public static StatHookEventHandler <26>__RecalculateStatsAPI_GetStatCoefficients;
		}

		public static void Init()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//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_003d: Expected O, but got Unknown
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Expected O, but got Unknown
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Expected O, but got Unknown
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Expected O, but got Unknown
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: 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_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Expected O, but got Unknown
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Expected O, but got Unknown
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Expected O, but got Unknown
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Expected O, but got Unknown
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Expected O, but got Unknown
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Expected O, but got Unknown
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Expected O, but got Unknown
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Expected O, but got Unknown
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Unknown result type (might be due to invalid IL or missing references)
			//IL_022c: Expected O, but got Unknown
			//IL_0242: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Expected O, but got Unknown
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_0268: Unknown result type (might be due to invalid IL or missing references)
			//IL_026e: Expected O, but got Unknown
			//IL_0284: Unknown result type (might be due to invalid IL or missing references)
			//IL_0289: Unknown result type (might be due to invalid IL or missing references)
			//IL_028f: Expected O, but got Unknown
			//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Expected O, but got Unknown
			//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d1: Expected O, but got Unknown
			//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f2: 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_0329: Unknown result type (might be due to invalid IL or missing references)
			//IL_032e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0334: Expected O, but got Unknown
			//IL_034a: Unknown result type (might be due to invalid IL or missing references)
			//IL_034f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0355: Expected O, but got Unknown
			//IL_036b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0370: Unknown result type (might be due to invalid IL or missing references)
			//IL_0376: Expected O, but got Unknown
			object obj = <>O.<0>__FireRandomProjectiles;
			if (obj == null)
			{
				hook_OnEnter val = FireRandomProjectiles;
				<>O.<0>__FireRandomProjectiles = val;
				obj = (object)val;
			}
			FireRandomProjectiles.OnEnter += (hook_OnEnter)obj;
			object obj2 = <>O.<1>__BaseSlideState;
			if (obj2 == null)
			{
				hook_OnEnter val2 = BaseSlideState;
				<>O.<1>__BaseSlideState = val2;
				obj2 = (object)val2;
			}
			BaseSlideState.OnEnter += (hook_OnEnter)obj2;
			object obj3 = <>O.<2>__ExitSkyLeap;
			if (obj3 == null)
			{
				hook_OnEnter val3 = ExitSkyLeap;
				<>O.<2>__ExitSkyLeap = val3;
				obj3 = (object)val3;
			}
			ExitSkyLeap.OnEnter += (hook_OnEnter)obj3;
			object obj4 = <>O.<3>__FistSlam;
			if (obj4 == null)
			{
				hook_OnEnter val4 = FistSlam;
				<>O.<3>__FistSlam = val4;
				obj4 = (object)val4;
			}
			FistSlam.OnEnter += (hook_OnEnter)obj4;
			object obj5 = <>O.<4>__HoldSkyLeap;
			if (obj5 == null)
			{
				hook_OnEnter val5 = HoldSkyLeap;
				<>O.<4>__HoldSkyLeap = val5;
				obj5 = (object)val5;
			}
			HoldSkyLeap.OnEnter += (hook_OnEnter)obj5;
			object obj6 = <>O.<5>__SlideIntroState;
			if (obj6 == null)
			{
				hook_OnEnter val6 = SlideIntroState;
				<>O.<5>__SlideIntroState = val6;
				obj6 = (object)val6;
			}
			SlideIntroState.OnEnter += (hook_OnEnter)obj6;
			object obj7 = <>O.<6>__SpellChannelEnterState;
			if (obj7 == null)
			{
				hook_OnEnter val7 = SpellChannelEnterState;
				<>O.<6>__SpellChannelEnterState = val7;
				obj7 = (object)val7;
			}
			SpellChannelEnterState.OnEnter += (hook_OnEnter)obj7;
			object obj8 = <>O.<7>__SpellChannelExitState;
			if (obj8 == null)
			{
				hook_OnEnter val8 = SpellChannelExitState;
				<>O.<7>__SpellChannelExitState = val8;
				obj8 = (object)val8;
			}
			SpellChannelExitState.OnEnter += (hook_OnEnter)obj8;
			object obj9 = <>O.<8>__SpellChannelState;
			if (obj9 == null)
			{
				hook_OnEnter val9 = SpellChannelState;
				<>O.<8>__SpellChannelState = val9;
				obj9 = (object)val9;
			}
			SpellChannelState.OnEnter += (hook_OnEnter)obj9;
			object obj10 = <>O.<9>__SprintBash;
			if (obj10 == null)
			{
				hook_OnEnter val10 = SprintBash;
				<>O.<9>__SprintBash = val10;
				obj10 = (object)val10;
			}
			SprintBash.OnEnter += (hook_OnEnter)obj10;
			object obj11 = <>O.<10>__StaggerEnter;
			if (obj11 == null)
			{
				hook_OnEnter val11 = StaggerEnter;
				<>O.<10>__StaggerEnter = val11;
				obj11 = (object)val11;
			}
			StaggerEnter.OnEnter += (hook_OnEnter)obj11;
			object obj12 = <>O.<11>__StaggerExit;
			if (obj12 == null)
			{
				hook_OnEnter val12 = StaggerExit;
				<>O.<11>__StaggerExit = val12;
				obj12 = (object)val12;
			}
			StaggerExit.OnEnter += (hook_OnEnter)obj12;
			object obj13 = <>O.<12>__StaggerLoop;
			if (obj13 == null)
			{
				hook_OnEnter val13 = StaggerLoop;
				<>O.<12>__StaggerLoop = val13;
				obj13 = (object)val13;
			}
			StaggerLoop.OnEnter += (hook_OnEnter)obj13;
			object obj14 = <>O.<13>__TrueDeathState;
			if (obj14 == null)
			{
				hook_OnEnter val14 = TrueDeathState;
				<>O.<13>__TrueDeathState = val14;
				obj14 = (object)val14;
			}
			TrueDeathState.OnEnter += (hook_OnEnter)obj14;
			object obj15 = <>O.<14>__UltChannelState;
			if (obj15 == null)
			{
				hook_OnEnter val15 = UltChannelState;
				<>O.<14>__UltChannelState = val15;
				obj15 = (object)val15;
			}
			UltChannelState.OnEnter += (hook_OnEnter)obj15;
			object obj16 = <>O.<15>__FireWave;
			if (obj16 == null)
			{
				hook_FireWave val16 = FireWave;
				<>O.<15>__FireWave = val16;
				obj16 = (object)val16;
			}
			UltChannelState.FireWave += (hook_FireWave)obj16;
			object obj17 = <>O.<16>__FireLunarShards;
			if (obj17 == null)
			{
				hook_OnEnter val17 = FireLunarShards;
				<>O.<16>__FireLunarShards = val17;
				obj17 = (object)val17;
			}
			FireLunarShards.OnEnter += (hook_OnEnter)obj17;
			object obj18 = <>O.<17>__WeaponSlam2;
			if (obj18 == null)
			{
				hook_FixedUpdate val18 = WeaponSlam2;
				<>O.<17>__WeaponSlam2 = val18;
				obj18 = (object)val18;
			}
			WeaponSlam.FixedUpdate += (hook_FixedUpdate)obj18;
			object obj19 = <>O.<18>__WeaponSlam;
			if (obj19 == null)
			{
				hook_OnEnter val19 = WeaponSlam;
				<>O.<18>__WeaponSlam = val19;
				obj19 = (object)val19;
			}
			WeaponSlam.OnEnter += (hook_OnEnter)obj19;
			object obj20 = <>O.<19>__Phase1;
			if (obj20 == null)
			{
				hook_OnEnter val20 = Phase1;
				<>O.<19>__Phase1 = val20;
				obj20 = (object)val20;
			}
			Phase1.OnEnter += (hook_OnEnter)obj20;
			object obj21 = <>O.<20>__Phase2;
			if (obj21 == null)
			{
				hook_OnEnter val21 = Phase2;
				<>O.<20>__Phase2 = val21;
				obj21 = (object)val21;
			}
			Phase2.OnEnter += (hook_OnEnter)obj21;
			object obj22 = <>O.<21>__Phase3;
			if (obj22 == null)
			{
				hook_OnEnter val22 = Phase3;
				<>O.<21>__Phase3 = val22;
				obj22 = (object)val22;
			}
			Phase3.OnEnter += (hook_OnEnter)obj22;
			object obj23 = <>O.<22>__Phase4;
			if (obj23 == null)
			{
				hook_OnEnter val23 = Phase4;
				<>O.<22>__Phase4 = val23;
				obj23 = (object)val23;
			}
			Phase4.OnEnter += (hook_OnEnter)obj23;
			object obj24 = <>O.<23>__SpeedUpProjectiles;
			if (obj24 == null)
			{
				hook_Start val24 = SpeedUpProjectiles;
				<>O.<23>__SpeedUpProjectiles = val24;
				obj24 = (object)val24;
			}
			ProjectileSimple.Start += (hook_Start)obj24;
			object obj25 = <>O.<24>__SpeedUpProjectiles2;
			if (obj25 == null)
			{
				hook_Start val25 = SpeedUpProjectiles2;
				<>O.<24>__SpeedUpProjectiles2 = val25;
				obj25 = (object)val25;
			}
			ProjectileController.Start += (hook_Start)obj25;
			object obj26 = <>O.<25>__CacheObjects;
			if (obj26 == null)
			{
				hook_Start val26 = CacheObjects;
				<>O.<25>__CacheObjects = val26;
				obj26 = (object)val26;
			}
			SceneDirector.Start += (hook_Start)obj26;
			object obj27 = <>O.<26>__RecalculateStatsAPI_GetStatCoefficients;
			if (obj27 == null)
			{
				StatHookEventHandler val27 = RecalculateStatsAPI_GetStatCoefficients;
				<>O.<26>__RecalculateStatsAPI_GetStatCoefficients = val27;
				obj27 = (object)val27;
			}
			RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj27;
		}

		public static void SpeedUpProjectiles2(orig_Start orig, ProjectileController self)
		{
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			ProjectileCharacterController component = ((Component)self).gameObject.GetComponent<ProjectileCharacterController>();
			ProjectileController component2 = ((Component)self).GetComponent<ProjectileController>();
			object obj;
			if (component2 == null)
			{
				obj = null;
			}
			else
			{
				GameObject owner = component2.owner;
				obj = ((owner != null) ? owner.GetComponent<CharacterBody>() : null);
			}
			CharacterBody val = (CharacterBody)obj;
			if ((Object)(object)((Component)self).gameObject != (Object)null && (Object)(object)component != (Object)null && (val.bodyIndex == Main.mithrixBody || val.bodyIndex == Main.mithrixPhase4Body))
			{
				component.velocity *= Main.ProjectileSpeed.Value;
				if (component.lifetime < 4f)
				{
					component.lifetime = 4f;
				}
			}
		}

		public static void SlideIntroState(orig_OnEnter orig, SlideIntroState self)
		{
			//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_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)self).isAuthority)
			{
				Ray aimRay = ((BaseState)self).GetAimRay();
				for (int i = 0; i < 6; i++)
				{
					ProjectileManager.instance.FireProjectile(FireLunarShards.projectilePrefab, ((Ray)(ref aimRay)).origin, Quaternion.LookRotation(((Ray)(ref aimRay)).direction), ((EntityState)self).gameObject, ((EntityState)self).characterBody.damage * 0.03f / 12f, 0f, Util.CheckRoll(((EntityState)self).characterBody.crit, ((EntityState)self).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f);
					((Ray)(ref aimRay)).direction = Util.ApplySpread(((Ray)(ref aimRay)).direction, 0f, 4f, 4f, 4f, 0f, 0f);
				}
			}
			orig.Invoke(self);
		}

		public static void FireWave(orig_FireWave orig, UltChannelState self)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: 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_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)self).isAuthority)
			{
				float num = 4f;
				float num2 = 360f / num;
				Vector3 val = Vector3.ProjectOnPlane(((EntityState)self).inputBank.aimDirection, Vector3.up);
				Transform val2 = ((BaseState)self).FindModelChild(WeaponSlam.muzzleString);
				Vector3 val3 = val2.position + new Vector3(Random.Range(-50f, 50f), 0f, Random.Range(-50f, 50f));
				for (int i = 0; (float)i < num; i++)
				{
					Vector3 val4 = Quaternion.AngleAxis(num2 * (float)i, Vector3.up) * val;
					ProjectileManager.instance.FireProjectile(UltChannelState.waveProjectileLeftPrefab, val3, Util.QuaternionSafeLookRotation(val4), ((EntityState)self).gameObject, ((EntityState)self).characterBody.damage * 4f, FistSlam.waveProjectileForce, Util.CheckRoll(((EntityState)self).characterBody.crit, ((EntityState)self).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f);
				}
			}
			orig.Invoke(self);
		}

		public static void Phase1(orig_OnEnter orig, Phase1 self)
		{
			Main.Ramp1.SetActive(false);
			Main.Ramp2.SetActive(false);
			Main.Ramp3.SetActive(false);
			Main.Rocks.SetActive(false);
			orig.Invoke(self);
		}

		public static void CacheObjects(orig_Start orig, SceneDirector self)
		{
			//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)
			Scene activeScene = SceneManager.GetActiveScene();
			if (((Scene)(ref activeScene)).name == "moon2")
			{
				Transform transform = GameObject.Find("HOLDER: Final Arena").transform;
				Main.Ramp1 = ((Component)transform.GetChild(0)).gameObject;
				Main.Ramp2 = ((Component)transform.GetChild(1)).gameObject;
				Main.Ramp3 = ((Component)transform.GetChild(2)).gameObject;
				Main.Rocks = ((Component)transform.GetChild(6)).gameObject;
			}
			orig.Invoke(self);
		}

		public static void Phase4(orig_OnEnter orig, Phase4 self)
		{
			Main.Ramp1.SetActive(false);
			Main.Ramp2.SetActive(false);
			Main.Ramp3.SetActive(false);
			Main.Rocks.SetActive(false);
			orig.Invoke(self);
		}

		public static void HoldSkyLeap(orig_OnEnter orig, HoldSkyLeap self)
		{
			HoldSkyLeap.duration = 2f;
			if (NetworkServer.active)
			{
				Util.CleanseBody(((EntityState)self).characterBody, true, false, false, true, true, false);
			}
			orig.Invoke(self);
		}

		public static void ExitSkyLeap(orig_OnEnter orig, ExitSkyLeap self)
		{
			ExitSkyLeap.waveProjectileCount = 20;
			ExitSkyLeap.waveProjectileDamageCoefficient = 2f;
			orig.Invoke(self);
		}

		public static void WeaponSlam(orig_OnEnter orig, WeaponSlam self)
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			WeaponSlam.waveProjectileArc = 360f;
			WeaponSlam.waveProjectileCount = 8;
			WeaponSlam.waveProjectileDamageCoefficient = 2f;
			WeaponSlam.waveProjectileForce = -1600f;
			WeaponSlam.weaponForce = -2300f;
			GameObject pillarProjectilePrefab = WeaponSlam.pillarProjectilePrefab;
			pillarProjectilePrefab.transform.localScale = new Vector3(4f, 4f, 4f);
			GameObject ghostPrefab = pillarProjectilePrefab.GetComponent<ProjectileController>().ghostPrefab;
			ghostPrefab.transform.localScale = new Vector3(4f, 4f, 4f);
			Main.hasFired = false;
			WeaponSlam.duration = 3f;
			orig.Invoke(self);
		}

		public static void BaseSlideState(orig_OnEnter orig, BaseSlideState self)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: 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_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			if (!(self is SlideBackwardState))
			{
				if (!(self is SlideLeftState))
				{
					if (self is SlideRightState)
					{
						self.slideRotation = Quaternion.AngleAxis(40f, Vector3.up);
					}
				}
				else
				{
					self.slideRotation = Quaternion.AngleAxis(-40f, Vector3.up);
				}
			}
			else
			{
				self.slideRotation = Quaternion.identity;
			}
			orig.Invoke(self);
		}

		public static void SprintBash(orig_OnEnter orig, SprintBash self)
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//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_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			SprintBash.durationBeforePriorityReduces = 0.18f;
			((BasicMeleeAttack)self).baseDuration = 1.4f;
			((BasicMeleeAttack)self).damageCoefficient = 1.5f;
			((BasicMeleeAttack)self).pushAwayForce = 1500f;
			((BasicMeleeAttack)self).forceVector = new Vector3(0f, 750f, 0f);
			if (((EntityState)self).isAuthority)
			{
				for (int i = 0; i < 6; i++)
				{
					Ray aimRay = ((BaseState)self).GetAimRay();
					Vector3 val = Util.ApplySpread(((Ray)(ref aimRay)).direction, 0f, 0f, 1f, 0f, (float)i * 5f, 0f);
					ProjectileManager.instance.FireProjectile(FireLunarShards.projectilePrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(val), ((EntityState)self).gameObject, ((EntityState)self).characterBody.damage * 0.05f / 12f, 0f, Util.CheckRoll(((EntityState)self).characterBody.crit, ((EntityState)self).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f);
					Ray aimRay2 = ((BaseState)self).GetAimRay();
					Vector3 val2 = Util.ApplySpread(((Ray)(ref aimRay2)).direction, 0f, 0f, 1f, 0f, (0f - (float)i) * 5f, 0f);
					ProjectileManager.instance.FireProjectile(FireLunarShards.projectilePrefab, ((Ray)(ref aimRay2)).origin, Util.QuaternionSafeLookRotation(val2), ((EntityState)self).gameObject, ((EntityState)self).characterBody.damage * 0.05f / 12f, 0f, Util.CheckRoll(((EntityState)self).characterBody.crit, ((EntityState)self).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f);
				}
			}
			orig.Invoke(self);
		}

		public static void FireLunarShards(orig_OnEnter orig, FireLunarShards self)
		{
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			FireLunarShards.spreadBloomValue = 20f;
			FireLunarShards.recoilAmplitude = 2f;
			FireLunarShards.baseDuration = 0.03f;
			Main.ShardCount++;
			if (self is FireLunarShardsHurt)
			{
				if (((EntityState)self).isAuthority && Main.ShardCount == 9)
				{
					float num = 3f;
					float num2 = 360f / num;
					Vector3 val = Vector3.ProjectOnPlane(((EntityState)self).inputBank.aimDirection, Vector3.up);
					Transform val2 = ((BaseState)self).FindModelChild(WeaponSlam.muzzleString);
					Vector3 val3 = val2.position + new Vector3(Random.Range(-50f, 50f), 0f, Random.Range(-50f, 50f));
					int num3 = 0;
					while ((float)num3 < num)
					{
						Vector3 val4 = Quaternion.AngleAxis(num2 * (float)num3, Vector3.up) * val;
						ProjectileManager.instance.FireProjectile(UltChannelState.waveProjectileLeftPrefab, val3, Util.QuaternionSafeLookRotation(val4), ((EntityState)self).gameObject, ((EntityState)self).characterBody.damage * 3.5f, FistSlam.waveProjectileForce, Util.CheckRoll(((EntityState)self).characterBody.crit, ((EntityState)self).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f);
						num3++;
						Main.ShardCount = 0;
					}
				}
			}
			else
			{
				Main.ShardCount = 0;
			}
			orig.Invoke(self);
		}

		public static void Phase2(orig_OnEnter orig, Phase2 self)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			orig.Invoke(self);
			((BrotherEncounterPhaseBaseState)self).PreEncounterBegin();
			((EntityState)self).outer.SetNextState((EntityState)new Phase3());
		}

		public static void FistSlam(orig_OnEnter orig, FistSlam self)
		{
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			FistSlam.waveProjectileDamageCoefficient = 2.3f;
			FistSlam.healthCostFraction = 0f;
			FistSlam.waveProjectileCount = 20;
			FistSlam.baseDuration = 3.5f;
			if (((EntityState)self).isAuthority)
			{
				float num = 8f;
				float num2 = 360f / num;
				Vector3 val = Vector3.ProjectOnPlane(((EntityState)self).inputBank.aimDirection, Vector3.up);
				Transform val2 = ((BaseState)self).FindModelChild(WeaponSlam.muzzleString);
				Vector3 val3 = val2.position + new Vector3(Random.Range(-50f, 50f), 0f, Random.Range(-50f, 50f));
				for (int i = 0; (float)i < num; i++)
				{
					Vector3 val4 = Quaternion.AngleAxis(num2 * (float)i, Vector3.up) * val;
					ProjectileManager.instance.FireProjectile(UltChannelState.waveProjectileLeftPrefab, val3, Util.QuaternionSafeLookRotation(val4), ((EntityState)self).gameObject, ((EntityState)self).characterBody.damage * 3.5f, FistSlam.waveProjectileForce, Util.CheckRoll(((EntityState)self).characterBody.crit, ((EntityState)self).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f);
				}
			}
			orig.Invoke(self);
		}

		public static void SpellChannelEnterState(orig_OnEnter orig, SpellChannelEnterState self)
		{
			SpellChannelEnterState.duration = 3f;
			orig.Invoke(self);
		}

		public static void SpellChannelState(orig_OnEnter orig, SpellChannelState self)
		{
			SpellChannelState.stealInterval = 0.05f;
			SpellChannelState.delayBeforeBeginningSteal = 0f;
			SpellChannelState.maxDuration = 15f;
			orig.Invoke(self);
		}

		public static void SpellChannelExitState(orig_OnEnter orig, SpellChannelExitState self)
		{
			SpellChannelExitState.lendInterval = 0.04f;
			SpellChannelExitState.duration = 2.5f;
			orig.Invoke(self);
		}

		public static void StaggerEnter(orig_OnEnter orig, StaggerEnter self)
		{
			((StaggerBaseState)self).duration = 0f;
			orig.Invoke(self);
		}

		public static void StaggerExit(orig_OnEnter orig, StaggerExit self)
		{
			((StaggerBaseState)self).duration = 0f;
			orig.Invoke(self);
		}

		public static void StaggerLoop(orig_OnEnter orig, StaggerLoop self)
		{
			((StaggerBaseState)self).duration = 0f;
			orig.Invoke(self);
		}

		public static void TrueDeathState(orig_OnEnter orig, TrueDeathState self)
		{
			TrueDeathState.dissolveDuration = 5f;
			orig.Invoke(self);
		}

		public static void FireRandomProjectiles(orig_OnEnter orig, FireRandomProjectiles self)
		{
			FireRandomProjectiles.maximumCharges = 150;
			FireRandomProjectiles.chargeRechargeDuration = 0.03f;
			FireRandomProjectiles.chanceToFirePerSecond = 0.5f;
			FireRandomProjectiles.damageCoefficient = 12f;
			orig.Invoke(self);
		}

		public static void SpeedUpProjectiles(orig_Start orig, ProjectileSimple self)
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			ProjectileController component = ((Component)self).GetComponent<ProjectileController>();
			object obj;
			if (component == null)
			{
				obj = null;
			}
			else
			{
				GameObject owner = component.owner;
				obj = ((owner != null) ? owner.GetComponent<CharacterBody>() : null);
			}
			CharacterBody val = (CharacterBody)obj;
			if ((val?.bodyIndex == (BodyIndex?)Main.mithrixBody || val?.bodyIndex == (BodyIndex?)Main.mithrixPhase4Body) && Object.op_Implicit((Object)(object)self.rigidbody) && !self.rigidbody.useGravity)
			{
				self.desiredForwardSpeed *= Main.ProjectileSpeed.Value;
				if (self.lifetime < 4f)
				{
					self.lifetime = 4f;
				}
			}
			orig.Invoke(self);
		}

		public static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)sender) && (sender.bodyIndex == Main.mithrixBody || sender.bodyIndex == Main.mithrixPhase4Body))
			{
				args.armorAdd += Main.LoopArmor.Value * (float)Run.instance.loopClearCount;
				args.cooldownMultAdd += Main.StageCooldownReduction.Value * (float)Run.instance.stageClearCount;
				if (sender.isBoss || sender.isChampion)
				{
					args.healthMultAdd += Main.BossHp.Value * (float)Run.instance.stageClearCount;
				}
			}
		}

		public static void UltChannelState(orig_OnEnter orig, UltChannelState self)
		{
			UltChannelState.totalWaves = 8;
			UltChannelState.maxDuration = 8f;
			orig.Invoke(self);
		}

		public static void WeaponSlam2(orig_FixedUpdate orig, WeaponSlam self)
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: 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_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)self).isAuthority && self.hasDoneBlastAttack && Object.op_Implicit((Object)(object)self.modelTransform) && !Main.hasFired)
			{
				Ray aimRay = ((BaseState)self).GetAimRay();
				Transform val = ((BaseState)self).FindModelChild(FireLunarShards.muzzleString);
				if (Object.op_Implicit((Object)(object)val))
				{
					((Ray)(ref aimRay)).origin = val.position;
				}
				float num = 7f;
				Main.hasFired = true;
				float num2 = 360f / num;
				Vector3 val2 = Vector3.ProjectOnPlane(((EntityState)self).inputBank.aimDirection, Vector3.up);
				Transform val3 = ((BaseState)self).FindModelChild(WeaponSlam.muzzleString);
				Vector3 position = val3.position;
				for (int i = 0; (float)i < num; i++)
				{
					Vector3 val4 = Quaternion.AngleAxis(num2 * (float)i, Vector3.up) * val2;
					ProjectileManager.instance.FireProjectile(FistSlam.waveProjectilePrefab, position, Util.QuaternionSafeLookRotation(val4), ((EntityState)self).gameObject, ((EntityState)self).characterBody.damage * FistSlam.waveProjectileDamageCoefficient * 0.6f, FistSlam.waveProjectileForce, Util.CheckRoll(((EntityState)self).characterBody.crit, ((EntityState)self).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f);
				}
			}
			orig.Invoke(self);
		}

		public static void Phase3(orig_OnEnter orig, Phase3 self)
		{
			Main.Ramp1.SetActive(false);
			Main.Ramp2.SetActive(false);
			Main.Ramp3.SetActive(false);
			Main.Rocks.SetActive(false);
			orig.Invoke(self);
			if (!NetworkServer.active)
			{
				return;
			}
			foreach (TeamComponent item in new List<TeamComponent>(TeamComponent.GetTeamMembers((TeamIndex)2)))
			{
				if (!Object.op_Implicit((Object)(object)item))
				{
					continue;
				}
				HealthComponent component = ((Component)item).GetComponent<HealthComponent>();
				if (Object.op_Implicit((Object)(object)component))
				{
					switch (((Object)item.body).name)
					{
					case "LunarExploderBody(Clone)":
						component.Suicide((GameObject)null, (GameObject)null, (DamageType)0);
						break;
					case "LunarGolemBody(Clone)":
						component.Suicide((GameObject)null, (GameObject)null, (DamageType)0);
						break;
					case "LunarWispBody(Clone)":
						component.Suicide((GameObject)null, (GameObject)null, (DamageType)0);
						break;
					}
				}
			}
		}
	}
}