diff --git a/agot-bg-game-server/src/client/EntireGameComponent.tsx b/agot-bg-game-server/src/client/EntireGameComponent.tsx index a1f5ed7e8..e97ea402f 100644 --- a/agot-bg-game-server/src/client/EntireGameComponent.tsx +++ b/agot-bg-game-server/src/client/EntireGameComponent.tsx @@ -274,13 +274,13 @@ export default class EntireGameComponent extends Component {this.settings.dragonWar && <>

-

Dragon war
+
Dragon War
Balon Greyjoy and Aeron Damphair (DwD) have been nerfed!

} {this.settings.dragonRevenge && <>

-

Dragon revenge
+
Dragon Revenge
The last remaining non-dragon land unit will transform into a dragon!

} diff --git a/agot-bg-game-server/src/client/MapComponent.tsx b/agot-bg-game-server/src/client/MapComponent.tsx index 8880e1ba3..8bb0b506a 100644 --- a/agot-bg-game-server/src/client/MapComponent.tsx +++ b/agot-bg-game-server/src/client/MapComponent.tsx @@ -29,6 +29,7 @@ import _ from "lodash"; import PartialRecursive from "../utils/PartialRecursive"; import { land, sea } from "../common/ingame-game-state/game-data-structure/regionTypes"; import PlaceOrdersGameState from "../common/ingame-game-state/planning-game-state/place-orders-game-state/PlaceOrdersGameState"; +import PlaceOrdersForVassalsGameState from "../common/ingame-game-state/planning-game-state/place-orders-for-vassals-game-state/PlaceOrdersForVassalsGameState"; import UseRavenGameState from "../common/ingame-game-state/action-game-state/use-raven-game-state/UseRavenGameState"; import { renderRegionTooltip } from "./regionTooltip"; import getGarrisonToken from "./garrisonTokens"; @@ -377,10 +378,24 @@ export default class MapComponent extends Component { } const clickable = property.onClick != undefined; + const dragonStrength = this.ingame.game.currentDragonStrength; + + const dragonPrefix = u.type.id == "dragon" + ? dragonStrength <= -1 + ? <> + : dragonStrength <= 1 + ? <>Baby + : dragonStrength <= 3 + ? <> + : dragonStrength <= 5 + ? <>Monster + : <> + : <> + ; return -
{u.type.name} of {controller?.name ?? "Unknown"}
{r.name}
+
{dragonPrefix}{u.type.name} of {controller?.name ?? "Unknown"}
{r.name}
} key={`map-unit-_${controller?.id ?? "must-be-controlled"}_${u.id}`} delay={{ show: 500, hide: 100 }} @@ -405,7 +420,7 @@ export default class MapComponent extends Component { "pulsate-bck_fade-in": property.animateFadeIn, "pulsate-bck_fade-out": property.animateFadeOut, }, - getClassNameForDragonStrength(u.type.id, this.ingame.game.currentDragonStrength) + getClassNameForDragonStrength(u.type.id, dragonStrength) )} style={{ backgroundImage: `url(${unitImages.get(u.allegiance.id).get(u.upgradedType ? u.upgradedType.id : u.type.id)})`, @@ -597,7 +612,7 @@ export default class MapComponent extends Component { } const drawBorder = order?.type.restrictedTo == sea.kind; - const hasPlaceOrders = this.ingame.hasChildGameState(PlaceOrdersGameState); + const hasPlaceOrders = this.ingame.hasChildGameState(PlaceOrdersGameState) || this.ingame.hasChildGameState(PlaceOrdersForVassalsGameState); const controller = drawBorder || hasPlaceOrders ? region.getController() : null; const color = drawBorder && controller ? controller.id != "greyjoy" diff --git a/agot-bg-game-server/src/common/ingame-game-state/vote-system/Vote.ts b/agot-bg-game-server/src/common/ingame-game-state/vote-system/Vote.ts index 04f0d6602..4f5d0c361 100644 --- a/agot-bg-game-server/src/common/ingame-game-state/vote-system/Vote.ts +++ b/agot-bg-game-server/src/common/ingame-game-state/vote-system/Vote.ts @@ -9,7 +9,7 @@ import CombatGameState from "../action-game-state/resolve-march-order-game-state import ClaimVassalsGameState from "../planning-game-state/claim-vassals-game-state/ClaimVassalsGameState"; import { getTimeDeltaInSeconds } from "../../../utils/getElapsedSeconds"; import BiddingGameState from "../westeros-game-state/bidding-game-state/BiddingGameState"; -import PlaceOrdersGameState from "../planning-game-state/place-orders-game-state/PlaceOrdersGameState"; +import PlanningGameState from "../planning-game-state/PlanningGameState"; export enum VoteState { ONGOING, @@ -79,9 +79,9 @@ export default class Vote { } const swapHousesVoteType = this.type; - if (this.ingame.hasChildGameState(PlaceOrdersGameState)) { - const placeOrders = this.ingame.getChildGameState(PlaceOrdersGameState) as PlaceOrdersGameState; - if (placeOrders.placedOrders.keys.some(r => { + if (this.ingame.hasChildGameState(PlanningGameState)) { + const planning = this.ingame.getChildGameState(PlanningGameState) as PlanningGameState; + if (planning.placedOrders.keys.some(r => { const controller = r.getController(); return controller == swapHousesVoteType.initiatorHouse || controller == swapHousesVoteType.swappingHouse}) ) { diff --git a/agot-bg-game-server/src/common/ingame-game-state/vote-system/VoteType.ts b/agot-bg-game-server/src/common/ingame-game-state/vote-system/VoteType.ts index 800d2ba3f..34e5921f1 100644 --- a/agot-bg-game-server/src/common/ingame-game-state/vote-system/VoteType.ts +++ b/agot-bg-game-server/src/common/ingame-game-state/vote-system/VoteType.ts @@ -11,6 +11,8 @@ import Order from "../game-data-structure/Order"; import _ from "lodash"; import GameEndedGameState from "../game-ended-game-state/GameEndedGameState"; import ChooseInitialObjectivesGameState from "../choose-initial-objectives-game-state/ChooseInitialObjectivesGameState"; +import PlanningGameState from "../planning-game-state/PlanningGameState"; +import PlaceOrdersForVassalsGameState from "../planning-game-state/place-orders-for-vassals-game-state/PlaceOrdersForVassalsGameState"; export type SerializedVoteType = SerializedCancelGame | SerializedEndGame | SerializedReplacePlayer | SerializedReplacePlayerByVassal | SerializedReplaceVassalByPlayer @@ -266,9 +268,9 @@ export class CancelGame extends VoteType { ingame.resumeGame(true); } - if (ingame.hasChildGameState(PlaceOrdersGameState)) { - const placeOrders = vote.ingame.getChildGameState(PlaceOrdersGameState) as PlaceOrdersGameState; - ingame.ordersOnBoard = placeOrders.placedOrders as BetterMap; + if (ingame.hasChildGameState(PlanningGameState)) { + const planning = vote.ingame.getChildGameState(PlanningGameState) as PlanningGameState; + ingame.ordersOnBoard = planning.placedOrders as BetterMap; ingame.entireGame.broadcastToClients({ type: "reveal-orders", orders: vote.ingame.ordersOnBoard.mapOver(r => r.id, o => o.id) @@ -595,9 +597,10 @@ export class ReplaceVassalByPlayer extends VoteType { houseCards: vote.ingame.game.oldPlayerHouseCards.entries.map(([h, hcs]) => [h.id, hcs.values.map(hc => hc.id)]) }); - const placeOrders = vote.ingame.leafState instanceof PlaceOrdersGameState ? vote.ingame.leafState : null; - if (placeOrders) { - const planning = placeOrders.parentGameState; + const hasPlaceOrders = vote.ingame.hasChildGameState(PlanningGameState) + && (vote.ingame.hasChildGameState(PlaceOrdersGameState) || vote.ingame.hasChildGameState(PlaceOrdersForVassalsGameState)); + if (hasPlaceOrders) { + const planning = vote.ingame.getChildGameState(PlanningGameState) as PlanningGameState; // Reset waitedFor data, to properly call ingame.setWaitedForPlayers() by the game-state-change vote.ingame.resetAllWaitedForData();