"Fangorn Forest"
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package com.gempukku.lotro.cards.effects.choose;
|
||||
|
||||
import com.gempukku.lotro.filters.Filter;
|
||||
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;
|
||||
@@ -15,14 +15,14 @@ import java.util.List;
|
||||
|
||||
public class ChooseAndPlayCardFromDeckEffect extends AbstractEffect {
|
||||
private String _playerId;
|
||||
private Filter _filter;
|
||||
private Filterable[] _filter;
|
||||
private int _twilightModifier;
|
||||
|
||||
public ChooseAndPlayCardFromDeckEffect(String playerId, Filter filter) {
|
||||
this(playerId, filter, 0);
|
||||
public ChooseAndPlayCardFromDeckEffect(String playerId, Filterable... filter) {
|
||||
this(playerId, 0, filter);
|
||||
}
|
||||
|
||||
public ChooseAndPlayCardFromDeckEffect(String playerId, Filter filter, int twilightModifier) {
|
||||
public ChooseAndPlayCardFromDeckEffect(String playerId, int twilightModifier, Filterable... filter) {
|
||||
_playerId = playerId;
|
||||
_filter = filter;
|
||||
_twilightModifier = twilightModifier;
|
||||
@@ -45,7 +45,7 @@ public class ChooseAndPlayCardFromDeckEffect extends AbstractEffect {
|
||||
|
||||
@Override
|
||||
protected FullEffectResult playEffectReturningResult(final LotroGame game) {
|
||||
Collection<PhysicalCard> deck = Filters.filter(game.getGameState().getDeck(_playerId), game.getGameState(), game.getModifiersQuerying(), _filter, Filters.playable(game, _twilightModifier));
|
||||
Collection<PhysicalCard> deck = Filters.filter(game.getGameState().getDeck(_playerId), game.getGameState(), game.getModifiersQuerying(), Filters.and(_filter, Filters.playable(game, _twilightModifier)));
|
||||
game.getUserFeedback().sendAwaitingDecision(_playerId,
|
||||
new ArbitraryCardsSelectionDecision(1, "Choose a card to play", new LinkedList<PhysicalCard>(deck), 0, 1) {
|
||||
@Override
|
||||
|
||||
@@ -46,7 +46,7 @@ public class Card1_349 extends AbstractSite {
|
||||
|
||||
// Play from deck
|
||||
possibleEffects.add(
|
||||
new ChooseAndPlayCardFromDeckEffect(playerId, Filters.name("The Balrog"), -6));
|
||||
new ChooseAndPlayCardFromDeckEffect(playerId, -6, Filters.name("The Balrog")));
|
||||
|
||||
action.appendEffect(
|
||||
new ChoiceEffect(action, playerId, possibleEffects));
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.gempukku.lotro.cards.set4.site;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractSite;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndPlayCardFromDeckEffect;
|
||||
import com.gempukku.lotro.common.Block;
|
||||
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.timing.Action;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Set: The Two Towers
|
||||
* Twilight Cost: 2
|
||||
* Type: Site
|
||||
* Site: 2T
|
||||
* Game Text: Forest. Fellowship: Play Treebeard from your draw deck.
|
||||
*/
|
||||
public class Card4_332 extends AbstractSite {
|
||||
public Card4_332() {
|
||||
super("Fangorn Forest", Block.TWO_TOWERS, 2, 2, Direction.LEFT);
|
||||
addKeyword(Keyword.FOREST);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Action> getPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
|
||||
if (PlayConditions.canUseSiteDuringPhase(game.getGameState(), Phase.FELLOWSHIP, self)) {
|
||||
ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendEffect(
|
||||
new ChooseAndPlayCardFromDeckEffect(playerId, Filters.name("Treebeard")));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user