"Ship of Smoke"

This commit is contained in:
marcins78@gmail.com
2012-03-06 16:04:44 +00:00
parent 6f408b1a3c
commit bb6da8cf0a
4 changed files with 17 additions and 41 deletions

View File

@@ -20,11 +20,18 @@ public class PutCardsFromDeckIntoHandDiscardRestEffect extends AbstractSubAction
private String _playerId;
private Filterable[] _filters;
private Set<PhysicalCard> _cards;
private int _drawn;
private int _maxCount;
public PutCardsFromDeckIntoHandDiscardRestEffect(Action action, PhysicalCard source, String playerId, Collection<? extends PhysicalCard> cards, Filterable... filters) {
this(action, source, playerId, cards, Integer.MAX_VALUE, filters);
}
public PutCardsFromDeckIntoHandDiscardRestEffect(Action action, PhysicalCard source, String playerId, Collection<? extends PhysicalCard> cards, int maxCount, Filterable... filters) {
_action = action;
_source = source;
_playerId = playerId;
_maxCount = maxCount;
_filters = filters;
_cards = new HashSet<PhysicalCard>(cards);
}
@@ -74,12 +81,14 @@ public class PutCardsFromDeckIntoHandDiscardRestEffect extends AbstractSubAction
@Override
protected void doPlayEffect(LotroGame game) {
if (game.getModifiersQuerying().canDrawCardNoIncrement(game.getGameState(), _playerId)
&& _drawn < _maxCount
&& Filters.filter(_remainingCards, game.getGameState(), game.getModifiersQuerying(), _filters).size() > 0) {
_subAction.insertEffect(
new ChooseArbitraryCardsEffect(_playerId, "Put next card to put into your hand", _remainingCards, Filters.and(_filters), 1, 1) {
@Override
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> selectedCards) {
for (PhysicalCard selectedCard : selectedCards) {
_drawn++;
_remainingCards.remove(selectedCard);
_subAction.insertEffect(
new ChooseAndPutNextCardFromDeckIntoHand(_subAction, _remainingCards));

View File

@@ -2,8 +2,7 @@ package com.gempukku.lotro.cards.set1.dwarven;
import com.gempukku.lotro.cards.AbstractOldEvent;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.DiscardCardFromDeckEffect;
import com.gempukku.lotro.cards.effects.PutCardFromDeckIntoHandOrDiscardEffect;
import com.gempukku.lotro.cards.effects.PutCardsFromDeckIntoHandDiscardRestEffect;
import com.gempukku.lotro.cards.effects.RevealTopCardsOfDrawDeckEffect;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Phase;
@@ -41,18 +40,14 @@ public class Card1_028 extends AbstractOldEvent {
}
@Override
public PlayEventAction getPlayCardAction(final String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
public PlayEventAction getPlayCardAction(final String playerId, LotroGame game, final PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
final PlayEventAction action = new PlayEventAction(self);
action.appendEffect(
new RevealTopCardsOfDrawDeckEffect(self, playerId, 3) {
@Override
protected void cardsRevealed(List<PhysicalCard> cards) {
for (PhysicalCard card : cards) {
if (card.getBlueprint().getSide() == Side.FREE_PEOPLE)
action.appendEffect(new PutCardFromDeckIntoHandOrDiscardEffect(card));
else
action.appendEffect(new DiscardCardFromDeckEffect(card));
}
action.appendEffect(
new PutCardsFromDeckIntoHandDiscardRestEffect(action, self, playerId, cards, Side.FREE_PEOPLE));
}
});
return action;

View File

@@ -2,8 +2,7 @@ package com.gempukku.lotro.cards.set1.gandalf;
import com.gempukku.lotro.cards.AbstractOldEvent;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.DiscardCardFromDeckEffect;
import com.gempukku.lotro.cards.effects.PutCardFromDeckIntoHandOrDiscardEffect;
import com.gempukku.lotro.cards.effects.PutCardsFromDeckIntoHandDiscardRestEffect;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
@@ -11,9 +10,7 @@ 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.effects.ChooseArbitraryCardsEffect;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
@@ -45,18 +42,7 @@ public class Card1_081 extends AbstractOldEvent {
List<? extends PhysicalCard> deck = game.getGameState().getDeck(playerId);
final List<PhysicalCard> cards = new LinkedList<PhysicalCard>(deck.subList(0, Math.min(deck.size(), 4)));
action.appendEffect(
new ChooseArbitraryCardsEffect(playerId, "Choose cards to put into hand", cards, Math.min(cards.size(), 2), Math.min(cards.size(), 2)) {
@Override
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> selectedCards) {
for (PhysicalCard selectedCard : selectedCards) {
action.appendEffect(new PutCardFromDeckIntoHandOrDiscardEffect(selectedCard));
cards.remove(selectedCard);
}
for (PhysicalCard remainingCard : cards)
action.appendEffect(new DiscardCardFromDeckEffect(remainingCard));
}
});
new PutCardsFromDeckIntoHandDiscardRestEffect(action, self, playerId, cards, 2, Filters.any));
return action;
}

View File

@@ -2,8 +2,7 @@ package com.gempukku.lotro.cards.set1.gandalf;
import com.gempukku.lotro.cards.AbstractOldEvent;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.DiscardCardFromDeckEffect;
import com.gempukku.lotro.cards.effects.PutCardFromDeckIntoHandOrDiscardEffect;
import com.gempukku.lotro.cards.effects.PutCardsFromDeckIntoHandDiscardRestEffect;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
@@ -11,9 +10,7 @@ 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.effects.ChooseArbitraryCardsEffect;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
@@ -45,18 +42,7 @@ public class Card1_082 extends AbstractOldEvent {
List<? extends PhysicalCard> deck = game.getGameState().getDeck(playerId);
final List<PhysicalCard> cards = new LinkedList<PhysicalCard>(deck.subList(0, Math.min(deck.size(), 2)));
action.appendEffect(
new ChooseArbitraryCardsEffect(playerId, "Choose card to put into hand", cards, Math.min(cards.size(), 1), Math.min(cards.size(), 1)) {
@Override
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> selectedCards) {
for (PhysicalCard selectedCard : selectedCards) {
action.appendEffect(new PutCardFromDeckIntoHandOrDiscardEffect(selectedCard));
cards.remove(selectedCard);
}
for (PhysicalCard remainingCard : cards)
action.appendEffect(new DiscardCardFromDeckEffect(remainingCard));
}
});
new PutCardsFromDeckIntoHandDiscardRestEffect(action, self, playerId, cards, 1, Filters.any));
return action;
}