using System;
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
using Decimation.Content.Buffs.Buffs;
using Decimation.Content.Buffs.Debuffs;
using Microsoft.Xna.Framework;

namespace Decimation.Content.Projectiles
{
   internal class Ember : DecimationProjectile
    {
        public override string Texture => "Terraria/Projectile_" + ProjectileID.Flames;

        protected override void Init()
        {
            projectile.width = 20;
            projectile.height = 20;
            projectile.aiStyle = -1;
            projectile.alpha = 255;
            projectile.penetrate = 1;
            projectile.light = 0.8f;
            Damages = 25;
            projectile.timeLeft = 60;
            projectile.tileCollide = false;
            projectile.ignoreWater = true;
        }

        public override void AI()
        {
            Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0, 0, 0, new Microsoft.Xna.Framework.Color(240, 94, 27));
        }

        public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
        {
            target.AddBuff(ModContent.BuffType<Slimed>(), 300);
        }

        public override void OnHitPlayer(Player target, int damage, bool crit)
        {
            target.AddBuff(ModContent.BuffType<Slimed>(), 300);
        }

        public override void OnHitPvp(Player target, int damage, bool crit)
        {
            target.AddBuff(ModContent.BuffType<Slimed>(), 300);
        }
    }
}
