Merge branch 'openfrontio:main' into main

This commit is contained in:
Hristiyan Simeonov
2025-02-14 14:45:57 +02:00
committed by GitHub
5 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ export enum DifficultyDescription {
Easy = "Relaxed",
Medium = "Balanced",
Hard = "Intense",
Impossible = "Challenging",
Impossible = "Impossible",
}
@customElement("difficulty-display")
+6 -6
View File
@@ -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;
}
}
+1 -1
View File
@@ -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,
) {}
-2
View File
@@ -103,8 +103,6 @@ export class BotExecution implements Execution {
this.bot.troops() / 20,
this.bot.id(),
toAttack.isPlayer() ? toAttack.id() : null,
null,
null,
),
);
}
+4 -2
View File
@@ -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,
),
);
}