Liquids in the bag can be blown out without the Flask (t103)

This commit is contained in:
2026-10-29 23:33:52 -04:00
parent ac5f5a06d1
commit af411d5b21
9 changed files with 107 additions and 7 deletions
+45 -1
View File
@@ -101,6 +101,50 @@ with launch() as (browser, page, url):
page.wait_for_function(f'tick === {tick + 5} && devSteps === 0')
page.wait_for_timeout(150)
check('step advances exactly five ticks then stays paused', page.evaluate('tick') == tick + 5)
# t103: real bag selection and mouse input, with deterministic dev stepping into a pit.
page.evaluate('''() => {
player.flask = false; bag.fill(0); bagTotal = 0; flyers.length = 0;
for (let y = 20; y <= 150; y++) for (let x = 60; x <= 190; x++) {
const i = y * W + x;
part[i] = mach[i] = bgm[i] = 0;
setCell(i, y >= 145 || x === 60 || x === 190 ? STONE : EMPTY, 20, 0);
}
bot.x = 100; bot.y = 100; bot.vx = bot.vy = 0;
SET.fog = false; SET.lighting = 'off'; SET.cameraLead = false; SET.zoom = 4;
SET.cardSeconds = 0; $('cards').replaceChildren();
resizeRender(); snapCamera(); selectTool(1); GAME.blow.clear();
lastBagKey = ''; hudDirty = true;
}''')
command('give water 500')
page.keyboard.press('Escape')
page.locator('#baglist .pick[title="Select Water"]').click()
check('console water is visible and selectable without the Flask', page.evaluate('!player.flask && bag[WATER] === 500 && GAME.blow.has(WATER)'))
point = page.evaluate('worldToScreenPx(130, 135)')
scale = page.evaluate('R.canvas.width / window.innerWidth')
page.mouse.move(point['x'] / scale, point['y'] / scale)
page.mouse.down(button='right')
page.evaluate('runDevCommand("step 4")')
page.wait_for_function('devSteps === 0')
page.mouse.up(button='right')
check('right click blows water without the Flask', page.evaluate('!player.flask && bag[WATER] < 500 && flyers.some(f => f.m === WATER)'))
page.evaluate('runDevCommand("step 240")')
page.wait_for_function('devSteps === 0')
check('water lands in the pit and leaves the bag count reduced', page.evaluate('''() => {
let landed = 0;
for (let y = 20; y < 145; y++) for (let x = 61; x < 190; x++) if (mat[y * W + x] === WATER) landed++;
return !player.flask && !flyers.length && landed > 0 && landed + bag[WATER] === 500;
}'''))
page.evaluate('runDevCommand("give sand 100"); hudDirty = true;')
page.keyboard.down('Shift')
page.wait_for_function("$('selcard').textContent.includes('Everything')")
check('Shift preview includes carried water without the Flask', page.evaluate("blowAllList().includes(WATER) && [...$('baglist').querySelectorAll('.bagrow.on .nm')].some(e => e.textContent === 'Water')"))
page.screenshot(path=str(SHOTS / 't103-water-pit.png'))
water = page.evaluate('bag[WATER]')
page.mouse.down(button='right')
page.evaluate('runDevCommand("step 4")')
page.wait_for_function('devSteps === 0')
page.mouse.up(button='right'); page.keyboard.up('Shift')
check('Shift right click blows both water and sand without the Flask', page.evaluate(f'!player.flask && bag[WATER] < {water} && bag[SAND] < 100'))
# Drive the actual frame accumulator with controlled elapsed time and no scheduled frames.
counts = page.evaluate('''() => {
requestAnimationFrame = () => 0;
@@ -133,7 +177,7 @@ with launch() as (browser, page, url):
}'''))
page.reload()
page.wait_for_function("!$('title').hidden")
check('history is restored on a fresh page', page.evaluate("devInputHistory.items.slice(-1)[0] === 'step 5' && devRecall(devInputHistory, -1) === 'step 5'"))
check('history is restored on a fresh page', page.evaluate("devInputHistory.items.slice(-1)[0] === 'give water 500' && devRecall(devInputHistory, -1) === 'give water 500'"))
check('no browser errors', not errors)
browser.close()