From 1907c61fb4dae1df7f0cbec0802fea6e046e8d3f Mon Sep 17 00:00:00 2001 From: scamiv <6170744+scamiv@users.noreply.github.com> Date: Sat, 22 Nov 2025 22:14:25 +0100 Subject: [PATCH] Adjust train gold refill time and modify fare calculation logic - Reduced the train gold refill time from 600 to 300 ticks for faster resource replenishment. - Updated fare calculation to use a base length bonus and adjusted congestion fare logic, ensuring that only the net congestion premium is added to the fare. --- src/core/configuration/DefaultConfig.ts | 2 +- src/core/game/Railroad.ts | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/core/configuration/DefaultConfig.ts b/src/core/configuration/DefaultConfig.ts index 41cd40bb8..6a69cc9df 100644 --- a/src/core/configuration/DefaultConfig.ts +++ b/src/core/configuration/DefaultConfig.ts @@ -371,7 +371,7 @@ export class DefaultConfig implements Config { } trainGoldRefillTime(): Tick { // Baseline: full refill in x ticks - return 600; + return 300; } trainStationMinRange(): number { diff --git a/src/core/game/Railroad.ts b/src/core/game/Railroad.ts index f85e9b2ac..18244393c 100644 --- a/src/core/game/Railroad.ts +++ b/src/core/game/Railroad.ts @@ -167,14 +167,15 @@ export class Railroad { } getFare(): bigint { - const baseLengthFare = 10; - const baseCongestionFare = BigInt(2000); - const lengthFare = BigInt(this.getLength() * baseLengthFare); // Base fare proportional to length + const baseLengthBonus = 10; + const baseCongestionFare = BigInt(1000); + const lengthFare = BigInt(this.getLength() * baseLengthBonus); // Base fare proportional to length // Busy railroads should be more expensive: each train adds a congestion premium const effectiveCongestion = Math.max(0, Math.round(this.congestionEma)); const congestionFactor = BigInt(1 + effectiveCongestion); // 1,2,3,... const congestionFare = baseCongestionFare * congestionFactor; - return lengthFare + congestionFare; + const net = congestionFare > lengthFare ? congestionFare - lengthFare : 0n; + return net; } setRailTiles(tiles: RailTile[]) {