"Seeking It Always"

This commit is contained in:
marcins78@gmail.com
2011-09-10 22:06:32 +00:00
parent 624f7d9e58
commit a1333573b9

View File

@@ -0,0 +1,72 @@
package com.gempukku.lotro.cards.set1.sauron;
import com.gempukku.lotro.cards.AbstractLotroCardBlueprint;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.actions.PlayPermanentAction;
import com.gempukku.lotro.cards.effects.CancelEffect;
import com.gempukku.lotro.cards.effects.ChooseAndExertCharacterEffect;
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.DefaultCostToEffectAction;
import com.gempukku.lotro.logic.timing.Action;
import com.gempukku.lotro.logic.timing.Effect;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collections;
import java.util.List;
/**
* Set: The Fellowship of the Ring
* Side: Shadow
* Culture: Sauron
* Twilight Cost: 1
* Type: Condition
* Game Text: Search. Plays to your support area. Response: If a stealth event is played, exert a [SAURON] tracker
* to cancel that event.
*/
public class Card1_275 extends AbstractLotroCardBlueprint {
public Card1_275() {
super(Side.SHADOW, CardType.CONDITION, Culture.SAURON, "Seeking It Always");
addKeyword(Keyword.SEARCH);
}
@Override
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
return PlayConditions.canPayForShadowCard(game, self, twilightModifier);
}
@Override
public Action getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
return new PlayPermanentAction(self, Zone.SHADOW_SUPPORT);
}
@Override
public int getTwilightCost() {
return 1;
}
@Override
public List<? extends Action> getPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canPlayCardDuringPhase(game, Phase.SHADOW, self)
&& checkPlayRequirements(playerId, game, self, 0))
return Collections.singletonList(getPlayCardAction(playerId, game, self, 0));
return null;
}
@Override
public List<? extends Action> getOptionalBeforeActions(String playerId, LotroGame game, Effect effect, EffectResult effectResult, PhysicalCard self) {
if (PlayConditions.canUseShadowCardDuringPhase(game.getGameState(), null, self, 0)
&& Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.culture(Culture.SAURON), Filters.keyword(Keyword.TRACKER), Filters.canExert())
&& PlayConditions.played(game.getGameState(), game.getModifiersQuerying(), effectResult, Filters.and(Filters.type(CardType.EVENT), Filters.keyword(Keyword.STEALTH)))) {
DefaultCostToEffectAction action = new DefaultCostToEffectAction(self, null, "Exert a SAURON tracker to cancel that event.");
action.addCost(
new ChooseAndExertCharacterEffect(action, playerId, "Choose a SAURON tracker", true, Filters.culture(Culture.SAURON), Filters.keyword(Keyword.TRACKER), Filters.canExert()));
action.addEffect(
new CancelEffect(effect));
return Collections.singletonList(action);
}
return null;
}
}