Simplifying strength bonus effects.
This commit is contained in:
@@ -9,6 +9,7 @@ import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.actions.CostToEffectAction;
|
||||
import com.gempukku.lotro.logic.actions.SubAction;
|
||||
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
|
||||
import com.gempukku.lotro.logic.modifiers.evaluator.ConstantEvaluator;
|
||||
import com.gempukku.lotro.logic.modifiers.evaluator.Evaluator;
|
||||
|
||||
public class ChooseAndAddUntilEOPStrengthBonusEffect extends ChooseActiveCardEffect {
|
||||
@@ -16,8 +17,12 @@ public class ChooseAndAddUntilEOPStrengthBonusEffect extends ChooseActiveCardEff
|
||||
private PhysicalCard _source;
|
||||
private Evaluator _bonusEvaluator;
|
||||
|
||||
public ChooseAndAddUntilEOPStrengthBonusEffect(CostToEffectAction action, PhysicalCard source, String playerId, Evaluator bonusEvaluator, Filter... filters) {
|
||||
super(source, playerId, "Choose character", filters);
|
||||
public ChooseAndAddUntilEOPStrengthBonusEffect(CostToEffectAction action, PhysicalCard source, String playerId, int bonus, Filter... selectionFilter) {
|
||||
this(action, source, playerId, new ConstantEvaluator(bonus), selectionFilter);
|
||||
}
|
||||
|
||||
public ChooseAndAddUntilEOPStrengthBonusEffect(CostToEffectAction action, PhysicalCard source, String playerId, Evaluator bonusEvaluator, Filter... selectionFilter) {
|
||||
super(source, playerId, "Choose character", selectionFilter);
|
||||
_action = action;
|
||||
_source = source;
|
||||
_bonusEvaluator = bonusEvaluator;
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.gempukku.lotro.cards.modifiers.evaluator;
|
||||
|
||||
import com.gempukku.lotro.filters.Filter;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.GameState;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
|
||||
import com.gempukku.lotro.logic.modifiers.evaluator.Evaluator;
|
||||
|
||||
public class CardMatchesEvaluator implements Evaluator {
|
||||
private Filter[] _filters;
|
||||
private int _matches;
|
||||
private int _default;
|
||||
|
||||
public CardMatchesEvaluator(int defaultValue, int matches, Filter... filters) {
|
||||
_default = defaultValue;
|
||||
_matches = matches;
|
||||
_filters = filters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int evaluateExpression(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard self) {
|
||||
return Filters.and(_filters).accepts(gameState, modifiersQuerying, self) ? _matches : _default;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.gempukku.lotro.cards.modifiers.evaluator;
|
||||
|
||||
import com.gempukku.lotro.filters.Filter;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.GameState;
|
||||
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
|
||||
import com.gempukku.lotro.logic.modifiers.evaluator.Evaluator;
|
||||
|
||||
public class LocationMatchesEvaluator implements Evaluator {
|
||||
private Filter[] _filters;
|
||||
private int _matches;
|
||||
private int _default;
|
||||
|
||||
public LocationMatchesEvaluator(int defaultValue, int matches, Filter... filters) {
|
||||
_default = defaultValue;
|
||||
_matches = matches;
|
||||
_filters = filters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int evaluateExpression(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard self) {
|
||||
return Filters.and(_filters).accepts(gameState, modifiersQuerying, gameState.getCurrentSite()) ? _matches : _default;
|
||||
}
|
||||
}
|
||||
@@ -2,15 +2,12 @@ package com.gempukku.lotro.cards.set1.dwarven;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractEvent;
|
||||
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.cards.effects.choose.ChooseAndAddUntilEOPStrengthBonusEffect;
|
||||
import com.gempukku.lotro.cards.modifiers.evaluator.CardMatchesEvaluator;
|
||||
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.effects.ChooseActiveCardEffect;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* Set: The Fellowship of the Ring
|
||||
@@ -29,19 +26,10 @@ public class Card1_003 extends AbstractEvent {
|
||||
public PlayEventAction getPlayCardAction(String playerId, final LotroGame game, final PhysicalCard self, int twilightModifier) {
|
||||
final PlayEventAction action = new PlayEventAction(self);
|
||||
action.appendEffect(
|
||||
new ChooseActiveCardEffect(self, playerId, "Choose Dwarf", Filters.race(Race.DWARF)) {
|
||||
@Override
|
||||
protected void cardSelected(LotroGame game, PhysicalCard dwarf) {
|
||||
Collection<PhysicalCard> attachedDwarvenHandWeapons = Filters.filter(game.getGameState().getAttachedCards(dwarf), game.getGameState(), game.getModifiersQuerying(), Filters.keyword(Keyword.HAND_WEAPON), Filters.culture(Culture.DWARVEN));
|
||||
int bonus = (attachedDwarvenHandWeapons.size() == 0) ? 2 : 3;
|
||||
action.appendEffect(
|
||||
new AddUntilEndOfPhaseModifierEffect(
|
||||
new StrengthModifier(self, Filters.sameCard(dwarf), bonus), Phase.SKIRMISH
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, playerId,
|
||||
new CardMatchesEvaluator(2, 3,
|
||||
Filters.hasAttached(Filters.culture(Culture.DWARVEN), Filters.keyword(Keyword.HAND_WEAPON))),
|
||||
Filters.race(Race.DWARF)));
|
||||
|
||||
return action;
|
||||
}
|
||||
|
||||
@@ -2,14 +2,12 @@ package com.gempukku.lotro.cards.set1.dwarven;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractEvent;
|
||||
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.cards.effects.choose.ChooseAndAddUntilEOPStrengthBonusEffect;
|
||||
import com.gempukku.lotro.cards.modifiers.evaluator.LocationMatchesEvaluator;
|
||||
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.effects.ChooseActiveCardEffect;
|
||||
|
||||
/**
|
||||
* Set: The Fellowship of the Ring
|
||||
@@ -33,16 +31,9 @@ public class Card1_026 extends AbstractEvent {
|
||||
public PlayEventAction getPlayCardAction(String playerId, final LotroGame game, final PhysicalCard self, int twilightModifier) {
|
||||
final PlayEventAction action = new PlayEventAction(self);
|
||||
action.appendEffect(
|
||||
new ChooseActiveCardEffect(self, playerId, "Choose Dwarf", Filters.race(Race.DWARF)) {
|
||||
@Override
|
||||
protected void cardSelected(LotroGame game, PhysicalCard dwarf) {
|
||||
GameState gameState = game.getGameState();
|
||||
int bonus = (game.getModifiersQuerying().hasKeyword(gameState, gameState.getCurrentSite(), Keyword.UNDERGROUND)) ? 4 : 2;
|
||||
action.appendEffect(
|
||||
new AddUntilEndOfPhaseModifierEffect(new StrengthModifier(self, Filters.sameCard(dwarf), bonus), Phase.SKIRMISH));
|
||||
}
|
||||
}
|
||||
);
|
||||
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, playerId,
|
||||
new LocationMatchesEvaluator(2, 4, Filters.keyword(Keyword.UNDERGROUND)),
|
||||
Filters.race(Race.DWARF)));
|
||||
return action;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,14 +2,12 @@ package com.gempukku.lotro.cards.set1.elven;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractEvent;
|
||||
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.cards.effects.choose.ChooseAndAddUntilEOPStrengthBonusEffect;
|
||||
import com.gempukku.lotro.cards.modifiers.evaluator.CardMatchesEvaluator;
|
||||
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.game.state.Skirmish;
|
||||
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
|
||||
|
||||
/**
|
||||
* Set: The Fellowship of the Ring
|
||||
@@ -34,19 +32,9 @@ public class Card1_032 extends AbstractEvent {
|
||||
final PlayEventAction action = new PlayEventAction(self);
|
||||
|
||||
action.appendEffect(
|
||||
new ChooseActiveCardEffect(self, playerId, "Choose an Elf", Filters.race(Race.ELF)) {
|
||||
@Override
|
||||
protected void cardSelected(LotroGame game, PhysicalCard elf) {
|
||||
Skirmish skirmish = game.getGameState().getSkirmish();
|
||||
int bonus = 2;
|
||||
if (skirmish != null) {
|
||||
if (skirmish.getFellowshipCharacter() == elf && Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.MINION), Filters.keyword(Keyword.ARCHER)))
|
||||
bonus = 4;
|
||||
}
|
||||
|
||||
action.appendEffect(new AddUntilEndOfPhaseModifierEffect(new StrengthModifier(self, Filters.sameCard(elf), bonus), Phase.SKIRMISH));
|
||||
}
|
||||
});
|
||||
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, playerId,
|
||||
new CardMatchesEvaluator(2, 4, Filters.inSkirmishAgainst(Filters.keyword(Keyword.ARCHER))),
|
||||
Filters.race(Race.ELF)));
|
||||
return action;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.gempukku.lotro.cards.set1.elven;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractEvent;
|
||||
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.cards.effects.choose.ChooseAndAddUntilEOPStrengthBonusEffect;
|
||||
import com.gempukku.lotro.cards.modifiers.evaluator.CardMatchesEvaluator;
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
import com.gempukku.lotro.common.Phase;
|
||||
import com.gempukku.lotro.common.Race;
|
||||
@@ -11,8 +11,6 @@ import com.gempukku.lotro.common.Side;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.game.state.Skirmish;
|
||||
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
|
||||
|
||||
/**
|
||||
* Set: The Fellowship of the Ring
|
||||
@@ -37,19 +35,9 @@ public class Card1_037 extends AbstractEvent {
|
||||
final PlayEventAction action = new PlayEventAction(self);
|
||||
|
||||
action.appendEffect(
|
||||
new ChooseActiveCardEffect(self, playerId, "Choose an Elf", Filters.race(Race.ELF)) {
|
||||
@Override
|
||||
protected void cardSelected(LotroGame game, PhysicalCard elf) {
|
||||
Skirmish skirmish = game.getGameState().getSkirmish();
|
||||
int bonus = 2;
|
||||
if (skirmish != null) {
|
||||
if (skirmish.getFellowshipCharacter() == elf && Filters.filter(skirmish.getShadowCharacters(), game.getGameState(), game.getModifiersQuerying(), Filters.race(Race.NAZGUL)).size() > 0)
|
||||
bonus = 4;
|
||||
}
|
||||
|
||||
action.appendEffect(new AddUntilEndOfPhaseModifierEffect(new StrengthModifier(self, Filters.sameCard(elf), bonus), Phase.SKIRMISH));
|
||||
}
|
||||
});
|
||||
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, playerId,
|
||||
new CardMatchesEvaluator(2, 4, Filters.inSkirmishAgainst(Filters.race(Race.NAZGUL))),
|
||||
Filters.race(Race.ELF)));
|
||||
|
||||
return action;
|
||||
}
|
||||
|
||||
@@ -2,13 +2,11 @@ package com.gempukku.lotro.cards.set1.gandalf;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractEvent;
|
||||
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.cards.effects.choose.ChooseAndAddUntilEOPStrengthBonusEffect;
|
||||
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.effects.ChooseActiveCardEffect;
|
||||
|
||||
/**
|
||||
* Set: The Fellowship of the Ring
|
||||
@@ -34,14 +32,7 @@ public class Card1_083 extends AbstractEvent {
|
||||
public PlayEventAction getPlayCardAction(String playerId, LotroGame game, final PhysicalCard self, int twilightModifier) {
|
||||
final PlayEventAction action = new PlayEventAction(self);
|
||||
action.appendEffect(
|
||||
new ChooseActiveCardEffect(self, playerId, "Choose a minion", Filters.type(CardType.MINION)) {
|
||||
@Override
|
||||
protected void cardSelected(LotroGame game, PhysicalCard minion) {
|
||||
action.appendEffect(
|
||||
new AddUntilEndOfPhaseModifierEffect(
|
||||
new StrengthModifier(self, Filters.sameCard(minion), -3), Phase.SKIRMISH));
|
||||
}
|
||||
});
|
||||
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, playerId, -3, Filters.type(CardType.MINION)));
|
||||
return action;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,8 @@ package com.gempukku.lotro.cards.set1.gondor;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractCompanion;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
|
||||
import com.gempukku.lotro.cards.effects.ExertCharactersEffect;
|
||||
import com.gempukku.lotro.cards.modifiers.StrengthModifier;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndAddUntilEOPStrengthBonusEffect;
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
import com.gempukku.lotro.common.Phase;
|
||||
import com.gempukku.lotro.common.Race;
|
||||
@@ -13,7 +12,6 @@ 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.ChooseActiveCardEffect;
|
||||
import com.gempukku.lotro.logic.timing.Action;
|
||||
|
||||
import java.util.Collections;
|
||||
@@ -43,15 +41,7 @@ public class Card1_097 extends AbstractCompanion {
|
||||
final ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(new ExertCharactersEffect(self, self));
|
||||
action.appendEffect(
|
||||
new ChooseActiveCardEffect(self, playerId, "Choose a Hobbit", Filters.race(Race.HOBBIT)) {
|
||||
@Override
|
||||
protected void cardSelected(LotroGame game, PhysicalCard hobbit) {
|
||||
action.appendEffect(
|
||||
new AddUntilEndOfPhaseModifierEffect(
|
||||
new StrengthModifier(self, Filters.sameCard(hobbit), 3), Phase.SKIRMISH));
|
||||
}
|
||||
}
|
||||
);
|
||||
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, playerId, 3, Filters.race(Race.HOBBIT)));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -2,13 +2,12 @@ package com.gempukku.lotro.cards.set1.gondor;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractEvent;
|
||||
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.cards.effects.choose.ChooseAndAddUntilEOPStrengthBonusEffect;
|
||||
import com.gempukku.lotro.cards.modifiers.evaluator.CardMatchesEvaluator;
|
||||
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.effects.ChooseActiveCardEffect;
|
||||
|
||||
/**
|
||||
* Set: The Fellowship of the Ring
|
||||
@@ -28,16 +27,9 @@ public class Card1_116 extends AbstractEvent {
|
||||
final PlayEventAction action = new PlayEventAction(self);
|
||||
|
||||
action.appendEffect(
|
||||
new ChooseActiveCardEffect(self, playerId, "Choose a GONDOR companion", Filters.culture(Culture.GONDOR), Filters.type(CardType.COMPANION)) {
|
||||
@Override
|
||||
protected void cardSelected(LotroGame game, PhysicalCard gondorCompanion) {
|
||||
boolean isDefender = game.getModifiersQuerying().hasKeyword(game.getGameState(), gondorCompanion, Keyword.DEFENDER);
|
||||
int bonus = isDefender ? 4 : 2;
|
||||
action.appendEffect(
|
||||
new AddUntilEndOfPhaseModifierEffect(
|
||||
new StrengthModifier(self, Filters.sameCard(gondorCompanion), bonus), Phase.SKIRMISH));
|
||||
}
|
||||
});
|
||||
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, playerId,
|
||||
new CardMatchesEvaluator(2, 4, Filters.keyword(Keyword.DEFENDER)),
|
||||
Filters.culture(Culture.GONDOR), Filters.type(CardType.COMPANION)));
|
||||
return action;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.gempukku.lotro.cards.set1.gondor;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractEvent;
|
||||
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.cards.effects.choose.ChooseAndAddUntilEOPStrengthBonusEffect;
|
||||
import com.gempukku.lotro.cards.modifiers.evaluator.CardMatchesEvaluator;
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
import com.gempukku.lotro.common.Keyword;
|
||||
import com.gempukku.lotro.common.Phase;
|
||||
@@ -11,8 +11,6 @@ import com.gempukku.lotro.common.Side;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.game.state.Skirmish;
|
||||
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
|
||||
|
||||
/**
|
||||
* Set: The Fellowship of the Ring
|
||||
@@ -32,20 +30,9 @@ public class Card1_117 extends AbstractEvent {
|
||||
final PlayEventAction action = new PlayEventAction(self);
|
||||
|
||||
action.appendEffect(
|
||||
new ChooseActiveCardEffect(self, playerId, "Choose a Ranger", Filters.keyword(Keyword.RANGER)) {
|
||||
@Override
|
||||
protected void cardSelected(LotroGame game, PhysicalCard gondorCompanion) {
|
||||
int bonus = 2;
|
||||
Skirmish skirmish = game.getGameState().getSkirmish();
|
||||
if (skirmish != null && skirmish.getFellowshipCharacter() == gondorCompanion
|
||||
&& Filters.filter(skirmish.getShadowCharacters(), game.getGameState(), game.getModifiersQuerying(), Filters.keyword(Keyword.ROAMING)).size() > 0)
|
||||
bonus = 4;
|
||||
|
||||
action.appendEffect(
|
||||
new AddUntilEndOfPhaseModifierEffect(
|
||||
new StrengthModifier(self, Filters.sameCard(gondorCompanion), bonus), Phase.SKIRMISH));
|
||||
}
|
||||
});
|
||||
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, playerId,
|
||||
new CardMatchesEvaluator(2, 4, Filters.inSkirmishAgainst(Filters.keyword(Keyword.ROAMING))),
|
||||
Filters.keyword(Keyword.RANGER)));
|
||||
return action;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,14 +2,12 @@ package com.gempukku.lotro.cards.set1.isengard;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractPermanent;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
|
||||
import com.gempukku.lotro.cards.modifiers.StrengthModifier;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndAddUntilEOPStrengthBonusEffect;
|
||||
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.ChooseActiveCardEffect;
|
||||
import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect;
|
||||
import com.gempukku.lotro.logic.modifiers.Modifier;
|
||||
import com.gempukku.lotro.logic.modifiers.TwilightCostModifier;
|
||||
@@ -39,14 +37,7 @@ public class Card1_133 extends AbstractPermanent {
|
||||
final ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(new DiscardCardsFromPlayEffect(self, self));
|
||||
action.appendEffect(
|
||||
new ChooseActiveCardEffect(self, playerId, "Choose an Uruk-hai", Filters.race(Race.URUK_HAI)) {
|
||||
@Override
|
||||
protected void cardSelected(LotroGame game, PhysicalCard urukHai) {
|
||||
action.appendEffect(
|
||||
new AddUntilEndOfPhaseModifierEffect(
|
||||
new StrengthModifier(self, Filters.sameCard(urukHai), 2), Phase.SKIRMISH));
|
||||
}
|
||||
});
|
||||
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, playerId, 2, Filters.race(Race.URUK_HAI)));
|
||||
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.gempukku.lotro.cards.set1.moria;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractEvent;
|
||||
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.cards.effects.choose.ChooseAndAddUntilEOPStrengthBonusEffect;
|
||||
import com.gempukku.lotro.cards.modifiers.evaluator.CardMatchesEvaluator;
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
import com.gempukku.lotro.common.Phase;
|
||||
import com.gempukku.lotro.common.Race;
|
||||
@@ -11,8 +11,6 @@ import com.gempukku.lotro.common.Side;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.game.state.Skirmish;
|
||||
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
|
||||
|
||||
/**
|
||||
* Set: The Fellowship of the Ring
|
||||
@@ -31,21 +29,9 @@ public class Card1_168 extends AbstractEvent {
|
||||
public PlayEventAction getPlayCardAction(String playerId, final LotroGame game, final PhysicalCard self, int twilightModifier) {
|
||||
final PlayEventAction action = new PlayEventAction(self);
|
||||
action.appendEffect(
|
||||
new ChooseActiveCardEffect(self, playerId, "Choose MORIA orc", Filters.culture(Culture.MORIA), Filters.race(Race.ORC)) {
|
||||
@Override
|
||||
protected void cardSelected(LotroGame game, PhysicalCard moriaOrc) {
|
||||
int bonus = 2;
|
||||
Skirmish skirmish = game.getGameState().getSkirmish();
|
||||
if (skirmish != null && skirmish.getShadowCharacters().contains(moriaOrc)) {
|
||||
PhysicalCard fpCharacter = skirmish.getFellowshipCharacter();
|
||||
if (fpCharacter != null && fpCharacter.getBlueprint().getRace() == Race.DWARF)
|
||||
bonus = 4;
|
||||
}
|
||||
action.appendEffect(
|
||||
new AddUntilEndOfPhaseModifierEffect(
|
||||
new StrengthModifier(self, Filters.sameCard(moriaOrc), bonus), Phase.SKIRMISH));
|
||||
}
|
||||
});
|
||||
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, playerId,
|
||||
new CardMatchesEvaluator(2, 4, Filters.inSkirmishAgainst(Filters.race(Race.DWARF))),
|
||||
Filters.culture(Culture.MORIA), Filters.race(Race.ORC)));
|
||||
return action;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,8 @@ package com.gempukku.lotro.cards.set1.moria;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractMinion;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
|
||||
import com.gempukku.lotro.cards.effects.RemoveTwilightEffect;
|
||||
import com.gempukku.lotro.cards.modifiers.StrengthModifier;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndAddUntilEOPStrengthBonusEffect;
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
import com.gempukku.lotro.common.Phase;
|
||||
import com.gempukku.lotro.common.Race;
|
||||
@@ -12,7 +11,6 @@ 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.ChooseActiveCardEffect;
|
||||
import com.gempukku.lotro.logic.timing.Action;
|
||||
|
||||
import java.util.Collections;
|
||||
@@ -40,14 +38,7 @@ public class Card1_186 extends AbstractMinion {
|
||||
final ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(new RemoveTwilightEffect(3));
|
||||
action.appendEffect(
|
||||
new ChooseActiveCardEffect(self, playerId, "Choose MORIA Orc", Filters.culture(Culture.MORIA), Filters.race(Race.ORC)) {
|
||||
@Override
|
||||
protected void cardSelected(LotroGame game, PhysicalCard moriaOrc) {
|
||||
action.appendEffect(
|
||||
new AddUntilEndOfPhaseModifierEffect(
|
||||
new StrengthModifier(self, Filters.sameCard(moriaOrc), 2), Phase.SKIRMISH));
|
||||
}
|
||||
});
|
||||
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, playerId, 2, Filters.culture(Culture.MORIA), Filters.race(Race.ORC)));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -303,12 +303,12 @@ public class Filters {
|
||||
};
|
||||
}
|
||||
|
||||
public static Filter hasAttached(final Filter filter) {
|
||||
public static Filter hasAttached(final Filter... filters) {
|
||||
return new Filter() {
|
||||
@Override
|
||||
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
|
||||
List<PhysicalCard> physicalCardList = gameState.getAttachedCards(physicalCard);
|
||||
return (Filters.filter(physicalCardList, gameState, modifiersQuerying, filter).size() > 0);
|
||||
return (Filters.filter(physicalCardList, gameState, modifiersQuerying, filters).size() > 0);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user