Files
CalamityModPublic/Projectiles/Rogue/SkyBomberGas.cs
T

50 lines
1.6 KiB
C#

using Terraria;
using Terraria.ModLoader;
using CalamityMod.Dusts;
using CalamityMod.Buffs.StatDebuffs;
namespace CalamityMod.Projectiles.Rogue
{
public class SkyBomberGas : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Rogue";
public override void SetDefaults()
{
Projectile.width = 32;
Projectile.height = 28;
Projectile.friendly = true;
Projectile.alpha = 0;
Projectile.penetrate = -1;
Projectile.tileCollide = false;
Projectile.ignoreWater = true;
Projectile.timeLeft = 100;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 10;
Projectile.DamageType = RogueDamageClass.Instance;
}
public override void AI()
{
if (Projectile.timeLeft < 50)
Projectile.alpha += 5;
if (Projectile.timeLeft < 75)
{
Projectile.velocity *= 0.95f;
Projectile.scale += 0.002f;
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType<Irradiated>(), 120);
public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType<Irradiated>(), 120);
public override void Kill(int timeLeft)
{
for (int i = 0; i < 8; i++)
{
Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.SulfurousSeaAcid);
}
}
}
}