using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Ranged { public class DrizzlefishFireball : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Ranged"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public override void SetDefaults() { Projectile.width = 10; Projectile.height = 10; Projectile.friendly = true; Projectile.DamageType = DamageClass.Ranged; Projectile.penetrate = 5; Projectile.aiStyle = ProjAIStyleID.GroundProjectile; Projectile.timeLeft = 300; Projectile.usesIDStaticNPCImmunity = true; Projectile.idStaticNPCHitCooldown = 10; } public override void AI() { Lighting.AddLight(Projectile.Center, 0.25f, 0f, 0f); int dustType = 235; if (Projectile.ai[1] == 1f) { if (Main.rand.NextBool(2)) { dustType = 35; } else { dustType = 55; } } else { dustType = 235; } Projectile.localAI[0] += 1f; if (Projectile.localAI[0] > 4f) { for (int num468 = 0; num468 < 5; num468++) { int num469 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } } } public override bool OnTileCollide(Vector2 oldVelocity) { Projectile.velocity *= 0.98f; return false; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { if (Projectile.ai[1] == 1f) { target.AddBuff(BuffID.OnFire, 180); } else { target.AddBuff(ModContent.BuffType(), 60); } } } }