Rijam_RijamsMod/Items/GlobalItems.cs
using System.Collections.Generic;
using System.Linq;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Localization;
using Terraria.GameContent.ItemDropRules;
using RijamsMod.Items.Weapons.Ranged.Ammo;
using RijamsMod.Items.Weapons.Summon.Whips;
using RijamsMod.Items.Materials;
using RijamsMod.Items.Weapons.Ranged;
using static RijamsMod.RijamsModConfigServer;
using RijamsMod.Items.Weapons.Melee.JoustingLances;

namespace RijamsMod.Items
{
	public class GlobalItems : GlobalItem
	{
		/// <summary> This set is a set of all whips. </summary>
		public static List<int> isWhip = new() { ItemID.BlandWhip, ItemID.ThornWhip, ItemID.BoneWhip, ItemID.FireWhip,
			ItemID.CoolWhip, ItemID.SwordWhip, ItemID.MaceWhip, ItemID.ScytheWhip, ItemID.RainbowWhip };
		/// <summary> This set is a set of all jousting lances. </summary>
		public static List<int> isJoustingLance = new() { ItemID.JoustingLance, ItemID.HallowJoustingLance, ItemID.ShadowJoustingLance };
		/// <summary>
		/// This set is a set of all lantern weapons (like the Nightglow, but does not include the Nightglow).
		/// Items in this set will automatically be drawn behind the player's back hand.
		/// </summary>
		public static List<int> isLanternWeapon = new(); // Nightglow not included.
		/*/// <summary>
		/// The front arm of the player will not animate correctly when the useStyle is set to RaiseLamp (14). Items in this set will be corrected with an IL Edit.
		/// </summary>
		// public static List<int> fixItemUseStyleIDRaiseLampFrontArmAnimation = new(); // No longer needed. Fix implemented into tModLoader directly. PR #3530*/

		public override void SetStaticDefaults()
		{
			ItemID.Sets.ShimmerTransformToItem[ItemID.WormTooth] = ModContent.ItemType<CrawlerChelicera>(); // Shimmer transforms the item.
			ItemID.Sets.ShimmerTransformToItem[ItemID.Handgun] = ModContent.ItemType<StockadeCrossbow>(); // Shimmer transforms the item.
			ItemID.Sets.ShimmerTransformToItem[ItemID.FleshKnuckles] = ItemID.PutridScent; // Shimmer transforms the item.
			ItemID.Sets.ShimmerTransformToItem[ItemID.PutridScent] = ItemID.FleshKnuckles; // Shimmer transforms the item.
			ItemID.Sets.ShimmerTransformToItem[ItemID.DarkLance] = ModContent.ItemType<DarkJoustingLance>(); // Shimmer transforms the item.
		}

		public override void SetDefaults(Item item)
		{
			RijamsModConfigServer.ArmorOptions vanillaVanityToArmor = ModContent.GetInstance<RijamsModConfigServer>().VanillaVanityToArmor;

			if (item.type == ItemID.Coal)
			{
				item.maxStack = Item.CommonMaxStack;
			}
			if (item.type == ItemID.PharaohsMask && (vanillaVanityToArmor == ArmorOptions.All || vanillaVanityToArmor == ArmorOptions.VanityOnly))
			{
				item.vanity = false;
				item.defense = 2;
				item.value = 5000;
			}
			if (item.type == ItemID.PharaohsRobe && (vanillaVanityToArmor == ArmorOptions.All || vanillaVanityToArmor == ArmorOptions.VanityOnly))
			{
				item.vanity = false;
				item.defense = 3;
				item.value = 5000;
			}
			if (item.type == ItemID.AncientArmorHat && (vanillaVanityToArmor == ArmorOptions.All || vanillaVanityToArmor == ArmorOptions.VanityOnly))
			{
				item.vanity = false;
				item.defense = 10;
			}
			if (item.type == ItemID.AncientArmorShirt && (vanillaVanityToArmor == ArmorOptions.All || vanillaVanityToArmor == ArmorOptions.VanityOnly))
			{
				item.vanity = false;
				item.defense = 14;
			}
			if (item.type == ItemID.AncientArmorPants && (vanillaVanityToArmor == ArmorOptions.All || vanillaVanityToArmor == ArmorOptions.VanityOnly))
			{
				item.vanity = false;
				item.defense = 9;
			}
			if (item.type == ItemID.PinkPricklyPear)
			{
				item.consumable = true;
				item.useStyle = ItemUseStyleID.EatFood;
				item.useAnimation = 15;
				item.useTime = 15;
				item.useTurn = true;
				item.UseSound = SoundID.Item2;
				item.buffType = ModContent.BuffType<Buffs.Potions.Satiated>(); //Specify an existing buff to be applied when used.
				item.buffTime = 3600; //1 minute
			}
			if (item.ModItem != null && item.ModItem.Mod == Mod) //Hacky solution because I'm lazy lol
			{
				if (item.ResearchUnlockCount != 0)
				{
					return;
				}
				if (item.maxStack == 1)
				{
					item.ResearchUnlockCount = 1;
				}
				else if (item.consumable)
				{
					if (item.buffType > BuffID.ObsidianSkin)
					{
						item.ResearchUnlockCount = 30;
					}
					else if (item.createTile > TileID.Stone)
					{
						item.ResearchUnlockCount = 100;
					}
					else if (item.createWall > WallID.Stone)
					{
						item.ResearchUnlockCount = 400;
					}
					else if (item.ammo > 1)
					{
						item.ResearchUnlockCount = 99;
					}
					else if (item.makeNPC > 1)
					{
						item.ResearchUnlockCount = 3;
					}
					else if (ItemID.Sets.BossBag[item.type])
					{
						item.ResearchUnlockCount = 3;
					}
					else
					{
						item.ResearchUnlockCount = 10;
					}
				}
				else if (item.ModItem.GetType().Namespace.ToString() == "RijamsMod.Items.Materials")
				{
					item.ResearchUnlockCount = 25;
				}
				else if (item.dye > 1)
				{
					item.ResearchUnlockCount = 3;
				}
				else
				{
					item.ResearchUnlockCount = 2;
				}
			}
		}
		public override void ModifyTooltips(Item item, List<TooltipLine> tooltips)
		{
			ArmorOptions vanillaVanityToArmor = ModContent.GetInstance<RijamsModConfigServer>().VanillaVanityToArmor;
			bool isLeftShiftHeld = Main.keyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.LeftShift);

			if (item.buffType == ModContent.BuffType<Buffs.Potions.ExceptionalFeast>())
			{
				if (isLeftShiftHeld)
				{
					tooltips.Add(new TooltipLine(Mod, "ExceptionalFeast", "Exceptional Feast provides:"));
					tooltips.Add(new TooltipLine(Mod, "EFStats1", "+5 Defense"));
					tooltips.Add(new TooltipLine(Mod, "EFStats2", "+5% Critical Hit Chance"));
					tooltips.Add(new TooltipLine(Mod, "EFStats3", "+12.5% Melee Speed"));
					tooltips.Add(new TooltipLine(Mod, "EFStats4", "+12.5% Damage"));
					tooltips.Add(new TooltipLine(Mod, "EFStats5", "+1.25 Minion Knockback"));
					tooltips.Add(new TooltipLine(Mod, "EFStats6", "+50% Movement Speed"));
					tooltips.Add(new TooltipLine(Mod, "EFStats7", "+20% Mining Speed"));
					tooltips.Add(new TooltipLine(Mod, "EFOverride", "Counts as a Well Fed buff"));
				}
				else
				{
					tooltips.Add(new TooltipLine(Mod, "EFInfo", "Hold Left Shift for more information"));
				}
			}
			if (item.buffType == ModContent.BuffType<Buffs.Potions.Satiated>())
			{
				if (item.type == ItemID.PinkPricklyPear)
				{
					if (FindTooltipIndex(tooltips, "Tooltip0", "Terraria", out int index))
					{
						tooltips.Insert(index + 1, new TooltipLine(Mod, "SItemInfo", "Minuscule improvements to all stats"));
					}
				}
			   
				if (isLeftShiftHeld)
				{
					tooltips.Add(new TooltipLine(Mod, "Satiated", "Satiated provides:"));
					tooltips.Add(new TooltipLine(Mod, "SStats1", "+1 Defense"));
					tooltips.Add(new TooltipLine(Mod, "SStats2", "+1% Critical Hit Chance"));
					tooltips.Add(new TooltipLine(Mod, "SStats3", "+2.5% Melee Speed"));
					tooltips.Add(new TooltipLine(Mod, "SStats4", "+2.5% Damage"));
					tooltips.Add(new TooltipLine(Mod, "SStats5", "+0.25 Minion Knockback"));
					tooltips.Add(new TooltipLine(Mod, "SStats6", "+10% Movement Speed"));
					tooltips.Add(new TooltipLine(Mod, "SStats7", "Does not provide increased life regeneration in Expert Mode"));
					tooltips.Add(new TooltipLine(Mod, "SOverride", "Counts as a Well Fed buff"));
				}
				else
				{
					tooltips.Add(new TooltipLine(Mod, "SInfo", "Hold Left Shift for more information"));
				}
			}
			if (item.type == ItemID.AncientArmorHat && (vanillaVanityToArmor == ArmorOptions.All || vanillaVanityToArmor == ArmorOptions.VanityOnly))
			{
				if (FindTooltipIndex(tooltips, "Defense", "Terraria", out int index))
				{
					tooltips.Insert(index + 1, new TooltipLine(Mod, "AncientHeaddress", "+5 critical strike chance"));
					tooltips.Insert(index + 2, new TooltipLine(Mod, "AncientHeaddress", "20% chance to not consume ammo"));
				}
			}
			if (item.type == ItemID.AncientArmorShirt && (vanillaVanityToArmor == ArmorOptions.All || vanillaVanityToArmor == ArmorOptions.VanityOnly))
			{
				if (FindTooltipIndex(tooltips, "Defense", "Terraria", out int index))
				{
					tooltips.Insert(index + 1, new TooltipLine(Mod, "AncientGarments", "20% increased damage"));
					tooltips.Insert(index + 2, new TooltipLine(Mod, "AncientGarments", "+1 Minion capacity"));
					tooltips.Insert(index + 3, new TooltipLine(Mod, "AncientGarments", "+5 Support minion radius"));
				}
			}
			if (item.type == ItemID.AncientArmorPants && (vanillaVanityToArmor == ArmorOptions.All || vanillaVanityToArmor == ArmorOptions.VanityOnly))
			{
				if (FindTooltipIndex(tooltips, "Defense", "Terraria", out int index))
				{
					tooltips.Insert(index + 1, new TooltipLine(Mod, "AncientSlacks", "10% increased melee speed"));
					tooltips.Insert(index + 2, new TooltipLine(Mod, "AncientSlacks", "10% reduced mana usage"));
					tooltips.Insert(index + 3, new TooltipLine(Mod, "AncientSlacks", "+2 life regeneration"));
				}
			}
			if (item.type == ItemID.BeeGreaves && (vanillaVanityToArmor == ArmorOptions.All || vanillaVanityToArmor == ArmorOptions.ArmorOnly))
			{
				if (FindTooltipIndex(tooltips, "Tooltip0", "Terraria", out int index))
				{
					tooltips.Insert(index + 1, new TooltipLine(Mod, "BeeGreaves", "+1 Sentry capacity"));
				}
			}
			if (item.type == ItemID.JoustingLance)
			{
				TooltipLine line = tooltips.FirstOrDefault(x => x.Name == "Tooltip0" && x.Mod == "Terraria");
				if (line != null)
				{
					line.Text = Language.GetTextValue("ItemTooltip.JoustingLance").Split("\n")[0] + "\n7.65 tile reach";
				}
				TooltipLine line2 = tooltips.FirstOrDefault(x => x.Name == "Tooltip3" && x.Mod == "Terraria");
			}
			if (item.type == ItemID.HallowJoustingLance)
			{
				TooltipLine line = tooltips.FirstOrDefault(x => x.Name == "Tooltip0" && x.Mod == "Terraria");
				if (line != null)
				{
					line.Text = Language.GetTextValue("ItemTooltip.HallowJoustingLance") + "\n7.65 tile reach";
				}
			}
			if (item.type == ItemID.ShadowJoustingLance)
			{
				TooltipLine line = tooltips.FirstOrDefault(x => x.Name == "Tooltip0" && x.Mod == "Terraria");
				if (line != null)
				{
					line.Text = Language.GetTextValue("ItemTooltip.ShadowJoustingLance") + "\n7.65 tile reach\nInflicts Shadowflame";
				}
			}
			RijamsModConfigClient configClient = ModContent.GetInstance<RijamsModConfigClient>();
			if (isWhip.Contains(item.type) && (isLeftShiftHeld && configClient.DisplayWhipMultihitPenalty == RijamsModConfigClient.WhipMultihitPenalty.HoldShift || configClient.DisplayWhipMultihitPenalty == RijamsModConfigClient.WhipMultihitPenalty.On))
			{
				if (item.type == ModContent.ItemType<Belt>())
				{
					if (FindTooltipIndex(tooltips, "Knockback", "Terraria", out int index))
					{
						tooltips.Insert(index + 1, new TooltipLine(Mod, "ModWhipDamageReduction", "50% damage penalty per enemy pierced"));
					}
				}
				if (item.type == ItemID.BlandWhip)
				{
					if (FindTooltipIndex(tooltips, "Knockback", "Terraria", out int index))
					{
						tooltips.Insert(index + 1, new TooltipLine(Mod, "VanillaWhipDamageReduction", "50% damage penalty per enemy pierced"));
					}
				}
				if (item.type == ItemID.ThornWhip)
				{
					if (FindTooltipIndex(tooltips, "Knockback", "Terraria", out int index))
					{
						tooltips.Insert(index + 1, new TooltipLine(Mod, "VanillaWhipDamageReduction", "40% damage penalty per enemy pierced"));
					}
				}
				if (item.type == ModContent.ItemType<VileWhip>())
				{
					if (FindTooltipIndex(tooltips, "Knockback", "Terraria", out int index))
					{
						tooltips.Insert(index + 1, new TooltipLine(Mod, "ModWhipDamageReduction", "30% damage penalty per enemy pierced"));
					}
				}
				if (item.type == ModContent.ItemType<ViciousWhip>())
				{
					if (FindTooltipIndex(tooltips, "Knockback", "Terraria", out int index))
					{
						tooltips.Insert(index + 1, new TooltipLine(Mod, "ModWhipDamageReduction", "30% damage penalty per enemy pierced"));
					}
				}
				if (item.type == ItemID.BoneWhip)
				{
					if (FindTooltipIndex(tooltips, "Knockback", "Terraria", out int index))
					{
						tooltips.Insert(index + 1, new TooltipLine(Mod, "VanillaWhipDamageReduction", "10% damage penalty per enemy pierced"));
					}
				}
				if (item.type == ModContent.ItemType<TailoThreeCats>())
				{
					if (FindTooltipIndex(tooltips, "Knockback", "Terraria", out int index))
					{
						tooltips.Insert(index + 1, new TooltipLine(Mod, "VanillaWhipDamageReduction", "25% damage penalty per enemy pierced"));
					}
				}
				if (item.type == ItemID.FireWhip)
				{
					if (FindTooltipIndex(tooltips, "Knockback", "Terraria", out int index))
					{
						tooltips.Insert(index + 1, new TooltipLine(Mod, "VanillaWhipDamageReduction", "33% damage penalty per enemy pierced"));
					}
				}
				if (item.type == ModContent.ItemType<SulfuricWhip>())
				{
					if (FindTooltipIndex(tooltips, "Knockback", "Terraria", out int index))
					{
						tooltips.Insert(index + 1, new TooltipLine(Mod, "ModWhipDamageReduction", "40% damage penalty per enemy pierced"));
					}
				}
				if (item.type == ItemID.CoolWhip)
				{
					if (FindTooltipIndex(tooltips, "Knockback", "Terraria", out int index))
					{
						tooltips.Insert(index + 1, new TooltipLine(Mod, "VanillaWhipDamageReduction", "30% damage penalty per enemy pierced"));
					}
				}
				if (item.type == ModContent.ItemType<ForbiddenWhip>())
				{
					if (FindTooltipIndex(tooltips, "Knockback", "Terraria", out int index))
					{
						tooltips.Insert(index + 1, new TooltipLine(Mod, "ModWhipDamageReduction", "10% damage penalty per enemy pierced"));
					}
				}
				if (item.type == ItemID.SwordWhip)
				{
					if (FindTooltipIndex(tooltips, "Knockback", "Terraria", out int index))
					{
						tooltips.Insert(index + 1, new TooltipLine(Mod, "VanillaWhipDamageReduction", "20% damage penalty per enemy pierced"));
					}
				}
				if (item.type == ItemID.MaceWhip)
				{
					if (FindTooltipIndex(tooltips, "Knockback", "Terraria", out int index))
					{
						tooltips.Insert(index + 1, new TooltipLine(Mod, "VanillaWhipDamageReduction", "5% damage penalty per enemy pierced"));
					}
				}
				if (item.type == ItemID.ScytheWhip)
				{
					if (FindTooltipIndex(tooltips, "Knockback", "Terraria", out int index))
					{
						tooltips.Insert(index + 1, new TooltipLine(Mod, "VanillaWhipDamageReduction", "10% damage penalty per enemy pierced"));
					}
				}
				if (item.type == ModContent.ItemType<FestiveWhip>())
				{
					if (FindTooltipIndex(tooltips, "Knockback", "Terraria", out int index))
					{
						tooltips.Insert(index + 1, new TooltipLine(Mod, "ModWhipDamageReduction", "20% damage penalty per enemy pierced"));
					}
				}
				if (item.type == ItemID.RainbowWhip)
				{
					if (FindTooltipIndex(tooltips, "Knockback", "Terraria", out int index))
					{
						tooltips.Insert(index + 1, new TooltipLine(Mod, "VanillaWhipDamageReduction", "10% damage penalty per enemy pierced"));
					}
				}
				if (item.type == ModContent.ItemType<SupernovaWhip>())
				{
					if (FindTooltipIndex(tooltips, "Knockback", "Terraria", out int index))
					{
						tooltips.Insert(index + 1, new TooltipLine(Mod, "ModWhipDamageReduction", "5% damage penalty per enemy pierced"));
					}
				}
			}
		}

		/// <summary>
		/// Finds the index of a certain tooltip line.
		/// </summary>
		/// <param name="tooltips">The list of tooltips.</param>
		/// <param name="name">The name of the tooltip to find. See the docs for all of the names.</param>
		/// <param name="mod">Which mod the tooltip line is from. "Terraria" for vanilla.</param>
		/// <param name="index">Out: the index of the tooltip line. 0 if not found.</param>
		/// <returns>True if found.</returns>
		public static bool FindTooltipIndex(List<TooltipLine> tooltips, string name, string mod, out int index, bool silenceWarning = false)
		{
			TooltipLine tooltipLine = tooltips.FirstOrDefault(x => x.Name == name && x.Mod == mod);
			if (tooltipLine != null)
			{
				index = tooltips.IndexOf(tooltipLine);
				return true;
			}
			index = 0;
			if (!silenceWarning)
			{
				ModContent.GetInstance<RijamsMod>().Logger.WarnFormat("Tooltip line {0} from mod {1} not found!", name, mod);
			}
			return false;
		}

		public override string IsArmorSet(Item head, Item body, Item legs)
		{
			ArmorOptions vanillaVanityToArmor = ModContent.GetInstance<RijamsModConfigServer>().VanillaVanityToArmor;

			if (head.type == ItemID.CrimsonHelmet && (body.type == ItemID.CrimsonScalemail || body.type == ModContent.ItemType<Armor.DilapidatedCrimson.DilapidatedCrimsonScalemail>()) && (legs.type == ItemID.CrimsonGreaves || legs.type == ModContent.ItemType<Armor.DilapidatedCrimson.DilapidatedCrimsonGreaves>()))
			{
				return Language.GetTextValue("ArmorSetBonus.Crimson");
			}
			if (head.type == ItemID.PharaohsMask && body.type == ItemID.PharaohsRobe && (vanillaVanityToArmor == ArmorOptions.All || vanillaVanityToArmor == ArmorOptions.VanityOnly))
			{
				return "Pharaoh";
			}
			if (head.type == ItemID.AncientArmorHat && body.type == ItemID.AncientArmorShirt && legs.type == ItemID.AncientArmorPants && (vanillaVanityToArmor == ArmorOptions.All || vanillaVanityToArmor == ArmorOptions.VanityOnly))
			{
				return "Ancient";
			}
			if (head.type == ItemID.StardustHelmet && body.type == ItemID.StardustBreastplate && legs.type == ItemID.StardustLeggings && (vanillaVanityToArmor == ArmorOptions.All || vanillaVanityToArmor == ArmorOptions.ArmorOnly))
			{
				return "Stardust";
			}
			return "";
		}
		public override void UpdateEquip(Item item, Player player)
		{
			ArmorOptions vanillaVanityToArmor = ModContent.GetInstance<RijamsModConfigServer>().VanillaVanityToArmor;

			if (item.type == ItemID.AncientArmorHat && (vanillaVanityToArmor == ArmorOptions.All || vanillaVanityToArmor == ArmorOptions.VanityOnly))
			{
				player.GetCritChance(DamageClass.Melee) += 5;
				player.GetCritChance(DamageClass.Ranged) += 5;
				player.GetCritChance(DamageClass.Magic) += 5;
				player.GetCritChance(DamageClass.Throwing) += 5;
				player.ammoCost80 = true;
			}
			if (item.type == ItemID.AncientArmorShirt && (vanillaVanityToArmor == ArmorOptions.All || vanillaVanityToArmor == ArmorOptions.VanityOnly))
			{
				player.maxMinions += 1;
				player.GetDamage(DamageClass.Generic) *= 1.2f;
				player.GetModPlayer<RijamsModPlayer>().supportMinionRadiusIncrease += 5;
			}
			if (item.type == ItemID.AncientArmorPants && (vanillaVanityToArmor == ArmorOptions.All || vanillaVanityToArmor == ArmorOptions.VanityOnly))
			{
				player.GetAttackSpeed(DamageClass.Melee) *= 1.1f;
				player.manaCost *= 0.9f;
				player.lifeRegen += 2;
			}
			if (item.type == ItemID.BeeGreaves && (vanillaVanityToArmor == ArmorOptions.All || vanillaVanityToArmor == ArmorOptions.ArmorOnly))
			{
				player.maxTurrets++;
			}
		}
		public override void UpdateArmorSet(Player player, string set)
		{
			ArmorOptions vanillaVanityToArmor = ModContent.GetInstance<RijamsModConfigServer>().VanillaVanityToArmor;

			if (set == "Pharaoh" && (vanillaVanityToArmor == ArmorOptions.All || vanillaVanityToArmor == ArmorOptions.VanityOnly))
			{
				player.setBonus = "\n10% reduced mana usage\n+1 Minion capacity\n+10% Whip range\n5% increased movement speed\nGrants Immunity to Mighty Wind";
				player.manaCost -= 0.1f;
				player.maxMinions++;
				player.whipRangeMultiplier += 0.1f;
				player.moveSpeed += 0.05f;
				player.buffImmune[BuffID.WindPushed] = true;
			}
			if (set == "Ancient" && (vanillaVanityToArmor == ArmorOptions.All || vanillaVanityToArmor == ArmorOptions.VanityOnly))
			{
				player.GetModPlayer<RijamsModPlayer>().ancientSet = true;
				player.setBonus = "\nIncreased maximum running speed\nIncreased running acceleration\n+0.5 seconds flight time\n+15% Whip speed\n+20% Whip range\nAllows Shield of Cthulhu style dashing";
				player.dashType = 2; //Shield of Cthulhu dash
				//Set in PostUpdateRunSpeeds() in RijamsModPlayer.cs
				//player.runAcceleration += 0.1f;
				//player.maxRunSpeed += 2;
				player.GetAttackSpeed(DamageClass.SummonMeleeSpeed) += 0.15f;
				player.whipRangeMultiplier += 0.2f;
				player.wingTimeMax += 30;
			}
			if ((player.setStardust || set == "Stardust") && (vanillaVanityToArmor == ArmorOptions.All || vanillaVanityToArmor == ArmorOptions.ArmorOnly))
			{
				player.setBonus = Language.GetTextValue("ArmorSetBonus.Stardust") + "\n+15% Whip speed";
				player.GetAttackSpeed(DamageClass.SummonMeleeSpeed) += 0.15f;
			}
		}
		public override void ArmorSetShadows(Player player, string set)
		{
			ArmorOptions vanillaVanityToArmor = ModContent.GetInstance<RijamsModConfigServer>().VanillaVanityToArmor;

			if (set == "Ancient" && (vanillaVanityToArmor == ArmorOptions.All || vanillaVanityToArmor == ArmorOptions.VanityOnly))
			{
				player.armorEffectDrawShadow = true;
			}
		}
		public override void ModifyItemLoot(Item item, ItemLoot itemLoot)
		{
			if (item.type == ItemID.KingSlimeBossBag)
			{
				itemLoot.Add(ItemDropRule.Common(ModContent.ItemType<Accessories.Misc.MorphasRing>(), 7));
			}
			if (item.type == ItemID.EyeOfCthulhuBossBag)
			{
				itemLoot.Add(ItemDropRule.Common(ModContent.ItemType<BloodyArrow>(), 1, 20, 50));
			}
			if (item.type == ItemID.WoodenCrate || item.type == ItemID.WoodenCrateHard)
			{
				itemLoot.Add(ItemDropRule.Common(ModContent.ItemType<Belt>(), 10));
			}
			if (item.type == ItemID.LockBox)
			{
				itemLoot.Add(ItemDropRule.Common(ModContent.ItemType<Weapons.Summon.Cudgels.CobaltProtectorCudgel>(), 7));
				itemLoot.Add(ItemDropRule.Common(ModContent.ItemType<Weapons.Other.StumbleCard>(), 10));
			}
			if (item.type == ItemID.ObsidianLockbox)
			{
				itemLoot.Add(ItemDropRule.Common(ModContent.ItemType<Weapons.Other.StumbleCard>(), 7));
			}
			if (item.type == ItemID.QueenSlimeBossBag)
			{
				itemLoot.Add(ItemDropRule.Common(ModContent.ItemType<Weapons.Summon.Cudgels.CrystalClusterCudgel>(), 4));
			}
			if (item.type == ItemID.DeerclopsBossBag)
			{
				itemLoot.Add(ItemDropRule.Common(ModContent.ItemType<Pets.StarCallerStaff>(), 4));
				itemLoot.Add(ItemDropRule.Common(ModContent.ItemType<Weapons.Summon.Cudgels.SanityFlowerCudgel> (), 4));
				itemLoot.Add(ItemDropRule.Common(ModContent.ItemType<Weapons.Summon.Whips.TailoThreeCats> (), 4));
			}
			if (item.type == ItemID.FairyQueenBossBag)
			{
				itemLoot.Add(ItemDropRule.Common(ModContent.ItemType<Weapons.Summon.Cudgels.RadiantLanternCudgel>(), 4));
				itemLoot.Add(ItemDropRule.Common(ModContent.ItemType<Weapons.Melee.JoustingLances.EtherealJoustingLance>(), 4));
			}
		}
	}
}