- "Barrows of Edoras" now makes you choose the order you put cards on bottom of your deck.

This commit is contained in:
marcins78@gmail.com
2011-11-14 15:01:55 +00:00
parent 2a6d733981
commit 9b2fcb58f6
4 changed files with 82 additions and 8 deletions

View File

@@ -0,0 +1,73 @@
package com.gempukku.lotro.cards.effects;
import com.gempukku.lotro.cards.effects.choose.ChooseArbitraryCardsEffect;
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.AbstractSubActionEffect;
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 {
private Action _action;
private String _playerId;
public PutHandBeneathDrawDeckEffect(Action action, String playerId) {
_action = action;
_playerId = playerId;
}
@Override
public String getText(LotroGame game) {
return null;
}
@Override
public Type getType() {
return null;
}
@Override
public boolean isPlayableInFull(LotroGame game) {
return true;
}
@Override
public Collection<? extends EffectResult> playEffect(LotroGame game) {
final Set<PhysicalCard> hand = new HashSet<PhysicalCard>(game.getGameState().getHand(_playerId));
SubAction subAction = new SubAction(_action);
subAction.appendEffect(
new ChooseAndPutNextCardFromHandOnBottomOfLibrary(subAction, hand));
processSubAction(game, subAction);
return null;
}
private class ChooseAndPutNextCardFromHandOnBottomOfLibrary extends ChooseArbitraryCardsEffect {
private Set<PhysicalCard> _remainingCards;
private SubAction _subAction;
public ChooseAndPutNextCardFromHandOnBottomOfLibrary(SubAction subAction, Set<PhysicalCard> remainingCards) {
super(_playerId, "Choose a card to put on bottom of your deck", remainingCards, 1, 1);
_subAction = subAction;
_remainingCards = remainingCards;
}
@Override
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> selectedCards) {
for (PhysicalCard selectedCard : selectedCards) {
_subAction.appendEffect(
new PutCardFromHandOnBottomOfDeckEffect(selectedCard));
_remainingCards.remove(selectedCard);
if (_remainingCards.size() > 0)
_subAction.appendEffect(
new ChooseAndPutNextCardFromHandOnBottomOfLibrary(_subAction, _remainingCards));
}
}
}
}

View File

@@ -11,21 +11,20 @@ import com.gempukku.lotro.logic.timing.Effect;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
public abstract class ChooseArbitraryCardsEffect extends AbstractEffect {
private String _playerId;
private String _choiceText;
private List<? extends PhysicalCard> _cards;
private Collection<? extends PhysicalCard> _cards;
private Filterable _filter;
private int _minimum;
private int _maximum;
public ChooseArbitraryCardsEffect(String playerId, String choiceText, List<? extends PhysicalCard> cards, int minimum, int maximum) {
public ChooseArbitraryCardsEffect(String playerId, String choiceText, Collection<? extends PhysicalCard> cards, int minimum, int maximum) {
this(playerId, choiceText, cards, Filters.any, minimum, maximum);
}
public ChooseArbitraryCardsEffect(String playerId, String choiceText, List<? extends PhysicalCard> cards, Filterable filter, int minimum, int maximum) {
public ChooseArbitraryCardsEffect(String playerId, String choiceText, Collection<? extends PhysicalCard> cards, Filterable filter, int minimum, int maximum) {
_playerId = playerId;
_choiceText = choiceText;
_cards = cards;

View File

@@ -2,7 +2,7 @@ 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.PutCardFromHandOnBottomOfDeckEffect;
import com.gempukku.lotro.cards.effects.PutHandBeneathDrawDeckEffect;
import com.gempukku.lotro.common.Block;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.game.PhysicalCard;
@@ -31,9 +31,8 @@ public class Card4_337 extends AbstractSite {
public List<? extends Action> getPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseSiteDuringPhase(game.getGameState(), Phase.FELLOWSHIP, self)) {
ActivateCardAction action = new ActivateCardAction(self);
for (PhysicalCard card : game.getGameState().getHand(playerId))
action.appendCost(
new PutCardFromHandOnBottomOfDeckEffect(card));
action.appendCost(
new PutHandBeneathDrawDeckEffect(action, playerId));
action.appendEffect(
new DrawCardEffect(playerId, 4));
return Collections.singletonList(action);

View File

@@ -1,4 +1,7 @@
<pre style="font-size:80%">
<b>14 Nov. 2011</b>
- "Barrows of Edoras" now makes you choose the order you put cards on bottom of your deck.
<b>13 Nov. 2011</b>
- "Uruk Stormer" now allows to take control of a site, if any other Uruk-hai kills a companion or ally.
- "Citadel of Minas Tirith" no longer allows you to heal companion if non-Gondor companion lost a skirmish.