"Aragorn's Bow"

This commit is contained in:
marcins78@gmail.com
2011-09-06 16:22:21 +00:00
parent 166d899187
commit 08afadf382

View File

@@ -0,0 +1,71 @@
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.AddUntilEndOfPhaseModifierEffect;
import com.gempukku.lotro.cards.effects.ExertCharacterEffect;
import com.gempukku.lotro.cards.modifiers.DoesNotAddToArcheryTotalModifier;
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.WoundCharacterEffect;
import com.gempukku.lotro.logic.modifiers.KeywordModifier;
import com.gempukku.lotro.logic.modifiers.Modifier;
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: 1
* Type: Possession • Ranged Weapon
* Game Text: Bearer must be Aragorn. He is an archer. Archery: Exert Aragorn to wound a minion; Aragorn does not add
* to the fellowship archery total.
*/
public class Card1_090 extends AbstractAttachableFPPossession {
public Card1_090() {
super(1, Culture.GONDOR, "Aragorn's Bow", true);
addKeyword(Keyword.RANGED_WEAPON);
}
@Override
protected Filter getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
return Filters.and(Filters.name("Aragorn"), Filters.not(Filters.hasAttached(Filters.keyword(Keyword.RANGED_WEAPON))));
}
@Override
public Modifier getAlwaysOnEffect(PhysicalCard self) {
return new KeywordModifier(self, Filters.attachedTo(self), Keyword.ARCHER);
}
@Override
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game.getGameState(), Phase.ARCHERY, self)
&& PlayConditions.canExert(game.getGameState(), game.getModifiersQuerying(), self.getAttachedTo())) {
final DefaultCostToEffectAction action = new DefaultCostToEffectAction(self, Keyword.ARCHERY, "Exert Aragorn to wound a minion; Aragorn does not add to the fellowship archery total.");
action.addCost(new ExertCharacterEffect(self.getAttachedTo()));
action.addCost(
new AddUntilEndOfPhaseModifierEffect(
new DoesNotAddToArcheryTotalModifier(self, Filters.sameCard(self.getAttachedTo())), Phase.ARCHERY));
action.addEffect(
new ChooseActiveCardEffect(playerId, "Choose minion", Filters.type(CardType.MINION)) {
@Override
protected void cardSelected(PhysicalCard minion) {
action.addEffect(new WoundCharacterEffect(minion));
}
});
return Collections.singletonList(action);
}
return null;
}
}