From e1d07736723e6ffeb52ce659334f4675998e7c29 Mon Sep 17 00:00:00 2001 From: FloPinguin <25036848+FloPinguin@users.noreply.github.com> Date: Fri, 26 Dec 2025 01:16:13 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20bots=20no=20longer=20attacking=20humans?= =?UTF-8?q?=20=F0=9F=A4=96=20For=20v28=20(#2697)?= 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/BotBehavior.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/execution/utils/BotBehavior.ts b/src/core/execution/utils/BotBehavior.ts index 2d79275c3..95efab75e 100644 --- a/src/core/execution/utils/BotBehavior.ts +++ b/src/core/execution/utils/BotBehavior.ts @@ -44,13 +44,14 @@ export class BotBehavior { this.game.addExecution(new EmojiExecution(this.player, player.id(), emoji)); } - // Prevent attacking of humans on lower difficulties + // Prevent attacking of humans on lower difficulties (or if we are a bot) private shouldAttack(other: Player | TerraNullius): boolean { // Always attack Terra Nullius, non-humans and traitors if ( other.isPlayer() === false || other.type() !== PlayerType.Human || - other.isTraitor() + other.isTraitor() || + this.player.type() === PlayerType.Bot ) { return true; } @@ -374,7 +375,6 @@ export class BotBehavior { } // 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; @@ -383,7 +383,7 @@ export class BotBehavior { neighbor.type() === PlayerType.FakeHuman || neighbor.type() === PlayerType.Human ) { - if (this.random.chance(2) || difficulty === Difficulty.Easy) { + if (this.random.chance(2)) { continue; } }