Files
CalamityModPublic/Projectiles/Summon/ApparatusExplosion.cs
T
2024-10-15 23:48:00 +07:00

44 lines
1.2 KiB
C#

using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Summon
{
public class ApparatusExplosion : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Summon";
public override void SetStaticDefaults()
{
ProjectileID.Sets.MinionShot[Type] = true;
Main.projFrames[Type] = 10;
}
public override void SetDefaults()
{
Projectile.width = 42;
Projectile.height = 44;
Projectile.friendly = true;
Projectile.penetrate = -1;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 20;
Projectile.DamageType = DamageClass.Summon;
}
public override void AI()
{
// Bluish cyan light
Lighting.AddLight(Projectile.Center, 0.1f, 0.5f, 1f);
Projectile.frameCounter++;
if (Projectile.frameCounter >= 6)
{
Projectile.frame++;
Projectile.frameCounter = 0;
}
if (Projectile.frame >= Main.projFrames[Type])
{
Projectile.Kill();
}
}
}
}