"Disarmed"

This commit is contained in:
marcins78@gmail.com
2012-03-07 11:19:47 +00:00
parent 7a9f7e3e69
commit 7ed0571e67

View File

@@ -0,0 +1,102 @@
package com.gempukku.lotro.cards.set18.gondor;
import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.ChoiceEffect;
import com.gempukku.lotro.cards.effects.SpotEffect;
import com.gempukku.lotro.cards.effects.TransferPermanentEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.cards.modifiers.MayNotBearModifier;
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.actions.RequiredTriggerAction;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect;
import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
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.LinkedList;
import java.util.List;
/**
* Set: Treachery & Deceit
* Side: Free
* Culture: Gondor
* Twilight Cost: 2
* Type: Condition • Support Area
* Strength: -1
* Game Text: Bearer cannot bear any Shadow cards. When this condition is transferred to bearer, discard all Shadow
* cards it bears. Maneuver: Exert a [GONDOR] Man or spot a ranger to transfer this condition from your support area
* to minion.
*/
public class Card18_046 extends AbstractPermanent {
public Card18_046() {
super(Side.FREE_PEOPLE, 2, CardType.CONDITION, Culture.GONDOR, Zone.SUPPORT, "Disarmed");
}
@Override
public List<? extends Modifier> getAlwaysOnModifiers(LotroGame game, PhysicalCard self) {
List<Modifier> modifiers = new LinkedList<Modifier>();
modifiers.add(
new MayNotBearModifier(self, Filters.hasAttached(self), Side.SHADOW));
modifiers.add(
new StrengthModifier(self, Filters.hasAttached(self), -1));
return modifiers;
}
@Override
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.transferredCard(game, effectResult, self, null, Filters.any)) {
RequiredTriggerAction action = new RequiredTriggerAction(self);
action.appendEffect(
new DiscardCardsFromPlayEffect(self, Filters.attachedTo(Filters.hasAttached(self)), Side.SHADOW));
return Collections.singletonList(action);
}
return null;
}
@Override
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, final PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.MANEUVER, self)
&& self.getZone() == Zone.SUPPORT
&& (PlayConditions.canExert(self, game, Culture.GONDOR, Race.MAN)
|| PlayConditions.canSpot(game, Keyword.RANGER))) {
final ActivateCardAction action = new ActivateCardAction(self);
List<Effect> possibleCosts = new LinkedList<Effect>();
possibleCosts.add(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Culture.GONDOR, Race.MAN) {
@Override
public String getText(LotroGame game) {
return "Exert a GONDOR Man";
}
});
possibleCosts.add(
new SpotEffect(1, Keyword.RANGER) {
@Override
public String getText(LotroGame game) {
return "Spot a ranger";
}
});
action.appendCost(
new ChoiceEffect(action, playerId, possibleCosts));
action.appendEffect(
new ChooseActiveCardEffect(self, playerId, "Choose a minion", CardType.MINION) {
@Override
protected void cardSelected(LotroGame game, PhysicalCard card) {
action.appendEffect(
new TransferPermanentEffect(self, card));
}
});
return Collections.singletonList(action);
}
return null;
}
}