mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-19 10:26:43 +00:00
make hard & impossible more difficult
This commit is contained in:
@@ -288,6 +288,19 @@ export class DefaultConfig implements Config {
|
||||
if (player.type() == PlayerType.Bot) {
|
||||
toAdd *= .7
|
||||
}
|
||||
let difficultyMultiplier = 1
|
||||
switch (this._gameConfig.difficulty) {
|
||||
case Difficulty.Easy:
|
||||
case Difficulty.Medium:
|
||||
difficultyMultiplier = 1
|
||||
case Difficulty.Hard:
|
||||
difficultyMultiplier = 1.2
|
||||
case Difficulty.Impossible:
|
||||
difficultyMultiplier = 1.5
|
||||
}
|
||||
if (player.type() == PlayerType.FakeHuman) {
|
||||
toAdd *= difficultyMultiplier
|
||||
}
|
||||
|
||||
return Math.min(player.population() + toAdd, max) - player.population()
|
||||
}
|
||||
|
||||
@@ -23,16 +23,13 @@ export class DevConfig extends DefaultConfig {
|
||||
// return 100
|
||||
}
|
||||
|
||||
unitInfo(type: UnitType): UnitInfo {
|
||||
const info = super.unitInfo(type)
|
||||
const oldCost = info.cost
|
||||
info.cost = (p: Player) => oldCost(p) / 10000
|
||||
return info
|
||||
}
|
||||
// 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
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user