1 - Revamp to free head movement

2 - Free head is once again immune to damage
3 - Gave free head the laser spread attack, which is followed by shooting lingering fire bolts
4 - Free head no longer passively fires fireballs, increased laser fire rate a bit
5 - Free head lasers no longer have differing speeds in Death Mode
6 - Removed body lasers after the head detaches

Fire bolt visuals are unfinished
This commit is contained in:
CongratsIsTrash committed 2025-07-11 21:55:22 -04:00
1 parent e020e409fe
commit 6d2dff85ba
10 files changed
+340 -441

No files matched your search

+56
View File
@@ -0,0 +1,56 @@
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Boss
{
public class GolemInfernoBlast : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Boss";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
private const int Lifetime = 900;
private const float Radius = 200f;
public override void SetDefaults()
{
Projectile.width = Projectile.height = 170; // Doesn't matter because circular hitbox
Projectile.hostile = true;
Projectile.tileCollide = false;
Projectile.ignoreWater = true;
Projectile.timeLeft = Lifetime;
Projectile.Calamity().DealsDefenseDamage = true;
}
public override void AI()
{
// Visual effects
for (int i = 0; i < 4; i++)
{
Vector2 spawn = Projectile.Center + Main.rand.NextVector2Circular(Radius, Radius);
HealingPlus test = new HealingPlus(spawn, 1f, Vector2.Zero, Color.Orange, Color.OrangeRed, 2) { Rotation = Main.rand.NextFloat(MathHelper.TwoPi) };
GeneralParticleHandler.SpawnParticle(test);
}
if (Projectile.timeLeft % 3 == 0)
{
FlameExplosion blast = new(Projectile.Center, Vector2.Zero, Color.Orange, Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.1f, 0.17f, 15, 0.7f);
GeneralParticleHandler.SpawnParticle(blast);
}
for (int i = 0; i < 3; i++)
{
float randomMult = Main.rand.NextFloat(0.35f, 0.9f);
Vector2 dustSpawn = Projectile.Center + Main.rand.NextVector2CircularEdge(Radius, Radius) * randomMult;
Vector2 dustVel = Utils.DirectionTo(Projectile.Center, dustSpawn) * Utils.Remap(randomMult, 0.35f, 0.9f, 6f, 1f);
Dust fire = Dust.NewDustPerfect(dustSpawn, DustID.InfernoFork, dustVel, Scale: 1.25f);
fire.noGravity = true;
}
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Radius, targetHitbox);
public override bool CanHitPlayer(Player target) => Projectile.timeLeft < Lifetime - 30;
public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.OnFire, 360);
}
}
+47
View File
@@ -0,0 +1,47 @@
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Boss
{
public class GolemInfernoBolt : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Boss";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void SetDefaults()
{
Projectile.width = Projectile.height = 12;
Projectile.hostile = true;
Projectile.tileCollide = false;
Projectile.ignoreWater = true;
}
public override void AI()
{
if (Projectile.ai[2] == 0f)
{
SoundEngine.PlaySound(SoundID.Item20, Projectile.Center);
Projectile.ai[2] = 1f;
}
bool hasReachedX = (Projectile.velocity.X < 0f && Projectile.Center.X < Projectile.ai[0]) || (Projectile.velocity.X > 0f && Projectile.Center.X > Projectile.ai[0]);
bool hasReachedY = (Projectile.velocity.Y < 0f && Projectile.Center.Y < Projectile.ai[1]) || (Projectile.velocity.Y > 0f && Projectile.Center.Y > Projectile.ai[1]);
if (hasReachedX && hasReachedY)
Projectile.Kill();
// Add visual effects
Dust.NewDustPerfect(Projectile.Center, DustID.InfernoFork, Vector2.Zero);
}
public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.OnFire, 360);
public override void OnKill(int timeLeft)
{
if (Main.myPlayer == Projectile.owner)
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<GolemInfernoBlast>(), Projectile.damage, 0f, Projectile.owner);
}
}
}
+2 -118
View File
@@ -2558,110 +2558,6 @@ namespace CalamityMod.Projectiles
return false;
}
else if (projectile.type == ProjectileID.InfernoHostileBolt && projectile.ai[2] > 0f)
{
if (projectile.localAI[0] == 0f)
{
SoundEngine.PlaySound(SoundID.Item20, projectile.position);
projectile.localAI[0] += 1f;
}
bool killX = false;
bool killY = false;
if (projectile.velocity.X < 0f && projectile.position.X < projectile.ai[0])
killX = true;
if (projectile.velocity.X > 0f && projectile.position.X > projectile.ai[0])
killX = true;
if (projectile.velocity.Y < 0f && projectile.position.Y < projectile.ai[1])
killY = true;
if (projectile.velocity.Y > 0f && projectile.position.Y > projectile.ai[1])
killY = true;
if (killX && killY)
projectile.Kill();
for (int i = 0; i < 10; i++)
{
int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.IchorTorch, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1.6f);
Main.dust[dust].noGravity = true;
Main.dust[dust].velocity *= 0.3f;
Main.dust[dust].velocity += projectile.velocity * 0.1f;
if (CalamityWorld.LegendaryMode)
Main.dust[dust].noLight = true;
}
Particle theSpark = new AltSparkParticle(projectile.Center, projectile.velocity * 0.06f + projectile.velocity * 0.1f, false, 40, 1f, new Color(255, 255, 100));
GeneralParticleHandler.SpawnParticle(theSpark);
return false;
}
else if (projectile.type == ProjectileID.InfernoHostileBlast && projectile.ai[2] > 0f)
{
if (projectile.localAI[0] == 0f)
{
SoundEngine.PlaySound(SoundID.Item74, projectile.position);
projectile.localAI[0] += 1f;
}
projectile.ai[0] += 1f;
float totalDust = 20f;
if (projectile.ai[0] > 540f)
totalDust -= (projectile.ai[0] - 180f) / 2f;
if (totalDust <= 0f)
{
totalDust = 0f;
projectile.Kill();
}
float maxDustVelocityX = 10f;
float maxDustVelocityY = 10f;
float minDustSpeed = 3f;
float maxDustSpeed = 8f;
for (int i = 0; i < (int)totalDust; i++)
{
float dustVelocityX = Main.rand.NextFloat(-maxDustVelocityX, maxDustVelocityX);
float dustVelocityY = Main.rand.NextFloat(-maxDustVelocityY, maxDustVelocityY);
float randomDustSpeed = Main.rand.NextFloat(minDustSpeed, maxDustSpeed);
float velocityLength = (float)Math.Sqrt(dustVelocityX * dustVelocityX + dustVelocityY * dustVelocityY);
velocityLength = randomDustSpeed / velocityLength;
dustVelocityX *= velocityLength;
dustVelocityY *= velocityLength;
Vector2 dustVelocity = new Vector2(dustVelocityX, dustVelocityY);
Vector2 dustPosition = projectile.Center + new Vector2(Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-10f, 10f));
int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.IchorTorch, 0f, 0f, 100, default, 1.8f);
Main.dust[dust].noGravity = true;
Main.dust[dust].position = dustPosition;
Main.dust[dust].velocity = dustVelocity;
if (CalamityWorld.LegendaryMode)
Main.dust[dust].noLight = true;
}
float maxSparkVelocityX = 10f;
float maxSparkVelocityY = 10f;
float minSparkSpeed = 3f;
float maxSparkSpeed = 7f;
float sparkVelocityX = Main.rand.NextFloat(-maxSparkVelocityX, maxSparkVelocityX);
float sparkVelocityY = Main.rand.NextFloat(-maxSparkVelocityY, maxSparkVelocityY);
float randSparkSpeed = Main.rand.NextFloat(minSparkSpeed, maxSparkSpeed);
float sparkLength = (float)Math.Sqrt(sparkVelocityX * sparkVelocityX + sparkVelocityY * sparkVelocityY);
sparkLength = randSparkSpeed / sparkLength;
sparkVelocityX *= sparkLength;
sparkVelocityY *= sparkLength;
Particle theSpark = new AltSparkParticle(projectile.Center, new Vector2(sparkVelocityX, sparkVelocityY), false, 40, 1f, new Color(255, 255, 100));
GeneralParticleHandler.SpawnParticle(theSpark);
return false;
}
else if (projectile.type == ProjectileID.AncientDoomProjectile)
{
if (projectile.velocity.Length() < 6f)
@@ -3151,10 +3047,7 @@ namespace CalamityMod.Projectiles
// ai[1] being set to 1 is done only by the Calamity usages of these projectiles in Skeletron and Skeletron Prime boss fights
bool isSkeletronBossProjectile = (projectile.type == ProjectileID.RocketSkeleton || projectile.type == ProjectileID.Shadowflames) && projectile.ai[1] > 0f;
// These projectiles will not be buffed if Golem fires them
bool isGolemBossProjectile = (projectile.type == ProjectileID.InfernoHostileBolt || projectile.type == ProjectileID.InfernoHostileBlast) && projectile.ai[2] > 0f;
if (!isSkeletronBossProjectile && !isGolemBossProjectile)
if (!isSkeletronBossProjectile)
projectile.damage += 30;
}
}
@@ -4596,7 +4489,6 @@ namespace CalamityMod.Projectiles
public override bool PreKill(Projectile projectile, int timeLeft)
{
bool revQueenBeeBeeHive = projectile.type == ProjectileID.BeeHive && (CalamityWorld.revenge || BossRushEvent.BossRushActive) && (projectile.ai[2] == 1f || CalamityWorld.death);
bool revGolemInferno = projectile.type == ProjectileID.InfernoHostileBolt && projectile.ai[2] > 0f;
if (revQueenBeeBeeHive)
{
@@ -4672,17 +4564,9 @@ namespace CalamityMod.Projectiles
if (Main.netMode != NetmodeID.SinglePlayer)
NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, projectile.identity, projectile.owner);
}
else if (revGolemInferno)
{
Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ProjectileID.InfernoHostileBlast, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f, projectile.ai[2]);
if (Main.netMode != NetmodeID.SinglePlayer)
NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, projectile.identity, projectile.owner);
}
}
if (revQueenBeeBeeHive || revGolemInferno)
if (revQueenBeeBeeHive)
{
projectile.active = false;
return false;
@@ -309,7 +309,6 @@ namespace CalamityMod.Projectiles
{ ProjectileID.FlamingScythe, defenseDamage }, // Pumpking orange spinning scythes
{ ProjectileID.FrostWave, defenseDamage }, // Ice Queen frost waves, reused by Storm Weaver
{ ProjectileID.HallowBossLastingRainbow, defenseDamage }, // Empress of Light's lingering rainbow trail hitboxes
{ ProjectileID.InfernoHostileBlast, defenseDamage }, // Diabolist inferno fork explosions
{ ProjectileID.JavelinHostile, defenseDamage },
{ ProjectileID.PaladinsHammerHostile, defenseDamage },
{ ProjectileID.PhantasmalDeathray, defenseDamage },