Files
CalamityModPublic/Projectiles/Rogue/BrickFragment.cs
T
tomat 67bceff6e7 Initial dotnet format pass.
This commit formats the entire codebase according to `dotnet format` and its limited understanding of our provided `.editorconfig`.
2024-02-28 21:49:50 -08:00

45 lines
1.4 KiB
C#

using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
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, DustID.Copper, -Projectile.velocity.X * 0.15f, -Projectile.velocity.Y * 0.10f, 150, default, 0.9f);
splash += 1;
}
}
}
}