diff --git a/src/core/execution/DonateGoldExecution.ts b/src/core/execution/DonateGoldExecution.ts index da292be9f..623fe6f90 100644 --- a/src/core/execution/DonateGoldExecution.ts +++ b/src/core/execution/DonateGoldExecution.ts @@ -5,6 +5,7 @@ import { Gold, Player, PlayerID, + PlayerType, } from "../game/Game"; import { PseudoRandom } from "../PseudoRandom"; import { assertNever, toInt } from "../Util"; @@ -60,21 +61,24 @@ export class DonateGoldExecution implements Execution { this.recipient.updateRelation(this.sender, relationUpdate); } - // Select emoji based on donation value - const emoji = - relationUpdate >= 50 - ? EMOJI_LOVE - : relationUpdate > 0 - ? EMOJI_DONATION_OK - : EMOJI_DONATION_TOO_SMALL; + // Only AI nations auto-respond with emojis, human players should not + if (this.recipient.type() === PlayerType.Nation) { + // Select emoji based on donation value + const emoji = + relationUpdate >= 50 + ? EMOJI_LOVE + : relationUpdate > 0 + ? EMOJI_DONATION_OK + : EMOJI_DONATION_TOO_SMALL; - this.mg.addExecution( - new EmojiExecution( - this.recipient, - this.sender.id(), - this.random.randElement(emoji), - ), - ); + this.mg.addExecution( + new EmojiExecution( + this.recipient, + this.sender.id(), + this.random.randElement(emoji), + ), + ); + } } else { console.warn( `cannot send gold from ${this.sender.name()} to ${this.recipient.name()}`, diff --git a/src/core/execution/DonateTroopExecution.ts b/src/core/execution/DonateTroopExecution.ts index d91313079..54992a2c3 100644 --- a/src/core/execution/DonateTroopExecution.ts +++ b/src/core/execution/DonateTroopExecution.ts @@ -1,4 +1,11 @@ -import { Difficulty, Execution, Game, Player, PlayerID } from "../game/Game"; +import { + Difficulty, + Execution, + Game, + Player, + PlayerID, + PlayerType, +} from "../game/Game"; import { PseudoRandom } from "../PseudoRandom"; import { assertNever } from "../Util"; import { EmojiExecution } from "./EmojiExecution"; @@ -54,15 +61,18 @@ export class DonateTroopsExecution implements Execution { this.recipient.updateRelation(this.sender, 50); } - this.mg.addExecution( - new EmojiExecution( - this.recipient, - this.sender.id(), - this.random.randElement( - this.troops >= minTroops ? EMOJI_LOVE : EMOJI_DONATION_TOO_SMALL, + // Only AI nations auto-respond with emojis, human players should not + if (this.recipient.type() === PlayerType.Nation) { + this.mg.addExecution( + new EmojiExecution( + this.recipient, + this.sender.id(), + this.random.randElement( + this.troops >= minTroops ? EMOJI_LOVE : EMOJI_DONATION_TOO_SMALL, + ), ), - ), - ); + ); + } } else { console.warn( `cannot send troops from ${this.sender} to ${this.recipient}`,