Files
CalamityModPublic/Projectiles/Rogue/Valaricicle2.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

44 lines
1.4 KiB
C#

using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Rogue
{
public class Valaricicle2 : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Rogue";
public override void SetDefaults()
{
Projectile.width = 10;
Projectile.height = 10;
Projectile.friendly = true;
Projectile.DamageType = RogueDamageClass.Instance;
Projectile.penetrate = 1;
Projectile.timeLeft = 180;
Projectile.aiStyle = ProjAIStyleID.Arrow;
Projectile.coldDamage = true;
}
public override bool? CanHitNPC(NPC target) => Projectile.timeLeft < 150 && target.CanBeChasedBy(Projectile);
public override void AI()
{
Projectile.velocity.X *= 0.9995f;
Projectile.velocity.Y += 0.01f;
if (Projectile.timeLeft < 150)
CalamityUtils.HomeInOnNPC(Projectile, true, 600f, 8f, 20f);
}
public override void OnKill(int timeLeft)
{
SoundEngine.PlaySound(SoundID.Item27, Projectile.position);
for (int k = 0; k < 5; k++)
{
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.IceRod, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f);
}
}
}
}