Skip to content

Commit

Permalink
Fix typo in "nerfed"
Browse files Browse the repository at this point in the history
  • Loading branch information
gereon77 committed Jun 15, 2024
1 parent e676792 commit e294f5d
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 18 deletions.
12 changes: 6 additions & 6 deletions agot-bg-game-server/src/client/GameLogListComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ export default class GameLogListComponent extends Component<GameLogListComponent
});
}

createNervedHouseCards(): [string, HouseCard][] {
const balonNerved = createHouseCard("balon-greyjoy-nerved", { name: "Balon Greyjoy", combatStrength: 2, ability: "jaqen-h-ghar" }, "greyjoy");
const aeronDwdNerved = createHouseCard("aeron-damphair-dwd-nerved", { name: "Aeron Damphair", ability: "aeron-damphair" }, "greyjoy");
createNerfedHouseCards(): [string, HouseCard][] {
const balonNerfed = createHouseCard("balon-greyjoy-nerfed", { name: "Balon Greyjoy", combatStrength: 2, ability: "jaqen-h-ghar" }, "greyjoy");
const aeronDwdNerfed = createHouseCard("aeron-damphair-dwd-nerfed", { name: "Aeron Damphair", ability: "quentyn-martell" }, "greyjoy");

return [
[balonNerved.id, balonNerved],
[aeronDwdNerved.id, aeronDwdNerved]
[balonNerfed.id, balonNerfed],
[aeronDwdNerfed.id, aeronDwdNerfed]
];
}

Expand All @@ -116,7 +116,7 @@ export default class GameLogListComponent extends Component<GameLogListComponent
this.createHouseCards(modBHouseCardsData),
this.createHouseCards(asosHouseCardsData),
this.game.vassalHouseCards.entries,
this.createNervedHouseCards());
this.createNerfedHouseCards());
}

render(): ReactNode {
Expand Down
8 changes: 4 additions & 4 deletions agot-bg-game-server/src/client/houseCardImages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import aeroImage from "../../public/images/house-cards/Areo.png";
import arianneImage from "../../public/images/house-cards/Arianne.png";
import ashaImage from "../../public/images/house-cards/Asha.png";
import balonImage from "../../public/images/house-cards/Balon.png";
import balonNervedImage from "../../public/images/house-cards/Balon-nerved.png";
import balonNerfedImage from "../../public/images/house-cards/Balon-nerfed.png";
import blackfishImage from "../../public/images/house-cards/Blackfish.png";
import brienneImage from "../../public/images/house-cards/Brienne.png";
import catelynImage from "../../public/images/house-cards/Catelyn.png";
Expand Down Expand Up @@ -48,7 +48,7 @@ import melisandreDwDImage from "../../public/images/house-cards/Melisandre_DwD.p
import jonSnow from "../../public/images/house-cards/JonSnow.png";
import stannisDwDImage from "../../public/images/house-cards/StannisBaratheonDwD.png";
import aeronDwDImage from "../../public/images/house-cards/AeronDamphairDwD.png";
import aeronDwDNervedImage from "../../public/images/house-cards/AeronDamphairDwD-nerved.png";
import aeronDwDNerfedImage from "../../public/images/house-cards/AeronDamphairDwD-nerfed.png";
import qarlTheMaidImage from "../../public/images/house-cards/QarlTheMaid.png";
import rodrikTheReaderImage from "../../public/images/house-cards/RodrikTheReader.png";
import euronDwDImage from "../../public/images/house-cards/EuronCrowsEye.png";
Expand Down Expand Up @@ -175,7 +175,7 @@ const houseCardImages = new BetterMap([
["areo-hotah", aeroImage],
["asha-greyjoy", ashaImage],
["balon-greyjoy", balonImage],
["balon-greyjoy-nerved", balonNervedImage],
["balon-greyjoy-nerfed", balonNerfedImage],
["the-blackfish", blackfishImage],
["brienne-of-tarth", brienneImage],
["catelyn-stark", catelynImage],
Expand Down Expand Up @@ -217,7 +217,7 @@ const houseCardImages = new BetterMap([
["jon-snow", jonSnow],
["stannis-baratheon-dwd", stannisDwDImage],
["aeron-damphair-dwd", aeronDwDImage],
["aeron-damphair-dwd-nerved", aeronDwDNervedImage],
["aeron-damphair-dwd-nerfed", aeronDwDNerfedImage],
["qarl-the-maid", qarlTheMaidImage],
["rodrik-the-reader", rodrikTheReaderImage],
["euron-crows-eye-dwd", euronDwDImage],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,8 @@ export function applyChangesForDragonWar(ingame: IngameGameState): void {

ensureDragonStrengthTokensArePresent(ingame);

nervHouseCard(game, "balon-greyjoy", "jaqen-h-ghar");
nervHouseCard(game, "aeron-damphair-dwd", "quentyn-martell");
nerfHouseCard(game, "balon-greyjoy", "jaqen-h-ghar");
nerfHouseCard(game, "aeron-damphair-dwd", "quentyn-martell");

game.world.regions.values.filter(r => 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);
Expand All @@ -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);
}
}
}
6 changes: 6 additions & 0 deletions agot-bg-game-server/src/server/serializedGameMigrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e294f5d

Please sign in to comment.