"Weapons of Isengard"

This commit is contained in:
marcins78@gmail.com
2011-10-11 10:21:43 +00:00
parent 4644a69146
commit 1f4580a4fb

View File

@@ -0,0 +1,62 @@
package com.gempukku.lotro.cards.set4.isengard;
import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.AddTokenEffect;
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
import com.gempukku.lotro.cards.effects.ChooseAndPlayCardFromHandEffect;
import com.gempukku.lotro.cards.effects.RemoveTokenEffect;
import com.gempukku.lotro.cards.modifiers.ArcheryTotalModifier;
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.effects.DiscardCardsFromPlayEffect;
import com.gempukku.lotro.logic.timing.Action;
import java.util.Collections;
import java.util.List;
/**
* Set: The Two Towers
* Side: Shadow
* Culture: Isengard
* Twilight Cost: 2
* Type: Condition
* Game Text: Machine. Plays to your support area. Shadow: Play an [ISENGARD] archer to place an [ISENGARD] token on
* this card. Archery: Remove 2 [ISENGARD] tokens from this card to make the minion archery total +2. Discard this
* condition.
*/
public class Card4_211 extends AbstractPermanent {
public Card4_211() {
super(Side.SHADOW, 2, CardType.CONDITION, Culture.ISENGARD, Zone.SUPPORT, "Weapons of Isengard");
addKeyword(Keyword.MACHINE);
}
@Override
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseShadowCardDuringPhase(game.getGameState(), Phase.SHADOW, self, 0)
&& PlayConditions.canPlayFromHand(playerId, game, Filters.culture(Culture.ISENGARD), Filters.keyword(Keyword.ARCHER))) {
ActivateCardAction action = new ActivateCardAction(self, Keyword.SHADOW);
action.appendCost(
new ChooseAndPlayCardFromHandEffect(playerId, game.getGameState().getHand(playerId), Filters.and(Filters.culture(Culture.ISENGARD), Filters.keyword(Keyword.ARCHER))));
action.appendEffect(
new AddTokenEffect(self, self, Token.ISENGARD));
return Collections.singletonList(action);
}
if (PlayConditions.canUseShadowCardDuringPhase(game.getGameState(), Phase.ARCHERY, self, 0)
&& game.getGameState().getTokenCount(self, Token.ISENGARD) >= 2) {
ActivateCardAction action = new ActivateCardAction(self, Keyword.ARCHERY);
action.appendCost(
new RemoveTokenEffect(self, self, Token.ISENGARD, 2));
action.appendEffect(
new AddUntilEndOfPhaseModifierEffect(
new ArcheryTotalModifier(self, Side.SHADOW, 2), Phase.ARCHERY));
action.appendEffect(
new DiscardCardsFromPlayEffect(self, self));
return Collections.singletonList(action);
}
return null;
}
}