v0.4.2 fixed passenger trains not stopping at office. changeed revenue for train completing run - 1 point to every player when train exits division
This commit is contained in:
@@ -543,11 +543,15 @@ describe('the view shows one seat at a time', () => {
|
||||
});
|
||||
|
||||
describe('scoring lands on the right seat', () => {
|
||||
it('pays the departure Revenue to the Office the train left, not to seat 0', () => {
|
||||
it('pays EVERY player when a train completes its run, and nobody for merely departing', () => {
|
||||
/**
|
||||
* The rule reads "one Revenue for every train that clears YOUR section", and `awardDeparture`
|
||||
* takes the owner of the departing Office. With one player that is unfalsifiable: seat 0 is the
|
||||
* only seat there is. This is the test that says so with three.
|
||||
* THE RULE CHANGED IN v0.4.2. It used to pay 1 to the Office a train departed — which on a
|
||||
* three-Office railroad paid three separate times for one train, and paid whichever Office the
|
||||
* train happened to pass first. It pays once now, when the train runs off the end of the
|
||||
* Division, and it pays everybody: getting a train the whole length is the shared achievement.
|
||||
*
|
||||
* With one player this is unfalsifiable, because "everybody" is one person. This is the test
|
||||
* that says so with three.
|
||||
*/
|
||||
const s = game(3);
|
||||
pinTerrain(s);
|
||||
@@ -558,10 +562,20 @@ describe('scoring lands on the right seat', () => {
|
||||
s.movedThisPhase = new Set();
|
||||
|
||||
advance(s);
|
||||
assert.deepEqual(s.players.map((p) => p.revenue), before, 'departing the Office paid somebody');
|
||||
|
||||
assert.equal(s.players[2]!.revenue, before[2]! + 1, 'seat 2 was not paid for its own departure');
|
||||
assert.equal(s.players[0]!.revenue, before[0]!, 'seat 0 was paid for a train it never ran');
|
||||
assert.equal(s.players[1]!.revenue, before[1]!, 'seat 1 was paid for a train it never ran');
|
||||
let completed;
|
||||
for (let i = 0; i < 25 && !completed; i++) {
|
||||
s.movedThisPhase = new Set();
|
||||
s.clock.phase = 'mainline';
|
||||
completed = advance(s).events.find((e) => e.type === 'trainCompleted');
|
||||
}
|
||||
assert.ok(completed, 'the train never ran off the end of the Division');
|
||||
assert.deepEqual(
|
||||
s.players.map((p) => p.revenue),
|
||||
before.map((r) => r + 1),
|
||||
'a completed run did not pay every player exactly 1',
|
||||
);
|
||||
});
|
||||
|
||||
it('keeps each seat’s Office Area to itself', () => {
|
||||
|
||||
Reference in New Issue
Block a user