Update hit wiring tests for per-volley damage

This commit is contained in:
Admin 2026-09-18 01:12:11 +00:00
parent 806fe2e878
commit cb139b839e

View File

@ -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/);
});