Decompiled source of NullifyingElite v1.0.0

plugins/NullifyingElite/NullifyingElite.dll

Decompiled 11 hours ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HG.Reflection;
using Microsoft.CodeAnalysis;
using On.RoR2;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2BepInExPack.GameAssetPathsBetter;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: OptIn]
[assembly: NetworkCompatibility(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("NullifyingElite")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+c988079955e49d627ea90ee7f89be9a0c0585f20")]
[assembly: AssemblyProduct("NullifyingElite")]
[assembly: AssemblyTitle("NullifyingElite")]
[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 NullifyingElite
{
	public class AffixNullifying
	{
		public const string TokenPrefix = "NULLIFYINGELITE_";

		public static readonly Color32 EliteColor = new Color32((byte)230, (byte)230, byte.MaxValue, byte.MaxValue);

		private readonly HashSet<BuffIndex> protectedBuffs = new HashSet<BuffIndex>();

		private static readonly List<BuffIndex> buffsToNullify = new List<BuffIndex>();

		public static AffixNullifying Instance { get; private set; }

		public BuffDef BuffDef { get; private set; }

		public EquipmentDef EquipmentDef { get; private set; }

		public EliteDef EliteDef { get; private set; }

		public EliteDef HonorEliteDef { get; private set; }

		public Material OverlayMaterial { get; private set; }

		public GameObject NullifyEffect { get; private set; }

		public ConfigEntry<bool> StunImmunity { get; private set; }

		public void Init(ConfigFile config)
		{
			Instance = this;
			float value = config.Bind<float>("Stats", "Health Multiplier", 4f, "Health multiplier of Nullifying elites. Vanilla tier 1 elites use 4.").Value;
			float value2 = config.Bind<float>("Stats", "Damage Multiplier", 2f, "Damage multiplier of Nullifying elites. Vanilla tier 1 elites use 2.").Value;
			float value3 = config.Bind<float>("Stats", "Honor Health Multiplier", 2.5f, "Health multiplier of Nullifying elites spawned by Artifact of Honor. Vanilla uses 2.5.").Value;
			float value4 = config.Bind<float>("Stats", "Honor Damage Multiplier", 1.5f, "Damage multiplier of Nullifying elites spawned by Artifact of Honor. Vanilla uses 1.5.").Value;
			float value5 = config.Bind<float>("Aspect", "Drop Chance", 0.00025f, "Chance for a Nullifying elite to drop its aspect on death. Vanilla aspects use 0.00025 (1 in 4000).").Value;
			StunImmunity = config.Bind<bool>("Effects", "Stun Immunity", true, "Nullifying elites can't be stunned, frozen, shocked or immobilized.");
			LoadAssets();
			CreateLanguage();
			CreateBuff();
			CreateEquipment(value5);
			CreateElites(value, value2, value3, value4);
			Hooks();
		}

		private void LoadAssets()
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			AssetBundle assetBundle = Main.AssetBundle;
			if (Object.op_Implicit((Object)(object)assetBundle))
			{
				OverlayMaterial = assetBundle.LoadAsset<Material>("AffixPureOverlay.mat");
				if (Object.op_Implicit((Object)(object)OverlayMaterial))
				{
					OverlayMaterial.shader = Addressables.LoadAssetAsync<Shader>((object)RoR2_Base_Shaders.HGIntersectionCloudRemap_shader).WaitForCompletion();
					OverlayMaterial.EnableKeyword("USE_CLOUDS");
					OverlayMaterial.EnableKeyword("DISABLEREMAP");
				}
				NullifyEffect = assetBundle.LoadAsset<GameObject>("NullEffect.prefab");
				if (Object.op_Implicit((Object)(object)NullifyEffect))
				{
					EffectComponent obj = NullifyEffect.AddComponent<EffectComponent>();
					obj.positionAtReferencedTransform = true;
					obj.parentToReferencedTransform = false;
					obj.applyScale = false;
					obj.soundName = "";
					NullifyEffect.AddComponent<DestroyOnParticleEnd>();
					ContentAddition.AddEffect(NullifyEffect);
				}
			}
		}

		private void CreateLanguage()
		{
			LanguageAPI.Add("NULLIFYINGELITE_EQUIPMENT_AFFIX_NULLIFYING_NAME", "Purifying Light");
			LanguageAPI.Add("NULLIFYINGELITE_EQUIPMENT_AFFIX_NULLIFYING_PICKUP", "Become an aspect of purity.");
			LanguageAPI.Add("NULLIFYINGELITE_EQUIPMENT_AFFIX_NULLIFYING_DESC", "Become <style=cIsUtility>immune to debuffs</style> and <style=cIsDamage>damage over time</style>. Hitting an enemy <style=cIsUtility>nullifies all of their buffs</style>.");
			LanguageAPI.Add("NULLIFYINGELITE_EQUIPMENT_AFFIX_NULLIFYING_LORE", "");
			LanguageAPI.Add("NULLIFYINGELITE_ELITE_MODIFIER_NULLIFYING", "Nullifying {0}");
		}

		private void CreateBuff()
		{
			//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)
			BuffDef = ScriptableObject.CreateInstance<BuffDef>();
			((Object)BuffDef).name = "bdEliteNullifying";
			BuffDef.canStack = false;
			BuffDef.isDebuff = false;
			BuffDef.isCooldown = false;
			BuffDef.buffColor = Color.white;
			BuffDef.iconSprite = (Object.op_Implicit((Object)(object)Main.AssetBundle) ? Main.AssetBundle.LoadAsset<Sprite>("NullifyingBuffIcon.png") : null);
			ContentAddition.AddBuffDef(BuffDef);
		}

		private void CreateEquipment(float dropChance)
		{
			EquipmentDef = ScriptableObject.CreateInstance<EquipmentDef>();
			((Object)EquipmentDef).name = "EliteNullifyingEquipment";
			EquipmentDef.nameToken = "NULLIFYINGELITE_EQUIPMENT_AFFIX_NULLIFYING_NAME";
			EquipmentDef.pickupToken = "NULLIFYINGELITE_EQUIPMENT_AFFIX_NULLIFYING_PICKUP";
			EquipmentDef.descriptionToken = "NULLIFYINGELITE_EQUIPMENT_AFFIX_NULLIFYING_DESC";
			EquipmentDef.loreToken = "NULLIFYINGELITE_EQUIPMENT_AFFIX_NULLIFYING_LORE";
			EquipmentDef.pickupModelReference = new AssetReferenceT<GameObject>(RoR2_Base_Mystery.PickupMystery_prefab);
			EquipmentDef.pickupIconSpriteReference = new AssetReferenceT<Sprite>(RoR2_Base_Common_MiscIcons.texMysteryIcon_png);
			EquipmentDef.appearsInSinglePlayer = true;
			EquipmentDef.appearsInMultiPlayer = true;
			EquipmentDef.canDrop = false;
			EquipmentDef.canBeRandomlyTriggered = false;
			EquipmentDef.enigmaCompatible = false;
			EquipmentDef.isBoss = false;
			EquipmentDef.isLunar = false;
			EquipmentDef.cooldown = 60f;
			EquipmentDef.dropOnDeathChance = dropChance;
			EquipmentDef.passiveBuffDef = BuffDef;
			ContentAddition.AddEquipmentDef(EquipmentDef);
		}

		private void CreateElites(float health, float damage, float honorHealth, float honorDamage)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			EliteDef = CreateEliteDef("edNullifying", health, damage);
			EliteAPI.Add(new CustomElite(EliteDef, (IEnumerable<EliteTierDef>)ValidTiers(EliteAPI.GetEliteTierEnumerable((VanillaEliteTier)1))));
			HonorEliteDef = CreateEliteDef("edNullifyingHonor", honorHealth, honorDamage);
			EliteAPI.Add(new CustomElite(HonorEliteDef, (IEnumerable<EliteTierDef>)ValidTiers(EliteAPI.GetHonorEliteTierEnumerable((VanillaEliteTier)1))));
			BuffDef.eliteDef = EliteDef;
		}

		private EliteDef CreateEliteDef(string name, float health, float damage)
		{
			//IL_0024: 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)
			EliteDef obj = ScriptableObject.CreateInstance<EliteDef>();
			((Object)obj).name = name;
			obj.modifierToken = "NULLIFYINGELITE_ELITE_MODIFIER_NULLIFYING";
			obj.eliteEquipmentDef = EquipmentDef;
			obj.color = EliteColor;
			obj.shaderEliteRampIndex = -1;
			obj.healthBoostCoefficient = health;
			obj.damageBoostCoefficient = damage;
			return obj;
		}

		private static EliteTierDef[] ValidTiers(IEnumerable<EliteTierDef> tiers)
		{
			EliteTierDef[] array = tiers.Where((EliteTierDef tier) => tier != null).ToArray();
			if (array.Length == 0)
			{
				Log.Error("Could not find vanilla elite tiers, Nullifying elites will not spawn", "D:\\Games\\LostItems\\secretspeedelite\\thalassophobianullifyingelite\\NullifyingElite\\AffixNullifying.cs", "ValidTiers", 164);
			}
			return array;
		}

		private void Hooks()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Expected O, but got Unknown
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Expected O, but got Unknown
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Expected O, but got Unknown
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Expected O, but got Unknown
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Expected O, but got Unknown
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Expected O, but got Unknown
			((ResourceAvailability)(ref BuffCatalog.availability)).CallWhenAvailable((Action)delegate
			{
				//IL_000b: 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_0037: Unknown result type (might be due to invalid IL or missing references)
				protectedBuffs.Add(Buffs.Immune.buffIndex);
				protectedBuffs.Add(Buffs.HiddenInvincibility.buffIndex);
				protectedBuffs.Add(Buffs.Intangible.buffIndex);
			});
			CharacterBody.FixedUpdate += new hook_FixedUpdate(CharacterBody_FixedUpdate);
			CharacterBody.AddBuff_BuffIndex += new hook_AddBuff_BuffIndex(CharacterBody_AddBuff_BuffIndex);
			CharacterBody.AddTimedBuff_BuffDef_float += new hook_AddTimedBuff_BuffDef_float(CharacterBody_AddTimedBuff_BuffDef_float);
			CharacterBody.AddTimedBuff_BuffDef_float_int += new hook_AddTimedBuff_BuffDef_float_int(CharacterBody_AddTimedBuff_BuffDef_float_int);
			CharacterBody.AddTimedBuffDontRefreshDuration += new hook_AddTimedBuffDontRefreshDuration(CharacterBody_AddTimedBuffDontRefreshDuration);
			CharacterBody.AddTimedBuffInternal += new hook_AddTimedBuffInternal(CharacterBody_AddTimedBuffInternal);
			DotController.InflictDot_refInflictDotInfo += new hook_InflictDot_refInflictDotInfo(DotController_InflictDot);
			SetStateOnHurt.SetStun += new hook_SetStun(SetStateOnHurt_SetStun);
			SetStateOnHurt.SetFrozen += new hook_SetFrozen(SetStateOnHurt_SetFrozen);
			SetStateOnHurt.SetShock += new hook_SetShock(SetStateOnHurt_SetShock);
			SetStateOnHurt.SetImmobilize += new hook_SetImmobilize(SetStateOnHurt_SetImmobilize);
			GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt;
		}

		private void CharacterBody_FixedUpdate(orig_FixedUpdate orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (self.HasBuff(BuffDef) && !Object.op_Implicit((Object)(object)((Component)self).GetComponent<NullifyingEliteBehaviour>()))
			{
				((Component)self).gameObject.AddComponent<NullifyingEliteBehaviour>();
			}
		}

		private bool ShouldBlockDebuff(CharacterBody body, BuffDef buffDef)
		{
			if (NetworkServer.active && Object.op_Implicit((Object)(object)buffDef) && buffDef.isDebuff && Object.op_Implicit((Object)(object)body))
			{
				return body.HasBuff(BuffDef);
			}
			return false;
		}

		private void CharacterBody_AddBuff_BuffIndex(orig_AddBuff_BuffIndex orig, CharacterBody self, BuffIndex buffType)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			if (!ShouldBlockDebuff(self, BuffCatalog.GetBuffDef(buffType)))
			{
				orig.Invoke(self, buffType);
			}
		}

		private void CharacterBody_AddTimedBuff_BuffDef_float(orig_AddTimedBuff_BuffDef_float orig, CharacterBody self, BuffDef buffDef, float duration)
		{
			if (!ShouldBlockDebuff(self, buffDef))
			{
				orig.Invoke(self, buffDef, duration);
			}
		}

		private void CharacterBody_AddTimedBuff_BuffDef_float_int(orig_AddTimedBuff_BuffDef_float_int orig, CharacterBody self, BuffDef buffDef, float duration, int maxStacks)
		{
			if (!ShouldBlockDebuff(self, buffDef))
			{
				orig.Invoke(self, buffDef, duration, maxStacks);
			}
		}

		private void CharacterBody_AddTimedBuffDontRefreshDuration(orig_AddTimedBuffDontRefreshDuration orig, CharacterBody self, BuffDef buffDef, float duration, int maxStacks)
		{
			if (!ShouldBlockDebuff(self, buffDef))
			{
				orig.Invoke(self, buffDef, duration, maxStacks);
			}
		}

		private void CharacterBody_AddTimedBuffInternal(orig_AddTimedBuffInternal orig, CharacterBody self, BuffDef buffDef, float duration, float totalDurationOverride)
		{
			if (!ShouldBlockDebuff(self, buffDef))
			{
				orig.Invoke(self, buffDef, duration, totalDurationOverride);
			}
		}

		private void DotController_InflictDot(orig_InflictDot_refInflictDotInfo orig, ref InflictDotInfo inflictDotInfo)
		{
			if (NetworkServer.active && Object.op_Implicit((Object)(object)inflictDotInfo.victimObject))
			{
				CharacterBody component = inflictDotInfo.victimObject.GetComponent<CharacterBody>();
				if (Object.op_Implicit((Object)(object)component) && component.HasBuff(BuffDef))
				{
					return;
				}
			}
			orig.Invoke(ref inflictDotInfo);
		}

		private bool IsStunImmune(SetStateOnHurt setStateOnHurt)
		{
			if (!StunImmunity.Value)
			{
				return false;
			}
			CharacterBody component = ((Component)setStateOnHurt).GetComponent<CharacterBody>();
			if (Object.op_Implicit((Object)(object)component))
			{
				return component.HasBuff(BuffDef);
			}
			return false;
		}

		private void SetStateOnHurt_SetStun(orig_SetStun orig, SetStateOnHurt self, float duration)
		{
			if (!IsStunImmune(self))
			{
				orig.Invoke(self, duration);
			}
		}

		private void SetStateOnHurt_SetFrozen(orig_SetFrozen orig, SetStateOnHurt self, float duration)
		{
			if (!IsStunImmune(self))
			{
				orig.Invoke(self, duration);
			}
		}

		private void SetStateOnHurt_SetShock(orig_SetShock orig, SetStateOnHurt self, float duration)
		{
			if (!IsStunImmune(self))
			{
				orig.Invoke(self, duration);
			}
		}

		private void SetStateOnHurt_SetImmobilize(orig_SetImmobilize orig, SetStateOnHurt self, GameObject attacker, GameObject inflictor)
		{
			if (!IsStunImmune(self))
			{
				orig.Invoke(self, attacker, inflictor);
			}
		}

		private bool CanNullify(BuffDef buffDef)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)buffDef) && !buffDef.isDebuff && !buffDef.isCooldown && !buffDef.isHidden && !buffDef.isElite)
			{
				return !protectedBuffs.Contains(buffDef.buffIndex);
			}
			return false;
		}

		private void GlobalEventManager_onServerDamageDealt(DamageReport damageReport)
		{
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: 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)
			//IL_00b4: 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_00f0: 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_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Expected O, but got Unknown
			CharacterBody attackerBody = damageReport.attackerBody;
			CharacterBody victimBody = damageReport.victimBody;
			if (!Object.op_Implicit((Object)(object)attackerBody) || !Object.op_Implicit((Object)(object)victimBody) || (Object)(object)attackerBody == (Object)(object)victimBody || damageReport.damageInfo == null || damageReport.damageInfo.procCoefficient <= 0f || !attackerBody.HasBuff(BuffDef))
			{
				return;
			}
			buffsToNullify.Clear();
			for (int i = 0; i < victimBody.activeBuffsListCount; i++)
			{
				BuffIndex val = victimBody.activeBuffsList[i];
				if (CanNullify(BuffCatalog.GetBuffDef(val)))
				{
					buffsToNullify.Add(val);
				}
			}
			if (buffsToNullify.Count == 0)
			{
				return;
			}
			foreach (BuffIndex item in buffsToNullify)
			{
				victimBody.ClearTimedBuffs(item);
				victimBody.SetBuffCount(item, 0);
			}
			if (Object.op_Implicit((Object)(object)NullifyEffect))
			{
				EffectManager.SpawnEffect(NullifyEffect, new EffectData
				{
					origin = victimBody.corePosition,
					scale = victimBody.radius
				}, true);
			}
		}
	}
	public class NullifyingEliteBehaviour : MonoBehaviour
	{
		private const float CleanseInterval = 0.2f;

		private CharacterBody body;

		private TemporaryOverlayInstance overlay;

		private float cleanseTimer;

		private void Awake()
		{
			body = ((Component)this).GetComponent<CharacterBody>();
		}

		private void FixedUpdate()
		{
			AffixNullifying instance = AffixNullifying.Instance;
			if (!Object.op_Implicit((Object)(object)body) || !body.HasBuff(instance.BuffDef))
			{
				if (overlay != null)
				{
					overlay.CleanupEffect();
					overlay = null;
				}
				Object.Destroy((Object)(object)this);
				return;
			}
			if (overlay == null)
			{
				TryAddOverlay(instance.OverlayMaterial);
			}
			if (!NetworkServer.active)
			{
				return;
			}
			cleanseTimer -= Time.fixedDeltaTime;
			if (cleanseTimer <= 0f)
			{
				cleanseTimer = 0.2f;
				if (HasDebuff())
				{
					CleanseSystem.CleanseBodyServer(body, true, false, false, true, false, false);
				}
			}
		}

		private bool HasDebuff()
		{
			for (int i = 0; i < body.activeBuffsListCount; i++)
			{
				BuffDef buffDef = BuffCatalog.GetBuffDef(body.activeBuffsList[i]);
				if (Object.op_Implicit((Object)(object)buffDef) && buffDef.isDebuff)
				{
					return true;
				}
			}
			return false;
		}

		private void TryAddOverlay(Material material)
		{
			if (Object.op_Implicit((Object)(object)material) && Object.op_Implicit((Object)(object)body.modelLocator) && Object.op_Implicit((Object)(object)body.modelLocator.modelTransform))
			{
				CharacterModel component = ((Component)body.modelLocator.modelTransform).GetComponent<CharacterModel>();
				if (Object.op_Implicit((Object)(object)component))
				{
					overlay = TemporaryOverlayManager.AddOverlay(((Component)component).gameObject);
					overlay.duration = float.PositiveInfinity;
					overlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
					overlay.animateShaderAlpha = true;
					overlay.destroyComponentOnEnd = true;
					overlay.originalMaterial = material;
					overlay.AddToCharacterModel(component);
				}
			}
		}
	}
	internal static class Log
	{
		internal static ManualLogSource _logSource;

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

		private static string getLogPrefix(string callerPath, string callerMemberName, int callerLineNumber)
		{
			int num = callerPath.LastIndexOf("NullifyingElite");
			if (num >= 0)
			{
				callerPath = callerPath.Substring(num + "NullifyingElite".Length + 1);
			}
			return $"{callerPath}:{callerLineNumber} ({callerMemberName}) ";
		}

		internal static void Error(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1)
		{
			_logSource.LogError((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data));
		}

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

		internal static void Fatal(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1)
		{
			_logSource.LogFatal((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data));
		}

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

		internal static void Info(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1)
		{
			_logSource.LogInfo((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data));
		}

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

		internal static void Message(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1)
		{
			_logSource.LogMessage((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data));
		}

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

		internal static void Warning(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1)
		{
			_logSource.LogWarning((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data));
		}

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

		public const string PluginAuthor = "Phreel";

		public const string PluginName = "NullifyingElite";

		public const string PluginVersion = "1.0.0";

		internal static Main Instance { get; private set; }

		public static string PluginDirectory { get; private set; }

		public static AssetBundle AssetBundle { get; private set; }

		public void Awake()
		{
			Instance = this;
			Log.Init(((BaseUnityPlugin)this).Logger);
			PluginDirectory = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location);
			string text = Path.Combine(PluginDirectory, "nullifyingeliteassets");
			AssetBundle = AssetBundle.LoadFromFile(text);
			if (!Object.op_Implicit((Object)(object)AssetBundle))
			{
				Log.Error("Failed to load asset bundle at " + text + ", the elite will use fallback visuals", "D:\\Games\\LostItems\\secretspeedelite\\thalassophobianullifyingelite\\NullifyingElite\\Main.cs", "Awake", 37);
			}
			new AffixNullifying().Init(((BaseUnityPlugin)this).Config);
		}
	}
}