Liquids in the bag can be blown out without the Flask (t103)
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
// t103: carried liquids can always leave the bag; collecting them still needs the Flask.
|
||||
const { load, suite, flatWorld, count } = require('./harness');
|
||||
const { run } = load();
|
||||
const { check, done } = suite();
|
||||
|
||||
for (const flask of [false, true]) {
|
||||
flatWorld(run, 240, 160, 110);
|
||||
run(`enableDevConsole(); player.flask = ${flask}; devCommand('give water 500');`);
|
||||
check(`give water keeps Flask=${flask}`, run(`bag[WATER] === 500 && player.flask === ${flask}`));
|
||||
const blown = run('toolBlow(135, 100, 6, WATER).placed');
|
||||
check(`water leaves the bag with Flask=${flask}`, blown > 0 && run(`bag[WATER] === 500 - ${blown} && bagTotal === bag[WATER] && flyers.length === ${blown}`));
|
||||
run('for (let k = 0; k < 240; k++) flyTick();');
|
||||
check(`blown water lands with Flask=${flask}`, blown > 0 && count(run, run('WATER')) === blown && run('flyers.length === 0'), blown);
|
||||
|
||||
run("devCommand('give sand 500'); blowRR = 0;");
|
||||
const mixed = run('toolBlow(135, 100, 6, SAND, [SAND, WATER]).placed');
|
||||
check(`mixed blow includes water with Flask=${flask}`, mixed > 1 && run('flyers.some(f => f.m === WATER) && flyers.some(f => f.m === SAND)'));
|
||||
const before = run('bag[WATER]');
|
||||
run('toolVacuum(135, 100, 20, m => m === WATER);');
|
||||
check(`liquid pickup ${flask ? 'works with' : 'still needs'} the Flask`, run('bag[WATER]') >= before && (flask ? run('bag[WATER]') > before : run('bag[WATER]') === before));
|
||||
}
|
||||
|
||||
flatWorld(run, 240, 160, 110);
|
||||
run('player.flask = false; setCell(100 * W + 125, WATER, 20, 0);');
|
||||
check('water on the ground cannot be targeted or collected without the Flask', run('vacuumTargetAt(125, 100, 1) === 0 && toolVacuum(125, 100, 1, () => true).got === 0 && mat[100 * W + 125] === WATER'));
|
||||
run('flyers.push({x:125, y:100, m:WATER});');
|
||||
check('flying water cannot be targeted or collected without the Flask', run('vacuumTargetAt(125, 100, 1) === 0 && toolVacuum(125, 100, 1, () => true).got === 0 && flyers.length === 1'));
|
||||
|
||||
// Molten liquids use the same blow path, retaining their pouring temperature.
|
||||
run('flyers.length = 0; enableDevConsole();');
|
||||
for (const m of run('Array.from({length: NMAT}, (_, m) => m).filter(m => PH[m] === PH_LIQUID)')) {
|
||||
run(`devCommand('give ' + MD[${m}].name + ' 2');`);
|
||||
check(`carried ${run(`MD[${m}].name`)} blows without the Flask`, run(`toolBlow(135, 100, 0, ${m}).placed === 1 && flyers[flyers.length - 1].T === bagTemp(${m})`));
|
||||
}
|
||||
done();
|
||||
Reference in New Issue
Block a user