Decompiled source of ExtradimensionalItems v0.5.9

plugins/viliger-ExtradimensionalItems/ExtradimensionalItems.dll

Decompiled 3 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates;
using ExtradimensionalItems.Modules.Content;
using ExtradimensionalItems.Modules.Effects;
using ExtradimensionalItems.Modules.Equipment;
using ExtradimensionalItems.Modules.Interactables;
using ExtradimensionalItems.Modules.Items;
using ExtradimensionalItems.Modules.Items.ItemBehaviors;
using ExtradimensionalItems.Modules.SkillStates;
using ExtradimensionalItems.Modules.UI;
using HG;
using HG.Reflection;
using HarmonyLib;
using IL.RoR2.UI;
using KinematicCharacterController;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.RoR2;
using On.RoR2.Items;
using On.RoR2.UI;
using R2API;
using R2API.Networking;
using R2API.Networking.Interfaces;
using R2API.Utils;
using RiskOfOptions;
using RiskOfOptions.Components.Panel;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.Artifacts;
using RoR2.Audio;
using RoR2.ExpansionManagement;
using RoR2.Skills;
using RoR2.UI;
using ShrineOfRepair.Modules;
using SimpleJSON;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Bindings;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyTitle("ExtradimensionalItems")]
[assembly: AssemblyProduct("ExtradimensionalItems")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: OptIn]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyCompany("ExtradimensionalItems")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace ExtradimensionalItems.Modules
{
	public static class ExtensionMethods
	{
		public static void AddOrReplace(this Dictionary<CharacterBody, bool> dictionary, CharacterBody key, bool value)
		{
			if (dictionary.ContainsKey(key))
			{
				dictionary[key] = value;
			}
			else
			{
				dictionary.Add(key, value);
			}
		}

		public static TimedBuff GetTimedBuff(this CharacterBody body, BuffDef buff, bool getLowest = false)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			if (!NetworkServer.active)
			{
				MyLogger.LogWarning("[Server] extension function 'System.Void RoR2.CharacterBody::GetTimedBuff(RoR2.BuffDef, bool)' called on client");
				return null;
			}
			return body.GetTimedBuff(buff.buffIndex, getLowest);
		}

		public static TimedBuff GetTimedBuff(this CharacterBody body, BuffIndex buff, bool getLowest = false)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			if (!NetworkServer.active)
			{
				MyLogger.LogWarning("[Server] extension function 'System.Void RoR2.CharacterBody::GetTimedBuff(RoR2.BuffIndex, bool)' called on client");
				return null;
			}
			TimedBuff val = null;
			foreach (TimedBuff timedBuff in body.timedBuffs)
			{
				if (timedBuff.buffIndex == buff)
				{
					if (!getLowest)
					{
						return timedBuff;
					}
					if (val == null || val?.timer > timedBuff.timer)
					{
						val = timedBuff;
					}
				}
			}
			return val;
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.Viliger.ExtradimensionalItems", "ExtradimensionalItems", "0.5.9")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class ExtradimensionalItemsPlugin : BaseUnityPlugin
	{
		public static ConfigEntry<bool> ExtensiveLogging;

		public static PluginInfo PInfo;

		public const string BundleFolder = "Assets";

		public const string SoundBanksFolder = "Soundbanks";

		public const string LanguageFolder = "Languages";

		public static Dictionary<string, string> ShaderLookup = new Dictionary<string, string>
		{
			{ "Stubbed Hopoo Games/Deferred/Standard", "shaders/deferred/hgstandard" },
			{ "Hopoo Games/FX/Cloud Remap", "shaders/fx/hgcloudremap" },
			{ "Stubbed Hopoo Games/FX/Cloud Remap", "shaders/fx/hgcloudremap" }
		};

		private void Awake()
		{
			ExtensiveLogging = ((BaseUnityPlugin)this).Config.Bind<bool>("Logging", "Enable extensive logging?", false, "Enables extensive logging, logs every major event related to new content. Might result in worse performance because it logs a lot.");
			MyLogger.Init(((BaseUnityPlugin)this).Logger);
			PInfo = ((BaseUnityPlugin)this).Info;
			foreach (Type item in from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(ItemBase))
				select type)
			{
				ItemBase itemBase = (ItemBase)Activator.CreateInstance(item);
				if (ValidateItem(itemBase))
				{
					itemBase.Init(((BaseUnityPlugin)this).Config);
					MyLogger.LogInfo("Item: " + itemBase.ItemLangTokenName + " loaded.");
				}
			}
			foreach (Type item2 in from type in Assembly.GetExecutingAssembly().GetTypes()
				where !type.IsAbstract && type.IsSubclassOf(typeof(EquipmentBase))
				select type)
			{
				EquipmentBase equipmentBase = (EquipmentBase)Activator.CreateInstance(item2);
				if (ValidateEquipment(equipmentBase))
				{
					equipmentBase.Init(((BaseUnityPlugin)this).Config);
					MyLogger.LogInfo("Equipment: " + equipmentBase.EquipmentLangTokenName + " loaded.");
				}
			}
			NetworkingAPI.RegisterMessageType<Chronoshift.ChronoshiftStartMovingOnClient>();
			NetworkingAPI.RegisterMessageType<Chronoshift.ChronoshiftRestoreStateOnServer>();
			NetworkingAPI.RegisterMessageType<DamageOnCooldowns.DamageOnCooldownsSendNumberBuffs>();
			if (RiskOfOptionsCompat.enabled)
			{
				RiskOfOptionsCompat.SetDescription();
				RiskOfOptionsCompat.SetIcon();
				RiskOfOptionsCompat.CreateNewOption(ExtensiveLogging);
			}
		}

		public bool ValidateEquipment(EquipmentBase equipment)
		{
			return ((BaseUnityPlugin)this).Config.Bind<bool>("Equipment: " + equipment.EquipmentName, "Enable Equipment?", true, "Should this equipment appear in runs?").Value;
		}

		public bool ValidateItem(ItemBase item)
		{
			return ((BaseUnityPlugin)this).Config.Bind<bool>("Item: " + item.ItemName, "Enable item?", true, "Should this item appear in runs?").Value;
		}
	}
	public static class MyLogger
	{
		private static ManualLogSource logger;

		public static void Init(ManualLogSource log)
		{
			logger = log;
		}

		public static void LogWarning(object data)
		{
			logger.LogWarning(data);
		}

		public static void LogInfo(object data)
		{
			logger.LogInfo(data);
		}

		public static void LogError(object data)
		{
			logger.LogError(data);
		}

		public static void LogMessage(string data, params string[] args)
		{
			if (ExtradimensionalItemsPlugin.ExtensiveLogging.Value)
			{
				logger.LogMessage((object)string.Format(data, args));
			}
		}
	}
	public static class RiskOfOptionsCompat
	{
		private static bool? _enabled;

		public static bool enabled
		{
			get
			{
				if (!_enabled.HasValue)
				{
					_enabled = Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions");
				}
				return _enabled.Value;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void AddDelegateOnModOptionsExit(Action action)
		{
			ModOptionPanelController.OnModOptionsExit = (Action)Delegate.Combine(ModOptionPanelController.OnModOptionsExit, action);
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void SetDescription()
		{
			ModSettingsManager.SetModDescription("Items from different worlds.", "com.Viliger.ExtradimensionalItems", "ExtradimensionalItems");
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void SetIcon()
		{
			ModSettingsManager.SetModIcon(AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(ExtradimensionalItemsPlugin.PInfo.Location), "Assets", "config")).LoadAsset<Sprite>("ModIcon.png"), "com.Viliger.ExtradimensionalItems", "ExtradimensionalItems");
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void CreateNewOption(ConfigEntry<float> entry, bool restartRequired = false)
		{
			//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_0012: Expected O, but got Unknown
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(entry, new StepSliderConfig
			{
				restartRequired = restartRequired
			}));
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void CreateNewOption(ConfigEntry<float> entry, float min, float max, float increment = 1f, bool restartRequired = false)
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Expected O, but got Unknown
			ModSettingsManager.AddOption((BaseOption)new StepSliderOption(entry, new StepSliderConfig
			{
				min = min,
				max = max,
				increment = increment,
				restartRequired = restartRequired
			}));
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void CreateNewOption(ConfigEntry<bool> entry, bool restartRequired = false)
		{
			//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_0012: Expected O, but got Unknown
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(entry, new CheckBoxConfig
			{
				restartRequired = restartRequired
			}));
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void CreateNewOption(ConfigEntry<int> entry, int min = 0, int max = 200, bool restartRequired = false)
		{
			//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_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			ModSettingsManager.AddOption((BaseOption)new IntSliderOption(entry, new IntSliderConfig
			{
				min = min,
				max = max,
				restartRequired = restartRequired
			}));
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void CreateNewOption(ConfigEntry<RoyalGuard.ItemType> entry, bool restartRequired = false)
		{
			//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_0012: Expected O, but got Unknown
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			ModSettingsManager.AddOption((BaseOption)new ChoiceOption((ConfigEntryBase)(object)entry, new ChoiceConfig
			{
				restartRequired = restartRequired
			}));
		}
	}
	public static class ShrineOfRepairCompat
	{
		private static bool? _enabled;

		public static bool enabled
		{
			get
			{
				if (!_enabled.HasValue)
				{
					_enabled = Chainloader.PluginInfos.ContainsKey("com.Viliger.ShrineOfRepair");
				}
				return _enabled.Value;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void AddListenerToFillDictionary()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			ModExtension.AddItemsListener(new DictionaryFillItemsDelegate(AddFuelCellDepletedToRepairList));
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void AddFuelCellDepletedToRepairList()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			ModExtension.AddItemsToList(ExtradimensionalItems.Modules.Content.Items.FuelCellDepleted.itemIndex, Items.EquipmentMagazine.itemIndex, "ExtradimensionalItems");
		}
	}
	public static class Utils
	{
		public static bool RegisterNetworkSound(string eventName)
		{
			NetworkSoundEventDef obj = ScriptableObject.CreateInstance<NetworkSoundEventDef>();
			((Object)obj).name = eventName;
			obj.eventName = eventName;
			return ContentAddition.AddNetworkSoundEventDef(obj);
		}

		public static void ShaderConversion(AssetBundle assets)
		{
			assets.LoadAllAssets<Material>();
			foreach (Material item in from material in assets.LoadAllAssets<Material>()
				where ((Object)material.shader).name.Contains("Hopoo Games")
				select material)
			{
				Shader val = LegacyResourcesAPI.Load<Shader>(ExtradimensionalItemsPlugin.ShaderLookup[((Object)item.shader).name]);
				if (Object.op_Implicit((Object)(object)val))
				{
					item.shader = val;
				}
			}
		}

		public static RendererInfo[] ItemDisplaySetup(GameObject obj)
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			List<Renderer> list = new List<Renderer>();
			MeshRenderer[] componentsInChildren = obj.GetComponentsInChildren<MeshRenderer>();
			if (componentsInChildren.Length != 0)
			{
				list.AddRange((IEnumerable<Renderer>)(object)componentsInChildren);
			}
			SkinnedMeshRenderer[] componentsInChildren2 = obj.GetComponentsInChildren<SkinnedMeshRenderer>();
			if (componentsInChildren2.Length != 0)
			{
				list.AddRange((IEnumerable<Renderer>)(object)componentsInChildren2);
			}
			RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[list.Count];
			for (int i = 0; i < list.Count; i++)
			{
				array[i] = new RendererInfo
				{
					defaultMaterial = ((list[i] is SkinnedMeshRenderer) ? list[i].sharedMaterial : list[i].material),
					renderer = list[i],
					defaultShadowCastingMode = (ShadowCastingMode)1,
					ignoreOverlays = false
				};
			}
			return array;
		}

		[ConCommand(/*Could not decode attribute arguments.*/)]
		private static void CCGiveItemAI(ConCommandArgs args)
		{
			//IL_0052: 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_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Invalid comparison between Unknown and I4
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: 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)
			if (((ConCommandArgs)(ref args)).Count == 0)
			{
				Debug.Log((object)"No parameters specified. Requires 2 arguments: {item} [count:1]");
				return;
			}
			int result = 1;
			if (((ConCommandArgs)(ref args)).Count >= 2 && ((ConCommandArgs)(ref args))[1] != "")
			{
				result = ((!int.TryParse(((ConCommandArgs)(ref args))[1], out result)) ? 1 : result);
			}
			ItemIndex itemFromPartial = GetItemFromPartial(((ConCommandArgs)(ref args))[0]);
			if ((int)itemFromPartial != -1)
			{
				if (RunArtifactManager.instance.IsArtifactEnabled(Artifacts.monsterTeamGainsItemsArtifactDef) && Object.op_Implicit((Object)(object)MonsterTeamGainsItemsArtifactManager.monsterTeamInventory))
				{
					MonsterTeamGainsItemsArtifactManager.monsterTeamInventory.GiveItem(itemFromPartial, result);
					Debug.Log((object)$"Gave {result} {itemFromPartial} to AIs");
				}
				else if ((Object)(object)SceneCatalog.GetSceneDefForCurrentScene() == (Object)(object)SceneCatalog.GetSceneDefFromSceneName("arena") && Object.op_Implicit((Object)(object)ArenaMissionController.instance) && Object.op_Implicit((Object)(object)ArenaMissionController.instance.inventory))
				{
					ArenaMissionController.instance.inventory.GiveItem(itemFromPartial, result);
					Debug.Log((object)$"Gave {result} {itemFromPartial} to AIs");
				}
				else
				{
					Debug.Log((object)"Only works when Artifact of Evolution is enabled or if players are in Void Fields.");
				}
			}
			else
			{
				Debug.Log((object)$"Item {((ConCommandArgs)(ref args))[0]} is not found.");
			}
		}

		[ConCommand(/*Could not decode attribute arguments.*/)]
		private static void CCGiveAllEDItems(ConCommandArgs args)
		{
			int result = 1;
			if (((ConCommandArgs)(ref args)).Count >= 1)
			{
				result = ((!int.TryParse(((ConCommandArgs)(ref args))[0], out result)) ? 1 : result);
			}
			CharacterMaster senderMaster = ((ConCommandArgs)(ref args)).senderMaster;
			if ((Object)(object)senderMaster == (Object)null)
			{
				Debug.Log((object)"Couldn't find target to add items to.");
			}
			Inventory inventory = senderMaster.inventory;
			if ((Object)(object)inventory == (Object)null)
			{
				Debug.Log((object)"Target has no inventory.");
			}
			inventory.GiveItem(ExtradimensionalItems.Modules.Content.Items.Atma, result);
			inventory.GiveItem(ExtradimensionalItems.Modules.Content.Items.DamageOnPing, result);
			inventory.GiveItem(ExtradimensionalItems.Modules.Content.Items.DamageOnCooldowns, result);
			inventory.GiveItem(ExtradimensionalItems.Modules.Content.Items.RoyalGuard, result);
			inventory.GiveItem(ExtradimensionalItems.Modules.Content.Items.FuelCellDepleted, result);
			inventory.GiveItem(ExtradimensionalItems.Modules.Content.Items.ReturnalAdrenaline, result);
			inventory.GiveItem(ExtradimensionalItems.Modules.Content.Items.Sheen, result);
			inventory.GiveItem(ExtradimensionalItems.Modules.Content.Items.VoidCooldownReduction, result);
			Debug.Log((object)$"Gave {result} of all Extradimensional items.");
		}

		private static ItemIndex GetItemFromPartial(string name)
		{
			//IL_0014: 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)
			if (Enum.TryParse<ItemIndex>(name, ignoreCase: true, out ItemIndex result) && ItemCatalog.IsIndexValid(ref result))
			{
				return result;
			}
			ItemDef[] fieldValue = Reflection.GetFieldValue<ItemDef[]>(typeof(ItemCatalog), "itemDefs");
			foreach (ItemDef val in fieldValue)
			{
				string langInvar = GetLangInvar(val.nameToken.ToUpper());
				if (((Object)val).name.ToUpper().Contains(name.ToUpper()) || langInvar.ToUpper().Contains(name.ToUpper()) || langInvar.ToUpper().Contains(RemoveSpacesAndAlike(name.ToUpper())))
				{
					return val.itemIndex;
				}
			}
			return (ItemIndex)(-1);
		}

		private static string GetLangInvar(string baseToken)
		{
			return RemoveSpacesAndAlike(Language.GetString(baseToken));
		}

		private static string RemoveSpacesAndAlike(string input)
		{
			return Regex.Replace(input, "[ '-]", string.Empty);
		}
	}
}
namespace ExtradimensionalItems.Modules.UI
{
	public class ReturnalAdrenalineUI : MonoBehaviour
	{
		private static List<ReturnalAdrenalineUI> instancesList = new List<ReturnalAdrenalineUI>();

		private HGTextMeshProUGUI textMesh;

		private Image levelBar;

		private HUD hud;

		private void Update()
		{
			if (Object.op_Implicit((Object)(object)hud) && Object.op_Implicit((Object)(object)hud.targetMaster))
			{
				ReturnalAdrenalineItemBehavior component = ((Component)hud.targetMaster).GetComponent<ReturnalAdrenalineItemBehavior>();
				if (Object.op_Implicit((Object)(object)component) && hud.targetMaster.inventory.GetItemCount(ExtradimensionalItems.Modules.Content.Items.ReturnalAdrenaline) > 0)
				{
					UpdateUI(component.adrenalineLevel, component.adrenalinePerLevel);
				}
			}
		}

		private void OnDestroy()
		{
			if (instancesList != null)
			{
				instancesList.Remove(this);
			}
		}

		private void UpdateUI(int adrenalineLevel, float adrenalinePerLevel)
		{
			if (Object.op_Implicit((Object)(object)textMesh))
			{
				((TMP_Text)textMesh).SetText(string.Format(Language.GetString("ITEM_RETURNAL_ADRENALINE_LEVEL"), (int)((float)adrenalineLevel / adrenalinePerLevel)), true);
			}
			if (Object.op_Implicit((Object)(object)levelBar))
			{
				if ((float)adrenalineLevel >= adrenalinePerLevel * 5f)
				{
					levelBar.fillAmount = 1f;
				}
				else
				{
					levelBar.fillAmount = Mathf.Clamp((float)adrenalineLevel % adrenalinePerLevel / adrenalinePerLevel, 0f, 1f);
				}
			}
		}

		public static void CreateUI(HUD HUD)
		{
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Expected O, but got Unknown
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: 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)
			//IL_0127: 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_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0227: Unknown result type (might be due to invalid IL or missing references)
			//IL_023d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0253: Unknown result type (might be due to invalid IL or missing references)
			//IL_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_027a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0290: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02be: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
			Image val = default(Image);
			if (Object.op_Implicit((Object)(object)HUD) && Object.op_Implicit((Object)(object)HUD.healthBar) && Object.op_Implicit((Object)(object)HUD.itemInventoryDisplay) && ((Component)HUD.itemInventoryDisplay).gameObject.TryGetComponent<Image>(ref val))
			{
				GameObject val2 = new GameObject("AdrenalineHUD");
				ReturnalAdrenalineUI returnalAdrenalineUI = val2.AddComponent<ReturnalAdrenalineUI>();
				RectTransform obj = val2.AddComponent<RectTransform>();
				val2.transform.SetParent(((Component)HUD.healthBar).transform);
				Image obj2 = val2.AddComponent<Image>();
				obj2.sprite = val.sprite;
				((Graphic)obj2).color = ((Graphic)val).color;
				obj2.type = (Type)1;
				((Transform)obj).localPosition = Vector3.zero;
				obj.anchorMin = new Vector2(0f, 0f);
				obj.anchorMax = new Vector2(0f, 0f);
				((Transform)obj).localScale = Vector3.one;
				obj.pivot = new Vector2(0f, 1f);
				obj.sizeDelta = new Vector2(421f, 15f);
				obj.anchoredPosition = new Vector2(-1f, -5f);
				((Transform)obj).eulerAngles = new Vector3(0f, -6f, 0f);
				GameObject val3 = new GameObject("AdrenalineLevelText");
				RectTransform val4 = val3.AddComponent<RectTransform>();
				HGTextMeshProUGUI val5 = val3.AddComponent<HGTextMeshProUGUI>();
				val3.transform.SetParent(val2.transform);
				((Transform)val4).localPosition = Vector3.zero;
				val4.anchorMin = Vector2.zero;
				val4.anchorMax = Vector2.one;
				((Transform)val4).localScale = Vector3.one;
				val4.sizeDelta = new Vector2(0f, 0f);
				val4.anchoredPosition = new Vector2(380f, 0f);
				((Transform)val4).eulerAngles = new Vector3(0f, -6f, 0f);
				((TMP_Text)val5).enableAutoSizing = true;
				((TMP_Text)val5).fontSizeMax = 256f;
				((TMP_Text)val5).faceColor = Color32.op_Implicit(Color.white);
				((TMP_Text)val5).alignment = (TextAlignmentOptions)4097;
				((TMP_Text)val5).text = "Testing";
				GameObject val6 = new GameObject("AdrenalineLevelBar");
				RectTransform val7 = val6.AddComponent<RectTransform>();
				val6.transform.SetParent(val2.transform);
				val7.anchorMin = new Vector2(0f, 1f);
				val7.anchorMax = new Vector2(0f, 1f);
				val7.pivot = new Vector2(0f, 1f);
				((Transform)val7).eulerAngles = new Vector3(0f, -6f, 0f);
				((Transform)val7).localScale = Vector3.one;
				val7.anchoredPosition = new Vector2(12f, 2f);
				val7.sizeDelta = new Vector2(360f, 8f);
				Image val8 = val6.AddComponent<Image>();
				val8.sprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/UI/texUINonsegmentedHealthbar.png").WaitForCompletion();
				((Graphic)val8).color = Color.yellow;
				val8.type = (Type)3;
				val8.fillMethod = (FillMethod)0;
				val8.fillOrigin = 0;
				val8.fillAmount = 0.5f;
				returnalAdrenalineUI.hud = HUD;
				returnalAdrenalineUI.textMesh = val5;
				returnalAdrenalineUI.levelBar = val8;
				val2.gameObject.SetActive(false);
				instancesList.Add(returnalAdrenalineUI);
			}
		}

		public static ReturnalAdrenalineUI FindInstance(CharacterMaster master)
		{
			foreach (ReturnalAdrenalineUI instances in instancesList)
			{
				if ((Object)(object)instances.hud.targetMaster == (Object)(object)master)
				{
					return instances;
				}
			}
			return null;
		}

		public void Enable()
		{
			if (Object.op_Implicit((Object)(object)((Component)this).gameObject))
			{
				((Component)this).gameObject.SetActive(true);
			}
		}

		public void Disable()
		{
			if (Object.op_Implicit((Object)(object)((Component)this).gameObject))
			{
				((Component)this).gameObject.SetActive(false);
			}
		}
	}
}
namespace ExtradimensionalItems.Modules.SkillStates
{
	public class Explode : BaseSkillState
	{
		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			ExplodeNow();
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (!((EntityState)this).characterBody.HasBuff(Buffs.RoyalGuardDamage))
			{
				((EntityState)this).outer.SetNextStateToMain();
				MyLogger.LogMessage("Player {0}({1}) has left parry state because they don't have damage buff after using Release.", ((EntityState)this).characterBody.GetUserName(), ((Object)((EntityState)this).characterBody).name);
			}
		}

		private void ExplodeNow()
		{
			//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_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: 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_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Expected O, but got Unknown
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Expected O, but got Unknown
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			if (((EntityState)this).characterBody.HasBuff(Buffs.RoyalGuardDamage))
			{
				BlastAttack val = new BlastAttack
				{
					radius = RoyalGuard.DamageRadius.Value,
					procCoefficient = 2f,
					position = ((EntityState)this).characterBody.corePosition,
					attacker = ((Component)((EntityState)this).characterBody).gameObject,
					crit = ((BaseState)this).RollCrit(),
					baseDamage = ((EntityState)this).characterBody.baseDamage * (float)((EntityState)this).characterBody.GetBuffCount(Buffs.RoyalGuardDamage) * (RoyalGuard.DamageModifier.Value / 100f),
					falloffModel = (FalloffModel)2,
					baseForce = 1f,
					teamIndex = TeamComponent.GetObjectTeam(((Component)((EntityState)this).characterBody).gameObject),
					damageType = DamageTypeCombo.op_Implicit((DamageType)131072),
					attackerFiltering = (AttackerFiltering)2
				};
				val.Fire();
				((EntityState)this).characterBody.SetBuffCount(Buffs.RoyalGuardDamage.buffIndex, 0);
				if (((EntityState)this).characterBody.HasBuff(Buffs.RoyalGuardParryState))
				{
					((EntityState)this).characterBody.RemoveOldestTimedBuff(Buffs.RoyalGuardParryState);
				}
				EffectData val2 = new EffectData();
				val2.origin = ((EntityState)this).characterBody.footPosition;
				val2.scale = 10f;
				EffectManager.SpawnEffect(RoyalGuard.RoyalGuardExplodeEffectInstance, val2, true);
				MyLogger.LogMessage("Player {0}({1}) used Release, dealing to everyone around {2} damage.", ((EntityState)this).characterBody.GetUserName(), ((Object)((EntityState)this).characterBody).name, val.baseDamage.ToString());
			}
		}
	}
	public class Parry : BaseSkillState
	{
		private float duration;

		private bool buffAdded;

		public override void OnEnter()
		{
			((BaseState)this).OnEnter();
			duration = RoyalGuard.GetParryStateDuration(((EntityState)this).characterBody);
			if (NetworkServer.active)
			{
				((EntityState)this).characterBody.AddTimedBuff(Buffs.RoyalGuardParryState, duration);
				MyLogger.LogMessage("Player {0}({1}) entered parry state for {2} seconds.", ((EntityState)this).characterBody.GetUserName(), ((Object)((EntityState)this).characterBody).name, duration.ToString());
			}
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.skillLocator) && ((EntityState)this).characterBody.HasBuff(Buffs.RoyalGuardDamage))
			{
				((EntityState)this).characterBody.skillLocator.primary.SetSkillOverride((object)((EntityState)this).characterBody, Skills.Explode, (SkillOverridePriority)3);
			}
		}

		public override void OnExit()
		{
			if (NetworkServer.active && ((EntityState)this).characterBody.HasBuff(Buffs.RoyalGuardParryState))
			{
				((EntityState)this).characterBody.RemoveOldestTimedBuff(Buffs.RoyalGuardParryState);
			}
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.skillLocator))
			{
				((EntityState)this).characterBody.skillLocator.primary.UnsetSkillOverride((object)((EntityState)this).characterBody, Skills.Explode, (SkillOverridePriority)3);
			}
			((EntityState)this).OnExit();
		}

		public override void FixedUpdate()
		{
			((EntityState)this).FixedUpdate();
			if (((EntityState)this).characterBody.HasBuff(Buffs.RoyalGuardParryState))
			{
				buffAdded = true;
			}
			if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
				MyLogger.LogMessage("Player {0}({1}) has left parry state due to timeout without being damaged.", ((EntityState)this).characterBody.GetUserName(), ((Object)((EntityState)this).characterBody).name);
			}
			if (buffAdded && !((EntityState)this).characterBody.HasBuff(Buffs.RoyalGuardParryState) && ((EntityState)this).isAuthority)
			{
				((EntityState)this).outer.SetNextStateToMain();
				MyLogger.LogMessage("Player {0}({1}) has left parry state because they don't have parry state buff after being damaged.", ((EntityState)this).characterBody.GetUserName(), ((Object)((EntityState)this).characterBody).name);
			}
		}

		public override void Update()
		{
			((EntityState)this).Update();
			if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && ((EntityState)this).characterBody.HasBuff(Buffs.RoyalGuardDamage) && ((ButtonState)(ref ((EntityState)this).inputBank.skill1)).justPressed)
			{
				((EntityState)this).skillLocator.primary.ExecuteIfReady();
			}
		}

		public override InterruptPriority GetMinimumInterruptPriority()
		{
			return (InterruptPriority)2;
		}
	}
}
namespace ExtradimensionalItems.Modules.NetworkAttachments
{
	public class ChronoshiftController : NetworkBehaviour
	{
		public enum ChronoshiftState
		{
			Saving,
			Moving,
			Restoring
		}

		private static readonly List<ChronoshiftController> instancesList;

		private NetworkedBodyAttachment networkedBodyAttachment;

		private SyncList<int> syncList;

		public static ChronoshiftController FindChronoshiftController(GameObject body)
		{
			if (!Object.op_Implicit((Object)(object)body))
			{
				return null;
			}
			foreach (ChronoshiftController instances in instancesList)
			{
				if ((Object)(object)instances.networkedBodyAttachment.attachedBodyObject == (Object)(object)body)
				{
					return instances;
				}
			}
			return null;
		}

		private void Awake()
		{
			networkedBodyAttachment = ((Component)this).GetComponent<NetworkedBodyAttachment>();
		}

		private void OnEnabled()
		{
			instancesList.Add(this);
		}

		private void OnDisable()
		{
			instancesList.Remove(this);
		}

		private void UNetVersion()
		{
		}

		public override bool OnSerialize(NetworkWriter writer, bool forceAll)
		{
			bool result = default(bool);
			return result;
		}

		public override void OnDeserialize(NetworkReader reader, bool initialState)
		{
		}
	}
}
namespace ExtradimensionalItems.Modules.Items
{
	public class Atma : ItemBase<Atma>
	{
		public static ConfigEntry<float> HealthPerLevel;

		public static ConfigEntry<float> PerStackScaling;

		public override string ItemName => "AtmasImpaler";

		public override string ItemLangTokenName => "ATMAS_IMPALER";

		public override ItemTier Tier => (ItemTier)1;

		public override string BundleName => "atma";

		public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 };

		public override GameObject ItemModel => AssetBundle.LoadAsset<GameObject>("atma");

		public override Sprite ItemIcon => AssetBundle.LoadAsset<Sprite>("texAtmaIcon");

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Expected O, but got Unknown
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: 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_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: 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_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_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			//IL_025c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0285: Unknown result type (might be due to invalid IL or missing references)
			//IL_02af: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_030a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0313: Unknown result type (might be due to invalid IL or missing references)
			//IL_033d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0342: Unknown result type (might be due to invalid IL or missing references)
			//IL_0358: Unknown result type (might be due to invalid IL or missing references)
			//IL_035d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0373: Unknown result type (might be due to invalid IL or missing references)
			//IL_0378: Unknown result type (might be due to invalid IL or missing references)
			//IL_037d: Unknown result type (might be due to invalid IL or missing references)
			//IL_037e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0398: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0401: Unknown result type (might be due to invalid IL or missing references)
			//IL_0406: Unknown result type (might be due to invalid IL or missing references)
			//IL_040b: Unknown result type (might be due to invalid IL or missing references)
			//IL_040c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0426: Unknown result type (might be due to invalid IL or missing references)
			//IL_042f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0459: Unknown result type (might be due to invalid IL or missing references)
			//IL_045e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0474: Unknown result type (might be due to invalid IL or missing references)
			//IL_0479: Unknown result type (might be due to invalid IL or missing references)
			//IL_048f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0494: Unknown result type (might be due to invalid IL or missing references)
			//IL_0499: Unknown result type (might be due to invalid IL or missing references)
			//IL_049a: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0502: Unknown result type (might be due to invalid IL or missing references)
			//IL_0507: Unknown result type (might be due to invalid IL or missing references)
			//IL_051d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0522: Unknown result type (might be due to invalid IL or missing references)
			//IL_0527: Unknown result type (might be due to invalid IL or missing references)
			//IL_0528: Unknown result type (might be due to invalid IL or missing references)
			//IL_0542: Unknown result type (might be due to invalid IL or missing references)
			//IL_054b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0575: Unknown result type (might be due to invalid IL or missing references)
			//IL_057a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0590: Unknown result type (might be due to invalid IL or missing references)
			//IL_0595: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0603: Unknown result type (might be due to invalid IL or missing references)
			//IL_0608: Unknown result type (might be due to invalid IL or missing references)
			//IL_061e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0623: Unknown result type (might be due to invalid IL or missing references)
			//IL_0639: Unknown result type (might be due to invalid IL or missing references)
			//IL_063e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0643: Unknown result type (might be due to invalid IL or missing references)
			//IL_0644: Unknown result type (might be due to invalid IL or missing references)
			//IL_065e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0667: Unknown result type (might be due to invalid IL or missing references)
			//IL_0691: Unknown result type (might be due to invalid IL or missing references)
			//IL_0696: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_071f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0724: Unknown result type (might be due to invalid IL or missing references)
			//IL_073a: Unknown result type (might be due to invalid IL or missing references)
			//IL_073f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0755: Unknown result type (might be due to invalid IL or missing references)
			//IL_075a: Unknown result type (might be due to invalid IL or missing references)
			//IL_075f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0760: Unknown result type (might be due to invalid IL or missing references)
			//IL_077a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0783: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0808: Unknown result type (might be due to invalid IL or missing references)
			//IL_0811: Unknown result type (might be due to invalid IL or missing references)
			//IL_083b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0840: Unknown result type (might be due to invalid IL or missing references)
			//IL_0856: Unknown result type (might be due to invalid IL or missing references)
			//IL_085b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0871: Unknown result type (might be due to invalid IL or missing references)
			//IL_0876: Unknown result type (might be due to invalid IL or missing references)
			//IL_087b: Unknown result type (might be due to invalid IL or missing references)
			//IL_087c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0896: Unknown result type (might be due to invalid IL or missing references)
			//IL_089f: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0904: Unknown result type (might be due to invalid IL or missing references)
			//IL_0909: Unknown result type (might be due to invalid IL or missing references)
			//IL_090a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0924: Unknown result type (might be due to invalid IL or missing references)
			//IL_092d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0957: Unknown result type (might be due to invalid IL or missing references)
			//IL_095c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0972: Unknown result type (might be due to invalid IL or missing references)
			//IL_0977: Unknown result type (might be due to invalid IL or missing references)
			//IL_098d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0992: Unknown result type (might be due to invalid IL or missing references)
			//IL_0997: Unknown result type (might be due to invalid IL or missing references)
			//IL_0998: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_09bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_09e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a00: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a05: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a1b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a20: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a25: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a26: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a40: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a49: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a73: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a78: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a8e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a93: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aae: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ab3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ab4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ace: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ad7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b01: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b06: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b1c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b21: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b37: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b3c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b41: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b42: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = AssetBundle.LoadAsset<GameObject>("atma");
			val.AddComponent<ItemDisplay>();
			val.GetComponent<ItemDisplay>().rendererInfos = Utils.ItemDisplaySetup(val);
			ItemDisplayRuleDict val2 = new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
			val2.Add("mdlCommandoDualies", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "Chest",
					localPos = new Vector3(0.05931f, 0.11769f, -0.21938f),
					localAngles = new Vector3(23.27695f, 5.91633f, 22.06631f),
					localScale = new Vector3(2.11112f, 2.11112f, 2.11112f)
				}
			});
			val2.Add("mdlHuntress", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "Chest",
					localPos = new Vector3(-0.00121f, -0.01595f, -0.11217f),
					localAngles = new Vector3(9.08415f, 326.9416f, 324.1578f),
					localScale = new Vector3(2.18992f, 2.18992f, 2.18992f)
				}
			});
			val2.Add("mdlToolbot", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "LowerArmR",
					localPos = new Vector3(0.53324f, 2.89081f, 0.01006f),
					localAngles = new Vector3(20.63849f, 243.5134f, 358.9025f),
					localScale = new Vector3(18.88126f, 18.88126f, 18.88126f)
				}
			});
			val2.Add("mdlEngi", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "Chest",
					localPos = new Vector3(-0.03588f, 0.0123f, -0.2605f),
					localAngles = new Vector3(19.14014f, 357.4113f, 346.8241f),
					localScale = new Vector3(2.76281f, 2.76281f, 2.76281f)
				}
			});
			val2.Add("mdlMage", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "Chest",
					localPos = new Vector3(-0.03411f, -0.30607f, -0.12951f),
					localAngles = new Vector3(9.03134f, 359.823f, 356.4779f),
					localScale = new Vector3(2.64689f, 2.64689f, 2.64689f)
				}
			});
			val2.Add("mdlMerc", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "HandR",
					localPos = new Vector3(-0.25078f, 0.078f, 0.04389f),
					localAngles = new Vector3(337.2337f, 332.8286f, 305.9801f),
					localScale = new Vector3(3.25417f, 3.25417f, 3.25417f)
				}
			});
			val2.Add("mdlTreebot", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "FlowerBase",
					localPos = new Vector3(-0.10445f, -0.35228f, -0.6879f),
					localAngles = new Vector3(28.78763f, 36.88558f, 97.3734f),
					localScale = new Vector3(3.71836f, 3.71836f, 3.71836f)
				}
			});
			val2.Add("mdlLoader", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "MechHandR",
					localPos = new Vector3(0.0391f, -0.27704f, 0.07467f),
					localAngles = new Vector3(18.69483f, 16.37429f, 359.6162f),
					localScale = new Vector3(3f, 3f, 3f)
				}
			});
			val2.Add("mdlCroco", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "Chest",
					localPos = new Vector3(-1.51356f, 3.06965f, 9.13635f),
					localAngles = new Vector3(16.712f, 35.78552f, 237.5622f),
					localScale = new Vector3(20f, 15f, 20f)
				}
			});
			val2.Add("mdlCaptain", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "Head",
					localPos = new Vector3(0.0603f, 0.06345f, -0.00892f),
					localAngles = new Vector3(345.2615f, 324.2955f, 335.8669f),
					localScale = new Vector3(2f, 1f, 2f)
				}
			});
			val2.Add("mdlBandit2", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "MainWeapon",
					localPos = new Vector3(-0.01876f, 0.67848f, 0.01137f),
					localAngles = new Vector3(16.80556f, 356.7202f, 359.0283f),
					localScale = new Vector3(1.47453f, 1.47453f, 1.47453f)
				}
			});
			val2.Add("mdlHeretic", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "Chest",
					localPos = new Vector3(0.33803f, -0.34522f, 0.16156f),
					localAngles = new Vector3(286.6828f, 287.9903f, 141.7693f),
					localScale = new Vector3(5f, 5f, 5f)
				}
			});
			val2.Add("mdlRailGunner", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "Backpack",
					localPos = new Vector3(0.23427f, -0.10423f, -0.05527f),
					localAngles = new Vector3(19.80791f, 840f / MathF.PI, 0.90511f),
					localScale = new Vector3(3f, 3f, 3f)
				}
			});
			val2.Add("mdlVoidSurvivor", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "LargeExhaust2R",
					localPos = new Vector3(0.02325f, -0.07614f, -0.01583f),
					localAngles = new Vector3(53.4817f, 5.6685f, 127f / 160f),
					localScale = new Vector3(3f, 1f, 3f)
				}
			});
			val2.Add("mdlMiner", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "Chest",
					localPos = new Vector3(0.00079f, 0.00048f, -0.00194f),
					localAngles = new Vector3(11.8281f, 9.81263f, 17.99667f),
					localScale = new Vector3(0.02779f, 0.02779f, 0.02779f)
				}
			});
			val2.Add("mdlNemforcer(Clone)", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "Chest",
					localPos = new Vector3(0.01594f, -0.00074f, 0.00416f),
					localAngles = new Vector3(352.4106f, 77.70187f, 339.1572f),
					localScale = new Vector3(0.12158f, 0.12158f, 0.12158f)
				}
			});
			val2.Add("mdlEnforcer", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "Chest",
					localPos = new Vector3(0.31749f, -0.1789f, 0.11174f),
					localAngles = new Vector3(20.46696f, 83.04866f, 334.5096f),
					localScale = new Vector3(3.92409f, 3.92409f, 3.92409f)
				}
			});
			val2.Add("mdlPaladin", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "Chest",
					localPos = new Vector3(0.15985f, -0.69306f, -0.13191f),
					localAngles = new Vector3(1.69802f, 8.71632f, 15.83549f),
					localScale = new Vector3(4.30285f, 5.79825f, 4.30285f)
				}
			});
			val2.Add("mdlRocket", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "Chest",
					localPos = new Vector3(-0.18752f, -0.52693f, 0.03871f),
					localAngles = new Vector3(34.70107f, 248.6318f, 354.8853f),
					localScale = new Vector3(3.94916f, 3.94916f, 3.94916f)
				}
			});
			val2.Add("mdlSniper", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "GunBarrel",
					localPos = new Vector3(0.00144f, 0.02943f, 0.3023f),
					localAngles = new Vector3(70.40952f, 185.3266f, 184.8057f),
					localScale = new Vector3(1.80279f, 1.80279f, 1.80279f)
				}
			});
			return val2;
		}

		public override void Init(ConfigFile config)
		{
			CreateConfig(config);
			LoadAssetBundle();
			SetLogbookCameraPosition();
			LoadLanguageFile();
			CreateItem(ref ExtradimensionalItems.Modules.Content.Items.Atma);
			Hooks();
		}

		protected override void Hooks()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			base.Hooks();
			RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
		}

		private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
		{
			int count = GetCount(sender);
			if (count > 0)
			{
				float num = sender.maxHealth / (HealthPerLevel.Value * ((100f - Util.ConvertAmplificationPercentageIntoReductionPercentage(PerStackScaling.Value * (float)(count - 1))) / 100f));
				if (num < 1f)
				{
					num = 1f;
				}
				args.baseDamageAdd += num * sender.levelDamage;
			}
		}

		public override string GetOverlayDescription(string value, JSONNode tokensNode)
		{
			return string.Format(value, HealthPerLevel.Value, (PerStackScaling.Value / 100f).ToString("0.#%"));
		}

		public override void CreateConfig(ConfigFile config)
		{
			HealthPerLevel = config.Bind<float>("Item: " + ItemName, "Health Per Level", 250f, "How much health item requires to grand additional level of damage.");
			PerStackScaling = config.Bind<float>("Item: " + ItemName, "Per Stack Scaling", 25f, "By how much, in percent, health requirement lowers per stack.");
			if (RiskOfOptionsCompat.enabled)
			{
				RiskOfOptionsCompat.CreateNewOption(HealthPerLevel, 10f, 500f);
				RiskOfOptionsCompat.CreateNewOption(PerStackScaling, 1f, 100f, 0.5f);
				RiskOfOptionsCompat.AddDelegateOnModOptionsExit(OnModOptionsExit);
			}
		}
	}
	public class DamageOnCooldowns : ItemBase<DamageOnCooldowns>
	{
		public class DamageOnCooldownsSendNumberBuffs : INetMessage, ISerializableObject
		{
			private NetworkInstanceId netId;

			private int numberOfBuffsFromClient;

			public DamageOnCooldownsSendNumberBuffs()
			{
			}

			public DamageOnCooldownsSendNumberBuffs(NetworkInstanceId netId, int buffsCount)
			{
				//IL_0007: 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)
				this.netId = netId;
				numberOfBuffsFromClient = buffsCount;
			}

			public void Deserialize(NetworkReader reader)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				netId = reader.ReadNetworkId();
				numberOfBuffsFromClient = reader.ReadInt32();
			}

			public void OnReceived()
			{
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				if (!NetworkServer.active)
				{
					MyLogger.LogInfo("Recieved ChronoshiftRestoreStateOnServer message on client, doing nothing...");
					return;
				}
				GameObject val = Util.FindNetworkObject(netId);
				CharacterBody body = default(CharacterBody);
				if (Object.op_Implicit((Object)(object)val) && val.TryGetComponent<CharacterBody>(ref body))
				{
					ApplyBuffs(body, numberOfBuffsFromClient);
				}
			}

			public void Serialize(NetworkWriter writer)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				writer.Write(netId);
				writer.Write(numberOfBuffsFromClient);
			}
		}

		public static ConfigEntry<float> DamageBonus;

		public static ConfigEntry<float> DamageBonusPerStack;

		public override string ItemName => "DamageOnCooldowns";

		public override string ItemLangTokenName => "DAMAGE_ON_COOLDOWNS";

		public override ItemTier Tier => (ItemTier)1;

		public override string BundleName => "damageoncooldowns";

		public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 };

		public override GameObject ItemModel => AssetBundle.LoadAsset<GameObject>("damageoncooldowns");

		public override Sprite ItemIcon => AssetBundle.LoadAsset<Sprite>("texDamageOnCooldownIcon");

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Expected O, but got Unknown
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: 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_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: 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_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_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			//IL_025c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0285: Unknown result type (might be due to invalid IL or missing references)
			//IL_02af: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_030a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0313: Unknown result type (might be due to invalid IL or missing references)
			//IL_033d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0342: Unknown result type (might be due to invalid IL or missing references)
			//IL_0358: Unknown result type (might be due to invalid IL or missing references)
			//IL_035d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0373: Unknown result type (might be due to invalid IL or missing references)
			//IL_0378: Unknown result type (might be due to invalid IL or missing references)
			//IL_037d: Unknown result type (might be due to invalid IL or missing references)
			//IL_037e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0398: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0401: Unknown result type (might be due to invalid IL or missing references)
			//IL_0406: Unknown result type (might be due to invalid IL or missing references)
			//IL_040b: Unknown result type (might be due to invalid IL or missing references)
			//IL_040c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0426: Unknown result type (might be due to invalid IL or missing references)
			//IL_042f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0459: Unknown result type (might be due to invalid IL or missing references)
			//IL_045e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0474: Unknown result type (might be due to invalid IL or missing references)
			//IL_0479: Unknown result type (might be due to invalid IL or missing references)
			//IL_048f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0494: Unknown result type (might be due to invalid IL or missing references)
			//IL_0499: Unknown result type (might be due to invalid IL or missing references)
			//IL_049a: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0502: Unknown result type (might be due to invalid IL or missing references)
			//IL_0507: Unknown result type (might be due to invalid IL or missing references)
			//IL_051d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0522: Unknown result type (might be due to invalid IL or missing references)
			//IL_0527: Unknown result type (might be due to invalid IL or missing references)
			//IL_0528: Unknown result type (might be due to invalid IL or missing references)
			//IL_0542: Unknown result type (might be due to invalid IL or missing references)
			//IL_054b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0575: Unknown result type (might be due to invalid IL or missing references)
			//IL_057a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0590: Unknown result type (might be due to invalid IL or missing references)
			//IL_0595: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0603: Unknown result type (might be due to invalid IL or missing references)
			//IL_0608: Unknown result type (might be due to invalid IL or missing references)
			//IL_061e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0623: Unknown result type (might be due to invalid IL or missing references)
			//IL_0639: Unknown result type (might be due to invalid IL or missing references)
			//IL_063e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0643: Unknown result type (might be due to invalid IL or missing references)
			//IL_0644: Unknown result type (might be due to invalid IL or missing references)
			//IL_065e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0667: Unknown result type (might be due to invalid IL or missing references)
			//IL_0691: Unknown result type (might be due to invalid IL or missing references)
			//IL_0696: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_071f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0724: Unknown result type (might be due to invalid IL or missing references)
			//IL_073a: Unknown result type (might be due to invalid IL or missing references)
			//IL_073f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0755: Unknown result type (might be due to invalid IL or missing references)
			//IL_075a: Unknown result type (might be due to invalid IL or missing references)
			//IL_075f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0760: Unknown result type (might be due to invalid IL or missing references)
			//IL_077a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0783: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0808: Unknown result type (might be due to invalid IL or missing references)
			//IL_0811: Unknown result type (might be due to invalid IL or missing references)
			//IL_083b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0840: Unknown result type (might be due to invalid IL or missing references)
			//IL_0856: Unknown result type (might be due to invalid IL or missing references)
			//IL_085b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0871: Unknown result type (might be due to invalid IL or missing references)
			//IL_0876: Unknown result type (might be due to invalid IL or missing references)
			//IL_087b: Unknown result type (might be due to invalid IL or missing references)
			//IL_087c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0896: Unknown result type (might be due to invalid IL or missing references)
			//IL_089f: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0904: Unknown result type (might be due to invalid IL or missing references)
			//IL_0909: Unknown result type (might be due to invalid IL or missing references)
			//IL_090a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0924: Unknown result type (might be due to invalid IL or missing references)
			//IL_092d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0957: Unknown result type (might be due to invalid IL or missing references)
			//IL_095c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0972: Unknown result type (might be due to invalid IL or missing references)
			//IL_0977: Unknown result type (might be due to invalid IL or missing references)
			//IL_098d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0992: Unknown result type (might be due to invalid IL or missing references)
			//IL_0997: Unknown result type (might be due to invalid IL or missing references)
			//IL_0998: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_09bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_09e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a00: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a05: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a1b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a20: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a25: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a26: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a40: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a49: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a73: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a78: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a8e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a93: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aae: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ab3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ab4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ace: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ad7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b01: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b06: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b1c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b21: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b37: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b3c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b41: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b42: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = AssetBundle.LoadAsset<GameObject>("damageoncooldowns");
			val.AddComponent<ItemDisplay>();
			val.GetComponent<ItemDisplay>().rendererInfos = Utils.ItemDisplaySetup(val);
			ItemDisplayRuleDict val2 = new ItemDisplayRuleDict(Array.Empty<ItemDisplayRule>());
			val2.Add("mdlCommandoDualies", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "ThighR",
					localPos = new Vector3(-0.09552f, 0.11592f, 0.06752f),
					localAngles = new Vector3(27.08141f, 304.4822f, 189.2228f),
					localScale = new Vector3(0.20751f, 0.20751f, 0.20751f)
				}
			});
			val2.Add("mdlHuntress", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "ThighR",
					localPos = new Vector3(-0.11649f, 0.18389f, 0.06237f),
					localAngles = new Vector3(28.06488f, 266.8881f, 196.0231f),
					localScale = new Vector3(0.19636f, 0.19636f, 0.19636f)
				}
			});
			val2.Add("mdlToolbot", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "ThighR",
					localPos = new Vector3(0.12048f, 0.90659f, 0.87745f),
					localAngles = new Vector3(23.94655f, 178.5852f, 175.6136f),
					localScale = new Vector3(2f, 2f, 2f)
				}
			});
			val2.Add("mdlEngi", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "ThighR",
					localPos = new Vector3(-0.18828f, 0.13572f, 0.00151f),
					localAngles = new Vector3(30.69436f, 274.8616f, 176.1863f),
					localScale = new Vector3(0.22972f, 0.22972f, 0.22972f)
				}
			});
			val2.Add("mdlMage", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "ThighR",
					localPos = new Vector3(-0.11235f, 0.22891f, 0.05888f),
					localAngles = new Vector3(25.38397f, 272.8091f, 189.4688f),
					localScale = new Vector3(0.17773f, 0.17773f, 0.17773f)
				}
			});
			val2.Add("mdlMerc", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "ThighR",
					localPos = new Vector3(-0.10393f, 0.20613f, 0.06577f),
					localAngles = new Vector3(29.68564f, 300.2674f, 182.2623f),
					localScale = new Vector3(0.23426f, 0.23426f, 0.23426f)
				}
			});
			val2.Add("mdlTreebot", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "ThighBackR",
					localPos = new Vector3(0.32198f, 0.39853f, 0.15919f),
					localAngles = new Vector3(333.9132f, 289.5818f, 57.39796f),
					localScale = new Vector3(0.34275f, 0.34275f, 0.34275f)
				}
			});
			val2.Add("mdlLoader", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "ThighR",
					localPos = new Vector3(-0.12364f, 0.15695f, 0.09189f),
					localAngles = new Vector3(37.29633f, 301.3473f, 186.7303f),
					localScale = new Vector3(0.22691f, 0.22691f, 0.22691f)
				}
			});
			val2.Add("mdlCroco", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "ThighR",
					localPos = new Vector3(-1.14331f, 1.28121f, -0.09511f),
					localAngles = new Vector3(29.22408f, 243.6448f, 166.6056f),
					localScale = new Vector3(2.34388f, 2.34388f, 2.34388f)
				}
			});
			val2.Add("mdlCaptain", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "CalfR",
					localPos = new Vector3(0.12231f, 0.10491f, 0.03471f),
					localAngles = new Vector3(20.49907f, 97.37933f, 172.5078f),
					localScale = new Vector3(0.24559f, 0.24559f, 0.24559f)
				}
			});
			val2.Add("mdlBandit2", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "ThighR",
					localPos = new Vector3(-0.07267f, 0.24929f, 0.03758f),
					localAngles = new Vector3(28.44042f, 288.6184f, 185.2202f),
					localScale = new Vector3(0.19305f, 0.19305f, 0.19305f)
				}
			});
			val2.Add("mdlHeretic", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "ThighR",
					localPos = new Vector3(-0.22414f, 0.16346f, 0.20641f),
					localAngles = new Vector3(343.4409f, 25.48389f, 270.7061f),
					localScale = new Vector3(0.42563f, 0.42563f, 0.42563f)
				}
			});
			val2.Add("mdlRailGunner", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "ThighR",
					localPos = new Vector3(-0.10685f, 0.08854f, 0.03331f),
					localAngles = new Vector3(34.29095f, 98.02614f, 174.7414f),
					localScale = new Vector3(0.19173f, 0.19173f, 0.19173f)
				}
			});
			val2.Add("mdlVoidSurvivor", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "ThighR",
					localPos = new Vector3(-0.04302f, 0.27724f, -0.11008f),
					localAngles = new Vector3(39.20871f, 5.40946f, 183.1687f),
					localScale = new Vector3(0.21219f, 0.21219f, 0.21219f)
				}
			});
			val2.Add("mdlMiner", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "LegR",
					localPos = new Vector3(0.00047f, 0.00182f, 0.0011f),
					localAngles = new Vector3(36.96081f, 203.9341f, 184.2606f),
					localScale = new Vector3(0.00194f, 0.00194f, 0.00194f)
				}
			});
			val2.Add("mdlNemforcer(Clone)", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "LegR",
					localPos = new Vector3(-0.00262f, 0.00736f, -0.00406f),
					localAngles = new Vector3(38.16177f, 26.56483f, 169.9774f),
					localScale = new Vector3(0.00825f, 0.00825f, 0.00825f)
				}
			});
			val2.Add("mdlEnforcer", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "ThighL",
					localPos = new Vector3(-0.05615f, 0.31438f, 0.13046f),
					localAngles = new Vector3(32.51384f, 163.4914f, 191.6256f),
					localScale = new Vector3(0.23618f, 0.23618f, 0.23618f)
				}
			});
			val2.Add("mdlPaladin", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "ThighR",
					localPos = new Vector3(0.15149f, 0.49419f, -0.18609f),
					localAngles = new Vector3(38.69322f, 308.8141f, 179.926f),
					localScale = new Vector3(0.31299f, 0.31299f, 0.31299f)
				}
			});
			val2.Add("mdlRocket", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "thigh.L",
					localPos = new Vector3(-0.08023f, 0.29315f, 0.1616f),
					localAngles = new Vector3(37.44303f, 145.909f, 184.9257f),
					localScale = new Vector3(0.18108f, 0.18108f, 0.18108f)
				}
			});
			val2.Add("mdlSniper", (ItemDisplayRule[])(object)new ItemDisplayRule[1]
			{
				new ItemDisplayRule
				{
					ruleType = (ItemDisplayRuleType)0,
					followerPrefab = val,
					childName = "UpperArmR",
					localPos = new Vector3(-0.00577f, 0.15569f, -0.08032f),
					localAngles = new Vector3(21.31146f, 187.8139f, 174.2495f),
					localScale = new Vector3(0.17465f, 0.17465f, 0.17465f)
				}
			});
			return val2;
		}

		public override string GetOverlayDescription(string value, JSONNode tokensNode)
		{
			return string.Format(value, (DamageBonus.Value / 100f).ToString("###%"), (DamageBonusPerStack.Value / 100f).ToString("###%"));
		}

		public override void Init(ConfigFile config)
		{
			LoadAssetBundle();
			SetLogbookCameraPosition();
			CreateConfig(config);
			LoadLanguageFile();
			CreateBuffs();
			CreateItem(ref ExtradimensionalItems.Modules.Content.Items.DamageOnCooldowns);
			Hooks();
		}

		private void CreateBuffs()
		{
			//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)
			BuffDef obj = ScriptableObject.CreateInstance<BuffDef>();
			((Object)obj).name = "Damage On Cooldowns";
			obj.buffColor = Color.grey;
			obj.canStack = true;
			obj.isDebuff = false;
			obj.iconSprite = AssetBundle.LoadAsset<Sprite>("texDamageOnCooldownBuffIcon");
			ContentAddition.AddBuffDef(obj);
			Buffs.DamageOnCooldowns = obj;
		}

		protected override void Hooks()
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			base.Hooks();
			CharacterBody.onBodyInventoryChangedGlobal += CharacterBody_onBodyInventoryChangedGlobal;
			HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage);
		}

		private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo)
		{
			GameObject val = damageInfo?.attacker ?? null;
			CharacterBody val2 = default(CharacterBody);
			if (Object.op_Implicit((Object)(object)val) && val.TryGetComponent<CharacterBody>(ref val2))
			{
				damageInfo.damage += damageInfo.damage * ((DamageBonus.Value / 100f + DamageBonusPerStack.Value / 100f * (float)(GetCount(val2) - 1)) * (float)val2.GetBuffCount(Buffs.DamageOnCooldowns));
			}
			orig.Invoke(self, damageInfo);
		}

		private void CharacterBody_onBodyInventoryChangedGlobal(CharacterBody body)
		{
			if (!Object.op_Implicit((Object)(object)body))
			{
				return;
			}
			if (((NetworkBehaviour)body).hasAuthority)
			{
				body.AddItemBehavior<DamageOnCooldownsBehavior>(GetCount(body));
			}
			if (NetworkServer.active && body.HasBuff(Buffs.DamageOnCooldowns) && GetCount(body) == 0)
			{
				while (body.HasBuff(Buffs.DamageOnCooldowns))
				{
					body.RemoveBuff(Buffs.DamageOnCooldowns);
				}
			}
		}

		public static void ApplyBuffs(CharacterBody body, int count)
		{
			int i;
			for (i = body.GetBuffCount(Buffs.DamageOnCooldowns); count > i; i++)
			{
				body.AddBuff(Buffs.DamageOnCooldowns);
			}
			while (count < i)
			{
				body.RemoveBuff(Buffs.DamageOnCooldowns);
				count++;
			}
		}

		public override void CreateConfig(ConfigFile config)
		{
			DamageBonus = config.Bind<float>("Item: " + ItemName, "Damage Bonus", 10f, "How much additional damage, in percentage, each ability and equipment on cooldown adds.");
			DamageBonusPerStack = config.Bind<float>("Item: " + ItemName, "Damage Bonus Per Stack", 5f, "How much additional damage per item stack, in percentage, each each ability and equipment on cooldown adds.");
			if (RiskOfOptionsCompat.enabled)
			{
				RiskOfOptionsCompat.CreateNewOption(DamageBonus, 1f, 30f);
				RiskOfOptionsCompat.CreateNewOption(DamageBonusPerStack, 1f, 30f);
				RiskOfOptionsCompat.AddDelegateOnModOptionsExit(OnModOptionsExit);
			}
		}
	}
	public class DamageOnPing : ItemBase<DamageOnPing>
	{
		public static ConfigEntry<float> DamageIncrease;

		public static ConfigEntry<bool> IsDebuff;

		public static ConfigEntry<bool> IsHidden;

		public static ConfigEntry<float> DebuffDuration;

		public static ConfigEntry<bool> DisablePingEnemyChatMessages;

		public override string ItemName => "DamageOnPing";

		public override string ItemLangTokenName => "DAMAGE_ON_PING";

		public override ItemTier Tier => (ItemTier)0;

		public override string BundleName => "damageonping";

		public override GameObject ItemModel => AssetBundle.LoadAsset<GameObject>("DamageOnPing");

		public override Sprite ItemIcon => AssetBundle.LoadAsset<Sprite>("texWitchHunterTools");

		public override ItemDisplayRuleDict CreateItemDisplayRules()
		{
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Expected O, but got Unknown
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: 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_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: 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_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			//IL_021d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: Unknown result type (might be due to invalid IL or missing references)
			//IL_0227: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Unknown result type (might be due to invalid IL or missing references)
			//IL_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_024c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0276: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02db: Unknown result type (might be due to invalid IL or missing references)
			//IL_0305: Unknown result type (might be due to invalid IL or missing references)
			//IL_030a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0320: Unknown result type (might be due to invalid IL or missing references)
			//IL_0325: Unknown result type (might be due to invalid IL or missing references)
			//IL_033b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0340: Unknown result type (might be due to invalid IL or missing references)
			//IL_0345: Unknown result type (might be due to invalid IL or missing references)
			//IL_0347: Unknown result type (might be due to invalid IL or missing references)
			//IL_0361: Unknown result type (might be due to invalid IL or missing referenc