From effce3d14a015868e7d7547ba4ea380b7f5ab01f Mon Sep 17 00:00:00 2001 From: aConifer <69027186+aConifer@users.noreply.github.com> Date: Tue, 6 Jan 2026 15:22:57 -0700 Subject: [PATCH] add teammate pulse highlight during spawn phase in team games (#2768) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a pulsing highlight effect for teammates during the spawn phase in team games. This helps colorblind players identify their teammates on the map more easily. - Teammates show a subtle green/team-colored pulse (5-14px radius) - Player's own pulse remains unchanged (8-24px white pulse) - Only activates during spawn phase in team games - Animation stays synchronized with player's own pulse I didn't want to come empty handed with my request so I generated the code I do know python and a little rust, but don't have TypeScript experience - I know you guys are probably getting flooded with AI slop so I hope its okay. Please implement the feature at the very least because its SO much better not having to hunt around. 🤖 Generated with [Claude Code](https://claude.com/claude-code) So the code calls drawTeammateHighlights() inside of drawFocusedPlayerHighlight() so it can only occur where current highlighting occurs Then uses the existing isOnSameTeam() to find teammates Then uses the existing drawBreathingRing() function - [x] I have added screenshots for all UI updates I took a video since it best captures the feature - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory I'm not that good at coding formally, I tested it manually by loading into team games, but I'm going to need help with the code being tested. (Please help) - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced I did load into multiple lobbies and made sure the feature works, its a really simple feature so I am confident there isn't any Lovecraftian bug lurking in it. It also uses mostly existing functions and features within the code base. https://github.com/user-attachments/assets/857cce43-4fb2-4c5d-bc04-1a6617570dee Co-authored-by: Daniel Co-authored-by: Claude Opus 4.5 Co-authored-by: iamlewis --- src/client/graphics/layers/TerritoryLayer.ts | 56 ++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/src/client/graphics/layers/TerritoryLayer.ts b/src/client/graphics/layers/TerritoryLayer.ts index 2e6fa2113..08d3f5a9c 100644 --- a/src/client/graphics/layers/TerritoryLayer.ts +++ b/src/client/graphics/layers/TerritoryLayer.ts @@ -263,6 +263,62 @@ export class TerritoryLayer implements Layer { baseColor, // Always draw white static semi-transparent ring teamColor, // Pass the breathing ring color. White for FFA, Duos, Trios, Quads. Transparent team color for TEAM games. ); + + // Draw breathing rings for teammates in team games (helps colorblind players identify teammates) + this.drawTeammateHighlights(minRad, maxRad, radius); + } + + private drawTeammateHighlights( + minRad: number, + maxRad: number, + radius: number, + ) { + const myPlayer = this.game.myPlayer(); + if (myPlayer === null || myPlayer.team() === null) { + return; + } + + const teammates = this.game + .playerViews() + .filter((p) => p !== myPlayer && myPlayer.isOnSameTeam(p)); + + // Smaller radius for teammates (more subtle than self highlight) + const teammateMinRad = 5; + const teammateMaxRad = 14; + const teammateRadius = + teammateMinRad + + (teammateMaxRad - teammateMinRad) * + ((radius - minRad) / (maxRad - minRad)); + + const teamColors = Object.values(ColoredTeams); + for (const teammate of teammates) { + const center = teammate.nameLocation(); + if (!center) { + continue; + } + + const team = teammate.team(); + let baseColor: Colord; + let breathingColor: Colord; + + if (team !== null && teamColors.includes(team)) { + baseColor = this.theme.teamColor(team).alpha(0.5); + breathingColor = this.theme.teamColor(team).alpha(0.5); + } else { + baseColor = this.theme.spawnHighlightTeamColor(); + breathingColor = this.theme.spawnHighlightTeamColor(); + } + + this.drawBreathingRing( + center.x, + center.y, + teammateMinRad, + teammateMaxRad, + teammateRadius, + baseColor, + breathingColor, + ); + } } init() {