From e294f5d06d655d4348114bf136719ba9e45f92f2 Mon Sep 17 00:00:00 2001 From: gereon77 Date: Sat, 15 Jun 2024 23:29:18 +0200 Subject: [PATCH] Fix typo in "nerfed" --- ...wD-nerved.png => AeronDamphairDwD-nerfed.png} | Bin .../{Balon-nerved.png => Balon-nerfed.png} | Bin .../src/client/GameLogListComponent.tsx | 12 ++++++------ .../src/client/houseCardImages.ts | 8 ++++---- .../game-data-structure/createGame.ts | 15 +++++++-------- .../src/server/serializedGameMigrations.ts | 6 ++++++ 6 files changed, 23 insertions(+), 18 deletions(-) rename agot-bg-game-server/public/images/house-cards/{AeronDamphairDwD-nerved.png => AeronDamphairDwD-nerfed.png} (100%) rename agot-bg-game-server/public/images/house-cards/{Balon-nerved.png => Balon-nerfed.png} (100%) diff --git a/agot-bg-game-server/public/images/house-cards/AeronDamphairDwD-nerved.png b/agot-bg-game-server/public/images/house-cards/AeronDamphairDwD-nerfed.png similarity index 100% rename from agot-bg-game-server/public/images/house-cards/AeronDamphairDwD-nerved.png rename to agot-bg-game-server/public/images/house-cards/AeronDamphairDwD-nerfed.png diff --git a/agot-bg-game-server/public/images/house-cards/Balon-nerved.png b/agot-bg-game-server/public/images/house-cards/Balon-nerfed.png similarity index 100% rename from agot-bg-game-server/public/images/house-cards/Balon-nerved.png rename to agot-bg-game-server/public/images/house-cards/Balon-nerfed.png diff --git a/agot-bg-game-server/src/client/GameLogListComponent.tsx b/agot-bg-game-server/src/client/GameLogListComponent.tsx index 87cc677ee..f7673e744 100644 --- a/agot-bg-game-server/src/client/GameLogListComponent.tsx +++ b/agot-bg-game-server/src/client/GameLogListComponent.tsx @@ -98,13 +98,13 @@ export default class GameLogListComponent extends Component r.superControlPowerToken != null && r.garrison == 4).forEach(r => r.garrison = 6); game.world.regions.values.filter(r => r.superControlPowerToken != null && r.garrison == 2).forEach(r => r.garrison = 4); @@ -647,25 +647,24 @@ function findUnitToReplace(ingame: IngameGameState, house: House, unitType: stri : pickRandom(ingame.world.getUnitsOfHouse(house).filter(u => u.type.id == unitType)); } -function nervHouseCard(game: Game, hcId: string, newAbilityId: string): void { +function nerfHouseCard(game: Game, hcId: string, newAbilityId: string): void { const houseCard = game.draftableHouseCards.has(hcId) ? game.draftableHouseCards.get(hcId) : _.flatMap(game.houses.values.map(h => h.houseCards.values)).find(hc => hc.id == hcId); if (houseCard) { - const originalId = houseCard.id; - houseCard.id = hcId + "-nerved"; + houseCard.id = hcId + "-nerfed"; houseCard.ability = houseCardAbilities.get(newAbilityId); - const house = game.houses.values.find(h => h.houseCards.has(originalId)); + const house = game.houses.values.find(h => h.houseCards.has(hcId)); if (house) { - house.houseCards.delete(originalId); + house.houseCards.delete(hcId); house.houseCards.set(houseCard.id, houseCard); } if (game.draftableHouseCards.has(hcId)) { game.draftableHouseCards.delete(hcId); - game.draftableHouseCards.set(hcId + "-nerved", houseCard); + game.draftableHouseCards.set(houseCard.id, houseCard); } } } \ No newline at end of file diff --git a/agot-bg-game-server/src/server/serializedGameMigrations.ts b/agot-bg-game-server/src/server/serializedGameMigrations.ts index 446a22646..f1a1f154d 100644 --- a/agot-bg-game-server/src/server/serializedGameMigrations.ts +++ b/agot-bg-game-server/src/server/serializedGameMigrations.ts @@ -2271,6 +2271,12 @@ const serializedGameMigrations: {version: string; migrate: (serializeGamed: any) if (aeronDwdNerfed) { aeronDwdNerfed[1].abilityId = "quentyn-martell"; } + + // Fix typo in nerved: + houseCards.filter(([id, _shc]: any) => id.endsWith("-nerved")).forEach((item: any) => { + item[0] = item[0].replace("-nerved", "-nerfed"); + item[1].id = item[0]; + }); } return serializedGame; }