Router trade-ins, one swap a day, and speed-based requirements (#82)

Swaps and removals sell the old chassis for 30% (optics get 40%, #45),
and buttons show the net price. A POP accepts one model swap per game
day so a double click cannot chain two upgrades. Optic and wave
requirements name the port speed, since side-grades qualify too.
This commit is contained in:
Frederic Jung 2026-10-25 21:49:51 +01:00
parent 6c2d5da5b8
commit 7e3ea0cefe
No known key found for this signature in database
5 changed files with 47 additions and 14 deletions

View file

@ -53,9 +53,9 @@ test('new routers: the 3.2T main line, side-grades, and 3.2T ports only once unl
assert.equal(ev('waveShown(6)'), true);
ev("S.pops.fra.rgen=3;S.pops.fra.routers=1;ACT.upRouter({city:'fra'})");
assert.equal(ev("RG[S.pops.fra.rgen].n"), 'Absolute Unit 3.2T');
ev("const g=RG.findIndex(r=>r.lvl===13);ACT.upRouter({city:'fra',g})");
ev("S.day++;const g=RG.findIndex(r=>r.lvl===13);ACT.upRouter({city:'fra',g})");
assert.equal(ev("RG[S.pops.fra.rgen].n"), 'Absolute Unit 3.2T', 'the Router at the End of the Universe waits for level 13');
ev("S.lvl=13;ACT.upRouter({city:'fra',g:RG.findIndex(r=>r.lvl===13)})");
ev("S.lvl=13;S.day++;ACT.upRouter({city:'fra',g:RG.findIndex(r=>r.lvl===13)})");
assert.equal(ev("RG[S.pops.fra.rgen].ports"), 256);
// every model's numbers make sense for its class
assert.equal(ev("RG.every(r=>PORT[r.maxP]&&LT[r.maxLT]&&r.pn===PORT[r.maxP].n&&r.lvl>=1&&r.lvl<=LEVELS.length)"), true);