aorecomp

Anarchy Online classic in the browser

git clone https://aorecomp.ubeagle.com/code/aorecomp.git


commit e1d7d8a94a2bce534ae4a32c982e1f67b1624103
parent b3588fe488415556b21d2f34289045e9f6b8affe
Author: anon <anon@example.com>
Date:   Mon,  9 Nov 2026 00:29:33 +0000

Repair cushion browser damage and shop interaction checks

Diffstat:
Mserver/browser_concrete_cushion_test.go | 2++
Mtools/client/test_concrete_cushion.mjs | 15+++++++--------
2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/server/browser_concrete_cushion_test.go b/server/browser_concrete_cushion_test.go @@ -80,6 +80,8 @@ func TestBrowserConcreteCushionQualities(t *testing.T) { return 0 } } + // Keep recovery outside the focused single-hit assertion. + target.regenerationAt = time.Now().Add(5 * time.Minute) targetID := target.id shutdown := startTestService(t, world) mux := http.NewServeMux() diff --git a/tools/client/test_concrete_cushion.mjs b/tools/client/test_concrete_cushion.mjs @@ -5,7 +5,7 @@ import {GameTest} from './game_test.mjs'; const {chromium} = createRequire(import.meta.url)('playwright'); const [url, output] = process.argv.slice(2); -const browser = await chromium.launch({executablePath: '/usr/bin/chromium', headless: false, +const browser = await chromium.launch({executablePath: '/usr/bin/chromium', args: ['--enable-gpu', '--use-gl=angle', '--use-angle=gl', '--no-sandbox', '--disable-dev-shm-usage', '--disable-background-timer-throttling', '--disable-renderer-backgrounding']}); const games = [], evidence = {}; @@ -29,6 +29,7 @@ try { const state = async () => (await owner.page.request.get(url + '/test-state')).json(); evidence.initial = await state(); if (evidence.initial.inventory.Items.length === 4) { + assert.equal(evidence.initial.health, 20); assert.equal(owner.local().stats[4], 1); assert.equal(owner.local().stats[102], 238); assert.equal(owner.local().stats[110], 142); @@ -107,9 +108,9 @@ try { assert.equal(Buffer.from(result.hex, 'hex').readUInt32BE(33), 0xffffffff); await owner.key('KeyQ'); await Promise.all(games.map(game => game.wait('native selected-quality impact', snapshot => - snapshot.actors.some(actor => actor.id === rejected.target && actor.stats[27] === 99)))); + snapshot.actors.some(actor => actor.id === rejected.target && actor.stats[27] === 19)))); evidence.hit = await state(); - assert.equal(evidence.hit.health, 99); + assert.equal(evidence.hit.health, 19); assert.equal(evidence.hit.fighting, 0); assert.equal(evidence.hit.inventory.Items[2].Ammo, 0); await owner.save(output + '/hit'); @@ -119,11 +120,9 @@ try { await owner.wait('weapon panel closed', snapshot => !snapshot.regions.some(([left, top, right, bottom]) => left === 832 && top === 0 && right === 1024 && bottom === 360)); if (!owner.state.camera.firstPerson) await owner.key('F8'); - // Combat follows the Leet's facing; turn back before picking the shop. - await owner.hold('KeyD', 'training machine in view', snapshot => { - const machine = snapshot.actors.find(actor => actor.type === 51035 && actor.id === 3221226422); - return machine?.screenPosition && machine.screenPosition[0] > 300 && machine.screenPosition[0] < 600; - }); + // Approach facing the machine with its mesh above the chat window. + await owner.walk(60, 57); + await owner.walk(60, 54.5); const offered = await state(); for (let attempt = 0; attempt < 2; ++attempt) { await owner.click(...await owner.pick(51035, 3221226422), 'right');