From ed8836a551a9334ff486cfd5915795a039712d06 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sat, 15 Jun 2024 01:21:44 -0400 Subject: [PATCH] Deus gores Also made it not fire projectiles during phase 2 transition --- Gores/AstrumDeus/AstrumDeusAltBody1.png | Bin 0 -> 1001 bytes Gores/AstrumDeus/AstrumDeusAltBody2.png | Bin 0 -> 387 bytes Gores/AstrumDeus/AstrumDeusBody1.png | Bin 0 -> 625 bytes Gores/AstrumDeus/AstrumDeusBody2.png | Bin 0 -> 679 bytes Gores/AstrumDeus/AstrumDeusHead1.png | Bin 0 -> 1400 bytes Gores/AstrumDeus/AstrumDeusHead2.png | Bin 0 -> 630 bytes Gores/AstrumDeus/AstrumDeusHead3.png | Bin 0 -> 768 bytes Gores/AstrumDeus/AstrumDeusTail1.png | Bin 0 -> 946 bytes Gores/AstrumDeus/AstrumDeusTail2.png | Bin 0 -> 680 bytes NPCs/AstrumDeus/AstrumDeusBody.cs | 14 ++ NPCs/AstrumDeus/AstrumDeusHead.cs | 7 + NPCs/AstrumDeus/AstrumDeusTail.cs | 6 + .../CalamityBossAIs/AstrumDeusAI.cs | 148 +++++++++--------- 13 files changed, 103 insertions(+), 72 deletions(-) create mode 100644 Gores/AstrumDeus/AstrumDeusAltBody1.png create mode 100644 Gores/AstrumDeus/AstrumDeusAltBody2.png create mode 100644 Gores/AstrumDeus/AstrumDeusBody1.png create mode 100644 Gores/AstrumDeus/AstrumDeusBody2.png create mode 100644 Gores/AstrumDeus/AstrumDeusHead1.png create mode 100644 Gores/AstrumDeus/AstrumDeusHead2.png create mode 100644 Gores/AstrumDeus/AstrumDeusHead3.png create mode 100644 Gores/AstrumDeus/AstrumDeusTail1.png create mode 100644 Gores/AstrumDeus/AstrumDeusTail2.png diff --git a/Gores/AstrumDeus/AstrumDeusAltBody1.png b/Gores/AstrumDeus/AstrumDeusAltBody1.png new file mode 100644 index 0000000000000000000000000000000000000000..acab1252d369a564e3daa321d48fae082e1dafbe GIT binary patch literal 1001 zcmVPx&qe(n zL0r2i2(DDrg#{NDN^3z{rBwt)u{J11Me#xe(YQGCPBLG5OeV!L({~dlIWs5cnfJS# znI;-kF1w>t&$xVHs;QCdFKOhYh0wCNCx}#Mt`mTn{0snxdJh8d^v6#CGM@`Nr3CTG zC6-v-tFWY`jk%6F$G^(Ii5!cpREuC@iN*GqR&L2z622!BC~CI zb7WjaR7S?vA}yttm@mU;yY~PUWR|<=R5V(TNj5rtN-wcm5*bN(O%=eZ-U^T&Vzs)4 zFuH4&i{7CP;^%y08my?IFEF0}svU@FsH0=QXp zfGR4$oaB;Etg7D%2q{m6`N|NJr&KFNwm;*7`}*uk0G{w2DBl69yN(FCP?sMv+8#=mq@4P0odjk=(H97gjBuh@w zYWpsqHx#XQd`H__0N#9fA35KWN_^(8`;T?BtqoTV&MVe0mAXGZ!u|1)|NqApT2*;W z_t@9_Z|d0%z{|-ApgPJ_GnMy5?ev-R?)SiBK5t2hCFb4Z*&3=S6S213Zvfstcn6fD zO+H+|Zyf+1@=F1@cl#z#Cb^vzk@?iGB|a*>#13comjJe8z5&&>@zlxQx+b`CZ5)8? z^s~tKBBTlj79R<_F!B~{u2OC1Fv-iQQ6h!epi(GYN^Qc(Ro)MCYWF3l26Ru zV@Y|XKk#0-;y}t@qgQW5j(t)z4$VwQ=F=UMl26P^D>%{q6@crrj#Rj#Zg4{1)1A~r zW$brJdiG$u3frMd%43V>?OWYXt+nDTdm_(ZBc=1VNGhVFl*4)i#$_3d&MVfc~TFE;8eDY3-n{l3zA&3da*C6?G< XMPHgC)q1b`00000NkvXXu0mjfz;WmB literal 0 HcmV?d00001 diff --git a/Gores/AstrumDeus/AstrumDeusAltBody2.png b/Gores/AstrumDeus/AstrumDeusAltBody2.png new file mode 100644 index 0000000000000000000000000000000000000000..daaf2ab482260d08381c4b59bc48bcc07adca011 GIT binary patch literal 387 zcmV-}0et?6P)Px$JxN4CR5*>bl(9+!K@f(&6D>?($Po^dfQ67IC>V(#HbH9@K`d-6EUdKfQG5aM z1q8_>NDvevXe<>DuJMcrNs+?9S=@~{YZ5uw`STeVmnt7XJJe zfu9kP=~d@B0N{KhrwUGcQ$r8R?yddt>O_0g+`RxGe2VAD`ecv%^-A7S1mG>!RNN#H hWlv<1iA)mfMBm#JXEWlm1ib(N002ovPDHLkV1jqDppO6m literal 0 HcmV?d00001 diff --git a/Gores/AstrumDeus/AstrumDeusBody1.png b/Gores/AstrumDeus/AstrumDeusBody1.png new file mode 100644 index 0000000000000000000000000000000000000000..8d3631cbb5dfda5c03f1f67f1cb7d9308fa78110 GIT binary patch literal 625 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 Q>i_@%07*qoM6N<$f-F-Z(f|Me literal 0 HcmV?d00001 diff --git a/Gores/AstrumDeus/AstrumDeusHead3.png b/Gores/AstrumDeus/AstrumDeusHead3.png new file mode 100644 index 0000000000000000000000000000000000000000..ad1854a57734c44f42bbd6967eaaa8fe6e502a25 GIT binary patch literal 768 zcmV+b1ONPqP)Px%x=BPqR9J=WnLlU~VHn1L(Fz825KTl$8y8(_3l)TF5z;}>!HT+xqaYLtPKr)W zb}ba092A^HET)5lLjzI?NUNk4!J?3Qi-{muO9YWPT%KOOuU^yU4_tG7w)gJ+j^lUF z`@QeoMQD){@!oQE>=bg5dakprIk(d~bqpLoU;f{TypvyZp&t>EyM1p2fYCeS4c%by z35wLU;Tr%9T)kiuBl{0Lere0H=_v>jnc)aK%R=l1wB4xcl^x zk@zX|+=z?Lb^u^HRg)Nb{RrBs@{&Qah)Xh-_zS@2*%<)3Vg~@v!&>J@GVlcJn$gyhJ8b8h|g(qEZbnhL51FsqAaOs8+!1$&1Br0F?H|-4m84w+KqAR(Vdc zt6HQrEo~7L5qV6+I|wnSFdA9#XI^I)xS zHIlrjj$*$Rc3Ju1At=dvnv}aM`<}cff-6&uj~As75}f-8K-B8Je$rPjeVBh00001b5ch_0Itp) z=>Px&Y)M2xRA_lo zE;3T3JiO7o?bYYHvbgT9EH3gtwI}TbM6Nt^HhiE)CPZ^jFttyt_eAo<{(S&EfAg~C zc}a=ppJ3YR)A^$#7ef21Jx4;@6H}9+?d?ZU1mu~dPiWtP+jsAUj(>PN3p9wfOEUKa zgFa|I)2;?N0Kn5Hj{&%OAMk=BH_uN1MqQFbT{o$U zL-75t-vIQx?fVbM0C@CZ+~45{Ev)#P)Ad&&Z>k#mD!%6yy=4F{p7OK#&x!}Y-rh=E zH&`5klAe^xQDAe`#dZGmgJl3pt91Zgyqf{wc%=$JwaptW9zpf5TjzX&J(a&e)5KhB z-5({96G`|u7klWfK+A+(;ht2yhvxa3e@R6oo;!Ni{r zE_wcxgIT}n7{m*&^N@4FwxhL56_at!{ErRl*ofo4fXH~B< z`p)e9HmhQ*IFeFQf>Fvn!PHfpRNMC3&dhJHv|8V^o=KzJ6Wp=~n>^LBnzK^w3GUor zTJ79mT4kOjHjC4$^9V{xleE9#>KuaBdv-OqRdo(QNfUI({C+U=U%zEVPRc#Of9CLr UeJ!%q)&Kwi07*qoM6N<$g5dkju>b%7 literal 0 HcmV?d00001 diff --git a/Gores/AstrumDeus/AstrumDeusTail2.png b/Gores/AstrumDeus/AstrumDeusTail2.png new file mode 100644 index 0000000000000000000000000000000000000000..a4f10db1916edcec224b3b63b9c703c3cf48a7f8 GIT binary patch literal 680 zcmV;Z0$2TsP)Px%Vo5|nR9J=8m%nQhVI0Ok5e0*`AZ_E4dV)CF1Z)w4;NWHl1<_puU4#z)Esjp^ zilBpT3Z+tzT4>@_l%~DK)FN0Vg2Or7JvrZRbG`Je@ZPf|yuXtB-1B|j_pLCZ>a}LH zUw_zJtBktVemZg(iyWqoW_4I1cdp-d`Zu?~0PykWuehO21piLTJ3@P&CXbAjNJ(#& z7lGoWyd#w9p)85Wx!Jk+bGi<|@2wDkpdM&wAy1W`kd?^1U48GgTT)UUG4BZFR+)6Q zbp?PkQ>OuV^71K=lIWkR0Wg0y7&04PZFB+XwOx{ynE!;NtUOYcZ7;6^(BX$OuhzH( zz=adXfs|-gUP&TVK0-5`1Yoy5;q;G%I{=)o?gFsh9|KZiA|;8K$Y@=SFAt$>waY`R zto7g?052Ao0H}WJ0niQO>bY5sr#Ze^t$)XLAek#BJh!rZLs;HC!1A0d5_mztAtl|9=U2mac%p5gK)%C8gU&mS;pn z-juQuS}HFgDeK;*6XQWWV^w}ac~aFX#|}!$J3{|W3qd2Y6*h{zBlHKhDgQdT)Hu=r O0000(), 0f, 0f, 100, default, 2f); Main.dust[astralDust].velocity *= 2f; } + if (Main.netMode != NetmodeID.Server) + { + float randomSpread = Main.rand.Next(-200, 201) / 100f; + if (NPC.localAI[3] == 1f) + { + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity * randomSpread, Mod.Find("AstrumDeusAltBody1").Type, 1f); + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity * randomSpread, Mod.Find("AstrumDeusAltBody2").Type, 1f); + } + else + { + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity * randomSpread, Mod.Find("AstrumDeusBody1").Type, 1f); + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity * randomSpread, Mod.Find("AstrumDeusBody2").Type, 1f); + } + } } } diff --git a/NPCs/AstrumDeus/AstrumDeusHead.cs b/NPCs/AstrumDeus/AstrumDeusHead.cs index 5be7ed4304..4ebacbee89 100644 --- a/NPCs/AstrumDeus/AstrumDeusHead.cs +++ b/NPCs/AstrumDeus/AstrumDeusHead.cs @@ -228,6 +228,13 @@ namespace CalamityMod.NPCs.AstrumDeus astralDust = Dust.NewDust(NPC.position, NPC.width, NPC.height, ModContent.DustType(), 0f, 0f, 100, default, 2f); Main.dust[astralDust].velocity *= 2f; } + if (Main.netMode != NetmodeID.Server) + { + float randomSpread = Main.rand.Next(-200, 201) / 100f; + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity * randomSpread, Mod.Find("AstrumDeusHead1").Type, 1f); + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity * randomSpread, Mod.Find("AstrumDeusHead2").Type, 1f); + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity * randomSpread, Mod.Find("AstrumDeusHead3").Type, 1f); + } } } } diff --git a/NPCs/AstrumDeus/AstrumDeusTail.cs b/NPCs/AstrumDeus/AstrumDeusTail.cs index 5f671f1e2a..e951bf803a 100644 --- a/NPCs/AstrumDeus/AstrumDeusTail.cs +++ b/NPCs/AstrumDeus/AstrumDeusTail.cs @@ -165,6 +165,12 @@ namespace CalamityMod.NPCs.AstrumDeus astralDust = Dust.NewDust(NPC.position, NPC.width, NPC.height, ModContent.DustType(), 0f, 0f, 100, default, 2f); Main.dust[astralDust].velocity *= 2f; } + if (Main.netMode != NetmodeID.Server) + { + float randomSpread = Main.rand.Next(-200, 201) / 100f; + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity * randomSpread, Mod.Find("AstrumDeusTail1").Type, 1f); + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity * randomSpread, Mod.Find("AstrumDeusTail2").Type, 1f); + } } } diff --git a/NPCs/CalamityAIs/CalamityBossAIs/AstrumDeusAI.cs b/NPCs/CalamityAIs/CalamityBossAIs/AstrumDeusAI.cs index 09ac47f3cf..826432bb36 100644 --- a/NPCs/CalamityAIs/CalamityBossAIs/AstrumDeusAI.cs +++ b/NPCs/CalamityAIs/CalamityBossAIs/AstrumDeusAI.cs @@ -774,98 +774,102 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs float shootProjectile = (doubleWormPhase && expertMode) ? 200 : 400; float timer = npc.ai[0] + 15f; float divisor = timer + shootProjectile; + bool canFireProjectiles = npc.Opacity >= 1f; bool shootGodRays = phase2 || deathModeEnragePhase_BodyAndTail; - if (!flyAtTarget || deathModeEnragePhase_BodyAndTail) + if (canFireProjectiles) { - float laserDivisor = (phase2 && !deathModeEnragePhase_BodyAndTail) ? 4f : 2f; - if (npc.localAI[0] % divisor == 0f && npc.ai[0] % laserDivisor == 0f) + if (!flyAtTarget || deathModeEnragePhase_BodyAndTail) { - npc.TargetClosest(); - - if (Main.netMode != NetmodeID.MultiplayerClient) + float laserDivisor = (phase2 && !deathModeEnragePhase_BodyAndTail) ? 4f : 2f; + if (npc.localAI[0] % divisor == 0f && npc.ai[0] % laserDivisor == 0f) { - if (deathModeEnragePhase_BodyAndTail) - { - Vector2 velocity = Vector2.Zero; - if (movingMines) - { - Vector2 randomMineMovement = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); - randomMineMovement.Normalize(); - randomMineMovement *= Main.rand.Next(90, 121) * 0.01f; - velocity = randomMineMovement; - } + npc.TargetClosest(); - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - float split = (splittingMines && npc.ai[0] % 3f == 0f) ? 1f : 0f; - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, velocity, type, damage, 0f, Main.myPlayer, split, 0f); - } - } - - if (Vector2.Distance(player.Center, npc.Center) > 80f) - { if (Main.netMode != NetmodeID.MultiplayerClient) { - float deusLaserSpeed = (death ? 16f : revenge ? 14f : 13f) + enrageScale * 4f; - - Vector2 deusLaserCenter = npc.Center; - float deusLaserTargetX = player.Center.X - deusLaserCenter.X; - float deusLaserTargetY = player.Center.Y - deusLaserCenter.Y; - float deusLaserTargetDist = (float)Math.Sqrt(deusLaserTargetX * deusLaserTargetX + deusLaserTargetY * deusLaserTargetY); - deusLaserTargetDist = deusLaserSpeed / deusLaserTargetDist; - deusLaserTargetX *= deusLaserTargetDist; - deusLaserTargetY *= deusLaserTargetDist; - deusLaserCenter.X += deusLaserTargetX * 5f; - deusLaserCenter.Y += deusLaserTargetY * 5f; - - Vector2 shootDirection = new Vector2(deusLaserTargetX, deusLaserTargetY).SafeNormalize(Vector2.UnitY); - Vector2 laserVelocity = shootDirection * deusLaserSpeed; - - int type = shootGodRays ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - if (shootGodRays) + if (deathModeEnragePhase_BodyAndTail) { - SoundEngine.PlaySound(AstrumDeusHead.GodRaySound, npc.Center); - // Waving beams need to start offset so they cross each other neatly. - float waveSideOffset = Main.rand.NextFloat(9f, 14f); - Vector2 perp = shootDirection.RotatedBy(-MathHelper.PiOver2) * waveSideOffset; - - for (int i = -1; i <= 1; i += 2) + Vector2 velocity = Vector2.Zero; + if (movingMines) { - Vector2 laserStartPos = deusLaserCenter + i * perp + Main.rand.NextVector2CircularEdge(6f, 6f); - Projectile godRay = Projectile.NewProjectileDirect(npc.GetSource_FromAI(), laserStartPos, laserVelocity, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); - - // Tell this Phased God Ray exactly which way it should be waving. - godRay.localAI[1] = i * 0.5f; + Vector2 randomMineMovement = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); + randomMineMovement.Normalize(); + randomMineMovement *= Main.rand.Next(90, 121) * 0.01f; + velocity = randomMineMovement; } + + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + float split = (splittingMines && npc.ai[0] % 3f == 0f) ? 1f : 0f; + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, velocity, type, damage, 0f, Main.myPlayer, split, 0f); } - else + } + + if (Vector2.Distance(player.Center, npc.Center) > 80f) + { + if (Main.netMode != NetmodeID.MultiplayerClient) { - SoundEngine.PlaySound(AstrumDeusHead.LaserSound, npc.Center); - Projectile.NewProjectile(npc.GetSource_FromAI(), deusLaserCenter, laserVelocity, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); + float deusLaserSpeed = (death ? 16f : revenge ? 14f : 13f) + enrageScale * 4f; + + Vector2 deusLaserCenter = npc.Center; + float deusLaserTargetX = player.Center.X - deusLaserCenter.X; + float deusLaserTargetY = player.Center.Y - deusLaserCenter.Y; + float deusLaserTargetDist = (float)Math.Sqrt(deusLaserTargetX * deusLaserTargetX + deusLaserTargetY * deusLaserTargetY); + deusLaserTargetDist = deusLaserSpeed / deusLaserTargetDist; + deusLaserTargetX *= deusLaserTargetDist; + deusLaserTargetY *= deusLaserTargetDist; + deusLaserCenter.X += deusLaserTargetX * 5f; + deusLaserCenter.Y += deusLaserTargetY * 5f; + + Vector2 shootDirection = new Vector2(deusLaserTargetX, deusLaserTargetY).SafeNormalize(Vector2.UnitY); + Vector2 laserVelocity = shootDirection * deusLaserSpeed; + + int type = shootGodRays ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + if (shootGodRays) + { + SoundEngine.PlaySound(AstrumDeusHead.GodRaySound, npc.Center); + // Waving beams need to start offset so they cross each other neatly. + float waveSideOffset = Main.rand.NextFloat(9f, 14f); + Vector2 perp = shootDirection.RotatedBy(-MathHelper.PiOver2) * waveSideOffset; + + for (int i = -1; i <= 1; i += 2) + { + Vector2 laserStartPos = deusLaserCenter + i * perp + Main.rand.NextVector2CircularEdge(6f, 6f); + Projectile godRay = Projectile.NewProjectileDirect(npc.GetSource_FromAI(), laserStartPos, laserVelocity, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); + + // Tell this Phased God Ray exactly which way it should be waving. + godRay.localAI[1] = i * 0.5f; + } + } + else + { + SoundEngine.PlaySound(AstrumDeusHead.LaserSound, npc.Center); + Projectile.NewProjectile(npc.GetSource_FromAI(), deusLaserCenter, laserVelocity, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); + } } } } } - } - else - { - if (npc.localAI[0] % divisor == 0f && npc.ai[0] % 2f == 0f) + else { - Vector2 velocity = Vector2.Zero; - if (movingMines) + if (npc.localAI[0] % divisor == 0f && npc.ai[0] % 2f == 0f) { - Vector2 randomMineMovement = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); - randomMineMovement.Normalize(); - randomMineMovement *= Main.rand.Next(30, 121) * 0.01f; - velocity = randomMineMovement; - } + Vector2 velocity = Vector2.Zero; + if (movingMines) + { + Vector2 randomMineMovement = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); + randomMineMovement.Normalize(); + randomMineMovement *= Main.rand.Next(30, 121) * 0.01f; + velocity = randomMineMovement; + } - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - float split = (splittingMines && npc.ai[0] % 3f == 0f) ? 1f : 0f; - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, velocity, type, damage, 0f, Main.myPlayer, split, 0f); + int type = ModContent.ProjectileType(); + int damage = npc.GetProjectileDamage(type); + float split = (splittingMines && npc.ai[0] % 3f == 0f) ? 1f : 0f; + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, velocity, type, damage, 0f, Main.myPlayer, split, 0f); + } } } }