Skip to content

Commit

Permalink
Merge pull request #1835 from gereon77/add-custom-dragon-mode
Browse files Browse the repository at this point in the history
Add custom mode: Dragon war!
  • Loading branch information
gereon77 authored Jun 12, 2024
2 parents 1bb5c5d + a61ac9e commit 5812195
Show file tree
Hide file tree
Showing 38 changed files with 492 additions and 247 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 27 additions & 1 deletion agot-bg-game-server/src/client/EntireGameComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,33 @@ export default class EntireGameComponent extends Component<EntireGameComponentPr
<h4><Badge variant="primary"><FontAwesomeIcon icon={faTriangleExclamation} /></Badge></h4>
</OverlayTrigger>
</Col>}
{this.props.entireGame.gameSettings.fogOfWar &&
{(this.settings.dragonWar || this.settings.dragonRevenge) &&
<Col xs="auto">
<OverlayTrigger
placement="auto"
overlay={
<Tooltip id="dragon-mode-tooltip" className="tooltip-w-100">
<div className="text-center">
{this.settings.dragonWar && <>
<p>
<h6>Dragon war</h6>
<small>Balon Greyjoy and Aeron Damphair (DwD) have been nerfed!</small>
</p>
</>}
{this.settings.dragonRevenge && <>
<p>
<h6>Dragon revenge</h6>
<small>The last remaining non-dragon land unit will transform into a dragon!</small>
</p>
</>}
</div>
</Tooltip>}
popperConfig={{ modifiers: [preventOverflow] }}
>
<h4><Badge variant="primary">🐉</Badge></h4>
</OverlayTrigger>
</Col>}
{this.settings.fogOfWar &&
<Col xs="auto">
<h4><Badge variant="warning">BETA</Badge></h4>
</Col>}
Expand Down
27 changes: 24 additions & 3 deletions agot-bg-game-server/src/client/GameLogListComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import orders from "../common/ingame-game-state/game-data-structure/orders";
import CombatInfoComponent from "./CombatInfoComponent";
import { OverlayTrigger, Tooltip } from "react-bootstrap";
import User from "../server/User";
import { baseHouseCardsData, adwdHouseCardsData, ffcHouseCardsData, modBHouseCardsData , HouseCardData, asosHouseCardsData } from "../common/ingame-game-state/game-data-structure/createGame";
import { baseHouseCardsData, adwdHouseCardsData, ffcHouseCardsData, modBHouseCardsData , HouseCardData, asosHouseCardsData, createHouseCard } from "../common/ingame-game-state/game-data-structure/createGame";
import HouseCard from "../common/ingame-game-state/game-data-structure/house-card/HouseCard";
import houseCardAbilities from "../common/ingame-game-state/game-data-structure/house-card/houseCardAbilities";
import BetterMap from "../utils/BetterMap";
Expand Down Expand Up @@ -97,14 +97,25 @@ 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");

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

getAllHouseCards(): [string, HouseCard][] {
return _.concat(
this.createHouseCards(baseHouseCardsData),
this.createHouseCards(adwdHouseCardsData),
this.createHouseCards(ffcHouseCardsData),
this.createHouseCards(modBHouseCardsData),
this.createHouseCards(asosHouseCardsData),
this.game.vassalHouseCards.entries);
this.game.vassalHouseCards.entries,
this.createNervedHouseCards());
}

render(): ReactNode {
Expand Down Expand Up @@ -1432,9 +1443,10 @@ export default class GameLogListComponent extends Component<GameLogListComponent
const house = this.game.houses.get(data.house);
const affectedHouse = this.game.houses.get(data.affectedHouse);
const newHouseCard = this.allHouseCards.get(data.newHouseCard);
const usedByHouseCard = this.allHouseCards.get(data.usedById);

return <p>
<b>Jaqen H&apos;ghar</b>: House <b>{house.name}</b> randomly chose <b>{newHouseCard.name}</b> as <b>
<b>{usedByHouseCard.name}</b>: House <b>{house.name}</b> randomly chose <b>{newHouseCard.name}</b> as <b>
{affectedHouse.name}&apos;s</b> new House card.
</p>;
}
Expand Down Expand Up @@ -2060,6 +2072,15 @@ export default class GameLogListComponent extends Component<GameLogListComponent
There was no further loyalty token available that could have been placed in <b>{this.fogOfWar ? fogOfWarPlaceholder : region.name}</b>.
</p>;
}
case "last-land-unit-transformed-to-dragon": {
const house = this.game.houses.get(data.house);
const unitType = unitTypes.get(data.transformedUnitType);
const region = this.world.regions.get(data.region);

return <>
<b>Dragon revenge</b>: The last <b>{unitType.name}</b> of House <b>{house.name}</b> has been transformed into a <b>Dragon</b> in <b>{region.name}</b>.
</>;
}
}
}

Expand Down
31 changes: 31 additions & 0 deletions agot-bg-game-server/src/client/GameSettingsComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,37 @@ export default class GameSettingsComponent extends Component<GameSettingsCompone
onChange={() => this.changeGameSettings(() => this.gameSettings.limitedDraft = !this.gameSettings.limitedDraft)}
/>
</Col>
<Col xs="12">
<FormCheck
id="dragon-war-setting"
type="switch"
label={
<OverlayTrigger overlay={
<Tooltip id="dragon-war-tooltip">
All houses, except Targaryen, will replace their starting knight by a dragon. <small><i>
(Inspired by LordWazza)</i></small>
</Tooltip>}>
<label htmlFor="dragon-war-setting">Dragon war</label>
</OverlayTrigger>}
checked={this.gameSettings.dragonWar}
onChange={() => this.changeGameSettings(() => this.gameSettings.dragonWar = !this.gameSettings.dragonWar)}
/>
</Col>
<Col xs="12">
<FormCheck
id="dragon-revenge-setting"
type="switch"
label={
<OverlayTrigger overlay={
<Tooltip id="dragon-revenge-tooltip">
If a player has only one remaining non-dragon land unit and no more castles, it will turn into a dragon.
</Tooltip>}>
<label htmlFor="dragon-revenge-setting">Dragon revenge</label>
</OverlayTrigger>}
checked={this.gameSettings.dragonRevenge}
onChange={() => this.changeGameSettings(() => this.gameSettings.dragonRevenge = !this.gameSettings.dragonRevenge)}
/>
</Col>
</Col>
{this.gameSettings.draftHouseCards && <Col xs="6" lg="auto" id="draft-decks-settings-col" className="no-gutters">
<Col xs="12">
Expand Down
2 changes: 1 addition & 1 deletion agot-bg-game-server/src/client/IngameComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ export default class IngameComponent extends Component<IngameComponentProps> {
</div>
</div>
</Row>
{this.gameSettings.playerCount >= 8 && <Row className="mx-0 mt-3">
{this.ingame.isDragonGame && <Row className="mx-0 mt-3">
<OverlayTrigger overlay={this.renderDragonStrengthTooltip()}
placement="auto">
<div>
Expand Down
11 changes: 5 additions & 6 deletions agot-bg-game-server/src/client/houseCardImages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +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 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 @@ -41,11 +42,13 @@ import theonImage from "../../public/images/house-cards/Theon.png";
import tyrionImage from "../../public/images/house-cards/Tyrion.png";
import tywinImage from "../../public/images/house-cards/Tywin.png";
import victarionImage from "../../public/images/house-cards/Victarion.png";

import rayderImage from "../../public/images/house-cards/Rayder.png";
import melisandreDwDImage from "../../public/images/house-cards/Melisandre_DwD.png";
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 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 All @@ -61,30 +64,24 @@ import ramsayBoltonImage from "../../public/images/house-cards/RamsayBolton.png"
import queenOfThornsDwDImage from "../../public/images/house-cards/QueenOfThorns.png";
import paxterRedwyneImage from "../../public/images/house-cards/PaxterRedwyne.png";
import margaeryTyrellDwDImage from "../../public/images/house-cards/MargaeryTyrell.png";

import maceTyrellDwDImage from "../../public/images/house-cards/MaceTyrell.png";
import randyllTarlyDwDImage from "../../public/images/house-cards/RandyllTarly.png";
import willasTyrellImage from "../../public/images/house-cards/WillasTyrell.png";
import serJonFossowayImage from "../../public/images/house-cards/SerJonFossoway.png";

import nymeriaSandDwDImage from "../../public/images/house-cards/NymeriaSand.png";
import areoHotahDwDImage from "../../public/images/house-cards/AreoHotah.png";
import bastardOfGodsgraceImage from "../../public/images/house-cards/BastardOfGodsgrace.png";
import bigManImage from "../../public/images/house-cards/BigMan.png";

import serHarrasHarlawImage from "../../public/images/house-cards/SerHarrasHarlaw.png";
import victarionGreyjoyDwDImage from "../../public/images/house-cards/VictarionGreyjoy.png";
import ashaGreyjoyDwDImage from "../../public/images/house-cards/AshaGreyjoy.png";

import bastardOfNightsongImage from "../../public/images/house-cards/BastardOfNightsong.png";
import serDavosSeaworthDwDImage from "../../public/images/house-cards/SerDavosSeaworth.png";
import serAxellFlorentImage from "../../public/images/house-cards/SerAxellFlorent.png";

import blackWalderImage from "../../public/images/house-cards/BlackWalder.png";
import steelshanksWaltonImage from "../../public/images/house-cards/SteelshanksWalton.png";
import damonDanceForMeImage from "../../public/images/house-cards/DamonDanceForMe.png";
import rooseBoltonDwDImage from "../../public/images/house-cards/RooseBolton.png";

import cerseiLannisterDwDImage from "../../public/images/house-cards/CerseiLannister.png";
import serJaimeLannisterDwDImage from "../../public/images/house-cards/SerJaimeLannister.png";
import serKevanLannisterDwDImage from "../../public/images/house-cards/SerKevanLannister.png";
Expand Down Expand Up @@ -178,6 +175,7 @@ const houseCardImages = new BetterMap([
["areo-hotah", aeroImage],
["asha-greyjoy", ashaImage],
["balon-greyjoy", balonImage],
["balon-greyjoy-nerved", balonNervedImage],
["the-blackfish", blackfishImage],
["brienne-of-tarth", brienneImage],
["catelyn-stark", catelynImage],
Expand Down Expand Up @@ -219,6 +217,7 @@ const houseCardImages = new BetterMap([
["jon-snow", jonSnow],
["stannis-baratheon-dwd", stannisDwDImage],
["aeron-damphair-dwd", aeronDwDImage],
["aeron-damphair-dwd-nerved", aeronDwDNervedImage],
["qarl-the-maid", qarlTheMaidImage],
["rodrik-the-reader", rodrikTheReaderImage],
["euron-crows-eye-dwd", euronDwDImage],
Expand Down
96 changes: 56 additions & 40 deletions agot-bg-game-server/src/client/unitImages.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import BetterMap from "../utils/BetterMap";
import {dragon, footman, knight, ship, siegeEngine} from "../common/ingame-game-state/game-data-structure/unitTypes";
import barathFoot from "../../public/images/units/BarathFoot.png";
import barathKnight from "../../public/images/units/BarathKnight.png";
import barathSiege from "../../public/images/units/BarathSeige.png";
import barathShip from "../../public/images/units/BarathShip.png";
import boltonFoot from "../../public/images/units/BoltonFoot.png";
import boltonKnight from "../../public/images/units/BoltonKnight.png";
import boltonSiege from "../../public/images/units/BoltonSiege.png";
import boltonShip from "../../public/images/units/BoltonShip.png";
import lanFoot from "../../public/images/units/LanFoot.png";
import lanKnight from "../../public/images/units/LanKnight.png";
import lanSiege from "../../public/images/units/LanSeige.png";
import lanShip from "../../public/images/units/LanShip.png";
import baraFoot from "../../public/images/units/BarathFoot.png";
import baraKnight from "../../public/images/units/BarathKnight.png";
import baraSiege from "../../public/images/units/BarathSeige.png";
import baraShip from "../../public/images/units/BarathShip.png";
import boltFoot from "../../public/images/units/BoltonFoot.png";
import boltKnight from "../../public/images/units/BoltonKnight.png";
import boltSiege from "../../public/images/units/BoltonSiege.png";
import boltShip from "../../public/images/units/BoltonShip.png";
import lannFoot from "../../public/images/units/LanFoot.png";
import lannKnight from "../../public/images/units/LanKnight.png";
import lannSiege from "../../public/images/units/LanSeige.png";
import lannShip from "../../public/images/units/LanShip.png";
import starFoot from "../../public/images/units/StarFoot.png";
import starKnight from "../../public/images/units/StarKnight.png";
import starSiege from "../../public/images/units/StarSeige.png";
Expand All @@ -28,70 +28,86 @@ import tyrFoot from "../../public/images/units/TyrFoot.png";
import tyrKnight from "../../public/images/units/TyrKnight.png";
import tyrSiege from "../../public/images/units/TyrSeige.png";
import tyrShip from "../../public/images/units/TyrShip.png";
import arrynFoot from "../../public/images/units/ArrynFoot.png"
import arrynKnight from "../../public/images/units/ArrynKnight.png";
import arrynSiege from "../../public/images/units/ArrynSiege.png";
import arrynShip from "../../public/images/units/ArrynShip.png";
import targaryenShip from "../../public/images/units/TargShip.png";
import targaryenFoot from "../../public/images/units/TargFoot.png";
import arrFoot from "../../public/images/units/ArrynFoot.png"
import arrKnight from "../../public/images/units/ArrynKnight.png";
import arrSiege from "../../public/images/units/ArrynSiege.png";
import arrShip from "../../public/images/units/ArrynShip.png";
import targShip from "../../public/images/units/TargShip.png";
import targFoot from "../../public/images/units/TargFoot.png";
import targKnight from "../../public/images/units/TargKnight.png";
import targDragon from "../../public/images/units/TargDragon.png";
import baraDragon from "../../public/images/units/BaraDragon.png";
import lannDragon from "../../public/images/units/LannDragon.png";
import starDragon from "../../public/images/units/StarDragon.png";
import boltDragon from "../../public/images/units/BoltDragon.png";
import greyDragon from "../../public/images/units/GreyDragon.png";
import martDragon from "../../public/images/units/MartDragon.png";
import tyrDragon from "../../public/images/units/TyrDragon.png";
import arrDragon from "../../public/images/units/ArrDragon.png";


const unitImages = new BetterMap([
["baratheon", new BetterMap([
[footman.id, barathFoot],
[knight.id, barathKnight],
[siegeEngine.id, barathSiege],
[ship.id, barathShip]
[footman.id, baraFoot],
[knight.id, baraKnight],
[siegeEngine.id, baraSiege],
[ship.id, baraShip],
[dragon.id, baraDragon]
])],
["lannister", new BetterMap([
[footman.id, lanFoot],
[knight.id, lanKnight],
[siegeEngine.id, lanSiege],
[ship.id, lanShip]
[footman.id, lannFoot],
[knight.id, lannKnight],
[siegeEngine.id, lannSiege],
[ship.id, lannShip],
[dragon.id, lannDragon]
])],
["stark", new BetterMap([
[footman.id, starFoot],
[knight.id, starKnight],
[siegeEngine.id, starSiege],
[ship.id, starShip]
[ship.id, starShip],
[dragon.id, starDragon]
])],
["greyjoy", new BetterMap([
[footman.id, greyFoot],
[knight.id, greyKnight],
[siegeEngine.id, greySiege],
[ship.id, greyShip]
[ship.id, greyShip],
[dragon.id, greyDragon]
])],
["martell", new BetterMap([
[footman.id, martFoot],
[knight.id, martKnight],
[siegeEngine.id, martSiege],
[ship.id, martShip]
[ship.id, martShip],
[dragon.id, martDragon]
])],
["tyrell", new BetterMap([
[footman.id, tyrFoot],
[knight.id, tyrKnight],
[siegeEngine.id, tyrSiege],
[ship.id, tyrShip]
[ship.id, tyrShip],
[dragon.id, tyrDragon]
])],
["arryn", new BetterMap([
[footman.id, arrynFoot],
[knight.id, arrynKnight],
[siegeEngine.id, arrynSiege],
[ship.id, arrynShip]
[footman.id, arrFoot],
[knight.id, arrKnight],
[siegeEngine.id, arrSiege],
[ship.id, arrShip],
[dragon.id, arrDragon]
])],
["bolton", new BetterMap([
[footman.id, boltonFoot],
[knight.id, boltonKnight],
[siegeEngine.id, boltonSiege],
[ship.id, boltonShip]
[footman.id, boltFoot],
[knight.id, boltKnight],
[siegeEngine.id, boltSiege],
[ship.id, boltShip],
[dragon.id, boltDragon]
])],
["targaryen", new BetterMap([
[footman.id, targaryenFoot],
[footman.id, targFoot],
[knight.id, targKnight],
[dragon.id, targDragon],
[ship.id, targaryenShip]
[ship.id, targShip]
])]
]);

Expand Down
Loading

0 comments on commit 5812195

Please sign in to comment.