mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-22 03:43:48 +00:00
50 lines
1.2 KiB
TypeScript
50 lines
1.2 KiB
TypeScript
import { GameType, Player, PlayerInfo, UnitInfo, UnitType } from "../game/Game";
|
|
import { GameConfig } from "../Schemas";
|
|
import { ServerConfig } from "./Config";
|
|
import { DefaultConfig, DefaultServerConfig } from "./DefaultConfig";
|
|
|
|
export class DevServerConfig extends DefaultServerConfig {
|
|
numSpawnPhaseTurns(gameType: GameType): number {
|
|
return gameType == GameType.Singleplayer ? 40 : 200
|
|
// return 100
|
|
}
|
|
gameCreationRate(): number {
|
|
return 10 * 1000
|
|
}
|
|
lobbyLifetime(): number {
|
|
return 10 * 1000
|
|
}
|
|
}
|
|
|
|
export class DevConfig extends DefaultConfig {
|
|
|
|
constructor(sc: ServerConfig, gc: GameConfig) {
|
|
super(sc, gc);
|
|
}
|
|
|
|
unitInfo(type: UnitType): UnitInfo {
|
|
const info = super.unitInfo(type)
|
|
const oldCost = info.cost
|
|
info.cost = (p: Player) => oldCost(p) / 10000
|
|
return info
|
|
}
|
|
|
|
percentageTilesOwnedToWin(): number {
|
|
return 95
|
|
}
|
|
// tradeShipSpawnRate(): number {
|
|
// return 10
|
|
// }
|
|
// boatMaxDistance(): number {
|
|
// return 5000
|
|
// }
|
|
|
|
// numBots(): number {
|
|
// return 1
|
|
// }
|
|
// spawnNPCs(): boolean {
|
|
// return false
|
|
// }
|
|
|
|
}
|