mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 21:24:14 +00:00
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.
This commit is contained in:
@@ -371,7 +371,7 @@ export class DefaultConfig implements Config {
|
||||
}
|
||||
trainGoldRefillTime(): Tick {
|
||||
// Baseline: full refill in x ticks
|
||||
return 600;
|
||||
return 300;
|
||||
}
|
||||
|
||||
trainStationMinRange(): number {
|
||||
|
||||
@@ -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[]) {
|
||||
|
||||
Reference in New Issue
Block a user