Files
CalamityModPublic/Projectiles/Boss/OldDukeToothBallSpike.cs
T
mountaindrew10 1cc2c68b69 1 - Added gores for Old Duke Tooth Balls and Sulphurous Sharkrons.
2 - Improved Aureus Spawns.
3 - Improved Old Duke Tooth Balls.
4 - Improved Old Duke Sulphurous Sharkrons.
5 - Improved Astrum Aureus.
6 - Old Duke and all his attacks now emit light if they didn't before.
7 - New sprite for Old Duke Tooth Ball spike projectiles.
2023-01-15 01:22:15 -06:00

67 lines
2.3 KiB
C#

using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Boss
{
public class OldDukeToothBallSpike : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Spike");
}
public override void SetDefaults()
{
Projectile.width = 10;
Projectile.height = 10;
Projectile.hostile = true;
Projectile.timeLeft = 600;
Projectile.ignoreWater = true;
CooldownSlot = ImmunityCooldownID.Bosses;
}
public override void AI()
{
Lighting.AddLight((int)((Projectile.position.X + (Projectile.width / 2)) / 16f), (int)((Projectile.position.Y + (Projectile.height / 2)) / 16f), 0.45f, 0.35f, 0f);
float finalVelocity = new Vector2(Projectile.ai[0], Projectile.ai[1]).Length();
if (Projectile.velocity.Length() < finalVelocity)
Projectile.velocity *= 1.025f;
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
for (int i = 0; i < 2; i++)
{
int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, (int)CalamityDusts.SulfurousSeaAcid, 0, 0, 0, default, 0.6f);
Main.dust[dust].noGravity = true;
Main.dust[dust].velocity *= 0.3f;
}
}
public override void OnHitPlayer(Player target, int damage, bool crit)
{
if (damage <= 0)
return;
target.AddBuff(ModContent.BuffType<Irradiated>(), 120);
}
public override void Kill(int timeLeft)
{
for (int i = 0; i <= 2; i++)
{
int idx = Dust.NewDust(Projectile.position, 8, 8, (int)CalamityDusts.SulfurousSeaAcid, 0, 0, 0, default, 0.75f);
Main.dust[idx].noGravity = true;
Main.dust[idx].velocity *= 3f;
idx = Dust.NewDust(Projectile.position, 8, 8, (int)CalamityDusts.SulfurousSeaAcid, 0, 0, 0, default, 0.75f);
Main.dust[idx].noGravity = true;
Main.dust[idx].velocity *= 3f;
}
}
}
}