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 0000000000..c0105e82e4 Binary files /dev/null and b/ExtraTextures/VanillaBossGlowmasks/ProbeGlow.png differ 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) {