Decompiled source of Minorix2 v1.0.2

Hyphen-Minorix2/Minorix2.dll

Decompiled 20 hours ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using EntityStates;
using EntityStates.BrotherMonster;
using EntityStates.Missions.BrotherEncounter;
using Microsoft.CodeAnalysis;
using On.EntityStates.BrotherMonster;
using On.EntityStates.Missions.BrotherEncounter;
using On.RoR2;
using RoR2;
using RoR2.Projectile;
using UnityEngine;
using UnityEngine.AddressableAssets;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Minorix2")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Minorix2")]
[assembly: AssemblyTitle("Minorix2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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 Minorix2
{
	internal static class Log
	{
		private static ManualLogSource _logSource;

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

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

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

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

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

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

		internal static void Warning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("Hyphen64.Minorix2", "Minorix2", "1.0.0")]
	public class Minorix2Plugin : BaseUnityPlugin
	{
		public const string PluginGUID = "Hyphen64.Minorix2";

		public const string PluginVersion = "1.0.0";

		public const string PluginName = "Minorix2";

		public static PluginInfo PInfo { get; private set; }

		public void Awake()
		{
			Log.Init(((BaseUnityPlugin)this).Logger);
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Minorix2 Entered Awake");
			PInfo = ((BaseUnityPlugin)this).Info;
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Minorix2 Info from DLL");
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Minorix2 Wwise SoundBank Loading Through R2API.Sound");
			MithrixStateHooks.Init();
			MithrixPillarSpawner.Init();
			RoR2Application.onUpdate += MithrixIntroManager.UpdateTimer;
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Minorix2 loaded successfully. Prepare thyself!");
		}
	}
	public static class MithrixIntroManager
	{
		public static bool IsIntroActive = false;

		private static bool hasPlayedThisEncounter = false;

		private static float introTimer = 0f;

		private static float introDuration = 50f;

		private static GameObject emitterObj;

		private static GameObject mithrixObj;

		public static void TriggerIntro(GameObject mithrixBody)
		{
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Expected O, but got Unknown
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			if (hasPlayedThisEncounter || (Object)(object)mithrixBody == (Object)null)
			{
				return;
			}
			mithrixObj = mithrixBody;
			hasPlayedThisEncounter = true;
			IsIntroActive = true;
			introTimer = introDuration;
			Transform val = mithrixObj.transform;
			ModelLocator component = mithrixObj.GetComponent<ModelLocator>();
			if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.modelTransform))
			{
				Transform val2 = component.modelTransform.Find("BrotherArmature/ROOT/base/stomach/chest/neck/head");
				if ((Object)(object)val2 != (Object)null)
				{
					val = val2;
				}
			}
			emitterObj = new GameObject("MinosAudioEmitter");
			emitterObj.transform.SetParent(val, false);
			emitterObj.transform.localPosition = Vector3.zero;
			emitterObj.AddComponent<AkGameObj>();
			Util.PlaySound("Play_Mp_intro2", emitterObj);
			Log.Info("Mithrix Intro started on " + ((Object)emitterObj).name + " Locking attack sounds for " + introDuration + " seconds.");
		}

		public static void UpdateTimer()
		{
			if (IsIntroActive)
			{
				introTimer -= Time.deltaTime;
				if (introTimer <= 0f)
				{
					Shup();
					hasPlayedThisEncounter = true;
					Log.Info("Mithrix Intro finished. Restoring normal attack audio.");
				}
			}
		}

		public static void Shup()
		{
			IsIntroActive = false;
			introTimer = 0f;
			AkSoundEngine.StopAll(emitterObj);
			Object.Destroy((Object)(object)emitterObj);
			emitterObj = null;
		}

		public static void ResetEncounter()
		{
			hasPlayedThisEncounter = false;
			IsIntroActive = false;
			introTimer = 0f;
		}
	}
	public class MithrixStateHooks
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_OnEnter <0>__UltEnterState_OnEnter;

			public static hook_OnEnter <1>__WeaponSlam_OnEnter;

			public static hook_OnEnter <2>__FistSlam_OnEnter;

			public static hook_OnEnter <3>__Bash_OnEnter;

			public static hook_OnEnter <4>__Dive_OnEnter;

			public static hook_OnEnter <5>__Phase3_OnEnter;

			public static hook_OnEnter <6>__Phase4_OnEnter;

			public static hook_OnEnter <7>__Mithrix_OnDeath;

			public static hook_OnBodyDeath <8>__CharacterMaster_OnBodyDeath;

			public static hook_OnEnter <9>__Parry_OnEnter;
		}

		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_OnEnter <>9__2_0;

			public static hook_OnEnter <>9__2_1;

			internal void <Init>b__2_0(orig_OnEnter orig, SkySpawnState self)
			{
				orig.Invoke(self);
				if (Object.op_Implicit((Object)(object)((Component)((EntityState)self).outer).gameObject))
				{
					MithrixIntroManager.TriggerIntro(((Component)((EntityState)self).outer).gameObject);
				}
			}

			internal void <Init>b__2_1(orig_OnEnter orig, Phase2 self)
			{
				orig.Invoke(self);
				if (MithrixIntroManager.IsIntroActive)
				{
					MithrixIntroManager.Shup();
					Util.PlaySound("Play_Mp_hurt", ((Component)((EntityState)self).outer).gameObject);
					Log.Info("Phase 1 Psuedoskipped");
				}
				Log.Info("Phase 2 Entered");
			}
		}

		public static bool Phase3Entered;

		public static bool Phase4Entered;

		public static void Init()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Expected O, but got Unknown
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Expected O, but got Unknown
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Expected O, but got Unknown
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Expected O, but got Unknown
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Expected O, but got Unknown
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Expected O, but got Unknown
			//IL_0142: 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_014d: Expected O, but got Unknown
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Expected O, but got Unknown
			//IL_0184: 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_018f: Expected O, but got Unknown
			object obj = <>O.<0>__UltEnterState_OnEnter;
			if (obj == null)
			{
				hook_OnEnter val = UltEnterState_OnEnter;
				<>O.<0>__UltEnterState_OnEnter = val;
				obj = (object)val;
			}
			UltEnterState.OnEnter += (hook_OnEnter)obj;
			object obj2 = <>O.<1>__WeaponSlam_OnEnter;
			if (obj2 == null)
			{
				hook_OnEnter val2 = WeaponSlam_OnEnter;
				<>O.<1>__WeaponSlam_OnEnter = val2;
				obj2 = (object)val2;
			}
			WeaponSlam.OnEnter += (hook_OnEnter)obj2;
			object obj3 = <>O.<2>__FistSlam_OnEnter;
			if (obj3 == null)
			{
				hook_OnEnter val3 = FistSlam_OnEnter;
				<>O.<2>__FistSlam_OnEnter = val3;
				obj3 = (object)val3;
			}
			FistSlam.OnEnter += (hook_OnEnter)obj3;
			object obj4 = <>O.<3>__Bash_OnEnter;
			if (obj4 == null)
			{
				hook_OnEnter val4 = Bash_OnEnter;
				<>O.<3>__Bash_OnEnter = val4;
				obj4 = (object)val4;
			}
			SprintBash.OnEnter += (hook_OnEnter)obj4;
			object obj5 = <>O.<4>__Dive_OnEnter;
			if (obj5 == null)
			{
				hook_OnEnter val5 = Dive_OnEnter;
				<>O.<4>__Dive_OnEnter = val5;
				obj5 = (object)val5;
			}
			EnterSkyLeap.OnEnter += (hook_OnEnter)obj5;
			object obj6 = <>c.<>9__2_0;
			if (obj6 == null)
			{
				hook_OnEnter val6 = delegate(orig_OnEnter orig, SkySpawnState self)
				{
					orig.Invoke(self);
					if (Object.op_Implicit((Object)(object)((Component)((EntityState)self).outer).gameObject))
					{
						MithrixIntroManager.TriggerIntro(((Component)((EntityState)self).outer).gameObject);
					}
				};
				<>c.<>9__2_0 = val6;
				obj6 = (object)val6;
			}
			SkySpawnState.OnEnter += (hook_OnEnter)obj6;
			object obj7 = <>c.<>9__2_1;
			if (obj7 == null)
			{
				hook_OnEnter val7 = delegate(orig_OnEnter orig, Phase2 self)
				{
					orig.Invoke(self);
					if (MithrixIntroManager.IsIntroActive)
					{
						MithrixIntroManager.Shup();
						Util.PlaySound("Play_Mp_hurt", ((Component)((EntityState)self).outer).gameObject);
						Log.Info("Phase 1 Psuedoskipped");
					}
					Log.Info("Phase 2 Entered");
				};
				<>c.<>9__2_1 = val7;
				obj7 = (object)val7;
			}
			Phase2.OnEnter += (hook_OnEnter)obj7;
			object obj8 = <>O.<5>__Phase3_OnEnter;
			if (obj8 == null)
			{
				hook_OnEnter val8 = Phase3_OnEnter;
				<>O.<5>__Phase3_OnEnter = val8;
				obj8 = (object)val8;
			}
			Phase3.OnEnter += (hook_OnEnter)obj8;
			object obj9 = <>O.<6>__Phase4_OnEnter;
			if (obj9 == null)
			{
				hook_OnEnter val9 = Phase4_OnEnter;
				<>O.<6>__Phase4_OnEnter = val9;
				obj9 = (object)val9;
			}
			Phase4.OnEnter += (hook_OnEnter)obj9;
			object obj10 = <>O.<7>__Mithrix_OnDeath;
			if (obj10 == null)
			{
				hook_OnEnter val10 = Mithrix_OnDeath;
				<>O.<7>__Mithrix_OnDeath = val10;
				obj10 = (object)val10;
			}
			TrueDeathState.OnEnter += (hook_OnEnter)obj10;
			object obj11 = <>O.<8>__CharacterMaster_OnBodyDeath;
			if (obj11 == null)
			{
				hook_OnBodyDeath val11 = CharacterMaster_OnBodyDeath;
				<>O.<8>__CharacterMaster_OnBodyDeath = val11;
				obj11 = (object)val11;
			}
			CharacterMaster.OnBodyDeath += (hook_OnBodyDeath)obj11;
			object obj12 = <>O.<9>__Parry_OnEnter;
			if (obj12 == null)
			{
				hook_OnEnter val12 = Parry_OnEnter;
				<>O.<9>__Parry_OnEnter = val12;
				obj12 = (object)val12;
			}
			StaggerEnter.OnEnter += (hook_OnEnter)obj12;
		}

		private void Update()
		{
		}

		private static void Parry_OnEnter(orig_OnEnter orig, StaggerEnter self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)((EntityState)self).outer) && Object.op_Implicit((Object)(object)((Component)((EntityState)self).outer).gameObject))
			{
				if (MithrixIntroManager.IsIntroActive)
				{
					MithrixIntroManager.Shup();
					Log.Info("Phase 1 Psuedoskipped");
				}
				AkSoundEngine.StopAll(((Component)((EntityState)self).outer).gameObject);
				Util.PlaySound("Play_Mp_hurt", ((Component)((EntityState)self).outer).gameObject);
				Log.Info("Mithrix Rooted -> Minos Hurt");
			}
		}

		private static void UltEnterState_OnEnter(orig_OnEnter orig, UltEnterState self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)((EntityState)self).outer) && Object.op_Implicit((Object)(object)((Component)((EntityState)self).outer).gameObject) && !MithrixIntroManager.IsIntroActive)
			{
				Log.Info("Mithrix Ulted -> Judgement");
				switch (Random.Range(0, 2) + 1)
				{
				case 1:
					Util.PlaySound("Play_Mp_judgement", ((Component)((EntityState)self).outer).gameObject);
					break;
				case 2:
					Util.PlaySound("Play_Mp_judgement2", ((Component)((EntityState)self).outer).gameObject);
					break;
				}
			}
		}

		private static void WeaponSlam_OnEnter(orig_OnEnter orig, WeaponSlam self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)((EntityState)self).outer) && Object.op_Implicit((Object)(object)((Component)((EntityState)self).outer).gameObject) && !MithrixIntroManager.IsIntroActive)
			{
				Log.Info("Mithrix Weapon Slam -> Die");
				switch (Random.Range(0, 2) + 1)
				{
				case 1:
					Util.PlaySound("Play_Mp_die", ((Component)((EntityState)self).outer).gameObject);
					break;
				case 2:
					Util.PlaySound("Play_Mp_die2", ((Component)((EntityState)self).outer).gameObject);
					break;
				}
			}
		}

		private static void FistSlam_OnEnter(orig_OnEnter orig, FistSlam self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)((EntityState)self).outer) && Object.op_Implicit((Object)(object)((Component)((EntityState)self).outer).gameObject) && !MithrixIntroManager.IsIntroActive)
			{
				if (Random.Range(0, 2) == 1)
				{
					Log.Info("Mithrix Fist Slam -> Prepare Thy End Is Self Now");
				}
				switch (Random.Range(0, 4))
				{
				case 0:
					Util.PlaySound("Play_Mp_prepare", ((Component)((EntityState)self).outer).gameObject);
					break;
				case 1:
					Util.PlaySound("Play_Mp_prepare2", ((Component)((EntityState)self).outer).gameObject);
					break;
				case 2:
					Util.PlaySound("Play_Mp_thyend", ((Component)((EntityState)self).outer).gameObject);
					break;
				case 3:
					Util.PlaySound("Play_Mp_thyend2", ((Component)((EntityState)self).outer).gameObject);
					break;
				}
			}
		}

		private static void Bash_OnEnter(orig_OnEnter orig, SprintBash self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)((EntityState)self).outer) && Object.op_Implicit((Object)(object)((Component)((EntityState)self).outer).gameObject) && !MithrixIntroManager.IsIntroActive)
			{
				Log.Info("Mithrix Sprint Bash -> Judgement");
				switch (Random.Range(0, 2) + 1)
				{
				case 1:
					Util.PlaySound("Play_Mp_judgement", ((Component)((EntityState)self).outer).gameObject);
					break;
				case 2:
					Util.PlaySound("Play_Mp_judgement2", ((Component)((EntityState)self).outer).gameObject);
					break;
				}
			}
		}

		private static void Dive_OnEnter(orig_OnEnter orig, EnterSkyLeap self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)((EntityState)self).outer) && Object.op_Implicit((Object)(object)((Component)((EntityState)self).outer).gameObject) && !MithrixIntroManager.IsIntroActive)
			{
				Log.Info("Mithrix Dive -> Crush");
				Util.PlaySound("Play_Mp_crush", ((Component)((EntityState)self).outer).gameObject);
			}
		}

		private static void Phase3_OnEnter(orig_OnEnter orig, Phase3 self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)((EntityState)self).outer) && Object.op_Implicit((Object)(object)((Component)((EntityState)self).outer).gameObject) && !MithrixIntroManager.IsIntroActive && !Phase3Entered)
			{
				Log.Info("Mithrix Phase 3 Enter -> Useless");
				Util.PlaySound("Play_Mp_useless", ((Component)((EntityState)self).outer).gameObject);
				Phase3Entered = true;
			}
		}

		private static void Phase4_OnEnter(orig_OnEnter orig, Phase4 self)
		{
			orig.Invoke(self);
			if (Object.op_Implicit((Object)(object)((EntityState)self).outer) && Object.op_Implicit((Object)(object)((Component)((EntityState)self).outer).gameObject) && !Phase4Entered)
			{
				Log.Info("Mithrix Phase 4 Enter -> Weak");
				Phase4WeakScript phase4WeakScript = ((EntityState)self).gameObject.AddComponent<Phase4WeakScript>();
				Phase4Entered = true;
			}
		}

		private static void CharacterMaster_OnBodyDeath(orig_OnBodyDeath orig, CharacterMaster self, CharacterBody body)
		{
			orig.Invoke(self, body);
			if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)body) && body.isPlayerControlled && Object.op_Implicit((Object)(object)((Component)self).gameObject))
			{
				Log.Info("Player Died/Revived on Mithrix Fight -> Useless");
				Util.PlaySound("Play_Mp_useless", ((Component)self).gameObject);
			}
		}

		private static void Mithrix_OnDeath(orig_OnEnter orig, TrueDeathState self)
		{
			int num = 0;
			TrueDeathState.durationBeforeDissolving = 17f;
			TrueDeathState.dissolveDuration = 8f;
			orig.Invoke(self);
			if (!Phase4Entered || !Object.op_Implicit((Object)(object)((EntityState)self).gameObject))
			{
				return;
			}
			CharacterBody component = ((EntityState)self).GetComponent<CharacterBody>();
			if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.master) || !Object.op_Implicit((Object)(object)component.master.inventory))
			{
				return;
			}
			if (component.master.inventory.GetItemCountEffective(Items.ExtraLife) + component.master.inventory.GetItemCountEffective(Items.ExtraLifeVoid) != 0)
			{
				Log.Info("Mithrix stole ur teddy, good luck");
				return;
			}
			Log.Info("Mithrix Died -> Outro");
			ModelLocator component2 = ((EntityState)self).gameObject.GetComponent<ModelLocator>();
			if (Object.op_Implicit((Object)(object)component2) && Object.op_Implicit((Object)(object)component2.modelTransform))
			{
				PrintController[] components = ((Component)component2.modelTransform).GetComponents<PrintController>();
				PrintController[] array = components;
				foreach (PrintController val in array)
				{
					((Behaviour)val).enabled = false;
				}
				Transform val2 = component2.modelTransform.Find("BrotherDeathEffects");
				if ((Object)(object)val2 != (Object)null)
				{
					((Component)val2).gameObject.SetActive(false);
				}
				Util.PlaySound("Play_Mp_outro", ((EntityState)self).gameObject);
				MithrixDeathScript mithrixDeathScript = ((EntityState)self).gameObject.AddComponent<MithrixDeathScript>();
				mithrixDeathScript.Initialize(15.2f, ((EntityState)self).gameObject);
			}
		}
	}
	public class Phase4WeakScript : MonoBehaviour
	{
		private float delayTimer;

		private bool hasFired = false;

		private GameObject mithrixObj;

		public void Initialize(float delay, GameObject obj)
		{
			delayTimer = delay;
			mithrixObj = obj;
		}

		private void Update()
		{
			if (!hasFired && !((Object)(object)mithrixObj == (Object)null))
			{
				delayTimer -= Time.deltaTime;
				if (delayTimer <= 0f)
				{
					Util.PlaySound("Play_Mp_weak", mithrixObj);
					hasFired = true;
					Object.Destroy((Object)(object)this);
				}
			}
		}
	}
	public class MithrixDeathScript : MonoBehaviour
	{
		private float delayTimer;

		private bool hasFired = false;

		private GameObject mithrixObj;

		public void Initialize(float delay, GameObject obj)
		{
			delayTimer = delay;
			mithrixObj = obj;
		}

		private void Update()
		{
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			if (!hasFired && !((Object)(object)mithrixObj == (Object)null))
			{
				delayTimer -= Time.deltaTime;
				if (delayTimer <= 0f)
				{
					Util.PlaySound("Play_Mp_death", mithrixObj);
					MithrixPillarSpawner.SpawnPillarsAtPosition(mithrixObj.transform.position, mithrixObj.transform.rotation, mithrixObj);
					MinosCorpseLevitator minosCorpseLevitator = mithrixObj.AddComponent<MinosCorpseLevitator>();
					minosCorpseLevitator.targetHeight = 30f;
					minosCorpseLevitator.levitateSpeed = 3.5f;
					hasFired = true;
					Object.Destroy((Object)(object)this);
				}
			}
		}
	}
	public class MinosCorpseLevitator : MonoBehaviour
	{
		private Vector3 startPosition;

		private Quaternion startRotation;

		private Quaternion targetRotation;

		private float timer = 0f;

		public float targetHeight = 1f;

		public float levitateSpeed = 1f;

		private void Start()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//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_0025: 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_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			startPosition = ((Component)this).transform.position;
			startRotation = ((Component)this).transform.rotation;
			targetRotation = startRotation * Quaternion.AngleAxis(-98f, ((Component)this).GetComponent<ModelLocator>().modelTransform.right);
			CharacterMotor component = ((Component)this).GetComponent<CharacterMotor>();
			if (Object.op_Implicit((Object)(object)component))
			{
				((Behaviour)component).enabled = false;
			}
		}

		private void Update()
		{
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			timer += Time.deltaTime;
			float num = Mathf.Lerp(startPosition.y, startPosition.y + targetHeight, timer * levitateSpeed / targetHeight);
			((Component)this).transform.position = new Vector3(startPosition.x, num, startPosition.z);
			if (timer <= 2.2f)
			{
				float num2 = 1f - Mathf.Exp((0f - timer) / 0.7f);
				((Component)this).transform.rotation = Quaternion.Slerp(startRotation, targetRotation, num2);
			}
			if (!(timer >= 19f))
			{
				return;
			}
			ModelLocator component = ((Component)this).gameObject.GetComponent<ModelLocator>();
			if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.modelTransform))
			{
				PrintController[] components = ((Component)component.modelTransform).GetComponents<PrintController>();
				PrintController[] array = components;
				foreach (PrintController val in array)
				{
					((Behaviour)val).enabled = true;
				}
				Transform val2 = component.modelTransform.Find("BrotherDeathEffects");
				if ((Object)(object)val2 != (Object)null)
				{
					((Component)val2).gameObject.SetActive(true);
				}
			}
		}
	}
	public static class MithrixPillarSpawner
	{
		private static bool spawned;

		public static GameObject FirePillarPrefab { get; private set; }

		public static void Init()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			if (!spawned)
			{
				FirePillarPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/BrotherFirePillarGhost.prefab").WaitForCompletion();
				Log.Info("MithrixPillarSpawner Init Completed");
			}
		}

		public static void SpawnPillarsAtPosition(Vector3 pos, Quaternion rot, GameObject owner)
		{
			//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_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			Log.Info("Beginning of Spawn Pillars");
			Vector3 zero = Vector3.zero;
			if ((Object)(object)FirePillarPrefab != (Object)null)
			{
				ModelLocator component = owner.GetComponent<ModelLocator>();
				Vector3 forward = component.modelTransform.forward;
				zero = ((Vector3)(ref forward)).normalized;
				GameObject val = Object.Instantiate<GameObject>(FirePillarPrefab, pos + 3f * zero, rot);
				ProjectileGhostController component2 = val.GetComponent<ProjectileGhostController>();
				if (Object.op_Implicit((Object)(object)component2))
				{
					Object.Destroy((Object)(object)component2);
				}
				AlignToNormal component3 = val.GetComponent<AlignToNormal>();
				if (Object.op_Implicit((Object)(object)component3))
				{
					Object.Destroy((Object)(object)component3);
				}
				spawned = true;
				ParticleSystem[] componentsInChildren = val.GetComponentsInChildren<ParticleSystem>(true);
				foreach (ParticleSystem val2 in componentsInChildren)
				{
					MainModule main = val2.main;
					((MainModule)(ref main)).loop = true;
					((Component)val2).gameObject.SetActive(true);
					val2.Play(true);
					Log.Info("firePillar Success");
				}
				val.transform.localScale = new Vector3(1.2f, 1.2f, 1.2f);
				Object.Destroy((Object)(object)val, 10f);
			}
			Log.Info("End of Spawn Pillars");
		}
	}
	public static class SoundBank
	{
		public const string soundBankFolder = "SoundBanks";

		public const string soundBankFileName = "minorix2.bnk";

		public const string soundBankName = "minorix2";

		public static uint _soundBankId;

		public static string SoundBankDirectory => Path.Combine(Path.GetDirectoryName(Minorix2Plugin.PInfo.Location), "SoundBanks");

		public static void Init()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Invalid comparison between Unknown and I4
			//IL_0042: 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_0068: 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_006b: Invalid comparison between Unknown and I4
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			AKRESULT val = AkSoundEngine.AddBasePath(SoundBankDirectory);
			if ((int)val == 1)
			{
				Log.Info("Added bank base path : " + SoundBankDirectory);
			}
			else
			{
				Log.Error("Error adding base path : " + SoundBankDirectory + " " + $"Error code : {val}");
			}
			val = AkSoundEngine.LoadBank("minorix2.bnk", ref _soundBankId);
			if ((int)val == 1)
			{
				Log.Info("Added bank : minorix2.bnk");
			}
			else
			{
				Log.Error("Error loading bank : minorix2.bnk " + $"Error code : {val}");
			}
		}
	}
}