Steadier taps, lighter map drawing, Sinai land route, live Tier 1, courtesy route, optics spares
Fixes #43, fixes #44, fixes #45, fixes #46, fixes #47
This commit is contained in:
parent
6a8df55dd9
commit
8e921693c5
6 changed files with 185 additions and 32 deletions
|
|
@ -50,3 +50,29 @@ test('version comparison for the update banner', () => {
|
|||
assert.equal(ev("newerVer('1.1.0','1.1.0')"), false);
|
||||
assert.equal(ev("newerVer('1.0.9','1.1.0')"), false);
|
||||
});
|
||||
|
||||
test('#46 an update that adds networks gives a courtesy route, and Tier 1 is shown only while it is true', () => {
|
||||
const { ev, errors } = load();
|
||||
ev("ACT.start({});S.cash=1e8;for(const g of GOALS)S.done[g.id]=0;ACT.launchBB({city:'fra'});ACT.buyTransit({city:'fra',net:'cog',tier:1});compute()");
|
||||
assert.ok(ev('R.reach') > 0.99);
|
||||
assert.ok(Array.isArray(JSON.parse(ev('JSON.stringify(S.seen)'))), 'new games remember which networks existed');
|
||||
// a transit-free network that has never heard of two of today's networks
|
||||
ev("S.transit=[];S.day=400;S.seen=S.seen.filter(id=>id!=='btt'&&id!=='sky');const s=JSON.parse(JSON.stringify(S));S=migrate(s);compute()");
|
||||
assert.deepEqual(JSON.parse(ev('JSON.stringify(S.grace.nets.sort())')), ['btt', 'sky']);
|
||||
assert.equal(ev('S.grace.until'), 460);
|
||||
assert.equal(ev('R.reachable.btt'), true, 'the courtesy route reaches a network from the update');
|
||||
assert.equal(ev('R.reachable.cog'), false, 'but not networks the player already knew about');
|
||||
ev('S.day=461;compute()');
|
||||
assert.equal(ev('R.reachable.btt'), false, 'it ends after 60 days');
|
||||
// a save from before this change, with no record at all, gets the grace for everything it cannot reach
|
||||
ev("S.day=10;delete S.seen;delete S.grace;S=migrate(JSON.parse(JSON.stringify(S)));compute()");
|
||||
assert.ok(ev('S.grace.nets.length') > 50);
|
||||
assert.ok(ev('R.reach') > 0.99, 'nothing drops overnight');
|
||||
// Tier 1 is a state, not a trophy
|
||||
ev("S.won=true;S.t1Now=true;S.grace=null;compute()");
|
||||
assert.notEqual(ev('tierLabel()'), 'Tier 1');
|
||||
ev("window.__t=[];const _t=toast;toast=(h,...a)=>{window.__t.push(h);return _t(h,...a);};dayTick()");
|
||||
assert.match(ev("window.__t.join(' ')"), /no longer Tier 1/);
|
||||
assert.equal(ev("BADGES.find(b=>b.id==='t1').ok()"), true, 'the badge stays');
|
||||
assert.deepEqual(errors, []);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue