From dc90cf47ea97e9d02a73c2e6d968c63ca3dc4425 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 12 Sep 2021 00:51:05 -0500 Subject: [PATCH 1/9] Head icon fixes --- CalamityMod.cs | 7 +++++++ NPCs/ExoMechs/Thanatos/ThanatosNormalBody.png | Bin 414 -> 426 bytes NPCs/ExoMechs/Thanatos/ThanatosNormalHead.png | Bin 435 -> 436 bytes NPCs/ExoMechs/Thanatos/ThanatosNormalTail.png | Bin 411 -> 414 bytes .../Thanatos/ThanatosVulnerableBody.png | Bin 391 -> 395 bytes .../Thanatos/ThanatosVulnerableHead.png | Bin 406 -> 404 bytes .../Thanatos/ThanatosVulnerableTail.png | Bin 390 -> 384 bytes 7 files changed, 7 insertions(+) diff --git a/CalamityMod.cs b/CalamityMod.cs index 99dbf2942e..90d0c2eadb 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -278,7 +278,14 @@ namespace CalamityMod RipperUI.Load(); AstralArcanumUI.Load(this); + Apollo.LoadHeadIcons(); + Artemis.LoadHeadIcons(); + Polterghast.LoadHeadIcons(); SupremeCalamitas.LoadHeadIcons(); + ThanatosHead.LoadHeadIcons(); + ThanatosBody1.LoadHeadIcons(); + ThanatosBody2.LoadHeadIcons(); + ThanatosTail.LoadHeadIcons(); GameShaders.Hair.BindShader(ModContent.ItemType(), new LegacyHairShaderData().UseLegacyMethod((Player player, Color newColor, ref bool lighting) => Color.Lerp(player.hairColor, new Color(0, 255, 171), ((float)player.Calamity().adrenaline / (float)player.Calamity().adrenalineMax)))); GameShaders.Hair.BindShader(ModContent.ItemType(), new LegacyHairShaderData().UseLegacyMethod((Player player, Color newColor, ref bool lighting) => Color.Lerp(player.hairColor, new Color(255, 83, 48), ((float)player.Calamity().rage / (float)player.Calamity().rageMax)))); diff --git a/NPCs/ExoMechs/Thanatos/ThanatosNormalBody.png b/NPCs/ExoMechs/Thanatos/ThanatosNormalBody.png index 9c496d1e777f637ac404f61b4e441d1d14ad3af3..40ebcdb5eabcfdeb3630c968a83adaa258d397f6 100644 GIT binary patch delta 322 zcmV-I0log71F8d%Of++Ri!(Ssnxw8CAR+Q_Nv7~=99dWLwkb(vx@qv-|Ns9vE^|Iv zuKNFQu)W0q004Bfoy3uVDSyHM01m-Q=ot9eelt_O`!Z=e&nSO^A@&uyf2vy(d~0B8{2bHD(L| z;rRbB5)`3CV;j~`1nVQs(c%nyFI6~{d0nv%$AU%LR?9-zwivrT{C^472GCLn`+gic znAVi)2ObYf#GDc^GfF#|Vv(GQNkpKVy delta 309 zcmV-50m}ZW1D*qrOf()KAu~8XrtoQVe2f48|2Zym^0q0ky~RFRuKNFQNoBfe@Z20( zSMqR4nxw7(0043@+WnD$DSyKN01m?e$8V@)0002fNkl56EvF}8_7@yq8IrUbh$fg#Vh?`yyq?~SPt zUxPz9CnxqDyvr6FP~=L@o{_r7~&S?^iIV#00000NkvXX Hu0mjf$U%-j diff --git a/NPCs/ExoMechs/Thanatos/ThanatosNormalHead.png b/NPCs/ExoMechs/Thanatos/ThanatosNormalHead.png index 1c485fcc418e6912037219c0b77078dc64efa7cd..9cd03281e6ff39db163c822a1a434cb2aa7f2a1d 100644 GIT binary patch delta 335 zcmV-V0kHnF1GEE>NjFegXEQiIb9{>)AR&h5`!QN1w)8n z)L!`ipDl-jwbKV-XDpG;gaj+4BbEQC#(lllA|YJ*C+^Fg7Ez7y(lM&?ZLCGiu5tk7 z&9F1lC~Ss@1L2qNIG{4r+~7cXm^`Oh(kdauh^D@6ksHlHmPIus)eyKYe@iz*Et2!P zqNFwut!vKhfPtoTSIs#za#nR`!bqEK+rFEn7aR(FCKNuq`mF hk#N#CD!00n55Z&|spee;4X*$I002ovPDHLkV1n=8n#BMB delta 334 zcmV-U0kQtH1G58=NjEb%KTug`9v~r+V3Ar)c>4cv^0q05D^_Xn-2eaortoP#mFXN= zS3X&;IWBW^e2V}80Hfs8w~>G;f5QL(4#NS*Z>VGd008JoL_t(IPmPk>4ul{KL|dw> zMHcb@e|8-PHTxn=VkkXhDHl0z$*q<+HHt;_)??`7R#8GQn6fgh(E3TUEOt3;+NC07*qoM6N<$f|zHL761SM diff --git a/NPCs/ExoMechs/Thanatos/ThanatosNormalTail.png b/NPCs/ExoMechs/Thanatos/ThanatosNormalTail.png index 45a93ddc59554214898974dde25f468c770a2eaf..1a087a283e014113289d809ecd1d4c1f8d5bd755 100644 GIT binary patch delta 312 zcmV-80muHE1D*qrNjFegXLEdu9v~qzI6v~XDM@9zY4F^p@M-dJN&o-w`u}iRO?Wvj zbB8Nd99dVIq^XCpcf5HF&4#EKyC`y0;007fTL_t(IPnD9<7K9)OL@`j* zYODYM*>%El_a$u}1m<$oFgkA0t!fmFVj@>GO;}sQ2*!rY&dDj~n6D%Hn8<6IVtw_n2(HfSG&E4GF{z95F0b4vCk^?E~?i-^{u&j-H-o@E?QMMT?X zZKy^u8bp8r*A>{FK%r)?+yRtHT3ZR=I=1fhOexHkK+p+zaDXs(_(o50000< KMNUMnLSTY~4vnw? delta 309 zcmV-50m}ZK1DgYoNjGzRi<+daGdMpUAR##}b5L1l99dU~D^{lPY5)K5@^DF7O?dkM zaB1+|NoBh7wkZGr00ykpQ;~ovf5QL(4#NS*Z>VGd007WQL_t(IPnD8O5`-WOM1w(; zpn&(k?9dY^oLLC=rbAwrp9H$9sOY~cb@gXVWK74my4naYOUJjm+7l*X{(U&Jp59INih+E@DWA}E5J}g$XV+cQyOD@M9vtb zuA+I)UpB-D;0owkFj8C%z&Q-*SaAjWLgq07O|?<DYR diff --git a/NPCs/ExoMechs/Thanatos/ThanatosVulnerableBody.png b/NPCs/ExoMechs/Thanatos/ThanatosVulnerableBody.png index c45262044ce422e86147310cda4fae56d1fbb57f..ff48f58356e5dfc7cc3dd15278d34f15bfaa99b5 100644 GIT binary patch delta 298 zcmV+_0oDG81B(NYNhls5Ay8Ro$38xXD^@c&KmY&#@^DG||8PzsCv$v@u)W0q008TW z7Fv;UB!9vH01m9zgx~lwalsrZS zlr|(?t?AH;hCi1tEOHzos%E8_sWQ%Cky;U2m;2cTTq_dt`08>u`yV4r!D=Y5wlgXM293wMYhMq${GqNoqN1`5l4VLWRNbc0n( zi7-Pmt_uw@izsD$s}yECBAzFL?a5&r=+05Z5U{E{F3MnjeT)Jn0prRXUhpj@>@ivg w%r8K#mUe$GJB);-HOVZ7U{cfQ`oyjM03p;9xxDVWL;wH)07*qoM6N<$g4U^jDF6Tf delta 294 zcmV+>0oneG1BU~UNhnZRXC5FSGdMr`|8R4Bi~s-shbva{a7nPe#m7EAP9i4&000k3 z33!olB!9yI01m?e$8V@)0002cNklxrIA%hOrNlTPz6Xo+L&xP7I3*De z<~6mpX81e}w^r-@Nf$0fHD@a)XVp@?n5Jkc1apzsOEm=Av$5{5Ef0%=CN^*ACuSrj zaIGVl{s!AcuvOT2rsKh^pJCW4p79RTz&M7Zi^itYnF~_}P(+pT=9The?GkBS|6mfp sDXG?~N^`_FabOY%8KwOa1~>S+-VW�aF9ZMF0Q*07*qoM6N<$f|SyO5&!@I diff --git a/NPCs/ExoMechs/Thanatos/ThanatosVulnerableHead.png b/NPCs/ExoMechs/Thanatos/ThanatosVulnerableHead.png index f6394a48ae7712aa80c79c2b6124669ff83be752..782e608c43b8e8d6977a7ccba78ef755c2db7b32 100644 GIT binary patch delta 308 zcmV-40n7fD1C#@hNhnZRXEQiIb9{>)AR&hb5<2+f?bTv547I4nlb|L{=Du%`n&yX8PD*Xo(qM zLl{hchgs5wN^!@bzQ>{_n2orr)_Mh`R#o>TOMfh~?=b|l@0j7iT4RLVQIH5eHgZpY zip^?04$Q4ZxJR^BtJ!g2Ug6$(4bXWaNE^}X8xFXg2 zbFDETzt1h$On8GSBt;NVZ!m?{Zt+;qTa1KT85o-4-ap$k7GXRk5kvq0002ovPDHLk GU;%=EK#SP` delta 310 zcmV-60m=T91C|4jNhmWoKTug`9v~r3A}5C{R>wX*`u}kM|NruEN&o-wb9{>c005Ib zy^4`>B!9vH01m{eM!$uiYy^2 zay*hp-EnFbi|C^_V2pc4DWz7kT1)8;*aQZs)<@U`&EO1BHS<%gnW-k6!vuhrWnCk{ z31=|HMT`%YiyVpO^=r1$fr{XovLA;A|i4OquH$oMqk3 zlVXcr-Vn1?-S;~{WZy}A+3EPixZd=CcAvg6&KKX-03XK>(XSPG<3}}>00000NkvXX It^-0~f^|oZk^lez diff --git a/NPCs/ExoMechs/Thanatos/ThanatosVulnerableTail.png b/NPCs/ExoMechs/Thanatos/ThanatosVulnerableTail.png index be37ce6997b9fb18a7e41b8d1f8485cd0071ecce..e34313db937fe4c411ebb9d340afefc1005b12a9 100644 GIT binary patch delta 287 zcmV+)0pR|I1AqgNNhnZRXLEdu9v~qzI6uceK29Ph`u}k9a7l+NR{#I-nxw7(007kL ztS6CiB!9vH01m*5nAJ*|xD?g? zktHsrHHJ&cOqCCjwZ=8nZgbtW(wfeJMNGp&y75 zr(lh5=nLXFQ?Q4}AwuqE#;?G&?BkB002ovPDHLkV1nr5gS`L% delta 293 zcmV+=0owk61BL^TNhouCi<+daGdMpUAR$g7Cs0{uhbvacK0fkrN&5eA|Nrm+008mT z*bH#nL^-eIDYf{92Z=NN%QNC^dJ z7;TA)N!5Sy2D2%~T3b_%5z#501z0799PkW}f^w8Z+&bK24B;4R%`Gs<9%B>~Fk`S% zd>x+OV)*8Caqsix1B00000NkvXXu0mjfp(cO# From 859f8202dd92c1885080d0301630fd180d89718e Mon Sep 17 00:00:00 2001 From: Merkalto Date: Sun, 12 Sep 2021 13:39:55 -0500 Subject: [PATCH 2/9] kelvin is ACTUALLY pre mech now --- Items/Weapons/Rogue/KelvinCatalyst.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Items/Weapons/Rogue/KelvinCatalyst.cs b/Items/Weapons/Rogue/KelvinCatalyst.cs index 9064404d67..e3b0e95312 100644 --- a/Items/Weapons/Rogue/KelvinCatalyst.cs +++ b/Items/Weapons/Rogue/KelvinCatalyst.cs @@ -55,7 +55,6 @@ namespace CalamityMod.Items.Weapons.Rogue ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 200); recipe.AddIngredient(ItemID.FrozenKey); - recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType(), 2); recipe.AddIngredient(ModContent.ItemType(), 2); From 4cc1ee5a93ffe5e3003659733af097e33073fe17 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Sun, 12 Sep 2021 14:12:32 -0500 Subject: [PATCH 3/9] 1 - Removed Ravager falling forever fix because it didn't fix fuck all. --- NPCs/Ravager/RavagerBody.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index ca552a0409..778a105e52 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -467,10 +467,6 @@ namespace CalamityMod.NPCs.Ravager npc.noTileCollide = true; else if ((npc.velocity.Y > 0f && npc.Bottom.Y > Main.player[npc.target].Top.Y) || (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].Center, 1, 1) && !Collision.SolidCollision(npc.position, npc.width, npc.height))) npc.noTileCollide = false; - - // Prevent falling forever in second phase - if (npc.ai[0] == 2f && npc.velocity.Y > 0f && npc.Top.Y > Main.player[npc.target].Bottom.Y + 16f && !Collision.SolidCollision(npc.position, npc.width, npc.height)) - npc.noTileCollide = false; } Vector2 targetVector = player.position; From 0cf87d361d9a5100bc0f15c17e496e6e7006e3e5 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 12 Sep 2021 14:31:29 -0500 Subject: [PATCH 4/9] Exception fixes --- NPCs/ExoMechs/Thanatos/ThanatosBody1.cs | 1 + NPCs/ExoMechs/Thanatos/ThanatosBody2.cs | 1 + NPCs/ExoMechs/Thanatos/ThanatosTail.cs | 1 + 3 files changed, 3 insertions(+) diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index 78fcbb996f..8fbb051c39 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -146,6 +146,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos npc.HitEffect(0, 10.0); npc.checkDead(); npc.active = false; + return; } // Set vulnerable to false by default diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index 1c49259062..63e5a0af78 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -146,6 +146,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos npc.HitEffect(0, 10.0); npc.checkDead(); npc.active = false; + return; } // Set vulnerable to false by default diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index f590452b41..2c2e1d87c9 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -145,6 +145,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos npc.HitEffect(0, 10.0); npc.checkDead(); npc.active = false; + return; } // Set vulnerable to false by default From d022e97433eb7f32fabd2cdc077f34a7e33ed79f Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Sun, 12 Sep 2021 15:08:00 -0500 Subject: [PATCH 5/9] 1 - Refactoring a bit. --- NPCs/ExoMechs/Thanatos/ThanatosBody1.cs | 45 ++++++++-------- NPCs/ExoMechs/Thanatos/ThanatosBody2.cs | 70 ++++++++++++------------- NPCs/ExoMechs/Thanatos/ThanatosTail.cs | 70 ++++++++++++------------- 3 files changed, 92 insertions(+), 93 deletions(-) diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index 8fbb051c39..9a54e93586 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -432,41 +432,40 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos Player player = Main.player[Main.npc[CalamityGlobalNPC.draedonExoMechWorm].target]; - Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - float num191 = player.position.X + (player.width / 2); - float num192 = player.position.Y + (player.height / 2); - num191 = (int)(num191 / 16f) * 16; - num192 = (int)(num192 / 16f) * 16; - vector18.X = (int)(vector18.X / 16f) * 16; - vector18.Y = (int)(vector18.Y / 16f) * 16; - num191 -= vector18.X; - num192 -= vector18.Y; + Vector2 npcCenter = npc.Center; + float targetCenterX = player.Center.X; + float targetCenterY = player.Center.Y; + targetCenterX = (int)(targetCenterX / 16f) * 16; + targetCenterY = (int)(targetCenterY / 16f) * 16; + npcCenter.X = (int)(npcCenter.X / 16f) * 16; + npcCenter.Y = (int)(npcCenter.Y / 16f) * 16; + targetCenterX -= npcCenter.X; + targetCenterY -= npcCenter.Y; - float num193 = (float)Math.Sqrt(num191 * num191 + num192 * num192); + float distanceFromTarget = (float)Math.Sqrt(targetCenterX * targetCenterX + targetCenterY * targetCenterY); if (npc.ai[1] > 0f && npc.ai[1] < Main.npc.Length) { try { - vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - num191 = Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) - vector18.X; - num192 = Main.npc[(int)npc.ai[1]].position.Y + (Main.npc[(int)npc.ai[1]].height / 2) - vector18.Y; + npcCenter = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + targetCenterX = Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) - npcCenter.X; + targetCenterY = Main.npc[(int)npc.ai[1]].position.Y + (Main.npc[(int)npc.ai[1]].height / 2) - npcCenter.Y; } catch { } - npc.rotation = (float)Math.Atan2(num192, num191) + MathHelper.PiOver2; - num193 = (float)Math.Sqrt(num191 * num191 + num192 * num192); - int num194 = npc.width; - num193 = (num193 - num194) / num193; - num191 *= num193; - num192 *= num193; + npc.rotation = (float)Math.Atan2(targetCenterY, targetCenterX) + MathHelper.PiOver2; + distanceFromTarget = (float)Math.Sqrt(targetCenterX * targetCenterX + targetCenterY * targetCenterY); + distanceFromTarget = (distanceFromTarget - npc.width) / distanceFromTarget; + targetCenterX *= distanceFromTarget; + targetCenterY *= distanceFromTarget; npc.velocity = Vector2.Zero; - npc.position.X = npc.position.X + num191; - npc.position.Y = npc.position.Y + num192; + npc.position.X = npc.position.X + targetCenterX; + npc.position.Y = npc.position.Y + targetCenterY; - if (num191 < 0f) + if (targetCenterX < 0f) npc.spriteDirection = -1; - else if (num191 > 0f) + else if (targetCenterX > 0f) npc.spriteDirection = 1; } } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index 63e5a0af78..710be48b47 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -432,44 +432,44 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos Player player = Main.player[Main.npc[CalamityGlobalNPC.draedonExoMechWorm].target]; - Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - float num191 = player.position.X + (player.width / 2); - float num192 = player.position.Y + (player.height / 2); - num191 = (int)(num191 / 16f) * 16; - num192 = (int)(num192 / 16f) * 16; - vector18.X = (int)(vector18.X / 16f) * 16; - vector18.Y = (int)(vector18.Y / 16f) * 16; - num191 -= vector18.X; - num192 -= vector18.Y; + Vector2 npcCenter = npc.Center; + float targetCenterX = player.Center.X; + float targetCenterY = player.Center.Y; + targetCenterX = (int)(targetCenterX / 16f) * 16; + targetCenterY = (int)(targetCenterY / 16f) * 16; + npcCenter.X = (int)(npcCenter.X / 16f) * 16; + npcCenter.Y = (int)(npcCenter.Y / 16f) * 16; + targetCenterX -= npcCenter.X; + targetCenterY -= npcCenter.Y; - float num193 = (float)Math.Sqrt(num191 * num191 + num192 * num192); - if (npc.ai[1] > 0f && npc.ai[1] < Main.npc.Length) - { - try - { - vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - num191 = Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) - vector18.X; - num192 = Main.npc[(int)npc.ai[1]].position.Y + (Main.npc[(int)npc.ai[1]].height / 2) - vector18.Y; - } catch - { - } + float distanceFromTarget = (float)Math.Sqrt(targetCenterX * targetCenterX + targetCenterY * targetCenterY); + if (npc.ai[1] > 0f && npc.ai[1] < Main.npc.Length) + { + try + { + npcCenter = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + targetCenterX = Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) - npcCenter.X; + targetCenterY = Main.npc[(int)npc.ai[1]].position.Y + (Main.npc[(int)npc.ai[1]].height / 2) - npcCenter.Y; + } + catch + { + } - npc.rotation = (float)Math.Atan2(num192, num191) + MathHelper.PiOver2; - num193 = (float)Math.Sqrt(num191 * num191 + num192 * num192); - int num194 = npc.width; - num193 = (num193 - num194) / num193; - num191 *= num193; - num192 *= num193; - npc.velocity = Vector2.Zero; - npc.position.X = npc.position.X + num191; - npc.position.Y = npc.position.Y + num192; + npc.rotation = (float)Math.Atan2(targetCenterY, targetCenterX) + MathHelper.PiOver2; + distanceFromTarget = (float)Math.Sqrt(targetCenterX * targetCenterX + targetCenterY * targetCenterY); + distanceFromTarget = (distanceFromTarget - npc.width) / distanceFromTarget; + targetCenterX *= distanceFromTarget; + targetCenterY *= distanceFromTarget; + npc.velocity = Vector2.Zero; + npc.position.X = npc.position.X + targetCenterX; + npc.position.Y = npc.position.Y + targetCenterY; - if (num191 < 0f) - npc.spriteDirection = -1; - else if (num191 > 0f) - npc.spriteDirection = 1; - } - } + if (targetCenterX < 0f) + npc.spriteDirection = -1; + else if (targetCenterX > 0f) + npc.spriteDirection = 1; + } + } public override bool CanHitPlayer(Player target, ref int cooldownSlot) { diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index 2c2e1d87c9..f5bc1f3eea 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -431,44 +431,44 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos Player player = Main.player[Main.npc[CalamityGlobalNPC.draedonExoMechWorm].target]; - Vector2 vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - float num191 = player.position.X + (player.width / 2); - float num192 = player.position.Y + (player.height / 2); - num191 = (int)(num191 / 16f) * 16; - num192 = (int)(num192 / 16f) * 16; - vector18.X = (int)(vector18.X / 16f) * 16; - vector18.Y = (int)(vector18.Y / 16f) * 16; - num191 -= vector18.X; - num192 -= vector18.Y; + Vector2 npcCenter = npc.Center; + float targetCenterX = player.Center.X; + float targetCenterY = player.Center.Y; + targetCenterX = (int)(targetCenterX / 16f) * 16; + targetCenterY = (int)(targetCenterY / 16f) * 16; + npcCenter.X = (int)(npcCenter.X / 16f) * 16; + npcCenter.Y = (int)(npcCenter.Y / 16f) * 16; + targetCenterX -= npcCenter.X; + targetCenterY -= npcCenter.Y; - float num193 = (float)Math.Sqrt(num191 * num191 + num192 * num192); - if (npc.ai[1] > 0f && npc.ai[1] < Main.npc.Length) - { - try - { - vector18 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - num191 = Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) - vector18.X; - num192 = Main.npc[(int)npc.ai[1]].position.Y + (Main.npc[(int)npc.ai[1]].height / 2) - vector18.Y; - } catch - { - } + float distanceFromTarget = (float)Math.Sqrt(targetCenterX * targetCenterX + targetCenterY * targetCenterY); + if (npc.ai[1] > 0f && npc.ai[1] < Main.npc.Length) + { + try + { + npcCenter = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + targetCenterX = Main.npc[(int)npc.ai[1]].position.X + (Main.npc[(int)npc.ai[1]].width / 2) - npcCenter.X; + targetCenterY = Main.npc[(int)npc.ai[1]].position.Y + (Main.npc[(int)npc.ai[1]].height / 2) - npcCenter.Y; + } + catch + { + } - npc.rotation = (float)Math.Atan2(num192, num191) + MathHelper.PiOver2; - num193 = (float)Math.Sqrt(num191 * num191 + num192 * num192); - int num194 = npc.width; - num193 = (num193 - num194) / num193; - num191 *= num193; - num192 *= num193; - npc.velocity = Vector2.Zero; - npc.position.X = npc.position.X + num191; - npc.position.Y = npc.position.Y + num192; + npc.rotation = (float)Math.Atan2(targetCenterY, targetCenterX) + MathHelper.PiOver2; + distanceFromTarget = (float)Math.Sqrt(targetCenterX * targetCenterX + targetCenterY * targetCenterY); + distanceFromTarget = (distanceFromTarget - npc.width) / distanceFromTarget; + targetCenterX *= distanceFromTarget; + targetCenterY *= distanceFromTarget; + npc.velocity = Vector2.Zero; + npc.position.X = npc.position.X + targetCenterX; + npc.position.Y = npc.position.Y + targetCenterY; - if (num191 < 0f) - npc.spriteDirection = -1; - else if (num191 > 0f) - npc.spriteDirection = 1; - } - } + if (targetCenterX < 0f) + npc.spriteDirection = -1; + else if (targetCenterX > 0f) + npc.spriteDirection = 1; + } + } public override bool CanHitPlayer(Player target, ref int cooldownSlot) { From 5b11a94866cda8b70da9a6ff39fca179210fe197 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Sun, 12 Sep 2021 15:11:55 -0500 Subject: [PATCH 6/9] 1 - Reduced the amount of shards the Aquashard Shotgun projectiles split into from 2-3 to 1-2. --- Projectiles/Ranged/Aquashard.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projectiles/Ranged/Aquashard.cs b/Projectiles/Ranged/Aquashard.cs index 0901bbb88b..1736325cca 100644 --- a/Projectiles/Ranged/Aquashard.cs +++ b/Projectiles/Ranged/Aquashard.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - int projAmt = Main.rand.Next(2, 4); + int projAmt = Main.rand.Next(1, 3); if (projectile.owner == Main.myPlayer) { for (int i = 0; i < projAmt; i++) From 5ea4c7abb0369d7e165a8a702566916964ae437a Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Sun, 12 Sep 2021 15:13:35 -0500 Subject: [PATCH 7/9] 1 - Fixed wack hitboxes of aquashards. --- Projectiles/Ranged/Aquashard.cs | 2 +- Projectiles/Ranged/AquashardSplit.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Projectiles/Ranged/Aquashard.cs b/Projectiles/Ranged/Aquashard.cs index 1736325cca..b0b763a4c5 100644 --- a/Projectiles/Ranged/Aquashard.cs +++ b/Projectiles/Ranged/Aquashard.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetDefaults() { projectile.width = 10; - projectile.height = 16; + projectile.height = 10; projectile.friendly = true; projectile.ranged = true; projectile.penetrate = 1; diff --git a/Projectiles/Ranged/AquashardSplit.cs b/Projectiles/Ranged/AquashardSplit.cs index 9b0f5db1f6..0ce0ef2bad 100644 --- a/Projectiles/Ranged/AquashardSplit.cs +++ b/Projectiles/Ranged/AquashardSplit.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Projectiles.Ranged public override void SetDefaults() { projectile.width = 10; - projectile.height = 16; + projectile.height = 10; projectile.friendly = true; projectile.ranged = true; projectile.penetrate = 1; From 1b97310d62da4d7f9b164997556568aacef9005d Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Sun, 12 Sep 2021 15:22:18 -0500 Subject: [PATCH 8/9] 1 - Useless. --- ModSupport/WeakReferenceSupport.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 7bb800ff13..6b2d90b5d0 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -586,7 +586,7 @@ namespace CalamityMod List bosses = new List() { NPCType(), NPCType(), NPCType(), NPCType() }; List loot = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; //List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; - string instructions = "By using a high-tech computer thing"; + string instructions = "By using a high-tech computer"; string despawn = CalamityUtils.ColorMessage("An imperfection after all...what a shame.", new Color(0x7F, 0xFF, 0xD4)); //string bossLogTex = "CalamityMod/NPCs/ExoMechs/ExoMechs_BossChecklist"; //AddBoss(bossChecklist, calamity, "ExoMechs", order, bosses, DownedExoMechs, null, loot, collection, instructions, despawn, bossLogTex); From a2ba10327c3a25d07de7b5e11bae9e72aa8aff31 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Sun, 12 Sep 2021 16:22:00 -0500 Subject: [PATCH 9/9] 1 - Artemis laser offset fix. --- Projectiles/Boss/ExoDestroyerLaser.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Projectiles/Boss/ExoDestroyerLaser.cs b/Projectiles/Boss/ExoDestroyerLaser.cs index 13ea28b98b..5128f706d0 100644 --- a/Projectiles/Boss/ExoDestroyerLaser.cs +++ b/Projectiles/Boss/ExoDestroyerLaser.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.NPCs.ExoMechs.Ares; +using CalamityMod.NPCs.ExoMechs.Artemis; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -145,9 +146,12 @@ namespace CalamityMod.Projectiles.Boss return; } - // If the Ares Laser Cannon is the owner + // If the Ares Laser Cannon is the owner. bool aresLaserIsOwner = ThingToAttachTo.type == ModContent.NPCType(); + // If Artemis is the owner. + bool artemisIsOwner = ThingToAttachTo.type == ModContent.NPCType(); + // Fade in after telegraphs have faded. if (TelegraphDelay > TelegraphTotalTime) { @@ -187,6 +191,8 @@ namespace CalamityMod.Projectiles.Boss if (aresLaserIsOwner) projectile.Center += Vector2.Normalize(Destination - ThingToAttachTo.Center) * 70f + Vector2.UnitY * 16f; + else if (artemisIsOwner) + projectile.Center += Vector2.Normalize(Destination - ThingToAttachTo.Center) * 70f; // Calculate and store the velocity that will be used for laser telegraph rotation and beam firing. Vector2 projectileDestination = Destination - ThingToAttachTo.Center; @@ -215,6 +221,8 @@ namespace CalamityMod.Projectiles.Boss if (aresLaserIsOwner) projectile.Center += Vector2.Normalize(Destination - ThingToAttachTo.Center) * 70f + Vector2.UnitY * 16f; + else if (artemisIsOwner) + projectile.Center += Vector2.Normalize(Destination - ThingToAttachTo.Center) * 70f; // Calculate and store the velocity that will be used for laser telegraph rotation and beam firing. Vector2 projectileDestination = Destination - ThingToAttachTo.Center;