using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { public class AccretionDisk2Melee : ModProjectile { public override void SetStaticDefaults() { DisplayName.SetDefault("Accretion Disk"); ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; ProjectileID.Sets.TrailingMode[projectile.type] = 1; } public override void SetDefaults() { projectile.width = 56; projectile.height = 56; projectile.alpha = 120; projectile.friendly = true; projectile.melee = true; projectile.tileCollide = false; projectile.penetrate = -1; projectile.aiStyle = 3; projectile.timeLeft = 60; aiType = 52; } public override void AI() { if (Main.rand.NextBool(2)) { int num250 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 66, (float)(projectile.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 0.5f); Main.dust[num250].noGravity = true; Main.dust[num250].velocity *= 0f; } Lighting.AddLight(projectile.Center, 0.15f, 1f, 0.25f); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); return false; } } }