Decompiled source of MinosSecondLife v1.0.0

MinosSecondLife.dll

Decompiled 2 days ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("MinosSecondLife")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("MinosSecondLife")]
[assembly: AssemblyTitle("MinosSecondLife")]
[assembly: AssemblyVersion("1.0.0.0")]
[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 MinosSecondLife
{
	[BepInPlugin("MinosSecondLife.adry.ultrakill", "Minos Second Life", "1.0.0")]
	public class MinosSecondLife : BaseUnityPlugin
	{
		private void Awake()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			Harmony val = new Harmony("MinosSecondLife.adry.ultrakill");
			val.PatchAll();
		}
	}
	[HarmonyPatch(typeof(MinosPrime), "Start")]
	public class MinosPrime_Start_Patch
	{
		[HarmonyPostfix]
		private static void Postfix(MinosPrime __instance)
		{
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Expected O, but got Unknown
			//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_008c: Expected O, but got Unknown
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			Machine component = ((Component)__instance).GetComponent<Machine>();
			if ((Object)(object)component == (Object)null)
			{
				Debug.LogError((object)"Error! 'Machine' component not found in MinosPrime", (Object)(object)__instance);
				return;
			}
			EnemyIdentifier component2 = ((Component)__instance).GetComponent<EnemyIdentifier>();
			if ((Object)(object)component2 == (Object)null)
			{
				Debug.LogError((object)"Error! 'EnemyIdentifier' component not found in MinosPrime", (Object)(object)__instance);
				return;
			}
			float health = component.health;
			component2.health = health * 3f;
			HealthLayer[] healthLayers = (HealthLayer[])(object)new HealthLayer[2]
			{
				new HealthLayer
				{
					health = health
				},
				new HealthLayer
				{
					health = health * 2f
				}
			};
			((Component)__instance).gameObject.GetComponent<BossHealthBar>().healthLayers = healthLayers;
			((Component)__instance).gameObject.GetComponent<BossHealthBar>().secondaryBar = true;
			((Component)__instance).gameObject.GetComponent<BossHealthBar>().SetSecondaryBarColor(Color.red);
			component.health = health * 3f;
			Debug.Log((object)"Minos Prime second health bar initialized successfully", (Object)(object)__instance);
		}
	}
	[HarmonyPatch(typeof(MinosPrime), "Update")]
	public class MinosPrime_Update_Patch
	{
		[HarmonyPrefix]
		private static void Prefix(MinosPrime __instance, ref bool ___enraged)
		{
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: 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)
			Machine component = ((Component)__instance).GetComponent<Machine>();
			if ((Object)(object)component == (Object)null)
			{
				return;
			}
			EnemyIdentifier component2 = ((Component)__instance).GetComponent<EnemyIdentifier>();
			if ((Object)(object)component2 == (Object)null)
			{
				return;
			}
			BossHealthBar component3 = ((Component)__instance).gameObject.GetComponent<BossHealthBar>();
			if (!((Object)(object)component3 == (Object)null) && component3.healthLayers != null && component3.healthLayers.Length == 2 && !___enraged && component2.health <= component3.healthLayers[0].health && component2.health > 0f)
			{
				___enraged = true;
				MonoSingleton<SubtitleController>.Instance.DisplaySubtitle("WEAK", (AudioSource)null, false);
				AudioSource component4 = ((Component)__instance).GetComponent<AudioSource>();
				if ((Object)(object)component4 != (Object)null)
				{
					component4.clip = __instance.phaseChangeVoice;
					component4.pitch = 1f;
					component4.Play();
				}
				GameObject val = Object.Instantiate<GameObject>(__instance.passiveEffect, ((Component)__instance).transform.position + Vector3.up * 3.5f, Quaternion.identity);
				if ((Object)(object)val != (Object)null)
				{
					val.transform.SetParent(((Component)__instance).transform);
				}
				EnemyIdentifierIdentifier[] componentsInChildren = ((Component)__instance).GetComponentsInChildren<EnemyIdentifierIdentifier>();
				foreach (EnemyIdentifierIdentifier val2 in componentsInChildren)
				{
					Object.Instantiate<GameObject>(__instance.flameEffect, ((Component)val2).transform);
				}
				if ((Object)(object)component != (Object)null)
				{
					Object.Instantiate<GameObject>(__instance.phaseChangeEffect, component.chest.transform.position, Quaternion.identity);
				}
			}
		}
	}
}