using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { public class CelestusMiniScythe : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; public override void SetStaticDefaults() { 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.ignoreWater = true; Projectile.penetrate = -1; Projectile.extraUpdates = 4; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 40; Projectile.timeLeft = 85; Projectile.DamageType = RogueDamageClass.Instance; } 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, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 180); } public override void OnHitPlayer(Player target, Player.HurtInfo info) { target.AddBuff(ModContent.BuffType(), 180); } public override bool PreDraw(ref Color lightColor) { CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1); return false; } } }