"Sharku's Warg"
This commit is contained in:
@@ -67,7 +67,7 @@ public abstract class AbstractAttachable extends AbstractLotroCardBlueprint {
|
||||
});
|
||||
}
|
||||
|
||||
protected abstract Filter getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self);
|
||||
protected abstract Filterable getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self);
|
||||
|
||||
@Override
|
||||
public final boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.gempukku.lotro.cards.set5.isengard;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractAttachable;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.effects.CancelActivatedEffect;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
|
||||
import com.gempukku.lotro.cards.modifiers.StrengthModifier;
|
||||
import com.gempukku.lotro.cards.modifiers.VitalityModifier;
|
||||
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.effects.ActivateCardEffect;
|
||||
import com.gempukku.lotro.logic.modifiers.KeywordModifier;
|
||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||
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: Battle of Helm's Deep
|
||||
* Side: Shadow
|
||||
* Culture: Isengard
|
||||
* Twilight Cost: 5
|
||||
* Type: Possession • Mount
|
||||
* Strength: +5
|
||||
* Vitality: +3
|
||||
* Game Text: Bearer must be a warg-rider. If bearer is Sharku, he is damage +1. Response: If a skirmish special
|
||||
* ability is used in a skirmish involving bearer, exert bearer to cancel that action.
|
||||
*/
|
||||
public class Card5_059 extends AbstractAttachable {
|
||||
public Card5_059() {
|
||||
super(Side.SHADOW, CardType.POSSESSION, 5, Culture.ISENGARD, PossessionClass.MOUNT, "Sharku's Warg", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Filterable getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
|
||||
return Keyword.WARG_RIDER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Modifier> getAlwaysOnModifiers(LotroGame game, PhysicalCard self) {
|
||||
List<Modifier> modifiers = new LinkedList<Modifier>();
|
||||
modifiers.add(
|
||||
new StrengthModifier(self, Filters.hasAttached(self), 4));
|
||||
modifiers.add(
|
||||
new VitalityModifier(self, Filters.hasAttached(self), 3));
|
||||
modifiers.add(
|
||||
new KeywordModifier(self, Filters.and(Filters.hasAttached(self), Filters.name("Sharku")), Keyword.DAMAGE, 1));
|
||||
return modifiers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends Action> getOptionalInPlayBeforeActions(String playerId, LotroGame game, Effect effect, PhysicalCard self) {
|
||||
if (effect.getType() == EffectResult.Type.ACTIVATE) {
|
||||
ActivateCardEffect activateEffect = (ActivateCardEffect) effect;
|
||||
if (Filters.inSkirmish.accepts(game.getGameState(), game.getModifiersQuerying(), self.getAttachedTo())
|
||||
&& activateEffect.getActionTimeword() == Phase.SKIRMISH
|
||||
&& !activateEffect.isCancelled()
|
||||
&& PlayConditions.canExert(self, game, Filters.hasAttached(self))) {
|
||||
ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(
|
||||
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.hasAttached(self)));
|
||||
action.appendEffect(
|
||||
new CancelActivatedEffect(self, activateEffect));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -17,8 +17,6 @@ public class ActivateCardAction extends AbstractCostToEffectAction {
|
||||
|
||||
public ActivateCardAction(PhysicalCard physicalCard) {
|
||||
_physicalCard = physicalCard;
|
||||
|
||||
_activateCardEffect = new ActivateCardEffect(physicalCard);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -45,6 +43,7 @@ public class ActivateCardAction extends AbstractCostToEffectAction {
|
||||
|
||||
if (!_activated) {
|
||||
_activated = true;
|
||||
_activateCardEffect = new ActivateCardEffect(_physicalCard, getActionTimeword());
|
||||
return _activateCardEffect;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.gempukku.lotro.logic.effects;
|
||||
|
||||
import com.gempukku.lotro.common.Phase;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.GameUtils;
|
||||
@@ -8,11 +9,17 @@ import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
|
||||
public class ActivateCardEffect extends AbstractEffect {
|
||||
private PhysicalCard _source;
|
||||
private Phase _actionTimeword;
|
||||
|
||||
private boolean _cancelled;
|
||||
|
||||
public ActivateCardEffect(PhysicalCard source) {
|
||||
public ActivateCardEffect(PhysicalCard source, Phase actionTimeword) {
|
||||
_source = source;
|
||||
_actionTimeword = actionTimeword;
|
||||
}
|
||||
|
||||
public Phase getActionTimeword() {
|
||||
return _actionTimeword;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user