"Their Marching Companies"

This commit is contained in:
marcins78@gmail.com
2011-11-15 12:34:35 +00:00
parent 008ef7356f
commit dd24fd36ac

View File

@@ -0,0 +1,75 @@
package com.gempukku.lotro.cards.set8.sauron;
import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.StackCardFromPlayEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndPlayCardFromStackedEffect;
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.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.effects.RemoveThreatsEffect;
import com.gempukku.lotro.logic.timing.Action;
import java.util.Collections;
import java.util.List;
/**
* Set: Siege of Gondor
* Side: Shadow
* Culture: Sauron
* Twilight Cost: 1
* Type: Condition • Support Area
* Game Text: Engine. To play, spot a [SAURON] minion. Regroup: Remove a threat to stack your [SAURON] minion on a site
* you control. Shadow: Remove a threat to play a [SAURON] minion stacked on a site you control.
*/
public class Card8_107 extends AbstractPermanent {
public Card8_107() {
super(Side.SHADOW, 1, CardType.CONDITION, Culture.SAURON, Zone.SUPPORT, "Their Marching Companies");
addKeyword(Keyword.ENGINE);
}
@Override
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
return super.checkPlayRequirements(playerId, game, self, twilightModifier, ignoreRoamingPenalty)
&& PlayConditions.canSpot(game, Culture.SAURON, CardType.MINION);
}
@Override
protected List<? extends Action> getExtraPhaseActions(final String playerId, LotroGame game, final PhysicalCard self) {
if (PlayConditions.canUseShadowCardDuringPhase(game, Phase.REGROUP, self, 0)
&& PlayConditions.canRemoveThreat(game, self, 1)) {
final ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new RemoveThreatsEffect(self, 1));
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose a site you control", Filters.siteControlled(playerId)) {
@Override
protected void cardSelected(LotroGame game, final PhysicalCard site) {
action.insertEffect(
new ChooseActiveCardEffect(self, playerId, "Choose your SAURON minion", Filters.owner(playerId), Culture.SAURON, CardType.MINION) {
@Override
protected void cardSelected(LotroGame game, PhysicalCard minion) {
action.insertEffect(
new StackCardFromPlayEffect(minion, site));
}
});
}
});
return Collections.singletonList(action);
}
if (PlayConditions.canUseShadowCardDuringPhase(game, Phase.SHADOW, self, 0)
&& PlayConditions.canRemoveThreat(game, self, 1)
&& PlayConditions.canPlayFromStacked(playerId, game, Filters.siteControlled(playerId), Culture.SAURON, CardType.MINION)) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new RemoveThreatsEffect(self, 1));
action.appendEffect(
new ChooseAndPlayCardFromStackedEffect(playerId, Filters.siteControlled(playerId), Culture.SAURON, CardType.MINION));
return Collections.singletonList(action);
}
return null;
}
}