using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { public class ShatteredExplosion : ModProjectile { public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; bool dust = true; public override void SetStaticDefaults() { DisplayName.SetDefault("Explosion"); } public override void SetDefaults() { projectile.width = 150; projectile.height = 150; projectile.friendly = true; projectile.ignoreWater = true; projectile.tileCollide = false; projectile.penetrate = -1; projectile.timeLeft = 15; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 5; projectile.Calamity().rogue = true; } public override void AI() { if (projectile.ai[0] == 1f) { projectile.ai[0] = 0f; dust = false; } projectile.localAI[0] += 1f; if (dust && projectile.localAI[0] > 4f) { for (int i = 0; i < 5; i++) { int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 246, 0f, 0f, 100, default, 1.5f); Main.dust[num469].noGravity = true; Main.dust[num469].velocity *= 0f; } } } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 180); } public override void OnHitPvp(Player target, int damage, bool crit) { target.AddBuff(ModContent.BuffType(), 180); } } }