using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Enemy { public class NuclearToadGoo : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Enemy"; public override void SetStaticDefaults() { Main.projFrames[Projectile.type] = 3; } public override void SetDefaults() { Projectile.width = 18; Projectile.height = 18; Projectile.hostile = true; Projectile.timeLeft = 600; Projectile.tileCollide = true; Projectile.ignoreWater = false; } public override void AI() { if (Projectile.localAI[0] == 0f) { Projectile.frame = Main.rand.Next(3); Projectile.localAI[0] = 1f; } if (Projectile.velocity.Y < 10f) Projectile.velocity.Y += 0.27f; } public override void OnHitPlayer(Player target, Player.HurtInfo info) { if (info.Damage <= 0) return; target.AddBuff(ModContent.BuffType(), 120); } public override void Kill(int timeLeft) { for (int i = 0; i <= 4; i++) { int idx = Dust.NewDust(Projectile.position, 8, 8, (int)CalamityDusts.SulfurousSeaAcid, 0, 0, 0, default, 0.75f); Main.dust[idx].noGravity = true; Main.dust[idx].velocity *= 3f; idx = Dust.NewDust(Projectile.position, 8, 8, (int)CalamityDusts.SulfurousSeaAcid, 0, 0, 0, default, 0.75f); Main.dust[idx].noGravity = true; Main.dust[idx].velocity *= 3f; } } } }