Files
CalamityModPublic/Projectiles/Rogue/DuststormCloud.cs
T
Altixal 34359e3d03 balancing 3
- kelvin sounds now play at the center of the projectile
- fixed a bug where stealth strike kelvin loses updates
- terror talons ACTUALLY uses its intended recipe, on god.
2023-02-19 19:26:46 -05:00

68 lines
2.0 KiB
C#

using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Rogue
{
public class DuststormCloud : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Dust Cloud");
Main.projFrames[Projectile.type] = 4;
}
public override void SetDefaults()
{
Projectile.width = 38;
Projectile.height = 14;
Projectile.friendly = true;
Projectile.alpha = 255;
Projectile.penetrate = -1;
Projectile.tileCollide = false;
Projectile.ignoreWater = true;
Projectile.timeLeft = 600;
Projectile.DamageType = RogueDamageClass.Instance;
Projectile.usesIDStaticNPCImmunity = true;
Projectile.idStaticNPCHitCooldown = 6;
}
public override void AI()
{
Projectile.frameCounter++;
if (Projectile.frameCounter > 6)
{
Projectile.frame++;
Projectile.frameCounter = 0;
}
if (Projectile.frame >= Main.projFrames[Projectile.type])
{
Projectile.frame = 0;
}
Projectile.velocity *= 0.995f;
Projectile.ai[1] += 1f;
if (Projectile.ai[1] >= 120f)
{
if (Projectile.alpha < 255)
{
Projectile.alpha += 5;
if (Projectile.alpha > 255)
{
Projectile.alpha = 255;
}
}
else if (Projectile.owner == Main.myPlayer)
{
Projectile.Kill();
}
}
else if (Projectile.alpha > 80)
{
Projectile.alpha -= 30;
if (Projectile.alpha < 80)
{
Projectile.alpha = 80;
}
}
}
}
}