From e3052546c5b5a57e30c4e0635e997196b5544cda Mon Sep 17 00:00:00 2001 From: 1brucben <1benjbruce@gmail.com> Date: Mon, 5 May 2025 02:13:53 +0200 Subject: [PATCH] nations attack terra nulla first. --- src/core/execution/FakeHumanExecution.ts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/core/execution/FakeHumanExecution.ts b/src/core/execution/FakeHumanExecution.ts index 3e960d789..afdedf490 100644 --- a/src/core/execution/FakeHumanExecution.ts +++ b/src/core/execution/FakeHumanExecution.ts @@ -262,6 +262,12 @@ export class FakeHumanExecution implements Execution { this.behavior.forgetOldEnemies(); this.behavior.checkIncomingAttacks(); this.behavior.assistAllies(); + + const sharesBorderWithTN = Array.from(this.player.borderTiles()) + .flatMap((t) => this.mg.neighbors(t)) + .some((t) => this.mg.isLand(t) && !this.mg.hasOwner(t)); + if (sharesBorderWithTN) return; + let enemy: Player | null = null; if ( @@ -879,6 +885,13 @@ export class FakeHumanExecution implements Execution { this.dogpileTarget = null; return; } + const isTeamGame = this.mg + .players() + .some((p) => p !== this.player && this.player.isOnSameTeam(p)); + if (isTeamGame) { + this.dogpileTarget = null; + return; + } const CHECK_INTERVAL = 50; if (this.mg.ticks() - this.dogpileLastChecked < CHECK_INTERVAL) return; @@ -886,7 +899,13 @@ export class FakeHumanExecution implements Execution { const alivePlayers = this.mg .players() - .filter((p) => p.isAlive() && p.isPlayer()); + .filter( + (p) => + p.isAlive() && + p.isPlayer() && + p.id() !== this.player?.id() && + !this.player?.isOnSameTeam(p), + ); if (alivePlayers.length < 2) { this.dogpileTarget = null;