mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-22 01:58:00 +00:00
The clown is gone! 🤡 Nations send much better emojis now (#2696)
## Description: Previously, nations just spammed these two rather toxic emojis: 🤡😡 They now send fewer emojis while attacking, and the clown emoji is reserved for special cases. They got the ability to send emojis in much more cases: - Human didn't donate enough for relation update - Human did donate an ok amount - Human did donate a lot - Responding to emojis that they get sent from a human - Nuke sent - MIRV sent - Retaliation warship sent - Traitor tries to ally - Threat asks for / accepts an alliance request - Disliked human tries to ally - Friendly human tries to ally - They are getting attacked by very much troops - They are getting attacked by very little troops - Congratulating the winner - Bragging with their crown - Charming their allies - Clown-Emoting traitors - Easteregg: Sending a rat emoji to very small humans ## 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 --------- Co-authored-by: iamlewis <lewismmmm@gmail.com>
This commit is contained in:
@@ -1,16 +1,14 @@
|
||||
import {
|
||||
AllPlayers,
|
||||
Execution,
|
||||
Game,
|
||||
Player,
|
||||
PlayerID,
|
||||
PlayerType,
|
||||
} from "../game/Game";
|
||||
import { AllPlayers, Execution, Game, Player, PlayerID } from "../game/Game";
|
||||
import { PseudoRandom } from "../PseudoRandom";
|
||||
import { flattenedEmojiTable } from "../Util";
|
||||
import { respondToEmoji } from "./nation/NationEmojiBehavior";
|
||||
|
||||
export class EmojiExecution implements Execution {
|
||||
private recipient: Player | typeof AllPlayers;
|
||||
|
||||
private mg: Game;
|
||||
private random: PseudoRandom;
|
||||
|
||||
private active = true;
|
||||
|
||||
constructor(
|
||||
@@ -20,6 +18,9 @@ export class EmojiExecution implements Execution {
|
||||
) {}
|
||||
|
||||
init(mg: Game, ticks: number): void {
|
||||
this.mg = mg;
|
||||
this.random = new PseudoRandom(mg.ticks());
|
||||
|
||||
if (this.recipientID !== AllPlayers && !mg.hasPlayer(this.recipientID)) {
|
||||
console.warn(`EmojiExecution: recipient ${this.recipientID} not found`);
|
||||
this.active = false;
|
||||
@@ -40,13 +41,13 @@ export class EmojiExecution implements Execution {
|
||||
);
|
||||
} else if (this.requestor.canSendEmoji(this.recipient)) {
|
||||
this.requestor.sendEmoji(this.recipient, emojiString);
|
||||
if (
|
||||
emojiString === "🖕" &&
|
||||
this.recipient !== AllPlayers &&
|
||||
this.recipient.type() === PlayerType.Nation
|
||||
) {
|
||||
this.recipient.updateRelation(this.requestor, -100);
|
||||
}
|
||||
respondToEmoji(
|
||||
this.mg,
|
||||
this.random,
|
||||
this.requestor,
|
||||
this.recipient,
|
||||
emojiString,
|
||||
);
|
||||
} else {
|
||||
console.warn(
|
||||
`cannot send emoji from ${this.requestor} to ${this.recipient}`,
|
||||
|
||||
Reference in New Issue
Block a user