mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-22 04:03:49 +00:00
Merge branch 'openfrontio:main' into main
This commit is contained in:
@@ -5,7 +5,7 @@ export enum DifficultyDescription {
|
||||
Easy = "Relaxed",
|
||||
Medium = "Balanced",
|
||||
Hard = "Intense",
|
||||
Impossible = "Challenging",
|
||||
Impossible = "Impossible",
|
||||
}
|
||||
|
||||
@customElement("difficulty-display")
|
||||
|
||||
@@ -301,7 +301,7 @@ export class DefaultConfig implements Config {
|
||||
if (defender.isPlayer()) {
|
||||
return {
|
||||
attackerTroopLoss:
|
||||
within(defender.troops() / (2.5 * attackTroops), 0.1, 10) * mag,
|
||||
within(defender.troops() / attackTroops, 0.5, 2) * mag,
|
||||
defenderTroopLoss: defender.troops() / defender.numTilesOwned(),
|
||||
tilesPerTickUsed:
|
||||
within(defender.troops() / (5 * attackTroops), 0.2, 1.5) * speed,
|
||||
@@ -360,9 +360,9 @@ export class DefaultConfig implements Config {
|
||||
case Difficulty.Medium:
|
||||
return 5_000 * (playerInfo?.nation?.strength ?? 1);
|
||||
case Difficulty.Hard:
|
||||
return 15_000 * (playerInfo?.nation?.strength ?? 1);
|
||||
case Difficulty.Impossible:
|
||||
return 20_000 * (playerInfo?.nation?.strength ?? 1);
|
||||
case Difficulty.Impossible:
|
||||
return 50_000 * (playerInfo?.nation?.strength ?? 1);
|
||||
}
|
||||
}
|
||||
return this.creativeMode() ? 1_000_000 : 25_000;
|
||||
@@ -387,11 +387,11 @@ export class DefaultConfig implements Config {
|
||||
case Difficulty.Easy:
|
||||
return maxPop * 0.5;
|
||||
case Difficulty.Medium:
|
||||
return maxPop * 0.7;
|
||||
case Difficulty.Hard:
|
||||
return maxPop * 1;
|
||||
case Difficulty.Impossible:
|
||||
case Difficulty.Hard:
|
||||
return maxPop * 1.5;
|
||||
case Difficulty.Impossible:
|
||||
return maxPop * 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ export class AttackExecution implements Execution {
|
||||
private startTroops: number | null = null,
|
||||
private _ownerID: PlayerID,
|
||||
private _targetID: PlayerID | null,
|
||||
private sourceTile: TileRef | null,
|
||||
private sourceTile: TileRef | null = null,
|
||||
private removeTroops: boolean = true,
|
||||
) {}
|
||||
|
||||
|
||||
@@ -103,8 +103,6 @@ export class BotExecution implements Execution {
|
||||
this.bot.troops() / 20,
|
||||
this.bot.id(),
|
||||
toAttack.isPlayer() ? toAttack.id() : null,
|
||||
null,
|
||||
null,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import { closestTwoTiles } from "./Util";
|
||||
import { calculateBoundingBox, simpleHash } from "../Util";
|
||||
import { andFN, manhattanDistFN, TileRef } from "../game/GameMap";
|
||||
import { ConstructionExecution } from "./ConstructionExecution";
|
||||
import { renderTroops } from "../../client/Utils";
|
||||
|
||||
export class FakeHumanExecution implements Execution {
|
||||
private firstMove = true;
|
||||
@@ -545,13 +546,14 @@ export class FakeHumanExecution implements Execution {
|
||||
}
|
||||
|
||||
sendAttack(toAttack: Player | TerraNullius) {
|
||||
console.log(
|
||||
`${this.player.name()} sending troops ${renderTroops(this.player.troops() / 5)}`,
|
||||
);
|
||||
this.mg.addExecution(
|
||||
new AttackExecution(
|
||||
this.player.troops() / 5,
|
||||
this.player.id(),
|
||||
toAttack.isPlayer() ? toAttack.id() : null,
|
||||
null,
|
||||
null,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user