diff --git a/scripts/lib/route-fuzz.js b/scripts/lib/route-fuzz.js index 506d1e0..164a8a7 100644 --- a/scripts/lib/route-fuzz.js +++ b/scripts/lib/route-fuzz.js @@ -95,6 +95,9 @@ function playGame(pages, seed, opts = {}) { const [s0, s1] = both('start', st); same('start', s0, s1); note('start ' + JSON.stringify(st)); + // A normal game signs its charter first: a popup on newer pages (which seeded pages skip), a card on older ones. Both + // sign the classic one at once, so neither shows charter buttons the other has not, and the game plays as it did. + if (kind === 'normal') { const [c0, c1] = both('press', { act: 'charter', args: { k: 'global' } }); same('charter', c0, c1); } if (!div) compare('start'); // A screen's buttons on both pages; the same list or a divergence. diff --git a/src/game/60-features/20-scenarios.js b/src/game/60-features/20-scenarios.js index 416ef19..9b8e154 100644 --- a/src/game/60-features/20-scenarios.js +++ b/src/game/60-features/20-scenarios.js @@ -55,4 +55,4 @@ function beginGame(nm,city,o={}){if(needPitch()&&!UI.pitched){UI.pendGame=[nm,ci track('game_new');UI.started=true;closeModal();compute();cam.x=CITY[city].x;cam.y=CITY[city].y;cam.z=innerWidth<760?1.1:1.4;selectCity(city); toast(S.scn?`${esc(S.scn.name)}
${o.scn.goal?esc(o.scn.goal)+'.':tr('common.serve_as_much_traffic_as_you')} ${tr('scenarios.you_have_n_days',{n:S.scn.days})}`:S.mode==='sandbox'?(chaosMul()?tr('scenarios.sandbox_mode_a_billion_dollars_chaos',{chaos:CHAOS[rule('chaos')].n}):tr('scenarios.sandbox_mode_a_billion_dollars_every')):tr('scenarios.welcome_name_the_ripe_ncc_assigned',{name:esc(nm),asn:S.asn,city:CITY[city].name}),'goal'); // A Normal game asks for its charter first; the tutorial starts once it is signed. - renderAll();save();if(!S.scn&&S.mode!=='sandbox'&&S.mode!=='puzzle'){if(charterDue()){UI.tutLater=true;charterAsk();}else tutorialStart();}} + renderAll();save();if(!S.scn&&S.mode!=='sandbox'&&S.mode!=='puzzle'){charterAsk();if(!$('modal').hidden&&$('modal').className==='charter')UI.tutLater=true;else tutorialStart();}} diff --git a/tests/regions.test.js b/tests/regions.test.js index 9ad4bd6..b9927fd 100644 --- a/tests/regions.test.js +++ b/tests/regions.test.js @@ -410,9 +410,9 @@ test('#22 Tier 1 networks can lay their own subsea cable', () => { const { ev, dom, errors } = load(); ev("ACT.start({});S.cash=2e8;S.lvl=4;for(const g of GOALS)S.done[g.id]=0;ACT.launchBB({city:'fra'});ACT.buildPop({city:'lon'});ACT.buildPop({city:'nyc'});compute()"); const card = () => dom.window.document.getElementById('modalCard').textContent; - // not before Tier 1 + // not before Tier 1 or customer level 9 (#300) ev("UI.lmode='df';UI.via=null;openLinkModal('lon','nyc')"); - assert.match(card(), /Tier 1 only/); + assert.match(card(), /level 9 or Tier 1/); assert.match(ev("ownCabWhy('lon','nyc')"), /Tier 1/); ev('ACT.orderCable()'); assert.equal(ev("S.links.filter(l=>l.own&&l.sub).length"), 0, 'refused before Tier 1');