Skip to content

Commit 4c60d4c

Browse files
committed
Add landed ship indicator, ordnance counter, and timer for all phases
- Landed ships show green dashed circle and 'L' tag - Fleet status now shows active ordnance count (e.g. "2M/1T" for mines/torpedoes) - Turn timer starts for ordnance and combat phases too (not just astrogation)
1 parent cbea32d commit 4c60d4c

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

src/client/main.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ class GameClient {
217217
break;
218218

219219
case 'playing_ordnance':
220+
this.startTurnTimer();
220221
this.ui.showHUD();
221222
this.updateHUD();
222223
this.renderer.planningState.selectedShipId = null;
@@ -233,6 +234,7 @@ class GameClient {
233234
break;
234235

235236
case 'playing_combat':
237+
this.startTurnTimer();
236238
this.ui.showHUD();
237239
this.updateHUD();
238240
this.renderer.planningState.combatTargetId = null;
@@ -970,11 +972,23 @@ class GameClient {
970972
const enemyShips = this.gameState.ships.filter(s => s.owner !== this.playerId);
971973
const myAlive = myShips.filter(s => !s.destroyed).length;
972974
const enemyAlive = enemyShips.filter(s => !s.destroyed).length;
975+
let statusParts: string[] = [];
973976
if (myShips.length > 1 || enemyShips.length > 1) {
974-
fleetEl.textContent = `⚔ ${myAlive}v${enemyAlive}`;
975-
} else {
976-
fleetEl.textContent = '';
977+
statusParts.push(`⚔ ${myAlive}v${enemyAlive}`);
978+
}
979+
// Show active ordnance count
980+
const activeOrd = this.gameState.ordnance.filter(o => !o.destroyed);
981+
if (activeOrd.length > 0) {
982+
const mines = activeOrd.filter(o => o.type === 'mine').length;
983+
const torps = activeOrd.filter(o => o.type === 'torpedo').length;
984+
const nukes = activeOrd.filter(o => o.type === 'nuke').length;
985+
const ordParts: string[] = [];
986+
if (mines > 0) ordParts.push(`${mines}M`);
987+
if (torps > 0) ordParts.push(`${torps}T`);
988+
if (nukes > 0) ordParts.push(`${nukes}N`);
989+
statusParts.push(ordParts.join('/'));
977990
}
991+
fleetEl.textContent = statusParts.join(' ');
978992
this.ui.updateShipList(
979993
myShips,
980994
selectedId,

src/client/renderer.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,17 @@ export class Renderer {
10491049
ctx.fillText(`D${ship.damage.disabledTurns}`, pos.x, pos.y - 12);
10501050
}
10511051

1052+
// Landed indicator
1053+
if (ship.landed && !this.animState) {
1054+
ctx.strokeStyle = 'rgba(100, 200, 100, 0.5)';
1055+
ctx.lineWidth = 1;
1056+
ctx.setLineDash([2, 2]);
1057+
ctx.beginPath();
1058+
ctx.arc(pos.x, pos.y, 12, 0, Math.PI * 2);
1059+
ctx.stroke();
1060+
ctx.setLineDash([]);
1061+
}
1062+
10521063
// Ship label and fuel (only when not animating)
10531064
if (!this.animState) {
10541065
const stats = SHIP_STATS[ship.type];
@@ -1059,7 +1070,8 @@ export class Renderer {
10591070
ctx.fillStyle = 'rgba(255, 255, 255, 0.5)';
10601071
ctx.font = '8px monospace';
10611072
ctx.textAlign = 'center';
1062-
ctx.fillText(`${label} F:${ship.fuel}`, pos.x, pos.y + 18);
1073+
const landedTag = ship.landed ? ' L' : '';
1074+
ctx.fillText(`${label} F:${ship.fuel}${landedTag}`, pos.x, pos.y + 18);
10631075
} else if (ship.detected) {
10641076
// Show type letter for detected enemy ships
10651077
ctx.fillStyle = 'rgba(255, 255, 255, 0.4)';

0 commit comments

Comments
 (0)