From b0cf50de905fcef97f482109e118b5ebb58b513c Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Wed, 3 Nov 2021 22:58:34 -0500 Subject: [PATCH 1/3] Added Ares' arms (still somewhat wip) --- ExtraTextures/AresArmTopPart1.png | Bin 0 -> 731 bytes ExtraTextures/AresArmTopPart2.png | Bin 0 -> 1018 bytes ExtraTextures/AresArmTopPart2Glow.png | Bin 0 -> 386 bytes ExtraTextures/AresArmTopSegment.png | Bin 0 -> 521 bytes ExtraTextures/AresArmTopSegmentGlow.png | Bin 0 -> 255 bytes ExtraTextures/AresArmTopShoulder.png | Bin 0 -> 1442 bytes ExtraTextures/AresArmTopShoulderGlow.png | Bin 0 -> 487 bytes NPCs/ExoMechs/Ares/AresBody.cs | 148 +++++++++++++++++++---- Projectiles/Boss/AresTeslaOrb.cs | 4 +- 9 files changed, 127 insertions(+), 25 deletions(-) create mode 100644 ExtraTextures/AresArmTopPart1.png create mode 100644 ExtraTextures/AresArmTopPart2.png create mode 100644 ExtraTextures/AresArmTopPart2Glow.png create mode 100644 ExtraTextures/AresArmTopSegment.png create mode 100644 ExtraTextures/AresArmTopSegmentGlow.png create mode 100644 ExtraTextures/AresArmTopShoulder.png create mode 100644 ExtraTextures/AresArmTopShoulderGlow.png diff --git a/ExtraTextures/AresArmTopPart1.png b/ExtraTextures/AresArmTopPart1.png new file mode 100644 index 0000000000000000000000000000000000000000..fc58f490580d2ff418b8a51915c3dba420bca3dc GIT binary patch literal 731 zcmeAS@N?(olHy`uVBq!ia0vp^B|xmg!3-qxPrZ8tq!^2X+?^QKos)S9+XVQ8xB_W0AsGWpS2+d68PD$|_Rll6un&k#FRtm{u=l7(W`V6=xRQo} zpOX3#1INzVr0$07&f4UO9SuN@?o#hXfs{x|kYDhBOu*pp|6C9#&spFRS8 zdVKGjqkf#Z-lOo(B}x6WQ@vBydHkNM6r>vTegE~>o7NorS|!#$&8TA5k~!&I4f{I! zmz1p4anpQjzEt3!!L_ZK$GrlVnVi2}wmN5a`PYyZ`x^_7>2W8mH!7YtsbyiyGFkn( z%PRR)kKbPFTC{DI+@UGmpNh(ouX0S;Wj0+>o9EBzAU4o_r7;Ld9zr)spPiT z!<(g7RkWTKcp0YmF3*zDbX^$cwKM!z$Md?5B|@81u6?zbH}6hnx>hS&|Kw#`-q#kJ zn$~UK`OA5yPKSfnT*Xw&-pQBzqB;d!v-4bRzB~VVwn^8kRObA7ef`39MaMiB?_^@V zEq`{ZN&0Q|S8f;O&rfLz_|LV?aa*m6=H7k#_AWhAImOuP)H8KW{f(zvk7;F@MhLD* zp0qXD*(>3t;?t#Tmrd$cmS*|5@lvLjW?Z77Nmsz;{ce{v+!ncBFmu#koo*NH=Gl6l zqxs?6r@m43FSu2dGj%p>o~Av|$rfmAgS4Q*ox5$RUzVQ}P}N;zF)1i_%CuJHTei~K zlE*y07BQa_tmfUyvHLIM(!MWNZauqWHajc`@0+&oc=nGkhlK?kCU?enzEzI-QvT2M z<#&ViPcy1^2P!@ai`J7{_ox37Tju%B)nIC3WKMspUXO@ GgeCyu(MO2@ literal 0 HcmV?d00001 diff --git a/ExtraTextures/AresArmTopPart2.png b/ExtraTextures/AresArmTopPart2.png new file mode 100644 index 0000000000000000000000000000000000000000..3390cc34de7333d072564d668d172fc44588b033 GIT binary patch literal 1018 zcmVPx#1ZP1_K>z@;j|==^1poj5KTu3mMF0Q*9v~qzI6qKXXPTt0b9{@z%+XFFC)4X} zq%c9pK0Zlhx@qv-IWBXnxPSWpaR2}C^0q0a@M-dJNdN!<;%<^W0000LbW%=J|NsC0 z|NsC0|NsC0|NsC0|NsC004v#j>Hq)$32;bRa{vGizyJUazyWI3i3tDz10zX9K~z{r z-Iv>Tn=lXn4Kyw;w>ZuJe`_@wHUfNU`_OY#&w~-tYIlN!9G^b_Da{va#{*tpqiwtH zTjnj%w$D^vTcapImw2x7x*B_h^SSGqrcFFksavDGWO4m7iUK9Mp3h3iBb9nJC~WX4 z!S=eRvgX}DB!#&$AC0mkL5%KI>eOHgK?Ku2o%r+)DTGW%!6VEimJHyM>^01GRH;vc zaFQ8DVS4yfC0AM@4cm}7Tl5|^ZkI%eiKy?Hx->$;G{QsMK76N%B1U%aDG^ZI<7!$On1ieEdB+?68mB#sOX#%)1!NbdPM-fVS(9uE$oK@OnBS$FA ziN0T!X|j?U9AWinkQNx=Q8AHT53r*K<@sa*q9iJ}ph8YGnr2C`MdAH@7(6DV9u00` znug(eC76k%P(u;Y##VF#8sR+=z#66a!k+0B^hlKbEPNLfRR00RhDoVng$I- zLZxO6M2bc%3mU$l5}Q?wxu>xeQDd4|7Ak-mEP1x5N(0c~q0KWAYP`Ln=SKB-bBQRC z>wl3e?=TMdlIyy8_D~;3UWH}hEA4WrPotCoUM_k}Mo)av8FzbViSYsB#Iqod&+{~S zJYF;PY7m?=f5Al3WwZ1H5)Jxdi5N9f8T;s^<+fywndEwHnx6?Jhzp6jH24Q5R46VK zN5TRqc&CU984F~|(u#Zk0RM#Rb(%tAn%4R&^=PWLhmk2(_PDS0e5 zZLXJ#$EZDm1|p8|gVB6alLnBGfFeUOde?vr^cro;_I*~1yey#-KMM-AX^1JENRhSs zF1dbUt@jYKsR8~h_#ZUH^y|%UFt(^4v0niX0N6{^t?~DmJc{nw3asHbyq1Po>ZoJi o8uEZw)CepbtesD(LgVxE7t9F|RL7Ea8UO$Q07*qoM6N<$f}}{yx&QzG literal 0 HcmV?d00001 diff --git a/ExtraTextures/AresArmTopPart2Glow.png b/ExtraTextures/AresArmTopPart2Glow.png new file mode 100644 index 0000000000000000000000000000000000000000..c98e533d239d5182045929ec90ffeff4575f0339 GIT binary patch literal 386 zcmeAS@N?(olHy`uVBq!ia0vp^Z9r_n!3-q%(+idXDaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(eheasfUeu0ZzvFFcUJGH|MkD%|Njr4wrMW=kol>=6DTz?{aHPb;wlO9 z3;quS44cmAoCk_>7I;J!GcfS&2Vq7F)?gK&;B`+I$B+p3w^wfSwJ7koUKA8q{{R2s z%gjfw+@7s6cgt_j3op93us8T{sc724(+~H}ZCF}xPfW)sjm_=8 zT(j(vATA5Jf9|8Q~#^Orw{7le7AMPBtvs+@|`0Ibc z|NkF0>^=Ia!1L2KO+O{|cI_~r#(!mc)<8<6B*-uLKPF)C_kS)3l;vHi~@@kiMZPqb7X%=DX z@Ug4aUQV8kyTfbUMU|!g&CN5@Ra$CiIC8!fy=6Op-dE3pxPM0{|6K2~=G3y47L)Ar zPPZO;8nSdEhZOh!uWalpa#r#hx;sN0Hecp`9P}yo@`cd)M1>8Ui=977gdWMhIxQ;B uUMcAEkDn`S8s#|O{yrbi!r^iI8|#rdmYgAvF0Td#D}$%2pUXO@geCy>xZ4*1 literal 0 HcmV?d00001 diff --git a/ExtraTextures/AresArmTopSegmentGlow.png b/ExtraTextures/AresArmTopSegmentGlow.png new file mode 100644 index 0000000000000000000000000000000000000000..508e7a4db16c2a9235b142c62613e731d6efc06b GIT binary patch literal 255 zcmeAS@N?(olHy`uVBq!ia0vp^DnM+&!3-q*W@@MdDaPU;cPEB*=VV?2IV|apzK#qG z8~eHcB(eheq5(c3u0T5T!<}FM3;zHA@TtJFT{{dY@?yifQXs`%666>B9}F0zyqVpA zLYxI2k;M!QdN3H`3JggV5WxT6@@@Y29%XJ1py9&&> z>^fdN)W7vYyX2l>$Z=>Px# literal 0 HcmV?d00001 diff --git a/ExtraTextures/AresArmTopShoulder.png b/ExtraTextures/AresArmTopShoulder.png new file mode 100644 index 0000000000000000000000000000000000000000..0ccf4a33fe41599e78e1f497d70c1c2f53c5f7cf GIT binary patch literal 1442 zcmV;T1zq}yP)Px#1ZP1_K>z@;j|==^1poj5PEbr#MF0Q*hbvYyI6odBA@a5<@^DGP%+de<@W(zr zP+4ble2bc-uB0$QIWBXfgpx&AfcpP%K3T4gqe0W_Y#<#lkzkRg@M&62cupcG0001+ zH6P3X000_vQchF<|NsC0|NsC0|NsC0|NsC0|NsC0|NsC002Cqs+5i9m32;bRa{vGi z!TRzB=zk<9M zC^s}w*CM9{C4r%?bF51uyOxlRI$Nb|MGsX#%l*CNr+BwEHPs_TO>K zLnLXYJ;z!~v0=O~VxV$(q1I3@cZ`8jHUS-DJpuntv0j@En+h@BL$`%iC1EL|tA>s4fQ6 zgdPI)Ho<~xqD{3u#-puJq-UmOW-I7+%PSwo1g_A_1iQe%U?C_Q=f3T17Nvw3qs^zH zA#}SP243U)ezgLNiQ>rA#4R1HTOk4*C5WPrg`OefW$$KCQoGynYP(wP_k^!l(uOM^ zp**}08f9+o+lz68H(s>UfPy?6cDt_QvGdoj{hkd%6BG$XU@3oso+HkMhcRgDPoPB8 zbQ5SG4FdFd?7C`*nOh@)g!1^U@ENB!a1|JBUUMqPcF@!5>FIF5oO0jqfB)|L<1w~< zp_CSm2rQ1=q*a-CRro1J;uvJ!9GXE*E@|w#;}NI{R=!l=41y$5TEYxk49f{oWhe;? zPY9lrZY$_8{P|-c2qnQ>Hjy|%0GZb+kc7;UUsae%aqMD6mRnmxXawW4-vbrn%Q3SS z6c*>nHFOAz!YtBuz1G)lw;hx%P#}~0{qg9=FVGSI`uwaFixC%4{ApQIp=Dv=B~y{@ zpu62LjG+L<2}Bgca}q(_7{C!QGc$}f5S9@~n+I1B?ueLoC~#pz_Z5So;ak;oaLqz)?; zv*-4KEySc&P#;1;@(Oi2VFrwFeB+RPi#W1uv>7XwbP3J0qP9?OXp6;ms|ltRITrJj z92@*4RP2l?W=>$(yaz-rp#;{nJR6D4FD>l-E=y?o~4KDk=s+fHcr&>bYqIEa466A;DOXxLf3mqeCU#N?4 zG1=>jY6k`D7EkF1QYc8;7}fr3Y72Ec@WqFot;trmN^W~7kaMWm(07E6VX=VQA*TT4 zp^|SjPAuTtA*TW*d?vjn)}D5^(KMhS{2*|*1)|naHaz~M62>=|$?cI-g8C8pJ)!(j wGX^?$d$or8C(Zu`qPEbn9Q%K20DXD+3s}MU*Xe;D_5c6?07*qoM6N<$g3ue64gdfE literal 0 HcmV?d00001 diff --git a/ExtraTextures/AresArmTopShoulderGlow.png b/ExtraTextures/AresArmTopShoulderGlow.png new file mode 100644 index 0000000000000000000000000000000000000000..b23f5bdbbb9fcaf841871c75f54eb5c23880573f GIT binary patch literal 487 zcmeAS@N?(olHy`uVBq!ia0vp^B_Pbf3?!3Xo{0h}#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6-k0X`wFK)PK!?9(>QPX(TfTPFSbUtkxxu5Yp9<<~hA6DBVEkO@?f7GEa~ zqO)G{+Q#JTq=`)W_g?RJ>@jAH93}fD?IvhPx{si zvr&?D9{7n5NKP6s8Wp!&^QYu5K z{Flp<^Ov<>tG7+|dHFZtPhGi#bHuh3MsNPP%RW77nGm%1>WVKHHXW>4`@%76@gK+6 z&aW2Pdd6;v5w2d^`3>Pjnbv0-ChiO2uD-Q@fs6nD4Ho|MFBkm*1}cN6tDnm{r-UW| Dh8EYW literal 0 HcmV?d00001 diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index 4e48d24cff..40d3dea6eb 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -17,6 +17,7 @@ using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; +using System.Collections.Generic; using System.IO; using Terraria; using Terraria.ID; @@ -26,7 +27,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares { [AutoloadBossHead] public class AresBody : ModNPC - { + { // Used for loot public enum MechType { @@ -106,34 +107,38 @@ namespace CalamityMod.NPCs.ExoMechs.Ares // Max distance from the target before they are unable to hear sound telegraphs private const float soundDistance = 4800f; + // Drawers for arm segments. + public static PrimitiveTrail LightningDrawer; + public static PrimitiveTrail LightningBackgroundDrawer; + public override void SetStaticDefaults() - { - DisplayName.SetDefault("XF-09 Ares"); + { + DisplayName.SetDefault("XF-09 Ares"); NPCID.Sets.TrailingMode[npc.type] = 3; NPCID.Sets.TrailCacheLength[npc.type] = npc.oldPos.Length; } - public override void SetDefaults() - { + public override void SetDefaults() + { npc.npcSlots = 5f; npc.damage = 100; npc.width = 220; - npc.height = 252; - npc.defense = 100; + npc.height = 252; + npc.defense = 100; npc.DR_NERD(0.35f); npc.LifeMaxNERB(1300000, 1495000, 500000); double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01; npc.lifeMax += (int)(npc.lifeMax * HPBoost); npc.aiStyle = -1; - aiType = -1; + aiType = -1; npc.Opacity = 0f; - npc.knockBackResist = 0f; - npc.value = Item.buyPrice(3, 33, 0, 0); - npc.noGravity = true; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath14; - npc.netAlways = true; + npc.knockBackResist = 0f; + npc.value = Item.buyPrice(3, 33, 0, 0); + npc.noGravity = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath14; + npc.netAlways = true; npc.boss = true; music = /*CalamityMod.Instance.GetMusicFromMusicMod("AdultEidolonWyrm") ??*/ MusicID.Boss3; bossBag = ModContent.ItemType(); @@ -146,19 +151,19 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } public override void SendExtraAI(BinaryWriter writer) - { + { writer.Write(frameX); writer.Write(frameY); writer.Write(armsSpawned); - writer.Write(npc.dontTakeDamage); + writer.Write(npc.dontTakeDamage); writer.Write(npc.localAI[0]); writer.Write(npc.localAI[1]); for (int i = 0; i < 4; i++) writer.Write(npc.Calamity().newAI[i]); } - public override void ReceiveExtraAI(BinaryReader reader) - { + public override void ReceiveExtraAI(BinaryReader reader) + { frameX = reader.ReadInt32(); frameY = reader.ReadInt32(); armsSpawned = reader.ReadBoolean(); @@ -169,8 +174,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares npc.Calamity().newAI[i] = reader.ReadSingle(); } - public override void AI() - { + public override void AI() + { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); CalamityGlobalNPC.draedonExoMechPrime = npc.whoAmI; @@ -786,6 +791,21 @@ namespace CalamityMod.NPCs.ExoMechs.Ares // Draw the enrage smoke behind Ares SmokeDrawer.DrawSet(npc.Center); + // Draw arms. + int laserArm = NPC.FindFirstNPC(ModContent.NPCType()); + int gaussArm = NPC.FindFirstNPC(ModContent.NPCType()); + int teslaArm = NPC.FindFirstNPC(ModContent.NPCType()); + int plasmaArm = NPC.FindFirstNPC(ModContent.NPCType()); + + if (laserArm != -1) + DrawArm(spriteBatch, Main.npc[laserArm].Center, -1, true); + if (gaussArm != -1) + DrawArm(spriteBatch, Main.npc[gaussArm].Center, 1, true); + if (teslaArm != -1) + DrawArm(spriteBatch, Main.npc[teslaArm].Center, -1, false); + if (plasmaArm != -1) + DrawArm(spriteBatch, Main.npc[plasmaArm].Center, 1, false); + Texture2D texture = Main.npcTexture[npc.type]; Rectangle frame = new Rectangle(npc.width * frameX, npc.height * frameY, npc.width, npc.height); Vector2 vector = new Vector2(npc.width / 2, npc.height / 2); @@ -831,6 +851,88 @@ namespace CalamityMod.NPCs.ExoMechs.Ares return false; } + internal float WidthFunction(float completionRatio) + { + return MathHelper.Lerp(0.75f, 1.85f, (float)Math.Sin(MathHelper.Pi * completionRatio)) * npc.scale; + } + + internal Color ColorFunction(float completionRatio) + { + float fadeToWhite = MathHelper.Lerp(0f, 0.65f, (float)Math.Sin(MathHelper.TwoPi * completionRatio + Main.GlobalTime * 4f) * 0.5f + 0.5f); + Color baseColor = Color.Lerp(Color.Cyan, Color.White, fadeToWhite); + Color color = Color.Lerp(baseColor, Color.LightBlue, ((float)Math.Sin(MathHelper.Pi * completionRatio + Main.GlobalTime * 4f) * 0.5f + 0.5f) * 0.8f) * npc.Opacity; + color.A = 84; + return color; + } + + internal float BackgroundWidthFunction(float completionRatio) => WidthFunction(completionRatio) * 4f; + + public Color BackgroundColorFunction(float completionRatio) + { + Color color = Color.CornflowerBlue * npc.Opacity * 0.4f; + return color; + } + + public void DrawArm(SpriteBatch spriteBatch, Vector2 handPosition, int direction, bool backArm) + { + if (LightningDrawer is null) + LightningDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, PrimitiveTrail.RigidPointRetreivalFunction); + if (LightningBackgroundDrawer is null) + LightningBackgroundDrawer = new PrimitiveTrail(BackgroundWidthFunction, BackgroundColorFunction, PrimitiveTrail.RigidPointRetreivalFunction); + + SpriteEffects spriteDirection = direction == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + float distanceFromHand = npc.Distance(handPosition); + + Texture2D shoulderTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/AresArmTopShoulder"); + Texture2D armTexture1 = ModContent.GetTexture("CalamityMod/ExtraTextures/AresArmTopPart1"); + Texture2D armSegmentTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/AresArmTopSegment"); + Texture2D armTexture2 = ModContent.GetTexture("CalamityMod/ExtraTextures/AresArmTopPart2"); + + Texture2D shoulderGlowmask = ModContent.GetTexture("CalamityMod/ExtraTextures/AresArmTopShoulderGlow"); + Texture2D armSegmentGlowmask = ModContent.GetTexture("CalamityMod/ExtraTextures/AresArmTopSegmentGlow"); + Texture2D armGlowmask2 = ModContent.GetTexture("CalamityMod/ExtraTextures/AresArmTopPart2Glow"); + + Vector2 shoulderDrawPosition = npc.Center + new Vector2(direction * (backArm ? 176f : 232f), backArm ? -100f : -36f); + Color shoulderLightColor = npc.GetAlpha(Lighting.GetColor((int)shoulderDrawPosition.X / 16, (int)shoulderDrawPosition.Y / 16)); + Color glowmaskColor = npc.GetAlpha(Color.White); + Vector2 arm1DrawPosition = shoulderDrawPosition + new Vector2(direction * (shoulderTexture.Width + 40f), 10f); + Vector2 armSegmentDrawPosition = arm1DrawPosition; + + Vector2 arm1Origin = armTexture1.Size() * new Vector2((direction == 1).ToInt(), 0.5f); + Vector2 arm2Origin = armTexture2.Size() * new Vector2((direction == 1).ToInt(), 0.5f); + + float arm1Rotation = MathHelper.Clamp(distanceFromHand * direction / 1200f, -0.22f, 0.22f); + float arm2Rotation = (handPosition - armSegmentDrawPosition).ToRotation(); + if (direction == 1) + arm2Rotation += MathHelper.Pi; + + // Handle offsets for points. + armSegmentDrawPosition += arm1Rotation.ToRotationVector2() * direction * 50f; + Vector2 arm2DrawPosition = armSegmentDrawPosition; + arm2DrawPosition -= arm2Rotation.ToRotationVector2() * direction * 40f; + arm2DrawPosition += (arm2Rotation - MathHelper.PiOver2).ToRotationVector2() * 14f; + + // Draw electricity between arms. + List arm1ElectricArcPoints = AresTeslaOrb.DetermineElectricArcPoints(arm1DrawPosition, armSegmentDrawPosition, 466920161); + List arm2ElectricArcPoints = AresTeslaOrb.DetermineElectricArcPoints(armSegmentDrawPosition, arm2DrawPosition, 250290787); + LightningBackgroundDrawer.Draw(arm1ElectricArcPoints, -Main.screenPosition, 90); + LightningDrawer.Draw(arm1ElectricArcPoints, -Main.screenPosition, 90); + LightningBackgroundDrawer.Draw(arm2ElectricArcPoints, -Main.screenPosition, 90); + LightningDrawer.Draw(arm2ElectricArcPoints, -Main.screenPosition, 90); + + shoulderDrawPosition += Vector2.UnitY * npc.gfxOffY - Main.screenPosition; + arm1DrawPosition += Vector2.UnitY * npc.gfxOffY - Main.screenPosition; + armSegmentDrawPosition += Vector2.UnitY * npc.gfxOffY - Main.screenPosition; + arm2DrawPosition += Vector2.UnitY * npc.gfxOffY - Main.screenPosition; + + spriteBatch.Draw(armTexture1, arm1DrawPosition, null, shoulderLightColor, arm1Rotation, arm1Origin, npc.scale, spriteDirection, 0f); + spriteBatch.Draw(shoulderTexture, shoulderDrawPosition, null, shoulderLightColor, 0f, shoulderTexture.Size() * 0.5f, npc.scale, spriteDirection, 0f); + spriteBatch.Draw(shoulderGlowmask, shoulderDrawPosition, null, glowmaskColor, 0f, shoulderTexture.Size() * 0.5f, npc.scale, spriteDirection, 0f); + spriteBatch.Draw(armSegmentTexture, armSegmentDrawPosition, null, shoulderLightColor, arm2Rotation, armSegmentTexture.Size() * 0.5f, npc.scale, spriteDirection, 0f); + spriteBatch.Draw(armSegmentGlowmask, armSegmentDrawPosition, null, glowmaskColor, arm2Rotation, armSegmentTexture.Size() * 0.5f, npc.scale, spriteDirection, 0f); + spriteBatch.Draw(armTexture2, arm2DrawPosition, null, shoulderLightColor, arm2Rotation, arm2Origin, npc.scale, spriteDirection, 0f); + spriteBatch.Draw(armGlowmask2, arm2DrawPosition, null, glowmaskColor, arm2Rotation, arm2Origin, npc.scale, spriteDirection, 0f); + } public override void BossLoot(ref string name, ref int potionType) { @@ -838,7 +940,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } public override void NPCLoot() - { + { // Check if the other exo mechs are alive bool exoWormAlive = false; bool exoTwinsAlive = false; @@ -1020,5 +1122,5 @@ namespace CalamityMod.NPCs.ExoMechs.Ares npc.lifeMax = (int)(npc.lifeMax * 0.8f * bossLifeScale); npc.damage = (int)(npc.damage * 0.8f); } - } + } } diff --git a/Projectiles/Boss/AresTeslaOrb.cs b/Projectiles/Boss/AresTeslaOrb.cs index 4e15d1898e..fb1278e334 100644 --- a/Projectiles/Boss/AresTeslaOrb.cs +++ b/Projectiles/Boss/AresTeslaOrb.cs @@ -168,7 +168,7 @@ namespace CalamityMod.Projectiles.Boss return null; } - public List DetermineElectricArcPoints(Vector2 start, Vector2 end, int seed) + public static List DetermineElectricArcPoints(Vector2 start, Vector2 end, int seed) { List points = new List(); @@ -194,7 +194,7 @@ namespace CalamityMod.Projectiles.Boss Vector2 offsetDirection = (noise * MathHelper.Pi * 0.7f).ToRotationVector2(); // Then, determine the factor of the offset. This is based on the initial direction (but squashed) and the muffle factor from above. - Vector2 offset = offsetDirection * (float)Math.Pow(offsetDirection.Y, 2D) * offsetMuffleFactor * 25f; + Vector2 offset = offsetDirection * (float)Math.Pow(offsetDirection.Y, 2D) * offsetMuffleFactor * 15f; points[i] += offset; } From 55e16f676f5ad2201d7ecf07878ecb919cfa4cb9 Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Thu, 4 Nov 2021 11:22:12 -0500 Subject: [PATCH 2/3] Rotation/direction fixes --- ExtraTextures/AresArmTopPart1.png | Bin 731 -> 715 bytes NPCs/ExoMechs/Ares/AresBody.cs | 33 ++++++++++--------- NPCs/ExoMechs/Ares/AresGaussNuke.cs | 6 ++++ NPCs/ExoMechs/Ares/AresLaserCannon.cs | 6 ++++ NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs | 6 ++++ NPCs/ExoMechs/Ares/AresTeslaCannon.cs | 8 ++++- 6 files changed, 43 insertions(+), 16 deletions(-) diff --git a/ExtraTextures/AresArmTopPart1.png b/ExtraTextures/AresArmTopPart1.png index fc58f490580d2ff418b8a51915c3dba420bca3dc..02b7d68335006240a9b2a93de7b82559ff145189 100644 GIT binary patch delta 614 zcmV-s0-62W1>+^=kA93N?q5};3H7>=8bly-k5 zNIOj_A+ZdFHhPMzRYz_mVqGtlbv>Ps_Em9GlyE+i64ak2WJ<;3p{0)~MH1$6zg%2P zgc;3PiIVcbNRjhqNK2elIj<{H+tEX$rJVcDcIkVBO}REoih%Un_VQxR)*{M-gYbDN z68#u^p~5Vnc-uMa@F0}9wC~NIT~yg zIrxe=>8)0WqV!DC2v^PUJ29=jr%MnL;irK%T#1w_IjDf(Nqyv2E;Rlfb9_neiItLE z|6Bu!E!^T#dGE3AIijVYl;0kc{v7=)0n+RB6Rp3FDfkVX%m4rY07*qoM6N<$g2YfA AMF0Q* delta 630 zcmV-+0*U?01=|IXNj(-4956XW9v~r@=iFhBo-;ToX6{N4M%YrXoU8Yj6-I-RN8oyh?LYc+~(NcWDMC&vSSNOAnq886M1OJ%M| z`<)_EB~tgl*Xy#Z#`Ss@kCrlcnxvd(3V^D8%FxItc$4XJAG|zwA zcB^cgclA_+KiHwhE(>C>GIO4igrS6{9WR}xc@8DV+pR@%wyGY&l#B9mc4O5Dl)5&T z87mC@%TfkKbGHfubKdueC1^*ElM+-YYjg$9q4rnK*Ub2Wc8ez&>$L%A%7KuVnPFEY&y<2t{|dH2wtYk?y}rJ^rNnuZ zGfK+lCn+zn%Z0`&YBg99sAH0~V?#<{=^^E%t)`NTBO3(qvC?TuDPCbQG>U&vv%f~u zC`O`1&^AFR1(!ZsMoERw2!rA6vfEy7o+}(y{^ry}c zB`u;jl2UDymW3nQJsWEo#z^&Y1I`h94Ydfn{Q;$p^g2e2yIiwCpjVETzQ=3$^urSn zK$D4IiR~j?^mqO>>Gv?N arm1ElectricArcPoints = AresTeslaOrb.DetermineElectricArcPoints(arm1DrawPosition, armSegmentDrawPosition, 466920161); - List arm2ElectricArcPoints = AresTeslaOrb.DetermineElectricArcPoints(armSegmentDrawPosition, arm2DrawPosition, 250290787); - LightningBackgroundDrawer.Draw(arm1ElectricArcPoints, -Main.screenPosition, 90); - LightningDrawer.Draw(arm1ElectricArcPoints, -Main.screenPosition, 90); + List arm2ElectricArcPoints = AresTeslaOrb.DetermineElectricArcPoints(armSegmentDrawPosition, arm2DrawPosition + arm2Rotation.ToRotationVector2() * -direction * 20f, 250290787); LightningBackgroundDrawer.Draw(arm2ElectricArcPoints, -Main.screenPosition, 90); LightningDrawer.Draw(arm2ElectricArcPoints, -Main.screenPosition, 90); @@ -925,13 +928,13 @@ namespace CalamityMod.NPCs.ExoMechs.Ares armSegmentDrawPosition += Vector2.UnitY * npc.gfxOffY - Main.screenPosition; arm2DrawPosition += Vector2.UnitY * npc.gfxOffY - Main.screenPosition; - spriteBatch.Draw(armTexture1, arm1DrawPosition, null, shoulderLightColor, arm1Rotation, arm1Origin, npc.scale, spriteDirection, 0f); + spriteBatch.Draw(armTexture1, arm1DrawPosition, null, arm1LightColor, arm1Rotation, arm1Origin, npc.scale, spriteDirection ^ SpriteEffects.FlipHorizontally, 0f); spriteBatch.Draw(shoulderTexture, shoulderDrawPosition, null, shoulderLightColor, 0f, shoulderTexture.Size() * 0.5f, npc.scale, spriteDirection, 0f); spriteBatch.Draw(shoulderGlowmask, shoulderDrawPosition, null, glowmaskColor, 0f, shoulderTexture.Size() * 0.5f, npc.scale, spriteDirection, 0f); - spriteBatch.Draw(armSegmentTexture, armSegmentDrawPosition, null, shoulderLightColor, arm2Rotation, armSegmentTexture.Size() * 0.5f, npc.scale, spriteDirection, 0f); - spriteBatch.Draw(armSegmentGlowmask, armSegmentDrawPosition, null, glowmaskColor, arm2Rotation, armSegmentTexture.Size() * 0.5f, npc.scale, spriteDirection, 0f); - spriteBatch.Draw(armTexture2, arm2DrawPosition, null, shoulderLightColor, arm2Rotation, arm2Origin, npc.scale, spriteDirection, 0f); - spriteBatch.Draw(armGlowmask2, arm2DrawPosition, null, glowmaskColor, arm2Rotation, arm2Origin, npc.scale, spriteDirection, 0f); + spriteBatch.Draw(armSegmentTexture, armSegmentDrawPosition, null, armSegmentLightColor, armSegmentRotation, armSegmentTexture.Size() * 0.5f, npc.scale, spriteDirection, 0f); + spriteBatch.Draw(armSegmentGlowmask, armSegmentDrawPosition, null, glowmaskColor, armSegmentRotation, armSegmentTexture.Size() * 0.5f, npc.scale, spriteDirection, 0f); + spriteBatch.Draw(armTexture2, arm2DrawPosition, null, arm2LightColor, arm2Rotation, arm2Origin, npc.scale, spriteDirection ^ SpriteEffects.FlipVertically, 0f); + spriteBatch.Draw(armGlowmask2, arm2DrawPosition, null, glowmaskColor, arm2Rotation, arm2Origin, npc.scale, spriteDirection ^ SpriteEffects.FlipVertically, 0f); } public override void BossLoot(ref string name, ref int potionType) diff --git a/NPCs/ExoMechs/Ares/AresGaussNuke.cs b/NPCs/ExoMechs/Ares/AresGaussNuke.cs index 89cfc11d88..51e9218642 100644 --- a/NPCs/ExoMechs/Ares/AresGaussNuke.cs +++ b/NPCs/ExoMechs/Ares/AresGaussNuke.cs @@ -83,6 +83,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares npc.DeathSound = SoundID.NPCDeath14; npc.netAlways = true; npc.boss = true; + npc.hide = true; music = /*CalamityMod.Instance.GetMusicFromMusicMod("AdultEidolonWyrm") ??*/ MusicID.Boss3; } @@ -527,6 +528,11 @@ namespace CalamityMod.NPCs.ExoMechs.Ares return false; } + public override void DrawBehind(int index) + { + Main.instance.DrawCacheNPCProjectiles.Add(index); + } + public override bool PreNPCLoot() => false; public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/ExoMechs/Ares/AresLaserCannon.cs b/NPCs/ExoMechs/Ares/AresLaserCannon.cs index 50869cd283..f2dc6179ba 100644 --- a/NPCs/ExoMechs/Ares/AresLaserCannon.cs +++ b/NPCs/ExoMechs/Ares/AresLaserCannon.cs @@ -81,6 +81,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares npc.DeathSound = SoundID.NPCDeath14; npc.netAlways = true; npc.boss = true; + npc.hide = true; music = /*CalamityMod.Instance.GetMusicFromMusicMod("AdultEidolonWyrm") ??*/ MusicID.Boss3; } @@ -583,6 +584,11 @@ namespace CalamityMod.NPCs.ExoMechs.Ares return false; } + public override void DrawBehind(int index) + { + Main.instance.DrawCacheNPCProjectiles.Add(index); + } + public override bool PreNPCLoot() => false; public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs index 1acc67759c..38819a20a8 100644 --- a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs +++ b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs @@ -81,6 +81,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares npc.DeathSound = SoundID.NPCDeath14; npc.netAlways = true; npc.boss = true; + npc.hide = true; music = /*CalamityMod.Instance.GetMusicFromMusicMod("AdultEidolonWyrm") ??*/ MusicID.Boss3; } @@ -511,6 +512,11 @@ namespace CalamityMod.NPCs.ExoMechs.Ares return false; } + public override void DrawBehind(int index) + { + Main.instance.DrawCacheNPCProjectiles.Add(index); + } + public override bool PreNPCLoot() => false; public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs index 1e4640db47..cb9b3fa316 100644 --- a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs +++ b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs @@ -81,6 +81,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares npc.DeathSound = SoundID.NPCDeath14; npc.netAlways = true; npc.boss = true; + npc.hide = true; music = /*CalamityMod.Instance.GetMusicFromMusicMod("AdultEidolonWyrm") ??*/ MusicID.Boss3; } @@ -508,7 +509,12 @@ namespace CalamityMod.NPCs.ExoMechs.Ares return false; } - + + public override void DrawBehind(int index) + { + Main.instance.DrawCacheNPCProjectiles.Add(index); + } + public override bool PreNPCLoot() => false; public override void HitEffect(int hitDirection, double damage) From d7d4ed41e85faf50f6a664bea1f963f33a17907f Mon Sep 17 00:00:00 2001 From: DominicKarma <51094361+DominicKarma@users.noreply.github.com> Date: Thu, 4 Nov 2021 13:14:19 -0500 Subject: [PATCH 3/3] Enraged red colors --- ExtraTextures/AresArmTopSegmentGlow.png | Bin 255 -> 328 bytes ExtraTextures/AresArmTopShoulderGlow.png | Bin 487 -> 539 bytes NPCs/ExoMechs/Ares/AresBody.cs | 32 ++++++++++++++--------- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/ExtraTextures/AresArmTopSegmentGlow.png b/ExtraTextures/AresArmTopSegmentGlow.png index 508e7a4db16c2a9235b142c62613e731d6efc06b..f39d4cfddb86876859bf86e0e372a4c5e8e02694 100644 GIT binary patch delta 272 zcmey*c!FtyW4%g%Plzi61A}MkuFJ1;EcJ>rKioNPXZP!W!T=PdAuEM{Qf+YiEw7OcT4K*6b=E{-7<{&%ljTJ4ZM=H_fot|`-EIuErxxAxo%o8ikISKQUy>U?$k_~@ Lu6{1-oD!MTn7|*STA17cvt`A(`=TP>kNW+ z6_|0^b-Z|}f9r*I$vwl6Oowe+k9fDQRe(3fy|p=t&(TPm$W(i7912fR-_My85}Sb4q9e0I)z%82|tP diff --git a/ExtraTextures/AresArmTopShoulderGlow.png b/ExtraTextures/AresArmTopShoulderGlow.png index b23f5bdbbb9fcaf841871c75f54eb5c23880573f..9cbb1968ba8fac4e6b3986631a7bd638126e62fe 100644 GIT binary patch delta 484 zcmaFPJey^LW4%FuPlzi614FxZ*r#opp9(xJ^@?um1&hk?Z;vJ6?XB zGcjS}vJaV2z7;^l_YY271Ed5>g8YL2qXLEp%CV9_InDx)$YKTtz5^i4n02j_lYxOT z!qdeuB*Xdb^@C;23IeSUyOipMd@BBLUu&L_Retn|(cF}OqC0*TS#&(q=3XKw+h&#F zC2z%(x7ttYQu{NWEpxASh?U8_e$xNarC4tJt!WY3QPXxjopGUin_T;>i`#gXmND6W ze`vRi^=M)MyZYs3yWK}-U3hLZW!AzgJWJCwOr2NSUdTK&b-mvS&qbG?*sl9{?reQ= z5;KmFIzR8u6SNAZbGeym%X$qo7Ya+aNy4MXY~ti_`L6yGZ(rrWe59y5viu{rDgmIegCXfRazgd zKUJvB_~);2++2~a{@eUkefQR9&z&&I<@@wwJ7Y^%_f(!-XgIC+@tp6r>%@vQ#3WMI zYfsVX;*XLK5_{`;YS9k0X@UJJ7xzheoejup3o=IX4piv3h{^N(n$OH?`qDQx1H+!d M)78&qol`;+07#wZvj6}9 delta 432 zcmbQu@|<~sW4%g%Plzi614FxZ*r#opp9(w|w@mu=zrZeXUEgBI%dc}LCQMxRArq(| zExt|~Nb!^e`33(+00yD^=gtAeISV`@iy0XB4uUY_j)~cC85kH%JY5_^GMwLDzsT3D zz|;DWb4AAe|F!8$PeyFwz9^fu{a<+f(b@Wne8-zbHg)hd^Z4F$Zdc4Xxk#~ELvZoi zHLhDW7@m5RU>3M&$JK2|!!B+*s(ZX8cFR|bEj`q8$#pg`qtB^WWY*#fT2t277&TpX4StmU=j#5L9G_o~0mU$~Y z`g46x`qm4xQcTh%6Ehc{{^WGLFxJ^&bJdD7)t3MDW=#T8pV^Y@&AvPQO#LN4C0<2k zb!%NxDnqIKm&=p$m$hH3w@vnW`8VNDUAcpE#I_VhZ~nQ()); int teslaArm = NPC.FindFirstNPC(ModContent.NPCType()); int plasmaArm = NPC.FindFirstNPC(ModContent.NPCType()); + Color afterimageBaseColor = EnragedState == (float)Enraged.Yes ? Color.Red : Color.White; + Color armGlowmaskColor = afterimageBaseColor; + armGlowmaskColor.A = 184; if (laserArm != -1) - DrawArm(spriteBatch, Main.npc[laserArm].Center, -1, true); + DrawArm(spriteBatch, Main.npc[laserArm].Center, armGlowmaskColor, -1, true); if (gaussArm != -1) - DrawArm(spriteBatch, Main.npc[gaussArm].Center, 1, true); + DrawArm(spriteBatch, Main.npc[gaussArm].Center, armGlowmaskColor, 1, true); if (teslaArm != -1) - DrawArm(spriteBatch, Main.npc[teslaArm].Center, -1, false); + DrawArm(spriteBatch, Main.npc[teslaArm].Center, armGlowmaskColor, -1, false); if (plasmaArm != -1) - DrawArm(spriteBatch, Main.npc[plasmaArm].Center, 1, false); + DrawArm(spriteBatch, Main.npc[plasmaArm].Center, armGlowmaskColor, 1, false); Texture2D texture = Main.npcTexture[npc.type]; Rectangle frame = new Rectangle(npc.width * frameX, npc.height * frameY, npc.width, npc.height); Vector2 vector = new Vector2(npc.width / 2, npc.height / 2); - Color afterimageBaseColor = EnragedState == (float)Enraged.Yes ? Color.Red : Color.White; int numAfterimages = 5; if (CalamityConfig.Instance.Afterimages) @@ -859,9 +861,12 @@ namespace CalamityMod.NPCs.ExoMechs.Ares internal Color ColorFunction(float completionRatio) { + Color baseColor1 = EnragedState == (float)Enraged.Yes ? Color.Red : Color.Cyan; + Color baseColor2 = EnragedState == (float)Enraged.Yes ? Color.IndianRed : Color.Cyan; + float fadeToWhite = MathHelper.Lerp(0f, 0.65f, (float)Math.Sin(MathHelper.TwoPi * completionRatio + Main.GlobalTime * 4f) * 0.5f + 0.5f); - Color baseColor = Color.Lerp(Color.Cyan, Color.White, fadeToWhite); - Color color = Color.Lerp(baseColor, Color.LightBlue, ((float)Math.Sin(MathHelper.Pi * completionRatio + Main.GlobalTime * 4f) * 0.5f + 0.5f) * 0.8f) * npc.Opacity; + Color baseColor = Color.Lerp(baseColor1, Color.White, fadeToWhite); + Color color = Color.Lerp(baseColor, baseColor2, ((float)Math.Sin(MathHelper.Pi * completionRatio + Main.GlobalTime * 4f) * 0.5f + 0.5f) * 0.8f) * npc.Opacity; color.A = 84; return color; } @@ -870,11 +875,12 @@ namespace CalamityMod.NPCs.ExoMechs.Ares public Color BackgroundColorFunction(float completionRatio) { - Color color = Color.CornflowerBlue * npc.Opacity * 0.4f; + Color backgroundColor = EnragedState == (float)Enraged.Yes ? Color.Crimson : Color.CornflowerBlue; + Color color = backgroundColor * npc.Opacity * 0.4f; return color; } - public void DrawArm(SpriteBatch spriteBatch, Vector2 handPosition, int direction, bool backArm) + public void DrawArm(SpriteBatch spriteBatch, Vector2 handPosition, Color glowmaskColor, int direction, bool backArm) { if (LightningDrawer is null) LightningDrawer = new PrimitiveTrail(WidthFunction, ColorFunction, PrimitiveTrail.RigidPointRetreivalFunction); @@ -917,7 +923,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Color arm1LightColor = npc.GetAlpha(Lighting.GetColor((int)arm1DrawPosition.X / 16, (int)arm1DrawPosition.Y / 16)); Color armSegmentLightColor = npc.GetAlpha(Lighting.GetColor((int)armSegmentDrawPosition.X / 16, (int)armSegmentDrawPosition.Y / 16)); Color arm2LightColor = npc.GetAlpha(Lighting.GetColor((int)arm2DrawPosition.X / 16, (int)arm2DrawPosition.Y / 16)); - Color glowmaskColor = npc.GetAlpha(Color.White); + Color glowmaskAlphaColor = npc.GetAlpha(glowmaskColor); // Draw electricity between arms. List arm2ElectricArcPoints = AresTeslaOrb.DetermineElectricArcPoints(armSegmentDrawPosition, arm2DrawPosition + arm2Rotation.ToRotationVector2() * -direction * 20f, 250290787); @@ -931,11 +937,11 @@ namespace CalamityMod.NPCs.ExoMechs.Ares spriteBatch.Draw(armTexture1, arm1DrawPosition, null, arm1LightColor, arm1Rotation, arm1Origin, npc.scale, spriteDirection ^ SpriteEffects.FlipHorizontally, 0f); spriteBatch.Draw(shoulderTexture, shoulderDrawPosition, null, shoulderLightColor, 0f, shoulderTexture.Size() * 0.5f, npc.scale, spriteDirection, 0f); - spriteBatch.Draw(shoulderGlowmask, shoulderDrawPosition, null, glowmaskColor, 0f, shoulderTexture.Size() * 0.5f, npc.scale, spriteDirection, 0f); + spriteBatch.Draw(shoulderGlowmask, shoulderDrawPosition, null, glowmaskAlphaColor, 0f, shoulderTexture.Size() * 0.5f, npc.scale, spriteDirection, 0f); spriteBatch.Draw(armSegmentTexture, armSegmentDrawPosition, null, armSegmentLightColor, armSegmentRotation, armSegmentTexture.Size() * 0.5f, npc.scale, spriteDirection, 0f); - spriteBatch.Draw(armSegmentGlowmask, armSegmentDrawPosition, null, glowmaskColor, armSegmentRotation, armSegmentTexture.Size() * 0.5f, npc.scale, spriteDirection, 0f); + spriteBatch.Draw(armSegmentGlowmask, armSegmentDrawPosition, null, glowmaskAlphaColor, armSegmentRotation, armSegmentTexture.Size() * 0.5f, npc.scale, spriteDirection, 0f); spriteBatch.Draw(armTexture2, arm2DrawPosition, null, arm2LightColor, arm2Rotation, arm2Origin, npc.scale, spriteDirection ^ SpriteEffects.FlipVertically, 0f); - spriteBatch.Draw(armGlowmask2, arm2DrawPosition, null, glowmaskColor, arm2Rotation, arm2Origin, npc.scale, spriteDirection ^ SpriteEffects.FlipVertically, 0f); + spriteBatch.Draw(armGlowmask2, arm2DrawPosition, null, glowmaskAlphaColor, arm2Rotation, arm2Origin, npc.scale, spriteDirection ^ SpriteEffects.FlipVertically, 0f); } public override void BossLoot(ref string name, ref int potionType)