Decompiled source of UltraReprise v1.0.3

UltraReprise.dll

Decompiled 8 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using PluginConfig.API;
using PluginConfig.API.Decorators;
using PluginConfig.API.Fields;
using Sandbox;
using ULTRAKILL.Cheats;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Events;
using UnityEngine.ResourceManagement.AsyncOperations;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("UltraReprise")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UltraReprise")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("d24676a8-4da0-4d43-a77a-48484b462e5c")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace UltraReprise;

public static class F_Utils
{
	public class AddresableObject<TObject>
	{
		public bool fast_load;

		public string path;

		public TObject obj;

		public TObject Object
		{
			get
			{
				//IL_0022: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: Unknown result type (might be due to invalid IL or missing references)
				if (obj == null)
				{
					fast_load = true;
					obj = Addressables.LoadAssetAsync<TObject>((object)path).WaitForCompletion();
				}
				return obj;
			}
		}

		public Transform[] childs => null;

		public Transform transform
		{
			get
			{
				if ((Object)(object)gameObject != (Object)null)
				{
					return gameObject.transform;
				}
				return null;
			}
		}

		public GameObject gameObject
		{
			get
			{
				object obj = Object;
				return (GameObject)((obj is GameObject) ? obj : null);
			}
		}

		public IEnumerator Long_Load()
		{
			if (obj == null)
			{
				AsyncOperationHandle<TObject> handle = Addressables.LoadAssetAsync<TObject>((object)path);
				yield return handle;
				if ((int)handle.Status == 1)
				{
					fast_load = false;
					obj = handle.Result;
				}
			}
		}

		public T GetComponent<T>()
		{
			if ((Object)(object)gameObject != (Object)null)
			{
				return gameObject.GetComponent<T>();
			}
			return default(T);
		}

		public Transform GetChild(int id)
		{
			if ((Object)(object)transform != (Object)null)
			{
				return transform.GetChild(id);
			}
			return null;
		}

		public AddresableObject(string path)
		{
			this.path = path;
			fast_load = false;
		}

		public static implicit operator AddresableObject<TObject>(string path)
		{
			return new AddresableObject<TObject>(path);
		}

		public override string ToString()
		{
			return path;
		}
	}

	public class Keep_Obj_NearOffset_ThisEnemy : MonoBehaviour
	{
		private EnemyIdentifier Eid;

		public GameObject Obj_ToKeep;

		public Vector3 Offset = Vector3.zero;

		public void Start()
		{
			Eid = ((Component)this).GetComponent<EnemyIdentifier>();
			if ((Object)(object)Eid == (Object)null)
			{
				Eid = ((Component)this).GetComponentInParent<EnemyIdentifier>();
			}
			if ((Object)(object)Eid == (Object)null)
			{
				Eid = ((Component)this).GetComponent<EnemyIdentifierIdentifier>().eid;
			}
			if ((Object)(object)Eid == (Object)null)
			{
				Eid = ((Component)this).GetComponentInParent<EnemyIdentifierIdentifier>().eid;
			}
			if ((Object)(object)Eid == (Object)null)
			{
				Eid = ((Component)((Component)this).transform.parent).GetComponent<EnemyIdentifierIdentifier>().eid;
			}
			if ((Object)(object)Eid == (Object)null)
			{
				Eid = ((Component)((Component)this).transform.parent).GetComponentInParent<EnemyIdentifierIdentifier>().eid;
			}
		}

		public void Update()
		{
			//IL_0045: 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)
			if ((Object)(object)Obj_ToKeep != (Object)null && (Object)(object)Eid != (Object)null && !Eid.Dead)
			{
				Obj_ToKeep.transform.position = ((Component)this).transform.TransformPoint(Offset);
			}
		}
	}

	public class ActivateWith : MonoBehaviour
	{
		public EnemyIdentifier idol;

		public void Start()
		{
			if (Object.op_Implicit((Object)(object)idol))
			{
				((Component)idol).gameObject.SetActive(true);
			}
		}
	}

	public class DestroyWith : MonoBehaviour
	{
		public EnemyIdentifier eid;

		public EnemyIdentifier idol;

		public void Start()
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Expected O, but got Unknown
			eid = ((Component)this).GetComponent<EnemyIdentifier>();
			if (!Object.op_Implicit((Object)(object)eid) || !Object.op_Implicit((Object)(object)idol))
			{
				return;
			}
			eid.onDeath.AddListener((UnityAction)delegate
			{
				if ((Object)(object)idol != (Object)null && (Object)(object)((Component)idol).gameObject != (Object)null)
				{
					Object.Destroy((Object)(object)((Component)idol).gameObject);
				}
			});
		}
	}

	public enum DetectebleEnemies
	{
		Idol
	}

	public static string[] IgnoreKeys = new string[5] { "fire", "acid", "chainsawzone", "environment", "deathzone" };

	public static Dictionary<DetectebleEnemies, EnemyIdentifier> AllEnemiesEids = new Dictionary<DetectebleEnemies, EnemyIdentifier>();

	public static Dictionary<DetectebleEnemies, AddresableObject<GameObject>> AllEnemiesPrefabs = new Dictionary<DetectebleEnemies, AddresableObject<GameObject>> { [DetectebleEnemies.Idol] = new AddresableObject<GameObject>("Assets/Prefabs/Enemies/Idol.prefab") };

	public static bool UltraCheck(EnemyIdentifier eid)
	{
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Invalid comparison between Unknown and I4
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Invalid comparison between Unknown and I4
		if (!UltraReprise_Settings.Mod_Enabled || (InvincibleEnemies.Enabled && eid.blessed) || eid.dead || eid.puppet || (int)eid.enemyType == 21 || (int)eid.enemyType == 39)
		{
			return true;
		}
		return false;
	}

	public static void UltraMethod(EnemyIdentifier eid)
	{
		//IL_0045: 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)
		((Component)eid).gameObject.AddComponent<UltraRepriseMarker>();
		Enemy val = default(Enemy);
		if (((Component)eid).TryGetComponent<Enemy>(ref val))
		{
			Enemy obj = val;
			obj.health += 1f;
		}
		EnemyIdentifier val2 = eid.Make_IdolMerged(enableIdol: true);
		val2.dontCountAsKills = true;
		Transform transform = ((Component)val2).transform;
		transform.localScale *= 0.4f;
		if (UltraReprise_Settings.Sandify_Idols)
		{
			val2.Sandify(false);
		}
		if (UltraReprise_Settings.Radiant_Idols)
		{
			val2.BuffAll();
		}
		if (UltraReprise_Settings.Deathcatchers_Ignore_NonKill_Idols)
		{
			EnemySpawnableInstance val3 = default(EnemySpawnableInstance);
			if (((Component)val2).TryGetComponent<EnemySpawnableInstance>(ref val3))
			{
				Object.Destroy((Object)(object)val3);
			}
			if ((Object)(object)MonoSingleton<EnemyTracker>.Instance != (Object)null && MonoSingleton<EnemyTracker>.Instance.spawnedEnemies != null)
			{
				MonoSingleton<EnemyTracker>.Instance.spawnedEnemies.Remove(((Object)val2).GetInstanceID());
			}
		}
	}

	public static float CalculateDamage(float multiplier, float critMultiplier)
	{
		return multiplier + multiplier * 1f * critMultiplier;
	}

	public static bool Try_GetFrom_Config(BoolField boolField, bool regular = false)
	{
		try
		{
			if (boolField != null)
			{
				return boolField.value;
			}
		}
		catch
		{
		}
		return regular;
	}

	public static float Try_GetFrom_Config(FloatField floatField, float regular = 1f)
	{
		try
		{
			if (floatField != null)
			{
				return floatField.value;
			}
		}
		catch
		{
		}
		return regular;
	}

	public static void DissableColliders(this Transform trf, Transform trc, bool ignore = true)
	{
		Collider[] componentsInChildren = ((Component)trf).GetComponentsInChildren<Collider>();
		Collider[] componentsInChildren2 = ((Component)trc).GetComponentsInChildren<Collider>();
		Collider[] array = componentsInChildren;
		foreach (Collider val in array)
		{
			Collider[] array2 = componentsInChildren2;
			foreach (Collider val2 in array2)
			{
				Physics.IgnoreCollision(val, val2, ignore);
			}
		}
	}

	public static EnemyIdentifier FindEnemyByType(DetectebleEnemies enemy)
	{
		EnemyIdentifier value = null;
		if (AllEnemiesEids.TryGetValue(enemy, out value) && (Object)(object)value != (Object)null)
		{
			return value;
		}
		if (AllEnemiesPrefabs.TryGetValue(enemy, out var value2))
		{
			value = value2.GetComponent<EnemyIdentifier>();
			if ((Object)(object)value != (Object)null)
			{
				AllEnemiesEids.Add(enemy, value);
				return value;
			}
			value = value2.gameObject.GetComponentInChildren<EnemyIdentifier>(true);
			if ((Object)(object)value != (Object)null)
			{
				AllEnemiesEids.Add(enemy, value);
				return value;
			}
			value = value2.gameObject.GetComponentInParent<EnemyIdentifier>(true);
			if ((Object)(object)value != (Object)null)
			{
				AllEnemiesEids.Add(enemy, value);
				return value;
			}
		}
		return null;
	}

	public static EnemyIdentifier Integrate_Enemy(DetectebleEnemies enemy, Transform Parent, bool active, Vector3 Pos = default(Vector3), Quaternion Quart = default(Quaternion))
	{
		//IL_001a: 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_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		EnemyIdentifier val = FindEnemyByType(enemy);
		GameObject val2 = null;
		val2 = Object.Instantiate<GameObject>(((Component)((Component)val).transform.root).gameObject, Pos, Quart);
		val2.transform.root.parent = Parent;
		val2.transform.position = Pos;
		val2.transform.rotation = Quart;
		val2.SetActive(active);
		KeepInBounds val3 = default(KeepInBounds);
		if (val2.TryGetComponent<KeepInBounds>(ref val3))
		{
			Object.Destroy((Object)(object)val3);
		}
		return val2.GetComponent<EnemyIdentifier>();
	}

	public static EnemyIdentifier Make_IdolMerged(this EnemyIdentifier eid, bool enableIdol, bool keepNear = true, bool activateWith = false)
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		EnemyIdentifier val = Integrate_Enemy(DetectebleEnemies.Idol, ((Component)eid).transform.parent, enableIdol, ((Component)eid).transform.position, ((Component)eid).transform.rotation);
		val.idol.ChangeOverrideTarget(eid);
		((Component)val).transform.DissableColliders(((Component)eid).transform);
		if (keepNear)
		{
			Keep_Obj_NearOffset_ThisEnemy orAddComponent = GameObjectExtensions.GetOrAddComponent<Keep_Obj_NearOffset_ThisEnemy>(((Component)eid).gameObject);
			orAddComponent.Obj_ToKeep = ((Component)val).gameObject;
			ComponentExtensions.GetOrAddComponent<DestroyWith>((Component)(object)eid).idol = val;
		}
		if (activateWith)
		{
			ComponentExtensions.GetOrAddComponent<ActivateWith>((Component)(object)eid).idol = val;
		}
		return val;
	}
}
public static class UltraReprise_Settings
{
	public static BoolField V__Varb_Mod_Enabled;

	public static BoolField V__Varb_InstaKill_Enviroment;

	public static BoolField V__Varb_Sandify_Idols;

	public static BoolField V__Varb_Deathcatchers_Ignore_NonKill_Idols;

	public static BoolField V__Varb_Radiant_Idols;

	public static FloatField V__Varb_Radiance_Extra_Tier;

	public static bool Mod_Enabled => F_Utils.Try_GetFrom_Config(V__Varb_Mod_Enabled, regular: true);

	public static bool InstaKill_Enviroment => F_Utils.Try_GetFrom_Config(V__Varb_InstaKill_Enviroment, regular: true);

	public static bool Sandify_Idols => F_Utils.Try_GetFrom_Config(V__Varb_Sandify_Idols);

	public static bool Deathcatchers_Ignore_NonKill_Idols => F_Utils.Try_GetFrom_Config(V__Varb_Deathcatchers_Ignore_NonKill_Idols, regular: true);

	public static bool Radiant_Idols => F_Utils.Try_GetFrom_Config(V__Varb_Radiant_Idols);

	public static float Radiance_Extra_Tier => F_Utils.Try_GetFrom_Config(V__Varb_Radiance_Extra_Tier, 0f);
}
[BepInPlugin("com.enragedone.ultrareprise", "UltraReprise", "1.0.3")]
public class UltraReprise_Loader : BaseUnityPlugin
{
	public const string GUID = "com.enragedone.ultrareprise";

	public const string Name = "UltraReprise";

	public const string Version = "1.0.3";

	public const string Set_Guid = "com.enragedone.ultrareprise.settings";

	public PluginConfigurator config;

	public bool Confing_Loaded = false;

	internal Harmony _Harmony = new Harmony("com.enragedone.fentokill.levelpatches");

	public static ManualLogSource _Logger;

	public static UltraReprise_Loader _Instance;

	public void Awake()
	{
		//IL_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_009d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cd: Expected O, but got Unknown
		//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ed: Expected O, but got Unknown
		//IL_0103: Unknown result type (might be due to invalid IL or missing references)
		//IL_010d: Expected O, but got Unknown
		//IL_011f: 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_0158: Unknown result type (might be due to invalid IL or missing references)
		//IL_0162: Expected O, but got Unknown
		//IL_0174: 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_018e: Unknown result type (might be due to invalid IL or missing references)
		//IL_01af: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b9: Expected O, but got Unknown
		//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01dd: Expected O, but got Unknown
		_Instance = this;
		_Logger = ((BaseUnityPlugin)this).Logger;
		_Logger.LogInfo((object)"UltraReprise_Loader v1.0.3 has started.");
		try
		{
			config = PluginConfigurator.Create("UltraReprise", "com.enragedone.ultrareprise.settings");
			string directoryName = Path.GetDirectoryName(typeof(UltraReprise_Loader).Assembly.Location);
			string text = Path.Combine(directoryName, "icon.png");
			config.SetIconWithURL("file://" + text);
			new ConfigHeader(config.rootPanel, "Main / Global Settings", 24).textColor = Color32.op_Implicit(new Color32((byte)105, (byte)172, byte.MaxValue, byte.MaxValue));
			UltraReprise_Settings.V__Varb_Mod_Enabled = new BoolField(config.rootPanel, "Mod Enabled", "com.enragedone.ultrareprise.settings.V__Varb_Mod_Enabled", true);
			UltraReprise_Settings.V__Varb_InstaKill_Enviroment = new BoolField(config.rootPanel, "InstaKill Enviroment", "com.enragedone.ultrareprise.settings.V__Varb_InstaKill_Enviroment", true);
			UltraReprise_Settings.V__Varb_Sandify_Idols = new BoolField(config.rootPanel, "Sandify Idols", "com.enragedone.ultrareprise.settings.V__Varb_Sandify_Idols", false);
			new ConfigHeader(config.rootPanel, "Deathcatcher Settings", 24).textColor = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)120, (byte)120, byte.MaxValue));
			UltraReprise_Settings.V__Varb_Deathcatchers_Ignore_NonKill_Idols = new BoolField(config.rootPanel, "Deathcatchers Ignore Non-Kill Idols", "com.enragedone.ultrareprise.settings.V__Varb_Deathcatchers_Ignore_NonKill_Idols", true);
			new ConfigHeader(config.rootPanel, "Radiance Settings", 24).textColor = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)215, (byte)0, byte.MaxValue));
			UltraReprise_Settings.V__Varb_Radiant_Idols = new BoolField(config.rootPanel, "Radiant Idols", "com.enragedone.ultrareprise.settings.V__Varb_Radiant_Idols", false);
			UltraReprise_Settings.V__Varb_Radiance_Extra_Tier = new FloatField(config.rootPanel, "Extra Radiance Tier on Death", "com.enragedone.ultrareprise.settings.V__Varb_Radiance_Extra_Tier", 0f);
			_Logger.LogInfo((object)"Config v1.0.3 loaded successfully");
			Confing_Loaded = true;
		}
		catch
		{
			_Logger.LogError((object)"UltraReprise_Loader v1.0.3 !!!---!!! ERROR With PluginConfigurator Init");
		}
		_Harmony.PatchAll(typeof(Base_Patches));
		_Logger.LogInfo((object)"UltraReprise_Loader v1.0.3 loaded successfully without error.");
	}
}
public static class Base_Patches
{
	public static EnemyType[] IgnoreEnemyForRadiance;

	[HarmonyPatch(typeof(Enemy), "GetHurt")]
	[HarmonyPrefix]
	public static bool Enemy_GetHurt(Vector3 force, float multiplier, float critMultiplier, EnemyIdentifier ___eid, Enemy __instance)
	{
		if (F_Utils.UltraCheck(___eid) || (UltraReprise_Settings.InstaKill_Enviroment && F_Utils.IgnoreKeys.Contains(___eid.hitter)))
		{
			return true;
		}
		UltraRepriseMarker ultraRepriseMarker = default(UltraRepriseMarker);
		if (__instance.health - F_Utils.CalculateDamage(multiplier, critMultiplier) < 0.15f && !((Component)__instance).TryGetComponent<UltraRepriseMarker>(ref ultraRepriseMarker))
		{
			F_Utils.UltraMethod(___eid);
			return false;
		}
		return true;
	}

	[HarmonyPatch(typeof(Enemy), "HandleParrying")]
	[HarmonyPostfix]
	public static void Enemy_HandleParrying(ref DamageData data, EnemyIdentifier ___eid, Enemy __instance)
	{
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		UltraRepriseMarker ultraRepriseMarker = default(UltraRepriseMarker);
		if (!F_Utils.UltraCheck(___eid) && (__instance.health <= 0.1f || __instance.parryable) && !((Component)__instance).TryGetComponent<UltraRepriseMarker>(ref ultraRepriseMarker))
		{
			__instance.health = Mathf.Max(__instance.health, 1f);
			data.damage = 0f;
			data.force = Vector3.zero;
			data.cancel = true;
			F_Utils.UltraMethod(___eid);
		}
	}

	[HarmonyPatch(typeof(EnemyScript), "OnParry")]
	[HarmonyPrefix]
	public static bool EnemyScript_OnParry(EnemyScript __instance)
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Invalid comparison between Unknown and I4
		EnemyIdentifier component = ((Component)__instance).GetComponent<EnemyIdentifier>();
		if (!Object.op_Implicit((Object)(object)component) || F_Utils.UltraCheck(component) || (int)component.enemyType == 6)
		{
			return true;
		}
		UltraRepriseMarker ultraRepriseMarker = default(UltraRepriseMarker);
		if (!((Component)__instance).TryGetComponent<UltraRepriseMarker>(ref ultraRepriseMarker))
		{
			F_Utils.UltraMethod(component);
			return false;
		}
		return true;
	}

	[HarmonyPatch(typeof(Streetcleaner), "HandleCanisterHit")]
	[HarmonyPrefix]
	public static bool Streetcleaner_HandleCanisterHit(EnemyIdentifier ___eid, Streetcleaner __instance)
	{
		if (F_Utils.UltraCheck(___eid))
		{
			return true;
		}
		UltraRepriseMarker ultraRepriseMarker = default(UltraRepriseMarker);
		if (!((Component)__instance).TryGetComponent<UltraRepriseMarker>(ref ultraRepriseMarker))
		{
			F_Utils.UltraMethod(___eid);
			return false;
		}
		return true;
	}

	[HarmonyPatch(typeof(EnemyIdentifier), "DeliverDamage")]
	[HarmonyPrefix]
	public static bool EnemyIdentifier_DeliverDamage(Vector3 force, float multiplier, int ___difficulty, EnemyIdentifier __instance)
	{
		if (F_Utils.UltraCheck(__instance) || (UltraReprise_Settings.InstaKill_Enviroment && F_Utils.IgnoreKeys.Contains(__instance.hitter)))
		{
			return true;
		}
		multiplier *= __instance.totalDamageTakenMultiplier;
		multiplier /= __instance.totalHealthModifier;
		if (__instance.isBoss && ___difficulty >= 4)
		{
			multiplier = ((___difficulty != 5) ? (multiplier / 1.5f) : (multiplier / 2f));
		}
		if (__instance.weaknesses.Length != 0)
		{
			for (int i = 0; i < __instance.weaknesses.Length; i++)
			{
				if (__instance.hitter == __instance.weaknesses[i] || (__instance.hitterAttributes.Contains((HitterAttribute)2) && __instance.weaknesses[i] == "electricity"))
				{
					multiplier *= __instance.weaknessMultipliers[i];
				}
			}
		}
		UltraRepriseMarker ultraRepriseMarker = default(UltraRepriseMarker);
		if (__instance.health - multiplier < 0.15f && !((Component)__instance).TryGetComponent<UltraRepriseMarker>(ref ultraRepriseMarker))
		{
			F_Utils.UltraMethod(__instance);
			return false;
		}
		return true;
	}

	[HarmonyPatch(typeof(EnemyIdentifier), "Splatter")]
	[HarmonyPrefix]
	public static bool EnemyIdentifier_Splatter(EnemyIdentifier __instance)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Invalid comparison between Unknown and I4
		if (F_Utils.UltraCheck(__instance) || (int)__instance.enemyType == 6 || (UltraReprise_Settings.InstaKill_Enviroment && F_Utils.IgnoreKeys.Contains(__instance.hitter)))
		{
			return true;
		}
		UltraRepriseMarker ultraRepriseMarker = default(UltraRepriseMarker);
		if (!((Component)__instance).TryGetComponent<UltraRepriseMarker>(ref ultraRepriseMarker))
		{
			F_Utils.UltraMethod(__instance);
			return false;
		}
		return true;
	}

	[HarmonyPatch(typeof(EnemyIdentifier), "Explode")]
	[HarmonyPrefix]
	public static bool EnemyIdentifier_Explode(EnemyIdentifier __instance)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Invalid comparison between Unknown and I4
		if (F_Utils.UltraCheck(__instance) || (int)__instance.enemyType == 6 || (UltraReprise_Settings.InstaKill_Enviroment && F_Utils.IgnoreKeys.Contains(__instance.hitter)))
		{
			return true;
		}
		UltraRepriseMarker ultraRepriseMarker = default(UltraRepriseMarker);
		if (!((Component)__instance).TryGetComponent<UltraRepriseMarker>(ref ultraRepriseMarker))
		{
			F_Utils.UltraMethod(__instance);
			return false;
		}
		return true;
	}

	[HarmonyPatch(typeof(EnemyIdentifier), "ProcessDeath")]
	[HarmonyPrefix]
	public static bool EnemyIdentifier_ProcessDeath(EnemyIdentifier __instance)
	{
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Invalid comparison between Unknown and I4
		if (F_Utils.UltraCheck(__instance) || (int)__instance.enemyType == 6 || (UltraReprise_Settings.InstaKill_Enviroment && F_Utils.IgnoreKeys.Contains(__instance.hitter)))
		{
			return true;
		}
		UltraRepriseMarker ultraRepriseMarker = default(UltraRepriseMarker);
		if (!((Component)__instance).TryGetComponent<UltraRepriseMarker>(ref ultraRepriseMarker))
		{
			F_Utils.UltraMethod(__instance);
			return false;
		}
		return true;
	}

	[HarmonyPatch(typeof(Deathcatcher), "EnemyDeath")]
	[HarmonyPrefix]
	public static bool Deathcatcher_EnemyDeath(EnemyIdentifier eid)
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Invalid comparison between Unknown and I4
		if ((Object)(object)eid == (Object)null)
		{
			return false;
		}
		if (UltraReprise_Settings.Deathcatchers_Ignore_NonKill_Idols && (int)eid.enemyType == 21 && eid.dontCountAsKills)
		{
			return false;
		}
		return true;
	}

	[HarmonyPatch(typeof(GoreZone), "EnemyDeath")]
	[HarmonyPrefix]
	public static bool GoreZone_EnemyDeath(EnemyIdentifier eid)
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Invalid comparison between Unknown and I4
		if ((Object)(object)eid == (Object)null)
		{
			return false;
		}
		if (UltraReprise_Settings.Deathcatchers_Ignore_NonKill_Idols && (int)eid.enemyType == 21 && eid.dontCountAsKills)
		{
			return false;
		}
		return true;
	}

	[HarmonyPatch(typeof(Idol), "Death")]
	[HarmonyPrefix]
	public static void Idol_Death(Idol __instance, EnemyIdentifier ___eid, bool ___dead)
	{
		//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)__instance == (Object)null || ___dead)
		{
			return;
		}
		EnemyIdentifier val = (((Object)(object)___eid != (Object)null) ? ___eid : ((Component)__instance).GetComponent<EnemyIdentifier>());
		if (!((Object)(object)val != (Object)null) || (!val.damageBuff && !val.speedBuff && !val.healthBuff && !(val.radianceTier > 1f)))
		{
			return;
		}
		float radiance_Extra_Tier = UltraReprise_Settings.Radiance_Extra_Tier;
		if (!(radiance_Extra_Tier <= 0f))
		{
			EnemyIdentifier val2 = (((Object)(object)__instance.target != (Object)null) ? __instance.target : __instance.overrideTarget);
			if ((Object)(object)val2 != (Object)null && !val2.dead && !IgnoreEnemyForRadiance.Contains(val2.enemyType))
			{
				val2.radianceTier += radiance_Extra_Tier;
				val2.BuffAll();
			}
		}
	}

	static Base_Patches()
	{
		EnemyType[] array = new EnemyType[8];
		RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
		IgnoreEnemyForRadiance = (EnemyType[])(object)array;
	}
}
public class UltraRepriseMarker : MonoBehaviour
{
}