From ef6e8be2be9cd99d6b6198595cb9e90a4a4fb38e Mon Sep 17 00:00:00 2001 From: FloPinguin <25036848+FloPinguin@users.noreply.github.com> Date: Wed, 15 Jul 2026 21:16:08 +0200 Subject: [PATCH] =?UTF-8?q?Allow=20mobile=20players=20to=20take=20part=20i?= =?UTF-8?q?n=20the=20aftergame=20=F0=9F=99=82=20(#4615)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description: In team games, after the game is over, players should be able to nuke their teammates (the core simulation already allows this via `nukeSpawn()`). On desktop this works because players can use keyboard shortcuts to select nukes directly. However, on mobile, the radial menu unconditionally replaces the attack submenu with "donate gold" when targeting a friendly player, making it impossible to access nukes targeting teammates in the aftergame. The fix checks whether any buildable attack units (AtomBomb, HydrogenBomb, MIRV) are actually available for the target tile. Since `nukeSpawn()` only returns a valid silo for teammate tiles after game over, this naturally detects the aftergame state and shows the attack submenu. During normal gameplay, `nukeSpawn()` blocks teammate nukes so `hasBuildableAttacks` stays false and donate gold is shown as before. ## Please complete the following: - [X] I have added screenshots for all UI updates - [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 ## Please put your Discord username so you can be contacted if a bug or regression is found: FloPinguin --- src/client/hud/layers/RadialMenuElements.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/client/hud/layers/RadialMenuElements.ts b/src/client/hud/layers/RadialMenuElements.ts index 1d10654b4..f376c4681 100644 --- a/src/client/hud/layers/RadialMenuElements.ts +++ b/src/client/hud/layers/RadialMenuElements.ts @@ -667,6 +667,16 @@ export const rootMenuElement: MenuElement = { const inExtensionWindow = params.playerActions.interaction?.allianceInfo?.inExtensionWindow; + // After game-over, nukes can target teammates (nukeSpawn allows it). + // Show the attack submenu so mobile users can access nukes in the aftergame. + const hasBuildableAttacks = + params.playerActions.buildableUnits?.some( + (bu) => BuildableAttacks.has(bu.type) && bu.canBuild !== false, + ) ?? false; + + const showDonateInsteadOfAttack = + isFriendlyTarget(params) && !isDisconnected && !hasBuildableAttacks; + const menuItems: (MenuElement | null)[] = [ infoMenuElement, ...(isOwnTerritory @@ -674,7 +684,7 @@ export const rootMenuElement: MenuElement = { : [ isAllied && !isDisconnected ? allyBreakElement : boatMenuElement, inExtensionWindow ? allyExtendElement : allyRequestElement, - isFriendlyTarget(params) && !isDisconnected + showDonateInsteadOfAttack ? donateGoldRadialElement : attackMenuElement, ]),