Decompiled source of StackCalculator v1.0.4

Stack_Calculator.dll

Decompiled 5 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using Microsoft.CodeAnalysis;
using On.RoR2.UI;
using RoR2;
using RoR2.UI;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("Stack Calculator")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Stack Calculator")]
[assembly: AssemblyTitle("Stack Calculator")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace StackCalculator
{
	internal static class Log
	{
		private static ManualLogSource _logSource;

		internal static void Init(ManualLogSource logSource)
		{
			_logSource = logSource;
		}

		internal static void Debug(object data)
		{
			_logSource.LogDebug(data);
		}

		internal static void Error(object data)
		{
			_logSource.LogError(data);
		}

		internal static void Fatal(object data)
		{
			_logSource.LogFatal(data);
		}

		internal static void Info(object data)
		{
			_logSource.LogInfo(data);
		}

		internal static void Message(object data)
		{
			_logSource.LogMessage(data);
		}

		internal static void Warning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
	[BepInPlugin("com.yourname.stackcalculator", "Stack Calculator", "1.0.0")]
	public class StackCalculator : BaseUnityPlugin
	{
		public void Awake()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Expected O, but got Unknown
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Stack Calculator Plugin loaded!");
			ItemIcon.SetItemIndex += new hook_SetItemIndex(ItemIcon_SetItemIndex);
		}

		private void Update()
		{
			if (Input.GetKeyDown((KeyCode)284))
			{
				LogAllItemsInInventory();
			}
		}

		private void LogAllItemsInInventory()
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			CharacterMaster master = LocalUserManager.GetFirstLocalUser().cachedMasterController.master;
			if (!Object.op_Implicit((Object)(object)master) || !Object.op_Implicit((Object)(object)master.inventory))
			{
				return;
			}
			foreach (ItemIndex item in master.inventory.itemAcquisitionOrder)
			{
				ItemDef itemDef = ItemCatalog.GetItemDef(item);
				if ((Object)(object)itemDef != (Object)null)
				{
					((BaseUnityPlugin)this).Logger.LogInfo((object)("Item: " + ((Object)itemDef).name + " - " + Language.GetString(itemDef.descriptionToken)));
				}
			}
		}

		private string GetBlockChance(int itemCount)
		{
			if (itemCount <= 0)
			{
				return "0%";
			}
			double num = 0.15 * (double)itemCount / (0.15 * (double)itemCount + 1.0);
			return $"{num * 100.0:F1}%";
		}

		private string GetStunGrenadeChance(int itemCount)
		{
			if (itemCount <= 0)
			{
				return "0%";
			}
			double num = 0.05 * (double)itemCount / (0.05 * (double)itemCount + 1.0);
			return $"{num * 100.0:F1}%";
		}

		private string GetBandolierChance(int itemCount)
		{
			if (itemCount <= 0)
			{
				return "0%";
			}
			double num = 1.0 - Math.Pow(1.0 / (1.0 + (double)itemCount), 0.33);
			return $"{num * 100.0:F1}%";
		}

		private string GetFuelCellCooldownReduction(int itemCount)
		{
			if (itemCount <= 0)
			{
				return "0%";
			}
			double num = 1.0 - Math.Pow(0.85, itemCount);
			return $"{num * 100.0:F1}%";
		}

		private string GetExecuteThreshold(int itemCount)
		{
			if (itemCount <= 0)
			{
				return "0%";
			}
			double num = 0.13 * (double)itemCount / (0.13 * (double)itemCount + 1.0);
			return $"{num * 100.0:F1}%";
		}

		private string GetStealthKitRechargeTime(int itemCount)
		{
			if (itemCount <= 0)
			{
				return "30s";
			}
			double num = 30.0 * Math.Pow(0.5, itemCount - 1);
			return $"{num:F1}s";
		}

		private string GetCustomDescription(ItemDef itemDef, int itemCount)
		{
			switch (((Object)itemDef).name)
			{
			case "ChainLightning":
			{
				int num136 = 3 + 2 * (itemCount - 1);
				float num137 = 20f + 2f * (float)(itemCount - 1);
				return $"Targets: {num136}, Range: {num137}m";
			}
			case "Syringe":
			{
				float num135 = 15f * (float)itemCount;
				return $"Attack Speed: {num135}%";
			}
			case "BossDamageBonus":
			{
				float num134 = 20f * (float)itemCount;
				return $"Damage: {num134}%";
			}
			case "SecondarySkillMagazine":
			{
				int num133 = 1 + itemCount;
				return $"Charges: {num133}";
			}
			case "FlatHealth":
			{
				int num132 = 25 * itemCount;
				return $"HP Increase: {num132}";
			}
			case "Firework":
			{
				int num131 = 8 + 4 * (itemCount - 1);
				return $"Fireworks: {num131}";
			}
			case "Mushroom":
			{
				float num129 = 4.5f + 2.25f * (float)(itemCount - 1);
				float num130 = 3f + 1.5f * (float)(itemCount - 1);
				return $"Healing: {num129}% Radius: {num130}m";
			}
			case "HealWhileSafe":
			{
				float num128 = 3f * (float)itemCount;
				return $"Regen: {num128} hp/s";
			}
			case "Crowbar":
			{
				float num127 = 75f * (float)itemCount;
				return $"Damage: {num127}%";
			}
			case "SprintBonus":
			{
				float num126 = 25f * (float)itemCount;
				return $"Sprint Speed: {num126}%";
			}
			case "NearbyDamageBonus":
			{
				float num125 = 20f * (float)itemCount;
				return $"Damage: {num125}%";
			}
			case "IgniteOnKill":
			{
				int num123 = 12 + 4 * (itemCount - 1);
				float num124 = 150f + 75f * (float)(itemCount - 1);
				return $"Radius: {num123}m, Damage: {num124}%";
			}
			case "CritGlasses":
			{
				float num122 = 10f * (float)itemCount;
				return $"Crit: {num122}%";
			}
			case "Medkit":
			{
				float num120 = 20f;
				float num121 = 5f * (float)itemCount;
				return $"Heal: {num120} + {num121}% of max HP";
			}
			case "Tooth":
			{
				float num119 = 8f + 2f * (float)itemCount;
				return $"HP per orb: {num119}%";
			}
			case "Hoof":
			{
				float num118 = 14f * (float)itemCount;
				return $"Speed: {num118}%";
			}
			case "PersonalShield":
			{
				float num117 = 8f * (float)itemCount;
				return $"Shield: {num117}% of max health";
			}
			case "ArmorPlate":
			{
				int num116 = 5 * itemCount;
				return $"Damage Reduction: {num116}";
			}
			case "StickyBomb":
			{
				float num115 = 5f * (float)itemCount;
				return $"Chance: {num115}%";
			}
			case "StunChanceOnHit":
				return "Stun Chance: " + GetStunGrenadeChance(itemCount);
			case "BarrierOnKill":
			{
				int num114 = 15 * itemCount;
				return $"Barrier HP: {num114}";
			}
			case "Bear":
				return "Chance: " + GetBlockChance(itemCount);
			case "BleedOnHit":
			{
				float num113 = 10f * (float)itemCount;
				return $"Chance: {num113}%";
			}
			case "WardOnLevel":
			{
				float num112 = 16f + 8f * (float)(itemCount - 1);
				return $"Radius: {num112}m";
			}
			case "Missile":
			{
				int num111 = 300 + 300 * (itemCount - 1);
				return $"Damage: {num111}%";
			}
			case "Bandolier":
				return "Chance: " + GetBandolierChance(itemCount);
			case "WarCryOnMultiKill":
			{
				int num110 = 6 + 4 * (itemCount - 1);
				return $"Duration: {num110}s";
			}
			case "SlowOnHit":
			{
				int num109 = 2 + 2 * (itemCount - 1);
				return $"Duration: {num109}s";
			}
			case "DeathMark":
			{
				int num108 = 7 + 7 * (itemCount - 1);
				return $"Duration: {num108}s";
			}
			case "EquipmentMagazine":
			{
				string fuelCellCooldownReduction = GetFuelCellCooldownReduction(itemCount);
				return $"Additional Charges: {itemCount}, Cooldown Reduction: {fuelCellCooldownReduction}";
			}
			case "BonusGoldPackOnKill":
			{
				float num107 = 4 * itemCount;
				return $"Chance: {num107}%";
			}
			case "HealOnCrit":
			{
				int num106 = 8 + 4 * (itemCount - 1);
				return $"HP per hit: {num106}";
			}
			case "Feather":
				return $"Jump Count: {itemCount}";
			case "Infusion":
			{
				int num105 = 100 * itemCount;
				return $"Health Increase: {num105}";
			}
			case "FireRing":
			{
				int num104 = 300 + 300 * (itemCount - 1);
				return $"Damage: {num104}%";
			}
			case "Seed":
				return $"HP per hit: {itemCount}";
			case "TPHealingNova":
				return $"Novas: {itemCount}";
			case "ExecuteLowHealthElite":
			{
				string executeThreshold = GetExecuteThreshold(itemCount);
				return "HP: " + executeThreshold;
			}
			case "Phasing":
			{
				string stealthKitRechargeTime = GetStealthKitRechargeTime(itemCount);
				return "Cooldown: " + stealthKitRechargeTime + ".";
			}
			case "AttackSpeedOnCrit":
			{
				int num103 = 24 * itemCount;
				return $"Max Attk Speed: {num103}%";
			}
			case "Thorns":
			{
				int num101 = 5 + 2 * (itemCount - 1);
				int num102 = 25 + 10 * (itemCount - 1);
				return $"Targets: {num101}, Radius: {num102}m";
			}
			case "SprintOutOfCombat":
			{
				float num100 = 30 + 30 * (itemCount - 1);
				return $"Movement Speed: {num100}%";
			}
			case "SprintArmor":
			{
				int num99 = 30 + 30 * (itemCount - 1);
				return $"Armor: {num99}";
			}
			case "IceRing":
			{
				int num97 = 250 + 250 * (itemCount - 1);
				int num98 = 3 + 3 * (itemCount - 1);
				return $"Damage: {num97}%, Duration: {num98}s";
			}
			case "Squid":
			{
				int num96 = 100 + 100 * (itemCount - 1);
				return $"Attack Speed: {num96}%";
			}
			case "EnergizedOnEquipmentUse":
			{
				int num95 = 8 + 4 * (itemCount - 1);
				return $"Duration: {num95}s";
			}
			case "JumpBoost":
			{
				int num94 = 10 + 10 * (itemCount - 1);
				return $"Distance: {num94}m";
			}
			case "ExplodeOnDeath":
			{
				float num92 = 12f + 2.4f * (float)(itemCount - 1);
				int num93 = 350 + 280 * (itemCount - 1);
				return $"Radius: {num92:F1}m, Damage: {num93}%";
			}
			case "Clover":
				return $"Rolls: {itemCount}";
			case "BarrierOnOverHeal":
			{
				float num91 = 50 + 50 * (itemCount - 1);
				return $"Barrier: {num91}%";
			}
			case "AlienHead":
			{
				float num90 = 25 * itemCount;
				return $"Reduction: {num90}%";
			}
			case "KillEliteFrenzy":
			{
				int num89 = 4 + 4 * (itemCount - 1);
				return $"Duration: {num89}s";
			}
			case "Behemoth":
			{
				float num88 = 4f + 2.5f * (float)(itemCount - 1);
				return $"Radius: {num88}m";
			}
			case "Dagger":
			{
				int num87 = 150 + 150 * (itemCount - 1);
				return $"Damage: {num87}%";
			}
			case "CaptainDefenseMatrix":
				return $"Projectiles: {itemCount}";
			case "Icicle":
			{
				int num86 = 18 + 12 * (itemCount - 1);
				return $"Max Radius: {num86}m";
			}
			case "FallBoots":
			{
				float num85 = 10f / (float)itemCount;
				return $"Cooldown: {num85:F1}s";
			}
			case "GhostOnKill":
			{
				int num84 = 30 + 30 * (itemCount - 1);
				return $"Duration: {num84}s";
			}
			case "UtilitySkillMagazine":
			{
				int num83 = 2 + 2 * (itemCount - 1);
				return $"Charges: {num83}";
			}
			case "Plant":
			{
				float num82 = 10f + 5f * (float)(itemCount - 1);
				return $"Radius: {num82}m";
			}
			case "NovaOnHeal":
			{
				int num81 = 100 + 100 * (itemCount - 1);
				return $"Stores {num81}% of healing as Soul Energy";
			}
			case "IncreaseHealing":
			{
				int num80 = 100 + 100 * (itemCount - 1);
				return $"Healing: +{num80}%";
			}
			case "LaserTurbine":
			{
				int num77 = 300 + 300 * (itemCount - 1);
				int num78 = 1000 + 1000 * (itemCount - 1);
				int num79 = 300 + 300 * (itemCount - 1);
				return $"Launch Damage: {num77}% base, Explode Damage: {num78}% base, Return Damage: {num79}% base";
			}
			case "BounceNearby":
			{
				float num75 = 100f * (1f - 1f / (1f + 0.2f * (float)itemCount));
				int num76 = 10 + 5 * (itemCount - 1);
				return $"Chance: {num75:F1}%, Targets: {num76}";
			}
			case "ArmorReductionOnHit":
			{
				int num74 = 8 + 8 * (itemCount - 1);
				return $"Duration: {num74}s";
			}
			case "Talisman":
			{
				int num73 = 4 + 2 * (itemCount - 1);
				return $"Cooldown: {num73}s";
			}
			case "ShockNearby":
			{
				int num72 = 3 + 2 * (itemCount - 1);
				return $"Targets: {num72}";
			}
			case "HeadHunter":
			{
				int num71 = 8 + 5 * (itemCount - 1);
				return $"Duration: {num71}s";
			}
			case "OutOfCombatArmor":
			{
				int num70 = 100 + 100 * (itemCount - 1);
				return $"Armor: {num70}";
			}
			case "GoldOnHurt":
			{
				int num69 = 3 + 3 * (itemCount - 1);
				return $"Gold: {num69}";
			}
			case "FragileDamageBonus":
			{
				float num68 = 20 + 20 * (itemCount - 1);
				return $"Damage: {num68}%";
			}
			case "AttackSpeedAndMoveSpeed":
			{
				float num66 = 7.5f + 7.5f * (float)(itemCount - 1);
				float num67 = 7 + 7 * (itemCount - 1);
				return $"Attack Speed: {num66:F1}% Movement speed: {num67}%.";
			}
			case "StrengthenBurn":
			{
				int num65 = 300 + 300 * (itemCount - 1);
				return $"Damage: +{num65}%";
			}
			case "PrimarySkillShuriken":
			{
				int num63 = 400 + 100 * (itemCount - 1);
				int num64 = 3 + (itemCount - 1);
				return $"Damage: {num63}% Max: {num64}.";
			}
			case "MoveSpeedOnKill":
			{
				float num62 = 1f + 0.5f * (float)(itemCount - 1);
				return $"Duration {num62:F1}s";
			}
			case "LightningStrikeOnHit":
			{
				int num61 = 500 + 500 * (itemCount - 1);
				return $"Damage: {num61}%";
			}
			case "MinorConstructOnKill":
			{
				int num60 = 4 + 4 * (itemCount - 1);
				return $"Max: {num60}.";
			}
			case "RoboBallBuddy":
			{
				int num59 = 100 + 100 * (itemCount - 1);
				return $"Damage: {num59}%";
			}
			case "NovaOnLowHealth":
			{
				float num58 = 30f / (float)(itemCount + 1);
				return $"Cooldown {num58:F1}";
			}
			case "TitanGoldDuringTP":
			{
				int num56 = 100 + 50 * (itemCount - 1);
				int num57 = 100 + 100 * (itemCount - 1);
				return $"Damage: {num56}% Health: {num57}%";
			}
			case "ShinyPearl":
			{
				int num55 = 10 + 10 * (itemCount - 1);
				return $"Increase: {num55}%.";
			}
			case "SprintWisp":
			{
				int num54 = 300 + 300 * (itemCount - 1);
				return $"Damage: {num54}%";
			}
			case "SiphonOnLowHealth":
			{
				int num53 = 1 + (itemCount - 1);
				return $"Max Tethered: {num53}";
			}
			case "FireballsOnHit":
			{
				int num52 = 300 + 300 * (itemCount - 1);
				return $"Damage: {num52}%";
			}
			case "Pearl":
			{
				int num51 = 10 + 10 * (itemCount - 1);
				return $"Increase: {num51}%";
			}
			case "ParentEgg":
			{
				int num50 = 15 + 15 * (itemCount - 1);
				return $"Heal {num50} on hurt.";
			}
			case "BeetleGland":
			{
				int num49 = 1 + (itemCount - 1);
				return $"Max: {num49}";
			}
			case "BleedOnHitAndExplode":
			{
				int num47 = 400 + 400 * (itemCount - 1);
				int num48 = 15 + 15 * (itemCount - 1);
				return $"Explosion damage: {num47}% and {num48}% of their max health.";
			}
			case "Knurl":
			{
				int num45 = 40 + 40 * (itemCount - 1);
				float num46 = 1.6f + 1.6f * (float)(itemCount - 1);
				return $"Health increase: {num45}, Regen increase: {num46} hp/s.";
			}
			case "GoldOnHit":
			{
				int num44 = 2 + 2 * (itemCount - 1);
				return $"30% chance on hit to gain {num44} gold.";
			}
			case "RepeatHeal":
			{
				float num43 = 0.1f / (float)itemCount;
				return $"Heals 100% more over time, max 10% of your health per second, reduces to {num43 * 100f:F1}% per stack.";
			}
			case "RandomDamageZone":
			{
				int num41 = 3 - (int)(1.5 * (double)(itemCount - 1));
				int num42 = 3 + (itemCount - 1);
				return $"Every {num41} seconds, gain an orbiting bomb (max {num42}), detonates on impact for 360% damage.";
			}
			case "LunarSpecialReplacement":
			{
				int num39 = 10 + 10 * (itemCount - 1);
				int num40 = 8 + 8 * (itemCount - 1);
				return $"Dealing damage adds a stack of Ruin for {num39}s. Recharges every {num40}s.";
			}
			case "RandomlyLunar":
			{
				int num38 = 5 + 5 * (itemCount - 1);
				return $"Items have a {num38}% chance to become Lunar items.";
			}
			case "FocusConvergence":
			{
				float num36 = 90f / (1f + 0.3f * (float)itemCount);
				float num37 = 1f / (2f * (float)itemCount);
				return $"Teleporters charge {num36:F1}% faster, zone size reduced to {num37 * 100f:F1}% of original.";
			}
			case "AutoCastEquipment":
			{
				float num35 = 0.5f * (float)Math.Pow(0.85, itemCount - 1);
				return $"Reduces Equipment cooldown by {num35 * 100f:F1}%.";
			}
			case "LunarSecondaryReplacement":
			{
				int num34 = 5 + 5 * (itemCount - 1);
				return $"Recharge: {num34}s.";
			}
			case "HalfAttackSpeedHalfCooldowns":
			{
				float num32 = (float)Math.Pow(0.5, itemCount);
				float num33 = 1f / (float)(itemCount + 1);
				return $"Decreases skill cooldowns by {num32 * 100f:F1}%, attack speed reduced to {num33 * 100f:F1}%.";
			}
			case "LunarBadLuck":
			{
				int num30 = 2 + (itemCount - 1);
				int num31 = 1 + (itemCount - 1);
				return $"Reduces skill cooldowns by {num30}s, increases unfavorable outcomes by {num31}.";
			}
			case "LunarDagger":
			{
				float num28 = (float)Math.Pow(2.0, itemCount);
				float num29 = (float)Math.Pow(0.5, itemCount);
				return $"Increases damage by {num28 * 100f:F1}%, reduces health by {num29 * 100f:F1}%.";
			}
			case "HalfSpeedDoubleHealth":
			{
				int num26 = 100 + 100 * (itemCount - 1);
				float num27 = (float)Math.Pow(0.5, itemCount);
				return $"Increases max health by {num26}%, reduces movement speed by {num27 * 100f:F1}%.";
			}
			case "LunarUtilityReplacement":
			{
				float num24 = 18.2f + 18.2f * (float)(itemCount - 1);
				int num25 = 3 + 3 * (itemCount - 1);
				return $"Heal {num24}% of max health over {num25}s.";
			}
			case "ShieldOnly":
			{
				float num23 = 50 + 25 * (itemCount - 1);
				return $"Increases maximum health by {num23}%.";
			}
			case "LunarPrimaryReplacement":
			{
				int num21 = 12 + 12 * (itemCount - 1);
				float num22 = 2 + 2 * (itemCount - 1);
				return $"Fire tracking shards, holds up to {num21} charges, reloads every {num22}s.";
			}
			case "CloverVoid":
			{
				int num20 = 3 + 3 * (itemCount - 1);
				return $"Upgrades: {num20}";
			}
			case "CritGlassesVoid":
			{
				float num19 = 0.5f + 0.5f * (float)(itemCount - 1);
				return $"Chance: {num19:F1}%";
			}
			case "EquipmentMagazineVoid":
				return $"Special Charges: {itemCount}";
			case "BleedOnHitVoid":
			{
				int num18 = 10 + 10 * (itemCount - 1);
				return $"Chance: {num18:F1}%";
			}
			case "VoidMegaCrabItem":
			{
				float num16 = 60f / (1f + 0.5f * (float)(itemCount - 1));
				int num17 = 1 + (itemCount - 1);
				return $"Spawnrate: {num16:F1}s, Max: {num17}";
			}
			case "MissileVoid":
			{
				float num14 = 10 + 10 * (itemCount - 1);
				int num15 = 40 + 40 * (itemCount - 1);
				return $"Gain a shield for {num14}% of max your health. Damage: {num15}%";
			}
			case "ChainLightningVoid":
			{
				int num13 = 3 + 3 * (itemCount - 1);
				return $"Chains Lightning: {num13} times.";
			}
			case "BearVoid":
			{
				float num12 = 15f * (float)Math.Pow(0.9, itemCount);
				return $"Cooldown: {num12:F1} seconds.";
			}
			case "ElementalRingVoid":
			{
				float num10 = 20f;
				int num11 = 100 + 100 * (itemCount - 1);
				return $"Damage: {num11}% Cooldown: {num10}s";
			}
			case "SlowOnHitVoid":
			{
				int num8 = 5 + 5 * (itemCount - 1);
				int num9 = 1 + (itemCount - 1);
				return $"Duration: {num9}s";
			}
			case "ExplodeOnDeathVoid":
			{
				float num6 = 12f + 2.4f * (float)(itemCount - 1);
				int num7 = 260 + 156 * (itemCount - 1);
				return $"Radius: {num6}m, Damage: {num7}%";
			}
			case "MushroomVoid":
			{
				int num5 = 2 + 2 * (itemCount - 1);
				return $"Heals for {num5}%";
			}
			case "RandomEquipmentTrigger":
				return $"Triggers random equipment {itemCount} time(s).";
			case "PermanentDebuffOnHit":
			{
				int num4 = 2 * itemCount;
				return $"Reduces enemy armor by {num4}.";
			}
			case "MoreMissile":
			{
				int num3 = 50 * itemCount;
				return $"Damage: {num3}%.";
			}
			case "ImmuneToDebuff":
				return $"Prevents {itemCount} debuff(s).";
			case "DroneWeapons":
			{
				int num2 = 50 * itemCount;
				return $"Attack Speed: {num2}%";
			}
			case "CritDamage":
			{
				int num = 100 * itemCount;
				return $"Critical strikes deal an additional {num}% damage.";
			}
			default:
				return "";
			}
		}

		private void ItemIcon_SetItemIndex(orig_SetItemIndex orig, ItemIcon self, ItemIndex newItemIndex, int newItemCount)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, newItemIndex, newItemCount);
			if (!Object.op_Implicit((Object)(object)self.tooltipProvider))
			{
				return;
			}
			ItemDef itemDef = ItemCatalog.GetItemDef(newItemIndex);
			if (!((Object)(object)itemDef != (Object)null))
			{
				return;
			}
			ItemInventoryDisplay componentInParent = ((Component)self).GetComponentInParent<ItemInventoryDisplay>();
			if ((Object)(object)componentInParent != (Object)null && (Object)(object)componentInParent.inventory != (Object)null)
			{
				int itemCount = componentInParent.inventory.GetItemCount(itemDef.itemIndex);
				string customDescription = GetCustomDescription(itemDef, itemCount);
				if (!string.IsNullOrEmpty(customDescription))
				{
					string @string = Language.GetString(itemDef.descriptionToken);
					string relevantStats = GetRelevantStats(componentInParent.inventory, ((Object)itemDef).name);
					self.tooltipProvider.overrideBodyText = @string + "\n" + customDescription + relevantStats;
				}
			}
		}

		private string GetRelevantStats(Inventory inventory, string itemName)
		{
			string text = "";
			if (itemName == "CritGlasses" || itemName == "HealOnCrit" || itemName == "AttackSpeedOnCrit")
			{
				text = text + "\n" + CalculateTotalCritChance(inventory);
			}
			switch (itemName)
			{
			default:
				if (!(itemName == "HalfAttackSpeedHalfCooldowns"))
				{
					break;
				}
				goto case "Syringe";
			case "Syringe":
			case "AttackSpeedOnCrit":
			case "AttackSpeedAndMoveSpeed":
				text = text + "\n" + CalculateTotalAttackSpeed(inventory);
				break;
			}
			switch (itemName)
			{
			default:
				if (!(itemName == "LunarUtilityReplacement"))
				{
					break;
				}
				goto case "Hoof";
			case "Hoof":
			case "SprintBonus":
			case "SprintOutOfCombat":
			case "AttackSpeedAndMoveSpeed":
			case "HalfSpeedDoubleHealth":
				text = text + "\n" + CalculateTotalMovementSpeed(inventory);
				break;
			}
			return text;
		}

		private string CalculateTotalMovementSpeed(Inventory inventory)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			int itemCount = inventory.GetItemCount(ItemCatalog.FindItemIndex("Hoof"));
			int itemCount2 = inventory.GetItemCount(ItemCatalog.FindItemIndex("SprintBonus"));
			int itemCount3 = inventory.GetItemCount(ItemCatalog.FindItemIndex("SprintOutOfCombat"));
			int itemCount4 = inventory.GetItemCount(ItemCatalog.FindItemIndex("AttackSpeedAndMoveSpeed"));
			int itemCount5 = inventory.GetItemCount(ItemCatalog.FindItemIndex("HalfSpeedDoubleHealth"));
			int itemCount6 = inventory.GetItemCount(ItemCatalog.FindItemIndex("LunarUtilityReplacement"));
			double num = 14 * itemCount + 25 * itemCount2 + 30 * itemCount3 + 7 * itemCount4;
			double num2 = 50 * itemCount5;
			num -= num2;
			return $"Total Movement Speed: {num}%";
		}

		private string CalculateTotalCritChance(Inventory inventory)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			int itemCount = inventory.GetItemCount(ItemCatalog.FindItemIndex("CritGlasses"));
			int itemCount2 = inventory.GetItemCount(ItemCatalog.FindItemIndex("HealOnCrit"));
			int itemCount3 = inventory.GetItemCount(ItemCatalog.FindItemIndex("AttackSpeedOnCrit"));
			int itemCount4 = inventory.GetItemCount(ItemCatalog.FindItemIndex("BleedOnHitAndExplode"));
			double num = 10 * itemCount + 5 * itemCount2 + 5 * itemCount3 + 5 * itemCount4;
			return $"Total Crit Chance: {num}%";
		}

		private string CalculateTotalAttackSpeed(Inventory inventory)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			int itemCount = inventory.GetItemCount(ItemCatalog.FindItemIndex("Syringe"));
			int itemCount2 = inventory.GetItemCount(ItemCatalog.FindItemIndex("AttackSpeedOnCrit"));
			int itemCount3 = inventory.GetItemCount(ItemCatalog.FindItemIndex("AttackSpeedAndMoveSpeed"));
			int itemCount4 = inventory.GetItemCount(ItemCatalog.FindItemIndex("HalfAttackSpeedHalfCooldowns"));
			double num = (double)(15 * itemCount + 12 * itemCount2) + 7.5 * (double)itemCount3;
			double num2 = 50 * itemCount4;
			num *= Math.Pow(0.5, itemCount4);
			return $"Total Attack Speed: {num}%";
		}
	}
}