Decompiled source of UmbralMithrix v2.2.1

UmbralMithrix.dll

Decompiled a week ago
using System;
using System.Collections;
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 EntityStates;
using EntityStates.BrotherMonster;
using EntityStates.BrotherMonster.Weapon;
using EntityStates.LunarWisp;
using EntityStates.Missions.BrotherEncounter;
using IL.RoR2;
using IL.RoR2.CharacterAI;
using KinematicCharacterController;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.EntityStates;
using On.EntityStates.BrotherMonster;
using On.EntityStates.BrotherMonster.Weapon;
using On.EntityStates.Missions.BrotherEncounter;
using On.RoR2;
using On.RoR2.CharacterAI;
using On.RoR2.UI.LogBook;
using R2API;
using Rewired.ComponentControls.Effects;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.CharacterAI;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using RoR2.UI.LogBook;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("UmbralMithrix")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+1e6ee591f011871867e81b2a9907c9ac0853d135")]
[assembly: AssemblyProduct("UmbralMithrix")]
[assembly: AssemblyTitle("UmbralMithrix")]
[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 UmbralMithrix
{
	public class CloneController : MonoBehaviour
	{
		private List<CharacterBody> playerBodies = new List<CharacterBody>();

		private SpawnCard cloneCard = UmbralMithrix.mithrixGlassCard;

		private float stopwatch;

		private float interval = 8f;

		private void Start()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Invalid comparison between Unknown and I4
			CharacterMaster[] array = Object.FindObjectsOfType<CharacterMaster>();
			foreach (CharacterMaster val in array)
			{
				if ((int)val.teamIndex == 1)
				{
					CharacterBody body = val.GetBody();
					if (Object.op_Implicit((Object)(object)body) && body.isPlayerControlled)
					{
						playerBodies.Add(body);
					}
				}
			}
		}

		private void FixedUpdate()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Expected O, but got Unknown
			//IL_003e: 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_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Expected O, but got Unknown
			stopwatch += Time.deltaTime;
			if (!((double)stopwatch < (double)interval))
			{
				stopwatch %= interval;
				DirectorPlacementRule val = new DirectorPlacementRule();
				val.placementMode = (PlacementMode)3;
				val.minDistance = 3f;
				val.maxDistance = 10f;
				val.position = playerBodies[Random.Range(0, playerBodies.Count)].corePosition;
				Xoroshiro128Plus rng = RoR2Application.rng;
				DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(cloneCard, val, rng)
				{
					summonerBodyObject = ((Component)this).gameObject,
					onSpawnedServer = delegate(SpawnResult spawnResult)
					{
						//IL_0000: Unknown result type (might be due to invalid IL or missing references)
						spawnResult.spawnedInstance.GetComponent<Inventory>().GiveItem(Items.HealthDecay, 6);
					}
				});
			}
		}
	}
	public class DeathZoneController : MonoBehaviour
	{
		private SphereZone zone;

		private float stopwatch;

		private float interval = 1f;

		private float zoneRadius = 100f;

		private void Start()
		{
			zone = ((Component)this).gameObject.GetComponent<SphereZone>();
		}

		private void FixedUpdate()
		{
			stopwatch += Time.deltaTime;
			if (!((double)stopwatch < (double)interval))
			{
				stopwatch %= interval;
				if ((double)zone.Networkradius > (double)zoneRadius)
				{
					SphereZone obj = zone;
					obj.Networkradius -= 10f;
				}
			}
		}
	}
	public class P4Controller : MonoBehaviour
	{
		public bool finishedItemSteal;

		private CharacterBody body;

		private bool isServer;

		public List<CharacterBody> playerBodies = new List<CharacterBody>();

		private float shockwaveStopwatch;

		private float pizzaStopwatch;

		private float missileStopwatch;

		private float shockwaveInterval = 3.75f;

		private float pizzaInterval = 1.5f;

		private float missileInterval = 1.25f;

		private void Start()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Invalid comparison between Unknown and I4
			body = ((Component)this).gameObject.GetComponent<CharacterBody>();
			isServer = ((Component)this).gameObject.GetComponent<NetworkIdentity>().isServer;
			CharacterMaster[] array = Object.FindObjectsOfType<CharacterMaster>();
			foreach (CharacterMaster val in array)
			{
				if ((int)val.teamIndex == 1)
				{
					CharacterBody val2 = val.GetBody();
					if (Object.op_Implicit((Object)(object)val2) && val2.isPlayerControlled)
					{
						playerBodies.Add(val2);
					}
				}
			}
		}

		private void FixedUpdate()
		{
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_0398: Unknown result type (might be due to invalid IL or missing references)
			//IL_039d: 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_03a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03af: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_029d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e1: 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_03e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02db: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: 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)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			if (finishedItemSteal && Object.op_Implicit((Object)(object)body.healthComponent) && body.healthComponent.alive && isServer)
			{
				missileStopwatch += Time.deltaTime;
				pizzaStopwatch += Time.deltaTime;
				shockwaveStopwatch += Time.deltaTime;
				if (missileStopwatch >= missileInterval)
				{
					missileStopwatch %= 1f;
					int num = 8;
					int num2 = 8;
					Vector3 val = (Object.op_Implicit((Object)(object)body.inputBank) ? body.inputBank.aimDirection : body.transform.forward);
					float num3 = 180f / (float)num;
					float num4 = (float)(3.0 + (double)(int)body.radius * 1.0);
					float damage = body.damage * 0.5f;
					Quaternion rotation = Util.QuaternionSafeLookRotation(val);
					for (int i = 0; i < num; i++)
					{
						Vector3 position = body.aimOrigin + Quaternion.AngleAxis((float)((double)(num2 - 1) * (double)num3 - (double)num3 * (double)(num - 1) / 2.0), val) * Vector3.up * num4;
						ProjectileManager.instance.FireProjectile(new FireProjectileInfo
						{
							projectilePrefab = UmbralMithrix.lunarMissile,
							position = position,
							rotation = rotation,
							owner = ((Component)this).gameObject,
							damage = damage,
							force = 100f
						});
						num2--;
					}
				}
			}
			if (pizzaStopwatch >= pizzaInterval)
			{
				pizzaStopwatch %= 1f;
				Vector3 val2 = Vector3.ProjectOnPlane(body.inputBank.aimDirection, Vector3.up);
				float num5 = 40f;
				Vector3 val3 = default(Vector3);
				((Vector3)(ref val3))..ctor((float)Random.Range(-45, -25), 0f, (float)Random.Range(-45, -25));
				if ((double)Random.value <= 0.5)
				{
					((Vector3)(ref val3))..ctor((float)Random.Range(25, 45), 0f, (float)Random.Range(25, 45));
				}
				GameObject val4 = UmbralMithrix.leftP4Line;
				if ((double)Random.value <= 0.5)
				{
					val4 = UmbralMithrix.rightP4Line;
				}
				Vector3 footPosition = playerBodies[Random.Range(0, playerBodies.Count)].footPosition;
				footPosition.y = 491f;
				Vector3 val5 = footPosition;
				val5 += val3;
				for (int j = 0; j < 9; j++)
				{
					Vector3 val6 = Quaternion.AngleAxis(num5 * (float)j, Vector3.up) * val2;
					ProjectileManager.instance.FireProjectile(val4, val5, Util.QuaternionSafeLookRotation(val6), ((Component)this).gameObject, body.damage * (UltChannelState.waveProjectileDamageCoefficient * 0.5f), UltChannelState.waveProjectileForce / 8f, Util.CheckRoll(body.crit, body.master), (DamageColorIndex)0, (GameObject)null, -1f);
				}
			}
			if (shockwaveStopwatch >= shockwaveInterval)
			{
				shockwaveStopwatch %= 1f;
				Util.PlaySound(ExitSkyLeap.soundString, ((Component)this).gameObject);
				float num6 = 360f / (float)ExitSkyLeap.waveProjectileCount;
				Vector3 val7 = Vector3.ProjectOnPlane(body.inputBank.aimDirection, Vector3.up);
				Vector3 footPosition2 = body.footPosition;
				for (int k = 0; k < ExitSkyLeap.waveProjectileCount; k++)
				{
					Vector3 val8 = Quaternion.AngleAxis(num6 * (float)k, Vector3.up) * val7;
					ProjectileManager.instance.FireProjectile(ExitSkyLeap.waveProjectilePrefab, footPosition2, Util.QuaternionSafeLookRotation(val8), ((Component)this).gameObject, body.damage * (ExitSkyLeap.waveProjectileDamageCoefficient * 0.75f), ExitSkyLeap.waveProjectileForce / 4f, Util.CheckRoll(body.crit, body.master), (DamageColorIndex)0, (GameObject)null, -1f);
				}
			}
		}
	}
	public class SelfDestructController : MonoBehaviour
	{
		private void Start()
		{
			((MonoBehaviour)this).StartCoroutine(SelfDestruct());
		}

		private IEnumerator SelfDestruct()
		{
			yield return (object)new WaitForSeconds(ModConfig.CrushingLeap.Value);
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
	public class GlassSpawnState : BaseState
	{
		public static float duration;

		public static string spawnSoundString;

		public static float spawnEffectsDelay;

		private bool spawnEffectsTriggered;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			Util.PlaySound(SpawnState.spawnSoundString, ((EntityState)this).gameObject);
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if ((double)((EntityState)this).fixedAge >= (double)SpawnState.spawnEffectsDelay && !spawnEffectsTriggered)
			{
				spawnEffectsTriggered = true;
				EffectManager.SimpleMuzzleFlash(SpawnState.spawnEffectPrefab, ((EntityState)this).gameObject, "MuzzleCenter", false);
			}
			if (!((double)((EntityState)this).fixedAge < (double)SpawnState.duration) && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)6;
		}
	}
	public class MiscHooks
	{
		public MiscHooks()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Expected O, but got Unknown
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Expected O, but got Unknown
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Expected O, but got Unknown
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Expected O, but got Unknown
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Expected O, but got Unknown
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Expected O, but got Unknown
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Expected O, but got Unknown
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Expected O, but got Unknown
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Expected O, but got Unknown
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Expected O, but got Unknown
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Expected O, but got Unknown
			BaseAI.FindEnemyHurtBox += new Manipulator(TargetOnlyPlayers);
			CharacterBody.UpdateAllTemporaryVisualEffects += new Manipulator(AddUmbralParticles);
			CharacterModel.UpdateOverlays += new Manipulator(AddUmbralOverlay);
			BaseAI.FindEnemyHurtBox += new hook_FindEnemyHurtBox(ChangeP3CloneTargeting);
			CharacterMaster.OnBodyDeath += new hook_OnBodyDeath(CharacterMaster_OnBodyDeath);
			PurchaseInteraction.OnInteractionBegin += new hook_OnInteractionBegin(PurchaseInteraction_OnInteractionBegin);
			CombatDirector.OnEnable += new hook_OnEnable(CombatDirector_OnEnable);
			BasicPickupDropTable.GenerateWeightedSelection += new hook_GenerateWeightedSelection(BasicPickupDropTable_GenerateWeightedSelection);
			PickupTransmutationManager.RebuildPickupGroups += new hook_RebuildPickupGroups(PickupTransmutationManager_RebuildPickupGroups);
			HealthComponent.SendDamageDealt += new hook_SendDamageDealt(HealthComponent_SendDamageDealt);
			Stage.Start += new hook_Start(Stage_Start);
			Run.Start += new hook_Start(Run_Start);
			CharacterMaster.OnBodyStart += new hook_OnBodyStart(CharacterMaster_OnBodyStart);
			FrozenState.OnEnter += new hook_OnEnter(FrozenState_OnEnter);
			CharacterBody.AddTimedBuff_BuffDef_float += new hook_AddTimedBuff_BuffDef_float(AddTimedBuff_BuffDef_float);
			ItemStealController.BrotherItemFilter += new hook_BrotherItemFilter(ItemStealController_BrotherItemFilter);
		}

		private void TargetOnlyPlayers(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0039: 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.MatchCallOrCallvirt<BullseyeSearch>(x, "GetResults")
			}))
			{
				return;
			}
			val.Emit(OpCodes.Ldarg_0);
			val.EmitDelegate<Func<IEnumerable<HurtBox>, BaseAI, IEnumerable<HurtBox>>>((Func<IEnumerable<HurtBox>, BaseAI, IEnumerable<HurtBox>>)delegate(IEnumerable<HurtBox> results, BaseAI instance)
			{
				if (Object.op_Implicit((Object)(object)instance) && ((Object)instance.body).name == "BrotherBody(Clone)" && Object.op_Implicit((Object)(object)PhaseCounter.instance) && PhaseCounter.instance.phase == 3)
				{
					IEnumerable<HurtBox> enumerable = results.Where(delegate(HurtBox hurtBox)
					{
						GameObject val2 = HurtBox.FindEntityObject(hurtBox);
						CharacterBody val3 = default(CharacterBody);
						return Object.op_Implicit((Object)(object)val2) && val2.TryGetComponent<CharacterBody>(ref val3) && val3.isPlayerControlled;
					});
					if (!enumerable.Any())
					{
						return results;
					}
					return enumerable;
				}
				return results;
			});
		}

		private HurtBox ChangeP3CloneTargeting(orig_FindEnemyHurtBox orig, BaseAI self, float maxDistance, bool full360Vision, bool filterByLoS)
		{
			if (Object.op_Implicit((Object)(object)self) && ((Object)self.body).name == "BrotherBody(Clone)" && Object.op_Implicit((Object)(object)PhaseCounter.instance) && PhaseCounter.instance.phase == 3)
			{
				maxDistance = float.PositiveInfinity;
				filterByLoS = false;
				full360Vision = true;
			}
			return orig.Invoke(self, maxDistance, full360Vision, filterByLoS);
		}

		private void AddUmbralParticles(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			val.GotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Items), "InvadingDoppelganger")
			});
			val.Index += 2;
			val.Emit(OpCodes.Ldarg_0);
			val.EmitDelegate<Func<int, CharacterBody, int>>((Func<int, CharacterBody, int>)delegate(int vengeanceCount, CharacterBody self)
			{
				if (((Object)self).name.Contains("Brother") && Object.op_Implicit((Object)(object)self.inventory) && self.inventory.GetItemCount(UmbralMithrix.UmbralItem) > 0)
				{
					vengeanceCount++;
				}
				return vengeanceCount;
			});
		}

		private void AddUmbralOverlay(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			ILCursor val = new ILCursor(il);
			val.GotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Items), "InvadingDoppelganger")
			});
			val.Index += 2;
			val.Emit(OpCodes.Ldarg_0);
			val.EmitDelegate<Func<int, CharacterModel, int>>((Func<int, CharacterModel, int>)delegate(int vengeanceCount, CharacterModel self)
			{
				if (((Object)self.body).name.Contains("Brother") && Object.op_Implicit((Object)(object)self.body.inventory) && self.body.inventory.GetItemCount(UmbralMithrix.UmbralItem) > 0)
				{
					vengeanceCount++;
				}
				return vengeanceCount;
			});
		}

		private void HealthComponent_SendDamageDealt(orig_SendDamageDealt orig, DamageReport damageReport)
		{
			CharacterBody victimBody = damageReport.victimBody;
			HealthComponent healthComponent = damageReport.victimBody.healthComponent;
			if (Object.op_Implicit((Object)(object)victimBody) && Object.op_Implicit((Object)(object)healthComponent) && ((Object)victimBody).name == "BrotherBody(Clone)" && PhaseCounter.instance.phase == 2 && !UmbralMithrix.p2ThresholdReached && healthComponent.health - damageReport.damageDealt <= healthComponent.fullHealth * 0.75f)
			{
				UmbralMithrix.p2ThresholdReached = true;
				P2ThresholdEvent(((Component)victimBody).gameObject);
				healthComponent.health = healthComponent.fullHealth * 0.75f;
				damageReport.damageInfo.rejected = true;
				GameObject.Find("BrotherBody(Clone)").GetComponent<CharacterBody>().AddBuff(Buffs.Immune);
			}
			if (Object.op_Implicit((Object)(object)victimBody) && Object.op_Implicit((Object)(object)healthComponent) && ((Object)victimBody).name == "BrotherHurtBodyP3(Clone)" && PhaseCounter.instance.phase == 3 && !UmbralMithrix.p3ThresholdReached && healthComponent.health - damageReport.damageDealt <= healthComponent.fullHealth * 0.75f)
			{
				UmbralMithrix.p3ThresholdReached = true;
				GameObject.Find("BrotherBody(Clone)").GetComponent<HealthComponent>().health = 1f;
				P3ThresholdEvent(((Component)victimBody).gameObject);
				healthComponent.health = healthComponent.fullHealth * 0.75f;
				damageReport.damageInfo.rejected = true;
				GameObject.Find("BrotherHurtBodyP3(Clone)").GetComponent<CharacterBody>().AddBuff(Buffs.Immune);
			}
			orig.Invoke(damageReport);
		}

		private void CharacterMaster_OnBodyStart(orig_OnBodyStart orig, CharacterMaster self, CharacterBody body)
		{
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Expected O, but got Unknown
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Expected O, but got Unknown
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Expected O, but got Unknown
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Expected O, but got Unknown
			orig.Invoke(self, body);
			if (!Object.op_Implicit((Object)(object)PhaseCounter.instance))
			{
				return;
			}
			if (((Object)body).name == "BrotherHurtBodyP3(Clone)")
			{
				self.inventory.GiveItemString(((Object)UmbralMithrix.UmbralItem).name);
				self.inventory.GiveItemString(((Object)Items.AdaptiveArmor).name);
			}
			if (((Object)body).name == "BrotherBody(Clone)" || ((Object)body).name == "BrotherGlassBody(Clone)")
			{
				self.inventory.GiveItemString(((Object)UmbralMithrix.UmbralItem).name);
			}
			if (((Object)body).name == "BrotherBody(Clone)" && PhaseCounter.instance.phase == 1)
			{
				((Component)body).gameObject.AddComponent<CloneController>();
				ChildLocator component = ((Component)SceneInfo.instance).GetComponent<ChildLocator>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					return;
				}
				Transform val = component.FindChild("CenterOfArena");
				if (Object.op_Implicit((Object)(object)val))
				{
					Object.Destroy((Object)(object)((Component)val).gameObject);
				}
			}
			if (((Object)body).name == "BrotherGlassBody(Clone)" && PhaseCounter.instance.phase == 3)
			{
				body.levelMoveSpeed = 0f;
				body.baseMoveSpeed = 0f;
				body.baseMaxHealth = 50f;
				body.levelMaxHealth = 15f;
				body.teamComponent.teamIndex = (TeamIndex)2;
				SkillLocator skillLocator = body.skillLocator;
				skillLocator.primary = new GenericSkill();
				skillLocator.secondary = new GenericSkill();
				skillLocator.utility = new GenericSkill();
				skillLocator.special = new GenericSkill();
			}
			if (((Object)body).name == "BrotherHurtBody(Clone)" && PhaseCounter.instance.phase == 4)
			{
				body.levelMoveSpeed = 0f;
				body.baseMoveSpeed = 0f;
				body.inventory.GiveItem(UmbralMithrix.UmbralItem, 1);
				body.AddBuff(Buffs.Immune);
				body.inventory.GiveItem(Items.HealthDecay, 40);
			}
		}

		private void CharacterMaster_OnBodyDeath(orig_OnBodyDeath orig, CharacterMaster self, CharacterBody body)
		{
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Invalid comparison between Unknown and I4
			orig.Invoke(self, body);
			if (!NetworkServer.active || !body.isPlayerControlled || !UmbralMithrix.practiceModeEnabled || self.IsExtraLifePendingServer() || !Object.op_Implicit((Object)(object)PhaseCounter.instance))
			{
				return;
			}
			self.RespawnExtraLife();
			if (PhaseCounter.instance.phase != 4)
			{
				return;
			}
			List<CharacterBody> list = new List<CharacterBody>();
			CharacterMaster[] array = Object.FindObjectsOfType<CharacterMaster>();
			foreach (CharacterMaster val in array)
			{
				if ((int)val.teamIndex == 1)
				{
					CharacterBody body2 = val.GetBody();
					if (Object.op_Implicit((Object)(object)body2) && body2.isPlayerControlled)
					{
						list.Add(body2);
					}
				}
			}
			GameObject.Find("BrotherHurtBody(Clone)").GetComponent<P4Controller>().playerBodies = list;
		}

		private void CombatDirector_OnEnable(orig_OnEnable orig, CombatDirector self)
		{
			if (Object.op_Implicit((Object)(object)PhaseCounter.instance) && (PhaseCounter.instance.phase == 2 || PhaseCounter.instance.phase == 3))
			{
				((Component)self).gameObject.SetActive(false);
			}
			else
			{
				orig.Invoke(self);
			}
		}

		private void BasicPickupDropTable_GenerateWeightedSelection(orig_GenerateWeightedSelection orig, BasicPickupDropTable self, Run run)
		{
			//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_0024: 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_0067: 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_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: 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)
			List<PickupIndex> list = new List<PickupIndex>();
			List<PickupIndex> list2 = new List<PickupIndex>();
			foreach (PickupIndex availableLunarCombinedDrop in run.availableLunarCombinedDropList)
			{
				PickupIndex current = availableLunarCombinedDrop;
				ItemDef itemDef = ItemCatalog.GetItemDef(((PickupIndex)(ref current)).itemIndex);
				EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(((PickupIndex)(ref current)).equipmentIndex);
				if (Object.op_Implicit((Object)(object)itemDef) && !((Object)itemDef).name.Contains("Umbral"))
				{
					list2.Add(current);
				}
				if (Object.op_Implicit((Object)(object)equipmentDef))
				{
					list2.Add(current);
				}
			}
			foreach (PickupIndex availableLunarItemDrop in run.availableLunarItemDropList)
			{
				PickupIndex current2 = availableLunarItemDrop;
				ItemDef itemDef2 = ItemCatalog.GetItemDef(((PickupIndex)(ref current2)).itemIndex);
				if (Object.op_Implicit((Object)(object)itemDef2) && !((Object)itemDef2).name.Contains("Umbral"))
				{
					list.Add(current2);
				}
			}
			run.availableLunarCombinedDropList = list2;
			run.availableLunarItemDropList = list;
			orig.Invoke(self, run);
		}

		private void PickupTransmutationManager_RebuildPickupGroups(orig_RebuildPickupGroups orig)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: 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_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke();
			List<PickupIndex> list = new List<PickupIndex>();
			PickupIndex[] itemTierLunarGroup = PickupTransmutationManager.itemTierLunarGroup;
			for (int i = 0; i < itemTierLunarGroup.Length; i++)
			{
				PickupIndex item = itemTierLunarGroup[i];
				ItemDef itemDef = ItemCatalog.GetItemDef(((PickupIndex)(ref item)).itemIndex);
				EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(((PickupIndex)(ref item)).equipmentIndex);
				if (Object.op_Implicit((Object)(object)itemDef) && !((Object)itemDef).name.Contains("Umbral"))
				{
					list.Add(item);
				}
				if (Object.op_Implicit((Object)(object)equipmentDef))
				{
					list.Add(item);
				}
			}
			PickupTransmutationManager.itemTierLunarGroup = list.ToArray();
		}

		private void P2ThresholdEvent(GameObject summoner)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: 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_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Expected O, but got Unknown
			UmbralMithrix.timeCrystals.Clear();
			DirectorPlacementRule val = new DirectorPlacementRule();
			val.placementMode = (PlacementMode)3;
			val.minDistance = 3f;
			val.maxDistance = 10f;
			val.position = new Vector3(-88.5f, 491.5f, -0.3f);
			Xoroshiro128Plus rng = RoR2Application.rng;
			DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(UmbralMithrix.mithrixGlassCard, val, rng)
			{
				summonerBodyObject = summoner,
				onSpawnedServer = delegate(SpawnResult spawnResult)
				{
					//IL_0000: Unknown result type (might be due to invalid IL or missing references)
					TetherVfxOrigin obj = ((Component)spawnResult.spawnedInstance.GetComponent<CharacterMaster>().GetBody()).gameObject.AddComponent<TetherVfxOrigin>();
					obj.tetherPrefab = UmbralMithrix.tether;
					obj.AddTether(summoner.transform);
				}
			});
			UmbralMithrix.timeCrystals.Add(summoner);
		}

		private void P3ThresholdEvent(GameObject summoner)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Expected O, but got Unknown
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Expected O, but got Unknown
			UmbralMithrix.timeCrystals.Clear();
			int num = 4;
			for (int i = 0; i < num; i++)
			{
				DirectorPlacementRule val = new DirectorPlacementRule();
				val.placementMode = (PlacementMode)3;
				val.minDistance = 3f;
				val.maxDistance = 10f;
				val.position = UmbralMithrix.p23PizzaPoints[i];
				Xoroshiro128Plus rng = RoR2Application.rng;
				DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(UmbralMithrix.mithrixGlassCard, val, rng)
				{
					summonerBodyObject = summoner,
					onSpawnedServer = delegate(SpawnResult spawnResult)
					{
						//IL_0000: Unknown result type (might be due to invalid IL or missing references)
						TetherVfxOrigin obj = spawnResult.spawnedInstance.gameObject.AddComponent<TetherVfxOrigin>();
						obj.tetherPrefab = UmbralMithrix.tether;
						obj.AddTether(summoner.transform);
					}
				});
				UmbralMithrix.timeCrystals.Add(summoner);
			}
		}

		private bool ItemStealController_BrotherItemFilter(orig_BrotherItemFilter orig, ItemIndex itemIndex)
		{
			return false;
		}

		private void Run_Start(orig_Start orig, Run self)
		{
			UmbralMithrix.practiceModeEnabled = false;
			orig.Invoke(self);
		}

		private void Stage_Start(orig_Start orig, Stage self)
		{
			//IL_003d: 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)
			orig.Invoke(self);
			if (self.sceneDef.cachedName == "moon2")
			{
				UmbralMithrix.ArenaSetup();
				UmbralMithrix.SpawnPracticeModeShrine();
				UmbralMithrix.mithrix.GetComponent<EntityStateMachine>().initialStateType = new SerializableEntityStateType(typeof(ThroneSpawnState));
			}
		}

		private void PurchaseInteraction_OnInteractionBegin(orig_OnInteractionBegin orig, PurchaseInteraction self, Interactor activator)
		{
			if (((Object)self).name == "PracticeModeShrine")
			{
				UmbralMithrix.practiceModeEnabled = true;
			}
			orig.Invoke(self, activator);
		}

		private void FrozenState_OnEnter(orig_OnEnter orig, FrozenState self)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: 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_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			if (((Object)((EntityState)self).characterBody).name == "BrotherBody(Clone)" && Random.value > 0.5f)
			{
				Ray aimRay = ((BaseState)self).GetAimRay();
				for (int i = 0; i < 6; i++)
				{
					Util.PlaySound(FireLunarShards.fireSound, ((EntityState)self).gameObject);
					ProjectileManager.instance.FireProjectile(FireLunarShards.projectilePrefab, ((Ray)(ref aimRay)).origin, Quaternion.LookRotation(((Ray)(ref aimRay)).direction), ((EntityState)self).gameObject, (float)((double)((EntityState)self).characterBody.damage * 0.100000001490116 / 12.0), 0f, Util.CheckRoll(((EntityState)self).characterBody.crit, ((EntityState)self).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f);
				}
			}
			orig.Invoke(self);
		}

		private void AddTimedBuff_BuffDef_float(orig_AddTimedBuff_BuffDef_float orig, CharacterBody self, BuffDef buffDef, float duration)
		{
			//IL_006e: 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_007e: 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_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: 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)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			if (((Object)self).name == "BrotherBody(Clone)" && (Object)(object)buffDef == (Object)(object)Buffs.Nullified && Random.value < 0.25f)
			{
				duration /= 2f;
				Ray val = (Object.op_Implicit((Object)(object)self.inputBank) ? new Ray(self.inputBank.aimOrigin, self.inputBank.aimDirection) : new Ray(self.transform.position, self.transform.forward));
				for (int i = 0; i < 6; i++)
				{
					Util.PlaySound(FireLunarShards.fireSound, ((Component)self).gameObject);
					ProjectileManager.instance.FireProjectile(FireLunarShards.projectilePrefab, ((Ray)(ref val)).origin, Quaternion.LookRotation(((Ray)(ref val)).direction), ((Component)self).gameObject, (float)((double)self.damage * 0.100000001490116 / 12.0), 0f, Util.CheckRoll(self.crit, self.master), (DamageColorIndex)0, (GameObject)null, -1f);
				}
			}
			orig.Invoke(self, buffDef, duration);
		}

		private void SetPosition(Vector3 newPosition, CharacterBody body)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)body.characterMotor))
			{
				((BaseCharacterController)body.characterMotor).Motor.SetPositionAndRotation(newPosition, Quaternion.identity, true);
			}
		}

		private void KillAllDrones()
		{
			//IL_0003: 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_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Expected O, but got Unknown
			int num = 0;
			TeamIndex val = (TeamIndex)1;
			CharacterMaster[] array = Object.FindObjectsOfType<CharacterMaster>();
			foreach (CharacterMaster val2 in array)
			{
				if (val2.teamIndex == val)
				{
					CharacterBody body = val2.GetBody();
					if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.healthComponent) && ((Object)body).name.Contains("Drone"))
					{
						body.healthComponent.Suicide((GameObject)null, (GameObject)null, (DamageType)0);
						num++;
					}
				}
			}
			if (num > 0)
			{
				Debug.Log((object)$"Killed {num} drones.");
				Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage
				{
					baseToken = "<color=#c6d5ff><size=120%>Mithrix: Enough of your toys.</color></size>"
				});
			}
		}
	}
	public class MissionHooks
	{
		public MissionHooks()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Expected O, but got Unknown
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			BrotherEncounterPhaseBaseState.OnEnter += new hook_OnEnter(BrotherEncounterPhaseBaseStateOnEnter);
			Phase1.OnEnter += new hook_OnEnter(Phase1OnEnter);
			Phase2.OnEnter += new hook_OnEnter(Phase2OnEnter);
			Phase3.OnEnter += new hook_OnEnter(Phase3OnEnter);
			Phase4.OnEnter += new hook_OnEnter(Phase4OnEnter);
			BossDeath.OnEnter += new hook_OnEnter(BossDeathOnEnter);
		}

		private void Phase1OnEnter(orig_OnEnter orig, Phase1 self)
		{
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			UmbralMithrix.spawnedClone = false;
			UmbralMithrix.p2ThresholdReached = false;
			UmbralMithrix.p3ThresholdReached = false;
			UmbralMithrix.finishedItemSteal = false;
			UmbralMithrix.AdjustBaseSkills();
			UmbralMithrix.AdjustBaseStats();
			GameObject val = GameObject.Find("EscapeSequenceController");
			if (Object.op_Implicit((Object)(object)val))
			{
				GameObject obj = Object.Instantiate<GameObject>(((Component)val.transform.GetChild(0).GetChild(8)).gameObject, new Vector3(-88.5f, 491.5f, -0.3f), Quaternion.identity);
				obj.transform.eulerAngles = new Vector3(270f, 0f, 0f);
				obj.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f);
				obj.AddComponent<NetworkIdentity>();
				NetworkServer.Spawn(obj);
			}
			orig.Invoke(self);
		}

		private void Phase2OnEnter(orig_OnEnter orig, Phase2 self)
		{
			((BrotherEncounterBaseState)self).KillAllMonsters();
			UmbralMithrix.AdjustPhase2Stats();
			orig.Invoke(self);
		}

		private void Phase3OnEnter(orig_OnEnter orig, Phase3 self)
		{
			((BrotherEncounterBaseState)self).KillAllMonsters();
			UmbralMithrix.AdjustPhase3Stats();
			orig.Invoke(self);
		}

		private void Phase4OnEnter(orig_OnEnter orig, Phase4 self)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Expected O, but got Unknown
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Expected O, but got Unknown
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Expected O, but got Unknown
			UmbralMithrix.AdjustPhase4Stats();
			GameObject obj = Object.Instantiate<GameObject>(UmbralMithrix.voidling, new Vector3(-88.5f, 520f, -0.3f), Quaternion.identity);
			obj.AddComponent<DeathZoneController>();
			obj.GetComponent<TeamComponent>().teamIndex = (TeamIndex)2;
			SkillLocator skillLocator = obj.GetComponent<CharacterBody>().skillLocator;
			skillLocator.primary = new GenericSkill();
			skillLocator.secondary = new GenericSkill();
			skillLocator.utility = new GenericSkill();
			skillLocator.special = new GenericSkill();
			NetworkServer.Spawn(obj);
			orig.Invoke(self);
		}

		private void BossDeathOnEnter(orig_OnEnter orig, BossDeath self)
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Invalid comparison between Unknown and I4
			orig.Invoke(self);
			GameObject.Find("InactiveVoidling(Clone)").GetComponent<HealthComponent>().Suicide((GameObject)null, (GameObject)null, (DamageType)0);
			TeamComponent[] array = Object.FindObjectsOfType<TeamComponent>();
			for (int i = 0; i < array.Length; i++)
			{
				if ((int)array[i].teamIndex == 1)
				{
					((Component)array[i]).GetComponent<CharacterBody>().RemoveBuff(Buffs.TeamWarCry);
				}
			}
		}

		private void BrotherEncounterPhaseBaseStateOnEnter(orig_OnEnter orig, BrotherEncounterPhaseBaseState self)
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: 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_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: 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_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: 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_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0240: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (!NetworkServer.active || (Object)(object)self.phaseScriptedCombatEncounter == (Object)null || !Object.op_Implicit((Object)(object)PhaseCounter.instance))
			{
				return;
			}
			((BrotherEncounterBaseState)self).childLocator = ((EntityState)self).GetComponent<ChildLocator>();
			Transform val = ((BrotherEncounterBaseState)self).childLocator.FindChild("ArenaWalls");
			Material material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/InvadingDoppelganger/matDoppelganger.mat").WaitForCompletion();
			if (Object.op_Implicit((Object)(object)val))
			{
				((Component)val).gameObject.SetActive(((BrotherEncounterBaseState)self).shouldEnableArenaWalls);
				if (ModConfig.purpleArena.Value)
				{
					Renderer[] componentsInChildren = ((Component)val).GetComponentsInChildren<Renderer>();
					for (int i = 0; i < componentsInChildren.Length; i++)
					{
						componentsInChildren[i].material = material;
					}
				}
			}
			self.phaseBossGroup.bestObservedName = "Umbral Mithrix";
			self.phaseBossGroup.bestObservedSubtitle = "<sprite name=\"CloudLeft\"> The Collective <sprite name=\"CloudRight\">";
			if (PhaseCounter.instance.phase == 2)
			{
				GameObject val2 = new GameObject();
				val2.transform.position = new Vector3(-88.5f, 491.5f, -0.3f);
				val2.transform.rotation = Quaternion.identity;
				Transform transform = val2.transform;
				SpawnInfo val3 = default(SpawnInfo);
				val3.explicitSpawnPosition = transform;
				val3.spawnCard = UmbralMithrix.mithrixCard;
				SpawnInfo val4 = val3;
				self.phaseScriptedCombatEncounter.spawns = (SpawnInfo[])(object)new SpawnInfo[1] { val4 };
			}
			if (PhaseCounter.instance.phase == 3)
			{
				GameObject val5 = new GameObject();
				val5.transform.position = new Vector3(-88.5f, 491.5f, -0.3f);
				val5.transform.rotation = Quaternion.identity;
				Transform transform2 = val5.transform;
				SpawnInfo val3 = default(SpawnInfo);
				val3.explicitSpawnPosition = transform2;
				val3.spawnCard = UmbralMithrix.mithrixHurtP3Card;
				SpawnInfo val6 = val3;
				self.phaseScriptedCombatEncounter.spawns = (SpawnInfo[])(object)new SpawnInfo[1] { val6 };
			}
			if (PhaseCounter.instance.phase == 4)
			{
				GameObject val7 = new GameObject();
				val7.transform.position = new Vector3(-88.5f, 491.5f, -0.3f);
				val7.transform.rotation = Quaternion.identity;
				Transform transform3 = val7.transform;
				SpawnInfo val3 = default(SpawnInfo);
				val3.explicitSpawnPosition = transform3;
				val3.spawnCard = UmbralMithrix.mithrixHurtCard;
				SpawnInfo val8 = val3;
				self.phaseScriptedCombatEncounter.spawns = (SpawnInfo[])(object)new SpawnInfo[1] { val8 };
			}
		}
	}
	public class MithrixMiscHooks
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_OnEnter <0>__SpellChannelState_OnEnter;
		}

		public MithrixMiscHooks()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Expected O, but got Unknown
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Expected O, but got Unknown
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Expected O, but got Unknown
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Expected O, but got Unknown
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Expected O, but got Unknown
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Expected O, but got Unknown
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Expected O, but got Unknown
			//IL_00af: 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_00ba: Expected O, but got Unknown
			EnterSkyLeap.OnEnter += new hook_OnEnter(EnterSkyLeap_OnEnter);
			HoldSkyLeap.OnEnter += new hook_OnEnter(HoldSkyLeap_OnEnter);
			ExitSkyLeap.OnEnter += new hook_OnEnter(ExitSkyLeap_OnEnter);
			SprintBash.OnEnter += new hook_OnEnter(SprintBash_OnEnter);
			SprintBash.OnExit += new hook_OnExit(SprintBash_OnExit);
			FistSlam.OnEnter += new hook_OnEnter(FistSlam_OnEnter);
			UltChannelState.FireWave += new hook_FireWave(UltChannelState_FireWave);
			SkyLeapDeathState.OnEnter += new hook_OnEnter(SkyLeapDeathState_OnEnter);
			SpellChannelEnterState.OnEnter += new hook_OnEnter(SpellChannelEnterState_OnEnter);
			object obj = <>O.<0>__SpellChannelState_OnEnter;
			if (obj == null)
			{
				hook_OnEnter val = SpellChannelState_OnEnter;
				<>O.<0>__SpellChannelState_OnEnter = val;
				obj = (object)val;
			}
			SpellChannelState.OnEnter += (hook_OnEnter)obj;
			SpellChannelExitState.OnEnter += new hook_OnEnter(SpellChannelExitState_OnEnter);
			StaggerEnter.OnEnter += new hook_OnEnter(StaggerEnter_OnEnter);
			TrueDeathState.OnEnter += new hook_OnEnter(TrueDeathState_OnEnter);
		}

		private void EnterSkyLeap_OnEnter(orig_OnEnter orig, EnterSkyLeap self)
		{
			EnterSkyLeap.baseDuration = 0.25f;
			Util.PlaySound("Play_voidRaid_snipe_shoot_final", ((Component)((EntityState)self).characterBody).gameObject);
			orig.Invoke(self);
		}

		private void HoldSkyLeap_OnEnter(orig_OnEnter orig, HoldSkyLeap self)
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Invalid comparison between Unknown and I4
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: 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_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: 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_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: 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)
			HoldSkyLeap.duration = ModConfig.CrushingLeap.Value;
			if (((EntityState)self).isAuthority)
			{
				List<CharacterBody> list = new List<CharacterBody>();
				CharacterMaster[] array = Object.FindObjectsOfType<CharacterMaster>();
				foreach (CharacterMaster val in array)
				{
					if ((int)val.teamIndex == 1)
					{
						CharacterBody body = val.GetBody();
						if (Object.op_Implicit((Object)(object)body) && body.isPlayerControlled)
						{
							list.Add(body);
						}
					}
				}
				if (list.Count > 0)
				{
					Vector3 footPosition = list[Random.Range(0, list.Count)].footPosition;
					RaycastHit val2 = default(RaycastHit);
					if (Physics.Raycast(new Ray(footPosition, Vector3.down), ref val2, 200f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1))
					{
						((BaseCharacterController)((EntityState)self).characterMotor).Motor.SetPositionAndRotation(((RaycastHit)(ref val2)).point + new Vector3(0f, 10f, 0f), Quaternion.identity, true);
					}
					else
					{
						((BaseCharacterController)((EntityState)self).characterMotor).Motor.SetPositionAndRotation(footPosition, Quaternion.identity, true);
					}
				}
				GameObject obj = Object.Instantiate<GameObject>(UmbralMithrix.leapIndicatorPrefab, ((EntityState)self).characterBody.footPosition, Quaternion.identity);
				float num = ((EntityState)self).characterBody.radius / 2f;
				obj.transform.localScale = new Vector3(num, num, num);
				obj.AddComponent<SelfDestructController>();
				UmbralMithrix.leapIndicator = obj;
				NetworkServer.Spawn(obj);
			}
			orig.Invoke(self);
		}

		private void ExitSkyLeap_OnEnter(orig_OnEnter orig, ExitSkyLeap self)
		{
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)PhaseCounter.instance) && PhaseCounter.instance.phase == 2)
			{
				GenericSkill val = (Object.op_Implicit((Object)(object)((EntityState)self).skillLocator) ? ((EntityState)self).skillLocator.special : null);
				if (Object.op_Implicit((Object)(object)val))
				{
					UltChannelState.replacementSkillDef.activationState = new SerializableEntityStateType(typeof(UltEnterState));
					val.SetSkillOverride((object)((EntityState)self).outer, UltChannelState.replacementSkillDef, (SkillOverridePriority)4);
				}
			}
		}

		private void FistSlam_OnEnter(orig_OnEnter orig, FistSlam self)
		{
			FistSlam.healthCostFraction = 0f;
			orig.Invoke(self);
		}

		private void UltChannelState_FireWave(orig_FireWave orig, UltChannelState self)
		{
			//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_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_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: 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_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_0240: Unknown result type (might be due to invalid IL or missing references)
			//IL_0245: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: 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_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_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0264: Unknown result type (might be due to invalid IL or missing references)
			//IL_0269: Unknown result type (might be due to invalid IL or missing references)
			//IL_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0270: Unknown result type (might be due to invalid IL or missing references)
			//IL_0275: Unknown result type (might be due to invalid IL or missing references)
			//IL_0282: Unknown result type (might be due to invalid IL or missing references)
			//IL_0287: 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)
			if (Object.op_Implicit((Object)(object)PhaseCounter.instance))
			{
				if (PhaseCounter.instance.phase == 2)
				{
					float num = 360f / (float)ModConfig.UltimateWaves.Value;
					Vector3 val = Vector3.ProjectOnPlane(((EntityState)self).inputBank.aimDirection, Vector3.up);
					for (int i = 0; i < 4; i++)
					{
						for (int j = 0; j < ModConfig.UltimateWaves.Value; j++)
						{
							Vector3 val2 = Quaternion.AngleAxis(num * (float)j, Vector3.up) * val;
							ProjectileManager.instance.FireProjectile(UmbralMithrix.staticUltLine, UmbralMithrix.p23PizzaPoints[i], Util.QuaternionSafeLookRotation(val2), ((EntityState)self).gameObject, ((EntityState)self).characterBody.damage * UltChannelState.waveProjectileDamageCoefficient, UltChannelState.waveProjectileForce, Util.CheckRoll(((EntityState)self).characterBody.crit, ((EntityState)self).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f);
						}
					}
				}
				if (PhaseCounter.instance.phase == 3)
				{
					UltChannelState.waveProjectileCount = 0;
					int count = PlayerCharacterMasterController.instances.Count;
					int value = ModConfig.UltimateWaves.Value;
					float num2 = 360f / (float)value;
					Vector3 val3 = Vector3.ProjectOnPlane(Random.onUnitSphere, Vector3.up);
					Vector3 normalized = ((Vector3)(ref val3)).normalized;
					GameObject val4 = UmbralMithrix.leftUltLine;
					if ((double)Random.value <= 0.5)
					{
						val4 = UmbralMithrix.rightUltLine;
					}
					PlayerCharacterMasterController val5 = PlayerCharacterMasterController.instances[new Random().Next(0, count - 1)];
					Vector3[] array = (Vector3[])(object)new Vector3[2]
					{
						new Vector3(val5.body.footPosition.x, ((EntityState)self).characterBody.footPosition.y, val5.body.footPosition.z) + new Vector3(Random.Range(-45f, -15f), 0f, Random.Range(-45f, -15f)),
						new Vector3(val5.body.footPosition.x, ((EntityState)self).characterBody.footPosition.y, val5.body.footPosition.z) + new Vector3(Random.Range(15f, 45f), 0f, Random.Range(15f, 45f))
					};
					for (int k = 0; k < 2; k++)
					{
						for (int l = 0; l < value; l++)
						{
							Vector3 val6 = Quaternion.AngleAxis(num2 * (float)l, Vector3.up) * normalized;
							ProjectileManager.instance.FireProjectile(val4, array[k], Util.QuaternionSafeLookRotation(val6), ((EntityState)self).gameObject, ((EntityState)self).characterBody.damage * UltChannelState.waveProjectileDamageCoefficient, UltChannelState.waveProjectileForce, Util.CheckRoll(((EntityState)self).characterBody.crit, ((EntityState)self).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f);
						}
					}
				}
			}
			orig.Invoke(self);
		}

		private void SkyLeapDeathState_OnEnter(orig_OnEnter orig, SkyLeapDeathState self)
		{
			if (((Object)((EntityState)self).characterBody).name == "BrotherGlassBody(Clone)" && Object.op_Implicit((Object)(object)PhaseCounter.instance) && PhaseCounter.instance.phase == 2)
			{
				GameObject val = GameObject.Find("BrotherBody(Clone)");
				if (Object.op_Implicit((Object)(object)val) && val.GetComponent<CharacterBody>().healthComponent.alive && val.GetComponent<CharacterBody>().HasBuff(Buffs.Immune) && UmbralMithrix.timeCrystals.Count == 1)
				{
					UmbralMithrix.timeCrystals.RemoveAt(0);
					val.GetComponent<CharacterBody>().RemoveBuff(Buffs.Immune);
				}
				((GenericCharacterDeath)self).DestroyModel();
				if (NetworkServer.active)
				{
					((GenericCharacterDeath)self).DestroyBodyAsapServer();
				}
			}
			else if (((Object)((EntityState)self).characterBody).name == "BrotherGlassBody(Clone)" && Object.op_Implicit((Object)(object)PhaseCounter.instance) && PhaseCounter.instance.phase == 3)
			{
				GameObject val2 = GameObject.Find("BrotherHurtBodyP3(Clone)");
				if (Object.op_Implicit((Object)(object)val2) && val2.GetComponent<CharacterBody>().HasBuff(Buffs.Immune) && UmbralMithrix.timeCrystals.Count == 1)
				{
					UmbralMithrix.timeCrystals.RemoveAt(0);
					val2.GetComponent<CharacterBody>().RemoveBuff(Buffs.Immune);
				}
				else
				{
					UmbralMithrix.timeCrystals.RemoveAt(0);
				}
				orig.Invoke(self);
			}
			else
			{
				orig.Invoke(self);
			}
		}

		private void SprintBash_OnEnter(orig_OnEnter orig, SprintBash self)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: 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_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)self).isAuthority)
			{
				Ray aimRay = ((BaseState)self).GetAimRay();
				if (((Object)((EntityState)self).characterBody).name == "BrotherBody(Clone)")
				{
					for (int i = 0; i < 6; i++)
					{
						Util.PlaySound(FireLunarShards.fireSound, ((EntityState)self).gameObject);
						ProjectileManager.instance.FireProjectile(FireLunarShards.projectilePrefab, ((Ray)(ref aimRay)).origin, Quaternion.LookRotation(((Ray)(ref aimRay)).direction), ((EntityState)self).gameObject, (float)((double)((EntityState)self).characterBody.damage * 0.100000001490116 / 12.0), 0f, Util.CheckRoll(((EntityState)self).characterBody.crit, ((EntityState)self).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f);
					}
				}
				else
				{
					ProjectileManager.instance.FireProjectile(SeekingBomb.projectilePrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction), ((EntityState)self).gameObject, ((EntityState)self).characterBody.damage * (SeekingBomb.bombDamageCoefficient * 0.75f), SeekingBomb.bombForce, Util.CheckRoll(((BaseState)self).critStat, ((EntityState)self).characterBody.master), (DamageColorIndex)0, (GameObject)null, 0f);
				}
				if (Object.op_Implicit((Object)(object)PhaseCounter.instance) && ((Object)((EntityState)self).characterBody).name == "BrotherBody(Clone)" && PhaseCounter.instance.phase != 1)
				{
					Vector3 val = Vector3.ProjectOnPlane(((EntityState)self).inputBank.aimDirection, Vector3.up);
					Vector3 footPosition = ((EntityState)self).characterBody.footPosition;
					Vector3 val2 = Quaternion.AngleAxis(0f, Vector3.up) * val;
					ProjectileManager.instance.FireProjectile(WeaponSlam.waveProjectilePrefab, footPosition, Util.QuaternionSafeLookRotation(val2), ((EntityState)self).gameObject, ((EntityState)self).characterBody.damage * WeaponSlam.waveProjectileDamageCoefficient, WeaponSlam.waveProjectileForce, Util.CheckRoll(((EntityState)self).characterBody.crit, ((EntityState)self).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f);
				}
			}
			orig.Invoke(self);
		}

		private void SprintBash_OnExit(orig_OnExit orig, SprintBash self)
		{
			orig.Invoke(self);
			ProjectileSimple[] array = Object.FindObjectsOfType<ProjectileSimple>();
			if (array.Length == 0)
			{
				return;
			}
			ProjectileSimple[] array2 = array;
			foreach (ProjectileSimple val in array2)
			{
				if (((Object)val).name == "LunarWispTrackingBomb(Clone)")
				{
					val.desiredForwardSpeed = 50f;
				}
			}
		}

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

		private static void SpellChannelState_OnEnter(orig_OnEnter orig, SpellChannelState self)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Invalid comparison between Unknown and I4
			SpellChannelState.maxDuration = 5f;
			TeamComponent[] array = Object.FindObjectsOfType<TeamComponent>();
			for (int i = 0; i < array.Length; i++)
			{
				if ((int)array[i].teamIndex == 1)
				{
					((Component)array[i]).GetComponent<CharacterBody>().AddBuff(Buffs.TeamWarCry);
				}
			}
			orig.Invoke(self);
		}

		private void SpellChannelExitState_OnEnter(orig_OnEnter orig, SpellChannelExitState self)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Invalid comparison between Unknown and I4
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Expected O, but got Unknown
			UmbralMithrix.finishedItemSteal = true;
			((Component)((EntityState)self).characterBody).gameObject.GetComponent<P4Controller>().finishedItemSteal = true;
			bool flag = false;
			CharacterMaster[] array = Object.FindObjectsOfType<CharacterMaster>();
			foreach (CharacterMaster val in array)
			{
				if ((int)val.teamIndex == 1)
				{
					CharacterBody body = val.GetBody();
					if (Object.op_Implicit((Object)(object)body) && !body.isPlayerControlled && Object.op_Implicit((Object)(object)body.healthComponent))
					{
						body.healthComponent.Suicide((GameObject)null, (GameObject)null, (DamageType)0);
					}
				}
			}
			if (flag)
			{
				Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage
				{
					baseToken = "<color=#c6d5ff><size=120%>Mithrix: Perish.</color></size>"
				});
			}
			orig.Invoke(self);
		}

		private void StaggerEnter_OnEnter(orig_OnEnter orig, StaggerEnter self)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Expected O, but got Unknown
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Expected O, but got Unknown
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: 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_00b4: Expected O, but got Unknown
			((StaggerBaseState)self).duration = 0f;
			if (Object.op_Implicit((Object)(object)PhaseCounter.instance) && PhaseCounter.instance.phase == 4)
			{
				((EntityState)self).outer.SetNextState((EntityState)new SpellChannelEnterState());
				return;
			}
			if (Object.op_Implicit((Object)(object)PhaseCounter.instance) && PhaseCounter.instance.phase == 3 && !UmbralMithrix.spawnedClone)
			{
				UmbralMithrix.spawnedClone = true;
				DirectorPlacementRule val = new DirectorPlacementRule();
				val.placementMode = (PlacementMode)3;
				val.minDistance = 3f;
				val.maxDistance = 20f;
				val.position = new Vector3(-88.5f, 491.5f, -0.3f);
				Xoroshiro128Plus rng = RoR2Application.rng;
				DirectorSpawnRequest val2 = new DirectorSpawnRequest(UmbralMithrix.mithrixCard, val, rng);
				val2.summonerBodyObject = ((EntityState)self).gameObject;
				val2.onSpawnedServer = (Action<SpawnResult>)Delegate.Combine(val2.onSpawnedServer, (Action<SpawnResult>)delegate(SpawnResult spawnResult)
				{
					//IL_0000: Unknown result type (might be due to invalid IL or missing references)
					CharacterMaster component = spawnResult.spawnedInstance.GetComponent<CharacterMaster>();
					component.GetBody().AddBuff(Buffs.Immune);
					BaseAI[] components = ((Component)component).GetComponents<BaseAI>();
					foreach (BaseAI val3 in components)
					{
						if (Object.op_Implicit((Object)(object)val3))
						{
							val3.fullVision = true;
							val3.neverRetaliateFriendlies = true;
						}
					}
				});
				DirectorCore.instance.TrySpawnObject(val2);
			}
			orig.Invoke(self);
		}

		private void TrueDeathState_OnEnter(orig_OnEnter orig, TrueDeathState self)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: 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_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: 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_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			TrueDeathState.dissolveDuration = 3f;
			if (!UmbralMithrix.practiceModeEnabled)
			{
				Vector3 val = Vector3.up * 40f + Vector3.forward * 2f;
				PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex(UmbralMithrix.UmbralItem.itemIndex), ((EntityState)self).characterBody.footPosition + Vector3.up * 1.5f, val);
			}
			UmbralMithrix.practiceModeEnabled = false;
			orig.Invoke(self);
		}
	}
	public class PrimaryHooks
	{
		public PrimaryHooks()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Expected O, but got Unknown
			WeaponSlam.OnEnter += new hook_OnEnter(WeaponSlamOnEnter);
			WeaponSlam.FixedUpdate += new hook_FixedUpdate(WeaponSlamFixedUpdate);
			FireLunarShards.OnEnter += new hook_OnEnter(FireLunarShardsOnEnter);
		}

		private void WeaponSlamOnEnter(orig_OnEnter orig, WeaponSlam self)
		{
			UmbralMithrix.hasfired = false;
			orig.Invoke(self);
		}

		private void WeaponSlamFixedUpdate(orig_FixedUpdate orig, WeaponSlam self)
		{
			//IL_005f: 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_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: 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_0094: 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_00a6: 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_00a9: 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) && !UmbralMithrix.hasfired)
			{
				UmbralMithrix.hasfired = true;
				if (Object.op_Implicit((Object)(object)PhaseCounter.instance))
				{
					int value = ModConfig.SlamOrbProjectileCount.Value;
					float num = 360f / (float)value;
					Vector3 val = Vector3.ProjectOnPlane(((EntityState)self).characterDirection.forward, Vector3.up);
					Vector3 position = ((BaseState)self).FindModelChild(WeaponSlam.muzzleString).position;
					for (int i = 0; i < value; i++)
					{
						Vector3 val2 = Quaternion.AngleAxis(num * (float)i, Vector3.up) * val;
						ProjectileManager.instance.FireProjectile(FistSlam.waveProjectilePrefab, position, Util.QuaternionSafeLookRotation(val2), ((EntityState)self).gameObject, ((EntityState)self).characterBody.damage * (FistSlam.waveProjectileDamageCoefficient * 0.75f), FistSlam.waveProjectileForce, Util.CheckRoll(((EntityState)self).characterBody.crit, ((EntityState)self).characterBody.master), (DamageColorIndex)0, (GameObject)null, -1f);
					}
				}
			}
			orig.Invoke(self);
		}

		private void FireLunarShardsOnEnter(orig_OnEnter orig, FireLunarShards self)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: 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_008a: 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_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: 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_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			if (!(self is FireLunarShardsHurt))
			{
				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;
				}
				FireProjectileInfo val2 = default(FireProjectileInfo);
				val2.position = ((Ray)(ref aimRay)).origin;
				val2.rotation = Quaternion.LookRotation(((Ray)(ref aimRay)).direction);
				val2.crit = ((EntityState)self).characterBody.RollCrit();
				val2.damage = ((EntityState)self).characterBody.damage * self.damageCoefficient;
				val2.damageColorIndex = (DamageColorIndex)0;
				val2.owner = ((EntityState)self).gameObject;
				val2.procChainMask = default(ProcChainMask);
				val2.force = 0f;
				val2.useFuseOverride = false;
				val2.useSpeedOverride = false;
				val2.target = null;
				val2.projectilePrefab = FireLunarShards.projectilePrefab;
				for (int i = 0; i < ModConfig.LunarShardAdd.Value; i++)
				{
					ProjectileManager.instance.FireProjectile(val2);
					((Ray)(ref aimRay)).direction = Util.ApplySpread(((Ray)(ref aimRay)).direction, 0f, self.maxSpread * (float)(1.0 + 0.449999988079071 * (double)i), self.spreadYawScale * (float)(1.0 + 0.449999988079071 * (double)i), self.spreadPitchScale * (float)(1.0 + 0.449999988079071 * (double)i), 0f, 0f);
					val2.rotation = Quaternion.LookRotation(((Ray)(ref aimRay)).direction);
				}
			}
			orig.Invoke(self);
		}
	}
	internal class ModConfig
	{
		public static ConfigEntry<bool> purpleArena;

		public static ConfigEntry<float> basehealth;

		public static ConfigEntry<float> levelhealth;

		public static ConfigEntry<float> basedamage;

		public static ConfigEntry<float> leveldamage;

		public static ConfigEntry<float> basearmor;

		public static ConfigEntry<float> baseattackspeed;

		public static ConfigEntry<float> basespeed;

		public static ConfigEntry<float> mass;

		public static ConfigEntry<float> turningspeed;

		public static ConfigEntry<float> jumpingpower;

		public static ConfigEntry<float> acceleration;

		public static ConfigEntry<float> aircontrol;

		public static ConfigEntry<int> PrimStocks;

		public static ConfigEntry<int> SecStocks;

		public static ConfigEntry<int> UtilStocks;

		public static ConfigEntry<float> PrimCD;

		public static ConfigEntry<float> SecCD;

		public static ConfigEntry<float> UtilCD;

		public static ConfigEntry<float> SpecialCD;

		public static ConfigEntry<float> CrushingLeap;

		public static ConfigEntry<int> SlamOrbProjectileCount;

		public static ConfigEntry<int> LunarShardAdd;

		public static ConfigEntry<int> UltimateWaves;

		public static ConfigEntry<int> UltimateCount;

		public static ConfigEntry<float> UltimateDuration;

		public static ConfigEntry<int> JumpWaveCount;

		public static ConfigEntry<float> ShardHoming;

		public static ConfigEntry<float> ShardRange;

		public static ConfigEntry<float> ShardCone;

		public static void InitConfig(ConfigFile config)
		{
			//IL_0384: Unknown result type (might be due to invalid IL or missing references)
			//IL_038e: Expected O, but got Unknown
			//IL_0393: Unknown result type (might be due to invalid IL or missing references)
			//IL_0398: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_03be: Expected O, but got Unknown
			//IL_03b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c3: Expected O, but got Unknown
			//IL_03c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d8: 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_03f3: Expected O, but got Unknown
			//IL_03ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f8: Expected O, but got Unknown
			//IL_03fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0402: Unknown result type (might be due to invalid IL or missing references)
			//IL_040d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0418: Unknown result type (might be due to invalid IL or missing references)
			//IL_0428: Expected O, but got Unknown
			//IL_0423: Unknown result type (might be due to invalid IL or missing references)
			//IL_042d: Expected O, but got Unknown
			//IL_0432: Unknown result type (might be due to invalid IL or missing references)
			//IL_0437: Unknown result type (might be due to invalid IL or missing references)
			//IL_0442: Unknown result type (might be due to invalid IL or missing references)
			//IL_044d: Unknown result type (might be due to invalid IL or missing references)
			//IL_045d: Expected O, but got Unknown
			//IL_0458: Unknown result type (might be due to invalid IL or missing references)
			//IL_0462: Expected O, but got Unknown
			//IL_0467: Unknown result type (might be due to invalid IL or missing references)
			//IL_046c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0477: Unknown result type (might be due to invalid IL or missing references)
			//IL_0482: Unknown result type (might be due to invalid IL or missing references)
			//IL_0492: Expected O, but got Unknown
			//IL_048d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0497: Expected O, but got Unknown
			//IL_049c: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c7: Expected O, but got Unknown
			//IL_04c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cc: Expected O, but got Unknown
			//IL_04d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fc: Expected O, but got Unknown
			//IL_04f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0501: Expected O, but got Unknown
			//IL_0506: Unknown result type (might be due to invalid IL or missing references)
			//IL_050b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0516: Unknown result type (might be due to invalid IL or missing references)
			//IL_0521: Unknown result type (might be due to invalid IL or missing references)
			//IL_0531: Expected O, but got Unknown
			//IL_052c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0536: Expected O, but got Unknown
			//IL_053b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0540: Unknown result type (might be due to invalid IL or missing references)
			//IL_054b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0556: Unknown result type (might be due to invalid IL or missing references)
			//IL_0566: Expected O, but got Unknown
			//IL_0561: Unknown result type (might be due to invalid IL or missing references)
			//IL_056b: Expected O, but got Unknown
			//IL_0570: Unknown result type (might be due to invalid IL or missing references)
			//IL_0575: Unknown result type (might be due to invalid IL or missing references)
			//IL_0580: Unknown result type (might be due to invalid IL or missing references)
			//IL_058b: Unknown result type (might be due to invalid IL or missing references)
			//IL_059b: Expected O, but got Unknown
			//IL_0596: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a0: Expected O, but got Unknown
			//IL_05a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d0: Expected O, but got Unknown
			//IL_05cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d5: Expected O, but got Unknown
			//IL_05da: Unknown result type (might be due to invalid IL or missing references)
			//IL_05df: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0605: Expected O, but got Unknown
			//IL_0600: Unknown result type (might be due to invalid IL or missing references)
			//IL_060a: Expected O, but got Unknown
			//IL_060f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0614: Unknown result type (might be due to invalid IL or missing references)
			//IL_061b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0627: Expected O, but got Unknown
			//IL_0622: Unknown result type (might be due to invalid IL or missing references)
			//IL_062c: Expected O, but got Unknown
			//IL_0631: Unknown result type (might be due to invalid IL or missing references)
			//IL_0636: Unknown result type (might be due to invalid IL or missing references)
			//IL_063d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0649: Expected O, but got Unknown
			//IL_0644: Unknown result type (might be due to invalid IL or missing references)
			//IL_064e: Expected O, but got Unknown
			//IL_0653: Unknown result type (might be due to invalid IL or missing references)
			//IL_0658: Unknown result type (might be due to invalid IL or missing references)
			//IL_065f: Unknown result type (might be due to invalid IL or missing references)
			//IL_066b: Expected O, but got Unknown
			//IL_0666: Unknown result type (might be due to invalid IL or missing references)
			//IL_0670: Expected O, but got Unknown
			//IL_0675: Unknown result type (might be due to invalid IL or missing references)
			//IL_067a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0685: Unknown result type (might be due to invalid IL or missing references)
			//IL_0690: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a0: Expected O, but got Unknown
			//IL_069b: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a5: Expected O, but got Unknown
			//IL_06aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_06af: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d5: Expected O, but got Unknown
			//IL_06d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_06da: Expected O, but got Unknown
			//IL_06df: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_06fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_070a: Expected O, but got Unknown
			//IL_0705: Unknown result type (might be due to invalid IL or missing references)
			//IL_070f: Expected O, but got Unknown
			//IL_0714: Unknown result type (might be due to invalid IL or missing references)
			//IL_0719: Unknown result type (might be due to invalid IL or missing references)
			//IL_0724: Unknown result type (might be due to invalid IL or missing references)
			//IL_072f: Unknown result type (might be due to invalid IL or missing references)
			//IL_073f: Expected O, but got Unknown
			//IL_073a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0744: Expected O, but got Unknown
			//IL_0749: Unknown result type (might be due to invalid IL or missing references)
			//IL_074e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0759: Unknown result type (might be due to invalid IL or missing references)
			//IL_0764: Unknown result type (might be due to invalid IL or missing references)
			//IL_0774: Expected O, but got Unknown
			//IL_076f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0779: Expected O, but got Unknown
			//IL_077e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0783: Unknown result type (might be due to invalid IL or missing references)
			//IL_078a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0797: Expected O, but got Unknown
			//IL_0792: Unknown result type (might be due to invalid IL or missing references)
			//IL_079c: Expected O, but got Unknown
			//IL_07a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b9: Expected O, but got Unknown
			//IL_07b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_07be: Expected O, but got Unknown
			//IL_07c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_07dc: Expected O, but got Unknown
			//IL_07d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e1: Expected O, but got Unknown
			//IL_07e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_07eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0801: Unknown result type (might be due to invalid IL or missing references)
			//IL_0811: Expected O, but got Unknown
			//IL_080c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0816: Expected O, but got Unknown
			//IL_081b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0820: Unknown result type (might be due to invalid IL or missing references)
			//IL_0828: Unknown result type (might be due to invalid IL or missing references)
			//IL_0835: Expected O, but got Unknown
			//IL_0830: Unknown result type (might be due to invalid IL or missing references)
			//IL_083a: Expected O, but got Unknown
			//IL_083f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0844: Unknown result type (might be due to invalid IL or missing references)
			//IL_084f: Unknown result type (might be due to invalid IL or missing references)
			//IL_085a: Unknown result type (might be due to invalid IL or missing references)
			//IL_086a: Expected O, but got Unknown
			//IL_0865: Unknown result type (might be due to invalid IL or missing references)
			//IL_086f: Expected O, but got Unknown
			//IL_0874: Unknown result type (might be due to invalid IL or missing references)
			//IL_0879: Unknown result type (might be due to invalid IL or missing references)
			//IL_0884: Unknown result type (might be due to invalid IL or missing references)
			//IL_088f: Unknown result type (might be due to invalid IL or missing references)
			//IL_089f: Expected O, but got Unknown
			//IL_089a: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a4: Expected O, but got Unknown
			//IL_08a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d4: Expected O, but got Unknown
			//IL_08cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d9: Expected O, but got Unknown
			purpleArena = config.Bind<bool>("General", "Purple Arena", false, "Adds swirling purple walls/ceiling to the arena. Applies at the start of the fight.");
			basehealth = config.Bind<float>("Stats", "Base Health", 1000f, "Vanilla: 1000");
			levelhealth = config.Bind<float>("Stats", "Level Health", 325f, "Health gained per level. Vanilla: 300");
			basedamage = config.Bind<float>("Stats", "Base Damage", 15f, "Vanilla: 16");
			leveldamage = config.Bind<float>("Stats", "Level Damage", 3f, "Damage gained per level. Vanilla: 3.2");
			basearmor = config.Bind<float>("Stats", "Base Armor", 30f, "Vanilla: 20");
			baseattackspeed = config.Bind<float>("Stats", "Base Attack Speed", 1.25f, "Vanilla: 1");
			basespeed = config.Bind<float>("Stats", "Base Move Speed", 15f, "Vanilla: 15");
			mass = config.Bind<float>("Stats", "Mass", 5000f, "Recommended to increase if you increase his movement speed. Vanilla: 900");
			turningspeed = config.Bind<float>("Stats", "Turn Speed", 300f, "Vanilla: 270");
			jumpingpower = config.Bind<float>("Stats", "Moon Shoes", 50f, "How high Mithrix jumps. Vanilla: 25");
			acceleration = config.Bind<float>("Stats", "Acceleration", 100f, "Vanilla: 45");
			aircontrol = config.Bind<float>("Stats", "Air Control", 0.5f, "Vanilla: 0.25");
			PrimStocks = config.Bind<int>("Skills", "Primary Stocks", 1, "Max Stocks for Mithrix's Weapon Slam. Vanilla: 1");
			SecStocks = config.Bind<int>("Skills", "Secondary Stocks", 1, "Max Stocks for Mithrix's Dash Attack. Vanilla: 1");
			UtilStocks = config.Bind<int>("Skills", "Util Stocks", 3, "Max Stocks for Mithrix's Dash. Vanilla: 2");
			PrimCD = config.Bind<float>("Skills", "Primary Cooldown", 4f, "Cooldown for Mithrix's Weapon Slam. Vanilla: 4");
			SecCD = config.Bind<float>("Skills", "Secondary Cooldown", 4.5f, "Cooldown for Mithrix's Dash Attack. Vanilla: 5");
			UtilCD = config.Bind<float>("Skills", "Util Cooldown", 2.5f, "Cooldown for Mithrix's Dash. Vanilla: 3");
			SpecialCD = config.Bind<float>("Skills", "Special Cooldown", 30f, "Cooldown for Mithrix's Jump Attack. Vanilla: 30");
			CrushingLeap = config.Bind<float>("Skill Mods", "Crushing Leap", 3f, "How long Mithrix stays in the air during the crushing leap. Vanilla: 3");
			SlamOrbProjectileCount = config.Bind<int>("Skill Mods", "Orb Projectile Count", 3, "Orbs fired by weapon slam in a circle. Vanilla: N/A");
			LunarShardAdd = config.Bind<int>("Skill Mods", "Shard Add Count", 1, "Bonus shards added to each shot of lunar shards. Vanilla: N/A");
			UltimateWaves = config.Bind<int>("Skill Mods", "P3 Ult Lines", 8, "Total lines in ultimate per burst. Vanilla: 4");
			UltimateCount = config.Bind<int>("Skill Mods", "P3 Ult Bursts", 6, "Total times the ultimate fires. Vanilla: 4");
			UltimateDuration = config.Bind<float>("Skill Mods", "P3 Ult Duration", 8f, "How long ultimate lasts. Vanilla: 8");
			JumpWaveCount = config.Bind<int>("Skill Mods", "Jump Wave Count", 16, "Shockwave count when Mithrix lands after a jump. Vanilla: 12");
			ShardHoming = config.Bind<float>("Skill Mods", "Shard Homing", 25f, "How strongly lunar shards home in to targets. Vanilla: 20");
			ShardRange = config.Bind<float>("Skill Mods", "Shard Range", 100f, "Range (distance) in which shards look for targets. Vanilla: 80");
			ShardCone = config.Bind<float>("Skill Mods", "Shard Cone", 120f, "Cone (Angle) in which shards look for targets. Vanilla: 90");
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(purpleArena));
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(basehealth, new StepSliderConfig
			{
				min = 500f,
				max = 2500f,
				increment = 50f
			}));
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(levelhealth, new StepSliderConfig
			{
				min = 100f,
				max = 500f,
				increment = 25f
			}));
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(basedamage, new StepSliderConfig
			{
				min = 10f,
				max = 30f,
				increment = 1f
			}));
			ModSettingsManager.AddOption((BaseOption)new StepSli