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.Rogue { public class Celestus2 : ModProjectile { public override void SetStaticDefaults() { DisplayName.SetDefault("Celestus"); ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; ProjectileID.Sets.TrailingMode[projectile.type] = 0; } public override void SetDefaults() { projectile.width = 48; projectile.height = 48; projectile.friendly = true; projectile.tileCollide = false; projectile.penetrate = -1; projectile.extraUpdates = 4; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 40; projectile.timeLeft = 85; projectile.Calamity().rogue = true; } public override void AI() { projectile.rotation += 2f; projectile.velocity.X *= 1.02f; projectile.velocity.Y *= 1.02f; Lighting.AddLight(projectile.Center, Main.DiscoR * 0.5f / 255f, Main.DiscoG * 0.5f / 255f, Main.DiscoB * 0.5f / 255f); } public override Color? GetAlpha(Color lightColor) { if (projectile.timeLeft < 85) { byte b2 = (byte)(projectile.timeLeft * 3); byte a2 = (byte)(100f * ((float)b2 / 255f)); return new Color((int)b2, (int)b2, (int)b2, (int)a2); } return new Color(255, 255, 255, 100); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 30); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(BuffID.CursedInferno, 120); target.AddBuff(BuffID.Frostburn, 120); target.AddBuff(BuffID.OnFire, 120); target.AddBuff(BuffID.Ichor, 120); } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); return false; } } }