mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-30 12:42:12 +00:00
Nations send emoji when declining assistance requests (#1911)
## Description: Nations will now send emoji when declining assistance requests. ## 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
This commit is contained in:
committed by
evanpelle
parent
81bd98c8d6
commit
8308d7f1e7
@@ -13,33 +13,17 @@ import { AllianceExtensionExecution } from "../alliance/AllianceExtensionExecuti
|
||||
import { AttackExecution } from "../AttackExecution";
|
||||
import { EmojiExecution } from "../EmojiExecution";
|
||||
|
||||
const emojiId = (e: typeof flattenedEmojiTable[number]) => flattenedEmojiTable.indexOf(e);
|
||||
const EMOJI_ASSIST_ACCEPT = ([
|
||||
"👍",
|
||||
"⛵",
|
||||
"🤝",
|
||||
"🎯",
|
||||
] as const).map(emojiId);
|
||||
const EMOJI_RELATION_TOO_LOW = ([
|
||||
"🥱",
|
||||
"🤦♂️",
|
||||
] as const).map(emojiId);
|
||||
const EMOJI_TARGET_ME = ([
|
||||
"🥺",
|
||||
"💀",
|
||||
] as const).map(emojiId);
|
||||
const EMOJI_TARGET_ALLY = ([
|
||||
"🕊️",
|
||||
"👎",
|
||||
] as const).map(emojiId);
|
||||
export const EMOJI_HECKLE = ([
|
||||
"🤡",
|
||||
"😡",
|
||||
] as const).map(emojiId);
|
||||
const emojiId = (e: (typeof flattenedEmojiTable)[number]) =>
|
||||
flattenedEmojiTable.indexOf(e);
|
||||
const EMOJI_ASSIST_ACCEPT = (["👍", "⛵", "🤝", "🎯"] as const).map(emojiId);
|
||||
const EMOJI_RELATION_TOO_LOW = (["🥱", "🤦♂️"] as const).map(emojiId);
|
||||
const EMOJI_TARGET_ME = (["🥺", "💀"] as const).map(emojiId);
|
||||
const EMOJI_TARGET_ALLY = (["🕊️", "👎"] as const).map(emojiId);
|
||||
export const EMOJI_HECKLE = (["🤡", "😡"] as const).map(emojiId);
|
||||
|
||||
export class BotBehavior {
|
||||
private enemy: Player | null = null;
|
||||
private enemyUpdated: Tick;
|
||||
private enemyUpdated: Tick | undefined;
|
||||
|
||||
constructor(
|
||||
private random: PseudoRandom,
|
||||
@@ -98,7 +82,7 @@ export class BotBehavior {
|
||||
|
||||
forgetOldEnemies() {
|
||||
// Forget old enemies
|
||||
if (this.game.ticks() - this.enemyUpdated > 100) {
|
||||
if (this.game.ticks() - (this.enemyUpdated ?? 0) > 100) {
|
||||
this.clearEnemy();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user