2 - Changed Ballistic Poison Bomb's stealth strike 3 - Reverted the buff to free Golem Head's health because it honestly didn't need it. This is a conclusion I've reached over testing a bunch of weapons at this tier, so it was not done hastily. 4 - Moved Chlorophyte Bullet dust IL edit (grrrrr Altix)
70 lines
2.3 KiB
C#
70 lines
2.3 KiB
C#
using System;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Projectiles.Rogue
|
|
{
|
|
public class BallisticPoisonCloud : ModProjectile, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Projectiles.Typeless";
|
|
public override void SetStaticDefaults()
|
|
{
|
|
Main.projFrames[Projectile.type] = 10;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Projectile.width = 34;
|
|
Projectile.height = 34;
|
|
Projectile.friendly = true;
|
|
Projectile.alpha = 255;
|
|
Projectile.penetrate = -1;
|
|
Projectile.tileCollide = false;
|
|
Projectile.ignoreWater = true;
|
|
Projectile.timeLeft = 600;
|
|
Projectile.usesIDStaticNPCImmunity = true;
|
|
Projectile.idStaticNPCHitCooldown = 10;
|
|
}
|
|
|
|
public override void AI()
|
|
{
|
|
Projectile.ai[0] += 1f;
|
|
Projectile.frameCounter++;
|
|
if (Projectile.frameCounter > 6)
|
|
{
|
|
Projectile.frame++;
|
|
Projectile.frameCounter = 0;
|
|
}
|
|
if (Projectile.ai[0] < 219f) //255 - frameCounter tick * number of disippation frames
|
|
{
|
|
if (Projectile.frame >= 4)
|
|
{
|
|
Projectile.frame = 0;
|
|
}
|
|
}
|
|
else if (Projectile.owner == Main.myPlayer && Projectile.frame >= Main.projFrames[Projectile.type])
|
|
{
|
|
Projectile.Kill();
|
|
}
|
|
Projectile.velocity *= 0.98f;
|
|
if (Projectile.alpha > 80)
|
|
{
|
|
Projectile.alpha -= 30;
|
|
if (Projectile.alpha < 80)
|
|
{
|
|
Projectile.alpha = 80;
|
|
}
|
|
}
|
|
if (Math.Abs(Projectile.velocity.X) > 0.1f)
|
|
{
|
|
Projectile.spriteDirection = -Projectile.direction;
|
|
}
|
|
}
|
|
|
|
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Venom, Projectile.ai[1] == 1f ? 240 : 120);
|
|
|
|
public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Venom, Projectile.ai[1] == 1f ? 240 : 120);
|
|
}
|
|
}
|