using Decimation.Content.Buffs.Debuffs;
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
{
    public class GreaterAntidote : DecimationItem
    {
        protected override string ItemName => "Greater Antidote";
        protected override string ItemTooltip => "Cures poison, venom, confusion and avian flu";

        protected override void Init()
        {
            item.CloneDefaults(ModContent.ItemType<Antidote>());

            item.width = 24;
            item.height = 26;
            item.rare = Rarity.Orange.GetRarityValue();
        }

        public override bool UseItem(Player player)
        {
            player.ClearBuff(BuffID.Poisoned);
            player.ClearBuff(BuffID.Venom);
            player.ClearBuff(BuffID.Confused);
            player.ClearBuff(ModContent.BuffType<AvianFlu>());

            return true;
        }

        protected override ModRecipe GetRecipe()
        {
            return new RecipeBuilder(this, 5)
                .WithIngredient(ModContent.ItemType<Antidote>())
                .WithIngredient(ItemID.ManaPotion)
                .WithIngredient(ItemID.GreaterHealingPotion)
                .WithIngredient(ModContent.ItemType<EnchantedMushroom>(), 5)
                .WithStation(TileID.AlchemyTable)
                .Build();
        }
    }
}