Profaned Soul Crystal's anti-whip-stack only works on vanilla whips at the moment.
45 lines
1.3 KiB
C#
45 lines
1.3 KiB
C#
using Terraria;
|
|
using Terraria.ModLoader;
|
|
using Terraria.ID;
|
|
using Terraria.Audio;
|
|
|
|
namespace CalamityMod.Projectiles.Rogue
|
|
{
|
|
public class BrickFragment : ModProjectile, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Projectiles.Rogue";
|
|
public override void SetStaticDefaults()
|
|
{
|
|
}
|
|
public override void SetDefaults()
|
|
{
|
|
Projectile.friendly = true;
|
|
Projectile.width = 16;
|
|
Projectile.height = 16;
|
|
Projectile.DamageType = RogueDamageClass.Instance;
|
|
}
|
|
public override void AI()
|
|
{
|
|
//Rotation and gravity
|
|
Projectile.rotation += 0.6f * Projectile.direction;
|
|
Projectile.velocity.Y = Projectile.velocity.Y + 0.27f;
|
|
if (Projectile.velocity.Y > 16f)
|
|
{
|
|
Projectile.velocity.Y = 16f;
|
|
}
|
|
|
|
}
|
|
public override void OnKill(int timeLeft)
|
|
{
|
|
SoundEngine.PlaySound(SoundID.Dig, Projectile.position);
|
|
//Dust effect
|
|
int splash = 0;
|
|
while (splash < 4)
|
|
{
|
|
Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 9, -Projectile.velocity.X * 0.15f, -Projectile.velocity.Y * 0.10f, 150, default, 0.9f);
|
|
splash += 1;
|
|
}
|
|
}
|
|
}
|
|
}
|