using Decimation.Content.Buffs.Debuffs;
using Decimation.Content.Items.Ores;
using Decimation.Content.Tiles;
using Decimation.Lib.Items;
using Decimation.Lib.Util;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Decimation.Content.Items.Weapons
{
    internal class TitanicLongsword : DecimationWeapon
    {
        protected override string ItemName => "Titanic Longsword";
        protected override int Damages => 145;

        protected override void InitWeapon()
        {
            item.useTime = 21;
            item.useAnimation = 21;
            item.crit = 14;
            item.knockBack = 7;
            this.item.value = Item.buyPrice(gold: 45);
            item.rare = Rarity.LightPurple.GetRarityValue();
            item.width = 84;
            item.height = 84;
            item.autoReuse = true;
        }

        public override void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool criticalStrikeChance)
        {
            target.AddBuff(ModContent.BuffType<Amnesia>(), 480);
        }

        protected override ModRecipe GetRecipe()
        {
            ModRecipe recipe = GetNewModRecipe(this, 1, ModContent.TileType<TitanForge>());

            recipe.AddIngredient(ModContent.ItemType<TitaniteBar>(), 12);
            recipe.AddIngredient(ItemID.SoulofMight, 15);

            return recipe;
        }
    }
}