make turnout description more clear. fix curves from breaking running track.
This commit is contained in:
+27
-9
@@ -557,9 +557,14 @@ describe('the page explains itself', () => {
|
||||
baseOperationalRail: true, standing: [], facility: null, modifiers: [], enhancements: [],
|
||||
});
|
||||
const cell = view(game).cells.find((c) => c.row === -1 && c.col === 0)!;
|
||||
assert.match(cell.what, /stem east/);
|
||||
assert.match(cell.what, /diverges south/);
|
||||
assert.match(cell.what, /NEVER/, 'the missing edge is not spelled out');
|
||||
// Said the way a player would ask it: if my train comes in from over there, where can it go?
|
||||
// "stem east, through west, diverges south" is three pieces of jargon and a compass reading.
|
||||
assert.match(
|
||||
cell.what,
|
||||
/allows traffic from the east to travel west or turn to the south/,
|
||||
`the turnout does not say what it does: ${cell.what}`,
|
||||
);
|
||||
assert.match(cell.what, /the two roads never join/, 'the missing edge is not spelled out');
|
||||
});
|
||||
|
||||
it('describes every card kind in the deck, not just the easy ones', () => {
|
||||
@@ -649,13 +654,20 @@ describe('the page explains itself', () => {
|
||||
variantsFor(geometry, hand).forEach((v, variant) => {
|
||||
const label = variantLabel(geometry, variant, hand);
|
||||
if (v.turnout) {
|
||||
assert.match(label, new RegExp(`stem ${say[v.turnout.stem]}`), `${geometry}/${hand} v${variant}: ${label}`);
|
||||
assert.match(label, new RegExp(`diverges ${say[v.turnout.diverge]}`), `${geometry}/${hand} v${variant}: ${label}`);
|
||||
assert.equal(
|
||||
label.trim(),
|
||||
`— allows traffic from the ${say[v.turnout.stem]} to travel ${say[v.turnout.through]} ` +
|
||||
`or turn to the ${say[v.turnout.diverge]}`,
|
||||
`${geometry}/${hand} v${variant}`,
|
||||
);
|
||||
} else if (v.arc) {
|
||||
const [a, b] = [v.arc[0]!, v.arc[1]!];
|
||||
const [side, leg] = a === 'n' || a === 's' ? [b, a] : [a, b];
|
||||
assert.match(label, new RegExp(say[side]!), `${geometry}/${hand} v${variant}: ${label}`);
|
||||
assert.match(label, new RegExp(`${say[leg]} edge`), `${geometry}/${hand} v${variant}: ${label}`);
|
||||
assert.equal(
|
||||
label.trim(),
|
||||
`— carries traffic from the ${say[side!]} round to the ${say[leg!]}`,
|
||||
`${geometry}/${hand} v${variant}`,
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -682,7 +694,7 @@ describe('the page explains itself', () => {
|
||||
.filter((sp) => sp.coord.row === under.row && sp.coord.col === under.col);
|
||||
|
||||
assert.equal(spots.length, 1, 'exactly one turnout rotation should meet the leg coming down');
|
||||
assert.match(spots[0]!.label, /diverges north/, 'the crossover turnout must point back up');
|
||||
assert.match(spots[0]!.label, /turn to the north/, 'the crossover turnout must point back up');
|
||||
assert.match(spots[0]!.label, /joins the track above/, 'the spot must say what it connects to');
|
||||
});
|
||||
|
||||
@@ -1278,7 +1290,13 @@ describe('every square the menu offers can actually be clicked (regression)', ()
|
||||
// is offered a square OFF the Running Track, which is the case that used to draw off-canvas.
|
||||
const { option: turnout } = dealTrack(game, 'turnout', 'left');
|
||||
if (turnout) submit(game, turnout);
|
||||
dealTrack(game, 'curved', 'left');
|
||||
// Hold BOTH the curve its leg calls for and a straight: the curve is offered the square off
|
||||
// the Running Track, the straight the growth points on it. A curve may no longer be laid in
|
||||
// the running row at all — it has no east-west road and would dead-end the main — so on its
|
||||
// own it now offers a single square and the bounds check would barely exercise anything.
|
||||
const curve = dealTrack(game, 'curved', 'left');
|
||||
const straight = dealTrack(game, 'straight', 'none');
|
||||
game.state.decks.hands.set(0, [curve.cardId, straight.cardId]);
|
||||
|
||||
const menu = actionMenu(game);
|
||||
const f = view(game);
|
||||
|
||||
Reference in New Issue
Block a user