diff --git a/src/game/60-features/96-architect.js b/src/game/60-features/96-architect.js index 1fb2f5a..61e2bc1 100644 --- a/src/game/60-features/96-architect.js +++ b/src/game/60-features/96-architect.js @@ -125,7 +125,7 @@ function arApply(i){const A=S.ar,P=S.pz,b=arRun().briefs[i];A.bi=i; arDemand();A.start=arSnapStr();UI.pzHist=[];UI.sel=null;UI.arFail=null; compute();pzCam();renderAll(); toast(`${tr('architect.brief_n_of_m',{n:i+1,m:arRun().briefs.length})}
${esc(b.t)}`,'goal');sfx('click');} -function arNext(){if(!arOn())return;const e=arEval();if(!e.passed)return;if(arLast()){arResults(true);return;}S.ar.over+=e.tubes.over;arApply(S.ar.bi+1);} +function arNext(){if(!arOn())return;const e=arEval();if(!e.passed)return;mkStop();if(arLast()){arResults(true);return;}S.ar.over+=e.tubes.over;arApply(S.ar.bi+1);} function arReset(){const o=JSON.parse(S.ar.start);S.pops=o.p;S.links=o.l;S.pairMet=o.m||{};S.ar.sunk=o.k||0;arDemand();UI.sel=null;} // Tubes over plan in the run so far, this brief included. const arOver=()=>S.ar.over+arTubes().over; diff --git a/tests/architect.test.js b/tests/architect.test.js index d54d1ac..8439242 100644 --- a/tests/architect.test.js +++ b/tests/architect.test.js @@ -23,7 +23,7 @@ test('architect runs: every reference passes each brief, on plan and within budg plan.forEach((steps, i) => { for (const s of steps) if (s[0] === '@rm') ev(`ACT.pzRmPop({city:'${s[1]}'})`); else lay(ev, ...s); assert.equal(review(ev), true, `${id} brief ${i + 1}: ${ev('arEval().why')} ${ev('JSON.stringify(UI.arFail)')}`); - if (i < plan.length - 1) ev('ACT.pzArNext()'); + if (i < plan.length - 1) { ev('ACT.pzArNext()'); assert.equal(ev('UI.mk'), null, `${id}: the monkey leaves with the next brief`); } }); assert.equal(ev('arOver()'), 0, `${id}: never over a brief's tubes`); assert.equal(ev('arSpend()<=arRun().budget'), true, `${id}: within budget`);