mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 14:00:54 +00:00
bugfix: bots were not losing troops in attack. rebalanced difficulties.
This commit is contained in:
@@ -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