From 6d2ac30526d1b33b8ea8d672c9586376ed0213aa Mon Sep 17 00:00:00 2001 From: FloPinguin <25036848+FloPinguin@users.noreply.github.com> Date: Fri, 26 Dec 2025 01:01:35 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20bots=20no=20longer=20attacking=20humans?= =?UTF-8?q?=20=F0=9F=A4=96=20(#2690)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description: A small number of people are complaining that bots no longer attack them and that "This has broken the factory farming strat". In the old #2550 I somehow added that bots on easy difficulty don't attack humans and nations anymore. And public games are on easy difficulty now. But I think the difficulty should actually only change nation behavior, not bot behavior. Their attacks are harmless anyways. So lets remove that little check. Also let `shouldAttack()` return true for bots. ## Please complete the following: - [X] I have added screenshots for all UI updates - [X] I process any text displayed to the user through translateText() and I've added it to the en.json file - [X] I have added relevant tests to the test directory - [X] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: FloPinguin --- src/core/execution/utils/AiAttackBehavior.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/execution/utils/AiAttackBehavior.ts b/src/core/execution/utils/AiAttackBehavior.ts index c65b60fa5..031bb9e7c 100644 --- a/src/core/execution/utils/AiAttackBehavior.ts +++ b/src/core/execution/utils/AiAttackBehavior.ts @@ -384,7 +384,6 @@ export class AiAttackBehavior { } // Choose a new enemy randomly - const { difficulty } = this.game.config().gameConfig(); const neighbors = this.player.neighbors(); for (const neighbor of this.random.shuffleArray(neighbors)) { if (!neighbor.isPlayer()) continue; @@ -393,7 +392,7 @@ export class AiAttackBehavior { neighbor.type() === PlayerType.Nation || neighbor.type() === PlayerType.Human ) { - if (this.random.chance(2) || difficulty === Difficulty.Easy) { + if (this.random.chance(2)) { continue; } } @@ -433,11 +432,12 @@ export class AiAttackBehavior { } shouldAttack(other: Player | TerraNullius): boolean { - // Always attack Terra Nullius, non-humans and traitors + // Always attack Terra Nullius, non-humans and traitors (or if we are a bot) if ( other.isPlayer() === false || other.type() !== PlayerType.Human || - other.isTraitor() + other.isTraitor() || + this.player.type() === PlayerType.Bot ) { return true; }