From b46d9d068c136dff17d842188184516e5f6252e4 Mon Sep 17 00:00:00 2001 From: gereon77 Date: Mon, 23 Oct 2023 15:06:36 +0200 Subject: [PATCH] Make loyalty tokens visible to Targaryen --- .../src/common/ingame-game-state/IngameGameState.ts | 2 +- .../common/ingame-game-state/game-data-structure/Region.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/agot-bg-game-server/src/common/ingame-game-state/IngameGameState.ts b/agot-bg-game-server/src/common/ingame-game-state/IngameGameState.ts index 0861e94f4..3a2288c3a 100644 --- a/agot-bg-game-server/src/common/ingame-game-state/IngameGameState.ts +++ b/agot-bg-game-server/src/common/ingame-game-state/IngameGameState.ts @@ -1725,7 +1725,7 @@ export default class IngameGameState extends GameState< this.entireGame.sendMessageToClients([p.user], { type: "update-visible-regions", playerUserId: p.user.id, - regionsToMakeVisible: makeVisible.map(r => r.serializeToClient(true, null)), + regionsToMakeVisible: makeVisible.map(r => r.serializeToClient(true, p)), regionsToHide: toHide.map(r => r.id), ordersToMakeVisible: makeVisible.filter(r => this.ordersOnBoard.has(r)).map(r => [r.id, this.ordersOnBoard.get(r).id]) }); diff --git a/agot-bg-game-server/src/common/ingame-game-state/game-data-structure/Region.ts b/agot-bg-game-server/src/common/ingame-game-state/game-data-structure/Region.ts index 64c7ff765..9687c5656 100644 --- a/agot-bg-game-server/src/common/ingame-game-state/game-data-structure/Region.ts +++ b/agot-bg-game-server/src/common/ingame-game-state/game-data-structure/Region.ts @@ -194,6 +194,8 @@ export default class Region { || this.game.ingame.publicVisibleRegions.includes(this) || this.game.ingame.getVisibleRegionsForPlayer(player).includes(this); + const playerControlsTargaryen = this.game.targaryen != null && player != null && player.house == this.game.targaryen; + return { id: this.id, units: visible ? this.units.values.map(u => u.serializeToClient()) : [], @@ -203,7 +205,7 @@ export default class Region { ? this.controlPowerToken.id : null : null, - loyaltyTokens: visible ? this.loyaltyTokens : 0, + loyaltyTokens: visible || playerControlsTargaryen ? this.loyaltyTokens : 0, castleModifier: visible ? this.castleModifier : 0, barrelModifier: visible ? this.barrelModifier : 0, crownModifier: visible ? this.crownModifier : 0,