"Hall of Our Fathers"

This commit is contained in:
marcins78@gmail.com
2011-11-30 12:02:11 +00:00
parent 4615d0f367
commit b705be3ade
2 changed files with 114 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
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 java.util.HashSet;
import java.util.List;
import java.util.Set;
public class ExchangeCardsInHandWithStackedOnEffect extends AbstractEffect {
private String _performingPlayer;
private PhysicalCard _source;
private String _playerHand;
private PhysicalCard _stackedOn;
public ExchangeCardsInHandWithStackedOnEffect(String performingPlayer, PhysicalCard source, String playerHand, PhysicalCard stackedOn) {
_performingPlayer = performingPlayer;
_source = source;
_playerHand = playerHand;
_stackedOn = stackedOn;
}
@Override
public String getText(LotroGame game) {
return null;
}
@Override
protected FullEffectResult playEffectReturningResult(LotroGame game) {
if (isPlayableInFull(game)) {
final List<PhysicalCard> stackedCards = game.getGameState().getStackedCards(_stackedOn);
final List<? extends PhysicalCard> hand = game.getGameState().getHand(_playerHand);
Set<PhysicalCard> toRemove = new HashSet<PhysicalCard>();
toRemove.addAll(stackedCards);
toRemove.addAll(hand);
game.getGameState().removeCardsFromZone(_performingPlayer, toRemove);
for (PhysicalCard cardInHand : hand)
game.getGameState().stackCard(game, cardInHand, _stackedOn);
for (PhysicalCard stackedCard : stackedCards)
game.getGameState().addCardToZone(game, stackedCard, Zone.HAND);
return new FullEffectResult(true, true);
}
return new FullEffectResult(false, false);
}
@Override
public Type getType() {
return null;
}
@Override
public boolean isPlayableInFull(LotroGame game) {
return _stackedOn.getZone().isInPlay();
}
}

View File

@@ -0,0 +1,54 @@
package com.gempukku.lotro.cards.set11.dwarven;
import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.ExchangeCardsInHandWithStackedOnEffect;
import com.gempukku.lotro.cards.effects.StackTopCardsFromDeckEffect;
import com.gempukku.lotro.common.*;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.OptionalTriggerAction;
import com.gempukku.lotro.logic.actions.RequiredTriggerAction;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collections;
import java.util.List;
/**
* Set: Shadows
* Side: Free
* Culture: Dwarven
* Twilight Cost: 2
* Type: Condition • Support Area
* Game Text: When you play this condition, stack the top 8 cards of your draw deck here. At the start of your maneuver
* phase, you may spot a Dwarf to exchange the cards stacked here with your hand.
*/
public class Card11_011 extends AbstractPermanent {
public Card11_011() {
super(Side.FREE_PEOPLE, 2, CardType.CONDITION, Culture.DWARVEN, Zone.SUPPORT, "Hall of Our Fathers", true);
}
@Override
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.played(game, effectResult, self)) {
RequiredTriggerAction action = new RequiredTriggerAction(self);
action.appendEffect(
new StackTopCardsFromDeckEffect(self, self.getOwner(), 8, self));
return Collections.singletonList(action);
}
return null;
}
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.startOfPhase(game, effectResult, Phase.MANEUVER)
&& PlayConditions.canSpot(game, Race.DWARF)) {
OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendEffect(
new ExchangeCardsInHandWithStackedOnEffect(playerId, self, playerId, self));
return Collections.singletonList(action);
}
return null;
}
}