From b0be2cba0e50f03365b496c2d508d4a2be9a2eb5 Mon Sep 17 00:00:00 2001 From: Restart2008 Date: Fri, 24 Oct 2025 22:13:44 -0700 Subject: [PATCH] NukeWars: allow ships/structures during prep; restrict Atom/Hydrogen bombs during preparation phase --- src/core/game/PlayerImpl.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/core/game/PlayerImpl.ts b/src/core/game/PlayerImpl.ts index 2a0c050e9..ac8ac5b97 100644 --- a/src/core/game/PlayerImpl.ts +++ b/src/core/game/PlayerImpl.ts @@ -975,6 +975,17 @@ export class PlayerImpl implements Player { return this.nukeSpawn(targetTile); case UnitType.AtomBomb: case UnitType.HydrogenBomb: + // In Nuke Wars, AtomBomb and HydrogenBomb cannot be launched during the + // preparation phase, but are allowed afterwards. Other build restrictions + // (like team spawn zones) are handled above. + if (gc.gameMode === GameMode.NukeWars && this.mg.inPreparationPhase()) { + this.mg.displayMessage( + "Nuclear weapons cannot be launched during the preparation phase", + MessageType.ATTACK_FAILED, + this.id(), + ); + return false; + } return this.nukeSpawn(targetTile); case UnitType.MIRVWarhead: return targetTile; @@ -1004,12 +1015,6 @@ export class PlayerImpl implements Player { } nukeSpawn(tile: TileRef): TileRef | false { - // During the Nuke Wars preparation phase nukes cannot be launched across - // to enemy territory. Block all nuke launches while in the preparation phase. - const gc = this.mg.config().gameConfig(); - if (gc.gameMode === GameMode.NukeWars && this.mg.inPreparationPhase()) { - return false; - } const owner = this.mg.owner(tile); if (owner.isPlayer()) { if (this.isOnSameTeam(owner)) {