From e8ee83e4b203044a9d021586bca5742e78e4ae3d Mon Sep 17 00:00:00 2001 From: evanpelle Date: Thu, 12 Mar 2026 21:09:18 -0700 Subject: [PATCH] meta: expand trainGold free window from 6 to 10 stops and update tests --- src/core/configuration/DefaultConfig.ts | 4 ++-- tests/core/game/TrainStation.test.ts | 26 ++++++++++++------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/core/configuration/DefaultConfig.ts b/src/core/configuration/DefaultConfig.ts index 408dfe95f..db29e0e88 100644 --- a/src/core/configuration/DefaultConfig.ts +++ b/src/core/configuration/DefaultConfig.ts @@ -277,8 +277,8 @@ export class DefaultConfig implements Config { rel: "self" | "team" | "ally" | "other", citiesVisited: number, ): Gold { - // No penalty for the first 5 cities. - citiesVisited = Math.max(0, citiesVisited - 5); + // No penalty for the first 10 cities. + citiesVisited = Math.max(0, citiesVisited - 9); let baseGold: number; switch (rel) { case "ally": diff --git a/tests/core/game/TrainStation.test.ts b/tests/core/game/TrainStation.test.ts index e04167594..03b84d8ca 100644 --- a/tests/core/game/TrainStation.test.ts +++ b/tests/core/game/TrainStation.test.ts @@ -192,35 +192,35 @@ describe("DefaultConfig.trainGold trade stop penalty", () => { ); }); - it("returns full base gold within free window (stops 0-5)", () => { - // first 6 stops (0-5) are free — no penalty + it("returns full base gold within free window (stops 0-9)", () => { + // first 10 stops (0-9) are free — no penalty expect(config.trainGold("self", 0)).toBe(10_000n); - expect(config.trainGold("self", 5)).toBe(10_000n); + expect(config.trainGold("self", 9)).toBe(10_000n); }); it("reduces gold by 5k per stop after the free window", () => { - // stop 6: effective = 6-5 = 1 -> 10k - 5k = 5k - expect(config.trainGold("self", 6)).toBe(5_000n); + // stop 10: effective = 10-9 = 1 -> 10k - 5k = 5k + expect(config.trainGold("self", 10)).toBe(5_000n); }); it("floors at 5k when penalty exceeds base gold", () => { - // stop 8: effective = 3 -> 10k - 15k -> floor at 5k - expect(config.trainGold("self", 8)).toBe(5_000n); + // stop 12: effective = 3 -> 10k - 15k -> floor at 5k + expect(config.trainGold("self", 12)).toBe(5_000n); }); it("floors at 5k for ally base even with heavy penalty", () => { - // ally base 35k, stop 20: effective = 15 -> penalty 75k -> floor at 5k + // ally base 35k, stop 20: effective = 11 -> penalty 55k -> floor at 5k expect(config.trainGold("ally", 20)).toBe(5_000n); }); it("ally base gold reduces correctly after free window", () => { - // ally base 35k, stop 7: effective = 2 -> 35k - 10k = 25k - expect(config.trainGold("ally", 7)).toBe(25_000n); + // ally base 35k, stop 11: effective = 2 -> 35k - 10k = 25k + expect(config.trainGold("ally", 11)).toBe(25_000n); }); it("other/team base gold reduces correctly after free window", () => { - // other base 25k, stop 6: effective = 1 -> 25k - 5k = 20k - expect(config.trainGold("other", 6)).toBe(20_000n); - expect(config.trainGold("team", 6)).toBe(20_000n); + // other base 25k, stop 10: effective = 1 -> 25k - 5k = 20k + expect(config.trainGold("other", 10)).toBe(20_000n); + expect(config.trainGold("team", 10)).toBe(20_000n); }); });