"Boromir's Cloak"

This commit is contained in:
marcins78@gmail.com
2011-09-06 17:32:53 +00:00
parent 4d85d84d91
commit 3978d5d288

View File

@@ -0,0 +1,58 @@
package com.gempukku.lotro.cards.set1.gondor;
import com.gempukku.lotro.cards.AbstractAttachableFPPossession;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.ExertCharacterEffect;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.filters.Filter;
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.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.effects.DiscardCardFromPlayEffect;
import com.gempukku.lotro.logic.timing.Action;
import java.util.Collections;
import java.util.List;
/**
* Set: The Fellowship of the Ring
* Side: Free
* Culture: Gondor
* Twilight Cost: 0
* Type: Possession • Cloak
* Game Text: Bearer must be Boromir. Maneuver: Exert Boromir to discard a weather condition.
*/
public class Card1_098 extends AbstractAttachableFPPossession {
public Card1_098() {
super(0, Culture.GONDOR, "Boromir's Cloak", true);
addKeyword(Keyword.CLOAK);
}
@Override
protected Filter getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
return Filters.and(Filters.name("Boromir"), Filters.not(Filters.hasAttached(Filters.keyword(Keyword.CLOAK))));
}
@Override
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, final PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game.getGameState(), Phase.MANEUVER, self)
&& PlayConditions.canExert(game.getGameState(), game.getModifiersQuerying(), self.getAttachedTo())) {
final DefaultCostToEffectAction action = new DefaultCostToEffectAction(self, Keyword.MANEUVER, "Exert Boromir to discard a weather condition.");
action.addCost(new ExertCharacterEffect(self.getAttachedTo()));
action.addEffect(
new ChooseActiveCardEffect(playerId, "Choose a Weather condition", Filters.keyword(Keyword.WEATHER), Filters.type(CardType.CONDITION)) {
@Override
protected void cardSelected(PhysicalCard weatherCondition) {
action.addEffect(new DiscardCardFromPlayEffect(self, weatherCondition));
}
});
return Collections.singletonList(action);
}
return null;
}
}