From 806fe2e8786f50d76ba095853df174225982e74b Mon Sep 17 00:00:00 2001 From: Admin Date: Fri, 18 Sep 2026 01:11:16 +0000 Subject: [PATCH] Test per-volley player damage wiring --- tests/wiring.test.mjs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/wiring.test.mjs b/tests/wiring.test.mjs index 7ff373f..81bbd30 100644 --- a/tests/wiring.test.mjs +++ b/tests/wiring.test.mjs @@ -99,3 +99,13 @@ test('player hit FX runs after queued hit processing, outside the overlap callba assert.match(source, /this\.flashShip\(this\.player, 0xffcccc\)/); assert.match(source, /combat:player-hit-fx-error/); }); + +test('pirate broadsides assign a volley id and player damage deduplicates by volley', async () => { + const source = await read('src/game-v4.js'); + + assert.match(source, /const volleyId = actor === 'pirate' \? this\.nextPirateVolleyId\+\+ : null/); + assert.match(source, /shot\.setData\('volleyId', volleyId\)/); + assert.match(source, /volleyId: shot\.getData\('volleyId'\)/); + assert.match(source, /seenVolleyIds: this\.damagedPlayerVolleys/); + assert.match(source, /this\.damagedPlayerVolleys = result\.seenVolleyIds/); +});