"Closer and Closer He Bent"

This commit is contained in:
marcins78@gmail.com
2011-11-15 12:46:00 +00:00
parent a8a40aea4a
commit d23d593a10
4 changed files with 66 additions and 13 deletions

View File

@@ -1,6 +1,8 @@
package com.gempukku.lotro.cards.effects;
import com.gempukku.lotro.cards.effects.choose.ChooseArbitraryCardsEffect;
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;
@@ -9,16 +11,16 @@ import com.gempukku.lotro.logic.timing.Action;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
public class PutHandBeneathDrawDeckEffect extends AbstractSubActionEffect {
public class PutCardsFromHandBeneathDrawDeckEffect extends AbstractSubActionEffect {
private Action _action;
private String _playerId;
private Filterable[] _filters;
public PutHandBeneathDrawDeckEffect(Action action, String playerId) {
public PutCardsFromHandBeneathDrawDeckEffect(Action action, String playerId, Filterable... filters) {
_action = action;
_playerId = playerId;
_filters = filters;
}
@Override
@@ -38,21 +40,20 @@ public class PutHandBeneathDrawDeckEffect extends AbstractSubActionEffect {
@Override
public Collection<? extends EffectResult> playEffect(LotroGame game) {
final Set<PhysicalCard> hand = new HashSet<PhysicalCard>(game.getGameState().getHand(_playerId));
final Collection<PhysicalCard> cards = Filters.filter(game.getGameState().getHand(_playerId), game.getGameState(), game.getModifiersQuerying(), _filters);
SubAction subAction = new SubAction(_action);
subAction.appendEffect(
new ChooseAndPutNextCardFromHandOnBottomOfLibrary(subAction, hand));
new ChooseAndPutNextCardFromHandOnBottomOfLibrary(subAction, cards));
processSubAction(game, subAction);
return null;
}
private class ChooseAndPutNextCardFromHandOnBottomOfLibrary extends ChooseArbitraryCardsEffect {
private Set<PhysicalCard> _remainingCards;
private Collection<PhysicalCard> _remainingCards;
private SubAction _subAction;
public ChooseAndPutNextCardFromHandOnBottomOfLibrary(SubAction subAction, Set<PhysicalCard> remainingCards) {
public ChooseAndPutNextCardFromHandOnBottomOfLibrary(SubAction subAction, Collection<PhysicalCard> remainingCards) {
super(_playerId, "Choose a card to put on bottom of your deck", remainingCards, 1, 1);
_subAction = subAction;
_remainingCards = remainingCards;

View File

@@ -2,9 +2,10 @@ 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.PutHandBeneathDrawDeckEffect;
import com.gempukku.lotro.cards.effects.PutCardsFromHandBeneathDrawDeckEffect;
import com.gempukku.lotro.common.Block;
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;
@@ -32,7 +33,7 @@ public class Card4_337 extends AbstractSite {
if (PlayConditions.canUseSiteDuringPhase(game.getGameState(), Phase.FELLOWSHIP, self)) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new PutHandBeneathDrawDeckEffect(action, playerId));
new PutCardsFromHandBeneathDrawDeckEffect(action, playerId, Filters.any));
action.appendEffect(
new DrawCardEffect(playerId, 4));
return Collections.singletonList(action);

View File

@@ -0,0 +1,51 @@
package com.gempukku.lotro.cards.set8.shire;
import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.AddBurdenEffect;
import com.gempukku.lotro.cards.effects.PutCardsFromHandBeneathDrawDeckEffect;
import com.gempukku.lotro.cards.effects.RevealCardsFromHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
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.timing.Action;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
/**
* Set: Siege of Gondor
* Side: Free
* Culture: Shire
* Twilight Cost: 0
* Type: Condition • Support Area
* Game Text: Regroup: Exert an unbound Hobbit and add a burden to reveal your hand. Place each Free Peoples card
* revealed this way beneath your draw deck.
*/
public class Card8_109 extends AbstractPermanent {
public Card8_109() {
super(Side.FREE_PEOPLE, 0, CardType.CONDITION, Culture.SHIRE, Zone.SUPPORT, "Closer and Closer He Bent");
}
@Override
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.REGROUP, self)
&& PlayConditions.canExert(self, game, Filters.unboundCompanion, Race.HOBBIT)) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.unboundCompanion, Race.HOBBIT));
action.appendCost(
new AddBurdenEffect(self, 1));
action.appendEffect(
new RevealCardsFromHandEffect(self, playerId, new HashSet<PhysicalCard>(game.getGameState().getHand(playerId))));
action.appendEffect(
new PutCardsFromHandBeneathDrawDeckEffect(action, playerId, Side.FREE_PEOPLE));
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -5,7 +5,7 @@ import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseActionProxyEffect;
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
import com.gempukku.lotro.cards.effects.PutHandBeneathDrawDeckEffect;
import com.gempukku.lotro.cards.effects.PutCardsFromHandBeneathDrawDeckEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filters;
@@ -70,7 +70,7 @@ public class Card8_068 extends AbstractEvent {
if (killResult.getKilledCards().contains(againstNazgul)) {
RequiredTriggerAction action = new RequiredTriggerAction(self);
action.appendEffect(
new PutHandBeneathDrawDeckEffect(action, game.getGameState().getCurrentPlayerId()));
new PutCardsFromHandBeneathDrawDeckEffect(action, game.getGameState().getCurrentPlayerId()));
return Collections.singletonList(action);
}
}