From cb139b839e5b391f57635a20d9a5b330b58f82e2 Mon Sep 17 00:00:00 2001 From: Admin Date: Fri, 18 Sep 2026 01:12:11 +0000 Subject: [PATCH] Update hit wiring tests for per-volley damage --- tests/wiring.test.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/wiring.test.mjs b/tests/wiring.test.mjs index 81bbd30..109675d 100644 --- a/tests/wiring.test.mjs +++ b/tests/wiring.test.mjs @@ -43,7 +43,7 @@ test('player collision callback queues hits and processing occurs in scene updat assert.match(source, /this\.pendingPlayerHits\.push\(\{[\s\S]*?shot,[\s\S]*?damage,[\s\S]*?x: shot\.x,[\s\S]*?y: shot\.y/); assert.match(source, /this\.processPlayerHits\(\)/); - assert.match(source, /processQueuedPlayerHits\(\{/); + assert.match(source, /reducePlayerVolleyHits\(\{/); assert.match(source, /combat:player-hit-queued/); assert.match(source, /combat:player-hit-processed/); }); @@ -74,7 +74,7 @@ test('non-lethal player hit processing does not mutate the player object or game const block = match[1]; assert.match(block, /this\.playerHull = result\.hull/); - assert.match(block, /if \(result\.gameOver\) this\.finishGame\(\)/); + assert.match(block, /if \(gameOver\) this\.finishGame\(\)/); assert.doesNotMatch(block, /this\.player\.setVelocity\(/); assert.doesNotMatch(block, /this\.player\.setVisible\(/); @@ -95,7 +95,7 @@ test('player hit FX runs after queued hit processing, outside the overlap callba const source = await read('src/game-v4.js'); assert.match(source, /this\.pendingPlayerHits\.push\(\{[\s\S]*?x: shot\.x,[\s\S]*?y: shot\.y/); - assert.match(source, /if \(result\.appliedHits > 0\) \{[\s\S]*?this\.spawnExplosion\(impact\.x, impact\.y, 0\.32\)/); + assert.match(source, /if \(acceptedHits\.length > 0\) \{[\s\S]*?this\.spawnExplosion\(impact\.x, impact\.y, 0\.32\)/); assert.match(source, /this\.flashShip\(this\.player, 0xffcccc\)/); assert.match(source, /combat:player-hit-fx-error/); });