From fb7295f5b99bdd717952af0f83329f423f254b02 Mon Sep 17 00:00:00 2001 From: Christian 'ketura' McCarty Date: Tue, 11 Jul 2023 00:34:32 -0500 Subject: [PATCH] Adding an awful hack so that tengwar cards display the title + game text with a link to the wiki --- .../src/main/web/js/gemp-022/gameUi.js | 4 +- .../lotro/game/LotroGameMediator.java | 153 +++++++++++++++--- 2 files changed, 134 insertions(+), 23 deletions(-) diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/gameUi.js b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/gameUi.js index 2bbe5ec82..5cea1d109 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/gameUi.js +++ b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/gameUi.js @@ -634,7 +634,9 @@ var GempLotrGameUI = Class.extend({ return false; } - if (!this.successfulDrag && this.infoDialog.dialog("isOpen")) { + //Only close any open dialogs if we are not mid-swipe, the dialog is open, and the mouse is not + // over a link in the card's info + if (!this.successfulDrag && this.infoDialog.dialog("isOpen") && tar.get(0).tagName != "A") { this.infoDialog.dialog("close"); event.stopPropagation(); return false; diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/LotroGameMediator.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/LotroGameMediator.java index f381de0e2..9ce68173d 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/LotroGameMediator.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/game/LotroGameMediator.java @@ -157,61 +157,81 @@ public class LotroGameMediator { Collection modifiers = _lotroGame.getModifiersQuerying().getModifiersAffecting(_lotroGame, card); for (Modifier modifier : modifiers) { PhysicalCard source = modifier.getSource(); - if (source != null) - sb.append("
" + GameUtils.getCardLink(source) + ": " + modifier.getText(_lotroGame, card)); - else - sb.append("
System: " + modifier.getText(_lotroGame, card)); + if (source != null) { + sb.append("
") + .append(GameUtils.getCardLink(source)) + .append(": ") + .append(modifier.getText(_lotroGame, card)); + } + else { + sb.append("
System: ") + .append(modifier.getText(_lotroGame, card)); + } } - if (modifiers.size() == 0) + if (modifiers.size() == 0) { sb.append("
nothing"); + } - if (card.getZone().isInPlay() && card.getBlueprint().getCardType() == CardType.SITE) - sb.append("
Owner: " + card.getOwner()); + if (card.getZone().isInPlay() && card.getBlueprint().getCardType() == CardType.SITE) { + sb.append("
Owner: ") + .append(card.getOwner()); + } Map map = _lotroGame.getGameState().getTokens(card); if (map != null && map.size() > 0) { sb.append("
Tokens:"); - for (Map.Entry tokenIntegerEntry : map.entrySet()) - sb.append("
" + tokenIntegerEntry.getKey().toString() + ": " + tokenIntegerEntry.getValue()); + for (Map.Entry tokenIntegerEntry : map.entrySet()) { + sb.append("
") + .append(tokenIntegerEntry.getKey().toString()) + .append(": ") + .append(tokenIntegerEntry.getValue()); + } } List stackedCards = _lotroGame.getGameState().getStackedCards(card); if (stackedCards != null && stackedCards.size() > 0) { - sb.append("
Stacked cards:"); - sb.append("
" + GameUtils.getAppendedNames(stackedCards)); + sb.append("
Stacked cards:") + .append("
") + .append(GameUtils.getAppendedNames(stackedCards)); } final String extraDisplayableInformation = card.getBlueprint().getDisplayableInformation(card); if (extraDisplayableInformation != null) { - sb.append("
Extra information:"); - sb.append("
" + extraDisplayableInformation); + sb.append("
Extra information:") + .append("
") + .append(extraDisplayableInformation); } sb.append("

Effective stats:"); try { PhysicalCard target = card.getAttachedTo(); int twilightCost = _lotroGame.getModifiersQuerying().getTwilightCost(_lotroGame, card, target, 0, false); - sb.append("
Twilight cost: " + twilightCost); + sb.append("
Twilight cost: ") + .append(twilightCost); } catch (UnsupportedOperationException ignored) { } try { int strength = _lotroGame.getModifiersQuerying().getStrength(_lotroGame, card); - sb.append("
Strength: " + strength); + sb.append("
Strength: ") + .append(strength); } catch (UnsupportedOperationException ignored) { } try { int vitality = _lotroGame.getModifiersQuerying().getVitality(_lotroGame, card); - sb.append("
Vitality: " + vitality); + sb.append("
Vitality: ") + .append(vitality); } catch (UnsupportedOperationException ignored) { } try { int resistance = _lotroGame.getModifiersQuerying().getResistance(_lotroGame, card); - sb.append("
Resistance: " + resistance); + sb.append("
Resistance: ") + .append(resistance); } catch (UnsupportedOperationException ignored) { } try { int siteNumber = _lotroGame.getModifiersQuerying().getMinionSiteNumber(_lotroGame, card); - sb.append("
Site number: " + siteNumber); + sb.append("
Site number: ") + .append(siteNumber); } catch (UnsupportedOperationException ignored) { } @@ -221,15 +241,27 @@ public class LotroGameMediator { if (keyword.isMultiples()) { int count = _lotroGame.getModifiersQuerying().getKeywordCount(_lotroGame, card, keyword); if (count > 0) - keywords.append(keyword.getHumanReadable() + " +" + count + ", "); + keywords.append(keyword.getHumanReadable()) + .append(" +") + .append(count) + .append(", "); } else { if (_lotroGame.getModifiersQuerying().hasKeyword(_lotroGame, card, keyword)) - keywords.append(keyword.getHumanReadable() + ", "); + keywords.append(keyword.getHumanReadable()) + .append(", "); } } } - if (keywords.length() > 0) - sb.append("
Keywords: " + keywords.substring(0, keywords.length() - 2)); + if (keywords.length() > 0) { + sb.append("
Keywords: ") + .append(keywords.substring(0, keywords.length() - 2)); + } + + if(TrulyAwfulTengwarHackMap.containsKey(card.getBlueprintId())) { + sb.append("

Tengwar Translation:
") + .append(TrulyAwfulTengwarHackMap.get(card.getBlueprintId())); + } + return sb.toString(); } else { return null; @@ -239,6 +271,83 @@ public class LotroGameMediator { } } + public static final HashMap TrulyAwfulTengwarHackMap = new HashMap<>() {{ + put("1_1T", "•The One Ring, Isildur's Bane (1R1)

Response: If bearer is about to take a wound, he wears The One Ring until the regroup phase.
While wearing The One Ring, each time the Ring-bearer is about to take a wound, add two burdens instead.
"); + put("1_13T", "•Gimli, Son of Gloin (1R13)

Damage +1.
Skirmish: Exert Gimli to make him strength +2.
"); + put("1_14T", "•Gimli's Battle Axe (1R14)

Bearer must be Gimli.
He is damage +1.
Each time Gimli wins a skirmish, you may wound an Orc.
"); + put("1_30T", "•Arwen, Daughter of Elrond (1R30)

Ranger.
While skirmishing a Nazgûl, Arwen is strength +3.
"); + put("1_50T", "•Legolas, Greenleaf (1R50)

Archer.
Archery: Exert Legolas to wound a minion; Legolas does not add to the fellowship archery total.
"); + put("1_72T", "•Gandalf, Friend of the Shirefolk (1R72)

Gandalf is strength +1 for each of these races you can spot in the fellowship: Hobbit, Dwarf, Elf, and Man.
"); + put("1_83T", "Servant of the Secret Fire (1R83)

Spell.
Skirmish: Spot Gandalf to make a minion strength -3.
"); + put("1_89T", "•Aragorn, Ranger of the North (1R89)

Ranger.
Maneuver: Exert Aragorn to make him defender +1 until the regroup phase.
"); + put("1_96T", "•Boromir, Lord of Gondor (1R96)

Ranger.
Boromir is not overwhelmed unless his strength is tripled.
"); + put("1_114T", "•The Saga of Elendil (1R114)

Tale. Bearer must be a [GONDOR] companion.
Skirmish: Discard this condition to make bearer strength +2.
"); + put("1_127T", "•Lurtz, Servant of Isengard (1R127)

Archer. Damage +1.
Maneuver: Spot another Uruk-hai to make Lurtz fierce until the regroup phase.
"); + put("1_165T", "•Cave Troll of Moria, Scourge of the Black Pit (1R165)

Damage +1. Fierce. To play, spot a [MORIA] Orc.
At an underground site, Cave Troll of Moria’s twilight cost is -3.
"); + put("1_231T", "•Ulaire Enquea, Lieutenant of Morgul (1U231)

Fierce.
Maneuver: Spot 6 companions (or 5 burdens) and exert Úlairë Enquëa to wound a companion (except the Ring-bearer).
"); + put("1_237T", "•The Witch-king, Lord of Angmar (1R237)

Fierce.
For each other Nazgûl you can spot, The Witch-king is strength +2.
"); + put("1_256T", "Morgul Hunter (1R256)

For each companion you can spot, this minion is strength +1.
"); + put("2_52T", "•The Balrog, Flame of Udun (2R52)

Damage +1. Fierce. To play, spot a [MORIA] Orc.
Discard The Balrog if not underground.
Shadow: Exert The Balrog and remove (2) to play a [MORIA] Orc from your discard pile.
"); + put("2_102T", "•Frodo, Reluctant Adventurer (2C102)

Ring-bound. Ring-bearer (resistance 10).
The cost of each artifact, possession, and [SHIRE] tale played on Frodo is -1.
"); + put("2_105T", "•Mithril-coat (2R105)

Bearer must be Frodo.
The minion archery total is -1.
Each minion skirmishing Frodo does not gain strength bonuses from weapons and loses all damage bonuses.
"); + put("4_1T", "•The One Ring, Answer To All Riddles (4R1)

While wearing The One Ring, the Ring-bearer is strength +2, and each time he is about to take a wound in a skirmish, add a burden instead.
Skirmish: Add a burden to wear The One Ring until the regroup phase.
"); + put("4_19T", "Hides (4R19)

When you play this possession, you may draw a card.
Response: If a [DUNLAND] Man is about to take a wound, remove (2) or discard this possession to prevent that wound.
"); + put("4_73T", "•Legolas, Dauntless Hunter (4R73)

Archer.
The twilight cost of each Shadow event and Shadow condition is +1 for each unbound Hobbit you can spot.
"); + put("4_90T", "•Gandalf, The White Wizard (4C90)

While you can spot 3 twilight tokens, Gandalf is strength +3.
"); + put("4_100T", "•Shadowfax (4R100)

Bearer must be Gandalf. Discard any hand weapon he bears.
Gandalf may not bear a hand weapon.
At the start of each skirmish involving Gandalf, each minion skirmishing him must exert.
"); + put("4_103T", "•Treebeard, Earthborn (4R103)

Unhasty.
Response: If an unbound Hobbit is about to be discarded, stack him here instead.
Fellowship: Exert Treebeard and add (1) to play an unbound Hobbit stacked here.
"); + put("4_154T", "•Grima, Wormtongue (4R154)

Maneuver: Exert Gríma and spot an unbound companion bearing 3 or more cards to return each Free Peoples card that companion bears to its owner’s hand.
"); + put("4_173T", "•Saruman, Black Traitor (4R173)

Saruman may not take wounds during the archery phase and may not be assigned to a skirmish.
When you play Saruman, you may discard a condition.
Shadow: Exert Saruman to play Saruman’s Staff from your discard pile.
"); + put("4_176T", "•Ugluk, Servant of Saruman (4R176)

Tracker. Fierce.
The roaming penalty for each [ISENGARD] tracker you play is -2.
While you can spot 2 [ISENGARD] trackers, Uglúk is strength +3.
While you can spot 3 [ISENGARD] trackers, Uglúk is damage +1.
"); + put("4_219T", "•Desert Lord (4R219)

Southron. Archer.
Archery: Exert Desert Lord to exert a companion (except the Ring-bearer); Desert Lord does not add to the minion archery total.
"); + put("4_225T", "•Easterling Captain (4R225)

Easterling. Fierce.
Skirmish: Spot 2 burdens and remove (2) to make an Easterling strength +2.
Skirmish: Spot 4 burdens and remove (2) to make an Easterling strength +3.
Skirmish: Spot 6 burdens and remove (2) to make an Easterling strength +4.
"); + put("4_289T", "Simbelmyne (4R289)

Fellowship: Spot 2 [ROHAN] Men (or 1 valiant [ROHAN] Man) to play a [ROHAN] character or [ROHAN] possession from your draw deck.
"); + put("4_301T", "•Frodo, Courteous Halfling (4R301)

Ring-bearer (resistance 10).
While you can spot 3 unbound companions, Shadow cards may not discard cards from your hand or from the top of your draw deck.
"); + put("4_364T", "•Aragorn, Wingfoot (4P364)

Ranger.
Each time the fellowship moves, you may wound a minion for each unbound Hobbit you spot.
"); + put("5_25T", "•Gollum, Stinker (5R25)

Gollum is strength +1 for each burden. Each time Gollum wins a skirmish, you may add a burden.
"); + put("5_29T", "•Smeagol, Slinker (5R29)

Ring-bound. To play, add a burden.
Skirmish: Add a burden to make Sméagol strength +2 and take no wounds.
"); + put("5_100T", "•Grishnakh, Orc Captain (5R100)

Tracker.
The site number of each [SAURON] Orc is -3.
Shadow: Exert Grishnákh twice and spot another [SAURON] Orc to draw 3 cards. The Free Peoples player may add 2 burdens to prevent this.
"); + put("5_116T", "•Sting, Baggins Heirloom (5R116)

Bearer must be Frodo.
Skirmish: Exert Frodo to make Sméagol strength +2 or Gollum strength -2.
"); + put("6_88T", "•Ulaire Toldea, Winged Sentry (6R88)

Fierce. Each time Úlairë Toldëa wins a skirmish, the Free Peoples player must exert a companion or add a burden.
"); + put("7_2T", "•The One Ring, Such a Weight to Carry (7R2)

Maneuver: Add a burden to wear The One Ring until the regroup phase.
While wearing The One Ring, each time the Ring-bearer is about to take a wound, add a burden instead.
"); + put("7_79T", "•Anduril, Flame of the West (7R79)

Bearer must be Aragorn. Discard other weapons he bears. He is damage +1 and cannot bear other weapons.
Fellowship or Regroup: If the fellowship is at any site 2 or any site 5, play the fellowship’s next site (replacing opponent’s site if necessary).
"); + put("7_211T", "•Ulaire Cantea, Faster Than Winds (7R211)

Fierce.
When you play Úlairë Cantëa, add a threat for each companion over 4.
Maneuver: Remove 2 threats and spot another [WRAITH] minion to discard a possession.
"); + put("7_221T", "•The Witch-king, Morgul King (7R221)

Fierce.
When you play The Witch-king, you may remove a threat to take a [WRAITH] card into hand from your discard pile.
The Ring-bearer cannot take threat wounds.
"); + put("7_227T", "•Eomer, Skilled Tactician (7R227)

Valiant. While you can spot a [ROHAN] Man, Éomer’s twilight cost is –1.
Fellowship: Play a [ROHAN] companion to take a [ROHAN] possession or [ROHAN] skirmish event into hand from your discard pile.
"); + put("7_321T", "•Merry, Swordthain (7R321)

Skirmish: If Merry is not assigned to a skirmish, return him to your hand to play up to 2 [ROHAN] possessions from your discard pile.
"); + put("7_324T", "•Pippin, Wearer of Black and Silver (7R324)

Skirmish: If Pippin is not assigned to a skirmish, return him to your hand to wound a roaming minion twice.
"); + put("8_15T", "•Gandalf, Leader of Men (8R15)

When Gandalf is in your starting fellowship, his twilight cost is -2.
"); + put("8_25T", "•Shelob, Eater of Light (8R25)

Fierce.
When you play Shelob, you may play a [GOLLUM] possession from your draw deck.
Shelob is strength +3 for each minion stacked on a [GOLLUM] possession.
"); + put("8_38T", "•King of the Dead, Oathbreaker (8R38)

Enduring. To play, spot a [GONDOR] Wraith and add 2 threats.
Response: If Aragorn is about to take a wound in a skirmish, exert King of the Dead to prevent that wound.
"); + put("8_51T", "•Castamir of Umbar (8R51)

Corsair. Enduring. Fierce.
Shadow: Exert Castamir of Umbar and play a corsair to add 2 [RAIDER] tokens to a card that already has a [RAIDER] token on it.
"); + put("8_57T", "Corsair Marauder (8R57)

Corsair.
When you play this minion, if you can spot another corsair, you may discard a possession to add 2 [RAIDER] tokens to a card that already has a [RAIDER] token on it.
"); + put("8_103T", "•Grond, Hammer of the Underworld (8R103)

Engine. Shadow: Play a [SAURON] minion to add a [SAURON] token here.
Regroup: Remove X [SAURON] tokens here to discard a Free Peoples card (except a companion) with a twilight cost of X. Discard a [SAURON] minion or this possession.
"); + put("10_6T", "•Arwen, Queen of Elves and Men (10R6)

Each minion skirmishing Arwen is strength –2 for each wounded minion you can spot.
"); + put("10_9T", "•Elrond, Venerable Lord (10R9)

To play, spot an Elf.
At the start of each skirmish involving Elrond, you may reveal the top card of your draw deck. If it is an [ELVEN] card, you may heal another Elf.
"); + put("10_25T", "•Aragorn, Elessar Telcontar (10R25)

When you play Aragorn, you may heal another companion. At the start of each fellowship phase, you may exert a companion of one culture to heal a companion of another culture.
"); + put("10_88T", "•Gothmog, Lieutenant of Morgul (10R88)

Besieger.
When you play Gothmog, the Free Peoples player must wound a companion for each site you control.
While you control a site, Gothmog is fierce.
"); + put("10_122T", "•Sam, Great Elf Warrior (10P122)

Ring-bound.
Sam is strength +1 for each [SHIRE] companion you can spot.
Response: If Frodo dies, make Sam the Ring-bearer (resistance 5).
"); + put("11_1T", "•The One Ring, The Ring of Rings (11R1)

Response: If the Ring-bearer is about to take a wound, he or she wears The One Ring until the regroup phase. While the Ring-bearer is wearing The One Ring, each time he or she is about to take a wound, add a burden instead.
"); + put("11_33T", "•Gandalf, Leader of the Company (11S33)

While Gandalf is in region 1, each other companion is strength +2. While Gandalf is in region 2, each companion is strength +1. While Gandalf is in region 3, he is strength +2.
"); + put("11_54T", "•Aragorn, Strider (11R54)

Ranger. Each time the fellowship moves, add (1).
"); + put("11_57T", "•Boromir, Hero of Osgiliath (11R57)

Knight. Each time Boromir wins a skirmish, you may heal a [GONDOR] companion.
"); + put("11_123T", "Goblin Hordes (11R123)

To play, spot an [ORC] minion.
Each time the fellowship moves from an underground site, you may take an [ORC] minion from your discard pile into hand.
"); + put("11_226T", "•The Witch-king, Captain of the Nine Riders (11R226)

Fierce. Toil 2. (For each [WRAITH] character you exert when playing this, its twilight cost is –2.) Muster. (At the start of the regroup phase, you may discard a card from hand to draw a card.)
"); + put("12_17T", "•Elrond, Witness to History (12R17)

To play, spot an Elf.
Skirmish: If Elrond is skirmishing a minion, exert him to place an [ELVEN] card from your discard pile on top of your draw deck.
"); + put("12_35T", "Watch and Wait (12R35)

To play, spot a [GANDALF] companion.
Bearer must be a companion (except the Ring-bearer). Limit 1 per bearer.
Each time bearer wins a skirmish, you may remove a burden.
"); + put("12_54T", "•Saruman, Of Many Colours (12R54)

Damage +1. Fierce. Lurker. (Skirmishes involving lurker minions must be resolved after any others.) When you play Saruman, name a culture. Each companion of the named culture is strength –1.
"); + put("12_73T", "•The Mouth of Sauron, Messenger of Mordor (12S73)

Maneuver: Exert The Mouth of Sauron to play a [MEN] condition or [MEN] possession from your draw deck.
"); + put("12_79T", "•The Balrog, The Terror of Khazad-dum (12R79)

Damage +1.
While The Balrog is at an underground site, it is fierce and cannot take wounds or be exerted.
"); + put("12_174T", "•Ulaire Cantea, Black Assassin (12R174)

Fierce.
Assignment:
Assign Úlairë Cantëa to a companion who has resistance 0.
Skirmish: Spot 6 companions and another [WRAITH] card to kill a companion Úlairë Cantëa is skirmishing.
"); + put("13_5T", "•Gimli, Lord of the Glittering Caves (13R5)

Damage +1.
Gimli is strength +1 for each minion assigned to a skirmish.
Assignment: Exert Gimli and spot a lurker minion to make that minion lose lurker until the regroup phase.
"); + put("13_46T", "•Deagol, Fateful Finder (13R46)

To play, spot Sméagol.
Aid – Add a burden.
Skirmish: If bearer is not assigned to a skirmish, discard this from play to play an artifact or possession from your draw deck on bearer.
"); + put("13_112T", "•Orc Crusher (13R112)

To play, spot an [ORC] Orc.
This minion is twilight cost –1 for each burden.
Each time a Ring-bound companion loses a skirmish involving an [ORC] minion, you may reveal this card from hand to add a burden.
"); + put("13_137T", "•Theoden, The Renowned (13R137)

While you can spot Éowyn, Théoden is defender +1.
While you can spot Éomer, Théoden is damage +1.
While you can spot Théodred, the move limit is +1.
"); + put("13_156T", "•Sam, Bearer of Great Need (13R156)

Ring-bound.
Sam is resistance +1 for each Hobbit you can spot.
Regroup: Exert Sam and transfer a follower he is bearing to your support area to discard a minion from play.
"); + put("13_174T", "Uruk Rogue (13R174)

Damage +1.
Skirmish:
If no other minions are assigned to a skirmish, you may exert this minion twice to make it fierce and strength +4 until the regroup phase.
"); + + }}; + public void startGame() { _writeLock.lock(); try {