Decompiled source of Nemesis Spikestrip v1.0.4

NemesisSpikestrip.dll

Decompiled 7 months 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.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using GrooveSaladSpikestripContent;
using GrooveSaladSpikestripContent.Content;
using GrooveUnsharedUtils;
using HarmonyLib;
using IL.RoR2;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using NemesisSpikestrip.Changes;
using On.RoR2;
using On.RoR2.UI;
using PlasmaCoreSpikestripContent.Content.Elites;
using R2API;
using RoR2;
using TPDespair.ZetAspects;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;

[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.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("NemesisSpikestrip")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("NemesisSpikestrip")]
[assembly: AssemblyTitle("NemesisSpikestrip")]
[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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[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 NemesisSpikestrip
{
	[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("prodzpod.NemesisSpikestrip", "NemesisSpikestrip", "1.0.3")]
	public class Main : BaseUnityPlugin
	{
		public const string PluginGUID = "prodzpod.NemesisSpikestrip";

		public const string PluginAuthor = "prodzpod";

		public const string PluginName = "NemesisSpikestrip";

		public const string PluginVersion = "1.0.3";

		public static ManualLogSource Log;

		public static PluginInfo pluginInfo;

		public static Harmony Harmony;

		public static ConfigFile Config;

		public static Dictionary<string, string> SuperOverrides = new Dictionary<string, string>();

		public void Awake()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Expected O, but got Unknown
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			pluginInfo = ((BaseUnityPlugin)this).Info;
			Log = ((BaseUnityPlugin)this).Logger;
			Harmony = new Harmony("prodzpod.NemesisSpikestrip");
			Config = new ConfigFile(Path.Combine(Paths.ConfigPath, "prodzpod.NemesisSpikestrip.cfg"), true);
			Plated.Init();
			Warped.Init();
			Veiled.Init();
			Aragonite.Init();
			if (Chainloader.PluginInfos.ContainsKey("com.TPDespair.ZetAspects"))
			{
				Log.LogDebug((object)"ZetAspect compat loaded :3");
				Harmony.PatchAll(typeof(PatchSuperOverrides));
			}
		}

		public static bool IsEnabled(SpikestripContentBase initialContent)
		{
			BaseUnityPlugin instance = Chainloader.PluginInfos["com.groovesalad.GrooveSaladSpikestripContent"].Instance;
			Base val = (Base)(object)((instance is Base) ? instance : null);
			bool flag = initialContent.IsEnabled && ((((object)initialContent).GetType().Assembly == typeof(Base).Assembly) ? Main.SpikestripContentLegacyConfig.Bind<bool>("Legacy " + val.SafeForConfig(initialContent.ConfigSection), "Enable " + val.SafeForConfig(initialContent.ConfigName), false, "Enable/Disable : " + val.SafeForConfig(initialContent.ConfigName)).Value : Base.SpikestripContentConfig.Bind<bool>(val.SafeForConfig(initialContent.ConfigSection), "Enable " + val.SafeForConfig(initialContent.ConfigName), true, "Enable/Disable : " + val.SafeForConfig(initialContent.ConfigName)).Value);
			Log.LogDebug((object)(((object)initialContent).GetType().Name + ": " + (flag ? "Loaded" : "Disabled")));
			return flag;
		}
	}
	[HarmonyPatch(typeof(Language), "TextFragment")]
	public class PatchSuperOverrides
	{
		public static bool Prefix(string key, ref string __result)
		{
			if (Main.SuperOverrides.ContainsKey(key))
			{
				__result = Main.SuperOverrides[key];
				return false;
			}
			return true;
		}
	}
}
namespace NemesisSpikestrip.Changes
{
	public class Aragonite
	{
		[HarmonyPatch(typeof(RageAffixBuffBehaviourServer), "OnTakeDamageServer")]
		public class PatchIgnoreDrone
		{
			public static bool Prefix(DamageReport damageReport)
			{
				object obj;
				if (damageReport == null)
				{
					obj = null;
				}
				else
				{
					DamageInfo damageInfo = damageReport.damageInfo;
					if (damageInfo == null)
					{
						obj = null;
					}
					else
					{
						GameObject attacker = damageInfo.attacker;
						if (attacker == null)
						{
							obj = null;
						}
						else
						{
							CharacterBody component = attacker.GetComponent<CharacterBody>();
							if (component == null)
							{
								obj = null;
							}
							else
							{
								CharacterMaster master = component.master;
								if (master == null)
								{
									obj = null;
								}
								else
								{
									MinionOwnership minionOwnership = master.minionOwnership;
									obj = ((minionOwnership != null) ? minionOwnership.ownerMaster : null);
								}
							}
						}
					}
				}
				CharacterMaster val = (CharacterMaster)obj;
				return val == null || !Object.op_Implicit((Object)(object)val);
			}
		}

		[HarmonyPatch(typeof(RageAffixBuffBehaviourServer), "OnKilledServer")]
		public class PatchIgnoreDrone2
		{
			public static bool Prefix(DamageReport damageReport)
			{
				CharacterMaster attackerMaster = damageReport.attackerMaster;
				object obj;
				if (attackerMaster == null)
				{
					obj = null;
				}
				else
				{
					MinionOwnership minionOwnership = attackerMaster.minionOwnership;
					obj = ((minionOwnership != null) ? minionOwnership.ownerMaster : null);
				}
				CharacterMaster val = (CharacterMaster)obj;
				if (val != null && Object.op_Implicit((Object)(object)val))
				{
					return false;
				}
				return true;
			}
		}

		public static bool enabled;

		public static ConfigEntry<bool> IgnoreDrone;

		public static void Init()
		{
			enabled = Main.Config.Bind<bool>("Aragonite", "Enabled", true, "").Value;
			IgnoreDrone = Main.Config.Bind<bool>("Aragonite", "Ignore Followers", true, "Hitting followers such as drones does not trigger the special attack");
			LanguageAPI.AddOverlay("EQUIPMENT_AFFIX" + "Aragonite".ToUpper() + "_DESCRIPTION", "On hit, unleash a <style=cIsDamage>deadly wave</style> that deals <style=cIsDamage>500%</style> base damage.");
			if (enabled && Main.IsEnabled((SpikestripContentBase)(object)SpikestripContentBase<RagingElite>.instance))
			{
				LanguageAPI.AddOverlay("EQUIPMENT_AFFIXARAGONITE_NAME", "Anger from Below");
				Main.SuperOverrides.Add("AFFIX_ARAGONITE_NAME", "Anger from Below");
				if (IgnoreDrone.Value)
				{
					Main.Harmony.PatchAll(typeof(PatchIgnoreDrone));
					Main.Harmony.PatchAll(typeof(PatchIgnoreDrone2));
				}
			}
		}
	}
	public class Plated
	{
		[HarmonyPatch(typeof(PlatedAffixBuffBehaviour), "OnTakeDamageServer")]
		public class PatchHits
		{
			public static bool Prefix()
			{
				return false;
			}
		}

		[HarmonyPatch(typeof(PlatedAffixBuffBehaviour), "OnIncomingDamageServer")]
		public class PatchHits2
		{
			public static bool Prefix()
			{
				return false;
			}
		}

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

			public static hook_TakeDamage <>9__9_0;

			public static StatHookEventHandler <>9__9_1;

			public static hook_OnCharacterDeath <>9__9_2;

			public static StatHookEventHandler <>9__9_3;

			internal void <Init>b__9_0(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
			{
				//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_0068: Unknown result type (might be due to invalid IL or missing references)
				//IL_0073: Unknown result type (might be due to invalid IL or missing references)
				//IL_0075: 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_008e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0086: 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_009e: Expected O, but got Unknown
				//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
				CharacterBody val = self?.body;
				if (!damageInfo.rejected && damageInfo.procCoefficient > 0f && (Object)(object)val != (Object)null && val.HasBuff(((SpikestripEliteBase<PlatedElite>)(object)SpikestripContentBase<PlatedElite>.instance).AffixBuff))
				{
					if (val.HasBuff(Stack))
					{
						damageInfo.rejected = true;
						EffectData val2 = new EffectData
						{
							origin = damageInfo.position,
							rotation = Util.QuaternionSafeLookRotation((damageInfo.force != Vector3.zero) ? damageInfo.force : Random.onUnitSphere)
						};
						EffectManager.SpawnEffect(newPlatedBlockEffectPrefab, val2, true);
						val.AddBuff(Stack);
						if (val.GetBuffCount(Stack) >= Hits.Value)
						{
							val.SetBuffCount(Stack.buffIndex, 0);
						}
					}
					else
					{
						val.AddBuff(Stack);
					}
				}
				orig.Invoke(self, damageInfo);
			}

			internal void <Init>b__9_1(CharacterBody self, StatHookEventArgs args)
			{
				if (self.HasBuff(((SpikestripEliteBase<PlatedElite>)(object)SpikestripContentBase<PlatedElite>.instance).AffixBuff))
				{
					args.healthMultAdd += MaxHPPenalty.Value - 1f;
				}
			}

			internal void <Init>b__9_2(orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport damageReport)
			{
				//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)
				//IL_006b: 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_0072: 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_0082: Unknown result type (might be due to invalid IL or missing references)
				//IL_008e: 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_0099: Expected O, but got Unknown
				//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c1: 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)
				<>c__DisplayClass9_0 CS$<>8__locals0 = new <>c__DisplayClass9_0
				{
					damageReport = damageReport
				};
				orig.Invoke(self, CS$<>8__locals0.damageReport);
				CharacterBody victimBody = CS$<>8__locals0.damageReport.victimBody;
				if (victimBody == null || !victimBody.HasBuff(((SpikestripEliteBase<PlatedElite>)(object)SpikestripContentBase<PlatedElite>.instance).AffixBuff))
				{
					return;
				}
				SphereSearch val = new SphereSearch
				{
					radius = OnDeathRange.Value + CS$<>8__locals0.damageReport.victimBody.radius,
					queryTriggerInteraction = (QueryTriggerInteraction)1,
					mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask,
					origin = CS$<>8__locals0.damageReport.victimBody.corePosition
				};
				val.RefreshCandidates();
				val.FilterCandidatesByDistinctHurtBoxEntities();
				TeamMask val2 = default(TeamMask);
				((TeamMask)(ref val2)).AddTeam(CS$<>8__locals0.damageReport.victimBody.teamComponent.teamIndex);
				val.FilterCandidatesByHurtBoxTeam(val2);
				CollectionExtensions.Do<HurtBox>((IEnumerable<HurtBox>)val.GetHurtBoxes(), (Action<HurtBox>)delegate(HurtBox hurtBox)
				{
					if ((Object)(object)hurtBox?.healthComponent?.body != (Object)(object)CS$<>8__locals0.damageReport.victimBody && hurtBox != null)
					{
						HealthComponent healthComponent = hurtBox.healthComponent;
						if (healthComponent != null)
						{
							CharacterBody body = healthComponent.body;
							if (body != null)
							{
								body.AddBuff(OnDeath);
							}
						}
					}
				});
			}

			internal void <Init>b__9_3(CharacterBody self, StatHookEventArgs args)
			{
				if (self.HasBuff(OnDeath))
				{
					args.armorAdd += OnDeathArmor.Value;
				}
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass9_0
		{
			public DamageReport damageReport;

			internal void <Init>b__4(HurtBox hurtBox)
			{
				if (!((Object)(object)hurtBox?.healthComponent?.body != (Object)(object)damageReport.victimBody) || hurtBox == null)
				{
					return;
				}
				HealthComponent healthComponent = hurtBox.healthComponent;
				if (healthComponent != null)
				{
					CharacterBody body = healthComponent.body;
					if (body != null)
					{
						body.AddBuff(OnDeath);
					}
				}
			}
		}

		public static bool enabled;

		public static BuffDef Stack;

		public static BuffDef OnDeath;

		public static ConfigEntry<int> Hits;

		public static ConfigEntry<float> MaxHPPenalty;

		public static ConfigEntry<float> OnDeathRange;

		public static ConfigEntry<float> OnDeathArmor;

		public static ConfigEntry<float> OnDeathDuration;

		public static GameObject newPlatedBlockEffectPrefab;

		public static void Init()
		{
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: 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_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Expected O, but got Unknown
			//IL_0240: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Expected O, but got Unknown
			//IL_025f: 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_026a: Expected O, but got Unknown
			//IL_02e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_030e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0313: 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_02a8: Expected O, but got Unknown
			//IL_0337: Unknown result type (might be due to invalid IL or missing references)
			//IL_033c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0342: Expected O, but got Unknown
			//IL_035c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0361: Unknown result type (might be due to invalid IL or missing references)
			//IL_0367: Expected O, but got Unknown
			enabled = Main.Config.Bind<bool>("Plated", "Enabled", true, "").Value;
			Hits = Main.Config.Bind<int>("Plated", "Hits", 6, "Every n hit goes through immunity");
			MaxHPPenalty = Main.Config.Bind<float>("Plated", "HP Penalty", 0.2f, "multiplied to max hp");
			OnDeathRange = Main.Config.Bind<float>("Plated", "On Death Range", 13f, "in meters");
			OnDeathArmor = Main.Config.Bind<float>("Plated", "On Death Armor", 30f, "default: 1 ruckler");
			OnDeathDuration = Main.Config.Bind<float>("Plated", "On Death Duration", 8f, "in seconds");
			LanguageAPI.AddOverlay("EQUIPMENT_AFFIX" + "Plated".ToUpper() + "_DESCRIPTION", enabled ? $"All but every {Hits.Value} hit is mitigated. Attacks <style=cIsUtility>stifle</style> on hit for <style=cIsUtility>8s</style>, reducing damage dealt by <style=cIsUtility>100%</style> base damage per stack." : "Gain defensive plating that mitigates heavy damage. Attacks <style=cIsUtility>stifle</style> on hit for <style=cIsUtility>8s</style>, reducing damage dealt by <style=cIsUtility>100%</style> base damage per stack.");
			if (!enabled || !Main.IsEnabled((SpikestripContentBase)(object)SpikestripContentBase<PlatedElite>.instance))
			{
				return;
			}
			if (Hits.Value > 0)
			{
				Main.SuperOverrides.Add("PASSIVE_DEFENSE_PLATING", $"All but every {Hits.Value} hit is mitigated.");
				Stack = ScriptableObject.CreateInstance<BuffDef>();
				Stack.canStack = true;
				Stack.iconSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/texBuffGenericShield.tif").WaitForCompletion();
				Stack.buffColor = new Color(31f / 51f, 48f / 85f, 0.47843137f);
				ContentAddition.AddBuffDef(Stack);
				Main.Harmony.PatchAll(typeof(PatchHits));
				Main.Harmony.PatchAll(typeof(PatchHits2));
				HealthBar.UpdateHealthbar -= new hook_UpdateHealthbar(SpikestripContentBase<PlatedElite>.instance.HealthBar_UpdateHealthbar);
				newPlatedBlockEffectPrefab = PrefabAPI.InstantiateClone(PlatedElite.platedBlockEffectPrefab, "PlatingBlockEffect 2");
				newPlatedBlockEffectPrefab.GetComponent<EffectComponent>().soundName = "Play_item_proc_crowbar";
				SpikestripContentBase.effectDefContent.Add(new EffectDef(newPlatedBlockEffectPrefab));
				object obj = <>c.<>9__9_0;
				if (obj == null)
				{
					hook_TakeDamage val = delegate(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
					{
						//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_0068: Unknown result type (might be due to invalid IL or missing references)
						//IL_0073: Unknown result type (might be due to invalid IL or missing references)
						//IL_0075: 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_008e: Unknown result type (might be due to invalid IL or missing references)
						//IL_0086: 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_009e: Expected O, but got Unknown
						//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
						CharacterBody val7 = self?.body;
						if (!damageInfo.rejected && damageInfo.procCoefficient > 0f && (Object)(object)val7 != (Object)null && val7.HasBuff(((SpikestripEliteBase<PlatedElite>)(object)SpikestripContentBase<PlatedElite>.instance).AffixBuff))
						{
							if (val7.HasBuff(Stack))
							{
								damageInfo.rejected = true;
								EffectData val8 = new EffectData
								{
									origin = damageInfo.position,
									rotation = Util.QuaternionSafeLookRotation((damageInfo.force != Vector3.zero) ? damageInfo.force : Random.onUnitSphere)
								};
								EffectManager.SpawnEffect(newPlatedBlockEffectPrefab, val8, true);
								val7.AddBuff(Stack);
								if (val7.GetBuffCount(Stack) >= Hits.Value)
								{
									val7.SetBuffCount(Stack.buffIndex, 0);
								}
							}
							else
							{
								val7.AddBuff(Stack);
							}
						}
						orig.Invoke(self, damageInfo);
					};
					<>c.<>9__9_0 = val;
					obj = (object)val;
				}
				HealthComponent.TakeDamage += (hook_TakeDamage)obj;
			}
			if (MaxHPPenalty.Value != 1f)
			{
				object obj2 = <>c.<>9__9_1;
				if (obj2 == null)
				{
					StatHookEventHandler val2 = delegate(CharacterBody self, StatHookEventArgs args)
					{
						if (self.HasBuff(((SpikestripEliteBase<PlatedElite>)(object)SpikestripContentBase<PlatedElite>.instance).AffixBuff))
						{
							args.healthMultAdd += MaxHPPenalty.Value - 1f;
						}
					};
					<>c.<>9__9_1 = val2;
					obj2 = (object)val2;
				}
				RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj2;
			}
			if (!(OnDeathRange.Value > 0f))
			{
				return;
			}
			OnDeath = ScriptableObject.CreateInstance<BuffDef>();
			OnDeath.canStack = false;
			OnDeath.iconSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Junk/Common/texBuffBodyArmorIcon.tif").WaitForCompletion();
			OnDeath.buffColor = new Color(31f / 51f, 48f / 85f, 0.47843137f);
			ContentAddition.AddBuffDef(OnDeath);
			object obj3 = <>c.<>9__9_2;
			if (obj3 == null)
			{
				hook_OnCharacterDeath val3 = delegate(orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport damageReport)
				{
					//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)
					//IL_006b: 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_0072: 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_0082: Unknown result type (might be due to invalid IL or missing references)
					//IL_008e: 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_0099: Expected O, but got Unknown
					//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
					//IL_00c1: 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)
					orig.Invoke(self, damageReport);
					CharacterBody victimBody = damageReport.victimBody;
					if (victimBody != null && victimBody.HasBuff(((SpikestripEliteBase<PlatedElite>)(object)SpikestripContentBase<PlatedElite>.instance).AffixBuff))
					{
						SphereSearch val5 = new SphereSearch
						{
							radius = OnDeathRange.Value + damageReport.victimBody.radius,
							queryTriggerInteraction = (QueryTriggerInteraction)1,
							mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask,
							origin = damageReport.victimBody.corePosition
						};
						val5.RefreshCandidates();
						val5.FilterCandidatesByDistinctHurtBoxEntities();
						TeamMask val6 = default(TeamMask);
						((TeamMask)(ref val6)).AddTeam(damageReport.victimBody.teamComponent.teamIndex);
						val5.FilterCandidatesByHurtBoxTeam(val6);
						CollectionExtensions.Do<HurtBox>((IEnumerable<HurtBox>)val5.GetHurtBoxes(), (Action<HurtBox>)delegate(HurtBox hurtBox)
						{
							if ((Object)(object)hurtBox?.healthComponent?.body != (Object)(object)damageReport.victimBody && hurtBox != null)
							{
								HealthComponent healthComponent = hurtBox.healthComponent;
								if (healthComponent != null)
								{
									CharacterBody body = healthComponent.body;
									if (body != null)
									{
										body.AddBuff(OnDeath);
									}
								}
							}
						});
					}
				};
				<>c.<>9__9_2 = val3;
				obj3 = (object)val3;
			}
			GlobalEventManager.OnCharacterDeath += (hook_OnCharacterDeath)obj3;
			object obj4 = <>c.<>9__9_3;
			if (obj4 == null)
			{
				StatHookEventHandler val4 = delegate(CharacterBody self, StatHookEventArgs args)
				{
					if (self.HasBuff(OnDeath))
					{
						args.armorAdd += OnDeathArmor.Value;
					}
				};
				<>c.<>9__9_3 = val4;
				obj4 = (object)val4;
			}
			RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj4;
		}
	}
	public class Veiled
	{
		[HarmonyPatch(typeof(CharacterModel), "UpdateRendererMaterials")]
		public class PatchVisibility
		{
			public static void ILManipulator(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_0039: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdsfld<CharacterModel>(x, "cloakedMaterial")
				});
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Func<Material, CharacterModel, Material>>((Func<Material, CharacterModel, Material>)((Material mat, CharacterModel self) => self.body.HasBuff(((SpikestripEliteBase<CloakedElite>)(object)SpikestripContentBase<CloakedElite>.instance).AffixBuff) ? fakeCloakedMaterial : mat));
			}
		}

		[HarmonyPatch(typeof(CloakedElite), "GlobalEventManager_OnHitEnemy")]
		public class PatchCloak
		{
			public static bool Prefix(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim)
			{
				//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_0089: 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_00a0: 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_00aa: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c2: Expected O, but got Unknown
				orig.Invoke(self, damageInfo, victim);
				if (damageInfo.procCoefficient > 0f && Object.op_Implicit((Object)(object)damageInfo.attacker))
				{
					CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
					if (Object.op_Implicit((Object)(object)component) && !component.HasBuff(Buffs.Cloak) && component.HasBuff(((SpikestripEliteBase<CloakedElite>)(object)SpikestripContentBase<CloakedElite>.instance).AffixBuff))
					{
						component.AddBuff(Buffs.Cloak);
						EffectManager.SpawnEffect(CloakedElite.SmokebombEffect, new EffectData
						{
							origin = damageInfo.attacker.transform.position,
							rotation = damageInfo.attacker.transform.rotation,
							scale = component.bestFitRadius * 0.2f
						}, true);
					}
				}
				return false;
			}
		}

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

			public static Action<PoolEntry> <>9__6_7;

			public static Action<DccsPool, List<DirectorCardHolder>, StageInfo> <>9__6_0;

			public static hook_CanSelect <>9__6_1;

			public static hook_CalcHighestEliteCostMultiplier <>9__6_2;

			public static Func<EliteDef, bool> <>9__6_8;

			public static hook_ResetEliteType <>9__6_3;

			public static Func<Instruction, bool> <>9__6_9;

			public static Func<EliteDef, bool> <>9__6_11;

			public static Func<EliteDef, CombatDirector, EliteDef> <>9__6_10;

			public static Manipulator <>9__6_4;

			public static hook_OnHitEnemy <>9__6_5;

			public static hook_RemoveBuff_BuffIndex <>9__6_6;

			internal void <Init>b__6_0(DccsPool dccsPool, List<DirectorCardHolder> mixEnemyArtifactMonsters, StageInfo currentStage)
			{
				if (!Object.op_Implicit((Object)(object)dccsPool))
				{
					return;
				}
				Helpers.ForEachPoolEntryInDccsPool(dccsPool, (Action<PoolEntry>)delegate(PoolEntry poolEntry)
				{
					//IL_0014: 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_001b: 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_005a: Unknown result type (might be due to invalid IL or missing references)
					Category[] categories = poolEntry.dccs.categories;
					foreach (Category val in categories)
					{
						DirectorCard[] cards = val.cards;
						foreach (DirectorCard val2 in cards)
						{
							if (((Object)val2.spawnCard).name.Contains("Assassin2"))
							{
								((SpawnCard)(CharacterSpawnCard)val2.spawnCard).eliteRules = (EliteRules)339001;
							}
						}
					}
				});
			}

			internal void <Init>b__6_7(PoolEntry poolEntry)
			{
				//IL_0014: 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_001b: 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_005a: Unknown result type (might be due to invalid IL or missing references)
				Category[] categories = poolEntry.dccs.categories;
				foreach (Category val in categories)
				{
					DirectorCard[] cards = val.cards;
					foreach (DirectorCard val2 in cards)
					{
						if (((Object)val2.spawnCard).name.Contains("Assassin2"))
						{
							((SpawnCard)(CharacterSpawnCard)val2.spawnCard).eliteRules = (EliteRules)339001;
						}
					}
				}
			}

			internal bool <Init>b__6_1(orig_CanSelect orig, EliteTierDef self, EliteRules rules)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Invalid comparison between Unknown and I4
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				if ((int)rules == 339001)
				{
					return orig.Invoke(self, (EliteRules)0);
				}
				return orig.Invoke(self, rules);
			}

			internal float <Init>b__6_2(orig_CalcHighestEliteCostMultiplier orig, EliteRules rules)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Invalid comparison between Unknown and I4
				//IL_0018: Unknown result type (might be due to invalid IL or missing references)
				if ((int)rules == 339001)
				{
					return orig.Invoke((EliteRules)0);
				}
				return orig.Invoke(rules);
			}

			internal void <Init>b__6_3(orig_ResetEliteType orig, CombatDirector self)
			{
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Invalid comparison between Unknown and I4
				orig.Invoke(self);
				if ((int)self.currentMonsterCard.spawnCard.eliteRules == 339001)
				{
					self.currentActiveEliteDef = self.rng.NextElementUniform<EliteDef>(self.currentActiveEliteTier.eliteTypes.Where((EliteDef x) => (Object)(object)x != (Object)null && x.IsAvailable() && !((Object)x).name.Contains("Cloaked")).ToList());
				}
			}

			internal bool <Init>b__6_8(EliteDef x)
			{
				return (Object)(object)x != (Object)null && x.IsAvailable() && !((Object)x).name.Contains("Cloaked");
			}

			internal void <Init>b__6_4(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_0038: 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.MatchStfld<CombatDirector>(x, "currentActiveEliteDef")
				});
				val.Emit(OpCodes.Ldarg_0);
				val.EmitDelegate<Func<EliteDef, CombatDirector, EliteDef>>((Func<EliteDef, CombatDirector, EliteDef>)((EliteDef orig, CombatDirector self) => ((int)self.currentMonsterCard.spawnCard.eliteRules == 339001) ? self.rng.NextElementUniform<EliteDef>(self.currentActiveEliteTier.eliteTypes.Where((EliteDef x) => (Object)(object)x != (Object)null && x.IsAvailable() && !((Object)x).name.Contains("Cloaked")).ToList()) : orig));
			}

			internal bool <Init>b__6_9(Instruction x)
			{
				return ILPatternMatchingExt.MatchStfld<CombatDirector>(x, "currentActiveEliteDef");
			}

			internal EliteDef <Init>b__6_10(EliteDef orig, CombatDirector self)
			{
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Invalid comparison between Unknown and I4
				if ((int)self.currentMonsterCard.spawnCard.eliteRules == 339001)
				{
					return self.rng.NextElementUniform<EliteDef>(self.currentActiveEliteTier.eliteTypes.Where((EliteDef x) => (Object)(object)x != (Object)null && x.IsAvailable() && !((Object)x).name.Contains("Cloaked")).ToList());
				}
				return orig;
			}

			internal bool <Init>b__6_11(EliteDef x)
			{
				return (Object)(object)x != (Object)null && x.IsAvailable() && !((Object)x).name.Contains("Cloaked");
			}

			internal void <Init>b__6_5(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject _victim)
			{
				//IL_003d: Unknown result type (might be due to invalid IL or missing references)
				CharacterBody component = _victim.GetComponent<CharacterBody>();
				if ((Object)(object)component != (Object)null && component.HasBuff(((SpikestripEliteBase<CloakedElite>)(object)SpikestripContentBase<CloakedElite>.instance).AffixBuff) && component.HasBuff(Buffs.Cloak))
				{
					component.SetBuffCount(Buffs.Cloak.buffIndex, 0);
					component.AddTimedBuff(Cooldown, VisibleTime.Value);
				}
				orig.Invoke(self, damageInfo, _victim);
			}

			internal void <Init>b__6_6(orig_RemoveBuff_BuffIndex orig, CharacterBody self, BuffIndex idx)
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0072: 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_0033: 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_0045: 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_0051: 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_006e: Expected O, but got Unknown
				if (NetworkServer.active && idx == Cooldown.buffIndex)
				{
					self.AddBuff(Buffs.Cloak);
					EffectManager.SpawnEffect(CloakedElite.SmokebombEffect, new EffectData
					{
						origin = self.transform.position,
						rotation = self.transform.rotation,
						scale = self.bestFitRadius * 0.2f
					}, true);
				}
				orig.Invoke(self, idx);
			}
		}

		public static bool enabled;

		public static Material fakeCloakedMaterial;

		public static BuffDef Cooldown;

		public static ConfigEntry<bool> BetterVisibility;

		public static ConfigEntry<bool> HitToShow;

		public static ConfigEntry<float> VisibleTime;

		public static void Init()
		{
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Expected O, but got Unknown
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Expected O, but got Unknown
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Expected O, but got Unknown
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Expected O, but got Unknown
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: 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_021d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0264: Expected O, but got Unknown
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0283: Unknown result type (might be due to invalid IL or missing references)
			//IL_0289: Expected O, but got Unknown
			enabled = Main.Config.Bind<bool>("Veiled", "Enabled", true, "").Value;
			BetterVisibility = Main.Config.Bind<bool>("Veiled", "Better Visibility", true, "make cloaked enemies easier to spot");
			HitToShow = Main.Config.Bind<bool>("Veiled", "Hit to Show Enemy", true, "hit enemy to make it visible");
			VisibleTime = Main.Config.Bind<float>("Veiled", "Duration", 4f, "in seconds");
			LanguageAPI.AddOverlay("EQUIPMENT_AFFIX" + "Veiled".ToUpper() + "_DESCRIPTION", enabled ? "You are <style=cIsUtility>cloaked</style>. Getting hit makes you decloak." : "Attacks <style=cIsUtility>cloak</style> you on hit.");
			if (!enabled || !Main.IsEnabled((SpikestripContentBase)(object)SpikestripContentBase<CloakedElite>.instance))
			{
				return;
			}
			DirectorAPI.MonsterActions += delegate(DccsPool dccsPool, List<DirectorCardHolder> mixEnemyArtifactMonsters, StageInfo currentStage)
			{
				if (Object.op_Implicit((Object)(object)dccsPool))
				{
					Helpers.ForEachPoolEntryInDccsPool(dccsPool, (Action<PoolEntry>)delegate(PoolEntry poolEntry)
					{
						//IL_0014: 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_001b: 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_005a: Unknown result type (might be due to invalid IL or missing references)
						Category[] categories = poolEntry.dccs.categories;
						foreach (Category val8 in categories)
						{
							DirectorCard[] cards = val8.cards;
							foreach (DirectorCard val9 in cards)
							{
								if (((Object)val9.spawnCard).name.Contains("Assassin2"))
								{
									((SpawnCard)(CharacterSpawnCard)val9.spawnCard).eliteRules = (EliteRules)339001;
								}
							}
						}
					});
				}
			};
			object obj = <>c.<>9__6_1;
			if (obj == null)
			{
				hook_CanSelect val = (orig_CanSelect orig, EliteTierDef self, EliteRules rules) => ((int)rules == 339001) ? orig.Invoke(self, (EliteRules)0) : orig.Invoke(self, rules);
				<>c.<>9__6_1 = val;
				obj = (object)val;
			}
			EliteTierDef.CanSelect += (hook_CanSelect)obj;
			object obj2 = <>c.<>9__6_2;
			if (obj2 == null)
			{
				hook_CalcHighestEliteCostMultiplier val2 = (orig_CalcHighestEliteCostMultiplier orig, EliteRules rules) => ((int)rules == 339001) ? orig.Invoke((EliteRules)0) : orig.Invoke(rules);
				<>c.<>9__6_2 = val2;
				obj2 = (object)val2;
			}
			CombatDirector.CalcHighestEliteCostMultiplier += (hook_CalcHighestEliteCostMultiplier)obj2;
			object obj3 = <>c.<>9__6_3;
			if (obj3 == null)
			{
				hook_ResetEliteType val3 = delegate(orig_ResetEliteType orig, CombatDirector self)
				{
					//IL_0014: Unknown result type (might be due to invalid IL or missing references)
					//IL_001e: Invalid comparison between Unknown and I4
					orig.Invoke(self);
					if ((int)self.currentMonsterCard.spawnCard.eliteRules == 339001)
					{
						self.currentActiveEliteDef = self.rng.NextElementUniform<EliteDef>(self.currentActiveEliteTier.eliteTypes.Where((EliteDef x) => (Object)(object)x != (Object)null && x.IsAvailable() && !((Object)x).name.Contains("Cloaked")).ToList());
					}
				};
				<>c.<>9__6_3 = val3;
				obj3 = (object)val3;
			}
			CombatDirector.ResetEliteType += (hook_ResetEliteType)obj3;
			object obj4 = <>c.<>9__6_4;
			if (obj4 == null)
			{
				Manipulator val4 = delegate(ILContext il)
				{
					//IL_0002: Unknown result type (might be due to invalid IL or missing references)
					//IL_0008: Expected O, but got Unknown
					//IL_0038: Unknown result type (might be due to invalid IL or missing references)
					ILCursor val7 = new ILCursor(il);
					val7.GotoNext(new Func<Instruction, bool>[1]
					{
						(Instruction x) => ILPatternMatchingExt.MatchStfld<CombatDirector>(x, "currentActiveEliteDef")
					});
					val7.Emit(OpCodes.Ldarg_0);
					val7.EmitDelegate<Func<EliteDef, CombatDirector, EliteDef>>((Func<EliteDef, CombatDirector, EliteDef>)((EliteDef orig, CombatDirector self) => ((int)self.currentMonsterCard.spawnCard.eliteRules == 339001) ? self.rng.NextElementUniform<EliteDef>(self.currentActiveEliteTier.eliteTypes.Where((EliteDef x) => (Object)(object)x != (Object)null && x.IsAvailable() && !((Object)x).name.Contains("Cloaked")).ToList()) : orig));
				};
				<>c.<>9__6_4 = val4;
				obj4 = (object)val4;
			}
			CombatDirector.PrepareNewMonsterWave += (Manipulator)obj4;
			if (BetterVisibility.Value)
			{
				fakeCloakedMaterial = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/matCloakedEffect.mat").WaitForCompletion());
				fakeCloakedMaterial.SetFloat("_Magnitude", 2.5f);
				Main.Harmony.PatchAll(typeof(PatchVisibility));
			}
			if (!HitToShow.Value)
			{
				return;
			}
			Cooldown = ScriptableObject.CreateInstance<BuffDef>();
			Cooldown.isCooldown = true;
			Cooldown.iconSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/texBuffCloakIcon.tif").WaitForCompletion();
			Cooldown.buffColor = Color.gray;
			ContentAddition.AddBuffDef(Cooldown);
			object obj5 = <>c.<>9__6_5;
			if (obj5 == null)
			{
				hook_OnHitEnemy val5 = delegate(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject _victim)
				{
					//IL_003d: Unknown result type (might be due to invalid IL or missing references)
					CharacterBody component = _victim.GetComponent<CharacterBody>();
					if ((Object)(object)component != (Object)null && component.HasBuff(((SpikestripEliteBase<CloakedElite>)(object)SpikestripContentBase<CloakedElite>.instance).AffixBuff) && component.HasBuff(Buffs.Cloak))
					{
						component.SetBuffCount(Buffs.Cloak.buffIndex, 0);
						component.AddTimedBuff(Cooldown, VisibleTime.Value);
					}
					orig.Invoke(self, damageInfo, _victim);
				};
				<>c.<>9__6_5 = val5;
				obj5 = (object)val5;
			}
			GlobalEventManager.OnHitEnemy += (hook_OnHitEnemy)obj5;
			object obj6 = <>c.<>9__6_6;
			if (obj6 == null)
			{
				hook_RemoveBuff_BuffIndex val6 = delegate(orig_RemoveBuff_BuffIndex orig, CharacterBody self, BuffIndex idx)
				{
					//IL_0008: Unknown result type (might be due to invalid IL or missing references)
					//IL_000e: Unknown result type (might be due to invalid IL or missing references)
					//IL_0072: 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_0033: 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_0045: 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_0051: 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_006e: Expected O, but got Unknown
					if (NetworkServer.active && idx == Cooldown.buffIndex)
					{
						self.AddBuff(Buffs.Cloak);
						EffectManager.SpawnEffect(CloakedElite.SmokebombEffect, new EffectData
						{
							origin = self.transform.position,
							rotation = self.transform.rotation,
							scale = self.bestFitRadius * 0.2f
						}, true);
					}
					orig.Invoke(self, idx);
				};
				<>c.<>9__6_6 = val6;
				obj6 = (object)val6;
			}
			CharacterBody.RemoveBuff_BuffIndex += (hook_RemoveBuff_BuffIndex)obj6;
			Main.Harmony.PatchAll(typeof(PatchCloak));
		}
	}
	public class Warped
	{
		[HarmonyPatch(typeof(WarpedElite), "OnHitEnemyServer")]
		public class PatchDuration
		{
			public static void ILManipulator(ILContext il)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_0039: Unknown result type (might be due to invalid IL or missing references)
				ILCursor val = new ILCursor(il);
				val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
				{
					(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 4f)
				});
				val.Emit(OpCodes.Pop);
				val.EmitDelegate<Func<float>>((Func<float>)(() => Duration.Value));
			}
		}

		[HarmonyPatch(typeof(GravityBuffBehaviour), "ServerFixedUpdate")]
		public class PatchBreakout
		{
			public static void Postfix(GravityBuffBehaviour __instance)
			{
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				//IL_001c: 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)
				//IL_0032: 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)
				//IL_004e: 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)
				//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c7: 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)
				HealthComponent healthComponent = ((ItemBehavior)__instance).body.healthComponent;
				if (healthComponent != null)
				{
					healthComponent.TakeDamageForce(Vector3.up * Time.fixedDeltaTime * (0f - ((ItemBehavior)__instance).body.corePosition.y), false, false);
				}
				Vector3 val = ((ItemBehavior)__instance).body.characterMotor?.velocity ?? Vector3.zero;
				TimedBuff val2 = ((ItemBehavior)__instance).body.timedBuffs.Find((TimedBuff x) => x.buffIndex == WarpedElite.gravityBuff.buffIndex);
				if (val2 != null && val2.timer > 0f)
				{
					val2.timer -= Time.fixedDeltaTime * BreakoutCoefficient.Value / Mathf.Sqrt(val.x * val.x + val.z * val.z + 1f);
					if (val2.timer < 0f)
					{
						((ItemBehavior)__instance).body.timedBuffs.Remove(val2);
						((ItemBehavior)__instance).body.RemoveBuff(WarpedElite.gravityBuff);
					}
				}
			}
		}

		public static bool enabled;

		public static ConfigEntry<float> Duration;

		public static ConfigEntry<float> BreakoutCoefficient;

		public static void Init()
		{
			enabled = Main.Config.Bind<bool>("Warped", "Enabled", true, "").Value;
			Duration = Main.Config.Bind<float>("Warped", "Duration", 4f, "in seconds");
			BreakoutCoefficient = Main.Config.Bind<float>("Warped", "Breakout Coefficient", 5f, "1 = 100% faster when standing completely still, hyperbolic");
			LanguageAPI.AddOverlay("EQUIPMENT_AFFIX" + "Warped".ToUpper() + "_DESCRIPTION", enabled ? $"Attacks <style=cIsUtility>levitate</style> on hit for <style=cIsUtility>{Duration.Value / BreakoutCoefficient.Value}s</style> or more." : "Attacks <style=cIsUtility>levitate</style> on hit for <style=cIsUtility>4s</style>.");
			if (enabled && Main.IsEnabled((SpikestripContentBase)(object)SpikestripContentBase<WarpedElite>.instance))
			{
				if (Duration.Value != 4f)
				{
					Main.Harmony.PatchAll(typeof(PatchDuration));
				}
				if (BreakoutCoefficient.Value > 0f)
				{
					Main.Harmony.PatchAll(typeof(PatchBreakout));
				}
			}
		}
	}
}