Fewer, smaller messages: mold percentages, markers for machine heat, short status lines
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+19
-2
@@ -25,6 +25,7 @@ with sync_playwright() as p:
|
||||
pg.wait_for_function('GAME.running === true', timeout=20000)
|
||||
pg.wait_for_timeout(500)
|
||||
ev = pg.evaluate
|
||||
ev("window._maxStatus = ''; const _ss = setStatus; setStatus = function (s, k) { if (s && s.length > _maxStatus.length) _maxStatus = s; return _ss(s, k); }; 0")
|
||||
look = sys.argv[2] if len(sys.argv) > 2 else 'pixel'
|
||||
check('a new game starts fully zoomed in', ev('SET.zoom') == 12, ev('SET.zoom'))
|
||||
# Ctrl+W closes the tab; with a world open the browser must ask first
|
||||
@@ -286,6 +287,8 @@ with sync_playwright() as p:
|
||||
check('mold placed by click', ev('molds.length') == 1, ev('GAME.status'))
|
||||
ev('for (const cav of molds[0].cavs) for (const i of cav) setCell(i, MCU, 1160, 0)')
|
||||
pg.wait_for_function("ents.filter(e => e.m === BARCU).length === 3", timeout=30000)
|
||||
check('mold label shows a percentage', ev(r'/^\d+%/.test(moldLabel(molds[0]))'))
|
||||
check('bar drops make no toast', ev("![...$('toasts').children].some(e => /dropped/i.test(e.textContent))"))
|
||||
check('bars set and drop on their own', ev("ents.length === 3 && molds[0].state === 'short' && molds[0].ready.length === 0"), ev('[molds[0].state, ents.length]'))
|
||||
pg.screenshot(path=str(out / '05-mold-ready.png'))
|
||||
check('three bars drop below the mold without F', ev('ents.every(e => e.m === BARCU && e.iy >= molds[0].y + molds[0].h)'), ev('ents.map(e => [e.ix, e.iy])'))
|
||||
@@ -297,6 +300,19 @@ with sync_playwright() as p:
|
||||
hold(*cell_to_screen(*e0), 900)
|
||||
check('vacuum picks up bars', ev('bag[BARCU]') >= 1, ev('bag[BARCU]'))
|
||||
|
||||
check('casting events stay quiet and damage labels are red', ev("""(() => {
|
||||
const oldToast = toast, oldCard = showCard, oldSfx = playSfx, events = EV.splice(0), floaters = R.floaters;
|
||||
let popups = 0, casts = 0;
|
||||
toast = showCard = () => popups++; playSfx = s => { if (s === 'cast') casts++; };
|
||||
R.floaters = [];
|
||||
try {
|
||||
emit({ t: 'ingot_drop', bars: 1, metal: COPPER, first: true });
|
||||
emit({ t: 'ingot_blocked' }); emit({ t: 'cast_ready', kind: 'bit', metal: COPPER });
|
||||
emit({ t: 'warn', x: 12, y: 34, text: 'melted' }); drainEvents();
|
||||
return popups === 0 && casts === 1 && R.floaters.length === 1 && R.floaters[0].colour === '#ff8a72' && R.floaters[0].text === 'melted';
|
||||
} finally { toast = oldToast; showCard = oldCard; playSfx = oldSfx; R.floaters = floaters; EV.push(...events); }
|
||||
})()"""))
|
||||
|
||||
# 7. belt line by dragging, copied with a blueprint and pasted
|
||||
refill('bag[BARCU] = 60'); ev('money = 1000')
|
||||
ok = select('3', "piece().id === 'belt'")
|
||||
@@ -344,7 +360,7 @@ with sync_playwright() as p:
|
||||
ok = select('3', "piece().id === 'fan'")
|
||||
pg.mouse.move(*blk(bbx - 4, bby + 1)); settle(400)
|
||||
pg.mouse.down(); pg.mouse.up(); settle(100)
|
||||
check('a fan on a belt says to hold G', 'Hold G' in ev('GAME.status'), ev('GAME.status'))
|
||||
check('a fan on a belt says to hold G', 'hold G' in ev('GAME.status'), ev('GAME.status'))
|
||||
pg.keyboard.down('g'); settle(100); pg.mouse.move(*blk(bbx - 4, bby + 1)); settle(200)
|
||||
check('holding G shows replace mode', 'Replace · G' in ev("$('selcard').textContent"))
|
||||
pg.screenshot(path=str(out / '07g-replace-fan.png'))
|
||||
@@ -384,7 +400,7 @@ with sync_playwright() as p:
|
||||
# two belts at the end of the line: plain dragging leaves them, G-dragging swaps them for filters
|
||||
ev(f"placeBlock(BP_BELT, 1, {bbx-2}, {fy}, true); placeBlock(BP_BELT, 1, {bbx-1}, {fy}, true);")
|
||||
drag(lambda: blk(bbx - 2, fy), lambda: blk(bbx - 1, fy))
|
||||
check('dragging over built belts leaves them and says how to replace', ev(f'blockP[{fy}*BW+{bbx-2}] === BP_BELT') and 'Hold G' in ev('GAME.status'), ev('GAME.status'))
|
||||
check('dragging over built belts leaves them and says how to replace', ev(f'blockP[{fy}*BW+{bbx-2}] === BP_BELT') and 'hold G' in ev('GAME.status'), ev('GAME.status'))
|
||||
pg.keyboard.down('g'); settle(50)
|
||||
pg.mouse.move(*blk(bbx - 2, fy)); settle(300)
|
||||
pg.screenshot(path=str(out / '07c-replace-preview.png'))
|
||||
@@ -527,6 +543,7 @@ with sync_playwright() as p:
|
||||
pg2.screenshot(path=str(out / '11-deep-magma.png'))
|
||||
pg2.close()
|
||||
print('\n'.join(logs) or 'no console errors')
|
||||
check('every status line is short (≤ 90 characters)', len(ev('_maxStatus')) <= 90, ev('_maxStatus'))
|
||||
print('FAILS:', fails)
|
||||
b.close()
|
||||
sys.exit(1 if fails else 0)
|
||||
|
||||
Reference in New Issue
Block a user