From 3c83fb6fa4ff2e5a08f671e300ec700f47e530e7 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sun, 23 Nov 2025 23:45:22 -0500 Subject: [PATCH] The public shall no longer suffer through Oblivion Also Skeletron Prime no longer spawns Probes, and fixed him not spinning on the first spin attack --- CalamityLists.cs | 3 - CalamityMod.cs | 8 - DataStructures/NPCStats.cs | 10 - Events/BossRushEvent.cs | 2 +- ExtraTextures/ChadPrime.png | Bin 6702 -> 0 bytes ExtraTextures/ChadPrimeHeadGlow.png | Bin 588 -> 0 bytes .../en-US/Mods.CalamityMod.Configs.hjson | 8 +- .../en-US/Mods.CalamityMod.NPCs.hjson | 1 - NPCs/CalamityGlobalNPC.cs | 145 +-- NPCs/NormalNPCs/SkeletronPrime2.cs | 910 ------------------ NPCs/NormalNPCs/SkeletronPrime2.png | Bin 6696 -> 0 bytes .../Bosses/DestroyerAI.cs | 116 +-- .../Bosses/SkeletronPrimeAI.cs | 169 +--- NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs | 113 +-- Projectiles/CalamityGlobalProjectile.cs | 226 +---- .../SkeletronPrimeMasterMusicScene.cs | 14 - 16 files changed, 126 insertions(+), 1599 deletions(-) delete mode 100644 ExtraTextures/ChadPrime.png delete mode 100644 ExtraTextures/ChadPrimeHeadGlow.png delete mode 100644 NPCs/NormalNPCs/SkeletronPrime2.cs delete mode 100644 NPCs/NormalNPCs/SkeletronPrime2.png delete mode 100644 Scenes/MusicScenes/SkeletronPrimeMasterMusicScene.cs diff --git a/CalamityLists.cs b/CalamityLists.cs index 774bf0f601..37f030063c 100644 --- a/CalamityLists.cs +++ b/CalamityLists.cs @@ -1031,7 +1031,6 @@ namespace CalamityMod NPCID.Retinazer, NPCID.Spazmatism, NPCID.SkeletronPrime, - NPCType(), NPCID.PrimeCannon, NPCID.PrimeSaw, NPCID.PrimeLaser, @@ -2160,7 +2159,6 @@ namespace CalamityMod SkeletronPrimeIDs = new List { NPCID.SkeletronPrime, - NPCType(), NPCID.PrimeCannon, NPCID.PrimeLaser, NPCID.PrimeSaw, @@ -2565,7 +2563,6 @@ namespace CalamityMod { NPCID.Probe, 5000 }, { NPCID.SkeletronPrime, 160000 }, // 30 seconds - { NPCType(), 160000 }, { NPCID.PrimeVice, 54000 }, { NPCID.PrimeCannon, 45000 }, { NPCID.PrimeSaw, 45000 }, diff --git a/CalamityMod.cs b/CalamityMod.cs index 76aec0acec..ca64b16be0 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -129,10 +129,6 @@ namespace CalamityMod public static Asset WallOfFleshEyeGlowmask; public static Asset WallOfFleshDemonSickleTexture; - // Master Rev+ Skeletron Prime - public static Asset ChadPrime; - public static Asset ChadPrimeEyeGlowmask; - // DR data structure public static SortedDictionary DRValues; @@ -343,10 +339,6 @@ namespace CalamityMod WallOfFleshEyeGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/WallOfFleshEyeTelegraphGlow", AssetRequestMode.AsyncLoad); WallOfFleshDemonSickleTexture = ModContent.Request("CalamityMod/Projectiles/Melee/ForbiddenOathbladeProjectile", AssetRequestMode.AsyncLoad); - // Master Rev+ Skeletron Prime textures - ChadPrime = ModContent.Request("CalamityMod/ExtraTextures/ChadPrime", AssetRequestMode.AsyncLoad); - ChadPrimeEyeGlowmask = ModContent.Request("CalamityMod/ExtraTextures/ChadPrimeHeadGlow", AssetRequestMode.AsyncLoad); - // TODO -- Sky shaders should probably be loaded in a ModSystem Filters.Scene["CalamityMod:DevourerofGodsHead"] = new Filter(new DoGScreenShaderData("FilterMiniTower").UseColor(0.4f, 0.1f, 1.0f).UseOpacity(0.5f), EffectPriority.VeryHigh); SkyManager.Instance["CalamityMod:DevourerofGodsHead"] = new DoGSky(); diff --git a/DataStructures/NPCStats.cs b/DataStructures/NPCStats.cs index 0aec9726b2..b2b8d4ee20 100644 --- a/DataStructures/NPCStats.cs +++ b/DataStructures/NPCStats.cs @@ -213,7 +213,6 @@ namespace CalamityMod { ModContent.NPCType(), 0.8 }, { NPCID.SkeletronPrime, 0.85 }, - { ModContent.NPCType(), 0.85 }, { NPCID.PrimeCannon, 0.85 }, { NPCID.PrimeLaser, 0.85 }, { NPCID.PrimeSaw, 0.85 }, @@ -416,12 +415,6 @@ namespace CalamityMod 102, // 204 while spinning 119, // 238 while spinning 153 } }, // 306 while spinning - { ModContent.NPCType(), new int[] { - 50, // 100 while spinning - 85, // 170 while spinning - 102, // 204 while spinning - 119, // 238 while spinning - 153 } }, // 306 while spinning { NPCID.PrimeVice, new int[] { 70, 102, 136, 170, 255 } }, { NPCID.PrimeSaw, new int[] { 70, 102, 136, 170, 255 } }, { NPCID.PrimeCannon, new int[] { 30, 51, 68, 85, 102 } }, @@ -663,9 +656,6 @@ namespace CalamityMod { new Tuple(NPCID.SkeletronPrime, ProjectileID.Skull), new int[] { 50, 108, 124, 140, 210 } }, { new Tuple(NPCID.SkeletronPrime, ProjectileID.DeathLaser), new int[] { 50, 108, 124, 140, 210 } }, { new Tuple(NPCID.SkeletronPrime, ProjectileID.RocketSkeleton), new int[] { 60, 120, 148, 176, 264 } }, - { new Tuple(ModContent.NPCType(), ProjectileID.Skull), new int[] { 50, 108, 124, 140, 210 } }, - { new Tuple(ModContent.NPCType(), ProjectileID.BombSkeletronPrime), new int[] { 80, 160, 180, 200, 300 } }, - { new Tuple(ModContent.NPCType(), ProjectileID.FrostBeam), new int[] { 50, 108, 124, 140, 210 } }, { new Tuple(NPCID.PrimeCannon, ProjectileID.RocketSkeleton), new int[] { 60, 120, 148, 176, 264 } }, { new Tuple(NPCID.PrimeCannon, ProjectileID.BombSkeletronPrime), new int[] { 80, 160, 0, 0, 300 } }, { new Tuple(NPCID.PrimeLaser, ProjectileID.DeathLaser), new int[] { 50, 108, 124, 140, 210 } }, diff --git a/Events/BossRushEvent.cs b/Events/BossRushEvent.cs index 6ed24fce51..29ceb12688 100644 --- a/Events/BossRushEvent.cs +++ b/Events/BossRushEvent.cs @@ -217,7 +217,7 @@ namespace CalamityMod.Events new Boss(ModContent.NPCType(), TimeChangeContext.Day, permittedNPCs: ModContent.NPCType()), - new Boss(NPCID.SkeletronPrime, TimeChangeContext.Night, permittedNPCs: new int[] { ModContent.NPCType(), NPCID.PrimeCannon, NPCID.PrimeSaw, NPCID.PrimeVice, NPCID.PrimeLaser, NPCID.Probe }), + new Boss(NPCID.SkeletronPrime, TimeChangeContext.Night, permittedNPCs: new int[] { NPCID.PrimeCannon, NPCID.PrimeSaw, NPCID.PrimeVice, NPCID.PrimeLaser, NPCID.Probe }), new Boss(ModContent.NPCType(), TimeChangeContext.Night, dimnessFactor: 0.6f, permittedNPCs: new int[] { ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }), diff --git a/ExtraTextures/ChadPrime.png b/ExtraTextures/ChadPrime.png deleted file mode 100644 index 3bbc5902b0e0c058ca668c4ae70daf2b9f1a3967..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6702 zcmd6s2{hFGzsC_0lie^OO9mstPuYn<7-Jt1MKTl8*vS&gG7{N`CZ?F|D*I4Tp)50! z@I*$!*s_!*%6_Nk`Ty_p+~@r7z31L@?m2hP`JM0gd*=I_Gr!;bKCjRF{hlNnE7QZA zM>v_7m=2qp8QU?&6egwvk2nr6W>wBlN*M!lkew-<=}E8H7si6s)6mk8iK!-yYsa09 zu{NH4>ZQFll8u$P`34VpP(RUapG1@?T8PC<8p6w`3jrU!)v59TlNFzV^B_N!jiG z{b7kaRRvf`|Mks4MV5-Lf!FJBCF-E@MVL{IqN7+-QYgk|b4M%iLHZ|Q-vMt2c6_HP z|KmdemtyvG^Thn`SmgmZ9Qe}GhD)$44F7M93-$63ISb&0sUb7OfWSm5s{$=#B&Wuh zGodpj67TL*#P(_EM+>C@?lpkXaGmdwRg-N@NLbwk6TujcgBhyN0&*(H!Oq91$EqJY z68P0?d()@<^IYscd5rf)$;O@eK)9A39u^iI9kF#pL_2xy`&3ZuD?2Fnz0`>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wc-w;d?$bp`e^R9Cd70?YX#2Z-cJ@7!|tCB4$MP(H77?1GcvfiB$| z#e0qNZpT?3Q*XSPv=EDl>R1YV1$H1!IDBVl6u2EF*yUys4@7baR_!cf?X>{ix9@>Jy9KjXvqnLT8#@wGKNoy^s?8HVjXZxzd_ z@%^gz$F!bz53UP|C?8+$TM{DV zUxdz5J)#XS_ywJS7oH-3$YX}$t2byWm*~v(!=!#v&sOz}^6c&rtpHkJ-)C(ZcqD+E z`aXTOaZvLGfvEh#%;kmP)LHG+krIYOGBh`WaY!(Fv|B-7g+2U*Q$jSRZ-qT2gwKiM zgi0GH*Kh>hJc~hfE2mj^f8|Ql-la~}7X0ef*IT1O;!ph`R$iF_BTs}Z2#Q%{sa6d0 zkPK8XDNtR2%y7^A(Fx!tC6uT~oywLR+aq=TEjO@-tcm%4u0vX>LdqzIk~j-3b3cWZ ztL63F9R-6aKcGq(L#1=uIfjX81YTE`bSW|8j=7F=PhwrX?kJ|cQb*sKIhpjz7HUyMCR`TT*Pk-hXA+Q7{a}5p%^cedxzR!G}Aj7il7Qn-)S2EW!yxC zHB_G7*`;!#OfoB1RA;xQ<{;mU|Cd3ZTt_y!=^PlB z5X*BstPiwW4|OOp`to7g;U<~C8@%Wy%PKi%!(-ZXn_dK%Z7~#R`eF=?@vVe(q+0%^wTbRsEtc;()FUI~G`#O1N diff --git a/ExtraTextures/ChadPrimeHeadGlow.png b/ExtraTextures/ChadPrimeHeadGlow.png deleted file mode 100644 index e8b25ba236320b5c71f2c9b12554aec4e055346a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 588 zcmeAS@N?(olHy`uVBq!ia0vp^Jq!$t*EraKtfh+*rGXS0K>?@Yeao-tz{`I{lJ$s+7OwE#Q*m!0w^PbYXPg1LI z_^U2`pI4S&nPr^F5h&p#(k9TV=#t1G`Dtn0^6mBg_dZ=oIz&we0nIufQ1qH%>y*zL z<*zI6&YrVzyUkXgwaf<7c9u45UpISC4*&0!OTOGa`%c$CR}B()) + else if (npc.type == NPCID.SkeletronPrime) { - // HP boosted in Master Mode due to having two heads (piercing can make them die faster than normal here since they share an HP bar) - npc.lifeMax = (int)Math.Round(npc.lifeMax * (Main.masterMode ? 1.7 : 1.2)); + npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.2); npc.npcSlots = 12f; } else if (npc.type <= NPCID.PrimeLaser && npc.type >= NPCID.PrimeCannon) @@ -5728,26 +5727,6 @@ namespace CalamityMod.NPCs #region Check Dead public override bool CheckDead(NPC npc) { - if (npc.type == NPCID.SkeletronPrime) - { - if ((Main.masterMode || BossRushEvent.BossRushActive) && CalamityWorld.revenge) - { - // Kill the other head if he's still alive when this head dies - for (int i = 0; i < Main.maxNPCs; i++) - { - NPC nPC = Main.npc[i]; - if (nPC.active && nPC.type == ModContent.NPCType() && nPC.life > 0) - { - nPC.life = 0; - nPC.HitEffect(); - nPC.checkDead(); - nPC.active = false; - nPC.netUpdate = true; - } - } - } - } - if (npc.lifeMax > 1000 && npc.type != NPCID.DungeonSpirit && npc.type != NPCType() && npc.type != NPCType() && @@ -6306,11 +6285,11 @@ namespace CalamityMod.NPCs #region Drawing public override void FindFrame(NPC npc, int frameHeight) { - if (CalamityWorld.revenge || BossRushEvent.BossRushActive) + /*if (CalamityWorld.revenge || BossRushEvent.BossRushActive) { - if (npc.type == NPCID.SkeletronPrime || npc.type == ModContent.NPCType()) + if (npc.type == NPCID.SkeletronPrime) npc.frameCounter = 0D; - } + }*/ } // Debuff visuals. Alphabetical order as per usual, please @@ -6710,8 +6689,43 @@ namespace CalamityMod.NPCs if (CalamityWorld.revenge || BossRushEvent.BossRushActive) { - if (npc.type == NPCID.SkeletronPrime || npc.type == ModContent.NPCType() || CalamityLists.DestroyerIDs.Contains(npc.type)) + if (CalamityLists.DestroyerIDs.Contains(npc.type)) return false; + + // Allows correct frames to draw in Rev+ phases + // GFB can rot for all I care + if (npc.type == NPCID.SkeletronPrime && !NPC.IsMechQueenUp) + { + int frameHeight = TextureAssets.Npc[npc.type].Value.Height / Main.npcFrameCount[npc.type]; + if (npc.ai[1] == 0f || npc.ai[1] == 4f) + { + newAI[2] += 1f; + if (newAI[2] >= 12f) + { + newAI[2] = 0f; + newAI[3] += frameHeight; + + if (newAI[3] / frameHeight >= 2f) + newAI[3] = 0f; + } + } + + // Spinning probe spawn or fly over phase + else if (npc.ai[1] == 5f || npc.ai[1] == 6f) + { + newAI[2] = 0f; + newAI[3] = frameHeight; + } + + // Spinning phase + else + { + newAI[2] = 0f; + newAI[3] = frameHeight * 2; + } + + npc.frame.Y = (int)newAI[3]; + } } if (npc.type == NPCID.GolemHeadFree) @@ -7448,83 +7462,6 @@ namespace CalamityMod.NPCs } } - // His afterimages I can't get to work, so fuck it - else if (npc.type == NPCID.SkeletronPrime || npc.type == ModContent.NPCType()) - { - Texture2D npcTexture = (masterMode && revenge && npc.type == NPCID.SkeletronPrime) ? CalamityMod.ChadPrime.Value : TextureAssets.Npc[npc.type].Value; - int frameHeight = npcTexture.Height / Main.npcFrameCount[npc.type]; - - npc.frame.Y = (int)newAI[3]; - - // Mechdusa drawing - if (NPC.IsMechQueenUp) - { - if (npc.ai[1] == 0f || npc.ai[1] == 4f) - { - newAI[2] += 1f; - if (newAI[2] >= 12f) - { - newAI[2] = 0f; - newAI[3] += frameHeight; - if (newAI[3] / frameHeight >= 5) - newAI[3] = frameHeight * 3; - } - } - else - { - newAI[2] = 0f; - newAI[3] = frameHeight * 5; - } - } - - // Floating phase - else if (npc.ai[1] == 0f || npc.ai[1] == 4f) - { - newAI[2] += 1f; - if (newAI[2] >= 12f) - { - newAI[2] = 0f; - newAI[3] += frameHeight; - - if (newAI[3] / frameHeight >= 2f) - newAI[3] = 0f; - } - } - - // Spinning probe spawn or fly over phase - else if (npc.ai[1] == 5f || npc.ai[1] == 6f) - { - newAI[2] = 0f; - newAI[3] = frameHeight; - } - - // Spinning phase - else - { - newAI[2] = 0f; - newAI[3] = frameHeight * 2; - } - - npc.frame.Y = (int)newAI[3]; - - SpriteEffects spriteEffects = SpriteEffects.None; - if (npc.spriteDirection == 1) - spriteEffects = SpriteEffects.FlipHorizontally; - - spriteBatch.Draw(npcTexture, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, npc.GetAlpha(drawColor), npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0f); - - Color eyesColor = new Color(200, 200, 200, 0); - if (masterMode && revenge) - { - int alpha = 192; - eyesColor = npc.type == NPCType() ? new Color(150, 100, 255, alpha) : new Color(255, 255, 0, alpha); - Texture2D glowTexture = npc.type == NPCID.SkeletronPrime ? CalamityMod.ChadPrimeEyeGlowmask.Value : SkeletronPrime2.EyeTexture.Value; - spriteBatch.Draw(glowTexture, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, eyesColor, npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0f); - } - else - spriteBatch.Draw(TextureAssets.BoneEyes.Value, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, eyesColor, npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0f); - } - else if (npc.type == NPCID.Plantera) { // Percent life remaining diff --git a/NPCs/NormalNPCs/SkeletronPrime2.cs b/NPCs/NormalNPCs/SkeletronPrime2.cs deleted file mode 100644 index 2e7c5a641d..0000000000 --- a/NPCs/NormalNPCs/SkeletronPrime2.cs +++ /dev/null @@ -1,910 +0,0 @@ -using System; -using System.IO; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.DataStructures; -using CalamityMod.Events; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria; -using Terraria.Audio; -using Terraria.GameContent.Bestiary; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.NPCs.NormalNPCs -{ - public class SkeletronPrime2 : ModNPC - { - public override string BossHeadTexture => $"Terraria/Images/NPC_Head_Boss_18"; - - public static Asset EyeTexture; - - public const int BombTimeLeft = 600; - - public override void SetStaticDefaults() - { - Main.npcFrameCount[NPC.type] = 6; - NPCID.Sets.NPCBestiaryDrawModifiers bestiaryData = new NPCID.Sets.NPCBestiaryDrawModifiers() { Hide = true }; - NPCID.Sets.NPCBestiaryDrawOffset.Add(Type, bestiaryData); - if (!Main.dedServ) - { - EyeTexture = ModContent.Request("CalamityMod/ExtraTextures/SkeletronPrime2HeadGlow"); - } - } - - public override void SetDefaults() - { - NPC.Calamity().canBreakPlayerDefense = true; - NPC.aiStyle = NPCAIStyleID.SkeletronPrimeHead; - NPC.GetNPCDamage(); - NPC.DR_NERD(0.2f); - - NPC.width = 80; - NPC.height = 102; - if (Main.tenthAnniversaryWorld) - NPC.scale *= 0.5f; - if (Main.getGoodWorld) - NPC.scale *= 1.1f; - - NPC.defense = 24; - - NPC.lifeMax = 28000; - double HPBoost = CalamityServerConfig.Instance.BossHealthBoost * 0.01; - NPC.lifeMax += (int)(NPC.lifeMax * HPBoost); - - NPC.knockBackResist = 0f; - NPC.noGravity = true; - NPC.noTileCollide = true; - NPC.boss = true; - NPC.value = 200000f; - NPC.HitSound = SoundID.NPCHit4; - NPC.DeathSound = SoundID.NPCDeath14; - NPC.Calamity().VulnerableToElectricity = true; - NPC.Calamity().VulnerableToSickness = false; - AnimationType = NPCID.SkeletronPrime; - Music = MusicID.Boss3; - } - - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(NPC.localAI[0]); - writer.Write(NPC.localAI[1]); - writer.Write(NPC.localAI[2]); - writer.Write(NPC.localAI[3]); - for (int i = 0; i < 4; i++) - writer.Write(NPC.Calamity().newAI[i]); - } - - public override void ReceiveExtraAI(BinaryReader reader) - { - NPC.localAI[0] = reader.ReadSingle(); - NPC.localAI[1] = reader.ReadSingle(); - NPC.localAI[2] = reader.ReadSingle(); - NPC.localAI[3] = reader.ReadSingle(); - for (int i = 0; i < 4; i++) - NPC.Calamity().newAI[i] = reader.ReadSingle(); - } - - public override void BossHeadRotation(ref float rotation) - { - rotation = (NPC.ai[1] == 1f || NPC.ai[1] == 2f) ? NPC.rotation : 0f; - } - - public override void AI() - { - CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); - - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - - // Percent life remaining - float lifeRatio = NPC.life / (float)NPC.lifeMax; - - // Spawn arms - if (calamityGlobalNPC.newAI[1] == 0f) - { - calamityGlobalNPC.newAI[1] = 1f; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - // This head owns the Cannon and the Vice in Master Mode - int arm = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, NPCID.PrimeCannon, NPC.whoAmI); - Main.npc[arm].ai[0] = -1f; - Main.npc[arm].ai[1] = NPC.whoAmI; - Main.npc[arm].target = NPC.target; - Main.npc[arm].netUpdate = true; - - arm = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, NPCID.PrimeVice, NPC.whoAmI); - Main.npc[arm].ai[0] = -1f; - Main.npc[arm].ai[1] = NPC.whoAmI; - Main.npc[arm].target = NPC.target; - Main.npc[arm].ai[3] = 150f; - Main.npc[arm].netUpdate = true; - } - - NPC.SyncExtraAI(); - } - - if (!Main.npc[(int)NPC.ai[0]].active || Main.npc[(int)NPC.ai[0]].aiStyle != NPCAIStyleID.SkeletronPrimeHead) - { - NPC.life = 0; - NPC.HitEffect(); - NPC.active = false; - NPC.netUpdate = true; - } - else - { - // Link the HP of both heads - if (NPC.life > Main.npc[(int)NPC.ai[0]].life) - NPC.life = Main.npc[(int)NPC.ai[0]].life; - - // Push away from the lead head if too close, pull closer if too far, if Mechdusa isn't real - if (!NPC.IsMechQueenUp) - { - float pushVelocity = 0.25f; - if (Vector2.Distance(NPC.Center, Main.npc[(int)NPC.ai[0]].Center) < 80f * NPC.scale) - { - if (NPC.position.X < Main.npc[(int)NPC.ai[0]].position.X) - NPC.velocity.X -= pushVelocity; - else - NPC.velocity.X += pushVelocity; - - if (NPC.position.Y < Main.npc[(int)NPC.ai[0]].position.Y) - NPC.velocity.Y -= pushVelocity; - else - NPC.velocity.Y += pushVelocity; - } - else if (Vector2.Distance(NPC.Center, Main.npc[(int)NPC.ai[0]].Center) > 240f * NPC.scale) - { - if (NPC.position.X < Main.npc[(int)NPC.ai[0]].position.X) - NPC.velocity.X += pushVelocity; - else - NPC.velocity.X -= pushVelocity; - - if (NPC.position.Y < Main.npc[(int)NPC.ai[0]].position.Y) - NPC.velocity.Y += pushVelocity; - else - NPC.velocity.Y -= pushVelocity; - } - } - } - - // Check if arms are alive - bool cannonAlive = false; - bool laserAlive = false; - bool viceAlive = false; - bool sawAlive = false; - if (CalamityGlobalNPC.primeCannon != -1) - { - if (Main.npc[CalamityGlobalNPC.primeCannon].active) - cannonAlive = true; - } - if (CalamityGlobalNPC.primeLaser != -1) - { - if (Main.npc[CalamityGlobalNPC.primeLaser].active) - laserAlive = true; - } - if (CalamityGlobalNPC.primeVice != -1) - { - if (Main.npc[CalamityGlobalNPC.primeVice].active) - viceAlive = true; - } - if (CalamityGlobalNPC.primeSaw != -1) - { - if (Main.npc[CalamityGlobalNPC.primeSaw].active) - sawAlive = true; - } - bool allArmsDead = !cannonAlive && !laserAlive && !viceAlive && !sawAlive; - NPC.chaseable = allArmsDead; - - NPC.defense = NPC.defDefense; - - // Phases - bool phase2 = lifeRatio < 0.66f; - bool phase3 = lifeRatio < 0.33f; - bool spawnSpazmatism = lifeRatio < 0.5f && !bossRush && NPC.localAI[2] == 0f; - - // Spawn Spazmatism in Master Mode (just like Oblivion from Avalon) - if (spawnSpazmatism) - { - Player spazmatismSpawnPlayer = Main.player[Player.FindClosest(NPC.position, NPC.width, NPC.height)]; - SoundEngine.PlaySound(SoundID.Roar, spazmatismSpawnPlayer.Center); - if (Main.netMode != NetmodeID.MultiplayerClient) - NPC.SpawnOnPlayer(spazmatismSpawnPlayer.whoAmI, NPCID.Spazmatism); - - NPC.localAI[2] = 1f; - NPC.SyncVanillaLocalAI(); - } - - // Despawn - if (Main.npc[(int)NPC.ai[0]].ai[1] == 3f) - NPC.ai[1] = 3f; - - // Activate daytime enrage - if (Main.IsItDay() && !bossRush && NPC.ai[1] != 3f && NPC.ai[1] != 2f) - { - // Heal - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int healAmt = NPC.life - 300; - if (healAmt < 0) - { - int absHeal = Math.Abs(healAmt); - NPC.life += absHeal; - NPC.HealEffect(absHeal, true); - NPC.netUpdate = true; - } - } - - NPC.ai[1] = 2f; - SoundEngine.PlaySound(SoundID.ForceRoar, NPC.Center); - } - - // Adjust slowing debuff immunity - bool immuneToSlowingDebuffs = NPC.ai[1] == 5f; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; - - bool normalLaserRotation = NPC.localAI[1] % 2f == 0f; - - // Prevents cheap hits - bool canUseAttackInMaster = NPC.position.Y < Main.player[Main.npc[(int)NPC.ai[0]].target].position.Y - 350f; - - // Float near player - if (NPC.ai[1] == 0f || NPC.ai[1] == 4f) - { - // Avoid unfair bullshit - NPC.damage = 0; - - // Start other phases; if arms are dead, start with spin phase - bool otherHeadChargingOrSpinning = Main.npc[(int)NPC.ai[0]].ai[1] == 5f || Main.npc[(int)NPC.ai[0]].ai[1] == 1f; - - // Start spin phase after 1.875 seconds - NPC.ai[2] += phase3 ? 1.2f : 0.8f; - if (NPC.ai[2] >= (90f - (death ? 15f * (1f - lifeRatio) : 0f)) && (!otherHeadChargingOrSpinning || phase3) && canUseAttackInMaster) - { - bool shouldSpinAround = NPC.ai[1] == 4f && NPC.position.Y < Main.player[Main.npc[(int)NPC.ai[0]].target].position.Y - 400f && - Vector2.Distance(Main.player[Main.npc[(int)NPC.ai[0]].target].Center, NPC.Center) < 600f && Vector2.Distance(Main.player[Main.npc[(int)NPC.ai[0]].target].Center, NPC.Center) > 400f; - - bool shouldCharge = !phase2 && !allArmsDead && !CalamityWorld.LegendaryMode; - if (shouldCharge) - { - NPC.ai[2] = 0f; - NPC.ai[1] = 1f; - NPC.netUpdate = true; - } - else if (shouldSpinAround || NPC.ai[1] != 4f) - { - if (shouldSpinAround) - { - NPC.localAI[3] = 300f; - NPC.SyncVanillaLocalAI(); - } - - NPC.ai[2] = 0f; - NPC.ai[1] = shouldSpinAround ? 5f : 1f; - NPC.netUpdate = true; - } - } - - if (NPC.IsMechQueenUp) - NPC.rotation = NPC.rotation.AngleLerp(NPC.velocity.X / 15f * 0.5f, 0.75f); - else - 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 *= accelerationMult; - - float topVelocity = acceleration * 100f; - float deceleration = 0.7f; - - float headDecelerationUpDist = 0f; - float headDecelerationDownDist = 0f; - float headDecelerationHorizontalDist = 0f; - int headHorizontalDirection = ((!(Main.player[Main.npc[(int)NPC.ai[0]].target].Center.X < NPC.Center.X)) ? 1 : (-1)); - if (NPC.IsMechQueenUp) - { - headDecelerationHorizontalDist = -150f * (float)headHorizontalDirection; - headDecelerationUpDist = 50f; - headDecelerationDownDist = 50f; - } - - if (NPC.position.Y > Main.player[Main.npc[(int)NPC.ai[0]].target].position.Y - (400f + headDecelerationUpDist)) - { - if (NPC.velocity.Y > 0f) - NPC.velocity.Y *= deceleration; - - NPC.velocity.Y -= acceleration; - - if (NPC.velocity.Y > topVelocity) - NPC.velocity.Y = topVelocity; - } - else if (NPC.position.Y < Main.player[Main.npc[(int)NPC.ai[0]].target].position.Y - (450f + headDecelerationDownDist)) - { - if (NPC.velocity.Y < 0f) - NPC.velocity.Y *= deceleration; - - NPC.velocity.Y += acceleration; - - if (NPC.velocity.Y < -topVelocity) - NPC.velocity.Y = -topVelocity; - } - - if (NPC.Center.X > Main.player[Main.npc[(int)NPC.ai[0]].target].Center.X + (400f + headDecelerationHorizontalDist)) - { - if (NPC.velocity.X > 0f) - NPC.velocity.X *= deceleration; - - NPC.velocity.X -= acceleration; - - if (NPC.velocity.X > topVelocity) - NPC.velocity.X = topVelocity; - } - if (NPC.Center.X < Main.player[Main.npc[(int)NPC.ai[0]].target].Center.X - (400f + headDecelerationHorizontalDist)) - { - if (NPC.velocity.X < 0f) - NPC.velocity.X *= deceleration; - - NPC.velocity.X += acceleration; - - if (NPC.velocity.X < -topVelocity) - NPC.velocity.X = -topVelocity; - } - } - - else - { - // Spinning - if (NPC.ai[1] == 1f) - { - NPC.defense *= 2; - NPC.damage = NPC.defDamage * 2; - - calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = true; - - if (phase2 && Main.netMode != NetmodeID.MultiplayerClient) - { - NPC.localAI[0] += 1f; - if (NPC.localAI[0] >= 60f) - { - NPC.localAI[0] = 0f; - - int totalProjectiles = bossRush ? 20 : death ? 12 : 10; - float radians = MathHelper.TwoPi / totalProjectiles; - int type = ProjectileID.FrostBeam; - int damage = NPC.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - - float velocity = 4.5f; - double angleA = radians * 0.5; - double angleB = MathHelper.ToRadians(90f) - angleA; - float velocityX = (float)(velocity * Math.Sin(angleA) / Math.Sin(angleB)); - Vector2 spinningPoint = normalLaserRotation ? new Vector2(0f, -velocity) : new Vector2(-velocityX, -velocity); - for (int k = 0; k < totalProjectiles; k++) - { - Vector2 laserFireDirection = spinningPoint.RotatedBy(radians * k); - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + laserFireDirection.SafeNormalize(Vector2.UnitY) * 140f, laserFireDirection, type, damage, 0f, Main.myPlayer, 1f, 0f); - Main.projectile[proj].timeLeft = 600; - } - NPC.localAI[1] += 1f; - } - } - - NPC.ai[2] += 1f; - if (NPC.ai[2] == 2f) - SoundEngine.PlaySound(SoundID.ForceRoar, NPC.Center); - - // Spin for 3 seconds then return to floating phase - float phaseTimer = 240f; - if (phase2 && !phase3) - phaseTimer += 60f; - - if (NPC.ai[2] >= (phaseTimer - (death ? 60f * (1f - lifeRatio) : 0f))) - { - NPC.ai[2] = 0f; - NPC.ai[1] = 4f; - NPC.localAI[0] = 0f; - } - - if (NPC.IsMechQueenUp) - NPC.rotation = NPC.rotation.AngleLerp(NPC.velocity.X / 15f * 0.5f, 0.75f); - else - NPC.rotation += NPC.direction * 0.3f; - - Vector2 headPosition = NPC.Center; - float headTargetX = Main.player[Main.npc[(int)NPC.ai[0]].target].Center.X - headPosition.X; - float headTargetY = Main.player[Main.npc[(int)NPC.ai[0]].target].Center.Y - headPosition.Y; - float headTargetDistance = (float)Math.Sqrt(headTargetX * headTargetX + headTargetY * headTargetY); - - float speed = bossRush ? 12f : 8f; - if (phase2) - speed += 0.5f; - if (phase3) - speed += 0.5f; - - if (headTargetDistance > 150f) - { - float baseDistanceVelocityMult = 1f + MathHelper.Clamp((headTargetDistance - 150f) * 0.0015f, 0.05f, 1.5f); - speed *= baseDistanceVelocityMult; - } - - if (NPC.IsMechQueenUp) - { - float mechdusaSpeedMult = (NPC.npcsFoundForCheckActive[NPCID.TheDestroyerBody] ? 0.6f : 0.75f); - speed *= mechdusaSpeedMult; - } - - headTargetDistance = speed / headTargetDistance; - NPC.velocity.X = headTargetX * headTargetDistance; - NPC.velocity.Y = headTargetY * headTargetDistance; - - if (NPC.IsMechQueenUp) - { - float mechdusaAccelMult = Vector2.Distance(NPC.Center, Main.player[Main.npc[(int)NPC.ai[0]].target].Center); - if (mechdusaAccelMult < 0.1f) - mechdusaAccelMult = 0f; - - if (mechdusaAccelMult < speed) - NPC.velocity = NPC.velocity.SafeNormalize(Vector2.Zero) * mechdusaAccelMult; - } - } - - // Daytime enrage - if (NPC.ai[1] == 2f) - { - NPC.damage = 1000; - calamityGlobalNPC.DR = 0.9999f; - calamityGlobalNPC.unbreakableDR = true; - - calamityGlobalNPC.CurrentlyEnraged = true; - calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = true; - - if (NPC.IsMechQueenUp) - NPC.rotation = NPC.rotation.AngleLerp(NPC.velocity.X / 15f * 0.5f, 0.75f); - else - NPC.rotation += NPC.direction * 0.3f; - - Vector2 enragedHeadPosition = NPC.Center; - float enragedHeadTargetX = Main.player[Main.npc[(int)NPC.ai[0]].target].Center.X - enragedHeadPosition.X; - float enragedHeadTargetY = Main.player[Main.npc[(int)NPC.ai[0]].target].Center.Y - enragedHeadPosition.Y; - float enragedHeadTargetDist = (float)Math.Sqrt(enragedHeadTargetX * enragedHeadTargetX + enragedHeadTargetY * enragedHeadTargetY); - - float enragedHeadSpeed = 10f; - enragedHeadSpeed += enragedHeadTargetDist / 100f; - if (enragedHeadSpeed < 8f) - enragedHeadSpeed = 8f; - if (enragedHeadSpeed > 32f) - enragedHeadSpeed = 32f; - - enragedHeadTargetDist = enragedHeadSpeed / enragedHeadTargetDist; - NPC.velocity.X = enragedHeadTargetX * enragedHeadTargetDist; - NPC.velocity.Y = enragedHeadTargetY * enragedHeadTargetDist; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - NPC.localAI[0] += 1f; - if (NPC.localAI[0] >= 60f) - { - NPC.localAI[0] = 0f; - Vector2 headCenter = NPC.Center; - if (Collision.CanHit(headCenter, 1, 1, Main.player[Main.npc[(int)NPC.ai[0]].target].position, Main.player[Main.npc[(int)NPC.ai[0]].target].width, Main.player[Main.npc[(int)NPC.ai[0]].target].height)) - { - enragedHeadSpeed = 7f; - float enragedHeadSkullTargetX = Main.player[Main.npc[(int)NPC.ai[0]].target].Center.X - headCenter.X + Main.rand.Next(-20, 21); - float enragedHeadSkullTargetY = Main.player[Main.npc[(int)NPC.ai[0]].target].Center.Y - headCenter.Y + Main.rand.Next(-20, 21); - float enragedHeadSkullTargetDist = (float)Math.Sqrt(enragedHeadSkullTargetX * enragedHeadSkullTargetX + enragedHeadSkullTargetY * enragedHeadSkullTargetY); - enragedHeadSkullTargetDist = enragedHeadSpeed / enragedHeadSkullTargetDist; - enragedHeadSkullTargetX *= enragedHeadSkullTargetDist; - enragedHeadSkullTargetY *= enragedHeadSkullTargetDist; - - Vector2 value = new Vector2(enragedHeadSkullTargetX * 1f + Main.rand.Next(-50, 51) * 0.01f, enragedHeadSkullTargetY * 1f + Main.rand.Next(-50, 51) * 0.01f).SafeNormalize(Vector2.UnitY); - value *= enragedHeadSpeed; - value += NPC.velocity; - enragedHeadSkullTargetX = value.X; - enragedHeadSkullTargetY = value.Y; - - int type = ProjectileID.Skull; - headCenter += value * 5f; - int enragedSkulls = Projectile.NewProjectile(NPC.GetSource_FromAI(), headCenter.X, headCenter.Y, enragedHeadSkullTargetX, enragedHeadSkullTargetY, type, 250, 0f, Main.myPlayer, -1f, 0f); - Main.projectile[enragedSkulls].timeLeft = 300; - } - } - } - } - - // Despawning - if (NPC.ai[1] == 3f) - { - // Avoid unfair bullshit - NPC.damage = 0; - - if (NPC.IsMechQueenUp) - { - int mechdusaBossDespawning = NPC.FindFirstNPC(NPCID.Retinazer); - if (mechdusaBossDespawning >= 0) - Main.npc[mechdusaBossDespawning].EncourageDespawn(5); - - mechdusaBossDespawning = NPC.FindFirstNPC(NPCID.Spazmatism); - if (mechdusaBossDespawning >= 0) - Main.npc[mechdusaBossDespawning].EncourageDespawn(5); - - if (!NPC.AnyNPCs(NPCID.Retinazer) && !NPC.AnyNPCs(NPCID.Spazmatism)) - { - mechdusaBossDespawning = NPC.FindFirstNPC(NPCID.TheDestroyer); - if (mechdusaBossDespawning >= 0) - Main.npc[mechdusaBossDespawning].Transform(NPCID.TheDestroyerTail); - - NPC.EncourageDespawn(5); - } - - NPC.velocity.Y += 0.1f; - if (NPC.velocity.Y < 0f) - NPC.velocity.Y *= 0.95f; - - NPC.velocity.X *= 0.95f; - if (NPC.velocity.Y > 13f) - NPC.velocity.Y = 13f; - } - else - { - NPC.velocity.Y += 0.1f; - if (NPC.velocity.Y < 0f) - NPC.velocity.Y *= 0.9f; - - NPC.velocity.X *= 0.9f; - - if (NPC.timeLeft > 500) - NPC.timeLeft = 500; - } - } - - // Fly around in a circle - if (NPC.ai[1] == 5f) - { - // Avoid unfair bullshit - NPC.damage = 0; - - NPC.ai[2] += 1f; - - NPC.rotation = NPC.velocity.X / 50f; - - float bombSpawnDivisor = bossRush ? 14f : death ? 22f - (float)Math.Round(5f * (1f - lifeRatio)) : 22f; - float totalBombs = 6f; - int bombSpread = bossRush ? 250 : death ? 125 : 100; - - // Spin for about 3 seconds - float spinVelocity = 24f; - if (NPC.ai[2] == 2f) - { - // Play angry noise - SoundEngine.PlaySound(SoundID.ForceRoar, NPC.Center); - - // Set spin direction - if (Main.player[Main.npc[(int)NPC.ai[0]].target].velocity.X > 0f) - calamityGlobalNPC.newAI[0] = 1f; - else if (Main.player[Main.npc[(int)NPC.ai[0]].target].velocity.X < 0f) - calamityGlobalNPC.newAI[0] = -1f; - else - calamityGlobalNPC.newAI[0] = Main.player[Main.npc[(int)NPC.ai[0]].target].direction; - - // Set spin velocity - NPC.velocity.X = MathHelper.Pi * NPC.localAI[3] / spinVelocity; - NPC.velocity *= -calamityGlobalNPC.newAI[0]; - NPC.SyncExtraAI(); - NPC.netUpdate = true; - } - - // Maintain velocity and spit homing bombs - else if (NPC.ai[2] > 2f) - { - NPC.velocity = NPC.velocity.RotatedBy(MathHelper.Pi / spinVelocity * -calamityGlobalNPC.newAI[0]); - if (NPC.ai[2] == 3f) - NPC.velocity *= 0.6f; - - if (NPC.ai[2] % bombSpawnDivisor == 0f) - { - NPC.localAI[0] += 1f; - - if (Vector2.Distance(Main.player[Main.npc[(int)NPC.ai[0]].target].Center, NPC.Center) > 64f) - { - SoundEngine.PlaySound(SoundID.Item61, NPC.Center); - CreateParticles(NPC, new Vector2(NPC.Center.X + Main.rand.Next(NPC.width / 2), NPC.Center.Y + 4f)); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - Vector2 headCenter = NPC.Center; - float enragedHeadSpeed = 6f + (death ? 2f * (1f - lifeRatio) : 0f); - float enragedHeadBombTargetX = Main.player[Main.npc[(int)NPC.ai[0]].target].Center.X - headCenter.X + Main.rand.Next(-20, 21); - float enragedHeadBombTargetY = Main.player[Main.npc[(int)NPC.ai[0]].target].Center.Y - headCenter.Y + Main.rand.Next(-20, 21); - float enragedHeadBombTargetDist = (float)Math.Sqrt(enragedHeadBombTargetX * enragedHeadBombTargetX + enragedHeadBombTargetY * enragedHeadBombTargetY); - enragedHeadBombTargetDist = enragedHeadSpeed / enragedHeadBombTargetDist; - enragedHeadBombTargetX *= enragedHeadBombTargetDist; - enragedHeadBombTargetY *= enragedHeadBombTargetDist; - - Vector2 value = new Vector2(enragedHeadBombTargetX + Main.rand.Next(-bombSpread, bombSpread + 1) * 0.01f, enragedHeadBombTargetY + Main.rand.Next(-bombSpread, bombSpread + 1) * 0.01f).SafeNormalize(Vector2.UnitY); - value *= enragedHeadSpeed; - enragedHeadBombTargetX = value.X; - enragedHeadBombTargetY = value.Y; - - int type = ProjectileID.BombSkeletronPrime; - int damage = NPC.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - - int enragedBombs = Projectile.NewProjectile(NPC.GetSource_FromAI(), headCenter.X, headCenter.Y + 30f, enragedHeadBombTargetX, enragedHeadBombTargetY, type, damage, 0f, Main.myPlayer, -1f); - Main.projectile[enragedBombs].timeLeft = BombTimeLeft; - Main.projectile[enragedBombs].tileCollide = false; - } - } - - // Go to floating phase, or spinning phase if in phase 2 - if (NPC.localAI[0] >= totalBombs) - { - NPC.velocity = NPC.velocity.SafeNormalize(Vector2.UnitY); - - // Fly overhead and spit spreads of bombs into the air if on low health - NPC.ai[1] = phase3 ? 6f : 1f; - NPC.ai[2] = 0f; - NPC.localAI[3] = 0f; - NPC.localAI[0] = 0f; - calamityGlobalNPC.newAI[0] = 0f; - NPC.SyncVanillaLocalAI(); - NPC.SyncExtraAI(); - NPC.netUpdate = true; - } - } - } - } - - // Fly overhead and spit bombs - if (NPC.ai[1] == 6f) - { - // Avoid unfair bullshit - NPC.damage = 0; - - NPC.rotation = NPC.velocity.X / 15f; - - float flightVelocity = bossRush ? 32f : death ? 28f : 24f; - float flightAcceleration = bossRush ? 1.28f : death ? 1.12f : 0.96f; - - Vector2 destination = new Vector2(Main.player[Main.npc[(int)NPC.ai[0]].target].Center.X, Main.player[Main.npc[(int)NPC.ai[0]].target].Center.Y - 500f); - NPC.SimpleFlyMovement((destination - NPC.Center).SafeNormalize(Vector2.UnitY) * flightVelocity, flightAcceleration); - - // Spit bombs and then go to floating phase - NPC.localAI[3] += 1f; - if (Vector2.Distance(NPC.Center, destination) < 160f || NPC.ai[2] > 0f || NPC.localAI[3] > 120f) - { - float bombSpawnDivisor = death ? 50f : 60f; - float totalBombSpreads = 2f; - NPC.ai[2] += 1f; - if (NPC.ai[2] % bombSpawnDivisor == 0f) - { - NPC.localAI[0] += 1f; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int totalProjectiles = bossRush ? 24 : 12; - float radians = MathHelper.TwoPi / totalProjectiles; - int type = ProjectileID.BombSkeletronPrime; - int damage = NPC.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - - float velocity = 12f; - double angleA = radians * 0.5; - double angleB = MathHelper.ToRadians(90f) - angleA; - float velocityX = (float)(velocity * Math.Sin(angleA) / Math.Sin(angleB)); - Vector2 spinningPoint = normalLaserRotation ? new Vector2(0f, -velocity) : new Vector2(-velocityX, -velocity); - Vector2 upwardVelocity = Vector2.UnitY * velocity; - for (int k = 0; k < totalProjectiles; k++) - { - 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 = BombTimeLeft; - Main.projectile[proj].tileCollide = false; - } - NPC.localAI[1] += 1f; - } - - SoundEngine.PlaySound(SoundID.Item62, NPC.Center); - CreateParticles(NPC, new Vector2(NPC.Center.X, NPC.Center.Y + 4f), 5); - - if (NPC.localAI[0] >= totalBombSpreads) - { - NPC.ai[1] = 0f; - NPC.ai[2] = 0f; - NPC.localAI[3] = 0f; - calamityGlobalNPC.newAI[0] = 0f; - NPC.localAI[0] = 0f; - NPC.SyncVanillaLocalAI(); - NPC.SyncExtraAI(); - NPC.netUpdate = true; - } - } - } - } - } - } - - private void CreateParticles(NPC npc, Vector2 position, int amountMultiplier = 1) - { - int firstDustCloudParticleAmount = 30 * amountMultiplier; - int secondDustCloudParticleAmount = 20 * amountMultiplier; - int goreAmount = 2 * amountMultiplier; - - for (int dustIndex = 0; dustIndex < firstDustCloudParticleAmount; dustIndex++) - { - int dust = Dust.NewDust(npc.position, npc.width, npc.height, DustID.Smoke, 0f, 0f, 100, default(Color), 1.5f); - Main.dust[dust].velocity *= 1.4f; - } - - for (int dustIndex = 0; dustIndex < secondDustCloudParticleAmount; dustIndex++) - { - int dust = Dust.NewDust(npc.position, npc.width, npc.height, DustID.Torch, 0f, 0f, 100, default(Color), 3.5f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 7f; - dust = Dust.NewDust(npc.position, npc.width, npc.height, DustID.Torch, 0f, 0f, 100, default(Color), 1.5f); - Main.dust[dust].velocity *= 3f; - } - - for (int goreIndex = 0; goreIndex < goreAmount; goreIndex++) - { - float goreVelocityMultiplier = 0.4f; - if (goreIndex >= goreAmount / 2) - goreVelocityMultiplier = 0.8f; - - int gore = Gore.NewGore(npc.GetSource_FromAI(), npc.Center, default(Vector2), Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= goreVelocityMultiplier; - Main.gore[gore].velocity.X += 1f; - Main.gore[gore].velocity.Y += 1f; - gore = Gore.NewGore(npc.GetSource_FromAI(), npc.Center, default(Vector2), Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= goreVelocityMultiplier; - Main.gore[gore].velocity.X -= 1f; - Main.gore[gore].velocity.Y += 1f; - gore = Gore.NewGore(npc.GetSource_FromAI(), npc.Center, default(Vector2), Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= goreVelocityMultiplier; - Main.gore[gore].velocity.X += 1f; - Main.gore[gore].velocity.Y -= 1f; - gore = Gore.NewGore(npc.GetSource_FromAI(), npc.Center, default(Vector2), Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= goreVelocityMultiplier; - Main.gore[gore].velocity.X -= 1f; - Main.gore[gore].velocity.Y -= 1f; - } - } - - public override void BossLoot(ref string name, ref int potionType) => potionType = ItemID.GreaterHealingPotion; - - public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) - { - NPC.lifeMax = (int)(NPC.lifeMax * 0.75f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); - } - - public override bool CheckActive() => false; - - public override bool CheckDead() - { - // Kill the lead head if he's still alive when this head dies - for (int i = 0; i < Main.maxNPCs; i++) - { - NPC nPC = Main.npc[i]; - if (nPC.active && nPC.type == NPCID.SkeletronPrime && nPC.life > 0) - { - nPC.life = 0; - nPC.HitEffect(); - nPC.checkDead(); - nPC.active = false; - nPC.netUpdate = true; - } - } - - return true; - } - - public override void HitEffect(NPC.HitInfo hit) - { - if (NPC.life <= 0) - { - if (Main.netMode != NetmodeID.Server) - { - Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, 149); - Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, 150); - - int num802 = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default(Vector2), Main.rand.Next(61, 64)); - Gore gore2 = Main.gore[num802]; - gore2.velocity *= 0.4f; - Main.gore[num802].velocity.X += 1f; - Main.gore[num802].velocity.Y += 1f; - - num802 = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default(Vector2), Main.rand.Next(61, 64)); - gore2 = Main.gore[num802]; - gore2.velocity *= 0.4f; - Main.gore[num802].velocity.X -= 1f; - Main.gore[num802].velocity.Y += 1f; - - num802 = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default(Vector2), Main.rand.Next(61, 64)); - gore2 = Main.gore[num802]; - gore2.velocity *= 0.4f; - Main.gore[num802].velocity.X += 1f; - Main.gore[num802].velocity.Y -= 1f; - - num802 = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default(Vector2), Main.rand.Next(61, 64)); - gore2 = Main.gore[num802]; - gore2.velocity *= 0.4f; - Main.gore[num802].velocity.X -= 1f; - Main.gore[num802].velocity.Y -= 1f; - } - - for (int num798 = 0; num798 < 10; num798++) - { - int num799 = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Smoke, 0f, 0f, 100, default(Color), 1.5f); - Dust dust = Main.dust[num799]; - dust.velocity *= 1.4f; - } - - for (int num800 = 0; num800 < 5; num800++) - { - int num801 = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, 0f, 0f, 100, default(Color), 2.5f); - Main.dust[num801].noGravity = true; - Dust dust = Main.dust[num801]; - dust.velocity *= 5f; - num801 = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, 0f, 0f, 100, default(Color), 1.5f); - dust = Main.dust[num801]; - dust.velocity *= 3f; - } - } - } - } -} diff --git a/NPCs/NormalNPCs/SkeletronPrime2.png b/NPCs/NormalNPCs/SkeletronPrime2.png deleted file mode 100644 index c019c3130896adbdecba05818d265649428f143b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6696 zcmchcc{G&$-^XVdV=x$lT!Un+W6NY6TUo|3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4tn z*hFjPSC^$QrRHs5vSX*n;mrf|V-pJSTRkGH$IL9q-l}_fGePDLq{z{b>0`Xyj-n}th3LQzKqeb^^IT| zp`ad2n*FAM4ifQVJBan5X1UVNnsr$t`NDCXI{sW*@({C)P*klstwVb>?^;DQti^~S>`I&&660|Jel?H6ACIQcz-<+^ZWZ-W z<0rl*hh}VYavoW6RTW3u7Id(DKpeWLDVdH#O<@nF8G79p=7G(^8iVf?9U@iJ;5sv8 zO^6Ad?}4SL(($*~%J@hswlW;AU_~BI7v)8u?4Yl&f6am{CRq%FjDyWRmr}m0c)yWl zrb16OT_SD<28JGSdi6gv7jRAWJIx%7X?-c!|5_zBpMmMzu49Y`i}NYgGE0ddQo!{b zQ$@Mkip++PS(o%gNOm&O+in&?6^95YhjyLnFT3hh{^J-ejMQNewasT?b@!R~i3AlD zI1VM1ZK$0GnbA<1xL{Xxnbg)RH1`jzh}@3(D^_%kl>Ylzu>za#&)H+o)zk0$Ddzc# Q`40++U`)i{GxSLK4{puH6951J diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs index 62e5159255..c42cb72a79 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs @@ -150,8 +150,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Check if other segments are still alive, if not, die - // Check for Oblivion too, since having a max power Destroyer during that fight would be turbo cancer - bool oblivionAlive = false; if (npc.type > NPCID.TheDestroyer) { bool shouldDespawn = true; @@ -178,39 +176,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.active = false; } } - else - { - if (masterMode && !bossRush && npc.localAI[3] != -1f) - { - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && (Main.npc[i].type == ModContent.NPCType() || Main.npc[i].type == NPCID.SkeletronPrime)) - { - oblivionAlive = true; - break; - } - } - } - - // Set variable to force despawn when Prime dies in Master Rev+ - // Set to -1f if Prime isn't alive when summoned - if (npc.localAI[3] == 0f) - { - if (oblivionAlive) - npc.localAI[3] = 1f; - else - npc.localAI[3] = -1f; - - npc.SyncExtraAI(); - } - } // Total segment variable int totalSegments = Main.getGoodWorld ? 100 : 80; // Calculate aggression based on how many broken segments there are float brokenSegmentAggressionMultiplier = 1f; - if (npc.type == NPCID.TheDestroyer && !oblivionAlive) + if (npc.type == NPCID.TheDestroyer) { int numProbeSegments = 0; for (int i = 0; i < Main.maxNPCs; i++) @@ -236,51 +208,39 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Increase velocity based on distance float velocityMultiplier = increaseSpeedMore ? 2f : increaseSpeed ? 1.5f : 1f; + noFlyZoneBoxHeight -= death ? 400 : (int)(400f * (1f - lifeRatio)); - // If Oblivion is alive, don't fly, don't spit laser spreads, use the default vanilla no fly zone, reduce segment count to 60, use base speed and use base turn speed - if (oblivionAlive) + float segmentVelocityBoost = death ? (flyAtTarget ? 4.5f : 6f) * (1f - lifeRatio) : (flyAtTarget ? 3f : 4f) * (1f - lifeRatio); + float speedBoost = death ? (flyAtTarget ? 0.1125f : 0.15f) * (1f - lifeRatio) : (flyAtTarget ? 0.075f : 0.1f) * (1f - lifeRatio); + float turnSpeedBoost = death ? 0.18f * (1f - lifeRatio) : 0.12f * (1f - lifeRatio); + + segmentVelocity += segmentVelocityBoost; + speed += speedBoost; + turnSpeed += turnSpeedBoost; + + segmentVelocity += 5f * enrageScale; + speed += 0.05f * enrageScale; + turnSpeed += 0.075f * enrageScale; + + if (flyAtTarget) { - calamityGlobalNPC.newAI[3] = 0f; - totalSegments = Main.getGoodWorld ? 75 : 60; - spitLaserSpreads = false; - noFlyZoneBoxHeight = 2000; + float speedMultiplier = phase5 ? 1.8f : phase4 ? 1.65f : 1.5f; + speed *= speedMultiplier; } - else + + segmentVelocity *= velocityMultiplier; + speed *= velocityMultiplier; + turnSpeed *= velocityMultiplier; + + segmentVelocity *= brokenSegmentAggressionMultiplier; + speed *= brokenSegmentAggressionMultiplier; + turnSpeed *= brokenSegmentAggressionMultiplier; + + if (Main.getGoodWorld) { - noFlyZoneBoxHeight -= death ? 400 : (int)(400f * (1f - lifeRatio)); - - float segmentVelocityBoost = death ? (flyAtTarget ? 4.5f : 6f) * (1f - lifeRatio) : (flyAtTarget ? 3f : 4f) * (1f - lifeRatio); - float speedBoost = death ? (flyAtTarget ? 0.1125f : 0.15f) * (1f - lifeRatio) : (flyAtTarget ? 0.075f : 0.1f) * (1f - lifeRatio); - float turnSpeedBoost = death ? 0.18f * (1f - lifeRatio) : 0.12f * (1f - lifeRatio); - - segmentVelocity += segmentVelocityBoost; - speed += speedBoost; - turnSpeed += turnSpeedBoost; - - segmentVelocity += 5f * enrageScale; - speed += 0.05f * enrageScale; - turnSpeed += 0.075f * enrageScale; - - if (flyAtTarget) - { - float speedMultiplier = phase5 ? 1.8f : phase4 ? 1.65f : 1.5f; - speed *= speedMultiplier; - } - - segmentVelocity *= velocityMultiplier; - speed *= velocityMultiplier; - turnSpeed *= velocityMultiplier; - - segmentVelocity *= brokenSegmentAggressionMultiplier; - speed *= brokenSegmentAggressionMultiplier; - turnSpeed *= brokenSegmentAggressionMultiplier; - - if (Main.getGoodWorld) - { - segmentVelocity *= 1.2f; - speed *= 1.2f; - turnSpeed *= 1.2f; - } + segmentVelocity *= 1.2f; + speed *= 1.2f; + turnSpeed *= 1.2f; } bool probeLaunched = npc.ai[2] == 1f; @@ -780,9 +740,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Despawn - bool oblivionWasAlive = npc.localAI[3] == 1f && !oblivionAlive; - bool oblivionFightDespawn = (oblivionAlive && lifeRatio < 0.75f) || oblivionWasAlive; - if (player.dead || oblivionFightDespawn) + if (player.dead) { shouldFly = false; npc.velocity.Y += 2f; @@ -1045,11 +1003,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Force the fucker to turn around in ground phase in Master - // Turns slower if Oblivion is alive, for fairness if (npc.type == NPCID.TheDestroyer && masterMode && !flyAtTarget) { if (npc.Distance(player.Center) > 2000f) - npc.velocity += (player.Center - npc.Center).SafeNormalize(Vector2.UnitY) * (oblivionAlive ? speed : turnSpeed); + npc.velocity += (player.Center - npc.Center).SafeNormalize(Vector2.UnitY) * turnSpeed; } if (NPC.IsMechQueenUp && npc.type == NPCID.TheDestroyer) @@ -1747,7 +1704,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { bool bossRush = BossRushEvent.BossRushActive; bool masterMode = Main.masterMode || bossRush; - bool oblivionAlive = npc.ai[1] == 1f; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -1791,12 +1747,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int i = 0; i < Main.maxNPCs; i++) { - if (masterMode && !bossRush && npc.ai[1] == 0f) - { - if (Main.npc[i].active && (Main.npc[i].type == ModContent.NPCType() || Main.npc[i].type == NPCID.SkeletronPrime)) - npc.ai[1] = 1f; - } - if (i != npc.whoAmI && Main.npc[i].active && Main.npc[i].type == npc.type) { Vector2 otherProbeDist = Main.npc[i].Center - npc.Center; @@ -1924,7 +1874,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses damage = (int)(damage * secondMechMultiplier); } - int totalProjectiles = oblivionAlive ? 2 : (CalamityWorld.death || bossRush) ? 3 : 1; + int totalProjectiles = (CalamityWorld.death || bossRush) ? 3 : 1; Vector2 npcCenter = new Vector2(probeTargetX, probeTargetY); if (NPC.IsMechQueenUp) { diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs index 7a7965cf58..020264f3cc 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs @@ -35,114 +35,42 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Spawn arms if (calamityGlobalNPC.newAI[1] == 0f) { + CalamityUtils.CalamityTargeting(npc, CalamityTargetingParameters.BossDefaults); calamityGlobalNPC.newAI[1] = 1f; if (Main.netMode != NetmodeID.MultiplayerClient) { - // Spawn second head in Master Mode - // The main head owns the Saw and the Laser in Master Mode - if (masterMode) - { - int head = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, ModContent.NPCType(), npc.whoAmI); - Main.npc[head].ai[0] = npc.whoAmI; - Main.npc[head].target = npc.target; - Main.npc[head].netUpdate = true; - npc.ai[0] = head; + int arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeCannon, npc.whoAmI); + Main.npc[arm].ai[0] = -1f; + Main.npc[arm].ai[1] = npc.whoAmI; + Main.npc[arm].target = npc.target; + Main.npc[arm].netUpdate = true; - int arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeSaw, npc.whoAmI); - Main.npc[arm].ai[0] = 1f; - Main.npc[arm].ai[1] = npc.whoAmI; - Main.npc[arm].target = npc.target; - Main.npc[arm].netUpdate = true; + arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeSaw, npc.whoAmI); + Main.npc[arm].ai[0] = 1f; + Main.npc[arm].ai[1] = npc.whoAmI; + Main.npc[arm].target = npc.target; + Main.npc[arm].netUpdate = true; - arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeLaser, npc.whoAmI); - Main.npc[arm].ai[0] = 1f; - Main.npc[arm].ai[1] = npc.whoAmI; - Main.npc[arm].target = npc.target; - Main.npc[arm].netUpdate = true; - Main.npc[arm].ai[3] = 150f; - } - else - { - int arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeCannon, npc.whoAmI); - Main.npc[arm].ai[0] = -1f; - Main.npc[arm].ai[1] = npc.whoAmI; - Main.npc[arm].target = npc.target; - Main.npc[arm].netUpdate = true; + arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeVice, npc.whoAmI); + Main.npc[arm].ai[0] = -1f; + Main.npc[arm].ai[1] = npc.whoAmI; + Main.npc[arm].target = npc.target; + Main.npc[arm].ai[3] = 150f; + Main.npc[arm].netUpdate = true; - arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeSaw, npc.whoAmI); - Main.npc[arm].ai[0] = 1f; - Main.npc[arm].ai[1] = npc.whoAmI; - Main.npc[arm].target = npc.target; - Main.npc[arm].netUpdate = true; - - arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeVice, npc.whoAmI); - Main.npc[arm].ai[0] = -1f; - Main.npc[arm].ai[1] = npc.whoAmI; - Main.npc[arm].target = npc.target; - Main.npc[arm].ai[3] = 150f; - Main.npc[arm].netUpdate = true; - - arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeLaser, npc.whoAmI); - Main.npc[arm].ai[0] = 1f; - Main.npc[arm].ai[1] = npc.whoAmI; - Main.npc[arm].target = npc.target; - Main.npc[arm].netUpdate = true; - Main.npc[arm].ai[3] = 150f; - } + arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeLaser, npc.whoAmI); + Main.npc[arm].ai[0] = 1f; + Main.npc[arm].ai[1] = npc.whoAmI; + Main.npc[arm].target = npc.target; + Main.npc[arm].netUpdate = true; + Main.npc[arm].ai[3] = 150f; } npc.netUpdate = true; npc.SyncExtraAI(); } - if (masterMode) - { - if (!Main.npc[(int)npc.ai[0]].active || Main.npc[(int)npc.ai[0]].aiStyle != NPCAIStyleID.SkeletronPrimeHead) - { - npc.life = 0; - npc.HitEffect(); - npc.active = false; - npc.netUpdate = true; - } - else - { - // Link the HP of both heads - if (npc.life > Main.npc[(int)npc.ai[0]].life) - npc.life = Main.npc[(int)npc.ai[0]].life; - - // Push away from the lead head if too close, pull closer if too far, if Mechdusa isn't real - if (!NPC.IsMechQueenUp) - { - float pushVelocity = 0.25f; - if (Vector2.Distance(npc.Center, Main.npc[(int)npc.ai[0]].Center) < 80f * npc.scale) - { - if (npc.position.X < Main.npc[(int)npc.ai[0]].position.X) - npc.velocity.X -= pushVelocity; - else - npc.velocity.X += pushVelocity; - - if (npc.position.Y < Main.npc[(int)npc.ai[0]].position.Y) - npc.velocity.Y -= pushVelocity; - else - npc.velocity.Y += pushVelocity; - } - else if (Vector2.Distance(npc.Center, Main.npc[(int)npc.ai[0]].Center) > 240f * npc.scale) - { - if (npc.position.X < Main.npc[(int)npc.ai[0]].position.X) - npc.velocity.X += pushVelocity; - else - npc.velocity.X -= pushVelocity; - - if (npc.position.Y < Main.npc[(int)npc.ai[0]].position.Y) - npc.velocity.Y += pushVelocity; - else - npc.velocity.Y -= pushVelocity; - } - } - } - } - // Check if arms are alive bool cannonAlive = false; bool laserAlive = false; @@ -175,33 +103,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Phases bool phase2 = lifeRatio < 0.66f; - bool spawnDestroyer = lifeRatio < 0.75f && masterMode && !bossRush && npc.localAI[2] == 0f; bool phase3 = lifeRatio < 0.33f; - bool spawnRetinazer = lifeRatio < 0.5f && masterMode && !bossRush && npc.localAI[2] == 1f; - - // Spawn The Destroyer in Master Mode (just like Oblivion from Avalon) - if (spawnDestroyer) - { - Player destroyerSpawnPlayer = Main.player[Player.FindClosest(npc.position, npc.width, npc.height)]; - SoundEngine.PlaySound(SoundID.Roar, destroyerSpawnPlayer.Center); - if (Main.netMode != NetmodeID.MultiplayerClient) - NPC.SpawnOnPlayer(destroyerSpawnPlayer.whoAmI, NPCID.TheDestroyer); - - npc.localAI[2] = 1f; - npc.SyncVanillaLocalAI(); - } - - // Spawn Retinazer in Master Mode (just like Oblivion from Avalon) - if (spawnRetinazer) - { - Player retinazerSpawnPlayer = Main.player[Player.FindClosest(npc.position, npc.width, npc.height)]; - SoundEngine.PlaySound(SoundID.Roar, retinazerSpawnPlayer.Center); - if (Main.netMode != NetmodeID.MultiplayerClient) - NPC.SpawnOnPlayer(retinazerSpawnPlayer.whoAmI, NPCID.Retinazer); - - npc.localAI[2] = 2f; - npc.SyncVanillaLocalAI(); - } // Despawn if (npc.ai[1] != 3f) @@ -250,9 +152,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool normalLaserRotation = npc.localAI[1] % 2f == 0f; - // Prevents cheap hits - bool canUseAttackInMaster = npc.position.Y < Main.player[npc.target].position.Y - 350f; - // Float near player if (npc.ai[1] == 0f || npc.ai[1] == 4f) { @@ -260,24 +159,16 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.damage = 0; // Start other phases; if arms are dead, start with spin phase - bool otherHeadChargingOrSpinning = Main.npc[(int)npc.ai[0]].ai[1] == 5f || Main.npc[(int)npc.ai[0]].ai[1] == 1f; - if (phase2 || CalamityWorld.LegendaryMode || allArmsDead || masterMode) + if (phase2 || CalamityWorld.LegendaryMode || allArmsDead) { // Start spin phase after 1.5 seconds npc.ai[2] += phase3 ? 1.5f : 1f; - if (npc.ai[2] >= (90f - (death ? (masterMode ? 15f : 60f) * (1f - lifeRatio) : 0f)) && (!otherHeadChargingOrSpinning || !masterMode || phase3) && (canUseAttackInMaster || !masterMode)) + if (npc.ai[2] >= (90f - (death ? (masterMode ? 15f : 60f) * (1f - lifeRatio) : 0f))) { bool shouldSpinAround = npc.ai[1] == 4f && npc.position.Y < Main.player[npc.target].position.Y - 400f && Vector2.Distance(Main.player[npc.target].Center, npc.Center) < 600f && Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 400f; - bool shouldCharge = masterMode && !phase2 && !allArmsDead && !CalamityWorld.LegendaryMode; - if (shouldCharge) - { - npc.ai[2] = 0f; - npc.ai[1] = 1f; - npc.netUpdate = true; - } - else if (shouldSpinAround || npc.ai[1] != 4f) + if (shouldSpinAround || npc.ai[1] != 4f) { if (shouldSpinAround) { @@ -287,6 +178,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[2] = 0f; npc.ai[1] = shouldSpinAround ? 5f : 1f; + CalamityUtils.CalamityTargeting(npc, CalamityTargetingParameters.BossDefaults); npc.netUpdate = true; } } @@ -669,13 +561,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses damage = (int)(damage * secondMechMultiplier); } - if (npc.localAI[0] % 3f == 0f) - { - int probeLimit = death ? (masterMode ? 3 : 4) : 2; - if (NPC.CountNPCS(NPCID.Probe) < probeLimit) - NPC.NewNPC(npc.GetSource_FromAI(), (int)headCenter.X, (int)headCenter.Y + 30, NPCID.Probe); - } - int enragedSkulls = Projectile.NewProjectile(npc.GetSource_FromAI(), headCenter.X, headCenter.Y + 30f, enragedHeadSkullTargetX, enragedHeadSkullTargetY, type, damage, 0f, Main.myPlayer, -3f, 0f); Main.projectile[enragedSkulls].timeLeft = 480; Main.projectile[enragedSkulls].tileCollide = false; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs index 6d2a37107f..f27e82ee0b 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs @@ -98,34 +98,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - // Check for Oblivion in Master Mode - bool oblivionAlive = false; - if (masterMode && !bossRush && npc.localAI[3] != -1f) - { - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && (Main.npc[i].type == ModContent.NPCType() || Main.npc[i].type == NPCID.SkeletronPrime)) - { - oblivionAlive = true; - break; - } - } - } - - // Set variable to force despawn when Prime dies in Master Rev+ - // Set to -1f if Prime isn't alive when summoned - if (npc.localAI[3] == 0f) - { - if (oblivionAlive) - npc.localAI[3] = 1f; - else - npc.localAI[3] = -1f; - - npc.SyncExtraAI(); - } - // Phase HP ratios - float phase2LifeRatio = oblivionAlive ? 0.5f : masterMode ? 0.85f : 0.7f; + float phase2LifeRatio = masterMode ? 0.85f : 0.7f; float finalPhaseLifeRatio = masterMode ? 0.4f : 0.25f; // Movement variables @@ -136,16 +110,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Phase duration variables float phase1MaxLaserPhaseDurationDecrease = masterMode ? 120f : 300f; - // If Oblivion is alive reduce aggression of all attacks - if (oblivionAlive) - { - phase1MaxSpeedIncrease = masterMode ? 1f : 2f; - phase1MaxAccelerationIncrease = masterMode ? 0.0125f : 0.025f; - phase1MaxChargeSpeedIncrease = masterMode ? 1.5f : 3f; - - phase1MaxLaserPhaseDurationDecrease = masterMode ? 60f : 150f; - } - // Phase checks bool phase2 = lifeRatio < phase2LifeRatio; bool finalPhase = lifeRatio < finalPhaseLifeRatio; @@ -165,9 +129,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.reflectsProjectiles = false; // Despawn - bool oblivionWasAlive = npc.localAI[3] == 1f && !oblivionAlive; - bool oblivionFightDespawn = (oblivionAlive && lifeRatio < 0.75f) || oblivionWasAlive || (oblivionAlive && !spazAlive && lifeRatio < 0.95f); - if (Main.player[npc.target].dead || oblivionFightDespawn) + if (Main.player[npc.target].dead) { npc.velocity.Y -= 0.04f; if (npc.timeLeft > 10) @@ -206,7 +168,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses retinazerFaceDirection = -1; Vector2 retinazerPosition = npc.Center; - float distanceFromTarget = oblivionAlive ? 450f : 300f; + float distanceFromTarget = 300f; float retinazerTargetX = Main.player[npc.target].Center.X + (retinazerFaceDirection * distanceFromTarget) - retinazerPosition.X; float retinazerTargetY = Main.player[npc.target].Center.Y - distanceFromTarget - retinazerPosition.Y; @@ -268,7 +230,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[2] += 1f; float phaseGateValue = (masterMode ? 300f : 450f) - (death ? phase1MaxLaserPhaseDurationDecrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); - float laserGateValue = oblivionAlive ? 60f : 30f; + float laserGateValue = 30f; if (NPC.IsMechQueenUp) { phaseGateValue = 900f; @@ -374,7 +336,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X) - MathHelper.PiOver2; float delayBeforeChargingAgain = (masterMode ? 48f : 56f) - (death ? (masterMode ? 3f : 6f) * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); - if (npc.ai[2] >= delayBeforeChargingAgain + (oblivionAlive ? 15f : 0f)) + if (npc.ai[2] >= delayBeforeChargingAgain) { npc.ai[3] += 1f; npc.ai[2] = 0f; @@ -449,7 +411,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses damage = (int)(damage * secondMechMultiplier); } - Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * (oblivionAlive ? 6f : 7f); + Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * 7f; int numProj = shootLaser ? 6 : 2; int spread = shootLaser ? 20 : 80; float rotation = MathHelper.ToRadians(spread); @@ -538,7 +500,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 eyePosition = npc.Center; float retinazerPhase2TargetX = Main.player[npc.target].Center.X - eyePosition.X; - float distanceFromTarget = oblivionAlive ? 480f : 420f; + float distanceFromTarget = 420f; float retinazerPhase2TargetY = Main.player[npc.target].Center.Y - 420f - eyePosition.Y; if (NPC.IsMechQueenUp) @@ -615,7 +577,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += 1f + (death ? (phase2LifeRatio - lifeRatio) / phase2LifeRatio : 0f); - if (npc.localAI[1] >= (spazAlive ? (oblivionAlive ? 76f : 52f) : 26f)) + if (npc.localAI[1] >= (spazAlive ? 52f : 26f)) { bool canHit = Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height); if (canHit || !spazAlive || finalPhase) @@ -680,7 +642,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } Vector2 retinazerPhase2RapidFirePos = npc.Center; - float distanceFromTarget = oblivionAlive ? 480f : 420f; + float distanceFromTarget = 420f; float retinazerPhase2RapidFireTargetX = Main.player[npc.target].Center.X + (retinazerPhase2FaceDirection * distanceFromTarget) - retinazerPhase2RapidFirePos.X; float retinazerPhase2RapidFireTargetY = Main.player[npc.target].Center.Y - retinazerPhase2RapidFirePos.Y; float retinazerPhase2RapidFireTargetDist = (float)Math.Sqrt(retinazerPhase2RapidFireTargetX * retinazerPhase2RapidFireTargetX + retinazerPhase2RapidFireTargetY * retinazerPhase2RapidFireTargetY); @@ -721,7 +683,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += 1f + (death ? (phase2LifeRatio - lifeRatio) / phase2LifeRatio : 0f); - if (npc.localAI[1] > (spazAlive ? (oblivionAlive ? 30f : 20f) : 10f)) + if (npc.localAI[1] > (spazAlive ? 20f : 10f)) { bool canHit = Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height); if (canHit || !spazAlive || finalPhase) @@ -1072,34 +1034,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - // Check for Oblivion in Master Mode - bool oblivionAlive = false; - if (masterMode && !bossRush && npc.localAI[3] != -1f) - { - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && (Main.npc[i].type == ModContent.NPCType() || Main.npc[i].type == NPCID.SkeletronPrime)) - { - oblivionAlive = true; - break; - } - } - } - - // Set variable to force despawn when Prime dies in Master Rev+ - // Set to -1f if Prime isn't alive when summoned - if (npc.localAI[3] == 0f) - { - if (oblivionAlive) - npc.localAI[3] = 1f; - else - npc.localAI[3] = -1f; - - npc.SyncExtraAI(); - } - // Phase HP ratios - float phase2LifeRatio = oblivionAlive ? 0.5f : masterMode ? 0.85f : 0.7f; + float phase2LifeRatio = masterMode ? 0.85f : 0.7f; float finalPhaseLifeRatio = masterMode ? 0.4f : 0.25f; // Movement variables @@ -1111,17 +1047,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float phase1MaxCursedFlamePhaseDurationDecrease = masterMode ? 80f : 200f; float phase1MaxChargesDecrease = masterMode ? 2f : 4f; - // If Oblivion is alive reduce aggression of all attacks - if (oblivionAlive) - { - phase1MaxSpeedIncrease = masterMode ? 1.125f : 2.25f; - phase1MaxAccelerationIncrease = masterMode ? 0.0375f : 0.075f; - phase1MaxChargeSpeedIncrease = masterMode ? 1.5f : 3f; - - phase1MaxCursedFlamePhaseDurationDecrease = masterMode ? 40f : 100f; - phase1MaxChargesDecrease = masterMode ? 1f : 2f; - } - // Phase checks bool phase2 = lifeRatio < phase2LifeRatio; bool finalPhase = lifeRatio < finalPhaseLifeRatio; @@ -1141,9 +1066,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.reflectsProjectiles = false; // Despawn - bool oblivionWasAlive = npc.localAI[3] == 1f && !oblivionAlive; - bool oblivionFightDespawn = (oblivionAlive && lifeRatio < 0.75f) || oblivionWasAlive || (oblivionAlive && !retAlive && lifeRatio < 0.95f); - if (Main.player[npc.target].dead || oblivionFightDespawn) + if (Main.player[npc.target].dead) { npc.velocity.Y -= 0.04f; if (npc.timeLeft > 10) @@ -1185,7 +1108,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses spazmatismFireballFaceDirection = -1; Vector2 spazmatismFireballPos = npc.Center; - float distanceFromTarget = oblivionAlive ? 480f : 400f; + float distanceFromTarget = 400f; float spazmatismFireballTargetX = Main.player[npc.target].Center.X + (spazmatismFireballFaceDirection * distanceFromTarget) - spazmatismFireballPos.X; float spazmatismFireballTargetY = Main.player[npc.target].Center.Y - spazmatismFireballPos.Y; if (NPC.IsMechQueenUp) @@ -1264,7 +1187,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[3] += 0.4f; } - if (npc.ai[3] >= (oblivionAlive ? 60f : 30f)) + if (npc.ai[3] >= 30f) { npc.ai[3] = 0f; spazmatismFireballPos = npc.Center; @@ -1352,7 +1275,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Charge 8 times float chargeTime = masterMode ? 45f : 25f; - if (npc.ai[2] >= chargeTime + (oblivionAlive ? 15f : 0f)) + if (npc.ai[2] >= chargeTime) { // Reset AI array and go to cursed fireball phase npc.ai[3] += 1f; @@ -1432,7 +1355,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses damage = (int)(damage * secondMechMultiplier); } - Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * (oblivionAlive ? 12f : 16f) + Main.rand.NextVector2CircularEdge(3f, 3f); + Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * 16f + Main.rand.NextVector2CircularEdge(3f, 3f); int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 50f, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 1f); Main.projectile[proj].tileCollide = false; } @@ -1527,7 +1450,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { // Boost speed if too far from target if (spazmatismFlamethrowerTargetDist > flamethrowerDistance) - spazmatismFlamethrowerMaxSpeed += MathHelper.Lerp(0f, oblivionAlive ? 3f : masterMode ? 8f : 6f, MathHelper.Clamp((spazmatismFlamethrowerTargetDist - flamethrowerDistance) / 1000f, 0f, 1f)); + spazmatismFlamethrowerMaxSpeed += MathHelper.Lerp(0f, masterMode ? 8f : 6f, MathHelper.Clamp((spazmatismFlamethrowerTargetDist - flamethrowerDistance) / 1000f, 0f, 1f)); if (Main.getGoodWorld) { @@ -1728,7 +1651,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X) - MathHelper.PiOver2; // Charges 5 times - if (npc.ai[2] >= (chargeTime * 1.6f) + (oblivionAlive ? 15f : 0f)) + if (npc.ai[2] >= (chargeTime * 1.6f)) { npc.ai[3] += 1f; npc.ai[2] = 0f; diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index d2e3661e1c..e6ab9ef8be 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -2381,138 +2381,6 @@ namespace CalamityMod.Projectiles } } - else if (projectile.type == ProjectileID.BombSkeletronPrime && projectile.ai[0] < 0f && masterMode) - { - int num = (int)(projectile.Center.X / 16f); - int num2 = (int)(projectile.Center.Y / 16f); - if (WorldGen.InWorld(num, num2) && projectile.tileCollide) - { - Tile tile = Main.tile[num, num2]; - if (tile != null && tile.HasTile && (TileID.Sets.Platforms[tile.TileType] || tile.TileType == TileID.PlanterBox)) - { - projectile.Kill(); - return false; - } - } - - bool masterModeSkeletronPrimeHomingBomb = projectile.ai[0] == -1f; - bool masterModeSkeletronPrimeFallingBomb = projectile.ai[0] == -2f; - - int target = 0; - target = Player.FindClosest(projectile.Center, 1, 1); - - if (projectile.Hitbox.Intersects(Main.player[target].Hitbox)) - { - projectile.Kill(); - 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 (Vector2.Distance(projectile.Center, Main.player[target].Center) < 192f && projectile.ai[1] < homingEndTime) - projectile.ai[1] = homingEndTime; - - if (projectile.ai[1] < homingEndTime && projectile.ai[1] > homingStartTime) - { - float num134 = projectile.velocity.Length(); - Vector2 vector24 = Main.player[target].Center - projectile.Center; - vector24.Normalize(); - vector24 *= num134; - float inertia = death ? 25f : 30f; - projectile.velocity = (projectile.velocity * (inertia - 1f) + vector24) / inertia; - projectile.velocity.Normalize(); - projectile.velocity *= num134; - } - - float maxVelocity = death ? 18f : 15f; - float acceleration = 1.02f; - if (projectile.velocity.Length() < maxVelocity) - projectile.velocity *= acceleration; - } - else - { - if (projectile.velocity.Y > 10f) - projectile.velocity.Y = 10f; - } - - if (projectile.localAI[0] == 0f) - { - projectile.localAI[0] = 1f; - SoundEngine.PlaySound(SoundID.Item10, projectile.Center); - } - - projectile.frameCounter++; - if (projectile.frameCounter > 3) - { - projectile.frame++; - projectile.frameCounter = 0; - } - - if (projectile.frame > 1) - projectile.frame = 0; - - if (projectile.owner == Main.myPlayer && projectile.timeLeft <= 3) - { - projectile.tileCollide = false; - projectile.ai[2] = 0f; - projectile.alpha = 255; - } - else if (Main.rand.NextBool()) - { - int num28 = Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.Smoke, 0f, 0f, 100); - Main.dust[num28].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; - Main.dust[num28].fadeIn = 1.5f + (float)Main.rand.Next(5) * 0.1f; - Main.dust[num28].noGravity = true; - Main.dust[num28].position = projectile.Center + new Vector2(0f, -projectile.height / 2).RotatedBy(projectile.rotation) * 1.1f; - int num29 = 6; - Dust dust8 = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, num29, 0f, 0f, 100); - dust8.scale = 1f + (float)Main.rand.Next(5) * 0.1f; - dust8.noGravity = true; - dust8.position = projectile.Center + new Vector2(0f, -projectile.height / 2 - 6).RotatedBy(projectile.rotation) * 1.1f; - } - - if (masterModeSkeletronPrimeFallingBomb) - { - projectile.ai[2] += 1f; - if (projectile.ai[2] > 60f) - projectile.velocity.Y += 0.2f; - } - - projectile.rotation += projectile.velocity.X * 0.1f; - - return false; - } - - else if (projectile.type == ProjectileID.FrostBeam && projectile.ai[0] == 1f) - { - projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + MathHelper.PiOver2; - - Lighting.AddLight(projectile.Center, 0f, (255 - projectile.alpha) * 0.15f / 255f, (255 - projectile.alpha) * 0.6f / 255f); - - if (projectile.alpha > 0) - projectile.alpha -= 125; - if (projectile.alpha < 0) - projectile.alpha = 0; - - if (projectile.localAI[1] == 0f) - { - SoundEngine.PlaySound(SoundID.Item33, projectile.Center); - projectile.localAI[1] = 1f; - } - - if (projectile.velocity.Length() < AcceleratingBossLaserVelocityCap) - projectile.velocity *= 1.0025f; - - return false; - } - else if (projectile.type == ProjectileID.RocketSkeleton && projectile.ai[1] == 1f) { bool primeCannonProjectile = projectile.ai[1] == 2f; @@ -4653,7 +4521,6 @@ namespace CalamityMod.Projectiles #region Pre Kill public override bool PreKill(Projectile projectile, int timeLeft) { - bool masterRevSkeletronPrimeBomb = projectile.type == ProjectileID.BombSkeletronPrime && projectile.ai[0] < 0f && (Main.masterMode || BossRushEvent.BossRushActive); bool revQueenBeeBeeHive = projectile.type == ProjectileID.BeeHive && (CalamityWorld.revenge || BossRushEvent.BossRushActive) && (projectile.ai[2] == 1f || CalamityWorld.death) && projectile.wet; bool revGolemInferno = projectile.type == ProjectileID.InfernoHostileBolt && projectile.ai[2] > 0f; @@ -4675,96 +4542,7 @@ namespace CalamityMod.Projectiles if (projectile.owner == Main.myPlayer) { - if (masterRevSkeletronPrimeBomb) - { - SoundEngine.PlaySound(SoundID.Item14, projectile.Center); - projectile.position.X += projectile.width / 2; - projectile.position.Y += projectile.height / 2; - projectile.width = projectile.height = 22; - projectile.position.X -= projectile.width / 2; - projectile.position.Y -= projectile.height / 2; - - for (int num951 = 0; num951 < 20; num951++) - { - int num952 = Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.Smoke, 0f, 0f, 100, default(Color), 1.5f); - Dust dust2 = Main.dust[num952]; - dust2.velocity *= 1.4f; - } - - int num950 = 6; - for (int num953 = 0; num953 < 10; num953++) - { - int num954 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num950, 0f, 0f, 100, default(Color), 2.5f); - Main.dust[num954].noGravity = true; - Dust dust2 = Main.dust[num954]; - dust2.velocity *= 5f; - num954 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num950, 0f, 0f, 100, default(Color), 1.5f); - dust2 = Main.dust[num954]; - dust2.velocity *= 3f; - } - - int num955 = Gore.NewGore(projectile.GetSource_FromAI(), projectile.position, default(Vector2), Main.rand.Next(61, 64)); - Gore gore2 = Main.gore[num955]; - gore2.velocity *= 0.4f; - Main.gore[num955].velocity.X += 1f; - Main.gore[num955].velocity.Y += 1f; - num955 = Gore.NewGore(projectile.GetSource_FromAI(), projectile.position, default(Vector2), Main.rand.Next(61, 64)); - gore2 = Main.gore[num955]; - gore2.velocity *= 0.4f; - Main.gore[num955].velocity.X -= 1f; - Main.gore[num955].velocity.Y += 1f; - num955 = Gore.NewGore(projectile.GetSource_FromAI(), projectile.position, default(Vector2), Main.rand.Next(61, 64)); - gore2 = Main.gore[num955]; - gore2.velocity *= 0.4f; - Main.gore[num955].velocity.X += 1f; - Main.gore[num955].velocity.Y -= 1f; - num955 = Gore.NewGore(projectile.GetSource_FromAI(), projectile.position, default(Vector2), Main.rand.Next(61, 64)); - gore2 = Main.gore[num955]; - gore2.velocity *= 0.4f; - Main.gore[num955].velocity.X -= 1f; - Main.gore[num955].velocity.Y -= 1f; - - Vector2 vector76 = projectile.position; - projectile.position.X += projectile.width / 2; - projectile.position.Y += projectile.height / 2; - projectile.width = projectile.height = 128; - projectile.position.X -= projectile.width / 2; - projectile.position.Y -= projectile.height / 2; - projectile.Damage(); - projectile.position = vector76; - projectile.width = projectile.height = 22; - - if (Main.getGoodWorld && !Main.remixWorld) - { - int num1011 = 4; - Vector2 center3 = projectile.position; - int num1012 = num1011; - int num1013 = num1011; - int num1014 = (int)(center3.X / 16f - (float)num1012); - int num1015 = (int)(center3.X / 16f + (float)num1012); - int num1016 = (int)(center3.Y / 16f - (float)num1013); - int num1017 = (int)(center3.Y / 16f + (float)num1013); - if (num1014 < 0) - num1014 = 0; - - if (num1015 > Main.maxTilesX) - num1015 = Main.maxTilesX; - - if (num1016 < 0) - num1016 = 0; - - if (num1017 > Main.maxTilesY) - num1017 = Main.maxTilesY; - - bool wallSplode2 = projectile.ShouldWallExplode(center3, num1011, num1014, num1015, num1016, num1017); - projectile.ExplodeTiles(center3, num1011, num1014, num1015, num1016, num1017, wallSplode2); - } - - if (Main.netMode != NetmodeID.SinglePlayer) - NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, projectile.identity, projectile.owner); - } - - else if (revQueenBeeBeeHive) + if (revQueenBeeBeeHive) { if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -4829,7 +4607,7 @@ namespace CalamityMod.Projectiles } } - if (masterRevSkeletronPrimeBomb || revQueenBeeBeeHive || revGolemInferno) + if (revQueenBeeBeeHive || revGolemInferno) { projectile.active = false; return false; diff --git a/Scenes/MusicScenes/SkeletronPrimeMasterMusicScene.cs b/Scenes/MusicScenes/SkeletronPrimeMasterMusicScene.cs deleted file mode 100644 index 77398c4c76..0000000000 --- a/Scenes/MusicScenes/SkeletronPrimeMasterMusicScene.cs +++ /dev/null @@ -1,14 +0,0 @@ -using CalamityMod.World; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Systems -{ - public class SkeletronPrimeMasterMusicScene : ModSceneEffect - { - public override int Music => MusicID.Boss3; // I spent 20 minutes trying to get this music to play while forgetting to actually override this in the first place _ YuH - public override SceneEffectPriority Priority => SceneEffectPriority.BossLow; - public override bool IsSceneEffectActive(Player player) => Main.masterMode && CalamityWorld.revenge && NPC.AnyNPCs(NPCID.SkeletronPrime) && Main.npc[NPC.FindFirstNPC(NPCID.SkeletronPrime)].Distance(player.Center) <= 525f * 16f; - } -}