From cae39de9d4a1bf3ffd8f2fa1c317cf1bfcf5688b Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Sat, 29 Jun 2024 16:27:48 -0500 Subject: [PATCH] Probe laser 1 second telegraph. --- CalamityMod.cs | 6 ++++++ .../VanillaBossGlowmasks/ProbeGlow.png | Bin 0 -> 594 bytes NPCs/CalamityGlobalNPC.cs | 19 ++++++++++++++++++ .../Bosses/DestroyerAI.cs | 12 ++++++++--- 4 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 ExtraTextures/VanillaBossGlowmasks/ProbeGlow.png diff --git a/CalamityMod.cs b/CalamityMod.cs index 6c24cae73b..a2417977f0 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -108,6 +108,9 @@ namespace CalamityMod // Destroyer glowmasks public static Asset[] DestroyerGlowmasks = new Asset[3]; + // Probe glowmask + public static Asset ProbeGlowmask; + // Wall of Flesh glowmasks public static Asset WallOfFleshEyeGlowmask; public static Asset WallOfFleshDemonSickleTexture; @@ -286,6 +289,9 @@ namespace CalamityMod DestroyerGlowmasks[1] = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerBodyGlow", AssetRequestMode.AsyncLoad); DestroyerGlowmasks[2] = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerTailGlow", AssetRequestMode.AsyncLoad); + // Probe glowmask + ProbeGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/ProbeGlow", AssetRequestMode.AsyncLoad); + // Wall of Flesh glowmasks WallOfFleshEyeGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/WallOfFleshEyeTelegraphGlow", AssetRequestMode.AsyncLoad); WallOfFleshDemonSickleTexture = ModContent.Request("CalamityMod/Projectiles/Melee/ForbiddenOathbladeProjectile", AssetRequestMode.AsyncLoad); diff --git a/ExtraTextures/VanillaBossGlowmasks/ProbeGlow.png b/ExtraTextures/VanillaBossGlowmasks/ProbeGlow.png new file mode 100644 index 0000000000000000000000000000000000000000..c0105e82e40e9adc2281a85bb8f551ee318245fd GIT binary patch literal 594 zcmV-Y0kdg0003bX+uL$Nkc;* zaB^>EX>4Tx04R~2kUdMoP!xurR;eH8mH#jRe``+l_U=}YN-iO0E?|bisx)Yf=pFe~+DKfWr$-KHXMtIX>vWgw5Syllc9u{>=a_J63usp_K< zyg$OK4{Oh`d|i>X`1@@YGp%ywpKtsESeSad^gZEa<4bO1wg zWnpw>WFU8GbZ8()Nlj2!fese{004AJL_t(Y$L-U>4TC@oMA5fs8=!;G1ybsu%GAL% zEhG{JYzdnKP(T1-4$R%2Z;#Ebi>R$_-CEo1HBU1E9o{K`Ag}H{K9!QrCV&A`R0tIQ+TbH7(!4IDv!_|z}NqucnHC*E9eKZnG+mpC@#GK000hUSV?A0 gO#mtY000O800000007cclK=n!07*qoM6N<$g4Ejd$^ZZW literal 0 HcmV?d00001 diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index a5776e577f..57ce6ea4ca 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -7328,6 +7328,25 @@ namespace CalamityMod.NPCs } } + // Laser telegraph + else if (npc.type == NPCID.Probe) + { + float eyeTelegraphGateValue = (NPC.IsMechQueenUp ? DestroyerAI.ProbeLaserGateValue_Mechdusa : BossRushEvent.BossRushActive ? DestroyerAI.ProbeLaserGateValue_BossRush : revenge ? DestroyerAI.ProbeLaserGateValue_Rev : DestroyerAI.ProbeLaserGateValue) - DestroyerAI.ProbeLaserTelegraphTime; + Texture2D glowTexture = CalamityConfig.Instance.NewVanillaTextures ? CalamityMod.ProbeGlowmask.Value : TextureAssets.Npc[npc.type].Value; + Vector2 halfSize = npc.frame.Size() / 2; + SpriteEffects spriteEffects = SpriteEffects.None; + if (npc.spriteDirection == 1) + spriteEffects = SpriteEffects.FlipHorizontally; + + float colorScale = MathHelper.Clamp((npc.localAI[0] - eyeTelegraphGateValue) / DestroyerAI.ProbeLaserTelegraphTime, 0f, 1f); + Color drawColor2 = Color.Lerp(new Color(150, 0, 0, 192), new Color(255, 100, 150, 192), colorScale); + for (int i = 0; i < 2; i++) + { + spriteBatch.Draw(glowTexture, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, + drawColor2, npc.rotation, halfSize, npc.scale, spriteEffects, 0f); + } + } + if (revenge) { // Create additional afterimages in the cardinal directions in Rev+ diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs index a0a767fa02..5024fe6d2c 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs @@ -29,6 +29,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public const float FlightTelegraphStartGateValue = FlightPhaseGateValue - PhaseTransitionTelegraphTime; private const int OneInXChanceToFireLaser = 200; + public const float ProbeLaserGateValue_Mechdusa = 360f; + public const float ProbeLaserGateValue_Rev = 240f; + public const float ProbeLaserGateValue_BossRush = 150f; + public const float ProbeLaserGateValue = 120f; + public const float ProbeLaserTelegraphTime = 60f; + public static bool BuffedDestroyerAI(NPC npc, Mod mod) { int mechdusaCurvedSpineSegmentIndex = 0; @@ -1894,7 +1900,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.justHit && !masterMode) npc.localAI[0] = 0f; - float laserGateValue = NPC.IsMechQueenUp ? 360f : bossRush ? 150f : 240f; + float laserGateValue = NPC.IsMechQueenUp ? ProbeLaserGateValue_Mechdusa : bossRush ? ProbeLaserGateValue_BossRush : ProbeLaserGateValue_Rev; if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= laserGateValue) { npc.localAI[0] = 0f; @@ -2150,9 +2156,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.justHit && !Main.masterMode) npc.localAI[0] = 0f; - float num10 = 120f; + float num10 = ProbeLaserGateValue; if (NPC.IsMechQueenUp) - num10 = 360f; + num10 = ProbeLaserGateValue_Mechdusa; if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= num10) {