From 93daff4db9db6ab59f56acdcd10904b48115cc35 Mon Sep 17 00:00:00 2001 From: MarcinSc Date: Sat, 18 May 2024 18:22:06 +0700 Subject: [PATCH] Migrated Gandalf cards in set 12 to hjson --- .../lotro/cards/set12/gandalf/Card12_026.java | 48 --- .../lotro/cards/set12/gandalf/Card12_027.java | 59 ---- .../lotro/cards/set12/gandalf/Card12_028.java | 71 ----- .../lotro/cards/set12/gandalf/Card12_029.java | 62 ---- .../lotro/cards/set12/gandalf/Card12_030.java | 49 --- .../lotro/cards/set12/gandalf/Card12_032.java | 59 ---- .../lotro/cards/set12/gandalf/Card12_033.java | 54 ---- .../lotro/cards/set12/gandalf/Card12_034.java | 47 --- .../lotro/cards/set12/gandalf/Card12_035.java | 54 ---- .../lotro/cards/set12/gandalf/Card12_036.java | 42 --- .../official/set12}/set12-Gandalf.hjson | 282 ++++++++++++++++-- .../effect/requirement/CantSpotBurdens.java | 18 ++ .../requirement/RequirementFactory.java | 1 + 13 files changed, 282 insertions(+), 564 deletions(-) delete mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_026.java delete mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_027.java delete mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_028.java delete mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_029.java delete mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_030.java delete mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_032.java delete mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_033.java delete mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_034.java delete mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_035.java delete mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_036.java rename gemp-lotr/gemp-lotr-cards/src/main/resources/{card-stubs => cards/official/set12}/set12-Gandalf.hjson (59%) create mode 100644 gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/cards/build/field/effect/requirement/CantSpotBurdens.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_026.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_026.java deleted file mode 100644 index 0f7a8dcb6..000000000 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_026.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.gempukku.lotro.cards.set12.gandalf; - -import com.gempukku.lotro.common.*; -import com.gempukku.lotro.filters.Filters; -import com.gempukku.lotro.game.PhysicalCard; -import com.gempukku.lotro.game.state.LotroGame; -import com.gempukku.lotro.logic.actions.PlayEventAction; -import com.gempukku.lotro.logic.cardtype.AbstractEvent; -import com.gempukku.lotro.logic.effects.ForEachYouSpotEffect; -import com.gempukku.lotro.logic.effects.ReorderTopCardsOfDeckEffect; -import com.gempukku.lotro.logic.timing.PlayConditions; - -/** - * Set: Black Rider - * Side: Free - * Culture: Gandalf - * Twilight Cost: 7 - * Type: Event • Fellowship - * Game Text: Toil 3. (For each [GANDALF] character you exert when playing this, its twilight cost is -3) - * Spot a [GANDALF] wizard and X other companions to examine the top X cards of your draw deck. Replace those cards - * in any order. - */ -public class Card12_026 extends AbstractEvent { - public Card12_026() { - super(Side.FREE_PEOPLE, 7, Culture.GANDALF, "Discoveries", Phase.FELLOWSHIP); - addKeyword(Keyword.TOIL, 3); - addKeyword(Keyword.SPELL); - } - - @Override - public boolean checkPlayRequirements(LotroGame game, PhysicalCard self) { - return PlayConditions.canSpot(game, Culture.GANDALF, Race.WIZARD); - } - - @Override - public PlayEventAction getPlayEventCardAction(final String playerId, LotroGame game, PhysicalCard self) { - final PlayEventAction action = new PlayEventAction(self); - action.appendEffect( - new ForEachYouSpotEffect(playerId, CardType.COMPANION, Filters.not(Culture.GANDALF, Race.WIZARD)) { - @Override - protected void spottedCards(int spotCount) { - action.appendEffect( - new ReorderTopCardsOfDeckEffect(action, playerId, spotCount)); - } - }); - return action; - } -} diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_027.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_027.java deleted file mode 100644 index f4342c40a..000000000 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_027.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.gempukku.lotro.cards.set12.gandalf; - -import com.gempukku.lotro.common.CardType; -import com.gempukku.lotro.common.Culture; -import com.gempukku.lotro.common.Phase; -import com.gempukku.lotro.common.Race; -import com.gempukku.lotro.filters.Filters; -import com.gempukku.lotro.game.PhysicalCard; -import com.gempukku.lotro.game.state.LotroGame; -import com.gempukku.lotro.logic.actions.ActivateCardAction; -import com.gempukku.lotro.logic.cardtype.AbstractCompanion; -import com.gempukku.lotro.logic.effects.AddUntilEndOfPhaseModifierEffect; -import com.gempukku.lotro.logic.effects.ReplaceInSkirmishEffect; -import com.gempukku.lotro.logic.effects.SelfExertEffect; -import com.gempukku.lotro.logic.effects.choose.ChooseAndExertCharactersEffect; -import com.gempukku.lotro.logic.modifiers.StrengthModifier; -import com.gempukku.lotro.logic.timing.PlayConditions; - -import java.util.Collections; -import java.util.List; - -/** - * Set: Black Rider - * Side: Free - * Culture: Gandalf - * Twilight Cost: 4 - * Type: Companion • Wizard - * Strength: 7 - * Vitality: 4 - * Resistance: 7 - * Game Text: Skirmish: If Gandalf is not assigned to a skirmish, exert him and another unbound companion skirmishing - * a minion to make Gandalf strength +3 and have him replace that companion in that skirmish. - */ -public class Card12_027 extends AbstractCompanion { - public Card12_027() { - super(4, 7, 4, 7, Culture.GANDALF, Race.WIZARD, null, "Gandalf", "The White Rider", true); - } - - @Override - public List getPhaseActionsInPlay(String playerId, LotroGame game, PhysicalCard self) { - if (PlayConditions.canUseFPCardDuringPhase(game, Phase.SKIRMISH, self) - && Filters.notAssignedToSkirmish.accepts(game, self) - && PlayConditions.canSelfExert(self, game) - && PlayConditions.canExert(self, game, Filters.unboundCompanion, Filters.inSkirmishAgainst(CardType.MINION))) { - ActivateCardAction action = new ActivateCardAction(self); - action.appendCost( - new SelfExertEffect(action, self)); - action.appendCost( - new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.unboundCompanion, Filters.inSkirmishAgainst(CardType.MINION))); - action.appendEffect( - new AddUntilEndOfPhaseModifierEffect( - new StrengthModifier(self, self, 3))); - action.appendEffect( - new ReplaceInSkirmishEffect(self, Filters.unboundCompanion, Filters.inSkirmishAgainst(CardType.MINION))); - return Collections.singletonList(action); - } - return null; - } -} diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_028.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_028.java deleted file mode 100644 index cb9789cd4..000000000 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_028.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.gempukku.lotro.cards.set12.gandalf; - -import com.gempukku.lotro.common.Culture; -import com.gempukku.lotro.common.Filterable; -import com.gempukku.lotro.common.Keyword; -import com.gempukku.lotro.common.Phase; -import com.gempukku.lotro.filters.Filters; -import com.gempukku.lotro.game.PhysicalCard; -import com.gempukku.lotro.game.state.LotroGame; -import com.gempukku.lotro.logic.actions.ActivateCardAction; -import com.gempukku.lotro.logic.actions.RequiredTriggerAction; -import com.gempukku.lotro.logic.cardtype.AbstractAttachableFPPossession; -import com.gempukku.lotro.logic.effects.AddBurdenEffect; -import com.gempukku.lotro.logic.effects.RemoveTwilightEffect; -import com.gempukku.lotro.logic.modifiers.evaluator.Evaluator; -import com.gempukku.lotro.logic.timing.EffectResult; -import com.gempukku.lotro.logic.timing.PlayConditions; -import com.gempukku.lotro.logic.timing.TriggerConditions; - -import java.util.Collections; -import java.util.List; - -/** - * Set: Black Rider - * Side: Free - * Culture: Gandalf - * Twilight Cost: 0 - * Type: Possession - * Game Text: Bearer must be Gandalf. Each time the fellowship moves from a battleground site, add a burden. - * Regroup: Add 2 burdens to remove all twilight tokens from the twilight pool. - */ -public class Card12_028 extends AbstractAttachableFPPossession { - public Card12_028() { - super(0, 0, 0, Culture.GANDALF, null, "Gandalf's Hat", null, true); - } - - @Override - public Filterable getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) { - return Filters.gandalf; - } - - @Override - public List getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) { - if (TriggerConditions.movesFrom(game, effectResult, Keyword.BATTLEGROUND)) { - RequiredTriggerAction action = new RequiredTriggerAction(self); - action.appendEffect( - new AddBurdenEffect(self.getOwner(), self, 1)); - return Collections.singletonList(action); - } - return null; - } - - @Override - public List getPhaseActionsInPlay(String playerId, LotroGame game, PhysicalCard self) { - if (PlayConditions.canUseFPCardDuringPhase(game, Phase.REGROUP, self)) { - ActivateCardAction action = new ActivateCardAction(self); - action.appendCost( - new AddBurdenEffect(playerId, self, 2)); - action.appendEffect( - new RemoveTwilightEffect( - new Evaluator() { - @Override - public int evaluateExpression(LotroGame game, PhysicalCard cardAffected) { - return game.getGameState().getTwilightPool(); - } - })); - return Collections.singletonList(action); - } - return null; - } -} diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_029.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_029.java deleted file mode 100644 index 5f64388d6..000000000 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_029.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.gempukku.lotro.cards.set12.gandalf; - -import com.gempukku.lotro.common.*; -import com.gempukku.lotro.filters.Filters; -import com.gempukku.lotro.game.PhysicalCard; -import com.gempukku.lotro.game.state.LotroGame; -import com.gempukku.lotro.logic.actions.PlayEventAction; -import com.gempukku.lotro.logic.cardtype.AbstractEvent; -import com.gempukku.lotro.logic.effects.ChoiceEffect; -import com.gempukku.lotro.logic.effects.choose.ChooseAndDiscardCardsFromPlayEffect; -import com.gempukku.lotro.logic.effects.choose.ChooseOpponentEffect; -import com.gempukku.lotro.logic.timing.Effect; -import com.gempukku.lotro.logic.timing.PlayConditions; - -import java.util.LinkedList; -import java.util.List; - -/** - * Set: Black Rider - * Side: Free - * Culture: Gandalf - * Twilight Cost: 2 - * Type: Event • Fellowship - * Game Text: Spell. Choose one: Spot a [GANDALF] Wizard to choose an opponent who must discard one of his or her - * conditions from play; or spot a [GANDALF] Wizard at a battleground site to discard a condition from play. - */ -public class Card12_029 extends AbstractEvent { - public Card12_029() { - super(Side.FREE_PEOPLE, 2, Culture.GANDALF, "Introspection", Phase.FELLOWSHIP); - addKeyword(Keyword.SPELL); - } - - @Override - public boolean checkPlayRequirements(LotroGame game, PhysicalCard self) { - return PlayConditions.canSpot(game, Culture.GANDALF, Race.WIZARD); - } - - @Override - public PlayEventAction getPlayEventCardAction(String playerId, LotroGame game, PhysicalCard self) { - final PlayEventAction action = new PlayEventAction(self); - List possibleEffects = new LinkedList<>(); - possibleEffects.add( - new ChooseOpponentEffect(playerId) { - @Override - public String getText(LotroGame game) { - return "Make opponent discard condition"; - } - - @Override - protected void opponentChosen(String opponentId) { - action.appendEffect( - new ChooseAndDiscardCardsFromPlayEffect(action, opponentId, 1, 1, Filters.owner(opponentId), CardType.CONDITION)); - } - }); - if (PlayConditions.location(game, Keyword.BATTLEGROUND)) - possibleEffects.add( - new ChooseAndDiscardCardsFromPlayEffect(action, playerId, 1, 1, CardType.CONDITION)); - action.appendEffect( - new ChoiceEffect(action, playerId, possibleEffects)); - return action; - } -} diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_030.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_030.java deleted file mode 100644 index 4bcb89ffa..000000000 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_030.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.gempukku.lotro.cards.set12.gandalf; - -import com.gempukku.lotro.logic.cardtype.AbstractCompanion; -import com.gempukku.lotro.logic.timing.PlayConditions; -import com.gempukku.lotro.logic.timing.TriggerConditions; -import com.gempukku.lotro.logic.effects.RemoveBurdenEffect; -import com.gempukku.lotro.common.CardType; -import com.gempukku.lotro.common.Culture; -import com.gempukku.lotro.common.Phase; -import com.gempukku.lotro.common.Race; -import com.gempukku.lotro.filters.Filters; -import com.gempukku.lotro.game.PhysicalCard; -import com.gempukku.lotro.game.state.LotroGame; -import com.gempukku.lotro.logic.actions.OptionalTriggerAction; -import com.gempukku.lotro.logic.timing.EffectResult; - -import java.util.Collections; -import java.util.List; - -/** - * Set: Black Rider - * Side: Free - * Culture: Gandalf - * Twilight Cost: 2 - * Type: Companion • Man - * Strength: 4 - * Vitality: 3 - * Resistance: 5 - * Game Text: At the start of each skirmish involving Jarnsmid, you may remove a burden (or 2 burdens if you can spot - * another [GANDALF] companion). - */ -public class Card12_030 extends AbstractCompanion { - public Card12_030() { - super(2, 4, 3, 5, Culture.GANDALF, Race.MAN, null, "Járnsmid", "Barding Emissary", true); - } - - @Override - public List getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) { - if (TriggerConditions.startOfPhase(game, effectResult, Phase.SKIRMISH) - && Filters.inSkirmish.accepts(game, self)) { - OptionalTriggerAction action = new OptionalTriggerAction(self); - int count = PlayConditions.canSpot(game, Filters.not(self), Culture.GANDALF, CardType.COMPANION) ? 2 : 1; - action.appendEffect( - new RemoveBurdenEffect(playerId, self, count)); - return Collections.singletonList(action); - } - return null; - } -} diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_032.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_032.java deleted file mode 100644 index f0b0d3a47..000000000 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_032.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.gempukku.lotro.cards.set12.gandalf; - -import com.gempukku.lotro.common.*; -import com.gempukku.lotro.filters.Filters; -import com.gempukku.lotro.game.PhysicalCard; -import com.gempukku.lotro.game.state.LotroGame; -import com.gempukku.lotro.logic.actions.ActivateCardAction; -import com.gempukku.lotro.logic.cardtype.AbstractAttachable; -import com.gempukku.lotro.logic.effects.PreventCardEffect; -import com.gempukku.lotro.logic.effects.PreventableCardEffect; -import com.gempukku.lotro.logic.effects.SelfDiscardEffect; -import com.gempukku.lotro.logic.timing.Effect; -import com.gempukku.lotro.logic.timing.PlayConditions; -import com.gempukku.lotro.logic.timing.TriggerConditions; - -import java.util.Collections; -import java.util.List; - -/** - * Set: Black Rider - * Side: Free - * Culture: Gandalf - * Twilight Cost: 0 - * Type: Condition - * Game Text: Spell. To play, spot a [GANDALF] Wizard. Bearer must be a companion. Limit 1 per bearer. - * Response: If bearer is about to take a wound that would kill him or her, discard this condition to prevent that - * wound. - */ -public class Card12_032 extends AbstractAttachable { - public Card12_032() { - super(Side.FREE_PEOPLE, CardType.CONDITION, 0, Culture.GANDALF, null, "Salve"); - addKeyword(Keyword.SPELL); - } - - @Override - public boolean checkPlayRequirements(LotroGame game, PhysicalCard self) { - return PlayConditions.canSpot(game, Culture.GANDALF, Race.WIZARD); - } - - @Override - public Filterable getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) { - return Filters.and(CardType.COMPANION, Filters.not(Filters.hasAttached(Filters.name(getTitle())))); - } - - @Override - public List getOptionalInPlayBeforeActions(String playerId, LotroGame game, Effect effect, PhysicalCard self) { - if (TriggerConditions.isGettingWounded(effect, game, self.getAttachedTo()) - && PlayConditions.canSelfDiscard(self, game) - && Filters.exhausted.accepts(game, self.getAttachedTo())) { - ActivateCardAction action = new ActivateCardAction(self); - action.appendCost( - new SelfDiscardEffect(self)); - action.appendEffect( - new PreventCardEffect((PreventableCardEffect) effect, self.getAttachedTo())); - return Collections.singletonList(action); - } - return null; - } -} diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_033.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_033.java deleted file mode 100644 index 2da5b4599..000000000 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_033.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.gempukku.lotro.cards.set12.gandalf; - -import com.gempukku.lotro.common.*; -import com.gempukku.lotro.filters.Filters; -import com.gempukku.lotro.game.PhysicalCard; -import com.gempukku.lotro.game.state.LotroGame; -import com.gempukku.lotro.logic.actions.PlayEventAction; -import com.gempukku.lotro.logic.cardtype.AbstractEvent; -import com.gempukku.lotro.logic.effects.AddUntilEndOfPhaseModifierEffect; -import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect; -import com.gempukku.lotro.logic.effects.OptionalEffect; -import com.gempukku.lotro.logic.effects.choose.ChooseAndPutCardFromDiscardIntoHandEffect; -import com.gempukku.lotro.logic.modifiers.StrengthModifier; -import com.gempukku.lotro.logic.timing.PlayConditions; - -/** - * Set: Black Rider - * Side: Free - * Culture: Gandalf - * Twilight Cost: 2 - * Type: Event • Skirmish - * Game Text: Make a [GANDALF] companion strength +2. Then, if that companion is at a battleground or dwelling site, - * you may take a [GANDALF] condition from your discard pile into hand. - */ -public class Card12_033 extends AbstractEvent { - public Card12_033() { - super(Side.FREE_PEOPLE, 2, Culture.GANDALF, "The Terror of His Coming", Phase.SKIRMISH); - } - - @Override - public PlayEventAction getPlayEventCardAction(final String playerId, LotroGame game, final PhysicalCard self) { - final PlayEventAction action = new PlayEventAction(self); - action.appendEffect( - new ChooseActiveCardEffect(self, playerId, "Choose a GANDALF companion", Culture.GANDALF, CardType.COMPANION) { - @Override - protected void cardSelected(LotroGame game, PhysicalCard card) { - action.appendEffect( - new AddUntilEndOfPhaseModifierEffect( - new StrengthModifier(self, card, 2))); - if (PlayConditions.location(game, Filters.or(Keyword.BATTLEGROUND, Keyword.DWELLING))) { - action.appendEffect( - new OptionalEffect(action, playerId, - new ChooseAndPutCardFromDiscardIntoHandEffect(action, playerId, 1, 1, Culture.GANDALF, CardType.CONDITION) { - @Override - public String getText(LotroGame game) { - return "Take a GANDALF condition from your discard pile into hand"; - } - })); - } - } - }); - return action; - } -} diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_034.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_034.java deleted file mode 100644 index d79f07372..000000000 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_034.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.gempukku.lotro.cards.set12.gandalf; - -import com.gempukku.lotro.common.*; -import com.gempukku.lotro.filters.Filters; -import com.gempukku.lotro.game.PhysicalCard; -import com.gempukku.lotro.game.state.LotroGame; -import com.gempukku.lotro.logic.GameUtils; -import com.gempukku.lotro.logic.actions.PlayEventAction; -import com.gempukku.lotro.logic.cardtype.AbstractEvent; -import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect; -import com.gempukku.lotro.logic.effects.PlaySiteEffect; -import com.gempukku.lotro.logic.timing.PlayConditions; - -/** - * Set: Black Rider - * Side: Free - * Culture: Gandalf - * Twilight Cost: 1 - * Type: Event • Maneuver or Regroup - * Game Text: Spot a [GANDALF] Wizard to replace a site in the fellowship's current region with a site from your - * adventure deck. - */ -public class Card12_034 extends AbstractEvent { - public Card12_034() { - super(Side.FREE_PEOPLE, 1, Culture.GANDALF, "Traveled Leader", Phase.MANEUVER, Phase.REGROUP); - } - - @Override - public boolean checkPlayRequirements(LotroGame game, PhysicalCard self) { - return PlayConditions.canSpot(game, Culture.GANDALF, Race.WIZARD); - } - - @Override - public PlayEventAction getPlayEventCardAction(final String playerId, LotroGame game, PhysicalCard self) { - final PlayEventAction action = new PlayEventAction(self); - - action.appendEffect( - new ChooseActiveCardEffect(self, playerId, "Choose site to replace", CardType.SITE, Filters.region(GameUtils.getRegion(game))) { - @Override - protected void cardSelected(LotroGame game, PhysicalCard card) { - action.appendEffect( - new PlaySiteEffect(action, playerId, null, card.getSiteNumber())); - } - }); - return action; - } -} diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_035.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_035.java deleted file mode 100644 index e601adf95..000000000 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_035.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.gempukku.lotro.cards.set12.gandalf; - -import com.gempukku.lotro.common.CardType; -import com.gempukku.lotro.common.Culture; -import com.gempukku.lotro.common.Filterable; -import com.gempukku.lotro.common.Side; -import com.gempukku.lotro.filters.Filters; -import com.gempukku.lotro.game.PhysicalCard; -import com.gempukku.lotro.game.state.LotroGame; -import com.gempukku.lotro.logic.actions.OptionalTriggerAction; -import com.gempukku.lotro.logic.cardtype.AbstractAttachable; -import com.gempukku.lotro.logic.effects.RemoveBurdenEffect; -import com.gempukku.lotro.logic.timing.EffectResult; -import com.gempukku.lotro.logic.timing.PlayConditions; -import com.gempukku.lotro.logic.timing.TriggerConditions; - -import java.util.Collections; -import java.util.List; - -/** - * Set: Black Rider - * Side: Free - * Culture: Gandalf - * Twilight Cost: 2 - * Type: Condition - * Game Text: 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. - */ -public class Card12_035 extends AbstractAttachable { - public Card12_035() { - super(Side.FREE_PEOPLE, CardType.CONDITION, 2, Culture.GANDALF, null, "Watch and Wait"); - } - - @Override - public boolean checkPlayRequirements(LotroGame game, PhysicalCard self) { - return PlayConditions.canSpot(game, Culture.GANDALF, CardType.COMPANION); - } - - @Override - public Filterable getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) { - return Filters.and(CardType.COMPANION, Filters.not(Filters.hasAttached(Filters.name(getTitle()))), Filters.not(Filters.ringBearer)); - } - - @Override - public List getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) { - if (TriggerConditions.winsSkirmish(game, effectResult, self.getAttachedTo())) { - OptionalTriggerAction action = new OptionalTriggerAction(self); - action.appendEffect( - new RemoveBurdenEffect(playerId, self)); - return Collections.singletonList(action); - } - return null; - } -} diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_036.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_036.java deleted file mode 100644 index 119b82bb2..000000000 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set12/gandalf/Card12_036.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.gempukku.lotro.cards.set12.gandalf; - -import com.gempukku.lotro.common.CardType; -import com.gempukku.lotro.common.Culture; -import com.gempukku.lotro.common.Keyword; -import com.gempukku.lotro.common.Side; -import com.gempukku.lotro.filters.Filters; -import com.gempukku.lotro.game.PhysicalCard; -import com.gempukku.lotro.game.state.LotroGame; -import com.gempukku.lotro.logic.cardtype.AbstractPermanent; -import com.gempukku.lotro.logic.modifiers.KeywordModifier; -import com.gempukku.lotro.logic.modifiers.Modifier; -import com.gempukku.lotro.logic.modifiers.condition.LocationCondition; - -import java.util.LinkedList; -import java.util.List; - -/** - * Set: Black Rider - * Side: Free - * Culture: Gandalf - * Twilight Cost: 1 - * Type: Condition • Support Area - * Game Text: While Gandalf is at an underground site, he gains muster. (At the start of the regroup phase, you may - * discard a card from hand to draw a card.) While the fellowship is at a battleground site, each [GANDALF] character - * gains muster. - */ -public class Card12_036 extends AbstractPermanent { - public Card12_036() { - super(Side.FREE_PEOPLE, 1, CardType.CONDITION, Culture.GANDALF, "With Doom We Come"); - } - - @Override - public List getInPlayModifiers(LotroGame game, PhysicalCard self) { - List modifiers = new LinkedList<>(); - modifiers.add( - new KeywordModifier(self, Filters.gandalf, new LocationCondition(Keyword.UNDERGROUND), Keyword.MUSTER, 1)); - modifiers.add( - new KeywordModifier(self, Filters.and(Culture.GANDALF, Filters.character), new LocationCondition(Keyword.BATTLEGROUND), Keyword.MUSTER, 1)); - return modifiers; - } -} diff --git a/gemp-lotr/gemp-lotr-cards/src/main/resources/card-stubs/set12-Gandalf.hjson b/gemp-lotr/gemp-lotr-cards/src/main/resources/cards/official/set12/set12-Gandalf.hjson similarity index 59% rename from gemp-lotr/gemp-lotr-cards/src/main/resources/card-stubs/set12-Gandalf.hjson rename to gemp-lotr/gemp-lotr-cards/src/main/resources/cards/official/set12/set12-Gandalf.hjson index 6f30b12a8..8c8f845d4 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/resources/card-stubs/set12-Gandalf.hjson +++ b/gemp-lotr/gemp-lotr-cards/src/main/resources/cards/official/set12/set12-Gandalf.hjson @@ -23,6 +23,35 @@ type: Condition keywords: Support Area effects: [ + { + type: trigger + optional: true + trigger: { + type: playerDrawsCard + player: shadow + } + requires: { + type: phase + phase: Shadow + } + effect: { + type: removeTwilight + amount: 1 + } + } + { + type: activated + phase: maneuver + cost: { + type: exert + filter: choose(name(Gandalf)) + } + effect: { + type: wound + filter: choose(name(Saruman)) + times: 2 + } + } ] gametext: Each time an opponent draws a card (or takes a card into hand) during the Shadow phase, you may remove (1).
Maneuver: Exert Gandalf to wound Saruman twice. lore: There is only one Lord of the Ring.' @@ -61,13 +90,25 @@ Toil 3 Fellowship ] - effects: { type: event - cost: { - }, + requires: { + type: canSpot + filter: culture(gandalf),wizard + } effect: [ + { + type: chooseHowManyToSpot + filter: companion + memorize: spotCount + } { + type: reorderTopCardsOfDrawDeck + count: { + type: subtract + firstNumber: memory(spotCount) + secondNumber: 1 + } } ] } @@ -109,6 +150,33 @@ vitality: 4 resistance: 7 effects: [ + { + type: activated + phase: skirmish + cost: [ + { + type: exert + filter: choose(self,notAssignedToSkirmish) + } + { + type: exert + filter: choose(another,unbound,companion,inSkirmishAgainst(minion)) + memorize: anotherCompanion + } + ] + effect: [ + { + type: modifyStrength + filter: self + amount: 3 + } + { + type: replaceInSkirmish + filter: memory(anotherCompanion) + with: self + } + ] + } ] gametext: Skirmish: If Gandalf is not assigned to a skirmish, exert him and another unbound companion skirmishing a minion to make Gandalf strength +3 and have him replace that companion in that skirmish. lore: Look to my coming at first light on the fifth day.' @@ -142,8 +210,30 @@ culture: Gandalf twilight: 0 type: Possession - #target: title(Gandalf) + target: title(Gandalf) effects: [ + { + type: trigger + trigger: { + type: movesFrom + filter: battleground + } + effect: { + type: addBurdens + } + } + { + type: activated + phase: regroup + cost: { + type: addBurdens + amount: 2 + } + effect: { + type: removeTwilight + amount: twilightCount + } + } ] gametext: Bearer must be Gandalf.
Each time the fellowship moves from a battleground site, add a burden.
Regroup: Add 2 burdens to remove all twilight tokens from the twilight pool. lore: He wore a tall pointed blue hat.... @@ -181,13 +271,37 @@ Spell Fellowship ] - effects: { type: event - cost: { - }, + requires: { + type: canSpot + filter: culture(gandalf),wizard + } effect: [ { + type: choice + texts: [ + Make opponent discard a condition + Discard condition + ] + effects: [ + { + type: discard + player: shadow + filter: choose(side(shadow),condition) + } + { + type: conditional + requires: { + type: location + filter: battleground + } + effect: { + type: discard + filter: choose(condition) + } + } + ] } ] } @@ -229,6 +343,30 @@ vitality: 3 resistance: 5 effects: [ + { + type: trigger + optional: true + trigger: { + type: startOfPhase + phase: skirmish + } + requires: { + type: canSpot + filter: self,inSkirmish + } + effect: { + type: removeBurdens + amount: { + type: condition + condition: { + type: canSpot + filter: another,culture(gandalf),companion + } + true: 2 + false: 1 + } + } + } ] gametext: At the start of each skirmish involving Járnsmid, you may remove a burden (or 2 burdens if you can spot another [gandalf] companion). lore: Sauron's Easterling allies were another trial for the Bardings, still keenly aware of the great efforts to rebuild Dale. @@ -266,13 +404,21 @@ Spell Skirmish ] - effects: { type: event - cost: { - }, effect: [ { + type: modifyStrength + filter: choose(name(Gandalf)) + amount: { + type: condition + condition: { + type: cantSpotBurdens + amount: 5 + } + true: 4 + false: 2 + } } ] } @@ -308,9 +454,38 @@ culture: Gandalf twilight: 0 type: Condition - #target: a companion + target: companion,not(hasAttached(name(Salve))) keywords: Spell effects: [ + { + type: toPlay + requires: { + type: canSpot + filter: culture(gandalf),wizard + } + } + { + type: activatedTrigger + trigger: { + type: aboutToTakeWound + filter: bearer + } + cost: [ + { + type: memorizeActive + filter: bearer + memory: bearer + } + { + type: discard + filter: self + } + { + type: preventWound + filter: memory(bearer) + } + ] + } ] gametext: Spell. To play, spot a [gandalf] Wizard. Bearer must be a companion. Limit 1 per bearer.
Response: If bearer is about to take a wound that would kill him or her, discard this condition to prevent that wound. lore: ...the whole hall became suddenly dark as night. @@ -345,13 +520,25 @@ twilight: 2 type: Event keywords: Skirmish - effects: { type: event - cost: { - }, effect: [ { + type: modifyStrength + filter: choose(culture(gandalf),companion) + amount: 2 + } + { + type: conditional + requires: { + type: location + filter: or(battleground,dwelling) + } + effect: { + type: putCardsFromDiscardIntoHand + filter: choose(culture(gandalf),condition) + count: 0-1 + } } ] } @@ -387,14 +574,29 @@ culture: Gandalf twilight: 1 type: Event - keywords: Maneuver or Regroup - + keywords: [ + Maneuver + Regroup + ] effects: { type: event - cost: { - }, + requires: { + type: canSpot + filter: culture(gandalf),wizard + } effect: [ { + type: chooseActiveCards + text: Choose site to replace + filter: choose(siteInCurrentRegion) + memorize: chosenSite + } + { + type: playSite + number: { + type: siteNumberInMemory + memory: chosenSite + } } ] } @@ -430,8 +632,26 @@ culture: Gandalf twilight: 2 type: Condition - #target: a companion (except the Ring-bearer) + target: companion,not(ringBearer),not(hasAttached(name(Watch and Wait))) effects: [ + { + type: toPlay + requires: { + type: canSpot + filter: culture(gandalf),companion + } + } + { + type: trigger + optional: true + trigger: { + type: winsSkirmish + filter: bearer + } + effect: { + type: removeBurdens + } + } ] gametext: 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. lore: I could not take it from him without doing greater harm; and I had no right to do so anyway.' @@ -467,6 +687,30 @@ type: Condition keywords: Support Area effects: [ + { + type: modifier + modifier: { + type: addKeyword + requires: { + type: location + filter: underground + } + filter: name(Gandalf) + keyword: muster + } + } + { + type: modifier + modifier: { + type: addKeyword + requires: { + type: location + filter: battleground + } + filter: culture(gandalf),character + keyword: muster + } + } ] gametext: While Gandalf is at an underground site, he gains muster. (At the start of the regroup phase, you may discard a card from hand to draw a card.)
While the fellowship is at a battleground site, each [gandalf] character gains muster. lore: We come, we come with roll of drum....' diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/cards/build/field/effect/requirement/CantSpotBurdens.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/cards/build/field/effect/requirement/CantSpotBurdens.java new file mode 100644 index 000000000..8dd3d5dbd --- /dev/null +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/cards/build/field/effect/requirement/CantSpotBurdens.java @@ -0,0 +1,18 @@ +package com.gempukku.lotro.cards.build.field.effect.requirement; + +import com.gempukku.lotro.cards.build.CardGenerationEnvironment; +import com.gempukku.lotro.cards.build.InvalidCardDefinitionException; +import com.gempukku.lotro.cards.build.Requirement; +import com.gempukku.lotro.cards.build.field.FieldUtils; +import com.gempukku.lotro.logic.timing.PlayConditions; +import org.json.simple.JSONObject; + +public class CantSpotBurdens implements RequirementProducer { + @Override + public Requirement getPlayRequirement(JSONObject object, CardGenerationEnvironment environment) throws InvalidCardDefinitionException { + FieldUtils.validateAllowedFields(object, "amount"); + + final int count = FieldUtils.getInteger(object.get("amount"), "amount", 1); + return (actionContext) -> !PlayConditions.canSpotBurdens(actionContext.getGame(), count); + } +} diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/cards/build/field/effect/requirement/RequirementFactory.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/cards/build/field/effect/requirement/RequirementFactory.java index d8b71a4a9..2b3d0b47d 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/cards/build/field/effect/requirement/RequirementFactory.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/cards/build/field/effect/requirement/RequirementFactory.java @@ -28,6 +28,7 @@ public class RequirementFactory { requirementProducers.put("canspottwilight", new CanSpotTwilight()); requirementProducers.put("canspotwounds", new CanSpotWounds()); requirementProducers.put("cantspot", new CantSpot()); + requirementProducers.put("cantspotburdens", new CantSpotBurdens()); requirementProducers.put("cantspotfpcultures", new CantSpotFPCultures()); requirementProducers.put("cantspotthreats", new CantSpotThreats()); requirementProducers.put("cardsindeckcount", new CardsInDeckCount());