using CalamityMod.Projectiles.BaseProjectiles; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { public class MourningstarFlail : BaseWhipProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Melee"; public override void SetDefaults() { Projectile.width = 16; Projectile.height = 16; Projectile.friendly = true; Projectile.alpha = 255; Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.DamageType = DamageClass.MeleeNoSpeed; Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 4; Projectile.extraUpdates = 1; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(BuffID.Daybreak, 180); // Note: This is being left as the solar explosion projectile for now, since the weapon is in a good balancing position right now. // If it is to be rebalanced, consider replacing it with the FuckYou projectile (which does not mess with I-frames) if (Projectile.localAI[1] <= 0f && Projectile.owner == Main.myPlayer) { int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center.X, target.Center.Y, 0f, 0f, ProjectileID.SolarWhipSwordExplosion, Projectile.damage, hit.Knockback, Projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); Main.projectile[proj].usesLocalNPCImmunity = true; Main.projectile[proj].localNPCHitCooldown = 4; } Projectile.localAI[1] = 4f; } } }