bugfix: bots were not losing troops in attack. rebalanced difficulties.

This commit is contained in:
Evan
2025-02-13 11:50:15 -08:00
parent 0b9ab34b63
commit 64d13a46bd
4 changed files with 8 additions and 8 deletions
+3 -3
View File
@@ -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,
),
);
}