v0.4.4 — New Game dialog for the opening hand and the three revenue rates, Yard renamed Interchange, and two movement bugs behind a mirrored consist

This commit is contained in:
Jesse
2026-08-14 22:39:50 -04:00
parent d1314066bd
commit 6655e20ea8
29 changed files with 5450 additions and 3902 deletions
+29 -4
View File
@@ -27,6 +27,7 @@ import {
STAGES_PER_DAY,
STAGES_PER_SHIFT,
collectiveRevenueFloor,
houseRules,
lengthProfile,
officeProfile,
REGIONS_PER_MAINLINE_CARD,
@@ -422,6 +423,26 @@ function enterMainline(
);
node.transits.push({ tray: id, stagesRemaining: stages, stagesTotal: stages, direction: tray.direction });
tray.position = { at: 'mainline', index };
/**
* OUT OF THE DISTRICT, AND THE SPUR PORT GOES WITH IT.
*
* `facing` is a port on the card the train is standing on, and switching round a district leaves
* it holding a real compass port — 'n' or 's' off a curve. Nothing cleared it when the train
* departed, so it carried that port out onto a Division that runs east and west, and then into
* the next Office, whose card has no north or south edge at all.
*
* That is not cosmetic. `movesFor` explores from `facing` and from its opposite, and a card with
* neither port yields no destinations either way — so a train that had been shunted onto a spur
* arrived at the next Office **unable to make a single Move**. It also drew a ▲ on the Division
* map, where there is no north to point at.
*
* A train out here is running one way along an east-west railroad with its engine at one end, so
* this is what `facing` means on the Division; there is nothing else it could be. `railFacing`
* follows for the same reason — this IS the east-west sense, freshly known.
*/
tray.facing = tray.direction === 'west' ? 'w' : 'e';
tray.railFacing = tray.facing;
}
/**
@@ -931,17 +952,21 @@ function collide(
*
* A crew with no train number is a local switching move, not a run, so it earns nothing.
*
* PROVISIONAL — the previous version was worth about +5 Revenue a game against a mean of 2.7, and
* this one pays far less often. Flagged in `TODO.md`.
* NOW A DIAL, AND OFF BY DEFAULT. At 1 it was worth ~5.4 Revenue against a bot mean of 7.0 — the
* railroad was making most of its money from the one thing no one has to work, and the freight and
* passenger economies it exists to reward could not be read through it. `trainPerTransit` sets the
* rate per player, and 0 (the default) means no event at all rather than a run of "+0" entries.
*/
function awardCompletedRun(s: GameState, tray: CrewTray, events: GameEvent[]): void {
if (tray.trainNumber === null) return;
const rate = houseRules(s.config).revenue.trainPerTransit;
if (rate <= 0) return;
for (const p of s.players) {
p.revenue += 1;
p.revenue += rate;
events.push({
type: 'revenueChanged',
player: p.index,
delta: 1,
delta: rate,
total: p.revenue,
reason: 'a train completed its run',
});