diff --git a/resources/lang/en.json b/resources/lang/en.json index 390baf730..4add1cf6f 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -402,6 +402,7 @@ "player_panel": { "gold": "Gold", "troops": "Troops", + "betrayals": "Number of betrayals", "traitor": "Traitor", "alliance_time_remaining": "Time Remaining", "embargo": "Stopped trading with you", diff --git a/src/client/graphics/layers/PlayerPanel.ts b/src/client/graphics/layers/PlayerPanel.ts index d9afeab4a..4e82be5bb 100644 --- a/src/client/graphics/layers/PlayerPanel.ts +++ b/src/client/graphics/layers/PlayerPanel.ts @@ -308,6 +308,16 @@ export class PlayerPanel extends LitElement implements Layer { + +
+
+ ${translateText("player_panel.betrayals")} +
+
+ ${other.data.betrayals ?? 0} +
+
+
diff --git a/src/core/game/GameUpdates.ts b/src/core/game/GameUpdates.ts index 839ca330c..1ccc20013 100644 --- a/src/core/game/GameUpdates.ts +++ b/src/core/game/GameUpdates.ts @@ -118,6 +118,7 @@ export interface PlayerUpdate { incomingAttacks: AttackUpdate[]; outgoingAllianceRequests: PlayerID[]; hasSpawned: boolean; + betrayals?: number; } export interface AllianceRequestUpdate { diff --git a/src/core/game/PlayerImpl.ts b/src/core/game/PlayerImpl.ts index d56f0f205..7295b4e80 100644 --- a/src/core/game/PlayerImpl.ts +++ b/src/core/game/PlayerImpl.ts @@ -123,6 +123,7 @@ export class PlayerImpl implements Player { const outgoingAllianceRequests = this.outgoingAllianceRequests().map((ar) => ar.recipient().id(), ); + const stats = this.mg.stats().getPlayerStats(this); return { type: GameUpdateType.Player, @@ -169,6 +170,7 @@ export class PlayerImpl implements Player { ), outgoingAllianceRequests: outgoingAllianceRequests, hasSpawned: this.hasSpawned(), + betrayals: stats?.betrayals, }; }