47 lines
1.4 KiB
C#
47 lines
1.4 KiB
C#
using CalamityMod.Buffs.DamageOverTime;
|
|
using CalamityMod.Buffs.StatDebuffs;
|
|
using Terraria;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Projectiles.Rogue
|
|
{
|
|
public class AbyssalMirrorProjectile : ModProjectile, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Projectiles.Rogue";
|
|
public override void SetStaticDefaults()
|
|
{
|
|
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.DamageType = RogueDamageClass.Instance;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
if (Projectile.timeLeft < 25)
|
|
Projectile.alpha += 10;
|
|
}
|
|
|
|
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
|
{
|
|
if (!target.friendly)
|
|
{
|
|
target.AddBuff(ModContent.BuffType<Eutrophication>(), 120);
|
|
target.AddBuff(ModContent.BuffType<CrushDepth>(), 180);
|
|
}
|
|
}
|
|
}
|
|
}
|