mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 14:00:54 +00:00
rebalance difficulties
This commit is contained in:
@@ -330,20 +330,21 @@ export class DefaultConfig implements Config {
|
||||
|
||||
startManpower(playerInfo: PlayerInfo): number {
|
||||
if (playerInfo.playerType == PlayerType.Bot) {
|
||||
return 10000;
|
||||
return 10_000;
|
||||
}
|
||||
if (playerInfo.playerType == PlayerType.FakeHuman) {
|
||||
// start troops * strength * difficulty
|
||||
switch (this._gameConfig.difficulty) {
|
||||
case Difficulty.Easy:
|
||||
return 2_500 * (playerInfo?.nation?.strength ?? 1);
|
||||
case Difficulty.Medium:
|
||||
return 10000 * (playerInfo?.nation?.strength ?? 1);
|
||||
return 5_000 * (playerInfo?.nation?.strength ?? 1);
|
||||
case Difficulty.Hard:
|
||||
return 15_000 * (playerInfo?.nation?.strength ?? 1);
|
||||
case Difficulty.Impossible:
|
||||
return 20000 * (playerInfo?.nation?.strength ?? 1);
|
||||
return 20_000 * (playerInfo?.nation?.strength ?? 1);
|
||||
}
|
||||
}
|
||||
return 25000;
|
||||
return 25_000;
|
||||
}
|
||||
|
||||
maxPopulation(player: Player | PlayerView): number {
|
||||
@@ -371,16 +372,16 @@ export class DefaultConfig implements Config {
|
||||
let difficultyMultiplier = 1;
|
||||
switch (this._gameConfig.difficulty) {
|
||||
case Difficulty.Easy:
|
||||
difficultyMultiplier = 0.5;
|
||||
difficultyMultiplier = 0.3;
|
||||
break;
|
||||
case Difficulty.Medium:
|
||||
difficultyMultiplier = 0.8;
|
||||
difficultyMultiplier = 0.6;
|
||||
break;
|
||||
case Difficulty.Hard:
|
||||
difficultyMultiplier = 1.5;
|
||||
difficultyMultiplier = 1;
|
||||
break;
|
||||
case Difficulty.Impossible:
|
||||
difficultyMultiplier = 1.7;
|
||||
difficultyMultiplier = 1.2;
|
||||
break;
|
||||
}
|
||||
if (player.type() == PlayerType.FakeHuman) {
|
||||
|
||||
@@ -27,6 +27,7 @@ export class BotExecution implements Execution {
|
||||
|
||||
init(mg: Game, ticks: number) {
|
||||
this.mg = mg;
|
||||
this.bot.setTargetTroopRatio(0.7);
|
||||
// this.neighborsTerra = this.bot.neighbors().filter(n => n == this.gs.terraNullius()).length > 0
|
||||
}
|
||||
|
||||
@@ -103,8 +104,8 @@ export class BotExecution implements Execution {
|
||||
this.bot.id(),
|
||||
toAttack.isPlayer() ? toAttack.id() : null,
|
||||
null,
|
||||
null,
|
||||
),
|
||||
null
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,13 +17,9 @@ import { PseudoRandom } from "../PseudoRandom";
|
||||
import { AttackExecution } from "./AttackExecution";
|
||||
import { TransportShipExecution } from "./TransportShipExecution";
|
||||
import { SpawnExecution } from "./SpawnExecution";
|
||||
import { PortExecution } from "./PortExecution";
|
||||
import { WarshipExecution } from "./WarshipExecution";
|
||||
import { GameID } from "../Schemas";
|
||||
import { consolex } from "../Consolex";
|
||||
import { CityExecution } from "./CityExecution";
|
||||
import { NukeExecution } from "./NukeExecution";
|
||||
import { MissileSiloExecution } from "./MissileSiloExecution";
|
||||
import { EmojiExecution } from "./EmojiExecution";
|
||||
import { AllianceRequestReplyExecution } from "./alliance/AllianceRequestReplyExecution";
|
||||
import { closestTwoTiles } from "./Util";
|
||||
|
||||
Reference in New Issue
Block a user