diff --git a/src/core/configuration/Config.ts b/src/core/configuration/Config.ts index b7e11adc9..a97dc2811 100644 --- a/src/core/configuration/Config.ts +++ b/src/core/configuration/Config.ts @@ -135,7 +135,7 @@ export interface Config { numPlayerPorts: number, numPlayerTradeShips: number, ): number; - trainGold(rel: "self" | "friendly" | "other"): Gold; + trainGold(rel: "self" | "team" | "ally" | "other"): Gold; trainSpawnRate(numPlayerFactories: number): number; trainStationMinRange(): number; trainStationMaxRange(): number; diff --git a/src/core/configuration/DefaultConfig.ts b/src/core/configuration/DefaultConfig.ts index 0fa3c8072..07aa45a0f 100644 --- a/src/core/configuration/DefaultConfig.ts +++ b/src/core/configuration/DefaultConfig.ts @@ -333,10 +333,11 @@ export class DefaultConfig implements Config { // expected number of trains = numPlayerFactories / trainSpawnRate(numPlayerFactories) return (numPlayerFactories + 10) * 20; } - trainGold(rel: "self" | "friendly" | "other"): Gold { + trainGold(rel: "self" | "team" | "ally" | "other"): Gold { switch (rel) { - case "friendly": + case "ally": return 50_000n; + case "team": case "other": return 25_000n; case "self": diff --git a/src/core/game/TrainStation.ts b/src/core/game/TrainStation.ts index b804755c2..0181137c7 100644 --- a/src/core/game/TrainStation.ts +++ b/src/core/game/TrainStation.ts @@ -233,12 +233,18 @@ export class Cluster { } } -function rel(player: Player, other: Player): "self" | "friendly" | "other" { +function rel( + player: Player, + other: Player, +): "self" | "team" | "ally" | "other" { if (player === other) { return "self"; } - if (player.isFriendly(other)) { - return "friendly"; + if (player.isOnSameTeam(other)) { + return "team"; + } + if (player.isAlliedWith(other)) { + return "ally"; } return "other"; }