From 72e2d137b921808d78700210535a5523dd8c4d73 Mon Sep 17 00:00:00 2001 From: Scott Anderson <662325+scottanderson@users.noreply.github.com> Date: Thu, 28 Aug 2025 03:22:46 -0400 Subject: [PATCH] cleanup: Nations rarely launch nukes (#1948) ## Description: In #1860, some unused code was left behind. Remove the unused code. ## 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 --- src/core/execution/FakeHumanExecution.ts | 38 ------------------------ 1 file changed, 38 deletions(-) diff --git a/src/core/execution/FakeHumanExecution.ts b/src/core/execution/FakeHumanExecution.ts index dea580dc1..0530fb4e1 100644 --- a/src/core/execution/FakeHumanExecution.ts +++ b/src/core/execution/FakeHumanExecution.ts @@ -1,7 +1,6 @@ import { BotBehavior, EMOJI_HECKLE } from "./utils/BotBehavior"; import { Cell, - Difficulty, Execution, Game, Gold, @@ -221,43 +220,6 @@ export class FakeHumanExecution implements Execution { } } - private shouldAttack(other: Player): boolean { - if (this.player === null) throw new Error("Not initialized"); - if (this.player.isOnSameTeam(other)) { - return false; - } - if (this.player.isFriendly(other)) { - if (this.shouldDiscourageAttack(other)) { - return this.random.chance(200); - } - return this.random.chance(50); - } else { - if (this.shouldDiscourageAttack(other)) { - return this.random.chance(4); - } - return true; - } - } - - private shouldDiscourageAttack(other: Player) { - if (other.isTraitor()) { - return false; - } - if (this.mg === undefined) throw new Error("Not initialized"); - const { difficulty } = this.mg.config().gameConfig(); - if ( - difficulty === Difficulty.Hard || - difficulty === Difficulty.Impossible - ) { - return false; - } - if (other.type() !== PlayerType.Human) { - return false; - } - // Only discourage attacks on Humans who are not traitors on easy or medium difficulty. - return true; - } - private maybeSendEmoji(enemy: Player) { if (this.player === null) throw new Error("Not initialized"); if (enemy.type() !== PlayerType.Human) return;