afk()
hated()
1 parent a225569 commit 8b30702Copy full SHA for 8b30702
1 file changed
src/core/execution/utils/AiAttackBehavior.ts
@@ -88,7 +88,10 @@ export class AiAttackBehavior {
88
89
const afk = (): boolean => {
90
// borderingEnemies is already sorted by troops (ascending), so first match is weakest afk enemy
91
- const afk = borderingEnemies.find((enemy) => enemy.isDisconnected());
+ const afk = borderingEnemies.find(
92
+ (enemy) =>
93
+ enemy.isDisconnected() && enemy.troops() < this.player.troops() * 3,
94
+ );
95
if (afk) {
96
this.sendAttack(afk);
97
return true;
@@ -120,6 +123,7 @@ export class AiAttackBehavior {
120
123
if (relation.relation !== Relation.Hostile) continue;
121
124
const other = relation.player;
122
125
if (this.player.isFriendly(other)) continue;
126
+ if (other.troops() > this.player.troops() * 3) continue;
127
this.sendAttack(other);
128
129
}
0 commit comments