45 lines
1.3 KiB
C#
45 lines
1.3 KiB
C#
using CalamityMod.Buffs.StatDebuffs;
|
|
using CalamityMod.CalPlayer;
|
|
using Terraria;
|
|
using Terraria.ModLoader;
|
|
namespace CalamityMod.Projectiles.Rogue
|
|
{
|
|
public class AbyssalMirrorProjectile : ModProjectile
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Lumenyl Fluid");
|
|
Main.projFrames[projectile.type] = 3;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
projectile.width = 12;
|
|
projectile.height = 14;
|
|
projectile.friendly = true;
|
|
projectile.alpha = 0;
|
|
projectile.penetrate = -1;
|
|
projectile.tileCollide = true;
|
|
projectile.ignoreWater = true;
|
|
projectile.timeLeft = 50;
|
|
projectile.usesLocalNPCImmunity = true;
|
|
projectile.localNPCHitCooldown = -1;
|
|
projectile.Calamity().rogue = true;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
if (projectile.timeLeft < 25)
|
|
{ projectile.alpha += 10; }
|
|
}
|
|
|
|
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
|
{
|
|
if (!target.friendly && target.rarity != 2 && !CalamityPlayer.areThereAnyDamnBosses)
|
|
{
|
|
target.AddBuff(ModContent.BuffType<SilvaStun>(), 300);
|
|
}
|
|
}
|
|
}
|
|
}
|