Merge pull request #1344 from CalamityTeam/cit-misc-boss-stuff
Miscellaneous Boss Tweaks
This commit is contained in:
14 files changed
+75
-161
No files matched your search
@@ -137,7 +137,7 @@ namespace CalamityMod.NPCs.AstrumAureus
|
||||
float lifeRatio = NPC.life / (float)NPC.lifeMax;
|
||||
|
||||
// Phase 2 check
|
||||
bool phase2 = lifeRatio <= 0.5f || Main.IsItDay();
|
||||
bool phase2 = lifeRatio <= 0.5f;
|
||||
|
||||
// Charge towards the target and explode after some time
|
||||
int inertia = 30;
|
||||
|
||||
@@ -341,7 +341,7 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
}
|
||||
}
|
||||
|
||||
SoundEngine.PlaySound(AstrumDeusHead.SplitSound, player.Center);
|
||||
SoundEngine.PlaySound(SplitSound, player.Center);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -401,10 +401,18 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
for (int segments = 0; segments < maxLength; segments++)
|
||||
{
|
||||
int lol;
|
||||
|
||||
// Spawn offsets prevent the body segments from spawning bunched on top of each other, which is exploitable
|
||||
if (segments >= 0 && segments < maxLength - 1)
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, bodyType, NPC.whoAmI);
|
||||
{
|
||||
Vector2 bodySpawnOffset = NPC.velocity.SafeNormalize(Vector2.UnitY) * NPC.height * (segments + 1) / 2;
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - bodySpawnOffset.X), (int)(NPC.Center.Y - bodySpawnOffset.Y), bodyType, NPC.whoAmI);
|
||||
}
|
||||
else
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, tailType, NPC.whoAmI);
|
||||
{
|
||||
Vector2 tailSpawnOffset = NPC.velocity.SafeNormalize(Vector2.UnitY) * NPC.height * maxLength / 2;
|
||||
lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - tailSpawnOffset.X), (int)(NPC.Center.Y - tailSpawnOffset.Y), tailType, NPC.whoAmI);
|
||||
}
|
||||
|
||||
if (segments % 2 == 0)
|
||||
Main.npc[lol].localAI[3] = 1f;
|
||||
@@ -761,13 +769,6 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
|
||||
NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) + MathHelper.PiOver2;
|
||||
|
||||
// Play spawn sound on Deus on the first frame because otherwise the sound wouldn't play properly in multiplayer
|
||||
if (calamityGlobalNPC.newAI[1] == 0f && !doubleWormPhase)
|
||||
{
|
||||
SoundEngine.PlaySound(SpawnSound, NPC.Center);
|
||||
calamityGlobalNPC.newAI[1] = 1f;
|
||||
}
|
||||
|
||||
// 5 seconds of resistance in phase 2, 10 seconds in phase 1, to prevent spawn killing
|
||||
if (calamityGlobalNPC.newAI[1] < resistanceTime && ((NPC.position - NPC.oldPosition).Length() > 2f || calamityGlobalNPC.newAI[1] > 1f))
|
||||
calamityGlobalNPC.newAI[1] += 1f;
|
||||
|
||||
@@ -1291,7 +1291,10 @@ namespace CalamityMod.NPCs
|
||||
npc.lifeMax *= 4;
|
||||
break;
|
||||
case NPCID.BrainofCthulhu:
|
||||
npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.75);
|
||||
npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.95);
|
||||
break;
|
||||
case NPCID.Creeper:
|
||||
npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.1);
|
||||
break;
|
||||
case NPCID.QueenBee:
|
||||
npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.8);
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.Perforator
|
||||
NPC.height = 40;
|
||||
NPC.defense = 6;
|
||||
|
||||
NPC.LifeMaxNERB(130, 170, 7000);
|
||||
NPC.LifeMaxNERB(120, 150, 7000);
|
||||
if (Main.zenithWorld)
|
||||
NPC.lifeMax *= 4;
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ namespace CalamityMod.NPCs.Perforator
|
||||
if (!TailSpawned)
|
||||
{
|
||||
int Previous = NPC.whoAmI;
|
||||
int maxLength = death ? 27 : revenge ? 24 : expertMode ? 21 : 15;
|
||||
int maxLength = death ? 27 : expertMode ? 21 : 15;
|
||||
for (int segments = 0; segments < maxLength; segments++)
|
||||
{
|
||||
int lol;
|
||||
@@ -509,7 +509,7 @@ namespace CalamityMod.NPCs.Perforator
|
||||
}
|
||||
}
|
||||
|
||||
if (NPC.Distance(player.Center) > 1280f)
|
||||
if (NPC.Distance(player.Center) > 1120f)
|
||||
NPC.velocity += (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * turnSpeed;
|
||||
|
||||
NPC.rotation = (float)Math.Atan2((double)NPC.velocity.Y, (double)NPC.velocity.X) + MathHelper.PiOver2;
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace CalamityMod.NPCs.Perforator
|
||||
NPC.height = 68;
|
||||
NPC.defense = 2;
|
||||
|
||||
NPC.LifeMaxNERB(130, 170, 7000);
|
||||
NPC.LifeMaxNERB(120, 150, 7000);
|
||||
if (Main.zenithWorld)
|
||||
NPC.lifeMax *= 4;
|
||||
|
||||
@@ -422,7 +422,7 @@ namespace CalamityMod.NPCs.Perforator
|
||||
}
|
||||
}
|
||||
|
||||
if (NPC.Distance(player.Center) > 1280f)
|
||||
if (NPC.Distance(player.Center) > 1120f)
|
||||
NPC.velocity += (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * turnSpeed;
|
||||
|
||||
NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) + MathHelper.PiOver2;
|
||||
@@ -465,7 +465,7 @@ namespace CalamityMod.NPCs.Perforator
|
||||
|
||||
public static int GetMediumPerforatorSegmentsCount()
|
||||
{
|
||||
return Main.getGoodWorld ? 20 : (CalamityWorld.death || BossRushEvent.BossRushActive) ? 14 : CalamityWorld.revenge ? 13 : Main.expertMode ? 12 : 10;
|
||||
return Main.getGoodWorld ? 20 : (CalamityWorld.death || BossRushEvent.BossRushActive) ? 14 : Main.expertMode ? 12 : 10;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
|
||||
|
||||
@@ -132,7 +132,7 @@ namespace CalamityMod.NPCs.Perforator
|
||||
if (!TailSpawned)
|
||||
{
|
||||
int Previous = NPC.whoAmI;
|
||||
int maxLength = death ? 9 : revenge ? 8 : expertMode ? 7 : 5;
|
||||
int maxLength = death ? 9 : expertMode ? 7 : 5;
|
||||
for (int segments = 0; segments < maxLength; segments++)
|
||||
{
|
||||
int lol;
|
||||
@@ -413,7 +413,7 @@ namespace CalamityMod.NPCs.Perforator
|
||||
}
|
||||
}
|
||||
|
||||
if (NPC.Distance(player.Center) > 1280f)
|
||||
if (NPC.Distance(player.Center) > 1120f)
|
||||
NPC.velocity += (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * turnSpeed;
|
||||
|
||||
NPC.rotation = (float)Math.Atan2((double)NPC.velocity.Y, (double)NPC.velocity.X) + MathHelper.PiOver2;
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace CalamityMod.NPCs.Perforator
|
||||
NPC.height = 50;
|
||||
NPC.defense = 10;
|
||||
|
||||
NPC.LifeMaxNERB(130, 170, 7000);
|
||||
NPC.LifeMaxNERB(120, 150, 7000);
|
||||
if (Main.zenithWorld)
|
||||
NPC.lifeMax *= 4;
|
||||
|
||||
|
||||
@@ -569,7 +569,9 @@ public class BrainOfCthulhuAI : VanillaAIOverride
|
||||
if (d > 592900) //770^2
|
||||
distanceScaleFactor = 1 / (1 + (((float)Math.Sqrt(d) - 770) / 32f));
|
||||
|
||||
float spawnCounter = Time - Math.Abs(SpawnTime);
|
||||
// Time spent in the spawn animation is shortened when summoned via item
|
||||
float spawnAnimTimeReduction = (SummonedViaItem || BossRushEvent.BossRushActive) ? 120 : 0;
|
||||
float spawnCounter = Time - Math.Abs(SpawnTime) + spawnAnimTimeReduction;
|
||||
|
||||
if (spawnCounter < 180)
|
||||
{
|
||||
@@ -686,7 +688,7 @@ public class BrainOfCthulhuAI : VanillaAIOverride
|
||||
AttackCounter++;
|
||||
|
||||
if (SummonedViaItem || BossRushEvent.BossRushActive)
|
||||
SpawnDelay = 2;
|
||||
SpawnDelay = 1;
|
||||
else
|
||||
SpawnDelay = AttackCounter switch
|
||||
{
|
||||
@@ -3096,7 +3098,7 @@ public class BrainOfCthulhuAI : VanillaAIOverride
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int GetBrainOfCthuluCreepersCountRevDeath() => CalamityWorld.death ? 30 : 21;
|
||||
public static int GetBrainOfCthuluCreepersCountRevDeath() => CalamityWorld.death ? 27 : 18;
|
||||
|
||||
public static List<int> GetAllValidTargets(Vector2 brainPosition)
|
||||
{
|
||||
|
||||
@@ -177,7 +177,8 @@ public class CreeperAI : VanillaAIOverride
|
||||
|
||||
if (bocAI.SpawnTime != 0 && Time >= 0) //Brain has appeared
|
||||
{
|
||||
float brainTime = bossCounter - Math.Abs(bocAI.SpawnTime);
|
||||
float spawnAnimTimeReduction = (SummonedViaItem || BossRushEvent.BossRushActive) ? 120 : 0;
|
||||
float brainTime = bossCounter - Math.Abs(bocAI.SpawnTime) + spawnAnimTimeReduction;
|
||||
|
||||
if (brainTime < 180)
|
||||
{
|
||||
|
||||
@@ -24,9 +24,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
|
||||
// Variables
|
||||
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
|
||||
bool phase2 = lifeRatio < (death ? 0.6f : 0.7f);
|
||||
bool phase3 = lifeRatio < (death ? 0.3f : 0.4f);
|
||||
bool phase4 = lifeRatio < (death ? 0.1f : 0.2f);
|
||||
bool phase2 = lifeRatio < 0.7f;
|
||||
bool phase3 = lifeRatio < 0.4f;
|
||||
bool phase4 = lifeRatio < 0.2f;
|
||||
bool phase2AI = NPC.ai[0] > 4f;
|
||||
bool phase3AI = NPC.ai[0] > 9f;
|
||||
bool charging = NPC.ai[3] < 10f;
|
||||
|
||||
@@ -744,8 +744,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
// Expert attack or not.
|
||||
bool expertAttack = calamityGlobalNPC.newAI[2] == 0f;
|
||||
|
||||
int numLanceWalls = expertAttack ? 6 : 4;
|
||||
float lanceWallSpawnGateValue = expertAttack ? (death ? 42f : 36f) : 54f;
|
||||
int numLanceWalls = (death && !expertAttack) ? 9 : 6;
|
||||
float lanceWallSpawnGateValue = expertAttack ? 50f : (death ? 32f : 45f);
|
||||
if (dayTimeEnrage)
|
||||
lanceWallSpawnGateValue -= expertAttack ? 4f : 6f;
|
||||
|
||||
@@ -760,73 +760,26 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item162, NPC.Center);
|
||||
|
||||
float totalProjectiles = death ? 18f : 15f;
|
||||
float lanceSpacing = death ? 150f : 175f;
|
||||
float totalProjectiles = death ? 19f : 15f;
|
||||
float lanceSpacing = death ? (expertAttack ? 150f : 200f) : 175f;
|
||||
float lanceWallSize = totalProjectiles * lanceSpacing;
|
||||
|
||||
Vector2 lanceSpawnOffset = targetData9.Center;
|
||||
if (NPC.Distance(lanceSpawnOffset) <= 3200f)
|
||||
{
|
||||
Vector2 lanceWallStartingPosition = Vector2.Zero;
|
||||
Vector2 lanceWallDirection = Vector2.UnitY;
|
||||
float lanceWallConvergence = 0.4f;
|
||||
float lanceWallSizeMult = 1.4f;
|
||||
totalProjectiles += 5f;
|
||||
lanceSpacing += 50f;
|
||||
lanceWallSize *= (death ? 0.7f : 0.5f);
|
||||
float direction = 1f;
|
||||
|
||||
int randomLanceWallType;
|
||||
do randomLanceWallType = Main.rand.Next(numLanceWalls);
|
||||
while (randomLanceWallType == calamityGlobalNPC.newAI[3]);
|
||||
|
||||
// This is set so that Empress doesn't use the same wall type twice in a row.
|
||||
calamityGlobalNPC.newAI[3] = randomLanceWallType;
|
||||
lanceWallSize *= (death && expertAttack) ? 0.7f : 0.5f;
|
||||
|
||||
// Used to give the lance walls a random rotation.
|
||||
calamityGlobalNPC.newAI[3] = Main.rand.NextFloat(MathHelper.TwoPi);
|
||||
// Keeps track of the total number of lance walls used.
|
||||
calamityGlobalNPC.newAI[1] += 1f;
|
||||
|
||||
// Sync the Calamity AI variables.
|
||||
NPC.SyncExtraAI();
|
||||
|
||||
switch (randomLanceWallType)
|
||||
{
|
||||
case 0:
|
||||
lanceSpawnOffset += new Vector2((0f - lanceWallSize) / 2f, 0f) * direction;
|
||||
lanceWallStartingPosition = new Vector2(0f, lanceWallSize);
|
||||
lanceWallDirection = Vector2.UnitX;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
lanceSpawnOffset += new Vector2(lanceWallSize / 2f, lanceSpacing / 2f) * direction;
|
||||
lanceWallStartingPosition = new Vector2(0f, lanceWallSize);
|
||||
lanceWallDirection = -Vector2.UnitX;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
lanceSpawnOffset += new Vector2(0f - lanceWallSize, 0f - lanceWallSize) * lanceWallConvergence * direction;
|
||||
lanceWallStartingPosition = new Vector2(lanceWallSize * lanceWallSizeMult, 0f);
|
||||
lanceWallDirection = new Vector2(1f, 1f);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
lanceSpawnOffset += new Vector2(lanceWallSize * lanceWallConvergence + lanceSpacing / 2f, (0f - lanceWallSize) * lanceWallConvergence) * direction;
|
||||
lanceWallStartingPosition = new Vector2((0f - lanceWallSize) * lanceWallSizeMult, 0f);
|
||||
lanceWallDirection = new Vector2(-1f, 1f);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
lanceSpawnOffset += new Vector2(0f - lanceWallSize, lanceWallSize) * lanceWallConvergence * direction;
|
||||
lanceWallStartingPosition = new Vector2(lanceWallSize * lanceWallSizeMult, 0f);
|
||||
lanceWallDirection = lanceSpawnOffset.DirectionTo(targetData9.Center);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
lanceSpawnOffset += new Vector2(lanceWallSize * lanceWallConvergence + lanceSpacing / 2f, lanceWallSize * lanceWallConvergence) * direction;
|
||||
lanceWallStartingPosition = new Vector2((0f - lanceWallSize) * lanceWallSizeMult, 0f);
|
||||
lanceWallDirection = lanceSpawnOffset.DirectionTo(targetData9.Center);
|
||||
break;
|
||||
}
|
||||
lanceSpawnOffset += -Vector2.UnitX.RotatedBy(calamityGlobalNPC.newAI[3]) * (lanceWallSize / 2f);
|
||||
Vector2 lanceWallStartingPosition = Vector2.UnitY.RotatedBy(calamityGlobalNPC.newAI[3]) * lanceWallSize;
|
||||
Vector2 lanceWallDirection = calamityGlobalNPC.newAI[3].ToRotationVector2();
|
||||
|
||||
int projectileType = ProjectileID.FairyQueenLance;
|
||||
int projectileDamage = lanceDamage;
|
||||
@@ -846,16 +799,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnLocation, Vector2.Zero, projectileType, projectileDamage, 0f, Main.myPlayer, v2.ToRotation(), i);
|
||||
}
|
||||
}
|
||||
|
||||
// Chance to stop using the lance walls and switch to a different attack after 3 lance walls are used.
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
if (Main.rand.NextBool(5 - ((int)calamityGlobalNPC.newAI[1] - 2)) && calamityGlobalNPC.newAI[1] >= 2f)
|
||||
{
|
||||
NPC.ai[1] = lanceWallPhaseTime;
|
||||
NPC.netUpdate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NPC.ai[1] += 1f;
|
||||
@@ -930,9 +873,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, rainbowStreakVelocity, projectileType, projectileDamage, 0f, Main.myPlayer, NPC.target, ai3);
|
||||
if (Main.getGoodWorld)
|
||||
Main.projectile[proj].extraUpdates += 1;
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, rainbowStreakVelocity, projectileType, projectileDamage, 0f, Main.myPlayer, NPC.target, ai3);
|
||||
}
|
||||
|
||||
// Spawn extra homing Rainbow Streaks per player.
|
||||
@@ -1166,12 +1107,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + projRandomOffset, vector, projectileType, projectileDamage, 0f, Main.myPlayer, NPC.target, streakHomeTime);
|
||||
if (phase3)
|
||||
{
|
||||
int proj2 = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + projRandomOffset, -vector, projectileType, projectileDamage, 0f, Main.myPlayer, NPC.target, 1f - streakHomeTime);
|
||||
if (Main.getGoodWorld)
|
||||
{
|
||||
Main.projectile[proj2].extraUpdates += 1;
|
||||
Main.projectile[proj2].netUpdate = true;
|
||||
}
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + projRandomOffset, -vector, projectileType, projectileDamage, 0f, Main.myPlayer, NPC.target, 1f - streakHomeTime);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -326,38 +326,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
|
||||
// Spawn crown gore
|
||||
if (NPC.ai[1] == teleportTime)
|
||||
{
|
||||
Gore.NewGore(NPC.GetSource_FromAI(), NPC.Center + new Vector2(-40f, -NPC.height / 2), NPC.velocity, GoreID.QueenSlimeCrown);
|
||||
|
||||
// Spawn spread of projectiles in Master Mode
|
||||
if (death)
|
||||
{
|
||||
int numGelProjectiles = 12;
|
||||
if (Main.getGoodWorld)
|
||||
numGelProjectiles = 15;
|
||||
|
||||
float gelVelocity = death ? 20f : 16f;
|
||||
int type = ProjectileID.QueenSlimeGelAttack;
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
for (int j = 0; j < numGelProjectiles; j++)
|
||||
{
|
||||
Vector2 spinningpoint = new Vector2(gelVelocity, 0f);
|
||||
|
||||
if (Main.getGoodWorld)
|
||||
spinningpoint *= Main.rand.NextFloat() + 0.5f;
|
||||
|
||||
spinningpoint = spinningpoint.RotatedBy((float)(-j) * MathHelper.TwoPi / (float)numGelProjectiles, Vector2.Zero);
|
||||
int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, spinningpoint, type, LargeGelDamage, 0f, Main.myPlayer, 0f, -2f);
|
||||
Main.projectile[proj].timeLeft = 900;
|
||||
}
|
||||
}
|
||||
|
||||
SoundEngine.PlaySound(SoundID.Item155, NPC.Center);
|
||||
}
|
||||
}
|
||||
|
||||
if (NPC.ai[1] >= teleportTime && Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
NPC.Bottom = new Vector2(NPC.localAI[1], NPC.localAI[2]);
|
||||
@@ -459,9 +429,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
NPC.ai[2] += 1f;
|
||||
}
|
||||
|
||||
if (death)
|
||||
NPC.velocity.X *= (death ? 1.4f : 1.2f);
|
||||
|
||||
NPC.noTileCollide = true;
|
||||
}
|
||||
else
|
||||
@@ -527,15 +494,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
int type = ProjectileID.QueenSlimeSmash;
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Bottom, Vector2.Zero, type, SlamDamage, 0f, Main.myPlayer);
|
||||
|
||||
// Line of explosions in Master Mode
|
||||
// Line of explosions in Death Mode
|
||||
if (death)
|
||||
{
|
||||
float expandDelay = 0f;
|
||||
int maxSmashes = death ? 22 : 16;
|
||||
int maxSmashes = 16;
|
||||
float maxSmashOffset = maxSmashes * 100f;
|
||||
Vector2 extraSmashPosition = NPC.Bottom + Vector2.UnitX * maxSmashOffset;
|
||||
int maxSmashesPerSide = maxSmashes / 2;
|
||||
float maxExpandDelay = (death ? 10f : 15f) * maxSmashesPerSide;
|
||||
float maxExpandDelay = 15f * maxSmashesPerSide;
|
||||
float smashSpawnDistanceOffset = 200f;
|
||||
for (int i = 0; i < maxSmashes + 1; i++)
|
||||
{
|
||||
@@ -550,7 +517,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
// Eruption of crystals in phase 3
|
||||
if (NPC.ai[0] == 6f && phase3)
|
||||
{
|
||||
float projectileVelocity = death ? 18f : 12f;
|
||||
float projectileVelocity = 12f;
|
||||
type = ProjectileID.QueenSlimeMinionBlueSpike;
|
||||
Vector2 destination = (new Vector2(NPC.Center.X, NPC.Center.Y - 100f) - NPC.Center).SafeNormalize(Vector2.UnitY);
|
||||
destination *= projectileVelocity;
|
||||
@@ -564,7 +531,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
|
||||
if (phase5)
|
||||
{
|
||||
numProj = 15;
|
||||
numProj = 12;
|
||||
destination *= 0.65f;
|
||||
for (int i = 0; i < numProj; i++)
|
||||
{
|
||||
@@ -853,7 +820,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
|
||||
// Spawn small slimes
|
||||
// Don't spawn any slimes in final phase
|
||||
if (NPC.life <= 0 || (phase4 && !death))
|
||||
if (NPC.life <= 0 || (phase4 && !death) || phase5)
|
||||
return false;
|
||||
|
||||
if (Main.netMode == NetmodeID.MultiplayerClient)
|
||||
@@ -926,7 +893,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
|
||||
float flyVelocity = death ? 19f : 16f;
|
||||
float flyAcceleration = death ? 0.15f : 0.12f;
|
||||
float flyDistanceY = death ? 350f : 450f;
|
||||
float flyDistanceY = 450f;
|
||||
|
||||
Vector2 desiredVelocity = npc.Center;
|
||||
|
||||
@@ -1005,7 +972,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
float num20 = obj.Center.Y - center.Y;
|
||||
float num21 = (float)Math.Sqrt(num19 * num19 + num20 * num20);
|
||||
int num22 = NPC.CountNPCS(NPCID.QueenSlimeMinionBlue);
|
||||
if (Main.expertMode && num22 < 5 && Math.Abs(num19) < 500f && Math.Abs(num20) < 550f && Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[NPC.target].position, Main.player[NPC.target].width, Main.player[NPC.target].height) && NPC.velocity.Y == 0f)
|
||||
if (num22 < 5 && Math.Abs(num19) < 500f && Math.Abs(num20) < 550f && Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[NPC.target].position, Main.player[NPC.target].width, Main.player[NPC.target].height) && NPC.velocity.Y == 0f)
|
||||
{
|
||||
NPC.ai[0] = -40f;
|
||||
if (NPC.velocity.Y == 0f)
|
||||
@@ -1026,8 +993,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
vector6 *= 1.5f;
|
||||
|
||||
int type = ProjectileID.QueenSlimeMinionBlueSpike;
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), center, vector6 * (death ? 0.8f : 0.5f), type, SpikeDamage, 0f, Main.myPlayer);
|
||||
NPC.localAI[0] = 25f;
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), center, vector6 * (death ? 0.7f : 0.5f), type, SpikeDamage, 0f, Main.myPlayer);
|
||||
NPC.localAI[0] = death ? 50f : 25f;
|
||||
if (num22 > 4)
|
||||
break;
|
||||
}
|
||||
@@ -1053,9 +1020,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
|
||||
num19 *= num21;
|
||||
num20 *= num21;
|
||||
NPC.localAI[0] = 50f;
|
||||
NPC.localAI[0] = death ? 100f : 50f;
|
||||
int type = ProjectileID.QueenSlimeMinionBlueSpike;
|
||||
Vector2 spikeVelocity = new Vector2(num19, num20) * (death ? 0.8f : 0.5f);
|
||||
Vector2 spikeVelocity = new Vector2(num19, num20) * (death ? 0.7f : 0.5f);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), center, spikeVelocity, type, SpikeDamage, 0f, Main.myPlayer);
|
||||
}
|
||||
}
|
||||
@@ -1113,7 +1080,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
if ((double)NPC.velocity.X > -0.1 && (double)NPC.velocity.X < 0.1)
|
||||
NPC.velocity.X = 0f;
|
||||
|
||||
NPC.ai[0] += (death ? 16f : Main.expertMode ? 10f : 7f);
|
||||
NPC.ai[0] += death ? 16f : 10f;
|
||||
|
||||
float num33 = -1000f;
|
||||
|
||||
@@ -1136,14 +1103,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
if (num34 == 3)
|
||||
{
|
||||
NPC.velocity.Y = -8f;
|
||||
NPC.velocity.X += (death ? 9 : Main.expertMode ? 6 : 3) * NPC.direction;
|
||||
NPC.velocity.X += (death ? 9 : 6) * NPC.direction;
|
||||
NPC.ai[0] = -200f;
|
||||
NPC.ai[3] = NPC.position.X;
|
||||
}
|
||||
else
|
||||
{
|
||||
NPC.velocity.Y = -6f;
|
||||
NPC.velocity.X += (death ? 6 : Main.expertMode ? 4 : 2) * NPC.direction;
|
||||
NPC.velocity.X += (death ? 6 : 4) * NPC.direction;
|
||||
NPC.ai[0] = -120f;
|
||||
if (num34 == 1)
|
||||
NPC.ai[0] += num33;
|
||||
@@ -1208,12 +1175,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
|
||||
num24 *= num26;
|
||||
num25 *= num26;
|
||||
NPC.localAI[0] = 40f;
|
||||
if (Main.expertMode)
|
||||
NPC.localAI[0] = 30f;
|
||||
NPC.localAI[0] = death ? 60f : 30f;
|
||||
|
||||
int type = ProjectileID.QueenSlimeMinionPinkBall;
|
||||
Vector2 pinkBallVelocity = new Vector2(num24, num25) * (death ? 0.8f : 0.5f);
|
||||
Vector2 pinkBallVelocity = new Vector2(num24, num25) * (death ? 0.7f : 0.5f);
|
||||
Projectile.NewProjectile(NPC.GetSource_FromAI(), center2, pinkBallVelocity, type, SmallGelDamage, 0f, Main.myPlayer);
|
||||
}
|
||||
}
|
||||
@@ -1271,7 +1236,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
if ((double)NPC.velocity.X > -0.1 && (double)NPC.velocity.X < 0.1)
|
||||
NPC.velocity.X = 0f;
|
||||
|
||||
NPC.ai[0] += (death ? 11f : Main.expertMode ? 7f : 5f);
|
||||
NPC.ai[0] += death ? 11f : 7f;
|
||||
|
||||
float num33 = -500f;
|
||||
|
||||
@@ -1294,14 +1259,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses
|
||||
if (num34 == 3)
|
||||
{
|
||||
NPC.velocity.Y = -8f;
|
||||
NPC.velocity.X += (death ? 9 : Main.expertMode ? 6 : 3) * NPC.direction;
|
||||
NPC.velocity.X += (death ? 9 : 6) * NPC.direction;
|
||||
NPC.ai[0] = -200f;
|
||||
NPC.ai[3] = NPC.position.X;
|
||||
}
|
||||
else
|
||||
{
|
||||
NPC.velocity.Y = -6f;
|
||||
NPC.velocity.X += (death ? 6 : Main.expertMode ? 4 : 2) * NPC.direction;
|
||||
NPC.velocity.X += (death ? 6 : 4) * NPC.direction;
|
||||
NPC.ai[0] = -120f;
|
||||
if (num34 == 1)
|
||||
NPC.ai[0] += num33;
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
public const int TotalSinePeriods = 6;
|
||||
public const int PulseTime = 45;
|
||||
public const int TotalRitualTime = 420;
|
||||
public const float MaxUpwardRise = 540f;
|
||||
public const float MaxUpwardRise = 900f;
|
||||
public static readonly Point PulseSize = new(300, 300);
|
||||
public override void SetDefaults()
|
||||
{
|
||||
@@ -42,11 +42,17 @@ namespace CalamityMod.Projectiles.Boss
|
||||
Time++;
|
||||
if (Time == TotalRitualTime - PulseTime)
|
||||
{
|
||||
SoundEngine.PlaySound(AstrumDeusHead.SpawnSound, Projectile.Center);
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int idx = NPC.NewNPC(Projectile.GetSource_FromThis(), (int)Projectile.Center.X, (int)Projectile.Center.Y - (int)MaxUpwardRise, ModContent.NPCType<AstrumDeusHead>(), 1);
|
||||
int idx = NPC.NewNPC(Projectile.GetSource_FromThis(), (int)Projectile.Center.X, (int)Projectile.Center.Y - (int)(MaxUpwardRise * 3f), ModContent.NPCType<AstrumDeusHead>(), 1);
|
||||
if (idx != -1)
|
||||
{
|
||||
CalamityUtils.BossAwakenMessage(idx);
|
||||
Main.npc[idx].velocity = Vector2.UnitY * 20f;
|
||||
NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user