Decompiled source of TooManyItems v0.6.8

plugins/TooManyItems.dll

Decompiled 3 days ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using HG;
using LookingGlass.ItemStatsNameSpace;
using Microsoft.CodeAnalysis;
using On.RoR2;
using On.RoR2.Items;
using On.RoR2.UI.LogBook;
using R2API;
using R2API.Networking;
using R2API.Networking.Interfaces;
using R2API.Utils;
using RoR2;
using RoR2.ExpansionManagement;
using RoR2.UI.LogBook;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.UI;

[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("TooManyItems")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+a815daa8e73bde756e7875d0f7804d8bcb10695a")]
[assembly: AssemblyProduct("TooManyItems")]
[assembly: AssemblyTitle("TooManyItems")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

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

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

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace TooManyItems
{
	internal class Integrations
	{
		internal static bool lookingGlassEnabled;

		internal static void Init()
		{
			Dictionary<string, PluginInfo> pluginInfos = Chainloader.PluginInfos;
			if (pluginInfos.ContainsKey("droppod.lookingglass"))
			{
				try
				{
					Log.Debug("Running code injection for LookingGlass.");
					LookingGlassIntegration.Init();
					lookingGlassEnabled = true;
				}
				catch (Exception data)
				{
					Log.Error(data);
				}
			}
		}
	}
	internal static class LookingGlassIntegration
	{
		public static class LookingGlassStats
		{
			public static void RegisterStats()
			{
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				//IL_0019: Expected O, but got Unknown
				//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c2: Expected O, but got Unknown
				//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ab: Expected I4, but got Unknown
				//IL_013a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0141: Expected O, but got Unknown
				//IL_011c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0127: Expected I4, but got Unknown
				//IL_01be: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c5: Expected O, but got Unknown
				//IL_019f: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ab: Expected I4, but got Unknown
				//IL_0245: Unknown result type (might be due to invalid IL or missing references)
				//IL_024c: Expected O, but got Unknown
				//IL_0223: Unknown result type (might be due to invalid IL or missing references)
				//IL_022f: Expected I4, but got Unknown
				//IL_02fb: Unknown result type (might be due to invalid IL or missing references)
				//IL_0302: Expected O, but got Unknown
				//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
				//IL_02e5: Expected I4, but got Unknown
				//IL_03b0: Unknown result type (might be due to invalid IL or missing references)
				//IL_03b7: Expected O, but got Unknown
				//IL_038e: Unknown result type (might be due to invalid IL or missing references)
				//IL_039a: Expected I4, but got Unknown
				//IL_0462: Unknown result type (might be due to invalid IL or missing references)
				//IL_0469: Expected O, but got Unknown
				//IL_0443: Unknown result type (might be due to invalid IL or missing references)
				//IL_044f: Expected I4, but got Unknown
				//IL_04e6: Unknown result type (might be due to invalid IL or missing references)
				//IL_04ed: Expected O, but got Unknown
				//IL_04c7: Unknown result type (might be due to invalid IL or missing references)
				//IL_04d3: Expected I4, but got Unknown
				//IL_056a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0571: Expected O, but got Unknown
				//IL_054b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0557: Expected I4, but got Unknown
				//IL_05ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_05f6: Expected O, but got Unknown
				//IL_05d0: Unknown result type (might be due to invalid IL or missing references)
				//IL_05dc: Expected I4, but got Unknown
				//IL_0673: Unknown result type (might be due to invalid IL or missing references)
				//IL_067a: Expected O, but got Unknown
				//IL_0654: Unknown result type (might be due to invalid IL or missing references)
				//IL_0660: Expected I4, but got Unknown
				//IL_06fa: Unknown result type (might be due to invalid IL or missing references)
				//IL_0701: Expected O, but got Unknown
				//IL_06d8: Unknown result type (might be due to invalid IL or missing references)
				//IL_06e4: Expected I4, but got Unknown
				//IL_07ac: Unknown result type (might be due to invalid IL or missing references)
				//IL_07b3: Expected O, but got Unknown
				//IL_078d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0799: Expected I4, but got Unknown
				//IL_0830: Unknown result type (might be due to invalid IL or missing references)
				//IL_0837: Expected O, but got Unknown
				//IL_0811: Unknown result type (might be due to invalid IL or missing references)
				//IL_081d: Expected I4, but got Unknown
				//IL_08b7: Unknown result type (might be due to invalid IL or missing references)
				//IL_08be: Expected O, but got Unknown
				//IL_0895: Unknown result type (might be due to invalid IL or missing references)
				//IL_08a1: Expected I4, but got Unknown
				//IL_0aaf: Unknown result type (might be due to invalid IL or missing references)
				//IL_0ab6: Expected O, but got Unknown
				//IL_0a8d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0a99: Expected I4, but got Unknown
				//IL_0b61: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b68: Expected O, but got Unknown
				//IL_0b42: Unknown result type (might be due to invalid IL or missing references)
				//IL_0b4e: Expected I4, but got Unknown
				//IL_0be5: Unknown result type (might be due to invalid IL or missing references)
				//IL_0bec: Expected O, but got Unknown
				//IL_0bc6: Unknown result type (might be due to invalid IL or missing references)
				//IL_0bd2: Expected I4, but got Unknown
				//IL_0c69: Unknown result type (might be due to invalid IL or missing references)
				//IL_0c70: Expected O, but got Unknown
				//IL_0c4a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0c56: Expected I4, but got Unknown
				//IL_0cf0: Unknown result type (might be due to invalid IL or missing references)
				//IL_0cf7: Expected O, but got Unknown
				//IL_0cce: Unknown result type (might be due to invalid IL or missing references)
				//IL_0cda: Expected I4, but got Unknown
				//IL_0da2: Unknown result type (might be due to invalid IL or missing references)
				//IL_0da9: Expected O, but got Unknown
				//IL_0d83: Unknown result type (might be due to invalid IL or missing references)
				//IL_0d8f: Expected I4, but got Unknown
				//IL_0e26: Unknown result type (might be due to invalid IL or missing references)
				//IL_0e2d: Expected O, but got Unknown
				//IL_0e07: Unknown result type (might be due to invalid IL or missing references)
				//IL_0e13: Expected I4, but got Unknown
				//IL_0ead: Unknown result type (might be due to invalid IL or missing references)
				//IL_0eb4: Expected O, but got Unknown
				//IL_0e8b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0e97: Expected I4, but got Unknown
				//IL_0f5f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0f66: Expected O, but got Unknown
				//IL_0f40: Unknown result type (might be due to invalid IL or missing references)
				//IL_0f4c: Expected I4, but got Unknown
				//IL_0fe7: Unknown result type (might be due to invalid IL or missing references)
				//IL_0fee: Expected O, but got Unknown
				//IL_0fc5: Unknown result type (might be due to invalid IL or missing references)
				//IL_0fd1: Expected I4, but got Unknown
				//IL_1099: Unknown result type (might be due to invalid IL or missing references)
				//IL_10a0: Expected O, but got Unknown
				//IL_107a: Unknown result type (might be due to invalid IL or missing references)
				//IL_1086: Expected I4, but got Unknown
				//IL_111d: Unknown result type (might be due to invalid IL or missing references)
				//IL_1124: Expected O, but got Unknown
				//IL_10fe: Unknown result type (might be due to invalid IL or missing references)
				//IL_110a: Expected I4, but got Unknown
				//IL_11a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_11ab: Expected O, but got Unknown
				//IL_1182: Unknown result type (might be due to invalid IL or missing references)
				//IL_118e: Expected I4, but got Unknown
				//IL_1259: Unknown result type (might be due to invalid IL or missing references)
				//IL_1260: Expected O, but got Unknown
				//IL_1237: Unknown result type (might be due to invalid IL or missing references)
				//IL_1243: Expected I4, but got Unknown
				//IL_130b: Unknown result type (might be due to invalid IL or missing references)
				//IL_1312: Expected O, but got Unknown
				//IL_12ec: Unknown result type (might be due to invalid IL or missing references)
				//IL_12f8: Expected I4, but got Unknown
				//IL_1370: Unknown result type (might be due to invalid IL or missing references)
				//IL_137c: Expected I4, but got Unknown
				if (AncientCoin.isEnabled.Value)
				{
					ItemStatsDef val = new ItemStatsDef();
					val.descriptions.Add("Gold Gain: ");
					val.valueTypes.Add((ValueType)16);
					val.measurementUnits.Add((MeasurementUnits)1);
					val.descriptions.Add("Damage Taken: ");
					val.valueTypes.Add((ValueType)11);
					val.measurementUnits.Add((MeasurementUnits)1);
					val.calculateValues = (CharacterMaster master, int itemCount) => new List<float>
					{
						AncientCoin.goldMultiplierAsPercent * (float)itemCount,
						AncientCoin.damageMultiplierAsPercent * (float)itemCount
					};
					ItemDefinitions.allItemDefinitions.Add((int)AncientCoin.itemDef.itemIndex, val);
				}
				if (BloodDice.isEnabled.Value)
				{
					ItemStatsDef val2 = new ItemStatsDef();
					val2.descriptions.Add("Permanent Health: ");
					val2.valueTypes.Add((ValueType)3);
					val2.measurementUnits.Add((MeasurementUnits)2);
					val2.calculateValues = delegate(CharacterMaster master, int itemCount)
					{
						List<float> list14 = new List<float>();
						if (Object.op_Implicit((Object)(object)master) && Object.op_Implicit((Object)(object)master.inventory) && Object.op_Implicit((Object)(object)((Component)master.inventory).GetComponent<BloodDice.Statistics>()))
						{
							BloodDice.Statistics component9 = ((Component)master.inventory).GetComponent<BloodDice.Statistics>();
							list14.Add(component9.PermanentHealth);
						}
						else
						{
							list14.Add(0f);
						}
						return list14;
					};
					ItemDefinitions.allItemDefinitions.Add((int)BloodDice.itemDef.itemIndex, val2);
				}
				if (BottleCap.isEnabled.Value)
				{
					ItemStatsDef val3 = new ItemStatsDef();
					val3.descriptions.Add("Cooldown Reduction: ");
					val3.valueTypes.Add((ValueType)2);
					val3.measurementUnits.Add((MeasurementUnits)1);
					val3.calculateValues = (CharacterMaster master, int itemCount) => new List<float> { Utils.GetHyperbolicStacking(BottleCap.specialCDRPercent, itemCount) };
					ItemDefinitions.allItemDefinitions.Add((int)BottleCap.itemDef.itemIndex, val3);
				}
				if (BrassKnuckles.isEnabled.Value)
				{
					ItemStatsDef val4 = new ItemStatsDef();
					val4.descriptions.Add("Bonus Damage: ");
					val4.valueTypes.Add((ValueType)1);
					val4.measurementUnits.Add((MeasurementUnits)1);
					val4.calculateValues = (CharacterMaster master, int itemCount) => new List<float> { BrassKnuckles.heavyHitBonusPercent * (float)itemCount };
					ItemDefinitions.allItemDefinitions.Add((int)BrassKnuckles.itemDef.itemIndex, val4);
				}
				if (BreadLoaf.isEnabled.Value)
				{
					ItemStatsDef val5 = new ItemStatsDef();
					val5.descriptions.Add("Gold On-Kill: ");
					val5.valueTypes.Add((ValueType)16);
					val5.measurementUnits.Add((MeasurementUnits)4);
					val5.descriptions.Add("Kills Remaining: ");
					val5.valueTypes.Add((ValueType)2);
					val5.measurementUnits.Add((MeasurementUnits)4);
					val5.calculateValues = delegate(CharacterMaster master, int itemCount)
					{
						List<float> list13 = new List<float>();
						if (Object.op_Implicit((Object)(object)master) && Object.op_Implicit((Object)(object)master.inventory) && Object.op_Implicit((Object)(object)((Component)master.inventory).GetComponent<BreadLoaf.Statistics>()))
						{
							BreadLoaf.Statistics component8 = ((Component)master.inventory).GetComponent<BreadLoaf.Statistics>();
							list13.Add(BreadLoaf.goldGainOnKill.Value * itemCount);
							list13.Add((int)BreadLoaf.killsNeededToScrap - component8.KillsCounter);
						}
						else
						{
							list13.Add(BreadLoaf.goldGainOnKill.Value * itemCount);
							list13.Add(0f);
						}
						return list13;
					};
					ItemDefinitions.allItemDefinitions.Add((int)BreadLoaf.itemDef.itemIndex, val5);
				}
				if (BrokenMask.isEnabled.Value)
				{
					ItemStatsDef val6 = new ItemStatsDef();
					val6.descriptions.Add("Burn Damage: ");
					val6.valueTypes.Add((ValueType)1);
					val6.measurementUnits.Add((MeasurementUnits)1);
					val6.descriptions.Add("Damage Dealt: ");
					val6.valueTypes.Add((ValueType)1);
					val6.measurementUnits.Add((MeasurementUnits)4);
					val6.calculateValues = delegate(CharacterMaster master, int itemCount)
					{
						List<float> list12 = new List<float>();
						if (Object.op_Implicit((Object)(object)master) && Object.op_Implicit((Object)(object)master.inventory) && Object.op_Implicit((Object)(object)((Component)master.inventory).GetComponent<BrokenMask.Statistics>()))
						{
							BrokenMask.Statistics component7 = ((Component)master.inventory).GetComponent<BrokenMask.Statistics>();
							list12.Add(BrokenMask.burnDamagePercent * (float)itemCount);
							list12.Add(component7.TotalDamageDealt);
						}
						else
						{
							list12.Add(BrokenMask.burnDamagePercent * (float)itemCount);
							list12.Add(0f);
						}
						return list12;
					};
					ItemDefinitions.allItemDefinitions.Add((int)BrokenMask.itemDef.itemIndex, val6);
				}
				if (CarvingBlade.isEnabled.Value)
				{
					ItemStatsDef val7 = new ItemStatsDef();
					val7.descriptions.Add("On-Hit Damage Cap: ");
					val7.valueTypes.Add((ValueType)1);
					val7.measurementUnits.Add((MeasurementUnits)1);
					val7.descriptions.Add("Damage Dealt: ");
					val7.valueTypes.Add((ValueType)1);
					val7.measurementUnits.Add((MeasurementUnits)4);
					val7.calculateValues = delegate(CharacterMaster master, int itemCount)
					{
						List<float> list11 = new List<float>();
						if (Object.op_Implicit((Object)(object)master) && Object.op_Implicit((Object)(object)master.inventory) && Object.op_Implicit((Object)(object)((Component)master.inventory).GetComponent<CarvingBlade.Statistics>()))
						{
							CarvingBlade.Statistics component6 = ((Component)master.inventory).GetComponent<CarvingBlade.Statistics>();
							list11.Add(CarvingBlade.CalculateDamageCapPercent(itemCount));
							list11.Add(Mathf.Max(component6.TotalDamageDealt, 0f));
						}
						else
						{
							list11.Add(CarvingBlade.CalculateDamageCapPercent(itemCount));
							list11.Add(0f);
						}
						return list11;
					};
					ItemDefinitions.allItemDefinitions.Add((int)CarvingBlade.itemDef.itemIndex, val7);
				}
				if (Crucifix.isEnabled.Value)
				{
					ItemStatsDef val8 = new ItemStatsDef();
					val8.descriptions.Add("Burn Damage: ");
					val8.valueTypes.Add((ValueType)3);
					val8.measurementUnits.Add((MeasurementUnits)7);
					val8.calculateValues = (CharacterMaster master, int itemCount) => new List<float> { Utils.GetReverseExponentialStacking(Crucifix.maxHealthBurnAmountPercent, Crucifix.maxHealthBurnAmountReductionPercent, itemCount) };
					ItemDefinitions.allItemDefinitions.Add((int)Crucifix.itemDef.itemIndex, val8);
				}
				if (DebitCard.isEnabled.Value)
				{
					ItemStatsDef val9 = new ItemStatsDef();
					val9.descriptions.Add("Rebate: ");
					val9.valueTypes.Add((ValueType)2);
					val9.measurementUnits.Add((MeasurementUnits)1);
					val9.calculateValues = (CharacterMaster master, int itemCount) => new List<float> { Utils.GetHyperbolicStacking(DebitCard.rebatePercent, itemCount) };
					ItemDefinitions.allItemDefinitions.Add((int)DebitCard.itemDef.itemIndex, val9);
				}
				if (DoubleDown.isEnabled.Value)
				{
					ItemStatsDef val10 = new ItemStatsDef();
					val10.descriptions.Add("Total DoT Damage: ");
					val10.valueTypes.Add((ValueType)11);
					val10.measurementUnits.Add((MeasurementUnits)1);
					val10.calculateValues = (CharacterMaster master, int itemCount) => new List<float> { Utils.GetReverseExponentialStacking(DoubleDown.upFrontDamagePercent, DoubleDown.upFrontDamageReductionPercent, itemCount) };
					ItemDefinitions.allItemDefinitions.Add((int)DoubleDown.itemDef.itemIndex, val10);
				}
				if (EdibleGlue.isEnabled.Value)
				{
					ItemStatsDef val11 = new ItemStatsDef();
					val11.descriptions.Add("Slow Range: ");
					val11.valueTypes.Add((ValueType)2);
					val11.measurementUnits.Add((MeasurementUnits)0);
					val11.calculateValues = (CharacterMaster master, int itemCount) => new List<float> { EdibleGlue.GetSlowRadius(itemCount) };
					ItemDefinitions.allItemDefinitions.Add((int)EdibleGlue.itemDef.itemIndex, val11);
				}
				if (Epinephrine.isEnabled.Value)
				{
					ItemStatsDef val12 = new ItemStatsDef();
					val12.descriptions.Add("Buff Duration: ");
					val12.valueTypes.Add((ValueType)2);
					val12.measurementUnits.Add((MeasurementUnits)6);
					val12.calculateValues = (CharacterMaster master, int itemCount) => new List<float> { (float)Epinephrine.buffDuration * (float)itemCount };
					ItemDefinitions.allItemDefinitions.Add((int)Epinephrine.itemDef.itemIndex, val12);
				}
				if (Hoodie.isEnabled.Value)
				{
					ItemStatsDef val13 = new ItemStatsDef();
					val13.descriptions.Add("Duration Bonus: ");
					val13.valueTypes.Add((ValueType)2);
					val13.measurementUnits.Add((MeasurementUnits)1);
					val13.descriptions.Add("Cooldown: ");
					val13.valueTypes.Add((ValueType)2);
					val13.measurementUnits.Add((MeasurementUnits)6);
					val13.calculateValues = (CharacterMaster master, int itemCount) => new List<float>
					{
						Hoodie.durationIncreasePercent * (float)itemCount,
						Hoodie.CalculateHoodieCooldown(itemCount)
					};
					ItemDefinitions.allItemDefinitions.Add((int)Hoodie.itemDef.itemIndex, val13);
				}
				if (GlassMarbles.isEnabled.Value)
				{
					ItemStatsDef val14 = new ItemStatsDef();
					val14.descriptions.Add("Base Damage: ");
					val14.valueTypes.Add((ValueType)1);
					val14.measurementUnits.Add((MeasurementUnits)4);
					val14.calculateValues = delegate(CharacterMaster master, int itemCount)
					{
						List<float> list10 = new List<float>();
						if (Object.op_Implicit((Object)(object)master) && Object.op_Implicit((Object)(object)master.GetBody()))
						{
							list10.Add((float)GlassMarbles.damagePerLevelPerStack * (float)itemCount * master.GetBody().level);
						}
						else
						{
							list10.Add(0f);
						}
						return list10;
					};
					ItemDefinitions.allItemDefinitions.Add((int)GlassMarbles.itemDef.itemIndex, val14);
				}
				if (HolyWater.isEnabled.Value)
				{
					ItemStatsDef val15 = new ItemStatsDef();
					val15.descriptions.Add("Experience Gained: ");
					val15.valueTypes.Add((ValueType)3);
					val15.measurementUnits.Add((MeasurementUnits)7);
					val15.calculateValues = (CharacterMaster master, int itemCount) => new List<float> { HolyWater.CalculateExperienceMultiplier(itemCount) };
					ItemDefinitions.allItemDefinitions.Add((int)HolyWater.itemDef.itemIndex, val15);
				}
				if (Horseshoe.isEnabled.Value)
				{
					ItemStatsDef val16 = new ItemStatsDef();
					val16.descriptions.Add("Health: ");
					val16.valueTypes.Add((ValueType)3);
					val16.measurementUnits.Add((MeasurementUnits)2);
					val16.descriptions.Add("Base Damage: ");
					val16.valueTypes.Add((ValueType)1);
					val16.measurementUnits.Add((MeasurementUnits)4);
					val16.descriptions.Add("Attack Speed: ");
					val16.valueTypes.Add((ValueType)1);
					val16.measurementUnits.Add((MeasurementUnits)1);
					val16.descriptions.Add("Crit Chance: ");
					val16.valueTypes.Add((ValueType)1);
					val16.measurementUnits.Add((MeasurementUnits)1);
					val16.descriptions.Add("Crit Damage: ");
					val16.valueTypes.Add((ValueType)1);
					val16.measurementUnits.Add((MeasurementUnits)1);
					val16.descriptions.Add("Armor: ");
					val16.valueTypes.Add((ValueType)15);
					val16.measurementUnits.Add((MeasurementUnits)4);
					val16.descriptions.Add("Regeneration: ");
					val16.valueTypes.Add((ValueType)0);
					val16.measurementUnits.Add((MeasurementUnits)3);
					val16.descriptions.Add("Shield: ");
					val16.valueTypes.Add((ValueType)2);
					val16.measurementUnits.Add((MeasurementUnits)2);
					val16.descriptions.Add("Movement Speed: ");
					val16.valueTypes.Add((ValueType)2);
					val16.measurementUnits.Add((MeasurementUnits)1);
					val16.calculateValues = delegate(CharacterMaster master, int itemCount)
					{
						List<float> list8 = new List<float> { 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f };
						if (!Object.op_Implicit((Object)(object)master) || !Object.op_Implicit((Object)(object)master.inventory) || !Object.op_Implicit((Object)(object)master.GetBody()))
						{
							return list8;
						}
						List<float> list9 = new List<float>();
						HorseshoeStatistics component5 = ((Component)master.inventory).GetComponent<HorseshoeStatistics>();
						if (Object.op_Implicit((Object)(object)component5))
						{
							list9.Add(Horseshoe.GetScaledValue(component5.MaxHealthBonus, master.GetBody().level, itemCount));
							list9.Add(Horseshoe.GetScaledValue(component5.BaseDamageBonus, master.GetBody().level, itemCount));
							list9.Add(Horseshoe.GetScaledValue(component5.AttackSpeedPercentBonus, master.GetBody().level, itemCount));
							list9.Add(Horseshoe.GetScaledValue(component5.CritChanceBonus, master.GetBody().level, itemCount) / 100f);
							list9.Add(Horseshoe.GetScaledValue(component5.CritDamageBonus, master.GetBody().level, itemCount));
							list9.Add(Horseshoe.GetScaledValue(component5.ArmorBonus, master.GetBody().level, itemCount));
							list9.Add(Horseshoe.GetScaledValue(component5.RegenerationBonus, master.GetBody().level, itemCount));
							list9.Add(Horseshoe.GetScaledValue(component5.ShieldBonus, master.GetBody().level, itemCount));
							list9.Add(Horseshoe.GetScaledValue(component5.MoveSpeedPercentBonus, master.GetBody().level, itemCount));
						}
						else
						{
							list9 = list8;
						}
						return list9;
					};
					ItemDefinitions.allItemDefinitions.Add((int)Horseshoe.itemDef.itemIndex, val16);
				}
				if (IronHeart.isEnabled.Value)
				{
					ItemStatsDef val17 = new ItemStatsDef();
					val17.descriptions.Add("On-Hit Damage: ");
					val17.valueTypes.Add((ValueType)3);
					val17.measurementUnits.Add((MeasurementUnits)7);
					val17.descriptions.Add("Damage Dealt: ");
					val17.valueTypes.Add((ValueType)1);
					val17.measurementUnits.Add((MeasurementUnits)4);
					val17.calculateValues = delegate(CharacterMaster master, int itemCount)
					{
						List<float> list7 = new List<float>();
						if (Object.op_Implicit((Object)(object)master) && Object.op_Implicit((Object)(object)master.inventory) && Object.op_Implicit((Object)(object)((Component)master.inventory).GetComponent<IronHeart.Statistics>()))
						{
							IronHeart.Statistics component4 = ((Component)master.inventory).GetComponent<IronHeart.Statistics>();
							list7.Add(IronHeart.multiplierPerStack * (float)itemCount);
							list7.Add(component4.TotalDamageDealt);
						}
						else
						{
							list7.Add(IronHeart.multiplierPerStack * (float)itemCount);
							list7.Add(0f);
						}
						return list7;
					};
					ItemDefinitions.allItemDefinitions.Add((int)IronHeart.itemDef.itemIndex, val17);
				}
				if (MilkCarton.isEnabled.Value)
				{
					ItemStatsDef val18 = new ItemStatsDef();
					val18.descriptions.Add("Damage Reduction: ");
					val18.valueTypes.Add((ValueType)2);
					val18.measurementUnits.Add((MeasurementUnits)1);
					val18.calculateValues = (CharacterMaster master, int itemCount) => new List<float> { Utils.GetHyperbolicStacking(MilkCarton.eliteDamageReductionPercent, itemCount) };
					ItemDefinitions.allItemDefinitions.Add((int)MilkCarton.itemDef.itemIndex, val18);
				}
				if (MagnifyingGlass.isEnabled.Value)
				{
					ItemStatsDef val19 = new ItemStatsDef();
					val19.descriptions.Add("Analyze Chance: ");
					val19.valueTypes.Add((ValueType)2);
					val19.measurementUnits.Add((MeasurementUnits)1);
					val19.calculateValues = delegate(CharacterMaster master, int itemCount)
					{
						List<float> list6 = new List<float>();
						if (Object.op_Implicit((Object)(object)master))
						{
							list6.Add(Utils.GetChanceAfterLuck(MagnifyingGlass.analyzeChancePercent * (float)itemCount, master.luck));
						}
						else
						{
							list6.Add(MagnifyingGlass.analyzeChancePercent * (float)itemCount);
						}
						return list6;
					};
					ItemDefinitions.allItemDefinitions.Add((int)MagnifyingGlass.itemDef.itemIndex, val19);
				}
				if (PaperPlane.isEnabled.Value)
				{
					ItemStatsDef val20 = new ItemStatsDef();
					val20.descriptions.Add("Bonus Damage: ");
					val20.valueTypes.Add((ValueType)1);
					val20.measurementUnits.Add((MeasurementUnits)1);
					val20.calculateValues = (CharacterMaster master, int itemCount) => new List<float> { PaperPlane.damageBonusPercent * (float)itemCount };
					ItemDefinitions.allItemDefinitions.Add((int)PaperPlane.itemDef.itemIndex, val20);
				}
				if (Permafrost.isEnabled.Value)
				{
					ItemStatsDef val21 = new ItemStatsDef();
					val21.descriptions.Add("Freeze Chance: ");
					val21.valueTypes.Add((ValueType)2);
					val21.measurementUnits.Add((MeasurementUnits)1);
					val21.descriptions.Add("Bonus Damage: ");
					val21.valueTypes.Add((ValueType)1);
					val21.measurementUnits.Add((MeasurementUnits)1);
					val21.calculateValues = delegate(CharacterMaster master, int itemCount)
					{
						List<float> list5 = new List<float>();
						if (Object.op_Implicit((Object)(object)master))
						{
							list5.Add(Utils.GetChanceAfterLuck(Utils.GetHyperbolicStacking(Permafrost.freezeChancePercent, itemCount), master.luck));
						}
						else
						{
							list5.Add(Utils.GetHyperbolicStacking(Permafrost.freezeChancePercent, itemCount));
						}
						list5.Add(Permafrost.frozenDamageMultiplierPercent * (float)itemCount);
						return list5;
					};
					ItemDefinitions.allItemDefinitions.Add((int)Permafrost.itemDef.itemIndex, val21);
				}
				if (Photodiode.isEnabled.Value)
				{
					ItemStatsDef val22 = new ItemStatsDef();
					val22.descriptions.Add("Max Attack Speed: ");
					val22.valueTypes.Add((ValueType)1);
					val22.measurementUnits.Add((MeasurementUnits)1);
					val22.calculateValues = (CharacterMaster master, int itemCount) => new List<float> { Photodiode.maxAttackSpeedAllowedPercent * (float)itemCount };
					ItemDefinitions.allItemDefinitions.Add((int)Photodiode.itemDef.itemIndex, val22);
				}
				if (PropellerHat.isEnabled.Value)
				{
					ItemStatsDef val23 = new ItemStatsDef();
					val23.descriptions.Add("Movement Speed: ");
					val23.valueTypes.Add((ValueType)2);
					val23.measurementUnits.Add((MeasurementUnits)1);
					val23.calculateValues = (CharacterMaster master, int itemCount) => new List<float> { PropellerHat.movespeedBonusPercent * (float)itemCount };
					ItemDefinitions.allItemDefinitions.Add((int)PropellerHat.itemDef.itemIndex, val23);
				}
				if (RedBlueGlasses.isEnabled.Value)
				{
					ItemStatsDef val24 = new ItemStatsDef();
					val24.descriptions.Add("Crit Chance: ");
					val24.valueTypes.Add((ValueType)1);
					val24.measurementUnits.Add((MeasurementUnits)1);
					val24.descriptions.Add("Crit Damage: ");
					val24.valueTypes.Add((ValueType)1);
					val24.measurementUnits.Add((MeasurementUnits)1);
					val24.calculateValues = (CharacterMaster master, int itemCount) => new List<float>
					{
						RedBlueGlasses.critChancePercent * (float)itemCount,
						RedBlueGlasses.critDamagePercent * (float)itemCount
					};
					ItemDefinitions.allItemDefinitions.Add((int)RedBlueGlasses.itemDef.itemIndex, val24);
				}
				if (RubberDucky.isEnabled.Value)
				{
					ItemStatsDef val25 = new ItemStatsDef();
					val25.descriptions.Add("Bonus Armor: ");
					val25.valueTypes.Add((ValueType)17);
					val25.measurementUnits.Add((MeasurementUnits)4);
					val25.calculateValues = (CharacterMaster master, int itemCount) => new List<float> { (int)RubberDucky.armorPerStack * itemCount };
					ItemDefinitions.allItemDefinitions.Add((int)RubberDucky.itemDef.itemIndex, val25);
				}
				if (RustyTrowel.isEnabled.Value)
				{
					ItemStatsDef val26 = new ItemStatsDef();
					val26.descriptions.Add("Cooldown: ");
					val26.valueTypes.Add((ValueType)2);
					val26.measurementUnits.Add((MeasurementUnits)6);
					val26.descriptions.Add("Healing Done: ");
					val26.valueTypes.Add((ValueType)0);
					val26.measurementUnits.Add((MeasurementUnits)2);
					val26.calculateValues = delegate(CharacterMaster master, int itemCount)
					{
						List<float> list4 = new List<float>();
						if (Object.op_Implicit((Object)(object)master) && Object.op_Implicit((Object)(object)master.inventory) && Object.op_Implicit((Object)(object)((Component)master.inventory).GetComponent<RustyTrowel.Statistics>()))
						{
							RustyTrowel.Statistics component3 = ((Component)master.inventory).GetComponent<RustyTrowel.Statistics>();
							list4.Add(RustyTrowel.CalculateCooldownInSec(itemCount));
							list4.Add(component3.TotalHealingDone);
						}
						else
						{
							list4.Add(RustyTrowel.CalculateCooldownInSec(itemCount));
							list4.Add(0f);
						}
						return list4;
					};
					ItemDefinitions.allItemDefinitions.Add((int)RustyTrowel.itemDef.itemIndex, val26);
				}
				if (ShadowCrest.isEnabled.Value)
				{
					ItemStatsDef val27 = new ItemStatsDef();
					val27.descriptions.Add("Missing Health Regen: ");
					val27.valueTypes.Add((ValueType)0);
					val27.measurementUnits.Add((MeasurementUnits)1);
					val27.calculateValues = (CharacterMaster master, int itemCount) => new List<float> { Utils.GetHyperbolicStacking(ShadowCrest.regenPerSecondPercent, itemCount) };
					ItemDefinitions.allItemDefinitions.Add((int)ShadowCrest.itemDef.itemIndex, val27);
				}
				if (SoulRing.isEnabled.Value)
				{
					ItemStatsDef val28 = new ItemStatsDef();
					val28.descriptions.Add("Bonus Regeneration: ");
					val28.valueTypes.Add((ValueType)0);
					val28.measurementUnits.Add((MeasurementUnits)3);
					val28.calculateValues = delegate(CharacterMaster master, int itemCount)
					{
						List<float> list3 = new List<float>();
						if (Object.op_Implicit((Object)(object)master) && Object.op_Implicit((Object)(object)master.inventory) && Object.op_Implicit((Object)(object)((Component)master.inventory).GetComponent<SoulRing.Statistics>()))
						{
							SoulRing.Statistics component2 = ((Component)master.inventory).GetComponent<SoulRing.Statistics>();
							list3.Add(component2.HealthRegen);
						}
						else
						{
							list3.Add(0f);
						}
						return list3;
					};
					ItemDefinitions.allItemDefinitions.Add((int)SoulRing.itemDef.itemIndex, val28);
				}
				if (SpiritStone.isEnabled.Value)
				{
					ItemStatsDef val29 = new ItemStatsDef();
					val29.descriptions.Add("Permanent Shield: ");
					val29.valueTypes.Add((ValueType)2);
					val29.measurementUnits.Add((MeasurementUnits)2);
					val29.descriptions.Add("Health Penalty: ");
					val29.valueTypes.Add((ValueType)3);
					val29.measurementUnits.Add((MeasurementUnits)7);
					val29.calculateValues = delegate(CharacterMaster master, int itemCount)
					{
						List<float> list2 = new List<float>();
						if (Object.op_Implicit((Object)(object)master) && Object.op_Implicit((Object)(object)master.inventory) && Object.op_Implicit((Object)(object)((Component)master.inventory).GetComponent<SpiritStone.Statistics>()))
						{
							SpiritStone.Statistics component = ((Component)master.inventory).GetComponent<SpiritStone.Statistics>();
							list2.Add(component.PermanentShield);
						}
						else
						{
							list2.Add(0f);
						}
						list2.Add(Utils.GetExponentialStacking(SpiritStone.maxHealthLostPercent, itemCount));
						return list2;
					};
					ItemDefinitions.allItemDefinitions.Add((int)SpiritStone.itemDef.itemIndex, val29);
				}
				if (Thumbtack.isEnabled.Value)
				{
					ItemStatsDef val30 = new ItemStatsDef();
					val30.descriptions.Add("Bleed Chance: ");
					val30.valueTypes.Add((ValueType)1);
					val30.measurementUnits.Add((MeasurementUnits)1);
					val30.descriptions.Add("Bonus Duration: ");
					val30.valueTypes.Add((ValueType)2);
					val30.measurementUnits.Add((MeasurementUnits)6);
					val30.calculateValues = (CharacterMaster master, int itemCount) => new List<float>
					{
						Thumbtack.bleedChancePercent * (float)itemCount,
						Thumbtack.bleedDurationBonus.Value * (float)itemCount
					};
					ItemDefinitions.allItemDefinitions.Add((int)Thumbtack.itemDef.itemIndex, val30);
				}
				if (!IronHeartVoid.isEnabled.Value)
				{
					return;
				}
				ItemStatsDef val31 = new ItemStatsDef();
				val31.descriptions.Add("Base Damage: ");
				val31.valueTypes.Add((ValueType)1);
				val31.measurementUnits.Add((MeasurementUnits)4);
				val31.calculateValues = delegate(CharacterMaster master, int itemCount)
				{
					List<float> list = new List<float>();
					if (Object.op_Implicit((Object)(object)master) && Object.op_Implicit((Object)(object)master.GetBody()))
					{
						list.Add(IronHeartVoid.CalculateDamageBonus(master.GetBody(), itemCount));
					}
					else
					{
						list.Add(0f);
					}
					return list;
				};
				ItemDefinitions.allItemDefinitions.Add((int)IronHeartVoid.itemDef.itemIndex, val31);
			}
		}

		internal static void Init()
		{
			RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(LookingGlassStats.RegisterStats));
		}
	}
	internal class BuffTotem
	{
		public enum Result
		{
			ARMOR,
			DAMAGE,
			ATTACK_SPEED,
			HEALTH_REGEN
		}

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

			public static hook_PerformEquipmentAction <>9__20_0;

			public static StatHookEventHandler <>9__20_1;

			internal bool <Hooks>b__20_0(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipDef)
			{
				if (NetworkServer.active && (Object)(object)equipDef == (Object)(object)equipmentDef)
				{
					return OnUse(self);
				}
				return orig.Invoke(self, equipDef);
			}

			internal void <Hooks>b__20_1(CharacterBody sender, StatHookEventArgs args)
			{
				if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory))
				{
					if (sender.HasBuff(armorBuff))
					{
						args.armorAdd += armorIncrease.Value;
					}
					if (sender.HasBuff(damageBuff))
					{
						args.damageMultAdd += damageIncreasePercent;
					}
					if (sender.HasBuff(attackSpeedBuff))
					{
						args.attackSpeedMultAdd += attackSpeedIncreasePercent;
					}
					if (sender.HasBuff(healthRegenBuff))
					{
						args.baseRegenAdd += regenIncreasePercent * sender.healthComponent.fullCombinedHealth;
					}
				}
			}
		}

		public static EquipmentDef equipmentDef;

		public static BuffDef armorBuff;

		public static BuffDef damageBuff;

		public static BuffDef attackSpeedBuff;

		public static BuffDef healthRegenBuff;

		public static ConfigurableValue<bool> isEnabled = new ConfigurableValue<bool>("Equipment: Totem of Prayer", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List<string> { "EQUIPMENT_BUFFTOTEM_DESC" });

		public static ConfigurableValue<float> armorIncrease = new ConfigurableValue<float>("Equipment: Totem of Prayer", "Armor Increase", 100f, "Armor increase if rolled.", new List<string> { "EQUIPMENT_BUFFTOTEM_DESC" });

		public static ConfigurableValue<float> damageIncrease = new ConfigurableValue<float>("Equipment: Totem of Prayer", "Damage Increase", 25f, "Percent damage increase if rolled.", new List<string> { "EQUIPMENT_BUFFTOTEM_DESC" });

		public static ConfigurableValue<float> attackSpeedIncrease = new ConfigurableValue<float>("Equipment: Totem of Prayer", "Attack Speed Increase", 75f, "Percent attack speed increase if rolled.", new List<string> { "EQUIPMENT_BUFFTOTEM_DESC" });

		public static ConfigurableValue<float> regenIncrease = new ConfigurableValue<float>("Equipment: Totem of Prayer", "Health Regen Increase", 8f, "Health regeneration bonus (as max HP/s) if rolled.", new List<string> { "EQUIPMENT_BUFFTOTEM_DESC" });

		public static ConfigurableValue<float> buffDuration = new ConfigurableValue<float>("Equipment: Totem of Prayer", "Buff Duration", 12f, "Duration of the buff given.", new List<string> { "EQUIPMENT_BUFFTOTEM_DESC" });

		public static ConfigurableValue<int> equipCooldown = new ConfigurableValue<int>("Equipment: Totem of Prayer", "Cooldown", 80, "Equipment cooldown.", new List<string> { "EQUIPMENT_BUFFTOTEM_DESC" });

		public static float damageIncreasePercent = damageIncrease.Value / 100f;

		public static float attackSpeedIncreasePercent = attackSpeedIncrease.Value / 100f;

		public static float regenIncreasePercent = regenIncrease.Value / 100f;

		public static Result lastBuffGiven = Result.ARMOR;

		internal static void Init()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			GenerateEquipment();
			GenerateBuff();
			ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
			ItemAPI.Add(new CustomEquipment(equipmentDef, val));
			ContentAddition.AddBuffDef(armorBuff);
			ContentAddition.AddBuffDef(damageBuff);
			ContentAddition.AddBuffDef(attackSpeedBuff);
			ContentAddition.AddBuffDef(healthRegenBuff);
			Hooks();
		}

		private static void GenerateEquipment()
		{
			equipmentDef = ScriptableObject.CreateInstance<EquipmentDef>();
			((Object)equipmentDef).name = "BUFFTOTEM";
			equipmentDef.AutoPopulateTokens();
			GameObject val = AssetHandler.bundle.LoadAsset<GameObject>("BuffTotem.prefab");
			ModelPanelParameters val2 = val.AddComponent<ModelPanelParameters>();
			val2.focusPointTransform = val.transform;
			val2.cameraPositionTransform = val.transform;
			val2.maxDistance = 10f;
			val2.minDistance = 5f;
			equipmentDef.pickupIconSprite = AssetHandler.bundle.LoadAsset<Sprite>("HealTotem.png");
			equipmentDef.pickupModelPrefab = val;
			equipmentDef.appearsInMultiPlayer = true;
			equipmentDef.appearsInSinglePlayer = true;
			equipmentDef.canBeRandomlyTriggered = true;
			equipmentDef.enigmaCompatible = true;
			equipmentDef.canDrop = true;
			equipmentDef.cooldown = equipCooldown.Value;
		}

		private static void GenerateBuff()
		{
			armorBuff = ScriptableObject.CreateInstance<BuffDef>();
			((Object)armorBuff).name = "Prayer of Defense";
			armorBuff.iconSprite = AssetHandler.bundle.LoadAsset<Sprite>("DefensePrayer.png");
			armorBuff.canStack = false;
			armorBuff.isHidden = false;
			armorBuff.isDebuff = false;
			armorBuff.isCooldown = false;
			damageBuff = ScriptableObject.CreateInstance<BuffDef>();
			((Object)damageBuff).name = "Prayer of Power";
			damageBuff.iconSprite = AssetHandler.bundle.LoadAsset<Sprite>("DamagePrayer.png");
			damageBuff.canStack = false;
			damageBuff.isHidden = false;
			damageBuff.isDebuff = false;
			damageBuff.isCooldown = false;
			attackSpeedBuff = ScriptableObject.CreateInstance<BuffDef>();
			((Object)attackSpeedBuff).name = "Prayer of Cadence";
			attackSpeedBuff.iconSprite = AssetHandler.bundle.LoadAsset<Sprite>("CadencePrayer.png");
			attackSpeedBuff.canStack = false;
			attackSpeedBuff.isHidden = false;
			attackSpeedBuff.isDebuff = false;
			attackSpeedBuff.isCooldown = false;
			healthRegenBuff = ScriptableObject.CreateInstance<BuffDef>();
			((Object)healthRegenBuff).name = "Prayer of Remedy";
			healthRegenBuff.iconSprite = AssetHandler.bundle.LoadAsset<Sprite>("RemedyPrayer.png");
			healthRegenBuff.canStack = false;
			healthRegenBuff.isHidden = false;
			healthRegenBuff.isDebuff = false;
			healthRegenBuff.isCooldown = false;
		}

		public static void Hooks()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			//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_0045: Expected O, but got Unknown
			object obj = <>c.<>9__20_0;
			if (obj == null)
			{
				hook_PerformEquipmentAction val = (orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipDef) => (NetworkServer.active && (Object)(object)equipDef == (Object)(object)equipmentDef) ? OnUse(self) : orig.Invoke(self, equipDef);
				<>c.<>9__20_0 = val;
				obj = (object)val;
			}
			EquipmentSlot.PerformEquipmentAction += (hook_PerformEquipmentAction)obj;
			object obj2 = <>c.<>9__20_1;
			if (obj2 == null)
			{
				StatHookEventHandler val2 = delegate(CharacterBody sender, StatHookEventArgs args)
				{
					if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory))
					{
						if (sender.HasBuff(armorBuff))
						{
							args.armorAdd += armorIncrease.Value;
						}
						if (sender.HasBuff(damageBuff))
						{
							args.damageMultAdd += damageIncreasePercent;
						}
						if (sender.HasBuff(attackSpeedBuff))
						{
							args.attackSpeedMultAdd += attackSpeedIncreasePercent;
						}
						if (sender.HasBuff(healthRegenBuff))
						{
							args.baseRegenAdd += regenIncreasePercent * sender.healthComponent.fullCombinedHealth;
						}
					}
				};
				<>c.<>9__20_1 = val2;
				obj2 = (object)val2;
			}
			RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj2;
		}

		private static bool OnUse(EquipmentSlot slot)
		{
			CharacterBody characterBody = slot.characterBody;
			if (Object.op_Implicit((Object)(object)characterBody))
			{
				Array values = Enum.GetValues(typeof(Result));
				Result result = (Result)values.GetValue(TooManyItems.RandGen.Next(values.Length));
				if (result == lastBuffGiven)
				{
					result = (Result)values.GetValue(TooManyItems.RandGen.Next(values.Length));
				}
				lastBuffGiven = result;
				switch (result)
				{
				case Result.ARMOR:
					characterBody.AddTimedBuff(armorBuff, buffDuration.Value);
					break;
				case Result.DAMAGE:
					characterBody.AddTimedBuff(damageBuff, buffDuration.Value);
					break;
				case Result.ATTACK_SPEED:
					characterBody.AddTimedBuff(attackSpeedBuff, buffDuration.Value);
					break;
				case Result.HEALTH_REGEN:
					characterBody.AddTimedBuff(healthRegenBuff, buffDuration.Value);
					break;
				}
				Utils.ForceRecalculate(characterBody);
				return true;
			}
			return false;
		}
	}
	internal class Chalice
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_PerformEquipmentAction <>9__12_0;

			public static StatHookEventHandler <>9__12_1;

			internal bool <Hooks>b__12_0(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipDef)
			{
				if (NetworkServer.active && (Object)(object)equipDef == (Object)(object)equipmentDef)
				{
					return OnUse(self);
				}
				return orig.Invoke(self, equipDef);
			}

			internal void <Hooks>b__12_1(CharacterBody sender, StatHookEventArgs args)
			{
				if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory) && sender.HasBuff(consecratedBuff))
				{
					args.attackSpeedMultAdd += consecrateAttackSpeedBonus.Value / 100f;
					args.damageMultAdd += consecrateDamageBonus.Value / 100f;
				}
			}
		}

		public static EquipmentDef equipmentDef;

		public static BuffDef consecratedBuff;

		public static ConfigurableValue<bool> isEnabled = new ConfigurableValue<bool>("Equipment: Chalice", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List<string> { "EQUIPMENT_CHALICE_DESC" });

		public static ConfigurableValue<float> consecrateDuration = new ConfigurableValue<float>("Equipment: Chalice", "Consecrate Duration", 10f, "Duration of the Consecrate buff given.", new List<string> { "EQUIPMENT_CHALICE_DESC" });

		public static ConfigurableValue<float> consecrateDamageBonus = new ConfigurableValue<float>("Equipment: Chalice", "Consecrate Damage Bonus", 30f, "Percent bonus damage dealt while Consecrated.", new List<string> { "EQUIPMENT_CHALICE_DESC" });

		public static ConfigurableValue<float> consecrateAttackSpeedBonus = new ConfigurableValue<float>("Equipment: Chalice", "Consecrate Attack Speed Bonus", 90f, "Percent bonus attack speed gained while Consecrated.", new List<string> { "EQUIPMENT_CHALICE_DESC" });

		public static ConfigurableValue<float> currentHealthCost = new ConfigurableValue<float>("Equipment: Chalice", "Current Health Loss", 90f, "Percent of current health lost as payment when Consecrated.", new List<string> { "EQUIPMENT_CHALICE_DESC" });

		public static ConfigurableValue<int> equipCooldown = new ConfigurableValue<int>("Equipment: Chalice", "Cooldown", 70, "Equipment cooldown.", new List<string> { "EQUIPMENT_CHALICE_DESC" });

		public static float currentHealthCostPercent = currentHealthCost.Value / 100f;

		internal static void Init()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			GenerateEquipment();
			GenerateBuff();
			ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
			ItemAPI.Add(new CustomEquipment(equipmentDef, val));
			ContentAddition.AddBuffDef(consecratedBuff);
			Hooks();
		}

		private static void GenerateEquipment()
		{
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			equipmentDef = ScriptableObject.CreateInstance<EquipmentDef>();
			((Object)equipmentDef).name = "CHALICE";
			equipmentDef.AutoPopulateTokens();
			GameObject val = AssetHandler.bundle.LoadAsset<GameObject>("Chalice.prefab");
			ModelPanelParameters val2 = val.AddComponent<ModelPanelParameters>();
			val2.focusPointTransform = val.transform;
			val2.cameraPositionTransform = val.transform;
			val2.maxDistance = 10f;
			val2.minDistance = 5f;
			equipmentDef.pickupIconSprite = AssetHandler.bundle.LoadAsset<Sprite>("Chalice.png");
			equipmentDef.pickupModelPrefab = val;
			equipmentDef.isLunar = true;
			equipmentDef.colorIndex = (ColorIndex)4;
			equipmentDef.appearsInMultiPlayer = true;
			equipmentDef.appearsInSinglePlayer = true;
			equipmentDef.canBeRandomlyTriggered = false;
			equipmentDef.enigmaCompatible = true;
			equipmentDef.canDrop = true;
			equipmentDef.cooldown = equipCooldown.Value;
		}

		private static void GenerateBuff()
		{
			consecratedBuff = ScriptableObject.CreateInstance<BuffDef>();
			((Object)consecratedBuff).name = "Consecrated";
			consecratedBuff.iconSprite = AssetHandler.bundle.LoadAsset<Sprite>("ConsecratedBuff.png");
			consecratedBuff.canStack = false;
			consecratedBuff.isHidden = false;
			consecratedBuff.isDebuff = false;
			consecratedBuff.isCooldown = false;
		}

		public static void Hooks()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			//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_0045: Expected O, but got Unknown
			object obj = <>c.<>9__12_0;
			if (obj == null)
			{
				hook_PerformEquipmentAction val = (orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipDef) => (NetworkServer.active && (Object)(object)equipDef == (Object)(object)equipmentDef) ? OnUse(self) : orig.Invoke(self, equipDef);
				<>c.<>9__12_0 = val;
				obj = (object)val;
			}
			EquipmentSlot.PerformEquipmentAction += (hook_PerformEquipmentAction)obj;
			object obj2 = <>c.<>9__12_1;
			if (obj2 == null)
			{
				StatHookEventHandler val2 = delegate(CharacterBody sender, StatHookEventArgs args)
				{
					if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory) && sender.HasBuff(consecratedBuff))
					{
						args.attackSpeedMultAdd += consecrateAttackSpeedBonus.Value / 100f;
						args.damageMultAdd += consecrateDamageBonus.Value / 100f;
					}
				};
				<>c.<>9__12_1 = val2;
				obj2 = (object)val2;
			}
			RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj2;
		}

		private static bool OnUse(EquipmentSlot slot)
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: 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_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Expected O, but got Unknown
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			CharacterBody characterBody = slot.characterBody;
			if (Object.op_Implicit((Object)(object)characterBody))
			{
				float num = characterBody.healthComponent.health * currentHealthCostPercent;
				if (characterBody.healthComponent.combinedHealth <= num)
				{
					return false;
				}
				DamageInfo val = new DamageInfo
				{
					damage = num,
					attacker = null,
					inflictor = null,
					procCoefficient = 0f,
					position = characterBody.corePosition,
					crit = false,
					damageColorIndex = (DamageColorIndex)0,
					procChainMask = default(ProcChainMask),
					damageType = DamageTypeCombo.op_Implicit((DamageType)2048)
				};
				characterBody.healthComponent.TakeDamage(val);
				foreach (TeamComponent teamMember in TeamComponent.GetTeamMembers(slot.characterBody.teamComponent.teamIndex))
				{
					teamMember.body.AddTimedBuff(consecratedBuff, consecrateDuration.Value);
				}
				return true;
			}
			return false;
		}
	}
	internal class Vanity
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_Start <>9__16_0;

			public static hook_Update <>9__16_1;

			public static hook_PerformEquipmentAction <>9__16_2;

			public static StatHookEventHandler <>9__16_3;

			public static hook_HandleOnKillEffectsServer <>9__16_4;

			internal void <Hooks>b__16_0(orig_Start orig, EquipmentSlot self)
			{
				orig.Invoke(self);
				((Component)self).gameObject.AddComponent<EquipmentTargeter>();
			}

			internal void <Hooks>b__16_1(orig_Update orig, EquipmentSlot self)
			{
				//IL_0028: 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)
				orig.Invoke(self);
				EquipmentTargeter component = ((Component)self).gameObject.GetComponent<EquipmentTargeter>();
				if (!Object.op_Implicit((Object)(object)component))
				{
					return;
				}
				if (equipmentDef.equipmentIndex == self.equipmentIndex)
				{
					if (self.stock > 0)
					{
						component.ConfigureTargetFinderForEnemies(self);
						HurtBox val = component.search.GetResults().FirstOrDefault();
						if (Object.op_Implicit((Object)(object)val))
						{
							component.obj = ((Component)val.healthComponent).gameObject;
							component.indicator.visualizerPrefab = vanityTargetIndicatorPrefab;
							component.indicator.targetTransform = ((Component)val).transform;
						}
						else
						{
							component.Invalidate();
						}
						component.indicator.active = Object.op_Implicit((Object)(object)val);
					}
					else
					{
						component.Invalidate();
						component.indicator.active = false;
					}
				}
				else
				{
					component.Invalidate();
					component.indicator.active = false;
				}
			}

			internal bool <Hooks>b__16_2(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipDef)
			{
				if (NetworkServer.active && (Object)(object)equipDef == (Object)(object)equipmentDef)
				{
					return OnUse(self);
				}
				return orig.Invoke(self, equipDef);
			}

			internal void <Hooks>b__16_3(CharacterBody sender, StatHookEventArgs args)
			{
				if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory))
				{
					args.damageMultAdd -= Utils.GetExponentialStacking(damageLostPercentPerStack, sender.GetBuffCount(hubrisDebuff));
				}
			}

			internal void <Hooks>b__16_4(orig_HandleOnKillEffectsServer orig, CharacterBody self, DamageReport damageReport)
			{
				//IL_0025: 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_003c: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(self, damageReport);
				if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.equipmentSlot) && self.equipmentSlot.equipmentIndex == equipmentDef.equipmentIndex && !DamageAPI.HasModdedDamageType(damageReport.damageInfo, damageType))
				{
					self.AddBuff(hubrisDebuff);
				}
			}
		}

		public static EquipmentDef equipmentDef;

		public static BuffDef hubrisDebuff;

		public static GameObject vanityTargetIndicatorPrefab;

		public static GameObject implosionEffectObject;

		public static ModdedDamageType damageType;

		public static DamageColorIndex damageColor = DamageColorAPI.RegisterDamageColor(Utils.VANITY_COLOR);

		public static ConfigurableValue<bool> isEnabled = new ConfigurableValue<bool>("Equipment: Crown of Vanity", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List<string> { "EQUIPMENT_VANITY_DESC" });

		public static ConfigurableValue<float> damageLostPerStack = new ConfigurableValue<float>("Equipment: Crown of Vanity", "Base Damage Lost", 3f, "Percent base damage lost for each stack of Hubris.", new List<string> { "EQUIPMENT_VANITY_DESC" });

		public static float damageLostPercentPerStack = damageLostPerStack.Value / 100f;

		public static ConfigurableValue<float> damageDealtPerStack = new ConfigurableValue<float>("Equipment: Crown of Vanity", "Damage Dealt", 150f, "Percent damage dealt for each stack of Hubris accrued.", new List<string> { "EQUIPMENT_VANITY_DESC" });

		public static float damageDealtPercentPerStack = damageDealtPerStack.Value / 100f;

		public static ConfigurableValue<float> coefficient = new ConfigurableValue<float>("Equipment: Crown of Vanity", "Proc Coefficient", 1.5f, "Proc coefficient for the single damage instance on equipment use.", new List<string> { "EQUIPMENT_VANITY_DESC" });

		public static ConfigurableValue<int> equipCooldown = new ConfigurableValue<int>("Equipment: Crown of Vanity", "Cooldown", 70, "Equipment cooldown.", new List<string> { "EQUIPMENT_VANITY_DESC" });

		internal static void Init()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Expected O, but got Unknown
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Expected O, but got Unknown
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			GenerateEquipment();
			GenerateBuff();
			vanityTargetIndicatorPrefab = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/WoodSpriteIndicator"), "TooManyItems_vanityTargetIndicator", false);
			vanityTargetIndicatorPrefab.GetComponentInChildren<SpriteRenderer>().color = Utils.VANITY_COLOR;
			((Graphic)vanityTargetIndicatorPrefab.GetComponentInChildren<TextMeshPro>()).color = Utils.VANITY_COLOR;
			implosionEffectObject = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/EliteIce/AffixWhiteExplosion.prefab").WaitForCompletion();
			ContentAddition.AddEffect(implosionEffectObject);
			ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
			ItemAPI.Add(new CustomEquipment(equipmentDef, val));
			ContentAddition.AddBuffDef(hubrisDebuff);
			damageType = DamageAPI.ReserveDamageType();
			Hooks();
		}

		private static void GenerateEquipment()
		{
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			equipmentDef = ScriptableObject.CreateInstance<EquipmentDef>();
			((Object)equipmentDef).name = "VANITY";
			equipmentDef.AutoPopulateTokens();
			GameObject val = AssetHandler.bundle.LoadAsset<GameObject>("Vanity.prefab");
			ModelPanelParameters val2 = val.AddComponent<ModelPanelParameters>();
			val2.focusPointTransform = val.transform;
			val2.cameraPositionTransform = val.transform;
			val2.maxDistance = 10f;
			val2.minDistance = 5f;
			equipmentDef.pickupIconSprite = AssetHandler.bundle.LoadAsset<Sprite>("Vanity.png");
			equipmentDef.pickupModelPrefab = val;
			equipmentDef.isLunar = true;
			equipmentDef.colorIndex = (ColorIndex)4;
			equipmentDef.appearsInMultiPlayer = true;
			equipmentDef.appearsInSinglePlayer = true;
			equipmentDef.canBeRandomlyTriggered = false;
			equipmentDef.enigmaCompatible = false;
			equipmentDef.canDrop = true;
			equipmentDef.cooldown = equipCooldown.Value;
		}

		private static void GenerateBuff()
		{
			hubrisDebuff = ScriptableObject.CreateInstance<BuffDef>();
			((Object)hubrisDebuff).name = "Hubris";
			hubrisDebuff.iconSprite = AssetHandler.bundle.LoadAsset<Sprite>("Hubris.png");
			hubrisDebuff.canStack = true;
			hubrisDebuff.isHidden = false;
			hubrisDebuff.isDebuff = true;
			hubrisDebuff.isCooldown = false;
		}

		public static void Hooks()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			//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_0045: Expected O, but got Unknown
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Expected O, but got Unknown
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Expected O, but got Unknown
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Expected O, but got Unknown
			object obj = <>c.<>9__16_0;
			if (obj == null)
			{
				hook_Start val = delegate(orig_Start orig, EquipmentSlot self)
				{
					orig.Invoke(self);
					((Component)self).gameObject.AddComponent<EquipmentTargeter>();
				};
				<>c.<>9__16_0 = val;
				obj = (object)val;
			}
			EquipmentSlot.Start += (hook_Start)obj;
			object obj2 = <>c.<>9__16_1;
			if (obj2 == null)
			{
				hook_Update val2 = delegate(orig_Update orig, EquipmentSlot self)
				{
					//IL_0028: 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)
					orig.Invoke(self);
					EquipmentTargeter component = ((Component)self).gameObject.GetComponent<EquipmentTargeter>();
					if (Object.op_Implicit((Object)(object)component))
					{
						if (equipmentDef.equipmentIndex == self.equipmentIndex)
						{
							if (self.stock > 0)
							{
								component.ConfigureTargetFinderForEnemies(self);
								HurtBox val6 = component.search.GetResults().FirstOrDefault();
								if (Object.op_Implicit((Object)(object)val6))
								{
									component.obj = ((Component)val6.healthComponent).gameObject;
									component.indicator.visualizerPrefab = vanityTargetIndicatorPrefab;
									component.indicator.targetTransform = ((Component)val6).transform;
								}
								else
								{
									component.Invalidate();
								}
								component.indicator.active = Object.op_Implicit((Object)(object)val6);
							}
							else
							{
								component.Invalidate();
								component.indicator.active = false;
							}
						}
						else
						{
							component.Invalidate();
							component.indicator.active = false;
						}
					}
				};
				<>c.<>9__16_1 = val2;
				obj2 = (object)val2;
			}
			EquipmentSlot.Update += (hook_Update)obj2;
			object obj3 = <>c.<>9__16_2;
			if (obj3 == null)
			{
				hook_PerformEquipmentAction val3 = (orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipDef) => (NetworkServer.active && (Object)(object)equipDef == (Object)(object)equipmentDef) ? OnUse(self) : orig.Invoke(self, equipDef);
				<>c.<>9__16_2 = val3;
				obj3 = (object)val3;
			}
			EquipmentSlot.PerformEquipmentAction += (hook_PerformEquipmentAction)obj3;
			object obj4 = <>c.<>9__16_3;
			if (obj4 == null)
			{
				StatHookEventHandler val4 = delegate(CharacterBody sender, StatHookEventArgs args)
				{
					if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory))
					{
						args.damageMultAdd -= Utils.GetExponentialStacking(damageLostPercentPerStack, sender.GetBuffCount(hubrisDebuff));
					}
				};
				<>c.<>9__16_3 = val4;
				obj4 = (object)val4;
			}
			RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj4;
			object obj5 = <>c.<>9__16_4;
			if (obj5 == null)
			{
				hook_HandleOnKillEffectsServer val5 = delegate(orig_HandleOnKillEffectsServer orig, CharacterBody self, DamageReport damageReport)
				{
					//IL_0025: 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_003c: Unknown result type (might be due to invalid IL or missing references)
					orig.Invoke(self, damageReport);
					if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.equipmentSlot) && self.equipmentSlot.equipmentIndex == equipmentDef.equipmentIndex && !DamageAPI.HasModdedDamageType(damageReport.damageInfo, damageType))
					{
						self.AddBuff(hubrisDebuff);
					}
				};
				<>c.<>9__16_4 = val5;
				obj5 = (object)val5;
			}
			CharacterBody.HandleOnKillEffectsServer += (hook_HandleOnKillEffectsServer)obj5;
		}

		private static bool OnUse(EquipmentSlot slot)
		{
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Expected O, but got Unknown
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: 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)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Expected O, but got Unknown
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			EquipmentTargeter component = ((Component)slot).GetComponent<EquipmentTargeter>();
			CharacterBody val = ((Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.obj)) ? component.obj.GetComponent<CharacterBody>() : null);
			CharacterBody characterBody = slot.characterBody;
			if (Object.op_Implicit((Object)(object)characterBody) && Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.healthComponent))
			{
				int buffCount = characterBody.GetBuffCount(hubrisDebuff);
				characterBody.SetBuffCount(hubrisDebuff.buffIndex, 0);
				EffectManager.SpawnEffect(implosionEffectObject, new EffectData
				{
					origin = val.corePosition,
					scale = 0.2f * (float)buffCount + val.radius,
					color = Color32.op_Implicit(Utils.VANITY_COLOR)
				}, true);
				float damage = characterBody.damage * damageDealtPercentPerStack * (float)buffCount;
				DamageInfo val2 = new DamageInfo
				{
					damage = damage,
					attacker = ((Component)characterBody).gameObject,
					inflictor = ((Component)characterBody).gameObject,
					procCoefficient = coefficient.Value,
					position = val.corePosition,
					crit = characterBody.RollCrit(),
					damageColorIndex = damageColor,
					procChainMask = default(ProcChainMask),
					damageType = DamageTypeCombo.op_Implicit((DamageType)264258)
				};
				DamageAPI.AddModdedDamageType(val2, damageType);
				val.healthComponent.TakeDamage(val2);
				return true;
			}
			return false;
		}
	}
	internal class TatteredScroll
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static hook_PerformEquipmentAction <>9__11_0;

			public static Action<DamageReport> <>9__11_1;

			internal bool <Hooks>b__11_0(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipDef)
			{
				if (NetworkServer.active && (Object)(object)equipDef == (Object)(object)equipmentDef)
				{
					return OnUse(self);
				}
				return orig.Invoke(self, equipDef);
			}

			internal void <Hooks>b__11_1(DamageReport damageReport)
			{
				if (NetworkServer.active && Object.op_Implicit((Object)(object)damageReport.victimBody) && damageReport.victimBody.HasBuff(curseDebuff) && Object.op_Implicit((Object)(object)damageReport.attackerMaster))
				{
					damageReport.attackerMaster.GiveMoney(Utils.ScaleGoldWithDifficulty(goldGranted.Value));
				}
			}
		}

		public static EquipmentDef equipmentDef;

		public static BuffDef curseDebuff;

		public static DamageColorIndex damageColor = DamageColorAPI.RegisterDamageColor(Utils.TATTERED_SCROLL_COLOR);

		public static ConfigurableValue<bool> isEnabled = new ConfigurableValue<bool>("Equipment: Tattered Scroll", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List<string> { "EQUIPMENT_TATTEREDSCROLL_DESC" });

		public static ConfigurableValue<int> curseDistance = new ConfigurableValue<int>("Equipment: Tattered Scroll", "Curse Distance", 60, "Max distance that the curse can reach.", new List<string> { "EQUIPMENT_TATTEREDSCROLL_DESC" });

		public static ConfigurableValue<float> curseDuration = new ConfigurableValue<float>("Equipment: Tattered Scroll", "Curse Duration", 10f, "Duration of the curse.", new List<string> { "EQUIPMENT_TATTEREDSCROLL_DESC" });

		public static ConfigurableValue<int> goldGranted = new ConfigurableValue<int>("Equipment: Tattered Scroll", "Gold Granted", 20, "Gold gained for each cursed enemy killed.", new List<string> { "EQUIPMENT_TATTEREDSCROLL_DESC" });

		public static ConfigurableValue<int> equipCooldown = new ConfigurableValue<int>("Equipment: Tattered Scroll", "Cooldown", 100, "Equipment cooldown.", new List<string> { "EQUIPMENT_TATTEREDSCROLL_DESC" });

		internal static void Init()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			GenerateEquipment();
			GenerateBuff();
			ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
			ItemAPI.Add(new CustomEquipment(equipmentDef, val));
			ContentAddition.AddBuffDef(curseDebuff);
			Hooks();
		}

		private static void GenerateEquipment()
		{
			equipmentDef = ScriptableObject.CreateInstance<EquipmentDef>();
			((Object)equipmentDef).name = "TATTEREDSCROLL";
			equipmentDef.AutoPopulateTokens();
			GameObject val = AssetHandler.bundle.LoadAsset<GameObject>("TatteredScroll.prefab");
			ModelPanelParameters val2 = val.AddComponent<ModelPanelParameters>();
			val2.focusPointTransform = val.transform;
			val2.cameraPositionTransform = val.transform;
			val2.maxDistance = 10f;
			val2.minDistance = 5f;
			equipmentDef.pickupIconSprite = AssetHandler.bundle.LoadAsset<Sprite>("TatteredScroll.png");
			equipmentDef.pickupModelPrefab = val;
			equipmentDef.appearsInMultiPlayer = true;
			equipmentDef.appearsInSinglePlayer = true;
			equipmentDef.canBeRandomlyTriggered = true;
			equipmentDef.enigmaCompatible = true;
			equipmentDef.canDrop = true;
			equipmentDef.cooldown = equipCooldown.Value;
		}

		private static void GenerateBuff()
		{
			curseDebuff = ScriptableObject.CreateInstance<BuffDef>();
			((Object)curseDebuff).name = "Siphon";
			curseDebuff.iconSprite = AssetHandler.bundle.LoadAsset<Sprite>("TatteredCurse.png");
			curseDebuff.canStack = false;
			curseDebuff.isHidden = false;
			curseDebuff.isDebuff = true;
			curseDebuff.isCooldown = false;
		}

		public static void Hooks()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			object obj = <>c.<>9__11_0;
			if (obj == null)
			{
				hook_PerformEquipmentAction val = (orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipDef) => (NetworkServer.active && (Object)(object)equipDef == (Object)(object)equipmentDef) ? OnUse(self) : orig.Invoke(self, equipDef);
				<>c.<>9__11_0 = val;
				obj = (object)val;
			}
			EquipmentSlot.PerformEquipmentAction += (hook_PerformEquipmentAction)obj;
			GlobalEventManager.onCharacterDeathGlobal += delegate(DamageReport damageReport)
			{
				if (NetworkServer.active && Object.op_Implicit((Object)(object)damageReport.victimBody) && damageReport.victimBody.HasBuff(curseDebuff) && Object.op_Implicit((Object)(object)damageReport.attackerMaster))
				{
					damageReport.attackerMaster.GiveMoney(Utils.ScaleGoldWithDifficulty(goldGranted.Value));
				}
			};
		}

		private static bool OnUse(EquipmentSlot slot)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: 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_0029: 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_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: 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)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Expected O, but got Unknown
			HurtBox[] hurtBoxes = new SphereSearch
			{
				mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask,
				origin = slot.characterBody.corePosition,
				queryTriggerInteraction = (QueryTriggerInteraction)2,
				radius = curseDistance.Value
			}.RefreshCandidates().FilterCandidatesByDistinctHurtBoxEntities().GetHurtBoxes();
			HurtBox[] array = hurtBoxes;
			foreach (HurtBox val in array)
			{
				CharacterBody body = val.healthComponent.body;
				if (Object.op_Implicit((Object)(object)body) && (Object)(object)body != (Object)(object)slot.characterBody && !body.isPlayerControlled)
				{
					body.healthComponent.TakeDamage(new DamageInfo
					{
						damage = slot.characterBody.damage,
						attacker = ((Component)slot.characterBody).gameObject,
						inflictor = ((Component)slot.characterBody).gameObject,
						procCoefficient = 0f,
						position = body.corePosition,
						crit = false,
						damageColorIndex = damageColor,
						procChainMask = default(ProcChainMask),
						damageType = DamageTypeCombo.op_Implicit((DamageType)2048)
					});
					body.AddTimedBuff(curseDebuff, curseDuration.Value);
				}
			}
			return true;
		}
	}
	internal class AncientCoin
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static GenericGameEvents.DamageAttackerVictimEventHandler <>9__8_0;

			public static hook_GiveMoney <>9__8_1;

			internal void <Hooks>b__8_0(DamageInfo damageInfo, TooManyItems.GenericCharacterInfo attackerInfo, TooManyItems.GenericCharacterInfo victimInfo)
			{
				if (!((Object)(object)victimInfo.inventory == (Object)null) && !((Object)(object)victimInfo.body == (Object)null))
				{
					int itemCountPermanent = victimInfo.inventory.GetItemCountPermanent(itemDef);
					if (itemCountPermanent > 0)
					{
						damageInfo.damage *= 1f + (float)itemCountPermanent * damageMultiplierAsPercent;
					}
				}
			}

			internal void <Hooks>b__8_1(orig_GiveMoney orig, CharacterMaster self, uint amount)
			{
				if (Object.op_Implicit((Object)(object)self.inventory))
				{
					int itemCountPermanent = self.inventory.GetItemCountPermanent(itemDef);
					if (itemCountPermanent > 0)
					{
						float num = 1f + (float)itemCountPermanent * goldMultiplierAsPercent;
						amount = Convert.ToUInt32((float)amount * num);
					}
				}
				orig.Invoke(self, amount);
			}
		}

		public static ItemDef itemDef;

		public static ConfigurableValue<bool> isEnabled = new ConfigurableValue<bool>("Item: Ancient Coin", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List<string> { "ITEM_ANCIENTCOIN_DESC" });

		public static ConfigurableValue<float> goldMultiplierPerStack = new ConfigurableValue<float>("Item: Ancient Coin", "Gold Multiplier", 100f, "Gold generation increase as a percentage.", new List<string> { "ITEM_ANCIENTCOIN_DESC" });

		public static ConfigurableValue<float> damageMultiplierPerStack = new ConfigurableValue<float>("Item: Ancient Coin", "Damage Multiplier", 25f, "Damage taken increase as a percentage.", new List<string> { "ITEM_ANCIENTCOIN_DESC" });

		public static float goldMultiplierAsPercent = goldMultiplierPerStack.Value / 100f;

		public static float damageMultiplierAsPercent = damageMultiplierPerStack.Value / 100f;

		internal static void Init()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			GenerateItem();
			ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
			ItemAPI.Add(new CustomItem(itemDef, val));
			Hooks();
		}

		private static void GenerateItem()
		{
			itemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)itemDef).name = "ANCIENTCOIN";
			itemDef.AutoPopulateTokens();
			Utils.SetItemTier(itemDef, (ItemTier)3);
			GameObject val = AssetHandler.bundle.LoadAsset<GameObject>("AncientCoin.prefab");
			ModelPanelParameters val2 = val.AddComponent<ModelPanelParameters>();
			val2.focusPointTransform = val.transform;
			val2.cameraPositionTransform = val.transform;
			val2.maxDistance = 10f;
			val2.minDistance = 5f;
			itemDef.pickupIconSprite = AssetHandler.bundle.LoadAsset<Sprite>("AncientCoin.png");
			itemDef.pickupModelPrefab = val;
			itemDef.canRemove = true;
			itemDef.hidden = false;
		}

		public static void Hooks()
		{
			//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_0045: Expected O, but got Unknown
			GenericGameEvents.BeforeTakeDamage += delegate(DamageInfo damageInfo, TooManyItems.GenericCharacterInfo attackerInfo, TooManyItems.GenericCharacterInfo victimInfo)
			{
				if (!((Object)(object)victimInfo.inventory == (Object)null) && !((Object)(object)victimInfo.body == (Object)null))
				{
					int itemCountPermanent2 = victimInfo.inventory.GetItemCountPermanent(itemDef);
					if (itemCountPermanent2 > 0)
					{
						damageInfo.damage *= 1f + (float)itemCountPermanent2 * damageMultiplierAsPercent;
					}
				}
			};
			object obj = <>c.<>9__8_1;
			if (obj == null)
			{
				hook_GiveMoney val = delegate(orig_GiveMoney orig, CharacterMaster self, uint amount)
				{
					if (Object.op_Implicit((Object)(object)self.inventory))
					{
						int itemCountPermanent = self.inventory.GetItemCountPermanent(itemDef);
						if (itemCountPermanent > 0)
						{
							float num = 1f + (float)itemCountPermanent * goldMultiplierAsPercent;
							amount = Convert.ToUInt32((float)amount * num);
						}
					}
					orig.Invoke(self, amount);
				};
				<>c.<>9__8_1 = val;
				obj = (object)val;
			}
			CharacterMaster.GiveMoney += (hook_GiveMoney)obj;
		}
	}
	internal class CarvingBlade
	{
		public class Statistics : MonoBehaviour
		{
			public class Sync : INetMessage, ISerializableObject
			{
				private NetworkInstanceId objId;

				private float totalDamageDealt;

				public Sync()
				{
				}

				public Sync(NetworkInstanceId objId, float totalDamage)
				{
					//IL_0009: Unknown result type (might be due to invalid IL or missing references)
					//IL_000a: Unknown result type (might be due to invalid IL or missing references)
					this.objId = objId;
					totalDamageDealt = totalDamage;
				}

				public void Deserialize(NetworkReader reader)
				{
					//IL_0003: Unknown result type (might be due to invalid IL or missing references)
					//IL_0008: Unknown result type (might be due to invalid IL or missing references)
					objId = reader.ReadNetworkId();
					totalDamageDealt = reader.ReadSingle();
				}

				public void OnReceived()
				{
					//IL_000d: Unknown result type (might be due to invalid IL or missing references)
					if (NetworkServer.active)
					{
						return;
					}
					GameObject val = Util.FindNetworkObject(objId);
					if ((Object)(object)val != (Object)null)
					{
						Statistics component = val.GetComponent<Statistics>();
						if ((Object)(object)component != (Object)null)
						{
							component.TotalDamageDealt = totalDamageDealt;
						}
					}
				}

				public void Serialize(NetworkWriter writer)
				{
					//IL_0003: Unknown result type (might be due to invalid IL or missing references)
					writer.Write(objId);
					writer.Write(totalDamageDealt);
					writer.FinishMessage();
				}
			}

			private float _totalDamageDealt;

			public float TotalDamageDealt
			{
				get
				{
					return _totalDamageDealt;
				}
				set
				{
					//IL_001d: Unknown result type (might be due to invalid IL or missing references)
					_totalDamageDealt = value;
					if (NetworkServer.active)
					{
						NetMessageExtensions.Send((INetMessage)(object)new Sync(((Component)this).gameObject.GetComponent<NetworkIdentity>().netId, value), (NetworkDestination)1);
					}
				}
			}
		}

		public static ItemDef itemDef;

		public static ModdedDamageType damageType;

		public static DamageColorIndex damageColor = DamageColorAPI.RegisterDamageColor(Utils.CARVING_BLADE_COLOR);

		public static ConfigurableValue<bool> isEnabled = new ConfigurableValue<bool>("Item: Carving Blade", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List<string> { "ITEM_CARVINGBLADE_DESC" });

		public static ConfigurableValue<float> currentHPDamage = new ConfigurableValue<float>("Item: Carving Blade", "On-Hit Damage Scaling", 2f, "Percent of enemy's current health dealt as bonus on-hit damage.", new List<string> { "ITEM_CARVINGBLADE_DESC" });

		public static ConfigurableValue<float> damageCapMultiplier = new ConfigurableValue<float>("Item: Carving Blade", "Damage Cap", 2000f, "Maximum damage on-hit. This value is displayed as a percentage of the user's base damage (100 = 1x your base damage).", new List<string> { "ITEM_CARVINGBLADE_DESC" });

		public static ConfigurableValue<float> damageCapMultiplierExtraStacks = new ConfigurableValue<float>("Item: Carving Blade", "Damage Cap Extra Stacks", 1000f, "Maximum damage on-hit with extra stacks. This value is displayed as a percentage of the user's base damage (100 = 1x your base damage).", new List<string> { "ITEM_CARVINGBLADE_DESC" });

		public static float currentHPDamageAsPercent = currentHPDamage.Value / 100f;

		public static float damageCapMultAsPercent = damageCapMultiplier.Value / 100f;

		public static float damageCapMultExtraStacksAsPercent = damageCapMultiplierExtraStacks.Value / 100f;

		internal static void Init()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			//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)
			GenerateItem();
			ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
			ItemAPI.Add(new CustomItem(itemDef, val));
			NetworkingAPI.RegisterMessageType<Statistics.Sync>();
			damageType = DamageAPI.ReserveDamageType();
			Hooks();
		}

		private static void GenerateItem()
		{
			itemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)itemDef).name = "CARVINGBLADE";
			itemDef.AutoPopulateTokens();
			Utils.SetItemTier(itemDef, (ItemTier)3);
			GameObject val = AssetHandler.bundle.LoadAsset<GameObject>("CarvingBlade.prefab");
			ModelPanelParameters val2 = val.AddComponent<ModelPanelParameters>();
			val2.focusPointTransform = val.transform;
			val2.cameraPositionTransform = val.transform;
			val2.maxDistance = 10f;
			val2.minDistance = 5f;
			itemDef.pickupIconSprite = AssetHandler.bundle.LoadAsset<Sprite>("CarvingBlade.png");
			itemDef.pickupModelPrefab = val;
			itemDef.canRemove = true;
			itemDef.hidden = false;
		}

		public static float CalculateDamageCapPercent(int itemCount)
		{
			return damageCapMultAsPercent + damageCapMultExtraStacksAsPercent * (float)(itemCount - 1);
		}

		public static void Hooks()
		{
			CharacterMaster.onStartGlobal += delegate(CharacterMaster obj)
			{
				Inventory inventory = obj.inventory;
				if (inventory != null)
				{
					((Component)inventory).gameObject.AddComponent<Statistics>();
				}
			};
			GenericGameEvents.BeforeTakeDamage += delegate(DamageInfo damageInfo, TooManyItems.GenericCharacterInfo attackerInfo, TooManyItems.GenericCharacterInfo victimInfo)
			{
				if (Object.op_Implicit((Object)(object)attackerInfo.inventory) && attackerInfo.inventory.GetItemCountPermanent(itemDef) > 0)
				{
					damageInfo.crit = false;
				}
			};
			GenericGameEvents.OnHitEnemy += delegate(DamageInfo damageInfo, TooManyItems.GenericCharacterInfo attackerInfo, TooManyItems.GenericCharacterInfo victimInfo)
			{
				//IL_004c: 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_00c7: 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_00d3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00df: Unknown result type (might be due to invalid IL or missing references)
				//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f8: 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_0109: Unknown result type (might be due to invalid IL or missing references)
				//IL_010a: Unknown result type (might be due to invalid IL or missing references)
				//IL_010f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0114: Unknown result type (might be due to invalid IL or missing references)
				//IL_0116: Unknown result type (might be due to invalid IL or missing references)
				//IL_011b: 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: Unknown result type (might be due to invalid IL or missing references)
				//IL_012b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0132: Expected O, but got Unknown
				//IL_0134: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)attackerInfo.body) && Object.op_Implicit((Object)(object)victimInfo.body) && Object.op_Implicit((Object)(object)attackerInfo.inventory))
				{
					int itemCountPermanent = attackerInfo.inventory.GetItemCountPermanent(itemDef);
					if (itemCountPermanent > 0 && attackerInfo.teamComponent.teamIndex != victimInfo.teamComponent.teamIndex)
					{
						float num = Mathf.Max(victimInfo.body.healthComponent.health * currentHPDamageAsPercent, 0.01f);
						if (damageCapMultiplier.Value < 0f)
						{
							damageCapMultAsPercent = 40f;
						}
						num = Mathf.Min(num, attackerInfo.body.damage * CalculateDamageCapPercent(itemCountPermanent));
						DamageInfo val = new DamageInfo
						{
							damage = num,
							attacker = attackerInfo.gameObject,
							inflictor = attackerInfo.gameObject,
							procCoefficient = 0f,
							position = damageInfo.position,
							crit = false,
							damageColorIndex = damageColor,
							procChainMask = damageInfo.procChainMask,
							damageType = DamageTypeCombo.op_Implicit((DamageType)2048)
						};
						DamageAPI.AddModdedDamageType(val, damageType);
						victimInfo.healthComponent.TakeDamage(val);
						CharacterBody minionOwnershipParentBody = Utils.GetMinionOwnershipParentBody(attackerInfo.body);
						((Component)minionOwnershipParentBody.inventory).GetComponent<Statistics>().TotalDamageDealt += num;
					}
				}
			};
		}
	}
	internal class Crucifix
	{
		public static ItemDef itemDef;

		public static ConfigurableValue<bool> isEnabled = new ConfigurableValue<bool>("Item: Crucifix", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List<string> { "ITEM_CRUCIFIX_DESC" });

		public static ConfigurableValue<float> damageReduction = new ConfigurableValue<float>("Item: Crucifix", "Damage Reduction", 100f, "Percentage of damage reduced.", new List<string> { "ITEM_CRUCIFIX_DESC" });

		public static ConfigurableValue<float> maxHealthBurnAmount = new ConfigurableValue<float>("Item: Crucifix", "Burn Amount", 40f, "Percentage of max health taken over the duration of the burn.", new List<string> { "ITEM_CRUCIFIX_DESC" });

		public static ConfigurableValue<float> maxHealthBurnAmountReduction = new ConfigurableValue<float>("Item: Crucifix", "Burn Amount Reduction", 8f, "Percentage of burn damage reduced per stack of this item. This scales hyperbolically.", new List<string> { "ITEM_CRUCIFIX_DESC" });

		public static ConfigurableValue<bool> isCrucifixBurnStackable = new ConfigurableValue<bool>("Item: Crucifix", "Is Burn Stackable", defaultValue: false, "Whether or not the burn caused by Crucifix is stackable.", new List<string> { "ITEM_CRUCIFIX_DESC" });

		public static float damageReductionPercent = damageReduction.Value / 100f;

		public static float maxHealthBurnAmountPercent = maxHealthBurnAmount.Value / 100f;

		public static float maxHealthBurnAmountReductionPercent = maxHealthBurnAmountReduction.Value / 100f;

		internal static void Init()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			GenerateItem();
			ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
			ItemAPI.Add(new CustomItem(itemDef, val));
			Hooks();
		}

		private static void GenerateItem()
		{
			itemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)itemDef).name = "CRUCIFIX";
			itemDef.AutoPopulateTokens();
			Utils.SetItemTier(itemDef, (ItemTier)3);
			GameObject val = AssetHandler.bundle.LoadAsset<GameObject>("Crucifix.prefab");
			ModelPanelParameters val2 = val.AddComponent<ModelPanelParameters>();
			val2.focusPointTransform = val.transform;
			val2.cameraPositionTransform = val.transform;
			val2.maxDistance = 10f;
			val2.minDistance = 5f;
			itemDef.pickupIconSprite = AssetHandler.bundle.LoadAsset<Sprite>("Crucifix.png");
			itemDef.pickupModelPrefab = val;
			itemDef.canRemove = true;
			itemDef.hidden = false;
		}

		public static void Hooks()
		{
			GenericGameEvents.BeforeTakeDamage += delegate(DamageInfo damageInfo, TooManyItems.GenericCharacterInfo attackerInfo, TooManyItems.GenericCharacterInfo victimInfo)
			{
				//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_0045: Invalid comparison between Unknown and I4
				//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
				//IL_0116: Unknown result type (might be due to invalid IL or missing references)
				//IL_0118: Unknown result type (might be due to invalid IL or missing references)
				if (!((Object)(object)victimInfo.inventory == (Object)null) && !((Object)(object)victimInfo.body == (Object)null) && !((Object)(object)attackerInfo.body == (Object)null) && (int)DamageTypeCombo.op_Implicit(damageInfo.damageType) != 65536)
				{
					int itemCountPermanent = victimInfo.inventory.GetItemCountPermanent(itemDef);
					if (itemCountPermanent > 0 && (Object)(object)attackerInfo.body != (Object)(object)victimInfo.body)
					{
						damageInfo.damage *= 1f - damageReductionPercent;
						float reverseExponentialStacking = Utils.GetReverseExponentialStacking(maxHealthBurnAmountPercent, maxHealthBurnAmountReductionPercent, itemCountPermanent);
						InflictDotInfo val = default(InflictDotInfo);
						val.victimObject = ((Component)victimInfo.body).gameObject;
						val.attackerObject = ((Component)victimInfo.body).gameObject;
						val.totalDamage = victimInfo.body.healthComponent.fullCombinedHealth * reverseExponentialStacking;
						val.dotIndex = (DotIndex)1;
						val.duration = 0f;
						val.damageMultiplier = 1f;
						InflictDotInfo val2 = val;
						if (!isCrucifixBurnStackable)
						{
							val2.maxStacksFromAttacker = 1u;
						}
						DotController.InflictDot(ref val2);
					}
				}
			};
		}
	}
	internal class DoubleDown
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static hook_InflictDot_refInflictDotInfo <0>__DotController_InflictDot_refInflictDotInfo;
		}

		public static ItemDef itemDef;

		public static ConfigurableValue<bool> isEnabled = new ConfigurableValue<bool>("Item: Double Down", "Enabled", defaultValue: true, "Whether or not the item is enabled.", new List<string> { "ITEM_DOUBLEDOWN_DESC" });

		public static ConfigurableValue<float> upFrontDamage = new ConfigurableValue<float>("Item: Double Down", "Total Up Front", 200f, "Percentage of the total DoT damage taken up front.", new List<string> { "ITEM_DOUBLEDOWN_DESC" });

		public static ConfigurableValue<float> upFrontDamageReduction = new ConfigurableValue<float>("Item: Double Down", "Damage Reduced Per Stack", 12f, "Percentage of the up front damage reduced with stacks.", new List<string> { "ITEM_DOUBLEDOWN_DESC" });

		public static float upFrontDamagePercent = upFrontDamage.Value / 100f;

		public static float upFrontDamageReductionPercent = upFrontDamageReduction.Value / 100f;

		internal static void Init()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			GenerateItem();
			ItemDisplayRuleDict val = new ItemDisplayRuleDict((ItemDisplayRule[])null);
			ItemAPI.Add(new CustomItem(itemDef, val));
			Hooks();
		}

		private static void GenerateItem()
		{
			itemDef = ScriptableObject.CreateInstance<ItemDef>();
			((Object)itemDef).name = "DOUBLEDOWN";
			itemDef.AutoPopulateTokens();
			Utils.SetItemTier(itemDef, (ItemTier)3);
			GameObject val = AssetHandler.bundle.LoadAsset<GameObject>("DoubleDown.prefab");
			ModelPanelParameters val2 = val.AddComponent<ModelPanelParameters>();
			val2.focusPointTransform = val.transform;
			val2.cameraPositionTransform = val.transform;
			val2.maxDistance = 10f;
			val2.minDistance = 5f;
			itemDef.pickupIconSprite = AssetHandler.bundle.LoadAsset<Sprite>("DoubleDown.png");
			itemDef.pickupModelPrefab = val;
			itemDef.canRemove = true;
			itemDef.hidden = false;
		}

		public static void Hooks()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			object obj = <>O.<0>__DotController_InflictDot_refInflictDotInfo;
			if (obj == null)
			{
				hook_InflictDot_refInflictDotInfo val = DotController_InflictDot_refInflictDotInfo;
				<>O.<0>__DotController_InflictDot_refInflictDotInfo = val;
				obj = (object)val;
			}
			DotController.InflictDot_refInflictDotInfo += (hook_InflictDot_refInflictDotInfo)obj;
		}

		private static void DotController_InflictDot_refInflictDotInfo(orig_InflictDot_refInflictDotInfo orig, ref InflictDotInfo info)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Invalid comparison between Unknown and I4
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unkn