using System.Collections.Generic;
using Decimation.Lib.Items;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Decimation.Content.Items.Accessories
{
    internal class JestersQuiver : DecimationAccessory
    {
        protected override string ItemName => "Jester's Quiver";

        protected override string ItemTooltip =>
            "Turns wooden arrows into jesters arrows \n+15% Ranged Damage \n-20% Ammo Cost \n+5% Ranged Critical Chance";

        protected override void InitAccessory()
        {
            item.width = 20;
            item.height = 20;
        }

        public override void UpdateAccessory(Player player, bool hideVisual)
        {
            player.rangedDamage += 0.15f;
            player.ammoCost80 = true;
            player.rangedCrit += 5;
        }

        protected override List<ModRecipe> GetRecipes()
        {
            ModRecipe recipe = GetNewModRecipe(this, 1, new List<int> {TileID.TinkerersWorkbench});

            recipe.AddIngredient(ModContent.ItemType<RangersQuiver>());
            recipe.AddIngredient(ModContent.ItemType<RangersPouch>());
            recipe.AddIngredient(ItemID.SoulofSight, 25);
            recipe.AddIngredient(ItemID.SoulofFright, 5);
            recipe.AddIngredient(ItemID.FallenStar, 15);

            return new List<ModRecipe> {recipe};
        }
    }
}