41 lines
1.3 KiB
C#
41 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.minion = 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 Kill(int timeLeft)
|
|
{
|
|
for (int k = 0; k < 5; k++)
|
|
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 7, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f);
|
|
}
|
|
}
|
|
}
|