Files
CalamityModPublic/Projectiles/Melee/MourningstarFlail.cs
T

41 lines
1.6 KiB
C#

using CalamityMod.Projectiles.BaseProjectiles;
using CalamityMod.Projectiles.Typeless;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee
{
public class MourningstarFlail : BaseFlailProjectile, 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 = 7;
Projectile.extraUpdates = 1;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.Daybreak, 180);
if (Projectile.localAI[1] <= 0f && Projectile.owner == Main.myPlayer)
{
int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType<FuckYou>(), Projectile.damage, hit.Knockback, Projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f);
Main.projectile[proj].usesLocalNPCImmunity = false;
Main.projectile[proj].usesIDStaticNPCImmunity = true;
Main.projectile[proj].idStaticNPCHitCooldown = 60;
}
Projectile.localAI[1] = 16f;
}
}
}