From 9e25f841738a1fdfd237bb053c1e8454c7bd6602 Mon Sep 17 00:00:00 2001 From: Phallen Cassidy Date: Mon, 6 Dec 2021 13:04:08 -0500 Subject: [PATCH] Fixes for the last Hobbit Draft Game expansion --- .../src/main/web/cards/set33/set33-fp.json | 13 +- .../main/web/cards/set33/set33-shadow.json | 189 ++++++++++++++---- .../src/main/web/cards/set33/set33-sites.json | 106 ++++++---- .../src/main/web/js/gemp-022/cardFilter.js | 4 +- .../src/main/web/js/gemp-022/hobbit.js | 8 +- .../src/main/resources/set33-rarity.txt | 122 +++++------ .../field/effect/EffectAppenderFactory.java | 4 +- .../field/effect/appender/ChooseANumber.java | 47 +++++ .../effect/appender/MemorizeStacked.java | 55 +++++ .../PutCardsFromPlayOnBottomOfDeck.java | 2 +- .../build/field/effect/appender/Transfer.java | 14 +- .../field/effect/filter/FilterFactory.java | 8 +- .../effect/modifier/CantBeTransferred.java | 23 +++ .../modifier/ModifierSourceFactory.java | 1 + 14 files changed, 435 insertions(+), 161 deletions(-) create mode 100644 gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/cards/build/field/effect/appender/ChooseANumber.java create mode 100644 gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/cards/build/field/effect/appender/MemorizeStacked.java create mode 100644 gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/cards/build/field/effect/modifier/CantBeTransferred.java diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/cards/set33/set33-fp.json b/gemp-lotr/gemp-lotr-async/src/main/web/cards/set33/set33-fp.json index 5c32ffd1b..cc30b432a 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/web/cards/set33/set33-fp.json +++ b/gemp-lotr/gemp-lotr-async/src/main/web/cards/set33/set33-fp.json @@ -175,14 +175,10 @@ "culture": "dwarven", "filter": "self" }, + "limitPerPhase": 1, "effect": { "type": "putCardsFromDiscardIntoHand", - "filter": "choose(culture(dwarven),event,maxTwilight(1),minTwilight(1))", - "count": { - "type": "cardPhaseLimit", - "limit": 1, - "amount": 1 - } + "filter": "choose(culture(dwarven),event,minTwilight(1),maxTwilight(1))", } } ] @@ -215,7 +211,8 @@ }, "effect": { "type": "putCardsFromHandOnBottomOfDeck" - } + }, + "limitPerTurn": 1 } ] }, @@ -821,7 +818,7 @@ } }, "33_53": { - "title": "*Master Worryword", + "title": "*Master Worrywort", "subtitle": "Hobbit Farmer", "culture": "shire", "cost": 1, diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/cards/set33/set33-shadow.json b/gemp-lotr/gemp-lotr-async/src/main/web/cards/set33/set33-shadow.json index 436620cd9..1d8e953d2 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/web/cards/set33/set33-shadow.json +++ b/gemp-lotr/gemp-lotr-async/src/main/web/cards/set33/set33-shadow.json @@ -220,7 +220,7 @@ "type": "modifier", "modifier": { "type": "cancelStrengthBonusTo", - "filter": "companion,culture(dwarven),inSkirmishAgainst(self)", + "filter": "companion,culture(dwarven)", "from": "weapon" } } @@ -311,6 +311,10 @@ "type": "endOfPhase", "phase": "shadow" }, + "condition": { + "type": "canSpot", + "filter": "culture(gundabad),orc" + }, "effect": { "type": "heal", "filter": "choose(culture(gundabad),orc)" @@ -319,28 +323,51 @@ { "type": "activated", "phase": "assignment", - "condition": { - "type": "location", - "filter": "forest" - }, + "condition": [ + { + "type": "location", + "filter": "forest" + }, + { + "type": "canSpot", + "filter": "culture(gundabad),orc" + } + ], "effect": [ { "type": "chooseActiveCards", - "filter": "choose(culture(gundabad),orc,assignableToSkirmishAgainst(name(Bilbo)))", "text": "Choose minion to assign to Bilbo", + "filter": "choose(culture(gundabad),orc,assignableToSkirmishAgainst(name(Bilbo)))", "memorize": "chosenMinion" }, + { + "type": "optional", + "player": "fp", + "text": "Would you like to add a doubt to assign {chosenMinion} to a companion?", + "effect": [ + { + "type": "addBurdens" + }, + { + "type": "assignFpCharacterToSkirmish", + "player": "fp", + "fpCharacter": "choose(companion)", + "against": "choose(memory(chosenMinion))" + } + ] + }, { "type": "preventable", "player": "fp", - "text": "Would you like to add a doubt to assign {chosenMinion} to a companion?", + "text": "assignFpCharacterToSkirmish doesn't work here for some reason, so this cost registers as unable to be attempted and the effect assigns the minion if the FP passed on the optional above", "cost": [ { "type": "addBurdens" }, { "type": "assignFpCharacterToSkirmish", - "fpCharacter": "choose(companion,notAssignedToSkirmish)", + "player": "shadowPlayer", + "fpCharacter": "choose(companion)", "against": "choose(memory(chosenMinion))" } ], @@ -396,17 +423,6 @@ "type": "condition", "keyword": "support area", "effects": [ - { - "type": "trigger", - "trigger": { - "type": "aboutToDiscard", - "filter": "self" - }, - "effect": { - "type": "putStackedCardsIntoHand", - "on": "self" - } - }, { "type": "activated", "phase": "regroup", @@ -425,6 +441,46 @@ "filter": "choose(lowestStrength(culture(dwarven),companion))", "where": "self" } + }, + { + "type": "trigger", + "trigger": { + "type": "aboutToDiscard", + "filter": "self" + }, + "effect": [ + { + "type": "memorizeStacked", + "on": "self", + "memory": "jailedCards" + }, + { + "type": "addTrigger", + "trigger": { + "type": "discarded", + "filter": "self" + }, + "effect": [ + { + "type": "choice", + "player": "fp", + "texts": [ + "The Free Peoples player takes stacked cards into hand" + ], + "effects": [ + { + "type": "putCardsFromDiscardIntoHand", + "filter": "choose(memory(jailedCards))", + "count": { + "type": "forEachInMemory", + "memory": "jailedCards" + } + } + ] + } + ] + } + ] } ] }, @@ -446,9 +502,13 @@ "type": "modifyStrength", "filter": "choose(minion)", "amount": { - "type": "forEachYouCanSpot", - "filter": "culture(elven)", - "limit": 3 + "type": "cardAffectedLimitPerPhase", + "limit": 3, + "source": { + "type": "forEachYouCanSpot", + "filter": "culture(elven)", + "limit": 3 + } } } }, @@ -515,6 +575,7 @@ "trigger": { "type": "aboutToDiscard", "filter": "another,condition,or(culture(gundabad),culture(mirkwood))", + "source": "side(free people)" }, "cost": { "type": "discard", @@ -533,7 +594,41 @@ "cost": 1, "type": "possession", "vitality": 1, - "target": "or(troll,giant)" + "target": "or(troll,giant)", + "effects": { + "type": "activated", + "phase": "archery", + "cost": { + "type": "discard", + "filter": "self" + }, + "effect": [ + { + "type": "chooseANumber", + "from": 0, + "to": 3, + "memorize": "chosenNumber" + }, + { + "type": "revealRandomCardsFromHand", + "forced": false, + "count": { + "type": "fromMemory", + "memory": "chosenNumber" + }, + "memorize": "revealedCards" + }, + { + "type": "modifyArcheryTotal", + "side": "shadow", + "amount": { + "type": "forEachMatchingInMemory", + "memory": "revealedCards", + "filter": "side(shadow)" + } + } + ] + } }, "33_36": { "title": "Bridging Troll", @@ -587,10 +682,18 @@ "count": 1, "memorize": "revealedCard" }, + { + "type": "memorizeNumber", + "memory": "cardTwilight", + "amount": { + "type": "twilightCostInMemory", + "memory": "revealedCard" + } + } { "type": "discard", "player": "fp", - "filter": "choose(side(free people),minTwilight(memory(revealedCard)),maxTwilight(memory(revealedCard)),not(companion))" + "filter": "choose(side(free people),minTwilight(memory(cardTwilight)),maxTwilight(memory(cardTwilight)),not(companion))" } ] } @@ -667,11 +770,11 @@ "33_40": { "title": "Goblin Bow", "culture": "moria", - "cost": 1, + "cost": 0, "type": "possession", "possession": "ranged weapon", "vitality": 1, - "target": "orc", + "target": "culture(moria),orc", "effects": [ { "type": "modifier", @@ -703,10 +806,7 @@ "type": "playCardFromDiscard", "filter": "choose(culture(moria),archer)" }, - "condition": { - "type": "perTurnLimit", - "limit": 1 - } + "limitPerTurn": 1 } ] }, @@ -738,7 +838,7 @@ "culture": "moria", "cost": 5, "type": "minion", - "race": "dragon", + "race": "giant", "strength": 11, "vitality": 3, "site": 4, @@ -807,7 +907,7 @@ "culture": "moria", "cost": 7, "type": "minion", - "race": "dragon", + "race": "giant", "strength": 14, "vitality": 4, "site": 4, @@ -839,6 +939,7 @@ { "type": "revealrandomcardsfromhand", "forced": false, + "hand": "fp", "memorize": "revealedCard", }, { @@ -909,7 +1010,7 @@ "effect": { "type": "preventable", "player": "fp", - "text": "Would you like to prevent adding a doubt to prevent wound to character skirmishing The Great Goblin?", + "text": "Would you like to add a doubt to prevent a wound to the character skirmishing The Great Goblin?", "cost": { "type": "addBurdens" }, @@ -965,7 +1066,7 @@ "phase": "shadow" }, "effect": { - "type": "putCardsFromDeckIntoHand", + "type": "putCardsFromDiscardIntoHand", "filter": "choose(or(culture(gundabad),culture(sauron)),event)" } } @@ -1002,9 +1103,12 @@ "effect": { "type": "drawCards", "count": { - "type": "forEachYouCanSpot", - "filter": "ally", - "limit": 3 + "type": "cardPhaseLimit", + "limit": 3, + "amount": { + "type": "forEachYouCanSpot", + "filter": "ally" + } } } } @@ -1042,9 +1146,13 @@ "effect": { "type": "drawCards", "count": { - "type": "forEachYouCanSpot", - "filter": "unique,minion", - "limit": 3 + "type": "cardPhaseLimit", + "limit": 3, + "amount": { + "type": "forEachYouCanSpot", + "filter": "unique,minion", + "limit": 3 + } } } } @@ -1180,6 +1288,7 @@ }, { "type": "optional", + "player": "fp", "text": "Would you like to take a Dwarven or Shire event into hand from discard?", "effect": { "type": "putCardsFromDiscardIntoHand", diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/cards/set33/set33-sites.json b/gemp-lotr/gemp-lotr-async/src/main/web/cards/set33/set33-sites.json index edeacc09b..f0d996da4 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/web/cards/set33/set33-sites.json +++ b/gemp-lotr/gemp-lotr-async/src/main/web/cards/set33/set33-sites.json @@ -12,13 +12,17 @@ "type": "startOfPhase", "phase": "fellowship" }, + "condition": { + "type": "isSide", + "side": "free people" + }, "cost": { "type": "addTwilight", "amount": 2 }, "effect": { "type": "putCardsFromDeckIntoHand", - "filter": "choose(culture(shire))" + "filter": "choose(or(culture(gandalf),culture(shire)))" } } }, @@ -36,6 +40,10 @@ "type": "startOfPhase", "phase": "fellowship" }, + "condition": { + "type": "isSide", + "side": "free people" + }, "effect": { "type": "playCardFromDrawDeck", "filter": "choose(or(possession,artifact))" @@ -77,56 +85,82 @@ "effect": [ { "type": "chooseYesOrNo", + "player": "fp", "text": "Would you like to transfer a Dwarven follower to a Dwarven companion for free?", "memorize": "choice" }, { - "type": "conditional", - "condition": { - "type": "memoryIs", - "memory": "choice", - "value": "yes" - }, - "effect": [ + "type": "choice", + "player": "fp", + "texts": [ + "This is just a hack to allow this card to break the rules" + ], + "effects": [ { - "type": "transfer", - "filter": "choose(culture(dwarven),follower,zone(support))", - "where": "choose(culture(dwarven),companion)" - }, - { - "type": "duplicate", - "amount": { - "type": "forEachYouCanSpot", - "filter": "follower,culture(dwarven),zone(support)", + "type": "conditional", + "condition": { + "type": "memoryIs", + "memory": "choice", + "value": "yes" }, - "effect": { - "type": "conditional", - "condition": { - "type": "memoryIs", - "memory": "choice", - "value": "yes" + "effect": [ + { + "type": "transfer", + "filter": "choose(culture(dwarven),follower)", + "where": "choose(culture(dwarven),companion)", + "memorizeTransferred": "transferredFollowers" }, - "effect": [ - { - "type": "chooseYesOrNo", - "text": "Would you like to transfer another follower for free?", - "memorize": "choice" + { + "type": "duplicate", + "amount": { + "type": "forEachYouCanSpot", + "filter": "follower,culture(dwarven),not(memory(transferredFollowers))", }, - { + "effect": { "type": "conditional", "condition": { "type": "memoryIs", "memory": "choice", "value": "yes" }, - "effect": { - "type": "transfer", - "filter": "choose(culture(dwarven),follower,zone(support))", - "where": "choose(culture(dwarven),companion)" - } + "effect": [ + { + "type": "chooseYesOrNo", + "text": "Would you like to transfer another follower for free?", + "memorize": "choice" + }, + { + "type": "conditional", + "condition": { + "type": "memoryIs", + "memory": "choice", + "value": "yes" + }, + "effect": [ + { + "type": "transfer", + "filter": "choose(culture(dwarven),follower,not(memory(transferredFollowers)))", + "where": "choose(culture(dwarven),companion)", + "memorizeTransferred": "anotherTransferredFollower" + }, + { + "type": "memorize", + "filter": "or(memory(transferredFollowers),memory(anotherTransferredFollower))", + "memory": "transferredFollowers" + } + ] + } + ] } - ] - } + }, + { + "type": "addModifier", + "modifier": { + "type": "cantBeTransferred", + "filter": "memory(transferredFollowers)" + } + } + ] } ] } diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/cardFilter.js b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/cardFilter.js index 784afeaa1..70af73f92 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/cardFilter.js +++ b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/cardFilter.js @@ -109,7 +109,7 @@ var CardFilter = Class.extend({ this.setSelect = $(""); combos.append("