Files
CalamityModPublic/Projectiles/Summon/SquirrelSquireAcorn.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

40 lines
1.3 KiB
C#

using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Summon
{
public class SquirrelSquireAcorn : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Summon";
public const float Gravity = 0.5f;
public override void SetStaticDefaults()
{
ProjectileID.Sets.SentryShot[Projectile.type] = true;
}
public override void SetDefaults()
{
Projectile.width = 10;
Projectile.height = 16;
Projectile.friendly = true;
Projectile.penetrate = 2;
Projectile.timeLeft = 180;
Projectile.MaxUpdates = 2;
Projectile.DamageType = DamageClass.Summon;
}
public override void AI()
{
Projectile.velocity.Y += Gravity;
Projectile.rotation += (Projectile.velocity.X > 0f).ToDirectionInt() * 0.3f;
}
public override void OnKill(int timeLeft)
{
for (int k = 0; k < 5; k++)
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.WoodFurniture, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f);
}
}
}