Decimation_Mod/Content/Projectiles/Item/Weapon/Stinger.cs
FyloZ 0cf76d5270 Organized projectiles.
Updated The Mind trinity item.
2020-07-14 22:31:26 -04:00

37 lines
1.1 KiB
C#

using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Decimation.Content.Projectiles.Item.Weapon
{
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(Terraria.NPC target, int damage, float knockback, bool crit)
{
if (Main.rand.Next(2) == 0)
{
target.AddBuff(BuffID.Poisoned, 100);
}
}
}
}