From 64c9752ca8046fbcfb7a3cfcb72a471373bfffae Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Sun, 28 Apr 2024 11:39:10 -0500 Subject: [PATCH] Perhaps, this is hell --- CalPlayer/CalamityPlayerHitHurt.cs | 2 + Localization/en-US/Mods.CalamityMod.UI.hjson | 10 +-- NPCs/NormalNPCs/SkeletronPrime2.cs | 15 ++++- .../Bosses/SkeletronPrimeAI.cs | 65 +++++++++++++++---- Projectiles/CalamityGlobalProjectile.cs | 19 ++---- 5 files changed, 78 insertions(+), 33 deletions(-) diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 367f3910e9..ecc1103e75 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -1303,6 +1303,8 @@ namespace CalamityMod.CalPlayer else if (proj.type == ProjectileID.DeathLaser || proj.type == ProjectileID.RocketSkeleton || proj.type == ProjectileID.BombSkeletronPrime) { Player.AddBuff(BuffID.OnFire, 180); + if (proj.type == ProjectileID.BombSkeletronPrime && proj.ai[0] < 0f && (Main.masterMode || BossRushEvent.BossRushActive)) + proj.Kill(); } else if (proj.type == ProjectileID.Skull) { diff --git a/Localization/en-US/Mods.CalamityMod.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index 206278c371..05c2f03692 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -202,7 +202,7 @@ Communication: { Crusade: { Inquiry: Role in the Crusade - Response: + Response: ''' While the Crusade is widely considered to have begun on the date of 6.19.1781 with Yharon's rebirth, I took no part in it until 4.23.1803. Upon joining, I was chosen to lead the science and engineering divisions. While I was given freedom over which projects I chose and how I pursued them, it was expected that anything I made would be beneficial to the war effort.\n\n @@ -245,12 +245,12 @@ Communication: { I forged its armor using a process inspired by how Silva created Braelor's axe: by using particle jets to slowly and carefully fuse many elements together into a nanocomposite, the invincible armor organically "grows" over Thanatos' structure like a chrysalis. Regrettably, the plating's immense weight makes Thanatos notably slower than its siblings.\n\n When designing the third, Apollo, my goal was to downscale significantly; to make something powerful, yet compact. Reviewing the most compact forms of destructive potential I knew, I elected to simulate the Witch's flames.\n\n - + Apollo's searing exoplasma is fueled by unstable nanomachines that constantly shed a deluge of ultra high energy particles. This both heats the plasma to incredible temperatures and causes radiation burns of a severity on par with those inflicted by the Witch. The craft had little capability beyond its nanomachine plasma projector, but there was no worry. Apollo was never meant to fight alone.\n\n The final to begin construction was Artemis. Rather than being founded on raw power, it was made to be the apex of speed and accuracy. There is elegance in simplicity, for all of Artemis' combat efficacy comes from an onboard predictive AI and a battery of hard-light bolt emitters.\n\n - - It was the perfect partner to its twin and required no revisions. Organic beings are naturally inclined to fixate their senses on fire, presenting Artemis with the perfect opportunity to strike with unparalleled precision. + + It was the perfect partner to its twin and required no revisions. Organic beings are naturally inclined to fixate their senses on fire, presenting Artemis with the perfect opportunity to strike with unparalleled precision. ''' } @@ -331,7 +331,7 @@ Communication: { Even if I dared to evoke Yharim's wrath, I cannot survey the Aerie. My attempts at locating it have been fruitless despite having surveyed this world's surface and skies many times over. Perhaps it avoids observation, as per some manner of cloaking. It is also possible it simply exists outside of conventional space, in a pocket dimension of sorts. Either case would make detecting it via my current methods drastically more difficult.\n\n What I do know is that the Dragon Aerie is an unusually large sky island that acted as the sacred home of the Auric dragons. Few others were ever allowed to tread there, as a sort of religious sanctuary or holy ground.\n\n - + It is also where Auric dragons would be laid to rest in preparation for their revival by Yharon. As their revival on the Aerie was a commonly accepted fact even at the start of recorded history, the sky island must be at least 2,000 years old, with Yharon himself being a similar age.\n\n Considering the extraordinary power of the Auric dragons and the sanctity of the Dragon Aerie, I am left to ponder: did the Aerie make the Auric dragons powerful, or is the Aerie inundated with power due to their extended presence? Perhaps more importantly, what made them leave the safety of the Aerie even as their kind were being slain? I eagerly await the uncovering of such mysteries. diff --git a/NPCs/NormalNPCs/SkeletronPrime2.cs b/NPCs/NormalNPCs/SkeletronPrime2.cs index 7cc97ce5e9..898692c130 100644 --- a/NPCs/NormalNPCs/SkeletronPrime2.cs +++ b/NPCs/NormalNPCs/SkeletronPrime2.cs @@ -22,6 +22,8 @@ namespace CalamityMod.NPCs.NormalNPCs public static Asset EyeTexture; + public const int BombTimeLeft = 600; + public override void SetStaticDefaults() { Main.npcFrameCount[NPC.type] = 6; @@ -312,15 +314,22 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.rotation = NPC.velocity.X / 15f; float acceleration = (bossRush ? 0.2f : 0.125f) + (death ? 0.05f * (1f - lifeRatio) : 0f); + float accelerationMult = 1f; if (!cannonAlive) + { acceleration += 0.025f; + accelerationMult += 0.5f; + } if (!laserAlive) + { acceleration += 0.025f; + accelerationMult += 0.5f; + } if (!viceAlive) acceleration += 0.025f; if (!sawAlive) acceleration += 0.025f; - acceleration *= 4f; + acceleration *= accelerationMult; float topVelocity = acceleration * 100f; float deceleration = 0.7f; @@ -679,7 +688,7 @@ namespace CalamityMod.NPCs.NormalNPCs } int enragedBombs = Projectile.NewProjectile(NPC.GetSource_FromAI(), headCenter.X, headCenter.Y + 30f, enragedHeadBombTargetX, enragedHeadBombTargetY, type, damage, 0f, Main.myPlayer, -1f); - Main.projectile[enragedBombs].timeLeft = 600; + Main.projectile[enragedBombs].timeLeft = BombTimeLeft; Main.projectile[enragedBombs].tileCollide = false; } } @@ -757,7 +766,7 @@ namespace CalamityMod.NPCs.NormalNPCs { Vector2 bombVelocity = spinningPoint.RotatedBy(radians * k); int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.UnitY * 30f + bombVelocity.SafeNormalize(Vector2.UnitY) * 15f, bombVelocity - upwardVelocity, type, damage, 0f, Main.myPlayer, -2f); - Main.projectile[proj].timeLeft = 900; + Main.projectile[proj].timeLeft = BombTimeLeft; Main.projectile[proj].tileCollide = false; } NPC.localAI[1] += 1f; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs index 71bba52336..463f4de7c3 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs @@ -290,16 +290,23 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation = npc.velocity.X / 15f; float acceleration = (bossRush ? 0.2f : masterMode ? 0.125f : 0.1f) + (death ? 0.05f * (1f - lifeRatio) : 0f); + float accelerationMult = 1f; if (!cannonAlive) + { acceleration += 0.025f; + accelerationMult += 0.5f; + } if (!laserAlive) + { acceleration += 0.025f; + accelerationMult += 0.5f; + } if (!viceAlive) acceleration += 0.025f; if (!sawAlive) acceleration += 0.025f; if (masterMode) - acceleration *= 4f; + acceleration *= accelerationMult; float topVelocity = acceleration * 100f; float deceleration = masterMode ? 0.7f : 0.85f; @@ -830,14 +837,18 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Movement float acceleration = (bossRush ? 0.6f : death ? (masterMode ? 0.375f : 0.3f) : (masterMode ? 0.3125f : 0.25f)); + float accelerationMult = 1f; if (!cannonAlive) + { acceleration += 0.025f; + accelerationMult += 0.5f; + } if (!viceAlive) acceleration += 0.025f; if (!sawAlive) acceleration += 0.025f; if (masterMode) - acceleration *= 4f; + acceleration *= accelerationMult; float topVelocity = acceleration * 100f; float deceleration = masterMode ? 0.6f : 0.8f; @@ -1155,14 +1166,18 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Movement float acceleration = (bossRush ? 0.6f : death ? (masterMode ? 0.375f : 0.3f) : (masterMode ? 0.3125f : 0.25f)); + float accelerationMult = 1f; if (!laserAlive) + { acceleration += 0.025f; + accelerationMult += 0.5f; + } if (!viceAlive) acceleration += 0.025f; if (!sawAlive) acceleration += 0.025f; if (masterMode) - acceleration *= 4f; + acceleration *= accelerationMult; float topVelocity = acceleration * 100f; float deceleration = masterMode ? 0.6f : 0.8f; @@ -1388,14 +1403,21 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[2] == 99f) { float acceleration = (bossRush ? 0.6f : death ? (masterMode ? 0.375f : 0.3f) : (masterMode ? 0.3125f : 0.25f)); + float accelerationMult = 1f; if (!cannonAlive) + { acceleration += 0.025f; + accelerationMult += 0.5f; + } if (!laserAlive) + { acceleration += 0.025f; + accelerationMult += 0.5f; + } if (!sawAlive) acceleration += 0.025f; if (masterMode) - acceleration *= 4f; + acceleration *= accelerationMult; float topVelocity = acceleration * 100f; float deceleration = masterMode ? 0.6f : 0.8f; @@ -1471,14 +1493,21 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } float acceleration = (bossRush ? 0.6f : death ? (masterMode ? 0.375f : 0.3f) : (masterMode ? 0.3125f : 0.25f)); + float accelerationMult = 1f; if (!cannonAlive) + { acceleration += 0.025f; + accelerationMult += 0.5f; + } if (!laserAlive) + { acceleration += 0.025f; + accelerationMult += 0.5f; + } if (!sawAlive) acceleration += 0.025f; if (masterMode) - acceleration *= 4f; + acceleration *= accelerationMult; float topVelocity = acceleration * 100f; float deceleration = masterMode ? 0.6f : 0.8f; @@ -1749,14 +1778,21 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[2] == 99f) { float acceleration = (bossRush ? 0.6f : death ? (masterMode ? 0.375f : 0.3f) : (masterMode ? 0.3125f : 0.25f)); + float accelerationMult = 1f; if (!cannonAlive) + { acceleration += 0.025f; + accelerationMult += 0.5f; + } + if (!laserAlive) + { + acceleration += 0.025f; + accelerationMult += 0.5f; + } if (!viceAlive) acceleration += 0.025f; - if (!laserAlive) - acceleration += 0.025f; if (masterMode) - acceleration *= 4f; + acceleration *= accelerationMult; float topVelocity = acceleration * 100f; float deceleration = masterMode ? 0.6f : 0.8f; @@ -1828,14 +1864,21 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } float acceleration = (bossRush ? 0.6f : death ? (masterMode ? 0.375f : 0.3f) : (masterMode ? 0.3125f : 0.25f)); + float accelerationMult = 1f; if (!cannonAlive) + { acceleration += 0.025f; + accelerationMult += 0.5f; + } + if (!laserAlive) + { + acceleration += 0.025f; + accelerationMult += 0.5f; + } if (!viceAlive) acceleration += 0.025f; - if (!laserAlive) - acceleration += 0.025f; if (masterMode) - acceleration *= 4f; + acceleration *= accelerationMult; float topVelocity = acceleration * 100f; float deceleration = masterMode ? 0.6f : 0.8f; diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 89b4fd3d8b..671e288ba3 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -10,6 +10,7 @@ using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.NPCs; +using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.PlagueEnemies; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; @@ -355,7 +356,7 @@ namespace CalamityMod.Projectiles homingEndTime += 90f; // Stop homing when within a certain distance of the target - if (Vector2.Distance(projectile.Center, Main.player[num133].Center) < ((revSkeletronPrimeHomingSkull && Main.masterMode && CalamityWorld.revenge) ? 192f : 96f) && projectile.ai[1] < homingEndTime) + if (Vector2.Distance(projectile.Center, Main.player[num133].Center) < ((revSkeletronPrimeHomingSkull && ((Main.masterMode && CalamityWorld.revenge) || BossRushEvent.BossRushActive)) ? 192f : 96f) && projectile.ai[1] < homingEndTime) projectile.ai[1] = homingEndTime; if (projectile.ai[1] < homingEndTime && projectile.ai[1] > homingStartTime) @@ -2253,20 +2254,15 @@ namespace CalamityMod.Projectiles return false; } + if (projectile.timeLeft < SkeletronPrime2.BombTimeLeft / 2 && projectile.timeLeft > 3) + projectile.tileCollide = true; + if (masterModeSkeletronPrimeHomingBomb) { projectile.ai[1] += 1f; float homingStartTime = 20f; float homingEndTime = death ? 140f : 110f; - if (projectile.ai[1] < homingEndTime) - { - projectile.ai[1] = homingEndTime; - - if (projectile.timeLeft > 3) - projectile.tileCollide = true; - } - if (Vector2.Distance(projectile.Center, Main.player[target].Center) < 192f && projectile.ai[1] < homingEndTime) projectile.ai[1] = homingEndTime; @@ -2290,12 +2286,7 @@ namespace CalamityMod.Projectiles else { if (projectile.velocity.Y > 10f) - { projectile.velocity.Y = 10f; - - if (!projectile.tileCollide && projectile.timeLeft > 3) - projectile.tileCollide = true; - } } if (projectile.localAI[0] == 0f)