Decompiled source of Darkness Expansion v1.2.0

DarknessExpansion/DarknessExpansion.dll

Decompiled 2 months ago
using System;
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 BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using EntityStates.TitanMonster;
using EntityStates.VagrantNovaItem;
using Microsoft.CodeAnalysis;
using On.EntityStates.VagrantNovaItem;
using On.RoR2;
using On.RoR2.Items;
using R2API;
using RoR2;
using RoR2.CharacterAI;
using RoR2.Items;
using RoR2.Navigation;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.UI;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Events;
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.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("DarknessExpansion")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+c9c6117d180a2a44a64eaac899a59a15313b45c5")]
[assembly: AssemblyProduct("DarknessExpansion")]
[assembly: AssemblyTitle("DarknessExpansion")]
[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 DarknessExpansion
{
	public class Darkness
	{
		public static EliteDef DarknessElite;

		public static EquipmentDef DarknessEquipment;

		public static BuffDef DarknessBuff;

		public static int DarknessLevel = 0;

		private static Sprite eliteIcon = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/EliteFire/texBuffAffixRed.tif").WaitForCompletion();

		public static int maxDarknessLevel;

		public static float maxItemChance;

		public static bool linearItemScaling;

		public static int maximumBonusItems;

		public static bool linearEliteScaling;

		public static bool linearStatsScaling;

		public static float healthBoost;

		public static float damageBoost;

		public static event Action<int> onDarknessLevelChange;

		public Darkness()
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Expected O, but got Unknown
			DarknessElite = ScriptableObject.CreateInstance<EliteDef>();
			DarknessElite.color = Color32.op_Implicit(new Color(0f, 0f, 0f, 255f));
			EliteRamp.AddRamp(DarknessElite, CreateDarknessTexture());
			((Object)DarknessElite).name = "EliteDarkness";
			DarknessElite.modifierToken = "Dark {0}";
			DarknessBuff = ScriptableObject.CreateInstance<BuffDef>();
			((Object)DarknessBuff).name = "DarknessBuff";
			DarknessBuff.canStack = false;
			DarknessBuff.isCooldown = false;
			DarknessBuff.isDebuff = false;
			DarknessBuff.buffColor = new Color(0f, 0f, 0f, 255f);
			DarknessBuff.iconSprite = eliteIcon;
			DarknessEquipment = ScriptableObject.CreateInstance<EquipmentDef>();
			DarknessEquipment.appearsInMultiPlayer = true;
			DarknessEquipment.appearsInSinglePlayer = true;
			DarknessEquipment.canBeRandomlyTriggered = false;
			DarknessEquipment.canDrop = false;
			DarknessEquipment.colorIndex = (ColorIndex)5;
			DarknessEquipment.cooldown = 0f;
			DarknessEquipment.isLunar = false;
			DarknessEquipment.isBoss = false;
			DarknessEquipment.passiveBuffDef = DarknessBuff;
			DarknessEquipment.dropOnDeathChance = 0f;
			DarknessEquipment.enigmaCompatible = false;
			DarknessElite.eliteEquipmentDef = DarknessEquipment;
			DarknessBuff.eliteDef = DarknessElite;
			ContentAddition.AddEliteDef(DarknessElite);
			ContentAddition.AddBuffDef(DarknessBuff);
			ContentAddition.AddEquipmentDef(DarknessEquipment);
			UpdateDarkness();
			CombatDirector.Spawn += new hook_Spawn(CombatDirectorOnSpawn);
			SpawnCard.onSpawnedServerGlobal += SpawnCardOnonSpawnedServerGlobal;
			Run.onRunStartGlobal += delegate
			{
				DarknessLevel = DarknessExpansion.startingDarkness.Value;
			};
			maxDarknessLevel = DarknessExpansion.maximumDarknessLevel.Value;
			maxItemChance = DarknessExpansion.maximumItemChance.Value;
			linearItemScaling = DarknessExpansion.linearDarknessEliteItemScaling.Value;
			maximumBonusItems = DarknessExpansion.maximumBonusItems.Value;
			linearEliteScaling = DarknessExpansion.linearDarknessEliteChanceScaling.Value;
			linearStatsScaling = DarknessExpansion.linearDarknessEliteStatsScaling.Value;
			healthBoost = DarknessExpansion.healthBoostAmount.Value;
			damageBoost = DarknessExpansion.damageBoostAmount.Value;
		}

		private void SpawnCardOnonSpawnedServerGlobal(SpawnResult obj)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)obj.spawnedInstance))
			{
				return;
			}
			Inventory component = obj.spawnedInstance.GetComponent<Inventory>();
			if (!Object.op_Implicit((Object)(object)component) || component.GetEquipmentIndex() != DarknessEquipment.equipmentIndex)
			{
				return;
			}
			List<ItemDef> darkItems = DarknessItems.darkItems;
			component.GiveItem(darkItems[(int)((float)(darkItems.Count - 1) * Random.value)], 1);
			float num = (float)DarknessLevel / (float)maxDarknessLevel;
			if (!linearItemScaling)
			{
				num *= num;
			}
			num *= maxItemChance;
			if (Random.value < num)
			{
				component.GiveItem(darkItems[(int)((float)(darkItems.Count - 1) * Random.value)], 1);
			}
			for (int i = 0; i < maximumBonusItems; i++)
			{
				if (!(Random.value < num))
				{
					break;
				}
				component.GiveItem(ItemCatalog.itemNameToIndex[DarknessShrine.yellowItemNames[(int)((float)(DarknessShrine.yellowItemNames.Length - 1) * Random.value)]], 1);
			}
		}

		public static Texture2D CreateDarknessTexture()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Expected O, but got Unknown
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: 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_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			Texture2D val = new Texture2D(256, 8);
			((Texture)val).wrapMode = (TextureWrapMode)1;
			for (int i = 0; i < 8; i++)
			{
				for (int j = 0; j < 50; j++)
				{
					val.SetPixel(j, i, new Color(0f, 0f, (float)j / 255f, 255f));
				}
				for (int k = 0; k < 50; k++)
				{
					val.SetPixel(k + 50, i, new Color(0f, 0f, 10f / 51f - (float)k / 255f, 255f));
				}
				for (int l = 0; l < 50; l++)
				{
					val.SetPixel(l + 100, i, new Color((float)l / 255f, 0f, (float)l / 255f, 255f));
				}
				for (int m = 0; m < 50; m++)
				{
					val.SetPixel(m + 150, i, new Color(10f / 51f - (float)m / 255f, 0f, 10f / 51f - (float)m / 255f, 255f));
				}
				for (int n = 0; n < 56; n++)
				{
					val.SetPixel(n + 200, i, new Color(0f, (float)n / 255f, 0f, 255f));
				}
			}
			val.Apply();
			return val;
		}

		private bool CombatDirectorOnSpawn(orig_Spawn orig, CombatDirector self, SpawnCard spawncard, EliteDef elitedef, Transform spawntarget, MonsterSpawnDistance spawndistance, bool preventoverhead, float valuemultiplier, PlacementMode placementmode)
		{
			//IL_0048: 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)
			float num = (float)DarknessLevel / (float)maxDarknessLevel;
			if (!linearEliteScaling)
			{
				num *= num;
			}
			if (Random.value < num)
			{
				elitedef = DarknessElite;
				Log.Debug("Changing Elite Type");
			}
			return orig.Invoke(self, spawncard, elitedef, spawntarget, spawndistance, preventoverhead, valuemultiplier, placementmode);
		}

		public static void UpdateDarkness()
		{
			float num = DarknessLevel;
			if (!linearStatsScaling)
			{
				num = Mathf.Sqrt(num);
			}
			DarknessElite.healthBoostCoefficient = 1f + num * healthBoost;
			DarknessElite.damageBoostCoefficient = 1f + num * damageBoost;
			if (Darkness.onDarknessLevelChange != null)
			{
				Darkness.onDarknessLevelChange(DarknessLevel);
			}
		}
	}
	public class DarknessArtifact
	{
		public static ArtifactDef darknessArtifact;

		public static Sprite iconDisabled = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/EliteOnly/texArtifactEliteOnlyDisabled.png").WaitForCompletion();

		public static Sprite iconEnabled = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/EliteOnly/texArtifactEliteOnlyEnabled.png").WaitForCompletion();

		public static int darknessGained;

		public DarknessArtifact()
		{
			darknessArtifact = ScriptableObject.CreateInstance<ArtifactDef>();
			darknessArtifact.nameToken = "Artifact of Darkness";
			darknessArtifact.descriptionToken = "Start with the world partially consumed with darkness.";
			darknessArtifact.smallIconDeselectedSprite = iconDisabled;
			darknessArtifact.smallIconSelectedSprite = iconEnabled;
			ContentAddition.AddArtifactDef(darknessArtifact);
			Run.onRunStartGlobal += RunOnonRunStartGlobal;
			darknessGained = DarknessExpansion.darknessGainedFromArtifact.Value;
		}

		private void RunOnonRunStartGlobal(Run obj)
		{
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Invalid comparison between Unknown and I4
			if (!RunArtifactManager.instance.IsArtifactEnabled(darknessArtifact))
			{
				return;
			}
			Darkness.DarknessLevel += darknessGained;
			Darkness.UpdateDarkness();
			foreach (CharacterMaster instances in CharacterMaster.instancesList)
			{
				List<ItemDef> darkItems = DarknessItems.darkItems;
				if ((int)instances._teamIndex == 1)
				{
					instances.inventory.GiveItem(darkItems[(int)((float)darkItems.Count * Random.value)], 1);
				}
			}
		}
	}
	[BepInPlugin("com.cybug.DarknessExpansion", "DarknessExpansion", "1.1.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class DarknessExpansion : BaseUnityPlugin
	{
		public static ConfigEntry<int> startingDarkness;

		public static ConfigEntry<int> maximumDarknessLevel;

		public static ConfigEntry<int> darknessGainedFromShrine;

		public static ConfigEntry<int> darknessGainedFromItem;

		public static ConfigEntry<int> darknessGainedFromArtifact;

		public static ConfigEntry<bool> linearDarknessEliteItemScaling;

		public static ConfigEntry<float> maximumItemChance;

		public static ConfigEntry<int> maximumBonusItems;

		public static ConfigEntry<bool> linearDarknessEliteChanceScaling;

		public static ConfigEntry<bool> linearDarknessEliteStatsScaling;

		public static ConfigEntry<float> healthBoostAmount;

		public static ConfigEntry<float> damageBoostAmount;

		public static ConfigEntry<int> creditCost;

		public static ConfigEntry<int> selectionWeight;

		public static ConfigEntry<int> maxDarknessShrines;

		public static ConfigEntry<int> numPotentialsPerShrine;

		public static ConfigEntry<float> baseShrineCredits;

		public static ConfigEntry<int> numWhiteItemsGiven;

		public static ConfigEntry<int> numGreenItemsGiven;

		public static ConfigEntry<int> numRedItemsGiven;

		public static ConfigEntry<int> numYellowItemsGiven;

		public static ConfigEntry<float> bonusStatsGiven;

		public static ConfigEntry<int> numWhitesPerRed;

		public static ConfigEntry<bool> logStacking;

		public static ConfigEntry<bool> sqrtStacking;

		public static ConfigEntry<int> golemHealth;

		public static ConfigEntry<int> golemRegen;

		public static ConfigEntry<float> golemChance;

		public static ConfigEntry<int> golemBaseDamage;

		public static ConfigEntry<int> golemDamagePerHealth;

		public static ConfigEntry<int> golemStackingHealth;

		public static ConfigEntry<int> golemStackingRegen;

		public static ConfigEntry<float> golemStacking;

		public static ConfigEntry<float> pearlHealthPercent;

		public static ConfigEntry<float> pearlOnKillPercent;

		public static ConfigEntry<float> pearlStacking;

		public static ConfigEntry<float> pearl2AllStatsPercent;

		public static ConfigEntry<float> pearl2OnKillPercent;

		public static ConfigEntry<float> pearl2Stacking;

		public static ConfigEntry<float> bleedCritChancePercent;

		public static ConfigEntry<int> bleedStacksPerHit;

		public static ConfigEntry<float> explosionBaseDamagePercent;

		public static ConfigEntry<float> explosionHealthPercent;

		public static ConfigEntry<float> onKillCritDamagePercent;

		public static ConfigEntry<float> bleedStackingMultiplier;

		public static ConfigEntry<float> beetleSpawnInterval;

		public static ConfigEntry<float> beetleBaseDamagePercent;

		public static ConfigEntry<float> beetleBaseHealthPercent;

		public static ConfigEntry<int> beetleDebuffStacks;

		public static ConfigEntry<int> beetleMaxGuards;

		public static ConfigEntry<float> beetleOnKillASPercent;

		public static ConfigEntry<float> coreSpawnInterval;

		public static ConfigEntry<float> coreAllyDamagePerAlly;

		public static ConfigEntry<float> coreOnKillAllyStatPct;

		public static ConfigEntry<float> jellyLowHealthThreshold;

		public static ConfigEntry<float> jellyRechargeInterval;

		public static ConfigEntry<int> jellyBaseCharges;

		public static ConfigEntry<float> jellySecondaryBasePct;

		public static ConfigEntry<float> jellyOnKillCdrPct;

		public static ConfigEntry<float> jellyStackingMultiplier;

		public static ConfigEntry<int> wispCount;

		public static ConfigEntry<int> wispBaseDamageMult;

		public static ConfigEntry<float> wispProcCoeff;

		public static ConfigEntry<float> wispOnKillMoveSpeedPct;

		public static ConfigEntry<float> wispStackingMultiplier;

		public static ConfigEntry<int> clayTetherCount;

		public static ConfigEntry<float> clayTarBonusDamagePct;

		public static ConfigEntry<float> clayHealPct;

		public static ConfigEntry<float> clayDarkKillHealingBonusPct;

		public static ConfigEntry<float> clayStackingMultiplier;

		public static ConfigEntry<float> parentHealPerArmorPct;

		public static ConfigEntry<float> parentIgniteRadiusBase;

		public static ConfigEntry<float> parentDarkKillArmorBonus;

		public static ConfigEntry<float> parentStackingMultiplier;

		public static ConfigEntry<float> lightningProcChance;

		public static ConfigEntry<int> lightningExtraTargets;

		public static ConfigEntry<float> lightningRangeBase;

		public static ConfigEntry<float> lightningDamagePct;

		public static ConfigEntry<float> lightningOnKillDamageBonus;

		public static ConfigEntry<float> lightningStackingMultiplier;

		public static ConfigEntry<float> fireProcChance;

		public static ConfigEntry<int> fireBaseBalls;

		public static ConfigEntry<float> fireDamagePct;

		public static ConfigEntry<float> fireOnKillDamageBonus;

		public static ConfigEntry<float> fireStackingMultiplier;

		public static ConfigEntry<float> constructHealthPctBase;

		public static ConfigEntry<float> constructOnHitChancePct;

		public static ConfigEntry<float> constructDamagePctBase;

		public static ConfigEntry<int> constructMaxBase;

		public static ConfigEntry<float> constructOnKillLuckGain;

		public static ConfigEntry<float> constructStackingMultiplier;

		private void Awake()
		{
			startingDarkness = ((BaseUnityPlugin)this).Config.Bind<int>("Darkness Level", "Starting Darkness Level", 0, "What the starting darkness level is.");
			maximumDarknessLevel = ((BaseUnityPlugin)this).Config.Bind<int>("Darkness Level", "Maximum Darkness Level", 10, "The point at which the world becomes consumed with darkness.");
			darknessGainedFromShrine = ((BaseUnityPlugin)this).Config.Bind<int>("Darkness Level", "Darkness From Shrine Activation", 1, "How much is added to the darkness level on activating a darkness shrine.");
			darknessGainedFromItem = ((BaseUnityPlugin)this).Config.Bind<int>("Darkness Level", "Darkness From Dark Item", 1, "How much is added to the darkness level per dark item picked up.");
			darknessGainedFromArtifact = ((BaseUnityPlugin)this).Config.Bind<int>("Darkness Level", "Darkness From Artifact", 1, "How much is added to the darkness level when starting a run with the darkness artifact.");
			linearDarknessEliteItemScaling = ((BaseUnityPlugin)this).Config.Bind<bool>("Darkness Elite", "Darkness Elite Item Chance Scaling Type", true, "Whether the item chance should scale linearly (true) or quadratically (false).");
			maximumItemChance = ((BaseUnityPlugin)this).Config.Bind<float>("Darkness Elite", "Maximum Item Chance", 1f, "The maximum chance that an elite gets bonus items.");
			maximumBonusItems = ((BaseUnityPlugin)this).Config.Bind<int>("Darkness Elite", "Maximum Bonus Items", 3, "The maximum number of bonus yellow items an elite can have.");
			linearDarknessEliteChanceScaling = ((BaseUnityPlugin)this).Config.Bind<bool>("Darkness Elite", "Darkness Elite Spawn Chance Scaling Type", false, "Whether the spawn chance should scale linearly (true) or quadratically (false).");
			linearDarknessEliteStatsScaling = ((BaseUnityPlugin)this).Config.Bind<bool>("Darkness Elite", "Darkness Elite Health and Damage Scaling Type", false, "Whether the health and damage should scale linearly (true) or square root (false).");
			healthBoostAmount = ((BaseUnityPlugin)this).Config.Bind<float>("Darkness Elite", "Health Boost Per Stack", 1f, "The amount of health boost an elite gets from 1 darkness level.");
			damageBoostAmount = ((BaseUnityPlugin)this).Config.Bind<float>("Darkness Elite", "Damage Boost Per Stack", 0.5f, "The amount of damage boost an elite gets from 1 darkness level.");
			creditCost = ((BaseUnityPlugin)this).Config.Bind<int>("Darkness Shrine", "Credit Cost", 10, "How many credits the darkness shrine costs.");
			selectionWeight = ((BaseUnityPlugin)this).Config.Bind<int>("Darkness Shrine", "Selection Weight", 100, "The weight of the Darkness Shrine.");
			maxDarknessShrines = ((BaseUnityPlugin)this).Config.Bind<int>("Darkness Shrine", "Maximum Darkness Shrines", 1, "How many Darkness Shrines can spawn at once.");
			numPotentialsPerShrine = ((BaseUnityPlugin)this).Config.Bind<int>("Darkness Shrine", "Number Of Potentials Per Shrine", 3, "How many Potentials spawn per Darkness Shrine. Also is the number of yellows required to make a dark item.");
			baseShrineCredits = ((BaseUnityPlugin)this).Config.Bind<float>("Darkness Shrine", "Base Shrine Credits", 600f, "The base shrine credits of the darkness shrine (scales like the teleporter).");
			numWhiteItemsGiven = ((BaseUnityPlugin)this).Config.Bind<int>("Darkness Shrine", "Number of White Items", 5, "The number of each white item sacrificed given to the boss.");
			numGreenItemsGiven = ((BaseUnityPlugin)this).Config.Bind<int>("Darkness Shrine", "Number of Green Items", 3, "The number of each green item sacrificed given to the boss.");
			numRedItemsGiven = ((BaseUnityPlugin)this).Config.Bind<int>("Darkness Shrine", "Number of Red Items", 1, "The number of each red item sacrificed given to the boss.");
			numYellowItemsGiven = ((BaseUnityPlugin)this).Config.Bind<int>("Darkness Shrine", "Number of Yellow Items", 1, "The number of each yellow item sacrificed given to the boss.");
			bonusStatsGiven = ((BaseUnityPlugin)this).Config.Bind<float>("Darkness Shrine", "Amount of Bonus Stats", 1f, "The amount of darkness level required for the dark boss to gain 10% bonus stats.");
			numWhitesPerRed = ((BaseUnityPlugin)this).Config.Bind<int>("Darkness Shrine", "Number of Whites Per Red", 5, "How many white items a red item upgrades into.");
			logStacking = ((BaseUnityPlugin)this).Config.Bind<bool>("Darkness Items", "Logarithmic Stacking", false, "Whether the stacking from dark items stacks logarithmically. If this and sqrt stacking are both enabled, stacking is disabled.");
			sqrtStacking = ((BaseUnityPlugin)this).Config.Bind<bool>("Darkness Items", "Square Root Stacking", false, "Whether the stacking from dark items stacks by square root. If this and log stacking are both enabled, stacking is disabled.");
			golemHealth = ((BaseUnityPlugin)this).Config.Bind<int>("Titanic Boulder", "Health", 100, "Base health of each Golem Item.");
			golemRegen = ((BaseUnityPlugin)this).Config.Bind<int>("Titanic Boulder", "Regen", 10, "Health regen granted by Golem Item.");
			golemChance = ((BaseUnityPlugin)this).Config.Bind<float>("Titanic Boulder", "Spawn Chance", 20f, "% chance to spawn a Golem on hit.");
			golemBaseDamage = ((BaseUnityPlugin)this).Config.Bind<int>("Titanic Boulder", "Base Damage %", 200, "Base % Damage dealt by Golem item.");
			golemDamagePerHealth = ((BaseUnityPlugin)this).Config.Bind<int>("Titanic Boulder", "Damage per Health %", 100, "Additional % damage per 500 health.");
			golemStackingHealth = ((BaseUnityPlugin)this).Config.Bind<int>("Titanic Boulder", "Stacking Health", 5, "Additional health per darkness stack per Golem Item.");
			golemStackingRegen = ((BaseUnityPlugin)this).Config.Bind<int>("Titanic Boulder", "Stacking Regen", 1, "Additional regen per darkness stack per Golem Item.");
			golemStacking = ((BaseUnityPlugin)this).Config.Bind<float>("Titanic Boulder", "Stacking Bonus", 1f, "Multiplier applied to per-stack values");
			pearlHealthPercent = ((BaseUnityPlugin)this).Config.Bind<float>("Dark Pearl", "Base Health %", 50f, "Base % max health");
			pearlOnKillPercent = ((BaseUnityPlugin)this).Config.Bind<float>("Dark Pearl", "On Kill %", 2f, "Health % gained on kill");
			pearlStacking = ((BaseUnityPlugin)this).Config.Bind<float>("Dark Pearl", "Stacking Mult", 1f, "Multiplier applied to per-stack values");
			pearl2AllStatsPercent = ((BaseUnityPlugin)this).Config.Bind<float>("Dark Irradiant Pearl", "All Stats %", 50f, "Base % increase to all stats per Dark Irradiant Pearl");
			pearl2OnKillPercent = ((BaseUnityPlugin)this).Config.Bind<float>("Dark Irradiant Pearl", "On Kill All Stats %", 1f, "Additional % to all stats on kill per Dark Irradiant Pearl");
			pearl2Stacking = ((BaseUnityPlugin)this).Config.Bind<float>("Dark Irradiant Pearl", "Stacking Multiplier", 1f, "Multiplier applied to per-stack values");
			bleedCritChancePercent = ((BaseUnityPlugin)this).Config.Bind<float>("Dark Shatterspleen", "Crit Chance %", 20f, "Base critical chance granted by each item");
			bleedStacksPerHit = ((BaseUnityPlugin)this).Config.Bind<int>("Dark Shatterspleen", "Bleed Stacks per Hit", 1, "Bleed stacks applied on each hit");
			explosionBaseDamagePercent = ((BaseUnityPlugin)this).Config.Bind<float>("Dark Shatterspleen", "Explosion Base %", 100f, "Base % damage per bleed item on death");
			explosionHealthPercent = ((BaseUnityPlugin)this).Config.Bind<float>("Dark Shatterspleen", "Explosion Health %", 15f, "Max-health % dealt per bleed item on death");
			onKillCritDamagePercent = ((BaseUnityPlugin)this).Config.Bind<float>("Dark Shatterspleen", "On-Kill Crit Dmg %", 3f, "Crit damage % bonus upon killing a dark enemy");
			bleedStackingMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Dark Shatterspleen", "Stacking Multiplier", 1f, "Multiplier applied to all per-stack values");
			beetleSpawnInterval = ((BaseUnityPlugin)this).Config.Bind<float>("Kings Gland", "Spawn Interval", 30f, "Seconds between Beetle Guard spawns");
			beetleBaseDamagePercent = ((BaseUnityPlugin)this).Config.Bind<float>("Kings Gland", "Guard Damage %", 300f, "Base % damage of each Beetle Guard");
			beetleBaseHealthPercent = ((BaseUnityPlugin)this).Config.Bind<float>("Kings Gland", "Guard Health %", 300f, "Base % health of each Beetle Guard");
			beetleDebuffStacks = ((BaseUnityPlugin)this).Config.Bind<int>("Kings Gland", "Debuff Stacks per Hit", 1, "Number of debuff stacks Beetle applies on hit");
			beetleMaxGuards = ((BaseUnityPlugin)this).Config.Bind<int>("Kings Gland", "Max Guards", 1, "Maximum simultaneous Beetle Guards");
			beetleOnKillASPercent = ((BaseUnityPlugin)this).Config.Bind<float>("Kings Gland", "Attack Speed Gain per Kill", 3f, "Attack speed % gained on killing a dark enemy");
			coreSpawnInterval = ((BaseUnityPlugin)this).Config.Bind<float>("Sympathy Cores", "Spawn Interval", 10f, "Seconds between each pair of Solus Probe summons");
			coreAllyDamagePerAlly = ((BaseUnityPlugin)this).Config.Bind<float>("Sympathy Cores", "Damage % per Ally", 200f, "Base % damage bonus per ally on your team");
			coreOnKillAllyStatPct = ((BaseUnityPlugin)this).Config.Bind<float>("Sympathy Cores", "On-Kill Ally Stat %", 2f, "Percent buff to all allies’ stats on killing a dark enemy");
			jellyLowHealthThreshold = ((BaseUnityPlugin)this).Config.Bind<float>("Omega Loop", "Low Health Threshold", 0.5f, "Fraction of health to trigger charging");
			jellyRechargeInterval = ((BaseUnityPlugin)this).Config.Bind<float>("Omega Loop", "Charge Interval (s)", 30f, "Base seconds per explosion");
			jellyBaseCharges = ((BaseUnityPlugin)this).Config.Bind<int>("Omega Loop", "Base Charges", 3, "Starting number of charges");
			jellySecondaryBasePct = ((BaseUnityPlugin)this).Config.Bind<float>("Omega Loop", "Secondary Base %", 500f, "Base secondary projectile damage percent");
			jellyOnKillCdrPct = ((BaseUnityPlugin)this).Config.Bind<float>("Omega Loop", "On-Kill CDR %", 1f, "Cooldown reduction percent gained on kill");
			jellyStackingMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Omega Loop", "Stacking Multiplier", 1f, "Multiplier applied to all per-stack values");
			wispCount = ((BaseUnityPlugin)this).Config.Bind<int>("Large Disciple", "Base Wisps", 3, "Number of wisps fired per shot");
			wispBaseDamageMult = ((BaseUnityPlugin)this).Config.Bind<int>("Large Disciple", "Wisp Damage %", 300, "Damage percent per wisp");
			wispProcCoeff = ((BaseUnityPlugin)this).Config.Bind<float>("Large Disciple", "Proc Coefficient", 3f, "Proc coefficient per wisp");
			wispOnKillMoveSpeedPct = ((BaseUnityPlugin)this).Config.Bind<float>("Large Disciple", "On-Kill MoveSpeed %", 3f, "Move-speed % gained on killing a dark enemy");
			wispStackingMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Large Disciple", "Stacking Multiplier", 1f, "Multiplier applied to each per-stack value");
			clayTetherCount = ((BaseUnityPlugin)this).Config.Bind<int>("Polished Urn", "Tether Count", 1, "Base number of enemies tethered to you");
			clayTarBonusDamagePct = ((BaseUnityPlugin)this).Config.Bind<float>("Polished Urn", "Tar Bonus Damage %", 15f, "Bonus damage % against tarred enemies");
			clayHealPct = ((BaseUnityPlugin)this).Config.Bind<float>("Polished Urn", "Heal Percent", 5f, "Heal % of damage dealt to tarred enemies");
			clayDarkKillHealingBonusPct = ((BaseUnityPlugin)this).Config.Bind<float>("Polished Urn", "On-Kill Heal %", 3f, "Healing bonus % gained on dark kill");
			clayStackingMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Polished Urn", "Stacking Multiplier", 1f, "Multiplier applied to all per-stack values");
			parentHealPerArmorPct = ((BaseUnityPlugin)this).Config.Bind<float>("Dark Planula", "Heal Per Armor %", 100f, "Heal percent of armor when damaged");
			parentIgniteRadiusBase = ((BaseUnityPlugin)this).Config.Bind<float>("Dark Planula", "Ignite Radius Base", 13f, "Base radius for ignite explosion");
			parentDarkKillArmorBonus = ((BaseUnityPlugin)this).Config.Bind<float>("Dark Planula", "Dark Kill Armor Bonus", 1.5f, "Armor bonus gained on dark enemy kill");
			parentStackingMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Dark Planula", "Stacking Multiplier", 1f, "Multiplier for all per-stack effects");
			lightningProcChance = ((BaseUnityPlugin)this).Config.Bind<float>("Charged Claw", "Proc Chance %", 10f, "Base % chance to trigger lightning on hit");
			lightningExtraTargets = ((BaseUnityPlugin)this).Config.Bind<int>("Charged Claw", "Extra Targets per Item", 2, "Number of extra enemies struck per item");
			lightningRangeBase = ((BaseUnityPlugin)this).Config.Bind<float>("Charged Claw", "Base Range", 15f, "Base search radius for additional targets");
			lightningDamagePct = ((BaseUnityPlugin)this).Config.Bind<float>("Charged Claw", "Damage %", 1000f, "Base damage % of lightning strike");
			lightningOnKillDamageBonus = ((BaseUnityPlugin)this).Config.Bind<float>("Charged Claw", "On-Kill Damage %", 4f, "Damage % bonus on killing a dark enemy");
			lightningStackingMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Charged Claw", "Stacking Multiplier", 1f, "Multiplier applied to all per-stack values");
			fireProcChance = ((BaseUnityPlugin)this).Config.Bind<float>("Molten Claw", "Proc Chance %", 10f, "Chance to summon magma balls on hit");
			fireBaseBalls = ((BaseUnityPlugin)this).Config.Bind<int>("Molten Claw", "Base Balls", 6, "Number of magma balls summoned per proc");
			fireDamagePct = ((BaseUnityPlugin)this).Config.Bind<float>("Molten Claw", "Base Damage Damage %%", 3000f, "Base damage damage percent percent of each magma ball");
			fireOnKillDamageBonus = ((BaseUnityPlugin)this).Config.Bind<float>("Molten Claw", "On-Kill Damage", 0.5f, "Base damage bonus on dark enemy kill");
			fireStackingMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Molten Claw", "Stacking Multiplier", 1f, "Multiplier applied to all per-stack effects");
			constructHealthPctBase = ((BaseUnityPlugin)this).Config.Bind<float>("Defense Cell", "Construct Health % Base", 1000f, "Alpha Construct health % of base");
			constructOnHitChancePct = ((BaseUnityPlugin)this).Config.Bind<float>("Defense Cell", "On-Hit Fire Chance %", 5f, "Chance per hit for a Construct to fire");
			constructDamagePctBase = ((BaseUnityPlugin)this).Config.Bind<float>("Defense Cell", "Construct Damage % Base", 300f, "Damage % when a Construct fires");
			constructMaxBase = ((BaseUnityPlugin)this).Config.Bind<int>("Defense Cell", "Max Constructs Base", 4, "Number of Constructs you can have");
			constructOnKillLuckGain = ((BaseUnityPlugin)this).Config.Bind<float>("Defense Cell", "On-Kill Luck Gain %", 0.03f, "Luck % gained on killing a dark enemy");
			constructStackingMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Defense Cell", "Stacking Multiplier", 1f, "Multiplier applied to per-stack values");
			Log.Init(((BaseUnityPlugin)this).Logger);
			new Darkness();
			new DarknessShrine();
			new DarknessArtifact();
			new DarknessItems();
		}
	}
	public class DarknessItems
	{
		public class DarkStacksItem
		{
			private Sprite darkGolemSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Knurl/texKnurlIcon.png").WaitForCompletion();

			private GameObject darkGolemPickup = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Knurl/PickupKnurl.prefab").WaitForCompletion();

			public DarkStacksItem()
			{
				//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_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00da: Expected O, but got Unknown
				//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f6: Expected O, but got Unknown
				stackingDarkItem = ScriptableObject.CreateInstance<ItemDef>();
				((Object)stackingDarkItem).name = "DARK_STACK_NAME";
				stackingDarkItem.descriptionToken = "DARK_STACK_DESCRIPTION";
				stackingDarkItem.nameToken = "DARK_STACK_NAME";
				stackingDarkItem.loreToken = "DARK_STACK_LORE";
				stackingDarkItem.pickupToken = "DARK_STACK_PICKUP";
				stackingDarkItem.pickupIconSprite = darkGolemSprite;
				stackingDarkItem.pickupModelPrefab = darkGolemPickup;
				stackingDarkItem.canRemove = false;
				stackingDarkItem.hidden = true;
				stackingDarkItem._itemTierDef = darkTier;
				ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
				stackingDarkItem.itemIndex = (ItemIndex)0;
				ItemAPI.Add(new CustomItem(stackingDarkItem, val));
			}
		}

		public class DarkGolemItem
		{
			public static ItemDef darkGolemItem;

			private Sprite darkGolemSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Knurl/texKnurlIcon.png").WaitForCompletion();

			private GameObject darkGolemPickup = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Knurl/PickupKnurl.prefab").WaitForCompletion();

			private GameObject fistProjectilePrefab = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Titan/TitanPreFistProjectile.prefab").WaitForCompletion(), "Dark Fist");

			public static int baseHealth;

			public static int baseRegen;

			public static float procChance;

			public static int fistBaseDamage;

			public static int fistDamagePerHealth;

			public static int stackingHealth;

			public static int stackingRegen;

			public static float stacking;

			public DarkGolemItem()
			{
				//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_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_0036: Unknown result type (might be due to invalid IL or missing references)
				//IL_003b: Unknown result type (might be due to invalid IL or missing references)
				//IL_016e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0174: Expected O, but got Unknown
				//IL_0186: Unknown result type (might be due to invalid IL or missing references)
				//IL_0190: Expected O, but got Unknown
				//IL_0198: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a2: Expected O, but got Unknown
				baseHealth = DarknessExpansion.golemHealth.Value;
				baseRegen = DarknessExpansion.golemRegen.Value;
				procChance = DarknessExpansion.golemChance.Value;
				fistBaseDamage = DarknessExpansion.golemBaseDamage.Value;
				fistDamagePerHealth = DarknessExpansion.golemDamagePerHealth.Value;
				stackingHealth = DarknessExpansion.golemStackingHealth.Value;
				stackingRegen = DarknessExpansion.golemStackingRegen.Value;
				stacking = DarknessExpansion.golemStacking.Value;
				darkGolemItem = ScriptableObject.CreateInstance<ItemDef>();
				((Object)darkGolemItem).name = "DARK_GOLEM_NAME";
				darkGolemItem.descriptionToken = "DARK_GOLEM_DESCRIPTION";
				darkGolemItem.nameToken = "DARK_GOLEM_NAME";
				darkGolemItem.loreToken = "DARK_GOLEM_LORE";
				darkGolemItem.pickupToken = "DARK_GOLEM_PICKUP";
				darkGolemItem.pickupIconSprite = darkGolemSprite;
				darkGolemItem.pickupModelPrefab = darkGolemPickup;
				darkGolemItem.canRemove = true;
				darkGolemItem.hidden = false;
				darkGolemItem._itemTierDef = darkTier;
				ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
				darkGolemItem.itemIndex = (ItemIndex)0;
				ItemAPI.Add(new CustomItem(darkGolemItem, val));
				HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(HealthComponentOnTakeDamageProcess);
				LanguageAPI.Add("DARK_GOLEM_NAME", "Titanic Boulder");
				LanguageAPI.Add("DARK_GOLEM_DESCRIPTION", $"Gives {baseHealth} (+{(float)baseHealth * stacking} per stack) health and {baseRegen} (+{(float)baseRegen * stacking} per stack) regen. Upon taking damage, {procChance}% chance to summon a fist for {fistBaseDamage}% (+{(float)fistBaseDamage * stacking}% per stack) damage + {fistDamagePerHealth}% damage (+{(float)fistDamagePerHealth * stacking}% per stack) per 500 health. Gives {stackingHealth} (+{(float)stackingHealth * stacking} per stack) health and {stackingRegen} (+{(float)stackingRegen * stacking} per stack) regen upon killing a dark enemy.");
				LanguageAPI.Add("DARK_GOLEM_PICKUP", "Increases health and regen. Upon taking damage, chance to summon a fist. Fist damage scales with health. Grows stronger as it absorbs darkness.");
				darkItems.Add(darkGolemItem);
			}

			private void HealthComponentOnTakeDamageProcess(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageinfo)
			{
				//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f6: Invalid comparison between Unknown and I4
				//IL_0144: Unknown result type (might be due to invalid IL or missing references)
				//IL_0164: Unknown result type (might be due to invalid IL or missing references)
				//IL_0169: Unknown result type (might be due to invalid IL or missing references)
				//IL_0170: 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_01c7: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body) && Object.op_Implicit((Object)(object)self.body.inventory) && Object.op_Implicit((Object)(object)damageinfo.attacker))
				{
					float num = self.body.inventory.GetItemCount(darkGolemItem);
					num = 1f + (num - 1f) * stacking;
					if (num > 0f && Util.CheckRoll(procChance, self.body.master))
					{
						bool crit = self.body.RollCrit();
						float num2 = self.body.damage * self.body.healthComponent.fullCombinedHealth * num * (float)fistDamagePerHealth / 50000f;
						if ((int)self.body.teamComponent.teamIndex != 1)
						{
							num2 = self.body.damage * self.body.healthComponent.fullCombinedHealth * num * (float)fistDamagePerHealth / 500000f;
						}
						num2 += (float)fistBaseDamage / 100f;
						FireProjectileInfo val = default(FireProjectileInfo);
						val.projectilePrefab = fistProjectilePrefab;
						val.position = damageinfo.attacker.transform.position;
						val.rotation = Quaternion.identity;
						val.owner = ((Component)self.body).gameObject;
						val.damage = num2;
						val.force = FireFist.fistForce;
						val.crit = crit;
						val._fuseOverride = FireFist.entryDuration - FireFist.trackingDuration + 2f;
						ProjectileManager.instance.FireProjectile(val);
					}
				}
				orig.Invoke(self, damageinfo);
			}
		}

		public class DarkPearlItem
		{
			public static ItemDef darkPearlItem;

			private Sprite darkPearlSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Pearl/texPearlIcon.png").WaitForCompletion();

			private GameObject darkPearlPickup = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Pearl/PickupPearl.prefab").WaitForCompletion();

			public static float baseHealthPercent;

			public static float onKillHealthPercent;

			public static float stackingMultiplier;

			public DarkPearlItem()
			{
				//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_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_0101: Unknown result type (might be due to invalid IL or missing references)
				//IL_0107: Expected O, but got Unknown
				//IL_0119: Unknown result type (might be due to invalid IL or missing references)
				//IL_0123: Expected O, but got Unknown
				baseHealthPercent = DarknessExpansion.pearlHealthPercent.Value;
				onKillHealthPercent = DarknessExpansion.pearlOnKillPercent.Value;
				stackingMultiplier = DarknessExpansion.pearlStacking.Value;
				darkPearlItem = ScriptableObject.CreateInstance<ItemDef>();
				((Object)darkPearlItem).name = "DARK_PEARL_NAME";
				darkPearlItem.descriptionToken = "DARK_PEARL_DESCRIPTION";
				darkPearlItem.nameToken = "DARK_PEARL_NAME";
				darkPearlItem.loreToken = "DARK_PEARL_LORE";
				darkPearlItem.pickupToken = "DARK_PEARL_PICKUP";
				darkPearlItem.pickupIconSprite = darkPearlSprite;
				darkPearlItem.pickupModelPrefab = darkPearlPickup;
				darkPearlItem.canRemove = true;
				darkPearlItem.hidden = false;
				darkPearlItem._itemTierDef = darkTier;
				ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
				darkPearlItem.itemIndex = (ItemIndex)0;
				ItemAPI.Add(new CustomItem(darkPearlItem, val));
				LanguageAPI.Add("DARK_PEARL_NAME", "Dark Pearl");
				LanguageAPI.Add("DARK_PEARL_DESCRIPTION", $"Increases maximum health by {baseHealthPercent}% " + $"(+{baseHealthPercent * stackingMultiplier}% per stack). " + $"Upon killing a dark enemy, increases health by {onKillHealthPercent}% " + $"(+{onKillHealthPercent * stackingMultiplier}% per stack).");
				LanguageAPI.Add("DARK_PEARL_PICKUP", "Increases health. Grows stronger as it absorbs darkness.");
				darkItems.Add(darkPearlItem);
			}
		}

		public class DarkPearlItem2
		{
			public static ItemDef darkPearlItem;

			private Sprite darkPearlSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/ShinyPearl/texShinyPearlIcon.png").WaitForCompletion();

			private GameObject darkPearlPickup = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ShinyPearl/PickupShinyPearl.prefab").WaitForCompletion();

			public static float allStatsPercent;

			public static float onKillPercent;

			public static float stackingMultiplier;

			public DarkPearlItem2()
			{
				//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_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_0101: Unknown result type (might be due to invalid IL or missing references)
				//IL_0107: Expected O, but got Unknown
				//IL_0119: Unknown result type (might be due to invalid IL or missing references)
				//IL_0123: Expected O, but got Unknown
				allStatsPercent = DarknessExpansion.pearl2AllStatsPercent.Value;
				onKillPercent = DarknessExpansion.pearl2OnKillPercent.Value;
				stackingMultiplier = DarknessExpansion.pearl2Stacking.Value;
				darkPearlItem = ScriptableObject.CreateInstance<ItemDef>();
				((Object)darkPearlItem).name = "DARK_PEARL_NAME2";
				darkPearlItem.descriptionToken = "DARK_PEARL_DESCRIPTION2";
				darkPearlItem.nameToken = "DARK_PEARL_NAME2";
				darkPearlItem.loreToken = "DARK_PEARL_LORE2";
				darkPearlItem.pickupToken = "DARK_PEARL_PICKUP2";
				darkPearlItem.pickupIconSprite = darkPearlSprite;
				darkPearlItem.pickupModelPrefab = darkPearlPickup;
				darkPearlItem.canRemove = true;
				darkPearlItem.hidden = false;
				darkPearlItem._itemTierDef = darkTier;
				ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
				darkPearlItem.itemIndex = (ItemIndex)0;
				ItemAPI.Add(new CustomItem(darkPearlItem, val));
				LanguageAPI.Add("DARK_PEARL_NAME2", "Dark Irradient Pearl");
				LanguageAPI.Add("DARK_PEARL_DESCRIPTION2", $"Increases all stats by {allStatsPercent}% " + $"(+{allStatsPercent * stackingMultiplier}% per stack). " + $"Upon killing a dark enemy, increases all stats by {onKillPercent}% " + $"(+{onKillPercent * stackingMultiplier}% per stack).");
				LanguageAPI.Add("DARK_PEARL_PICKUP2", "Increases all stats. Grows stronger as it absorbs darkness.");
				darkItems.Add(darkPearlItem);
			}
		}

		public class DarkBleedItem
		{
			public static ItemDef darkBleedItem;

			private Sprite darkBleedSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/BleedOnHitAndExplode/texBleedOnHitAndExplodeIcon.png").WaitForCompletion();

			private GameObject darkBleedPickup = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/BleedOnHitAndExplode/DisplayBleedOnHitAndExplode.prefab").WaitForCompletion();

			public static float critChancePercent;

			public static int bleedStacksPerHit;

			public static float explosionBasePercent;

			public static float explosionHealthPercent;

			public static float onKillCritDmgPercent;

			public static float stackingMultiplier;

			public DarkBleedItem()
			{
				//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_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_012e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0134: Expected O, but got Unknown
				//IL_0146: Unknown result type (might be due to invalid IL or missing references)
				//IL_0150: Expected O, but got Unknown
				//IL_0239: Unknown result type (might be due to invalid IL or missing references)
				//IL_0243: Expected O, but got Unknown
				critChancePercent = DarknessExpansion.bleedCritChancePercent.Value;
				bleedStacksPerHit = DarknessExpansion.bleedStacksPerHit.Value;
				explosionBasePercent = DarknessExpansion.explosionBaseDamagePercent.Value;
				explosionHealthPercent = DarknessExpansion.explosionHealthPercent.Value;
				onKillCritDmgPercent = DarknessExpansion.onKillCritDamagePercent.Value;
				stackingMultiplier = DarknessExpansion.bleedStackingMultiplier.Value;
				darkBleedItem = ScriptableObject.CreateInstance<ItemDef>();
				((Object)darkBleedItem).name = "DARK_BLEED_NAME";
				darkBleedItem.descriptionToken = "DARK_BLEED_DESCRIPTION";
				darkBleedItem.nameToken = "DARK_BLEED_NAME";
				darkBleedItem.loreToken = "DARK_BLEED_LORE";
				darkBleedItem.pickupToken = "DARK_BLEED_PICKUP";
				darkBleedItem.pickupIconSprite = darkBleedSprite;
				darkBleedItem.pickupModelPrefab = darkBleedPickup;
				darkBleedItem.canRemove = true;
				darkBleedItem.hidden = false;
				darkBleedItem._itemTierDef = darkTier;
				ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
				darkBleedItem.itemIndex = (ItemIndex)0;
				ItemAPI.Add(new CustomItem(darkBleedItem, val));
				LanguageAPI.Add("DARK_BLEED_NAME", "Dark Shatterspleen");
				LanguageAPI.Add("DARK_BLEED_DESCRIPTION", $"Gain {critChancePercent}% critical chance. " + $"All hits apply {bleedStacksPerHit} bleed stack(s). " + "Crits apply bonus bleed. " + $"Bleeding enemies explode for {explosionBasePercent}% (+{explosionBasePercent * stackingMultiplier}% per stack) " + $"damage per bleed stack + {explosionHealthPercent}% (+{explosionHealthPercent * stackingMultiplier}% per stack) max health. " + $"Upon killing a dark enemy, gain {onKillCritDmgPercent}% (+{onKillCritDmgPercent * stackingMultiplier}% per stack) crit damage.");
				LanguageAPI.Add("DARK_BLEED_PICKUP", "All hits apply bleed, and crits apply extra. Bleeding enemies explode, dealing damage to nearby enemies. Grows stronger as it absorbs darkness.");
				GlobalEventManager.ProcessHitEnemy += new hook_ProcessHitEnemy(GlobalEventManagerOnProcessHitEnemy);
				GlobalEventManager.onCharacterDeathGlobal += GlobalEventManagerOnonCharacterDeathGlobal;
				darkItems.Add(darkBleedItem);
			}

			private void GlobalEventManagerOnonCharacterDeathGlobal(DamageReport obj)
			{
				//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
				//IL_0133: Unknown result type (might be due to invalid IL or missing references)
				//IL_0135: Unknown result type (might be due to invalid IL or missing references)
				//IL_014c: 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_01b5: Unknown result type (might be due to invalid IL or missing references)
				//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)obj.attacker) && Object.op_Implicit((Object)(object)obj.attackerBody) && Object.op_Implicit((Object)(object)obj.attackerBody.inventory) && Object.op_Implicit((Object)(object)obj.victimBody))
				{
					float num = obj.attackerBody.inventory.GetItemCount(darkBleedItem);
					num = 1f + (num - 1f) * stackingMultiplier;
					if ((num > 0f && obj.victimBody.HasBuff(Buffs.Bleeding)) || obj.victimBody.HasBuff(Buffs.SuperBleed))
					{
						Util.PlaySound("Play_bleedOnCritAndExplode_explode", ((Component)obj.victimBody).gameObject);
						Vector3 position = obj.victimBody.transform.position;
						float num2 = explosionBasePercent * num * (float)(obj.victimBody.GetBuffCount(Buffs.Bleeding) + 3) / 100f;
						float num3 = explosionHealthPercent * num / 100f;
						float baseDamage = Util.OnKillProcDamage(obj.attackerBody.damage, num2) + obj.victimBody.maxHealth * num3;
						GameObject val = Object.Instantiate<GameObject>(CommonAssets.bleedOnHitAndExplodeBlastEffect, position, Quaternion.identity);
						DelayBlast component = val.GetComponent<DelayBlast>();
						component.position = position;
						component.baseDamage = baseDamage;
						component.baseForce = 0f;
						component.radius = 16f;
						component.attacker = obj.attacker;
						component.inflictor = null;
						component.crit = Util.CheckRoll(obj.attackerBody.crit, obj.attackerMaster);
						component.maxTimer = 0f;
						component.damageColorIndex = (DamageColorIndex)3;
						component.falloffModel = (FalloffModel)2;
						val.GetComponent<TeamFilter>().teamIndex = obj.attackerTeamIndex;
						NetworkServer.Spawn(val);
					}
				}
			}

			private void GlobalEventManagerOnProcessHitEnemy(orig_ProcessHitEnemy orig, GlobalEventManager self, DamageInfo damageinfo, GameObject victim)
			{
				//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00be: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(self, damageinfo, victim);
				if (!Object.op_Implicit((Object)(object)damageinfo.attacker) || !(damageinfo.procCoefficient > 0f))
				{
					return;
				}
				CharacterBody component = damageinfo.attacker.GetComponent<CharacterBody>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					return;
				}
				CharacterMaster master = component.master;
				if (!Object.op_Implicit((Object)(object)master) || ((ProcChainMask)(ref damageinfo.procChainMask)).HasProc((ProcType)5))
				{
					return;
				}
				Inventory inventory = master.inventory;
				float num = inventory.GetItemCount(darkBleedItem);
				num = 1f + (num - 1f) * stackingMultiplier;
				if (num > 0f)
				{
					ProcChainMask procChainMask = damageinfo.procChainMask;
					((ProcChainMask)(ref procChainMask)).AddProc((ProcType)5);
					int num2 = bleedStacksPerHit;
					if (damageinfo.crit)
					{
						num2 *= (int)component.critMultiplier;
					}
					for (int i = 0; i < num2; i++)
					{
						DotController.InflictDot(victim, damageinfo.attacker, (DotIndex)0, 3f * damageinfo.procCoefficient, 1f, (uint?)null);
					}
				}
			}
		}

		public class DarkBeetleItem
		{
			public class DarkBeetleBodyBehavior : BaseItemBodyBehavior
			{
				private CharacterMaster cm;

				private float guardResummonCooldown;

				[ItemDefAssociation(useOnServer = true, useOnClient = false)]
				private static ItemDef GetItemDef()
				{
					return darkBeetleItem;
				}

				private void Start()
				{
					cm = ((BaseItemBodyBehavior)this).body.master;
					guardResummonCooldown = 0f;
				}

				private void FixedUpdate()
				{
					//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)
					//IL_005a: Unknown result type (might be due to invalid IL or missing references)
					//IL_005f: Unknown result type (might be due to invalid IL or missing references)
					//IL_006a: 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_008b: Expected O, but got Unknown
					//IL_0086: Unknown result type (might be due to invalid IL or missing references)
					//IL_008c: Expected O, but got Unknown
					int deployableCount = cm.GetDeployableCount((DeployableSlot)2);
					if (deployableCount >= base.stack)
					{
						return;
					}
					guardResummonCooldown -= Time.fixedDeltaTime;
					if (guardResummonCooldown <= 0f)
					{
						DirectorSpawnRequest val = new DirectorSpawnRequest(LegacyResourcesAPI.Load<SpawnCard>("SpawnCards/CharacterSpawnCards/cscBeetleGuardAlly"), new DirectorPlacementRule
						{
							placementMode = (PlacementMode)1,
							minDistance = 3f,
							maxDistance = 40f,
							spawnOnTarget = ((Component)this).transform
						}, RoR2Application.rng);
						val.summonerBodyObject = ((Component)this).gameObject;
						val.onSpawnedServer = OnSpawned;
						DirectorCore.instance.TrySpawnObject(val);
						if (deployableCount < base.stack)
						{
							guardResummonCooldown = 1f;
						}
						else
						{
							guardResummonCooldown = spawnInterval;
						}
					}
				}

				private void OnSpawned(SpawnResult obj)
				{
					//IL_0001: Unknown result type (might be due to invalid IL or missing references)
					//IL_0014: 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_005d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0091: Unknown result type (might be due to invalid IL or missing references)
					if (Object.op_Implicit((Object)(object)obj.spawnedInstance))
					{
						Deployable component = obj.spawnedInstance.GetComponent<Deployable>();
						cm.AddDeployable(component, (DeployableSlot)2);
						CharacterBody body = obj.spawnedInstance.GetComponent<CharacterMaster>().GetBody();
						body.baseDamage *= (float)base.stack * baseDamagePct / 100f;
						CharacterBody body2 = obj.spawnedInstance.GetComponent<CharacterMaster>().GetBody();
						body2.baseMaxHealth *= (float)base.stack * baseHealthPct / 100f;
						for (int i = 0; i < base.stack; i++)
						{
							obj.spawnedInstance.GetComponent<CharacterMaster>().GetBody().AddBuff(debuffApplier);
						}
					}
				}
			}

			public static ItemDef darkBeetleItem;

			private Sprite darkBeetleSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/BeetleGland/texBeetleGlandIcon.png").WaitForCompletion();

			private GameObject darkBeetlePickup = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/BeetleGland/PickupBeetleGland.prefab").WaitForCompletion();

			private static BuffDef debuffApplier;

			public static float spawnInterval;

			public static float baseDamagePct;

			public static float baseHealthPct;

			public static int debuffStacks;

			public static int maxGuards;

			public static float onKillASPct;

			public DarkBeetleItem()
			{
				//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_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_012e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0134: Expected O, but got Unknown
				//IL_0146: Unknown result type (might be due to invalid IL or missing references)
				//IL_0150: Expected O, but got Unknown
				//IL_0298: Unknown result type (might be due to invalid IL or missing references)
				//IL_02a2: Expected O, but got Unknown
				//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
				//IL_02b4: Expected O, but got Unknown
				spawnInterval = DarknessExpansion.beetleSpawnInterval.Value;
				baseDamagePct = DarknessExpansion.beetleBaseDamagePercent.Value;
				baseHealthPct = DarknessExpansion.beetleBaseHealthPercent.Value;
				debuffStacks = DarknessExpansion.beetleDebuffStacks.Value;
				maxGuards = DarknessExpansion.beetleMaxGuards.Value;
				onKillASPct = DarknessExpansion.beetleOnKillASPercent.Value;
				darkBeetleItem = ScriptableObject.CreateInstance<ItemDef>();
				((Object)darkBeetleItem).name = "DARK_BEETLE_NAME";
				darkBeetleItem.descriptionToken = "DARK_BEETLE_DESCRIPTION";
				darkBeetleItem.nameToken = "DARK_BEETLE_NAME";
				darkBeetleItem.loreToken = "DARK_BEETLE_LORE";
				darkBeetleItem.pickupToken = "DARK_BEETLE_PICKUP";
				darkBeetleItem.pickupIconSprite = darkBeetleSprite;
				darkBeetleItem.pickupModelPrefab = darkBeetlePickup;
				darkBeetleItem.canRemove = true;
				darkBeetleItem.hidden = false;
				darkBeetleItem._itemTierDef = darkTier;
				ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
				darkBeetleItem.itemIndex = (ItemIndex)0;
				ItemAPI.Add(new CustomItem(darkBeetleItem, val));
				LanguageAPI.Add("DARK_BEETLE_NAME", "King's Gland");
				LanguageAPI.Add("DARK_BEETLE_DESCRIPTION", $"Every {spawnInterval}s, summon a Beetle Guard with " + $"{baseDamagePct}% (+{baseDamagePct}% per stack) damage and " + $"{baseHealthPct}% (+{baseHealthPct}% per stack) health. " + $"Beetle Guards apply {debuffStacks} (+{debuffStacks} per stack) debuff on hit. " + $"Can have up to {maxGuards} (+{maxGuards} per stack) guard(s) at a time. " + "Give your beetles your attack speed. " + $"Upon killing a dark enemy, gain {onKillASPct}% (+{onKillASPct}% per stack) attack speed.");
				LanguageAPI.Add("DARK_BEETLE_PICKUP", "Summon a beetle guard which applies random debuffs on hit. Grows stronger as it absorbs darkness.");
				darkItems.Add(darkBeetleItem);
				debuffApplier = ScriptableObject.CreateInstance<BuffDef>();
				debuffApplier.isHidden = true;
				debuffApplier.canStack = true;
				debuffApplier.isCooldown = false;
				ContentAddition.AddBuffDef(debuffApplier);
				GlobalEventManager.ProcessHitEnemy += new hook_ProcessHitEnemy(GlobalEventManagerOnProcessHitEnemy);
				CharacterMaster.GetDeployableSameSlotLimit += new hook_GetDeployableSameSlotLimit(CharacterMasterOnGetDeployableSameSlotLimit);
				MasterSummon.onServerMasterSummonGlobal += MasterSummonOnonServerMasterSummonGlobal;
			}

			private void MasterSummonOnonServerMasterSummonGlobal(MasterSummonReport obj)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				//IL_0041: Unknown result type (might be due to invalid IL or missing references)
				//IL_0062: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)obj.leaderMasterInstance) && Object.op_Implicit((Object)(object)obj.leaderMasterInstance.inventory) && obj.leaderMasterInstance.inventory.GetItemCount(darkBeetleItem) > 0)
				{
					float attackSpeed = obj.leaderMasterInstance.GetBody().attackSpeed;
					int num = (int)((attackSpeed - 1f) / 0.15f);
					obj.summonMasterInstance.inventory.GiveItemString("Syringe", num);
				}
			}

			private int CharacterMasterOnGetDeployableSameSlotLimit(orig_GetDeployableSameSlotLimit orig, CharacterMaster self, DeployableSlot slot)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0003: Invalid comparison between Unknown and I4
				//IL_0051: Unknown result type (might be due to invalid IL or missing references)
				if ((int)slot == 2)
				{
					int num = 1;
					if (RunArtifactManager.instance.IsArtifactEnabled(Artifacts.swarmsArtifactDef))
					{
						num = 2;
					}
					return num * (self.inventory.GetItemCount(Items.BeetleGland) + self.inventory.GetItemCount(darkBeetleItem) * maxGuards);
				}
				return orig.Invoke(self, slot);
			}

			private void GlobalEventManagerOnProcessHitEnemy(orig_ProcessHitEnemy orig, GlobalEventManager self, DamageInfo damageinfo, GameObject victim)
			{
				if (Object.op_Implicit((Object)(object)damageinfo.attacker))
				{
					CharacterBody component = damageinfo.attacker.GetComponent<CharacterBody>();
					if (Object.op_Implicit((Object)(object)component) && component.HasBuff(debuffApplier))
					{
						int num = component.GetBuffCount(debuffApplier) * debuffStacks;
						for (int i = 0; i < num; i++)
						{
							CharacterBody component2 = victim.GetComponent<CharacterBody>();
							BuffDef val = BuffCatalog.buffDefs[(int)((float)BuffCatalog.buffDefs.Length * Random.value)];
							while (!val.isDebuff)
							{
								val = BuffCatalog.buffDefs[(int)((float)BuffCatalog.buffDefs.Length * Random.value)];
							}
							component2.AddTimedBuff(val, 10f);
						}
					}
				}
				orig.Invoke(self, damageinfo, victim);
			}
		}

		public class DarkCoreItem
		{
			public class DarkStacksItem
			{
				public static ItemDef stackingDarkItem;

				private Sprite darkGolemSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Knurl/texKnurlIcon.png").WaitForCompletion();

				private GameObject darkGolemPickup = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Knurl/PickupKnurl.prefab").WaitForCompletion();

				public DarkStacksItem()
				{
					//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_001e: Unknown result type (might be due to invalid IL or missing references)
					//IL_0023: Unknown result type (might be due to invalid IL or missing references)
					//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
					//IL_00da: Expected O, but got Unknown
					//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
					//IL_00f6: Expected O, but got Unknown
					stackingDarkItem = ScriptableObject.CreateInstance<ItemDef>();
					((Object)stackingDarkItem).name = "DARK_STACK_NAME2";
					stackingDarkItem.descriptionToken = "DARK_STACK_DESCRIPTION2";
					stackingDarkItem.nameToken = "DARK_STACK_NAME2";
					stackingDarkItem.loreToken = "DARK_STACK_LORE2";
					stackingDarkItem.pickupToken = "DARK_STACK_PICKUP2";
					stackingDarkItem.pickupIconSprite = darkGolemSprite;
					stackingDarkItem.pickupModelPrefab = darkGolemPickup;
					stackingDarkItem.canRemove = false;
					stackingDarkItem.hidden = true;
					stackingDarkItem._itemTierDef = darkTier;
					ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
					stackingDarkItem.itemIndex = (ItemIndex)0;
					ItemAPI.Add(new CustomItem(stackingDarkItem, val));
				}
			}

			private class InventorySync : MonoBehaviour
			{
				public Inventory srcInventory;

				public Inventory destInventory;

				private int granted;

				private int granted2;

				private void FixedUpdate()
				{
					if (Object.op_Implicit((Object)(object)srcInventory) && Object.op_Implicit((Object)(object)destInventory))
					{
						int num = (int)((float)srcInventory.GetItemCount(darkCoreItem) * dmgPerAllyPct / 100f);
						int num2 = num - granted;
						if (num2 != 0)
						{
							destInventory.GiveItem(Items.TeamSizeDamageBonus, num2);
							granted = num;
						}
						int num3 = srcInventory.GetItemCount(stackingDarkItem);
						if (logStacking && sqrtStacking)
						{
							num3 = 0;
						}
						else if (logStacking)
						{
							num3 = (int)Mathf.Log((float)(num3 + 1), 2f);
						}
						else if (sqrtStacking)
						{
							num3 = (int)Mathf.Sqrt((float)num3);
						}
						num = srcInventory.GetItemCount(darkCoreItem) * num3;
						num2 = num - granted2;
						if (num2 != 0)
						{
							destInventory.GiveItem(DarkStacksItem.stackingDarkItem, num2);
							granted2 = num;
						}
					}
				}
			}

			public class DarkCoreBodyBehavior : BaseItemBodyBehavior
			{
				private DeployableMinionSpawner redBuddySpawner;

				private DeployableMinionSpawner greenBuddySpawner;

				private CharacterMaster cm;

				[ItemDefAssociation(useOnServer = true, useOnClient = false)]
				private static ItemDef GetItemDef()
				{
					return darkCoreItem;
				}

				private void Start()
				{
					cm = ((BaseItemBodyBehavior)this).body.master;
				}

				private void FixedUpdate()
				{
					if (redBuddySpawner == null && ((Behaviour)this).isActiveAndEnabled)
					{
						CreateSpawners();
					}
				}

				private void CreateSpawners()
				{
					//IL_000f: Unknown result type (might be due to invalid IL or missing references)
					//IL_0014: Unknown result type (might be due to invalid IL or missing references)
					//IL_0030: Unknown result type (might be due to invalid IL or missing references)
					//IL_0035: Unknown result type (might be due to invalid IL or missing references)
					CreateSpawner(ref redBuddySpawner, (DeployableSlot)12, Addressables.LoadAssetAsync<SpawnCard>((object)"RoR2/Base/RoboBallBuddy/cscRoboBallRedBuddy.asset").WaitForCompletion());
					CreateSpawner(ref greenBuddySpawner, (DeployableSlot)13, Addressables.LoadAssetAsync<SpawnCard>((object)"RoR2/Base/RoboBallBuddy/cscRoboBallGreenBuddy.asset").WaitForCompletion());
				}

				private void CreateSpawner(ref DeployableMinionSpawner dms, DeployableSlot ds, SpawnCard sc)
				{
					//IL_0008: 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_001c: Expected O, but got Unknown
					//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)
					//IL_0027: Unknown result type (might be due to invalid IL or missing references)
					//IL_002f: Expected O, but got Unknown
					dms = new DeployableMinionSpawner(cm, ds, new Xoroshiro128Plus((ulong)Random.value * ulong.MaxValue))
					{
						respawnInterval = spawnInterval,
						spawnCard = sc
					};
				}
			}

			public static ItemDef darkCoreItem;

			private Sprite darkCoreSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/RoboBallBuddy/texEmpathyChip.png").WaitForCompletion();

			private GameObject darkCorePickup = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/RoboBallBuddy/PickupEmpathyChip.prefab").WaitForCompletion();

			public static float spawnInterval;

			public static float dmgPerAllyPct;

			public static float onKillAllyPct;

			public DarkCoreItem()
			{
				//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_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_0101: Unknown result type (might be due to invalid IL or missing references)
				//IL_0107: Expected O, but got Unknown
				//IL_0119: Unknown result type (might be due to invalid IL or missing references)
				//IL_0123: Expected O, but got Unknown
				spawnInterval = DarknessExpansion.coreSpawnInterval.Value;
				dmgPerAllyPct = DarknessExpansion.coreAllyDamagePerAlly.Value;
				onKillAllyPct = DarknessExpansion.coreOnKillAllyStatPct.Value;
				darkCoreItem = ScriptableObject.CreateInstance<ItemDef>();
				((Object)darkCoreItem).name = "DARK_CORE_NAME";
				darkCoreItem.descriptionToken = "DARK_CORE_DESCRIPTION";
				darkCoreItem.nameToken = "DARK_CORE_NAME";
				darkCoreItem.loreToken = "DARK_CORE_LORE";
				darkCoreItem.pickupToken = "DARK_CORE_PICKUP";
				darkCoreItem.pickupIconSprite = darkCoreSprite;
				darkCoreItem.pickupModelPrefab = darkCorePickup;
				darkCoreItem.canRemove = true;
				darkCoreItem.hidden = false;
				darkCoreItem._itemTierDef = darkTier;
				ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
				darkCoreItem.itemIndex = (ItemIndex)0;
				ItemAPI.Add(new CustomItem(darkCoreItem, val));
				LanguageAPI.Add("DARK_CORE_NAME", "Sympathy Cores");
				LanguageAPI.Add("DARK_CORE_DESCRIPTION", $"Every {spawnInterval}s, summon two Solus Probes. " + $"All summons gain +{dmgPerAllyPct}% (+{dmgPerAllyPct}% per stack) damage per ally on your team. " + $"Upon killing a dark enemy, increase all your allies’ stats by {onKillAllyPct}% (+{onKillAllyPct}% per stack).");
				LanguageAPI.Add("DARK_CORE_PICKUP", "Summon probes. All allies gain stats per ally on your team. Grows stronger as it absorbs darkness.");
				darkItems.Add(darkCoreItem);
				new DarkStacksItem();
				MasterSummon.onServerMasterSummonGlobal += MasterSummonOnonServerMasterSummonGlobal;
			}

			private void MasterSummonOnonServerMasterSummonGlobal(MasterSummonReport obj)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				//IL_002a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0047: Unknown result type (might be due to invalid IL or missing references)
				//IL_0057: 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_0096: Unknown result type (might be due to invalid IL or missing references)
				if (!Object.op_Implicit((Object)(object)obj.leaderMasterInstance) || !Object.op_Implicit((Object)(object)obj.leaderMasterInstance.inventory) || obj.leaderMasterInstance.inventory.GetItemCount(darkCoreItem) <= 0 || !Object.op_Implicit((Object)(object)obj.summonMasterInstance))
				{
					return;
				}
				CharacterMaster summonMasterInstance = obj.summonMasterInstance;
				if (Object.op_Implicit((Object)(object)summonMasterInstance))
				{
					Inventory inventory = obj.leaderMasterInstance.GetBody().inventory;
					Inventory inventory2 = summonMasterInstance.inventory;
					if (Object.op_Implicit((Object)(object)inventory))
					{
						InventorySync inventorySync = ((Component)obj.summonMasterInstance).gameObject.AddComponent<InventorySync>();
						inventorySync.srcInventory = inventory;
						inventorySync.destInventory = inventory2;
					}
				}
			}
		}

		public class DarkJellyfishItem
		{
			public class DarkJellyfishItemBehavior : BaseItemBodyBehavior
			{
				private NetworkedBodyAttachment attachment;

				private GameObject projectilePrefab;

				private SkillLocator skillLocator;

				private InputBankTest inputBank;

				private float reloadTimer = 0f;

				[ItemDefAssociation(useOnServer = true, useOnClient = false)]
				private static ItemDef GetItemDef()
				{
					return darkJellyfishItem;
				}

				private void Start()
				{
					//IL_0039: Unknown result type (might be due to invalid IL or missing references)
					//IL_003e: Unknown result type (might be due to invalid IL or missing references)
					attachment = Object.Instantiate<GameObject>(LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/BodyAttachments/VagrantNovaItemBodyAttachment")).GetComponent<NetworkedBodyAttachment>();
					attachment.AttachToGameObjectAndSpawn(((Component)((BaseItemBodyBehavior)this).body).gameObject, (string)null);
					projectilePrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Vagrant/VagrantCannon.prefab").WaitForCompletion();
					if (Object.op_Implicit((Object)(object)((BaseItemBodyBehavior)this).body))
					{
						((BaseItemBodyBehavior)this).body.onSkillActivatedServer += OnSkillActivated;
						skillLocator = ((Component)((BaseItemBodyBehavior)this).body).GetComponent<SkillLocator>();
						inputBank = ((Component)((BaseItemBodyBehavior)this).body).GetComponent<InputBankTest>();
					}
				}

				private void FixedUpdate()
				{
					if (!((BaseItemBodyBehavior)this).body.healthComponent.alive)
					{
						Object.Destroy((Object)(object)this);
					}
					float num = base.stack;
					num = 1f + (num - 1f) * stackingMult;
					int num2 = (int)num * baseCharges;
					if (((BaseItemBodyBehavior)this).body.GetBuffCount(chargeBuff) < num2)
					{
						float num3 = 10f * skillLocator.primary.cooldownScale / (float)num2;
						reloadTimer += Time.fixedDeltaTime;
						while (reloadTimer > num3 && ((BaseItemBodyBehavior)this).body.GetBuffCount(chargeBuff) < num2)
						{
							((BaseItemBodyBehavior)this).body.AddBuff(chargeBuff);
							reloadTimer -= num3;
						}
					}
				}

				private void OnSkillActivated(GenericSkill skill)
				{
					if ((Object)(object)(Object.op_Implicit((Object)(object)skillLocator) ? skillLocator.secondary : null) == (Object)(object)skill && ((BaseItemBodyBehavior)this).body.GetBuffCount(chargeBuff) > 0)
					{
						if (NetworkServer.active)
						{
							((BaseItemBodyBehavior)this).body.RemoveBuff(chargeBuff);
						}
						FireLightning();
					}
				}

				private void FireLightning()
				{
					//IL_000d: 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_003c: Unknown result type (might be due to invalid IL or missing references)
					//IL_0043: Unknown result type (might be due to invalid IL or missing references)
					//IL_0048: Unknown result type (might be due to invalid IL or missing references)
					//IL_004e: 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)
					Log.Debug("Firing");
					Ray aimRay = GetAimRay();
					float num = base.stack;
					num = 1f + (num - 1f) * stackingMult;
					ProjectileManager.instance.FireProjectileWithoutDamageType(projectilePrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction) * GetRandomRollPitch(), ((Component)this).gameObject, ((BaseItemBodyBehavior)this).body.damage * (secondaryBasePct * num / 100f), 0f, Util.CheckRoll(((BaseItemBodyBehavior)this).body.crit, ((BaseItemBodyBehavior)this).body.master), (DamageColorIndex)3, (GameObject)null, -1f);
				}

				private Quaternion GetRandomRollPitch()
				{
					//IL_000d: 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)
					//IL_002d: 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_0037: 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_0039: 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_003f: Unknown result type (might be due to invalid IL or missing references)
					//IL_0042: Unknown result type (might be due to invalid IL or missing references)
					Quaternion val = Quaternion.AngleAxis((float)Random.Range(0, 360), Vector3.forward);
					Quaternion val2 = Quaternion.AngleAxis(0f + Random.Range(0f, 1f), Vector3.left);
					return val * val2;
				}

				private Ray GetAimRay()
				{
					//IL_0035: Unknown result type (might be due to invalid IL or missing references)
					//IL_0040: 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_004a: 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_0022: Unknown result type (might be due to invalid IL or missing references)
					//IL_0027: Unknown result type (might be due to invalid IL or missing references)
					//IL_002c: Unknown result type (might be due to invalid IL or missing references)
					//IL_004d: Unknown result type (might be due to invalid IL or missing references)
					if (Object.op_Implicit((Object)(object)inputBank))
					{
						return new Ray(inputBank.aimOrigin, inputBank.aimDirection);
					}
					return new Ray(((Component)this).transform.position, ((Component)this).transform.forward);
				}

				private void OnDestroy()
				{
					if (Object.op_Implicit((Object)(object)attachment))
					{
						Object.Destroy((Object)(object)((Component)attachment).gameObject);
						attachment = null;
					}
					if (Object.op_Implicit((Object)(object)((BaseItemBodyBehavior)this).body))
					{
						((BaseItemBodyBehavior)this).body.onSkillActivatedServer -= OnSkillActivated;
						while (((BaseItemBodyBehavior)this).body.HasBuff(chargeBuff))
						{
							((BaseItemBodyBehavior)this).body.RemoveBuff(chargeBuff);
						}
					}
				}
			}

			public static ItemDef darkJellyfishItem;

			private Sprite darkJellyfishSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/NovaOnLowHealth/texJellyGutsIcon.png").WaitForCompletion();

			private GameObject darkJellyfishPickup = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/NovaOnLowHealth/PickupJellyGuts.prefab").WaitForCompletion();

			private static BuffDef chargeBuff;

			public static float lowHealthThreshold;

			public static float rechargeInterval;

			public static int baseCharges;

			public static float secondaryBasePct;

			public static float onKillCdrPct;

			public static float stackingMult;

			public DarkJellyfishItem()
			{
				//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_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_012e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0134: Expected O, but got Unknown
				//IL_0146: Unknown result type (might be due to invalid IL or missing references)
				//IL_0150: Expected O, but got Unknown
				//IL_028f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0299: Expected O, but got Unknown
				//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
				//IL_02ab: Expected O, but got Unknown
				//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
				//IL_02bd: Expected O, but got Unknown
				lowHealthThreshold = DarknessExpansion.jellyLowHealthThreshold.Value;
				rechargeInterval = DarknessExpansion.jellyRechargeInterval.Value;
				baseCharges = DarknessExpansion.jellyBaseCharges.Value;
				secondaryBasePct = DarknessExpansion.jellySecondaryBasePct.Value;
				onKillCdrPct = DarknessExpansion.jellyOnKillCdrPct.Value;
				stackingMult = DarknessExpansion.jellyStackingMultiplier.Value;
				darkJellyfishItem = ScriptableObject.CreateInstance<ItemDef>();
				((Object)darkJellyfishItem).name = "DARK_JELLYFISH_NAME";
				darkJellyfishItem.descriptionToken = "DARK_JELLYFISH_DESCRIPTION";
				darkJellyfishItem.nameToken = "DARK_JELLYFISH_NAME";
				darkJellyfishItem.loreToken = "DARK_JELLYFISH_LORE";
				darkJellyfishItem.pickupToken = "DARK_JELLYFISH_PICKUP";
				darkJellyfishItem.pickupIconSprite = darkJellyfishSprite;
				darkJellyfishItem.pickupModelPrefab = darkJellyfishPickup;
				darkJellyfishItem.canRemove = true;
				darkJellyfishItem.hidden = false;
				darkJellyfishItem._itemTierDef = darkTier;
				ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
				darkJellyfishItem.itemIndex = (ItemIndex)0;
				ItemAPI.Add(new CustomItem(darkJellyfishItem, val));
				LanguageAPI.Add("DARK_JELLYFISH_NAME", "Omega Loop");
				LanguageAPI.Add("DARK_JELLYFISH_DESCRIPTION", $"When below {lowHealthThreshold * 100f}% health, every " + $"{rechargeInterval}/2 (+{stackingMult} per stack) seconds, " + $"charge an explosion, dealing 6000% (+{6000f * stackingMult}% per stack) damage." + $"Additionally, gain {baseCharges} (+{(float)baseCharges * stackingMult} per stack) charges. " + $"Upon using your secondary, release a ball dealing {secondaryBasePct}% (+{secondaryBasePct * stackingMult}% per stack) damage. " + $"On killing a dark enemy, gain {onKillCdrPct}% (+{onKillCdrPct * stackingMult}% per stack) cooldown reduction.");
				LanguageAPI.Add("DARK_JELLYFISH_PICKUP", "Upon reaching low health, explode in an area. Upon using your secondary, release a ball of lightning. Grows stronger as it absorbs darkness.");
				darkItems.Add(darkJellyfishItem);
				chargeBuff = ScriptableObject.CreateInstance<BuffDef>();
				chargeBuff.canStack = true;
				chargeBuff.isHidden = true;
				BaseVagrantNovaItemState.GetItemStack += new hook_GetItemStack(BaseVagrantNovaItemStateOnGetItemStack);
				ReadyState.FixedUpdate += new hook_FixedUpdate(ReadyStateOnFixedUpdate);
				RechargeState.FixedUpdate += new hook_FixedUpdate(RechargeStateOnFixedUpdate);
				ContentAddition.AddBuffDef(chargeBuff);
			}

			private void RechargeStateOnFixedUpdate(orig_FixedUpdate orig, RechargeState self)
			{
				//IL_00af: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b9: Expected O, but got Unknown
				if (((BaseBodyAttachmentState)self).attachedBody.inventory.GetItemCount(darkJellyfishItem) > 0)
				{
					((EntityState)self).fixedAge = ((EntityState)self).fixedAge + ((EntityState)self).GetDeltaTime();
					if (((EntityState)self).isAuthority)
					{
						float num = ((BaseVagrantNovaItemState)self).GetItemStack();
						num = 1f + (num - 1f) * stackingMult;
						float num2 = rechargeInterval / (num + 1f);
						num2 *= ((BaseBodyAttachmentState)self).attachedBody.skillLocator.primary.cooldownScale;
						float num3 = ((EntityState)self).fixedAge / num2;
						if (num3 >= 1f)
						{
							num3 = 1f;
							((EntityState)self).outer.SetNextState((EntityState)new ReadyState());
						}
						((BaseVagrantNovaItemState)self).SetChargeSparkEmissionRateMultiplier(RechargeState.particleEmissionCurve.Evaluate(num3));
					}
				}
				else
				{
					orig.Invoke(self);
				}
			}

			private void ReadyStateOnFixedUpdate(orig_FixedUpdate orig, ReadyState self)
			{
				//IL_0061: Unknown result type (might be due to invalid IL or missing references)
				//IL_006b: Expected O, but got Unknown
				if (((BaseBodyAttachmentState)self).attachedBody.inventory.GetItemCount(darkJellyfishItem) > 0)
				{
					if (((EntityState)self).isAuthority && (self.attachedHealthComponent.health + self.attachedHealthComponent.shield) / self.attachedHealthComponent.fullCombinedHealth <= lowHealthThreshold)
					{
						((EntityState)self).outer.SetNextState((EntityState)new ChargeState());
					}
				}
				else
				{
					orig.Invoke(self);
				}
			}

			private int BaseVagrantNovaItemStateOnGetItemStack(orig_GetItemStack orig, BaseVagrantNovaItemState self)
			{
				if (!Object.op_Implicit((Object)(object)((BaseBodyAttachmentState)self).attachedBody) || !Object.op_Implicit((Object)(object)((BaseBodyAttachmentState)self).attachedBody.inventory))
				{
					return 1;
				}
				return ((BaseBodyAttachmentState)self).attachedBody.inventory.GetItemCount(Items.NovaOnLowHealth) + ((BaseBodyAttachmentState)self).attachedBody.inventory.GetItemCount(darkJellyfishItem);
			}
		}

		public class DarkWispItem
		{
			public class DarkWispItemBehavior : BaseItemBodyBehavior
			{
				private float fireTimer;

				[ItemDefAssociation(useOnServer = true, useOnClient = false)]
				private static ItemDef GetItemDef()
				{
					return darkWispItem;
				}

				private void FixedUpdate()
				{
					if (((BaseItemBodyBehavior)this).body.isSprinting)
					{
						fireTimer -= Time.fixedDeltaTime;
						if (fireTimer <= 0f && ((BaseItemBodyBehavior)this).body.moveSpeed > 0f)
						{
							fireTimer += 1f / (3f / 35f * ((BaseItemBodyBehavior)this).body.moveSpeed);
							Fire();
						}
					}
				}

				private void Fire()
				{
					//IL_0025: Unknown result type (might be due to invalid IL or missing references)
					//IL_002a: Unknown result type (might be due to invalid IL or missing references)
					//IL_0031: Unknown result type (might be due to invalid IL or missing references)
					//IL_0036: Unknown result type (might be due to invalid IL or missing references)
					//IL_003b: Unknown result type (might be due to invalid IL or missing references)
					//IL_005a: 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_006b: Unknown result type (might be due to invalid IL or missing references)
					//IL_0070: Unknown result type (might be due to invalid IL or missing references)
					//IL_007c: Unknown result type (might be due to invalid IL or missing references)
					//IL_007e: Unknown result type (might be due to invalid IL or missing references)
					//IL_0083: 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_0090: Unknown result type (might be due to invalid IL or missing references)
					//IL_0095: Unknown result type (might be due to invalid IL or missing references)
					//IL_00a3: Expected O, but got Unknown
					//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
					float num = base.stack;
					num = 1f + (num - 1f) * stackingMult;
					for (int i = 0; (float)i < (float)baseWisps * num; i++)
					{
						DevilOrb val = new DevilOrb
						{
							origin = ((BaseItemBodyBehavior)this).body.corePosition,
							damageValue = ((BaseItemBodyBehavior)this).body.damage * damageMult * num / 100f,
							teamIndex = ((BaseItemBodyBehavior)this).body.teamComponent.teamIndex,
							attacker = ((Component)this).gameObject,
							damageColorIndex = (DamageColorIndex)3,
							scale = 3f,
							effectType = (EffectType)1,
							procCoefficient = procCoeff * num
						};
						if (Object.op_Implicit((Object)(object)(((Orb)val).target = val.PickNextTarget(((Orb)val).origin, 40f))))
						{
							val.isCrit = Util.CheckRoll(((BaseItemBodyBehavior)this).body.crit, ((BaseItemBodyBehavior)this).body.master);
							OrbManager.instance.AddOrb((Orb)(object)val);
						}
					}
				}
			}

			public static ItemDef darkWispItem;

			private Sprite darkWispSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/SprintWisp/texBrokenMaskIcon.png").WaitForCompletion();

			private GameObject darkWispPickup = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/SprintWisp/PickupBrokenMask.prefab").WaitForCompletion();

			public static int baseWisps;

			public static float damageMult;

			public static float procCoeff;

			public static float onKillMoveSpeedPct;

			public static float stackingMult;

			public DarkWispItem()
			{
				//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_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_0120: Unknown result type (might be due to invalid IL or missing references)
				//IL_0126: Expected O, but got Unknown
				//IL_0138: Unknown result type (might be due to invalid IL or missing references)
				//IL_0142: Expected O, but got Unknown
				baseWisps = DarknessExpansion.wispCount.Value;
				damageMult = DarknessExpansion.wispBaseDamageMult.Value;
				procCoeff = DarknessExpansion.wispProcCoeff.Value;
				onKillMoveSpeedPct = DarknessExpansion.wispOnKillMoveSpeedPct.Value;
				stackingMult = DarknessExpansion.wispStackingMultiplier.Value;
				darkWispItem = ScriptableObject.CreateInstance<ItemDef>();
				((Object)darkWispItem).name = "DARK_WISP_NAME";
				darkWispItem.descriptionToken = "DARK_WISP_DESCRIPTION";
				darkWispItem.nameToken = "DARK_WISP_NAME";
				darkWispItem.loreToken = "DARK_WISP_LORE";
				darkWispItem.pickupToken = "DARK_WISP_PICKUP";
				darkWispItem.pickupIconSprite = darkWispSprite;
				darkWispItem.pickupModelPrefab = darkWispPickup;
				darkWispItem.canRemove = true;
				darkWispItem.hidden = false;
				darkWispItem._itemTierDef = darkTier;
				ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
				darkWispItem.itemIndex = (ItemIndex)0;
				ItemAPI.Add(new CustomItem(darkWispItem, val));
				LanguageAPI.Add("DARK_WISP_NAME", "Large Disciple");
				LanguageAPI.Add("DARK_WISP_DESCRIPTION", $"Fire {baseWisps} (+{(float)baseWisps * stackingMult} per stack) tracking wisps for " + $"{damageMult}% (+{damageMult * stackingMult}% per stack) base damage. " + $"Wisps have {procCoeff} (+{procCoeff * stackingMult} per stack) proc coefficient. " + "Fires every 1.6 seconds while sprinting; fire rate increases with move speed. " + $"Upon killing a dark enemy, gain {onKillMoveSpeedPct}% (+{onKillMoveSpeedPct * stackingMult}% per stack) movement speed.");
				LanguageAPI.Add("DARK_WISP_PICKUP", "Fire 3 tracking wisps while sprinting. Fire rate scales with move speed. Grows stronger as it absorbs darkness.");
				darkItems.Add(darkWispItem);
			}
		}

		public class DarkClayItem
		{
			public class DarkClayItemBehavior : BaseItemBodyBehavior
			{
				private NetworkedBodyAttachment attachment;

				private SiphonNearbyController siphonNearbyController;

				[ItemDefAssociation(useOnServer = true, useOnClient = false)]
				private static ItemDef GetItemDef()
				{
					return darkClayItem;
				}

				private void OnEnable()
				{
					attachment = Object.Instantiate<GameObject>(LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/BodyAttachments/SiphonNearbyBodyAttachment")).GetComponent<NetworkedBodyAttachment>();
					attachment.AttachToGameObjectAndSpawn(((Component)((BaseItemBodyBehavior)this).body).gameObject, (string)null);
					siphonNearbyController = ((Component)attachment).GetComponent<SiphonNearbyController>();
				}

				private void OnDisable()
				{
					DestroyAttachment();
				}

				private void FixedUpdate()
				{
					float num = base.stack;
					num = 1f + (num - 1f) * stackMult;
					siphonNearbyController.NetworkmaxTargets = (((BaseItemBodyBehavior)this).body.healthComponent.alive ? ((int)(num * (float)baseTethers)) : 0);
				}

				private void DestroyAttachment()
				{
					if (Object.op_Implicit((Object)(object)attachment))
					{
						Object.Destroy((Object)(object)((Component)attachment).gameObject);
					}
					attachment = null;
					siphonNearbyController = null;
				}
			}

			public static ItemDef darkClayItem;

			private Sprite darkClaySprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/SiphonOnLowHealth/texSiphonOnLowHealthIcon.png").WaitForCompletion();

			private GameObject darkClayPickup = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/SiphonOnLowHealth/PickupSiphonOnLowHealth.prefab").WaitForCompletion();

			public static int baseTethers;

			public static float bonusDamagePct;

			public static float healPct;

			public static float onKillHealPct;

			public static float stackMult;

			public DarkClayItem()
			{
				//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_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_011f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0125: Expected O, but got Unknown
				//IL_0137: Unknown result type (might be due to invalid IL or missing references)
				//IL_0141: Expected O, but got Unknown
				//IL_020a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0214: Expected O, but got Unknown
				baseTethers = DarknessExpansion.clayTetherCount.Value;
				bonusDamagePct = DarknessExpansion.clayTarBonusDamagePct.Value;
				healPct = DarknessExpansion.clayHealPct.Value;
				onKillHealPct = DarknessExpansion.clayDarkKillHealingBonusPct.Value;
				stackMult = DarknessExpansion.clayStackingMultiplier.Value;
				darkClayItem = ScriptableObject.CreateInstance<ItemDef>();
				((Object)darkClayItem).name = "DARK_CLAY_NAME";
				darkClayItem.descriptionToken = "DARK_CLAY_DESCRIPTION";
				darkClayItem.nameToken = "DARK_CLAY_NAME";
				darkClayItem.loreToken = "DARK_CLAY_LORE";
				darkClayItem.pickupToken = "DARK_CLAY_PICKUP";
				darkClayItem.pickupIconSprite = darkClaySprite;
				darkClayItem.pickupModelPrefab = darkClayPickup;
				darkClayItem.canRemove = true;
				darkClayItem.hidden = false;
				darkClayItem._itemTierDef = darkTier;
				ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
				darkClayItem.itemIndex = (ItemIndex)0;
				ItemAPI.Add(new CustomItem(darkClayItem, val));
				LanguageAPI.Add("DARK_CLAY_NAME", "Polished Urn");
				LanguageAPI.Add("DARK_CLAY_DESCRIPTION", $"The nearest {baseTethers} (+{(float)baseTethers * stackMult} per stack) enemies within 13m are tethered and tarred." + $"Deal {bonusDamagePct}% (+{bonusDamagePct * stackMult}% per stack) bonus damage to tarred enemies." + $"Heal for {healPct}% (+{healPct * stackMult}% per stack) of the damage dealt to them." + $"Killing a dark enemy increases your healing received by {onKillHealPct}% (+{onKillHealPct * stackMult}% per stack).");
				LanguageAPI.Add("DARK_CLAY_PICKUP", "Tether yourself to nearby enemies, dealing bonus damage and healing for a portion of the damage dealt. Grows stronger as it absorbs darkness.");
				HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(HealthComponentOnTakeDamageProcess);
				darkItems.Add(darkClayItem);
			}

			private void HealthComponentOnTakeDamageProcess(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageinfo)
			{
				//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)self.body) && Object.op_Implicit((Object)(object)self.body.inventory) && Object.op_Implicit((Object)(object)damageinfo.attacker))
				{
					CharacterBody component = damageinfo.attacker.GetComponent<CharacterBody>();
					if (Object.op_Implicit((Object)(object)component))
					{
						float num = component.inventory.GetItemCount(darkClayItem);
						num = 1f + (num - 1f) * stackMult;
						if (num > 0f && self.body.HasBuff(Buffs.ClayGoo))
						{
							damageinfo.damage *= 1f + num * bonusDamagePct / 100f;
							component.healthComponent.Heal(damageinfo.damage * healPct * num / 100f, default(ProcChainMask), false);
						}
					}
				}
				orig.Invoke(self, damageinfo);
			}
		}

		public class DarkParentItem
		{
			public static ItemDef darkParentItem;

			public static float healPerArmorPct = DarknessExpansion.parentHealPerArmorPct.Value;

			public static float igniteRadiusBase = DarknessExpansion.parentIgniteRadiusBase.Value;

			public static float darkKillArmorBonus = DarknessExpansion.parentDarkKillArmorBonus.Value;

			public static float stackingMultiplier = DarknessExpansion.parentStackingMultiplier.Value;

			private Sprite darkParentSprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/ParentEgg/texParentEggIcon.png").WaitForCompletion();

			private GameObject darkParentPickup = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ParentEgg/PickupParentEgg.prefab").WaitForCompletion();

			public DarkParentItem()
			{
				//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_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00da: Expected O, but got Unknown
				//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f6: Expected O, but got Unknown
				//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b3: Expected O, but got Unknown
				darkParentItem = ScriptableObject.CreateInstance<ItemDef>();
				((Object)darkParentItem).name = "DARK_PARENT_NAME";
				darkParentItem.descriptionToken = "DARK_PARENT_DESCRIPTION";
				darkParentItem.nameToken = "DARK_PARENT_NAME";
				darkParentItem.loreToken = "DARK_PARENT_LORE";
				darkParentItem.pickupToken = "DARK_PARENT_PICKUP";
				darkParentItem.pickupIconSprite = darkParentSprite;
				darkParentItem.pickupModelPrefab = darkParentPickup;
				darkParentItem.canRemove = true;
				darkParentItem.hidden = false;
				darkParentItem._itemTierDef = darkTier;
				ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
				darkParentItem.itemIndex = (ItemIndex)0;
				ItemAPI.Add(new CustomItem(darkParentItem, val));
				LanguageAPI.Add("DARK_PARENT_NAME", "Dark Planula");
				LanguageAPI.Add("DARK_PARENT_PICKUP", "Heal from incoming damage and ignite nearby enemies. Grows stronger as it absorbs darkness.");
				LanguageAPI.Add("DARK_PARENT_DESCRIPTION", $"Heal from incoming damage equal to {healPerArmorPct}% (+{healPerArmorPct * stackingMultiplier}% per stack) armor. On taking damage, ignite enemies within a {igniteRadiusBase}m (+{igniteRadiusBase * stackingMultiplier}m per stack) radius. Upon killing a dark enemy, gain {darkKillArmorBonus} (+{darkKillArmorBonus * stackingMultiplier}) armor.");
				darkItems.Add(darkParentItem);
				HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(HealthComponentOnTakeDamageProcess);
			}

			private void HealthComponentOnTakeDamageProcess(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageinfo)
			{
				//IL_0091: Unknown result type (might be due to invalid IL or missing references)
				//IL_0097: Unknown result type (might be due to invalid IL or missing references)
				//IL_00af: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fd: 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_018b: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body) && Object.op_Implicit((Object)(object)self.body.inventory))
				{
					float num = self.body.inventory.GetItemCount(darkParentItem);
					num = 1f + (num - 1f) * stackingMultiplier;
					if (num > 0f)
					{
						self.Heal(self.body.armor * num * healPerArmorPct / 100f, default(ProcChainMask), false);
						float radius = igniteRadiusBase * num;
						Vector3 corePosition = self.body.corePosition;
						GlobalEventManager.igniteOnKillSphereSearch.origin = corePosition;
						GlobalEventManager.igniteOnKillSphereSearch.mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask;
						GlobalEventManager.igniteOnKillSphereSearch.radius = radius;
						GlobalEventManager.igniteOnKillSphereSearch.RefreshCandidates();
						GlobalEventManager.igniteOnKillSphereSearch.FilterCandidatesByHurtBoxTeam(TeamMask.GetUnprotectedTeams(self.body.teamComponent.teamIndex));
						GlobalEventManager.igniteOnKillSphereSearch.FilterCandidatesByDistinctHurtBoxEntities();
						GlobalEventManager.igniteOnKillSphereSearch.OrderCandidatesByD