"Banner of the Mark"

This commit is contained in:
marcins78@gmail.com
2011-10-22 17:13:28 +00:00
parent 8f8e7154cb
commit 10c5517c03

View File

@@ -0,0 +1,76 @@
package com.gempukku.lotro.cards.set6.rohan;
import com.gempukku.lotro.cards.AbstractAttachableFPPossession;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.LiberateASiteEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Filterable;
import com.gempukku.lotro.common.PossessionClass;
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.actions.OptionalTriggerAction;
import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect;
import com.gempukku.lotro.logic.timing.Action;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collections;
import java.util.List;
/**
* Set: Ents of Fangorn
* Side: Free
* Culture: Rohan
* Twilight Cost: 1
* Type: Possession • Hand Weapon
* Game Text: Bearer must be a [ROHAN] companion. Each time bearer wins a skirmish, you may exert a minion.
* Response: If bearer wins a skirmish, discard this possession to liberate a site.
*/
public class Card6_090 extends AbstractAttachableFPPossession {
public Card6_090() {
super(1, 0, 0, Culture.ROHAN, PossessionClass.HAND_WEAPON, "Banner of the Mark");
}
@Override
protected Filterable getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
return Filters.and(Culture.ROHAN, CardType.COMPANION);
}
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (PlayConditions.winsSkirmish(game, effectResult, self.getAttachedTo())) {
OptionalTriggerAction action = new OptionalTriggerAction(self) {
@Override
public String getText(LotroGame game) {
return "Exert a minion";
}
};
action.appendEffect(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, CardType.MINION));
return Collections.singletonList(action);
}
return null;
}
@Override
public List<? extends Action> getOptionalInPlayAfterActions(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (PlayConditions.winsSkirmish(game, effectResult, self.getAttachedTo())
&& PlayConditions.canSelfDiscard(self, game)) {
ActivateCardAction action = new ActivateCardAction(self) {
@Override
public String getText(LotroGame game) {
return "Discard this to liberate a site";
}
};
action.appendCost(
new DiscardCardsFromPlayEffect(self, self));
action.appendEffect(
new LiberateASiteEffect(self));
return Collections.singletonList(action);
}
return null;
}
}