"The Mirror of Galadriel", "Revealer of Portents"
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
package com.gempukku.lotro.cards.effects;
|
||||
|
||||
import com.gempukku.lotro.common.Zone;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.GameState;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.GameUtils;
|
||||
import com.gempukku.lotro.logic.timing.AbstractEffect;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
public class PutCardFromStackedOnTopOfDeckEffect extends AbstractEffect {
|
||||
private PhysicalCard _physicalCard;
|
||||
|
||||
public PutCardFromStackedOnTopOfDeckEffect(PhysicalCard physicalCard) {
|
||||
_physicalCard = physicalCard;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPlayableInFull(LotroGame game) {
|
||||
return _physicalCard.getZone() == Zone.STACKED;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected FullEffectResult playEffectReturningResult(LotroGame game) {
|
||||
if (isPlayableInFull(game)) {
|
||||
GameState gameState = game.getGameState();
|
||||
gameState.sendMessage(_physicalCard.getOwner() + " puts " + GameUtils.getCardLink(_physicalCard) + " from being stacked on the top of deck");
|
||||
gameState.removeCardsFromZone(_physicalCard.getOwner(), Collections.singleton(_physicalCard));
|
||||
gameState.putCardOnTopOfDeck(_physicalCard);
|
||||
return new FullEffectResult(true);
|
||||
}
|
||||
return new FullEffectResult(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(LotroGame game) {
|
||||
return "Put " + GameUtils.getCardLink(_physicalCard) + " from being stacked on top of deck";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type getType() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.gempukku.lotro.cards.effects.choose;
|
||||
|
||||
import com.gempukku.lotro.cards.effects.PutCardFromStackedOnTopOfDeckEffect;
|
||||
import com.gempukku.lotro.common.Filterable;
|
||||
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.SubAction;
|
||||
import com.gempukku.lotro.logic.timing.Action;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public class ChooseAndPutCardFromStackedOnTopOfDeckEffect extends ChooseStackedCardsEffect {
|
||||
private Action _action;
|
||||
|
||||
public ChooseAndPutCardFromStackedOnTopOfDeckEffect(Action action, String playerId, int minimum, int maximum, Filterable stackedOn, Filterable... stackedCardsFilter) {
|
||||
super(action, playerId, minimum, maximum, stackedOn, Filters.and(stackedCardsFilter));
|
||||
_action = action;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void cardsChosen(LotroGame game, Collection<PhysicalCard> stackedCards) {
|
||||
if (stackedCards.size() > 0) {
|
||||
SubAction subAction = new SubAction(_action);
|
||||
for (PhysicalCard card : stackedCards)
|
||||
subAction.appendEffect(new PutCardFromStackedOnTopOfDeckEffect(card));
|
||||
game.getActionsEnvironment().addActionToStack(subAction);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -59,14 +59,14 @@ public abstract class ChooseStackedCardsEffect extends AbstractEffect {
|
||||
final boolean success = stackedCards.size() >= _minimum;
|
||||
|
||||
if (stackedCards.size() <= _minimum) {
|
||||
cardsChosen(stackedCards);
|
||||
cardsChosen(game, stackedCards);
|
||||
} else {
|
||||
game.getUserFeedback().sendAwaitingDecision(_playerId,
|
||||
new CardsSelectionDecision(1, "Choose cards", stackedCards, _minimum, maximum) {
|
||||
@Override
|
||||
public void decisionMade(String result) throws DecisionResultInvalidException {
|
||||
Set<PhysicalCard> stackedCards = getSelectedCardsByResponse(result);
|
||||
cardsChosen(stackedCards);
|
||||
cardsChosen(game, stackedCards);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -74,5 +74,5 @@ public abstract class ChooseStackedCardsEffect extends AbstractEffect {
|
||||
return new FullEffectResult(success);
|
||||
}
|
||||
|
||||
protected abstract void cardsChosen(Collection<PhysicalCard> stackedCards);
|
||||
protected abstract void cardsChosen(LotroGame game, Collection<PhysicalCard> stackedCards);
|
||||
}
|
||||
|
||||
@@ -2,20 +2,20 @@ package com.gempukku.lotro.cards.set11.gandalf;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractPermanent;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.effects.PutCardFromStackedIntoHandEffect;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndStackCardsFromHandEffect;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseStackedCardsEffect;
|
||||
import com.gempukku.lotro.cards.effects.PutCardFromStackedIntoHandEffect;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.logic.timing.Action;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.actions.ActivateCardAction;
|
||||
import com.gempukku.lotro.logic.effects.ChooseAndDiscardCardsFromHandEffect;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.logic.timing.Action;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Set: Shadows
|
||||
@@ -53,7 +53,7 @@ public class Card11_028 extends AbstractPermanent {
|
||||
action.appendEffect(
|
||||
new ChooseStackedCardsEffect(action, playerId, 1, 1, self, Filters.any) {
|
||||
@Override
|
||||
protected void cardsChosen(Collection<PhysicalCard> stackedCards) {
|
||||
protected void cardsChosen(LotroGame game, Collection<PhysicalCard> stackedCards) {
|
||||
for (PhysicalCard stackedCard : stackedCards) {
|
||||
action.appendEffect(
|
||||
new PutCardFromStackedIntoHandEffect(stackedCard));
|
||||
|
||||
@@ -50,7 +50,7 @@ public class Card20_046 extends AbstractEvent {
|
||||
action.appendEffect(
|
||||
new ChooseStackedCardsEffect(action, playerId, 1, 1, Filters.and(Culture.DWARVEN, CardType.CONDITION), Culture.DWARVEN) {
|
||||
@Override
|
||||
protected void cardsChosen(Collection<PhysicalCard> stackedCards) {
|
||||
protected void cardsChosen(LotroGame game, Collection<PhysicalCard> stackedCards) {
|
||||
for (PhysicalCard stackedCard : stackedCards) {
|
||||
action.appendEffect(
|
||||
new PutCardFromStackedIntoHandEffect(stackedCard));
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.gempukku.lotro.cards.set20.elven;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractPermanent;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.TriggerConditions;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndPutCardFromStackedOnTopOfDeckEffect;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndStackCardsFromDiscardEffect;
|
||||
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.actions.OptionalTriggerAction;
|
||||
import com.gempukku.lotro.logic.timing.Action;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 2
|
||||
* •The Mirror of Galadriel, Revealer of Portents
|
||||
* Elven Artifact • Support Area
|
||||
* At the beginning of the fellowship phase you may spot Galadriel to place a card stacked here on top of your draw deck.
|
||||
* Regroup: Exert Galadriel to stack an [Elven] card from your discard pile here.
|
||||
*/
|
||||
public class Card20_096 extends AbstractPermanent {
|
||||
public Card20_096() {
|
||||
super(Side.FREE_PEOPLE, 2, CardType.ARTIFACT, Culture.ELVEN, Zone.SUPPORT, "The Mirror of Galadriel", "Revealer of Portents", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (TriggerConditions.startOfPhase(game, effectResult, Phase.FELLOWSHIP)
|
||||
&& PlayConditions.canSpot(game, Filters.galadriel)) {
|
||||
OptionalTriggerAction action = new OptionalTriggerAction(self);
|
||||
action.appendEffect(
|
||||
new ChooseAndPutCardFromStackedOnTopOfDeckEffect(action, playerId, 1, 1, self, Filters.any));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
|
||||
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.REGROUP, self)
|
||||
&& PlayConditions.canExert(self, game, Filters.galadriel)) {
|
||||
ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(
|
||||
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.galadriel));
|
||||
action.appendEffect(
|
||||
new ChooseAndStackCardsFromDiscardEffect(action, playerId, 1, 1, self, Culture.ELVEN));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,7 @@ public class Card4_045 extends AbstractOldEvent {
|
||||
action.appendEffect(
|
||||
new ChooseStackedCardsEffect(action, playerId, 1, 1, Filters.and(Culture.DWARVEN, CardType.CONDITION), Side.FREE_PEOPLE) {
|
||||
@Override
|
||||
protected void cardsChosen(Collection<PhysicalCard> stackedCards) {
|
||||
protected void cardsChosen(LotroGame game, Collection<PhysicalCard> stackedCards) {
|
||||
for (PhysicalCard card : stackedCards)
|
||||
action.insertEffect(
|
||||
new PutCardFromStackedIntoHandEffect(card));
|
||||
|
||||
@@ -59,7 +59,7 @@ public class Card4_046 extends AbstractPermanent {
|
||||
action.appendEffect(
|
||||
new ChooseStackedCardsEffect(action, playerId, 1, 1, self, Side.FREE_PEOPLE) {
|
||||
@Override
|
||||
protected void cardsChosen(Collection<PhysicalCard> stackedCards) {
|
||||
protected void cardsChosen(LotroGame game, Collection<PhysicalCard> stackedCards) {
|
||||
for (PhysicalCard stackedCard : stackedCards) {
|
||||
action.appendEffect(
|
||||
new PutCardFromStackedIntoHandEffect(stackedCard));
|
||||
|
||||
@@ -54,7 +54,7 @@ public class Card5_009 extends AbstractPermanent {
|
||||
action.appendEffect(
|
||||
new ChooseStackedCardsEffect(action, playerId, 1, 1, self, Side.FREE_PEOPLE) {
|
||||
@Override
|
||||
protected void cardsChosen(Collection<PhysicalCard> stackedCards) {
|
||||
protected void cardsChosen(LotroGame game, Collection<PhysicalCard> stackedCards) {
|
||||
for (PhysicalCard stackedCard : stackedCards)
|
||||
action.insertEffect(
|
||||
new PutCardFromStackedIntoHandEffect(stackedCard));
|
||||
|
||||
@@ -64,7 +64,7 @@ public class Card9_039 extends AbstractPermanent {
|
||||
action.appendEffect(
|
||||
new ChooseStackedCardsEffect(action, playerId, 1, 1, self, Culture.ISENGARD) {
|
||||
@Override
|
||||
protected void cardsChosen(Collection<PhysicalCard> stackedCards) {
|
||||
protected void cardsChosen(LotroGame game, Collection<PhysicalCard> stackedCards) {
|
||||
for (PhysicalCard stackedCard : stackedCards) {
|
||||
action.appendEffect(
|
||||
new PutCardFromStackedIntoHandEffect(stackedCard));
|
||||
|
||||
Reference in New Issue
Block a user