using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Graphics.Metaballs; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Typeless { public class StandingFire : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Typeless"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public override void SetDefaults() { Projectile.width = 8; Projectile.height = 8; Projectile.friendly = true; Projectile.penetrate = 1; Projectile.timeLeft = 240; Projectile.usesIDStaticNPCImmunity = true; Projectile.idStaticNPCHitCooldown = 7; Projectile.MaxUpdates = 4; Projectile.tileCollide = false; } public override void AI() { CalamityUtils.HomeInOnNPC(Projectile, false, 300, 5.5f, 10f, true); if (Projectile.Calamity().HomingTarget < 0) { Projectile.velocity.Y += 0.025f; } if (Projectile.ai[1] == 0f && Projectile.type >= ProjectileID.GreekFire1 && Projectile.type <= ProjectileID.GreekFire3) { Projectile.ai[1] = 1f; SoundEngine.PlaySound(SoundID.Item13, Projectile.position); } CalamitasMetaball.SpawnParticle(Projectile.Center + Projectile.velocity, Main.rand.NextVector2Circular(2, 2), 16f); if (Projectile.velocity.Y > 16f) { Projectile.velocity.Y = 16f; } } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 300); public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 300); } }