update meta

This commit is contained in:
evanpelle
2025-08-15 09:50:37 -07:00
parent cefc9f6dbf
commit 214c664d8b
3 changed files with 26 additions and 10 deletions
+1 -1
View File
@@ -130,7 +130,7 @@ export interface Config {
unitInfo(type: UnitType): UnitInfo;
tradeShipGold(dist: number, numPorts: number): Gold;
tradeShipSpawnRate(numTradeShips: number, numPlayerPorts: number): number;
trainGold(isFriendly: boolean): Gold;
trainGold(rel: "self" | "friendly" | "other"): Gold;
trainSpawnRate(numPlayerFactories: number): number;
trainStationMinRange(): number;
trainStationMaxRange(): number;
+10 -3
View File
@@ -333,8 +333,15 @@ export class DefaultConfig implements Config {
// expected number of trains = numPlayerFactories / trainSpawnRate(numPlayerFactories)
return (numPlayerFactories + 5) * 50;
}
trainGold(isFriendly: boolean): Gold {
return isFriendly ? 50_000n : 10_000n;
trainGold(rel: "self" | "friendly" | "other"): Gold {
switch (rel) {
case "friendly":
return 50_000n;
case "other":
return 10_000n;
case "self":
return 5_000n;
}
}
trainStationMinRange(): number {
@@ -363,7 +370,7 @@ export class DefaultConfig implements Config {
this.tradeShipPortMultiplier(numPlayerPorts),
);
return Math.floor(10 / combined);
return Math.floor(20 / combined);
}
private tradeShipBaseSpawn(numTradeShips: number): number {
+15 -6
View File
@@ -25,8 +25,7 @@ class CityStopHandler implements TrainStopHandler {
): void {
const stationOwner = station.unit.owner();
const trainOwner = trainExecution.owner();
const isFriendly = stationOwner.isFriendly(trainOwner);
const goldBonus = mg.config().trainGold(isFriendly);
const goldBonus = mg.config().trainGold(rel(trainOwner, stationOwner));
// Share revenue with the station owner if it's not the current player
if (trainOwner !== stationOwner) {
stationOwner.addGold(goldBonus, station.tile());
@@ -44,13 +43,13 @@ class PortStopHandler implements TrainStopHandler {
): void {
const stationOwner = station.unit.owner();
const trainOwner = trainExecution.owner();
const isFriendly = stationOwner.isFriendly(trainOwner);
const goldBonus = mg.config().trainGold(isFriendly);
const goldBonus = mg.config().trainGold(rel(trainOwner, stationOwner));
if (isFriendly) {
trainOwner.addGold(goldBonus, station.tile());
// Share revenue with the station owner if it's not the current player
if (trainOwner !== stationOwner) {
stationOwner.addGold(goldBonus, station.tile());
}
trainOwner.addGold(goldBonus, station.tile());
}
}
@@ -233,3 +232,13 @@ export class Cluster {
this.stations.clear();
}
}
function rel(player: Player, other: Player): "self" | "friendly" | "other" {
if (player === other) {
return "self";
}
if (player.isFriendly(other)) {
return "friendly";
}
return "other";
}