using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Decimation.Content.Projectiles
{

    internal class Stinger : DecimationProjectile
    {
        protected override void Init()
        {
            projectile.width = 10;
            projectile.height = 18;
            projectile.tileCollide = true;
            projectile.penetrate = 2;
            projectile.timeLeft = 200;
            projectile.extraUpdates = 1;
            projectile.ignoreWater = false;
        }
        public override void AI()           //this make that the projectile will face the corect way
        {                                                           // |
            projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;

        }
        public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
        {
            if (Main.rand.Next(2) == 0)
            {
                target.AddBuff(BuffID.Poisoned, 100);
            }
        }

    }
}