"Horse of Rohan"
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package com.gempukku.lotro.cards.modifiers.evaluator;
|
||||
|
||||
import com.gempukku.lotro.filters.Filter;
|
||||
import com.gempukku.lotro.common.Filterable;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.GameState;
|
||||
@@ -8,14 +8,14 @@ import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
|
||||
import com.gempukku.lotro.logic.modifiers.evaluator.Evaluator;
|
||||
|
||||
public class CountSpottableEvaluator implements Evaluator {
|
||||
private Filter[] _filters;
|
||||
private Filterable[] _filters;
|
||||
private int _limit;
|
||||
|
||||
public CountSpottableEvaluator(Filter... filters) {
|
||||
public CountSpottableEvaluator(Filterable... filters) {
|
||||
this(Integer.MAX_VALUE, filters);
|
||||
}
|
||||
|
||||
public CountSpottableEvaluator(int limit, Filter... filters) {
|
||||
public CountSpottableEvaluator(int limit, Filterable... filters) {
|
||||
_filters = filters;
|
||||
_limit = limit;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class Card4_282 extends AbstractEvent {
|
||||
PlayEventAction action = new PlayEventAction(self);
|
||||
action.appendEffect(
|
||||
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, playerId,
|
||||
new CountSpottableEvaluator(3, Filters.culture(Culture.ROHAN), Filters.race(Race.MAN)),
|
||||
new CountSpottableEvaluator(3, Culture.ROHAN, Race.MAN),
|
||||
Filters.unboundCompanion));
|
||||
return action;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.gempukku.lotro.cards.set4.rohan;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractAttachableFPPossession;
|
||||
import com.gempukku.lotro.cards.effects.ExertCharactersEffect;
|
||||
import com.gempukku.lotro.common.*;
|
||||
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.RequiredTriggerAction;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Set: The Two Towers
|
||||
* Side: Free
|
||||
* Culture: Rohan
|
||||
* Twilight Cost: 2
|
||||
* Type: Possession • Mount
|
||||
* Game Text: To play, spot a [ROHAN] Man. Bearer must be a Man, Elf, or Wizard. At the start of each skirmish
|
||||
* involving bearer, each minion skirmishing bearer must exert.
|
||||
*/
|
||||
public class Card4_283 extends AbstractAttachableFPPossession {
|
||||
public Card4_283() {
|
||||
super(2, 0, 0, Culture.ROHAN, PossessionClass.MOUNT, "Horse of Rohan");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Filter getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
|
||||
return Filters.or(Race.MAN, Race.ELF, Race.WIZARD);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (effectResult.getType() == EffectResult.Type.START_OF_PHASE
|
||||
&& game.getGameState().getCurrentPhase() == Phase.SKIRMISH
|
||||
&& Filters.inSkirmish.accepts(game.getGameState(), game.getModifiersQuerying(), self.getAttachedTo())) {
|
||||
RequiredTriggerAction action = new RequiredTriggerAction(self);
|
||||
action.appendEffect(
|
||||
new ExertCharactersEffect(self, Filters.and(CardType.MINION, Filters.inSkirmishAgainst(Filters.hasAttached(self)))));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
package com.gempukku.lotro.common;
|
||||
|
||||
public enum CardType {
|
||||
public enum CardType implements Filterable {
|
||||
THE_ONE_RING, SITE, COMPANION, ALLY, MINION, POSSESSION, ARTIFACT, EVENT, CONDITION
|
||||
}
|
||||
|
||||
@@ -449,6 +449,8 @@ public class Filters {
|
||||
private static Filter changeToFilter(Filterable filter) {
|
||||
if (filter instanceof Filter)
|
||||
return (Filter) filter;
|
||||
else if (filter instanceof CardType)
|
||||
return Filters.type((CardType) filter);
|
||||
else if (filter instanceof Culture)
|
||||
return Filters.culture((Culture) filter);
|
||||
else if (filter instanceof Keyword)
|
||||
|
||||
Reference in New Issue
Block a user