mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-05 13:52:10 +00:00
Merge branch 'openfrontio:main' into main
This commit is contained in:
@@ -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