using Decimation.Lib.Items;
using Decimation.Lib.Util;
using Decimation.Lib.Util.Builder;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Decimation.Content.Items.Potions
{
    // Not an actual potion, since it doesn't give the player any buff.
    internal class Antidote : DecimationItem
    {
        protected override string ItemName => "Antidote";
        protected override string ItemTooltip => "Cures poison and venom.";

        protected override void Init()
        {
            item.width = 20;
            item.height = 26;
            item.maxStack = 30;
            item.consumable = true;
            item.useAnimation = 17;
            item.useTime = 17;
            item.useTurn = true;
            item.useStyle = 2;
            item.rare = Rarity.Blue.GetRarityValue();
        }

        public override bool UseItem(Player player)
        {
            player.ClearBuff(BuffID.Poisoned);
            player.ClearBuff(BuffID.Venom);
            return true;
        }

        protected override ModRecipe GetRecipe()
        {
            return new RecipeBuilder(this)
                .WithIngredient(ItemID.Waterleaf)
                .WithIngredient(ItemID.Moonglow)
                .WithIngredient(ItemID.BottledHoney)
                .WithStation(TileID.AlchemyTable)
                .Build();
        }
    }
}