49 lines
1.5 KiB
C#
49 lines
1.5 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
namespace CalamityMod.Projectiles.Summon
|
|
{
|
|
public class BelladonnaPetal : ModProjectile
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Bullet");
|
|
ProjectileID.Sets.MinionShot[projectile.type] = true;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
projectile.width = 10;
|
|
projectile.height = 12;
|
|
projectile.friendly = true;
|
|
projectile.minion = true;
|
|
projectile.minionSlots = 0f;
|
|
projectile.ignoreWater = true;
|
|
projectile.penetrate = 1;
|
|
projectile.timeLeft = 360;
|
|
}
|
|
public override void AI()
|
|
{
|
|
projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2;
|
|
projectile.velocity.X *= 0.99f;
|
|
if (projectile.velocity.Y < 9f)
|
|
projectile.velocity.Y += 0.085f;
|
|
projectile.tileCollide = projectile.timeLeft <= 180;
|
|
}
|
|
public override void Kill(int timeLeft)
|
|
{
|
|
for (int i = 0; i < 5; i++)
|
|
{
|
|
Dust dust = Dust.NewDustPerfect(projectile.Center, DustID.Grass);
|
|
dust.velocity = Main.rand.NextVector2Circular(2f, 2f) ;
|
|
dust.noGravity = true;
|
|
}
|
|
}
|
|
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
|
{
|
|
target.AddBuff(BuffID.Poisoned, 240);
|
|
}
|
|
}
|
|
}
|