"Questions That Need Answering"

This commit is contained in:
marcins78@gmail.com
2011-09-06 11:41:07 +00:00
parent 022c6f03db
commit 40854b7d96
5 changed files with 122 additions and 14 deletions

View File

@@ -0,0 +1,40 @@
package com.gempukku.lotro.cards.effects;
import com.gempukku.lotro.common.Zone;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.timing.AbstractEffect;
import com.gempukku.lotro.logic.timing.EffectResult;
public class PutCardFromDeckIntoHandOrDiscardEffect extends AbstractEffect {
private PhysicalCard _physicalCard;
public PutCardFromDeckIntoHandOrDiscardEffect(PhysicalCard physicalCard) {
_physicalCard = physicalCard;
}
public PhysicalCard getCard() {
return _physicalCard;
}
@Override
public boolean canPlayEffect(LotroGame game) {
return _physicalCard.getZone() == Zone.DECK;
}
@Override
public EffectResult getRespondableResult() {
return null;
}
@Override
public String getText() {
return "Put card from deck into hand";
}
@Override
public void playEffect(LotroGame game) {
game.getGameState().removeCardFromZone(_physicalCard);
game.getGameState().addCardToZone(_physicalCard, Zone.HAND);
}
}

View File

@@ -3,6 +3,7 @@ package com.gempukku.lotro.cards.set1.dwarven;
import com.gempukku.lotro.cards.AbstractEvent;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.ChooseAndExertCharacterEffect;
import com.gempukku.lotro.cards.effects.PutCardFromDiscardIntoHandEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
@@ -74,16 +75,14 @@ public class Card1_022 extends AbstractEvent {
@Override
protected void validDecisionMade(int index, String result) {
if (result.equals("Yes")) {
gameState.removeCardFromZone(_lastCard);
gameState.addCardToZone(_lastCard, Zone.HAND);
_action.addEffect(new PutCardFromDiscardIntoHandEffect(_lastCard));
} else {
_action.addEffect(new DiscardAndChooseToPutToHandEffect(_action, _player, _lastCard, _count + 1));
}
}
}));
} else if (_lastCard != null) {
gameState.removeCardFromZone(_lastCard);
gameState.addCardToZone(_lastCard, Zone.HAND);
_action.addEffect(new PutCardFromDiscardIntoHandEffect(_lastCard));
}
}
}

View File

@@ -2,7 +2,12 @@ package com.gempukku.lotro.cards.set1.dwarven;
import com.gempukku.lotro.cards.AbstractEvent;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.cards.effects.DiscardCardFromDeckEffect;
import com.gempukku.lotro.cards.effects.PutCardFromDeckIntoHandOrDiscardEffect;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
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;
@@ -37,7 +42,7 @@ public class Card1_028 extends AbstractEvent {
@Override
public PlayEventAction getPlayCardAction(final String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
PlayEventAction action = new PlayEventAction(self);
final PlayEventAction action = new PlayEventAction(self);
action.addEffect(
new UnrespondableEffect() {
@Override
@@ -47,11 +52,10 @@ public class Card1_028 extends AbstractEvent {
List<? extends PhysicalCard> cards = new LinkedList<PhysicalCard>(deck.subList(0, cardCount));
for (PhysicalCard card : cards) {
game.getGameState().removeCardFromZone(card);
if (card.getBlueprint().getSide() == Side.FREE_PEOPLE)
game.getGameState().addCardToZone(card, Zone.HAND);
action.addEffect(new PutCardFromDeckIntoHandOrDiscardEffect(card));
else
game.getGameState().addCardToZone(card, Zone.DISCARD);
action.addEffect(new DiscardCardFromDeckEffect(playerId, card));
}
}
});

View File

@@ -0,0 +1,65 @@
package com.gempukku.lotro.cards.set1.gandalf;
import com.gempukku.lotro.cards.AbstractEvent;
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.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
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.LinkedList;
import java.util.List;
/**
* Set: The Fellowship of the Ring
* Side: Free
* Culture: Gandalf
* Twilight Cost: 3
* Type: Event
* Game Text: Spell. Fellowship: If the twilight pool has fewer than 3 twilight tokens, spot Gandalf to look at the top
* 4 cards of your draw deck. Take 2 of those cards into hand and discard the rest.
*/
public class Card1_081 extends AbstractEvent {
public Card1_081() {
super(Side.FREE_PEOPLE, Culture.GANDALF, "Questions That Need Answering", Phase.FELLOWSHIP);
addKeyword(Keyword.SPELL);
}
@Override
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self) {
return game.getGameState().getTwilightPool() < 3
&& Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.name("Gandalf"));
}
@Override
public PlayEventAction getPlayCardAction(final String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
final PlayEventAction action = new PlayEventAction(self);
List<? extends PhysicalCard> deck = game.getGameState().getDeck(playerId);
final List<PhysicalCard> cards = new LinkedList<PhysicalCard>(deck.subList(0, Math.min(deck.size(), 4)));
action.addEffect(
new ChooseArbitraryCardsEffect(playerId, "Choose cards to put into hand", cards, Math.min(cards.size(), 2), Math.min(cards.size(), 2)) {
@Override
protected void cardsSelected(List<PhysicalCard> selectedCards) {
for (PhysicalCard selectedCard : selectedCards) {
action.addEffect(new PutCardFromDeckIntoHandOrDiscardEffect(selectedCard));
cards.remove(selectedCard);
}
for (PhysicalCard remainingCard : cards)
action.addEffect(new DiscardCardFromDeckEffect(playerId, remainingCard));
}
});
return action;
}
@Override
public int getTwilightCost() {
return 3;
}
}

View File

@@ -2,9 +2,10 @@ package com.gempukku.lotro.cards.set1.shire;
import com.gempukku.lotro.cards.AbstractAlly;
import com.gempukku.lotro.cards.effects.AddTwilightEffect;
import com.gempukku.lotro.cards.effects.DiscardCardFromDeckEffect;
import com.gempukku.lotro.cards.effects.PutCardFromDeckIntoHandOrDiscardEffect;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Zone;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.DefaultCostToEffectAction;
@@ -36,7 +37,7 @@ public class Card1_301 extends AbstractAlly {
@Override
protected List<? extends Action> getExtraPhaseActions(final String playerId, LotroGame game, PhysicalCard self) {
if (game.getGameState().getTwilightPool() < 3) {
DefaultCostToEffectAction action = new DefaultCostToEffectAction(self, Keyword.FELLOWSHIP, "Add (2) to reveal the top 3 cards of your draw deck. Take all SHIRE cards revealed into hand and discard the rest.");
final DefaultCostToEffectAction action = new DefaultCostToEffectAction(self, Keyword.FELLOWSHIP, "Add (2) to reveal the top 3 cards of your draw deck. Take all SHIRE cards revealed into hand and discard the rest.");
action.addCost(new AddTwilightEffect(2));
action.addEffect(
new UnrespondableEffect() {
@@ -47,11 +48,10 @@ public class Card1_301 extends AbstractAlly {
List<? extends PhysicalCard> cards = new LinkedList<PhysicalCard>(deck.subList(0, cardCount));
for (PhysicalCard card : cards) {
game.getGameState().removeCardFromZone(card);
if (card.getBlueprint().getCulture() == Culture.SHIRE)
game.getGameState().addCardToZone(card, Zone.HAND);
action.addEffect(new PutCardFromDeckIntoHandOrDiscardEffect(card));
else
game.getGameState().addCardToZone(card, Zone.DISCARD);
action.addEffect(new DiscardCardFromDeckEffect(playerId, card));
}
}
});