Note: Does not include item rarities, and appears to shown nonexistant using directive movement in the commit. This does not really affect anything, however.
48 lines
1.6 KiB
C#
48 lines
1.6 KiB
C#
using CalamityMod.Buffs.StatDebuffs;
|
|
using CalamityMod.Dusts;
|
|
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ModLoader;
|
|
namespace CalamityMod.Projectiles.Enemy
|
|
{
|
|
public class TrilobiteSpike : ModProjectile
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Spike");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
projectile.width = 10;
|
|
projectile.height = 10;
|
|
projectile.hostile = true;
|
|
projectile.timeLeft = 600;
|
|
projectile.tileCollide = true;
|
|
projectile.ignoreWater = false;
|
|
}
|
|
public override void AI()
|
|
{
|
|
if (projectile.velocity.Y < 10f)
|
|
projectile.velocity.Y += 0.25f;
|
|
projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2;
|
|
}
|
|
public override void OnHitPlayer(Player target, int damage, bool crit)
|
|
{
|
|
target.AddBuff(ModContent.BuffType<Irradiated>(), 120);
|
|
}
|
|
public override void Kill(int timeLeft)
|
|
{
|
|
for (int i = 0; i <= 2; i++)
|
|
{
|
|
int idx = Dust.NewDust(projectile.position, 8, 8, (int)CalamityDusts.SulfurousSeaAcid, 0, 0, 0, default, 0.75f);
|
|
Main.dust[idx].noGravity = true;
|
|
Main.dust[idx].velocity *= 3f;
|
|
idx = Dust.NewDust(projectile.position, 8, 8, (int)CalamityDusts.SulfurousSeaAcid, 0, 0, 0, default, 0.75f);
|
|
Main.dust[idx].noGravity = true;
|
|
Main.dust[idx].velocity *= 3f;
|
|
}
|
|
}
|
|
}
|
|
}
|