"Wrath of Harad"
This commit is contained in:
@@ -21,6 +21,7 @@ import java.util.List;
|
||||
|
||||
public class PlayEventAction extends AbstractCostToEffectAction {
|
||||
private PhysicalCard _source;
|
||||
private boolean _requiresRanger;
|
||||
|
||||
private Iterator<Effect> _preCostIterator;
|
||||
|
||||
@@ -35,6 +36,7 @@ public class PlayEventAction extends AbstractCostToEffectAction {
|
||||
|
||||
public PlayEventAction(PhysicalCard card, boolean requiresRanger) {
|
||||
_source = card;
|
||||
_requiresRanger = requiresRanger;
|
||||
|
||||
List<Effect> preCostEffects = new LinkedList<Effect>();
|
||||
preCostEffects.add(new SendMessageEffect(card.getOwner() + " plays " + GameUtils.getCardLink(card) + " from " + card.getZone().getHumanReadable()));
|
||||
@@ -51,6 +53,10 @@ public class PlayEventAction extends AbstractCostToEffectAction {
|
||||
_playCardEffect.setRequiresRanger(true);
|
||||
}
|
||||
|
||||
public boolean isRequiresRanger() {
|
||||
return _requiresRanger;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PhysicalCard getActionSource() {
|
||||
return _source;
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.gempukku.lotro.cards.set4.raider;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractPermanent;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.actions.PlayEventAction;
|
||||
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
|
||||
import com.gempukku.lotro.cards.modifiers.StrengthModifier;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.GameState;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.actions.ActivateCardAction;
|
||||
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
|
||||
import com.gempukku.lotro.logic.effects.ChooseAndWoundCharactersEffect;
|
||||
import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect;
|
||||
import com.gempukku.lotro.logic.modifiers.AbstractModifier;
|
||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifierEffect;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
|
||||
import com.gempukku.lotro.logic.timing.Action;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Set: The Two Towers
|
||||
* Side: Shadow
|
||||
* Culture: Raider
|
||||
* Twilight Cost: 1
|
||||
* Type: Condition
|
||||
* Game Text: Plays to your support area. While you can spot a [RAIDER] Man, each Free Peoples event that spots
|
||||
* or exerts a ranger gains this cost: 'wound a companion.' Skirmish: Discard this condition to make a [RAIDER]
|
||||
* Man strength +2.
|
||||
*/
|
||||
public class Card4_261 extends AbstractPermanent {
|
||||
public Card4_261() {
|
||||
super(Side.SHADOW, 1, CardType.CONDITION, Culture.RAIDER, Zone.SUPPORT, "Wrath of Harad");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Modifier> getAlwaysOnModifiers(PhysicalCard self) {
|
||||
return Collections.singletonList(
|
||||
new AbstractModifier(self, null, null, new ModifierEffect[]{ModifierEffect.ACTION_MODIFIER}) {
|
||||
@Override
|
||||
public boolean canPlayAction(GameState gameState, ModifiersQuerying modifiersQuerying, String performingPlayer, Action action, boolean result) {
|
||||
final PhysicalCard actionSource = action.getActionSource();
|
||||
|
||||
if (actionSource != null
|
||||
&& actionSource.getBlueprint().getCardType() == CardType.EVENT) {
|
||||
PlayEventAction playEventAction = (PlayEventAction) action;
|
||||
if (Filters.canSpot(gameState, modifiersQuerying, Filters.culture(Culture.RAIDER), Filters.race(Race.MAN))
|
||||
&& playEventAction.isRequiresRanger())
|
||||
playEventAction.appendCost(
|
||||
new ChooseAndWoundCharactersEffect(playEventAction, performingPlayer, 1, 1, Filters.type(CardType.COMPANION)));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, final PhysicalCard self) {
|
||||
if (PlayConditions.canUseShadowCardDuringPhase(game.getGameState(), Phase.SKIRMISH, self, 0)) {
|
||||
final ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(
|
||||
new DiscardCardsFromPlayEffect(self, self));
|
||||
action.appendEffect(
|
||||
new ChooseActiveCardEffect(self, playerId, "Choose RAIDER Man", Filters.culture(Culture.RAIDER), Filters.race(Race.MAN)) {
|
||||
@Override
|
||||
protected void cardSelected(PhysicalCard card) {
|
||||
action.insertEffect(
|
||||
new AddUntilEndOfPhaseModifierEffect(
|
||||
new StrengthModifier(self, Filters.sameCard(card), 2), Phase.SKIRMISH));
|
||||
}
|
||||
});
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user