Decompiled source of ArtifactOfConsole v1.1.1

ArtifactOfConsole.dll

Decompiled 3 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using ArtifactOfConsole.Artifact;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.Croco;
using EntityStates.GravekeeperBoss;
using EntityStates.Loader;
using EntityStates.Toolbot;
using IL.EntityStates.Croco;
using IL.EntityStates.Toolbot;
using IL.RoR2;
using KinematicCharacterController;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.EntityStates.Croco;
using On.EntityStates.GravekeeperBoss;
using On.EntityStates.Loader;
using On.EntityStates.Toolbot;
using On.RoR2;
using On.RoR2.Items;
using On.RoR2.Projectile;
using On.RoR2.UI;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.CharacterAI;
using RoR2.ConVar;
using RoR2.ExpansionManagement;
using RoR2.Items;
using RoR2.Networking;
using RoR2.Projectile;
using RoR2.UI;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Diagnostics;
using UnityEngine.Networking;
using UnityEngine.SceneManagement;

[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("ArtifactOfConsole")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ArtifactOfConsole")]
[assembly: AssemblyTitle("ArtifactOfConsole")]
[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.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace ArtifactOfConsole
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("HIFU.ArtifactOfConsole", "ArtifactOfConsole", "1.1.0")]
	public class Main : BaseUnityPlugin
	{
		public const string PluginGUID = "HIFU.ArtifactOfConsole";

		public const string PluginAuthor = "HIFU";

		public const string PluginName = "ArtifactOfConsole";

		public const string PluginVersion = "1.1.0";

		public static AssetBundle artifactofconsole;

		public static ManualLogSource ACLogger;

		public void Awake()
		{
			ACLogger = ((BaseUnityPlugin)this).Logger;
			artifactofconsole = AssetBundle.LoadFromFile(Assembly.GetExecutingAssembly().Location.Replace("ArtifactOfConsole.dll", "artifactofconsole"));
			IEnumerable<Type> enumerable = from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(ArtifactBase))
				select type;
			foreach (Type item in enumerable)
			{
				ArtifactBase artifactBase = (ArtifactBase)Activator.CreateInstance(item);
				artifactBase.Init(((BaseUnityPlugin)this).Config);
			}
		}
	}
}
namespace ArtifactOfConsole.Artifact
{
	public abstract class ArtifactBase<T> : ArtifactBase where T : ArtifactBase<T>
	{
		public static T Instance { get; private set; }

		public ArtifactBase()
		{
			if (Instance != null)
			{
				throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ArtifactBase was instantiated twice");
			}
			Instance = this as T;
		}
	}
	public abstract class ArtifactBase
	{
		public ArtifactDef ArtifactDef;

		public abstract string ArtifactName { get; }

		public abstract string ArtifactLangTokenName { get; }

		public abstract string ArtifactDescription { get; }

		public abstract Sprite ArtifactEnabledIcon { get; }

		public abstract Sprite ArtifactDisabledIcon { get; }

		public bool ArtifactEnabled => Object.op_Implicit((Object)(object)Run.instance) && RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef);

		public abstract void Init(ConfigFile config);

		protected void CreateLang()
		{
			LanguageAPI.Add("ARTIFACT_" + ArtifactLangTokenName + "_NAME", ArtifactName);
			LanguageAPI.Add("ARTIFACT_" + ArtifactLangTokenName + "_DESCRIPTION", ArtifactDescription);
		}

		protected void CreateArtifact()
		{
			ArtifactDef = ScriptableObject.CreateInstance<ArtifactDef>();
			ArtifactDef.cachedName = "ARTIFACT_" + ArtifactLangTokenName;
			ArtifactDef.nameToken = "ARTIFACT_" + ArtifactLangTokenName + "_NAME";
			ArtifactDef.descriptionToken = "ARTIFACT_" + ArtifactLangTokenName + "_DESCRIPTION";
			ArtifactDef.smallIconSelectedSprite = ArtifactEnabledIcon;
			ArtifactDef.smallIconDeselectedSprite = ArtifactDisabledIcon;
			ContentAddition.AddArtifactDef(ArtifactDef);
		}

		public abstract void Hooks();
	}
	internal class ArtifactOfConsole : ArtifactBase<ArtifactOfConsole>
	{
		public static OldCleansingPoolDropTable oldCleansingPoolDropTable;

		public static BuffDef oldPowerMode;

		public static float textTimer = 0f;

		public static float textInterval = 0.6f;

		public override string ArtifactName => "Artifact of Console";

		public override string ArtifactLangTokenName => "HIFU_ArtifactOfConsole";

		public override string ArtifactDescription => "Experience a bunch of Risk of Rain 2 Console Edition bugs.";

		public override Sprite ArtifactEnabledIcon => Main.artifactofconsole.LoadAsset<Sprite>("texArtifactOfConsoleOn");

		public override Sprite ArtifactDisabledIcon => Main.artifactofconsole.LoadAsset<Sprite>("texArtifactOfConsoleOff");

		public override void Init(ConfigFile config)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			Texture2D val = Addressables.LoadAssetAsync<Texture2D>((object)"RoR2/Base/Common/texBuffGenericShield.tif").WaitForCompletion();
			oldCleansingPoolDropTable = ScriptableObject.CreateInstance<OldCleansingPoolDropTable>();
			oldPowerMode = ScriptableObject.CreateInstance<BuffDef>();
			oldPowerMode.isDebuff = false;
			oldPowerMode.isHidden = false;
			oldPowerMode.canStack = false;
			oldPowerMode.buffColor = Color32.op_Implicit(new Color32((byte)214, (byte)201, (byte)58, byte.MaxValue));
			oldPowerMode.iconSprite = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0f, 0f));
			CreateLang();
			CreateArtifact();
			Hooks();
		}

		public override void Hooks()
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: 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_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Expected O, but got Unknown
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Expected O, but got Unknown
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Expected O, but got Unknown
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Expected O, but got Unknown
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Expected O, but got Unknown
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Expected O, but got Unknown
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Expected O, but got Unknown
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Expected O, but got Unknown
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Expected O, but got Unknown
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Expected O, but got Unknown
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Expected O, but got Unknown
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Expected O, but got Unknown
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Expected O, but got Unknown
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Expected O, but got Unknown
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Expected O, but got Unknown
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Expected O, but got Unknown
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Expected O, but got Unknown
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Expected O, but got Unknown
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Expected O, but got Unknown
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Expected O, but got Unknown
			//IL_0224: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Expected O, but got Unknown
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_0240: Expected O, but got Unknown
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Expected O, but got Unknown
			//IL_026c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0276: Expected O, but got Unknown
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0288: Expected O, but got Unknown
			//IL_0290: Unknown result type (might be due to invalid IL or missing references)
			//IL_029a: Expected O, but got Unknown
			//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ac: Expected O, but got Unknown
			//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02be: Expected O, but got Unknown
			CharacterBody.onBodyStartGlobal += RemoveOSPMakeBrassCancer;
			CharacterMaster.onStartGlobal += ClingyDronesAndInvincibleUmbrae;
			Bite.OnMeleeHitAuthority += new Manipulator(RemoveM2Healing);
			Slash.OnMeleeHitAuthority += new Manipulator(RemoveM1Healing);
			ToolbotDashImpact.OnEnter += new Manipulator(ToolbotDashImpact_OnEnter);
			CharacterBody.RecalculateStats += new Manipulator(ChangeTriTipChance);
			CharacterBody.UpdateFireTrail += new Manipulator(IncreaseFireTrailDamage);
			GlobalEventManager.OnHitEnemy += new Manipulator(RemoveBandsOnHitChangeDeathMarkDebuffsRequirement);
			HealthComponent.Heal += new Manipulator(RemoveAegisAndRejuvRack);
			HealthComponent.TakeDamage += new Manipulator(NoFocusCrystalColorNerfedCrowbarNoPlanula);
			BaseLeap.OnEnter += new hook_OnEnter(HighSpeedLeap);
			DamageDisplay.DoUpdate += new hook_DoUpdate(RemoveDamageNumbersLateGame);
			DamageInfo.ModifyDamageInfo += new hook_ModifyDamageInfo(RandomNoDamageOnHit);
			GlobalEventManager.OnHitAll += new hook_OnHitAll(OverloadingTwoOrbs);
			HealthComponent.Awake += new hook_Awake(HealthComponent_Awake);
			HealthComponent.TakeDamageForce_DamageInfo_bool_bool += new hook_TakeDamageForce_DamageInfo_bool_bool(IncreasedKnockback);
			HealthComponent.TakeDamageForce_Vector3_bool_bool += new hook_TakeDamageForce_Vector3_bool_bool(IncreasedKnockback2);
			NearbyDamageBonusBodyBehavior.OnEnable += new hook_OnEnable(NoFocusCrystalVFX);
			Run.IsExpansionEnabled += new hook_IsExpansionEnabled(DisableSOTV);
			HUD.Awake += new hook_Awake(HUD_Awake);
			RoR2Application.onFixedUpdate += RandomCrashFpsDropsFPSLimit;
			SceneDirector.onPrePopulateMonstersSceneServer += CommencementLunarWispSpam;
			Stage.onServerStageBegin += RandomStageStuff;
			CombatDirector.Spawn += new hook_Spawn(LunarChimeraeBugs);
			GlobalEventManager.OnInteractionBegin += new hook_OnInteractionBegin(GlobalEventManager_OnInteractionBegin);
			CharacterBody.AddMultiKill += new Manipulator(CharacterBody_AddMultiKill);
			ProjectileImpactExplosion.OnProjectileImpact += new hook_OnProjectileImpact(ProjectileImpactExplosion_OnProjectileImpact);
			RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
			ToolbotDualWieldBase.OnEnter += new hook_OnEnter(ToolbotDualWieldBase_OnEnter);
			PreGroundSlam.OnEnter += new hook_OnEnter(PreGroundSlam_OnEnter);
			GroundSlam.OnEnter += new hook_OnEnter(GroundSlam_OnEnter);
			RagdollController.BeginRagdoll += new hook_BeginRagdoll(RagdollController_BeginRagdoll);
			HoldoutZoneController.Start += new hook_Start(HoldoutZoneController_Start);
			Run.onRunStartGlobal += Run_onRunStartGlobal;
			SpawnState.OnEnter += new hook_OnEnter(SpawnState_OnEnter);
			HUDBossHealthBarController.LateUpdate += new hook_LateUpdate(HUDBossHealthBarController_LateUpdate);
			HUDBossHealthBarController.OnDisable += new hook_OnDisable(HUDBossHealthBarController_OnDisable);
			BaseTeleporterState.OnEnter += new hook_OnEnter(BaseTeleporterState_OnEnter);
			CombatDirector.Awake += new hook_Awake(MoreCredits);
		}

		private void HUDBossHealthBarController_OnDisable(orig_OnDisable orig, HUDBossHealthBarController self)
		{
			orig.Invoke(self);
			textTimer = 0f;
		}

		private void HUDBossHealthBarController_LateUpdate(orig_LateUpdate orig, HUDBossHealthBarController self)
		{
			if (base.ArtifactEnabled)
			{
				bool flag = Object.op_Implicit((Object)(object)self.currentBossGroup) && self.currentBossGroup.combatSquad.memberCount > 0;
				self.container.SetActive(flag);
				if (flag)
				{
					textTimer += Time.fixedDeltaTime;
					float totalObservedHealth = self.currentBossGroup.totalObservedHealth;
					float totalMaxObservedMaxHealth = self.currentBossGroup.totalMaxObservedMaxHealth;
					float num = ((totalMaxObservedMaxHealth == 0f) ? 0f : Mathf.Clamp01(totalObservedHealth / totalMaxObservedMaxHealth));
					self.delayedTotalHealthFraction = Mathf.Clamp(Mathf.SmoothDamp(self.delayedTotalHealthFraction, num, ref self.healthFractionVelocity, 0.1f, float.PositiveInfinity, Time.deltaTime), num, 1f);
					self.fillRectImage.fillAmount = num;
					self.delayRectImage.fillAmount = self.delayedTotalHealthFraction;
					StringBuilderExtensions.AppendInt(StringBuilderExtensions.AppendInt(HUDBossHealthBarController.sharedStringBuilder.Clear(), Mathf.CeilToInt(totalObservedHealth), 1u, uint.MaxValue).Append("/"), Mathf.CeilToInt(totalMaxObservedMaxHealth), 1u, uint.MaxValue);
					((TMP_Text)self.healthLabel).SetText(HUDBossHealthBarController.sharedStringBuilder);
					if (textTimer >= textInterval)
					{
						Main.ACLogger.LogError((object)"timer ABOVE interval");
						((TMP_Text)self.bossNameLabel).SetText(self.currentBossGroup.bestObservedName, true);
						((TMP_Text)self.bossSubtitleLabel).SetText(self.currentBossGroup.bestObservedSubtitle, true);
					}
					else
					{
						Main.ACLogger.LogError((object)"timer below interval");
						((TMP_Text)self.bossNameLabel).SetText("Boss Name", true);
						((TMP_Text)self.bossSubtitleLabel).SetText("Mother of Many", true);
					}
				}
			}
			else
			{
				orig.Invoke(self);
			}
		}

		private void MoreCredits(orig_Awake orig, CombatDirector self)
		{
			orig.Invoke(self);
			if (base.ArtifactEnabled)
			{
				self.creditMultiplier += 0.33f;
			}
		}

		private void BaseTeleporterState_OnEnter(orig_OnEnter orig, BaseState self)
		{
			//IL_005e: 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_006e: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			if (!base.ArtifactEnabled)
			{
				return;
			}
			float num = 2.5f;
			TeleporterInteraction component = ((EntityState)self).GetComponent<TeleporterInteraction>();
			if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.modelChildLocator))
			{
				Transform val = ((Component)component).transform.Find("TeleporterBaseMesh/BuiltInEffects/PassiveParticle, Sphere");
				if (Object.op_Implicit((Object)(object)val))
				{
					val.localScale = Vector3.one * 0.8f * num;
				}
			}
		}

		private void ToolbotDashImpact_OnEnter(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 32)
			}))
			{
				int index = val.Index;
				val.Index = index + 1;
				val.EmitDelegate<Func<int, int>>((Func<int, int>)((int self) => (!base.ArtifactEnabled) ? self : 0));
			}
		}

		private void SpawnState_OnEnter(orig_OnEnter orig, SpawnState self)
		{
			if (base.ArtifactEnabled)
			{
				SpawnState.duration = 10f;
			}
			orig.Invoke(self);
		}

		private void Run_onRunStartGlobal(Run obj)
		{
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Expected O, but got Unknown
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Expected O, but got Unknown
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			if (base.ArtifactEnabled)
			{
				NetworkManagerSystem.cvNetTimeSmoothRate = new FloatConVar("net_time_smooth_rate", (ConVarFlags)0, "0", "The smoothing rate for the network time.");
				NetworkManagerSystem.svTimeTransmitInterval = new FloatConVar("sv_time_transmit_interval", (ConVarFlags)8, (1f / 6f).ToString(), "How long it takes for the server to issue a time update to clients.");
			}
			else
			{
				NetworkManagerSystem.cvNetTimeSmoothRate = new FloatConVar("net_time_smooth_rate", (ConVarFlags)0, "1.05", "The smoothing rate for the network time.");
				NetworkManagerSystem.svTimeTransmitInterval = new FloatConVar("sv_time_transmit_interval", (ConVarFlags)8, (1f / 60f).ToString(), "How long it takes for the server to issue a time update to clients.");
			}
		}

		private void HoldoutZoneController_Start(orig_Start orig, HoldoutZoneController self)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			if (base.ArtifactEnabled && ((Object)((Component)self).transform.root).name == "Moon2DropshipZone")
			{
				self.holdoutZoneShape = (HoldoutZoneShape)0;
			}
			orig.Invoke(self);
		}

		private void RagdollController_BeginRagdoll(orig_BeginRagdoll orig, RagdollController self, Vector3 force)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			if (base.ArtifactEnabled)
			{
				force *= 5f;
			}
			orig.Invoke(self, force);
		}

		private void GroundSlam_OnEnter(orig_OnEnter orig, GroundSlam self)
		{
			if (base.ArtifactEnabled)
			{
				for (int i = 0; i < 50; i++)
				{
					Util.PlaySound("Play_loader_R_variant_whooshDown", ((EntityState)self).gameObject);
				}
			}
			orig.Invoke(self);
		}

		private void PreGroundSlam_OnEnter(orig_OnEnter orig, PreGroundSlam self)
		{
			if (base.ArtifactEnabled)
			{
				for (int i = 0; i < 50; i++)
				{
					Util.PlaySound("Play_loader_R_variant_activate", ((EntityState)self).gameObject);
				}
			}
			orig.Invoke(self);
		}

		private void ToolbotDualWieldBase_OnEnter(orig_OnEnter orig, ToolbotDualWieldBase self)
		{
			if (base.ArtifactEnabled)
			{
				ToolbotDualWieldBase.bonusBuff = oldPowerMode;
			}
			orig.Invoke(self);
		}

		private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
		{
			if (sender.HasBuff(oldPowerMode))
			{
				args.armorAdd += 200f;
			}
		}

		private void ProjectileImpactExplosion_OnProjectileImpact(orig_OnProjectileImpact orig, ProjectileImpactExplosion self, ProjectileImpactInfo impactInfo)
		{
			//IL_005d: 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)
			if (base.ArtifactEnabled && ((Object)((Component)self).gameObject).name.Contains("ImpVoidspikeProjectile"))
			{
				self.destroyOnEnemy = false;
				((ProjectileExplosion)self).blastRadius = 0f;
				((ProjectileExplosion)self).blastDamageCoefficient = 0f;
				((ProjectileExplosion)self).blastProcCoefficient = 0f;
				((ProjectileExplosion)self).projectileDamage.damageType = (DamageType)0;
			}
			orig.Invoke(self, impactInfo);
		}

		private void CharacterBody_AddMultiKill(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)Reflection.GetPropertyGetter(typeof(CharacterBody), "multiKillCount")),
				(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 4)
			}))
			{
				val.Index += 2;
				val.EmitDelegate<Func<int, int>>((Func<int, int>)((int self) => base.ArtifactEnabled ? 2 : self));
			}
			else
			{
				Main.ACLogger.LogError((object)"Failed to apply Berzerker's Pauldron Buff Kill Requirement hook");
			}
		}

		private void GlobalEventManager_OnInteractionBegin(orig_OnInteractionBegin orig, GlobalEventManager self, Interactor interactor, IInteractable interactable, GameObject interactableObject)
		{
			if (base.ArtifactEnabled && ((Object)interactableObject).name.Contains("ShrineCleanse"))
			{
				ShopTerminalBehavior component = interactableObject.GetComponent<ShopTerminalBehavior>();
				component.dropTable = (PickupDropTable)(object)oldCleansingPoolDropTable;
			}
			orig.Invoke(self, interactor, interactable, interactableObject);
		}

		private bool LunarChimeraeBugs(orig_Spawn orig, CombatDirector self, SpawnCard spawnCard, EliteDef eliteDef, Transform spawnTarget, MonsterSpawnDistance spawnDistance, bool preventOverhead, float valueMultiplier, PlacementMode placementMode)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Invalid comparison between Unknown and I4
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: 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)
			if (base.ArtifactEnabled && (int)spawnCard.eliteRules == 2)
			{
				spawnCard.eliteRules = (EliteRules)0;
				spawnCard.directorCreditCost /= 2;
				self.eliteBias *= 5000f;
				self.maxSpawnDistance *= 0.1f;
			}
			return orig.Invoke(self, spawnCard, eliteDef, spawnTarget, spawnDistance, preventOverhead, valueMultiplier, placementMode);
		}

		private void ChangeTriTipChance(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			int num = default(int);
			if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[4]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 10f),
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref num),
				(Instruction x) => ILPatternMatchingExt.MatchConvR4(x)
			}))
			{
				val.Index += 2;
				val.EmitDelegate<Func<float, float>>((Func<float, float>)((float self) => base.ArtifactEnabled ? 9f : self));
			}
			else
			{
				Main.ACLogger.LogError((object)"Failed to apply Tri-tip Dagger Chance hook");
			}
		}

		private bool DisableSOTV(orig_IsExpansionEnabled orig, Run self, ExpansionDef expansionDef)
		{
			if (base.ArtifactEnabled && expansionDef.nameToken == "DLC1_NAME")
			{
				return false;
			}
			return orig.Invoke(self, expansionDef);
		}

		private void NoFocusCrystalColorNerfedCrowbarNoPlanula(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 10),
				(Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(DamageInfo), "damageColorIndex")
			}))
			{
				val.Index += 1;
				val.EmitDelegate<Func<int, int>>((Func<int, int>)((int self) => (!base.ArtifactEnabled) ? self : 0));
			}
			else
			{
				Main.ACLogger.LogError((object)"Failed to apply Focus Crystal Damage Color hook");
			}
			val.Index = 0;
			if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1f),
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.75f)
			}))
			{
				val.Index += 2;
				val.EmitDelegate<Func<float, float>>((Func<float, float>)((float self) => base.ArtifactEnabled ? 0.5f : self));
			}
			else
			{
				Main.ACLogger.LogError((object)"Failed to apply Crowbar Damage hook");
			}
			val.Index = 0;
			if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 15f),
				(Instruction x) => ILPatternMatchingExt.MatchMul(x)
			}))
			{
				val.Index += 1;
				val.EmitDelegate<Func<float, float>>((Func<float, float>)((float self) => base.ArtifactEnabled ? 0f : self));
			}
			else
			{
				Main.ACLogger.LogError((object)"Failed to apply Crowbar Damage hook");
			}
		}

		private void NoFocusCrystalVFX(orig_OnEnable orig, NearbyDamageBonusBodyBehavior self)
		{
			if (base.ArtifactEnabled)
			{
				self.indicatorEnabled = false;
			}
			orig.Invoke(self);
		}

		private void HUD_Awake(orig_Awake orig, HUD self)
		{
			if (base.ArtifactEnabled)
			{
			}
			orig.Invoke(self);
		}

		private void HealthComponent_Awake(orig_Awake orig, HealthComponent self)
		{
			if (base.ArtifactEnabled)
			{
				((Component)self).gameObject.AddComponent<StupidBandController>();
			}
			orig.Invoke(self);
		}

		private void RemoveBandsOnHitChangeDeathMarkDebuffsRequirement(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			ILLabel val3 = default(ILLabel);
			if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[2]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 4f),
				(Instruction x) => ILPatternMatchingExt.MatchBltUn(x, ref val3)
			}))
			{
				val.Index += 1;
				val.EmitDelegate<Func<float, float>>((Func<float, float>)((float self) => base.ArtifactEnabled ? float.MaxValue : self));
			}
			else
			{
				Main.ACLogger.LogError((object)"Failed to apply Bands Damage Bug hook");
			}
			val.Index = 0;
			ILLabel val2 = default(ILLabel);
			if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[3]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 16),
				(Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 4),
				(Instruction x) => ILPatternMatchingExt.MatchBlt(x, ref val2)
			}))
			{
				val.Index += 2;
				val.EmitDelegate<Func<int, int>>((Func<int, int>)((int self) => base.ArtifactEnabled ? 5 : self));
			}
			else
			{
				Main.ACLogger.LogError((object)"Failed to apply Death Mark Minimum Debuffs hook");
			}
		}

		private void OverloadingTwoOrbs(orig_OnHitAll orig, GlobalEventManager self, DamageInfo damageInfo, GameObject hitObject)
		{
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			if (damageInfo.procCoefficient > 0f && !damageInfo.rejected)
			{
				bool active = NetworkServer.active;
				if (Object.op_Implicit((Object)(object)damageInfo.attacker))
				{
					CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>();
					if (Object.op_Implicit((Object)(object)component))
					{
						CharacterMaster master = component.master;
						if (Object.op_Implicit((Object)(object)master))
						{
							Inventory inventory = master.inventory;
							if (Object.op_Implicit((Object)(object)master.inventory) && (component.HasBuff(Buffs.AffixBlue) ? 1 : 0) > 0)
							{
								float num = 0.5f;
								float num2 = Util.OnHitProcDamage(damageInfo.damage, component.damage, num);
								float num3 = 0f;
								Vector3 position = damageInfo.position;
								ProjectileManager.instance.FireProjectile(LegacyResourcesAPI.Load<GameObject>("Prefabs/Projectiles/LightningStake"), position, Quaternion.identity, damageInfo.attacker, num2, num3, damageInfo.crit, (DamageColorIndex)3, (GameObject)null, -1f);
							}
						}
					}
				}
			}
			orig.Invoke(self, damageInfo, hitObject);
		}

		private void ClingyDronesAndInvincibleUmbrae(CharacterMaster master)
		{
			//IL_063c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0642: Invalid comparison between Unknown and I4
			//IL_045b: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e2: 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_0289: Unknown result type (might be due to invalid IL or missing references)
			//IL_0310: Unknown result type (might be due to invalid IL or missing references)
			if (!base.ArtifactEnabled)
			{
				return;
			}
			switch (((Object)master).name)
			{
			case "Drone1Master(Clone)":
			{
				AISkillDriver val9 = (from x in ((Component)master).GetComponents<AISkillDriver>()
					where x.customName == "IdleNearLeaderWhenNoEnemies"
					select x).First();
				val9.maxDistance = float.PositiveInfinity;
				val9.movementType = (MovementType)1;
				AISkillDriver val10 = (from x in ((Component)master).GetComponents<AISkillDriver>()
					where x.customName == "SoftLeashToLeader"
					select x).First();
				val10.minDistance = 0f;
				AISkillDriver val11 = (from x in ((Component)master).GetComponents<AISkillDriver>()
					where x.customName == "HardLeashToLeader"
					select x).First();
				val11.minDistance = 0f;
				break;
			}
			case "Drone2Master(Clone)":
			{
				AISkillDriver val12 = (from x in ((Component)master).GetComponents<AISkillDriver>()
					where x.customName == "HardLeashToLeader"
					select x).First();
				val12.minDistance = 0f;
				break;
			}
			case "EmergencyDroneMaster(Clone)":
			{
				AISkillDriver val13 = (from x in ((Component)master).GetComponents<AISkillDriver>()
					where x.customName == "IdleNearLeaderWhenNoEnemies"
					select x).First();
				val13.maxDistance = float.PositiveInfinity;
				val13.movementType = (MovementType)1;
				AISkillDriver val14 = (from x in ((Component)master).GetComponents<AISkillDriver>()
					where x.customName == "HardLeashToLeader"
					select x).First();
				val14.minDistance = 0f;
				break;
			}
			case "EquipmentDroneMaster(Clone)":
			{
				AISkillDriver val6 = (from x in ((Component)master).GetComponents<AISkillDriver>()
					where x.customName == "IdleNearLeaderWhenNoEnemies"
					select x).First();
				val6.maxDistance = float.PositiveInfinity;
				val6.movementType = (MovementType)1;
				AISkillDriver val7 = (from x in ((Component)master).GetComponents<AISkillDriver>()
					where x.customName == "SoftLeashToLeader"
					select x).First();
				val7.minDistance = 0f;
				AISkillDriver val8 = (from x in ((Component)master).GetComponents<AISkillDriver>()
					where x.customName == "HardLeashToLeader"
					select x).First();
				val8.minDistance = 0f;
				break;
			}
			case "FlameDroneMaster(Clone)":
			{
				AISkillDriver val15 = (from x in ((Component)master).GetComponents<AISkillDriver>()
					where x.customName == "IdleNearLeaderWhenNoEnemies"
					select x).First();
				val15.maxDistance = float.PositiveInfinity;
				val15.movementType = (MovementType)1;
				AISkillDriver val16 = (from x in ((Component)master).GetComponents<AISkillDriver>()
					where x.customName == "HardLeashToLeader"
					select x).First();
				val16.minDistance = 0f;
				break;
			}
			case "MegaDroneMaster(Clone)":
			{
				AISkillDriver val4 = (from x in ((Component)master).GetComponents<AISkillDriver>()
					where x.customName == "IdleNearLeaderWhenNoEnemies"
					select x).First();
				val4.maxDistance = float.PositiveInfinity;
				val4.movementType = (MovementType)1;
				AISkillDriver val5 = (from x in ((Component)master).GetComponents<AISkillDriver>()
					where x.customName == "LeashLeaderHard"
					select x).First();
				val5.minDistance = 0f;
				break;
			}
			case "DroneMissileMaster(Clone)":
			{
				AISkillDriver val17 = (from x in ((Component)master).GetComponents<AISkillDriver>()
					where x.customName == "IdleNearLeaderWhenNoEnemies"
					select x).First();
				val17.maxDistance = float.PositiveInfinity;
				val17.movementType = (MovementType)1;
				AISkillDriver val18 = (from x in ((Component)master).GetComponents<AISkillDriver>()
					where x.customName == "SoftLeashToLeader"
					select x).First();
				val18.minDistance = 0f;
				AISkillDriver val19 = (from x in ((Component)master).GetComponents<AISkillDriver>()
					where x.customName == "HardLeashToLeader"
					select x).First();
				val19.minDistance = 0f;
				break;
			}
			case "DroneBackupMaster(Clone)":
			{
				AISkillDriver val = (from x in ((Component)master).GetComponents<AISkillDriver>()
					where x.customName == "IdleNearLeaderWhenNoEnemies"
					select x).First();
				val.maxDistance = float.PositiveInfinity;
				val.movementType = (MovementType)1;
				AISkillDriver val2 = (from x in ((Component)master).GetComponents<AISkillDriver>()
					where x.customName == "SoftLeashToLeader"
					select x).First();
				val2.minDistance = 0f;
				AISkillDriver val3 = (from x in ((Component)master).GetComponents<AISkillDriver>()
					where x.customName == "HardLeashToLeader"
					select x).First();
				val3.minDistance = 0f;
				break;
			}
			}
			CharacterBody body = master.GetBody();
			if (Object.op_Implicit((Object)(object)body) && (int)master.teamIndex == 2 && ((Object)body).name.Contains("MonsterMaster"))
			{
				body.healthComponent.godMode = true;
			}
		}

		private void RemoveDamageNumbersLateGame(orig_DoUpdate orig, DamageDisplay self)
		{
			if (base.ArtifactEnabled && Run.instance.stageClearCount >= 11)
			{
				self.maxLife = 0f;
			}
			orig.Invoke(self);
		}

		private void HighSpeedLeap(orig_OnEnter orig, BaseLeap self)
		{
			if (base.ArtifactEnabled)
			{
				BaseLeap.upwardVelocity = 21f;
				BaseLeap.forwardVelocity = 9f;
			}
			orig.Invoke(self);
		}

		private void CommencementLunarWispSpam(SceneDirector sceneDirector)
		{
			//IL_0009: 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)
			if (base.ArtifactEnabled)
			{
				Scene activeScene = SceneManager.GetActiveScene();
				if (((Scene)(ref activeScene)).name == "moon2")
				{
					sceneDirector.monsterCredit *= 50;
					sceneDirector.spawnDistanceMultiplier *= 0.1f;
					sceneDirector.eliteBias *= 100f;
				}
			}
		}

		private void RemoveOSPMakeBrassCancer(CharacterBody body)
		{
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: 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)
			if (!base.ArtifactEnabled)
			{
				return;
			}
			body.oneShotProtectionFraction = 0f;
			Vector3 val = default(Vector3);
			((Vector3)(ref val))..ctor(0.5f, 2.045f, 1.215f);
			float num = 0.345f;
			if (((Object)body).name == "BellBody(Clone)")
			{
				Transform child = body.transform.GetChild(0).GetChild(0);
				if (Object.op_Implicit((Object)(object)child))
				{
					HurtBoxGroup component = ((Component)child).GetComponent<HurtBoxGroup>();
					for (int i = 0; i < component.hurtBoxes.Length; i++)
					{
						HurtBox val2 = component.hurtBoxes[i];
						BoxCollider component2 = ((Component)val2).GetComponent<BoxCollider>();
						if (Object.op_Implicit((Object)(object)component2) && component2.size != val)
						{
							component2.size = val;
						}
						SphereCollider component3 = ((Component)val2).GetComponent<SphereCollider>();
						if (Object.op_Implicit((Object)(object)component3) && component3.radius != num)
						{
							component3.radius = num;
						}
					}
				}
			}
			if (body.isPlayerControlled && (Object)(object)((Component)body).GetComponent<FuckWithCollisions>() == (Object)null)
			{
				((Component)body).gameObject.AddComponent<FuckWithCollisions>();
			}
		}

		private void RemoveM2Healing(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.5f)
			}))
			{
				val.Index += 1;
				val.EmitDelegate<Func<float, float>>((Func<float, float>)((float self) => base.ArtifactEnabled ? 0f : self));
			}
			else
			{
				Main.ACLogger.LogError((object)"Failed to apply Acrid M2 Regenerative hook");
			}
		}

		private void RemoveM1Healing(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.5f)
			}))
			{
				val.Index += 1;
				val.EmitDelegate<Func<float, float>>((Func<float, float>)((float self) => base.ArtifactEnabled ? 0f : self));
			}
			else
			{
				Main.ACLogger.LogError((object)"Failed to apply Acrid M1 Regenerative hook");
			}
		}

		private void IncreaseFireTrailDamage(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1.5f)
			}))
			{
				val.Index += 1;
				val.EmitDelegate<Func<float, float>>((Func<float, float>)((float self) => base.ArtifactEnabled ? 6f : self));
			}
			else
			{
				Main.ACLogger.LogError((object)"Failed to apply Blazing Elite Fire Trail Damage hook");
			}
		}

		private void IncreasedKnockback(orig_TakeDamageForce_DamageInfo_bool_bool orig, HealthComponent self, DamageInfo damageInfo, bool alwaysApply, bool disableAirControlUntilCollision)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			if (base.ArtifactEnabled)
			{
				damageInfo.force *= 3f;
			}
			orig.Invoke(self, damageInfo, alwaysApply, disableAirControlUntilCollision);
		}

		private void IncreasedKnockback2(orig_TakeDamageForce_Vector3_bool_bool orig, HealthComponent self, Vector3 force, bool alwaysApply, bool disableAirControlUntilCollision)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			if (base.ArtifactEnabled)
			{
				force *= 3f;
			}
			orig.Invoke(self, force, alwaysApply, disableAirControlUntilCollision);
		}

		private void RandomCrashFpsDropsFPSLimit()
		{
			if (base.ArtifactEnabled)
			{
				if (Random.RandomRangeInt(0, 10000000) < 2)
				{
					Utils.ForceCrash((ForcedCrashCategory)0);
				}
				Application.targetFrameRate = 60;
				if (Run.instance.stageRng.RangeInt(0, 1000) < 3)
				{
					Application.targetFrameRate = 10;
				}
			}
			else
			{
				Application.targetFrameRate = int.MaxValue;
			}
		}

		private void RandomStageStuff(Stage stage)
		{
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Expected O, but got Unknown
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Expected O, but got Unknown
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Expected O, but got Unknown
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Expected O, but got Unknown
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Expected O, but got Unknown
			if (base.ArtifactEnabled)
			{
				if (Run.instance.stageRng.RangeInt(0, 100) < 3)
				{
					Utils.ForceCrash((ForcedCrashCategory)1);
				}
				if (Run.instance.stageRng.RangeInt(0, 100) < 5)
				{
					DamageInfo.ModifyDamageInfo += new hook_ModifyDamageInfo(RandomNoDamageForStage);
				}
				else
				{
					DamageInfo.ModifyDamageInfo -= new hook_ModifyDamageInfo(RandomNoDamageForStage);
				}
				if (Run.instance.stageRng.RangeInt(0, 100) < 4)
				{
					DamageInfo.ModifyDamageInfo += new hook_ModifyDamageInfo(RandomNoProcsForStage);
				}
				else
				{
					DamageInfo.ModifyDamageInfo -= new hook_ModifyDamageInfo(RandomNoProcsForStage);
				}
				if (Run.instance.stageRng.RangeInt(0, 100) < 6)
				{
					DamageInfo.ModifyDamageInfo += new hook_ModifyDamageInfo(RandomInfiniteChainsForStage);
				}
			}
		}

		private void RandomInfiniteChainsForStage(orig_ModifyDamageInfo orig, DamageInfo self, DamageModifier damageModifier)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			self.procChainMask = default(ProcChainMask);
			self.procCoefficient = 100f;
			orig.Invoke(self, damageModifier);
		}

		private void RandomNoProcsForStage(orig_ModifyDamageInfo orig, DamageInfo self, DamageModifier damageModifier)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			self.procCoefficient = 0f;
			orig.Invoke(self, damageModifier);
		}

		private void RandomNoDamageForStage(orig_ModifyDamageInfo orig, DamageInfo self, DamageModifier damageModifier)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			self.damage = 0f;
			orig.Invoke(self, damageModifier);
		}

		private void RandomNoDamageOnHit(orig_ModifyDamageInfo orig, DamageInfo self, DamageModifier damageModifier)
		{
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			if (Run.instance.stageRng.RangeInt(0, 1000) < 25)
			{
				self.damage = 0f;
			}
			if (Run.instance.stageRng.RangeInt(0, 1000) < 45)
			{
				self.procCoefficient = 0f;
			}
			orig.Invoke(self, damageModifier);
		}

		private void RemoveAegisAndRejuvRack(ILContext il)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1f)
			}))
			{
				val.Index += 1;
				val.EmitDelegate<Func<float, float>>((Func<float, float>)((float self) => base.ArtifactEnabled ? 0f : self));
			}
			else
			{
				Main.ACLogger.LogError((object)"Failed to apply Rejuvenation Rack Healing hook");
			}
			val.Index = 0;
			if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[3]
			{
				(Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "RoR2.HealthComponent/ItemCounts", "barrierOnOverHeal"),
				(Instruction x) => ILPatternMatchingExt.MatchConvR4(x),
				(Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.5f)
			}))
			{
				val.Index += 3;
				val.EmitDelegate<Func<float, float>>((Func<float, float>)((float self) => base.ArtifactEnabled ? 0f : self));
			}
			else
			{
				Main.ACLogger.LogError((object)"Failed to apply Aegis Overheal hook");
			}
		}
	}
	public class StupidBandController : MonoBehaviour, IOnTakeDamageServerReceiver
	{
		public void OnTakeDamageServer(DamageReport damageReport)
		{
			//IL_0070: 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_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_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0372: Unknown result type (might be due to invalid IL or missing references)
			//IL_0377: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0424: Unknown result type (might be due to invalid IL or missing references)
			//IL_0429: Unknown result type (might be due to invalid IL or missing references)
			//IL_0436: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: 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_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Expected O, but got Unknown
			//IL_01ad: 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_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_024c: Unknown result type (might be due to invalid IL or missing references)
			//IL_024e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0253: Unknown result type (might be due to invalid IL or missing references)
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02eb: 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_0304: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0282: Unknown result type (might be due to invalid IL or missing references)
			//IL_0287: Unknown result type (might be due to invalid IL or missing references)
			DamageInfo damageInfo = damageReport.damageInfo;
			GameObject attacker = damageInfo.attacker;
			if (!Object.op_Implicit((Object)(object)attacker))
			{
				return;
			}
			CharacterBody component = attacker.GetComponent<CharacterBody>();
			if (!Object.op_Implicit((Object)(object)component))
			{
				return;
			}
			Inventory inventory = component.inventory;
			if (((ProcChainMask)(ref damageInfo.procChainMask)).HasProc((ProcType)12) || !(damageReport.damageDealt / component.damage >= 4f))
			{
				return;
			}
			Vector3 aimOrigin = component.aimOrigin;
			FireProjectileInfo val4;
			if (component.HasBuff(Buffs.ElementalRingsReady) && Object.op_Implicit((Object)(object)inventory))
			{
				int itemCount = inventory.GetItemCount(Items.IceRing);
				int itemCount2 = inventory.GetItemCount(Items.FireRing);
				component.RemoveBuff(Buffs.ElementalRingsReady);
				for (int i = 1; (float)i <= 10f; i++)
				{
					component.AddTimedBuff(Buffs.ElementalRingsCooldown, (float)i);
				}
				ProcChainMask procChainMask = damageInfo.procChainMask;
				((ProcChainMask)(ref procChainMask)).AddProc((ProcType)12);
				Vector3 position = damageInfo.position;
				if (itemCount > 0 && Object.op_Implicit((Object)(object)component))
				{
					float num = 2.5f * (float)itemCount;
					float damage = Util.OnHitProcDamage(damageInfo.damage, component.damage, num);
					DamageInfo val = new DamageInfo
					{
						damage = damage,
						damageColorIndex = (DamageColorIndex)3,
						damageType = (DamageType)0,
						attacker = damageInfo.attacker,
						crit = damageInfo.crit,
						force = Vector3.zero,
						inflictor = null,
						position = position,
						procChainMask = procChainMask,
						procCoefficient = 1f
					};
					EffectManager.SimpleImpactEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ImpactEffects/IceRingExplosion"), position, Vector3.up, true);
					component.AddTimedBuff(Buffs.Slow80, 3f * (float)itemCount);
					damageReport.victim.TakeDamage(val);
				}
				if (itemCount2 > 0)
				{
					GameObject val2 = LegacyResourcesAPI.Load<GameObject>("Prefabs/Projectiles/FireTornado");
					float resetInterval = val2.GetComponent<ProjectileOverlapAttack>().resetInterval;
					float lifetime = val2.GetComponent<ProjectileSimple>().lifetime;
					float num2 = 3f * (float)itemCount2;
					float damage2 = Util.OnHitProcDamage(damageInfo.damage, component.damage, num2) / lifetime * resetInterval;
					float speedOverride = 0f;
					Quaternion rotation = Quaternion.identity;
					Vector3 val3 = position - aimOrigin;
					val3.y = 0f;
					if (val3 != Vector3.zero)
					{
						speedOverride = -1f;
						rotation = Util.QuaternionSafeLookRotation(val3, Vector3.up);
					}
					ProjectileManager instance = ProjectileManager.instance;
					val4 = new FireProjectileInfo
					{
						damage = damage2,
						crit = damageInfo.crit,
						damageColorIndex = (DamageColorIndex)3,
						position = position,
						procChainMask = procChainMask,
						force = 0f,
						owner = damageInfo.attacker,
						projectilePrefab = val2,
						rotation = rotation
					};
					((FireProjectileInfo)(ref val4)).speedOverride = speedOverride;
					val4.target = null;
					instance.FireProjectile(val4);
				}
			}
			else if (component.HasBuff(Buffs.ElementalRingVoidReady))
			{
				int itemCount3 = inventory.GetItemCount(Items.ElementalRingVoid);
				component.RemoveBuff(Buffs.ElementalRingVoidReady);
				for (int j = 1; (float)j <= 20f; j++)
				{
					component.AddTimedBuff(Buffs.ElementalRingVoidCooldown, (float)j);
				}
				ProcChainMask procChainMask2 = damageInfo.procChainMask;
				((ProcChainMask)(ref procChainMask2)).AddProc((ProcType)12);
				if (itemCount3 > 0)
				{
					GameObject projectilePrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Projectiles/ElementalRingVoidBlackHole");
					float num3 = 1f * (float)itemCount3;
					float damage3 = Util.OnHitProcDamage(damageInfo.damage, component.damage, num3);
					ProjectileManager instance2 = ProjectileManager.instance;
					val4 = new FireProjectileInfo
					{
						damage = damage3,
						crit = damageInfo.crit,
						damageColorIndex = (DamageColorIndex)9,
						position = damageInfo.position,
						procChainMask = procChainMask2,
						force = 6000f,
						owner = damageInfo.attacker,
						projectilePrefab = projectilePrefab,
						rotation = Quaternion.identity,
						target = null
					};
					instance2.FireProjectile(val4);
				}
			}
		}
	}
	public class OldCleansingPoolDropTable : PickupDropTable
	{
		public WeightedSelection<PickupIndex> weighted = new WeightedSelection<PickupIndex>(8);

		public override int GetPickupCount()
		{
			return weighted.Count;
		}

		public void GenerateWeightedSelection()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//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)
			weighted.Clear();
			weighted.AddChoice(PickupCatalog.FindPickupIndex(Items.Pearl.itemIndex), 96f);
			weighted.AddChoice(PickupCatalog.FindPickupIndex(Items.ShinyPearl.itemIndex), 4f);
		}

		public override PickupIndex[] GenerateUniqueDropsPreReplacement(int maxDrops, Xoroshiro128Plus rng)
		{
			GenerateWeightedSelection();
			return PickupDropTable.GenerateUniqueDropsFromWeightedSelection(maxDrops, rng, weighted);
		}

		public override PickupIndex GenerateDropPreReplacement(Xoroshiro128Plus rng)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: 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)
			GenerateWeightedSelection();
			Debug.Log((object)PickupDropTable.GenerateDropFromWeightedSelection(rng, weighted));
			return PickupDropTable.GenerateDropFromWeightedSelection(rng, weighted);
		}
	}
	public class FuckWithCollisions : MonoBehaviour
	{
		private bool disableCollision = false;

		public KinematicCharacterMotor kcmotor;

		public void Start()
		{
			kcmotor = ((Component)this).GetComponent<KinematicCharacterMotor>();
		}

		public void FixedUpdate()
		{
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)kcmotor))
			{
				if (Random.Range(0f, 1f) < 9E-05f)
				{
					((MonoBehaviour)this).StartCoroutine(ToggleCollision());
				}
				if (disableCollision)
				{
					kcmotor.CollidableLayers = LayerMask.op_Implicit(LayerMask.NameToLayer("TriggerZone"));
				}
				else
				{
					kcmotor.CollidableLayers = LayerMask.op_Implicit(-20411191);
				}
			}
		}

		private IEnumerator ToggleCollision()
		{
			disableCollision = true;
			yield return (object)new WaitForSeconds(2f);
			disableCollision = false;
		}
	}
}