"Leod"
This commit is contained in:
@@ -2,7 +2,7 @@ package com.gempukku.lotro.cards.effects.choose;
|
||||
|
||||
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
|
||||
import com.gempukku.lotro.cards.modifiers.StrengthModifier;
|
||||
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.LotroGame;
|
||||
@@ -17,11 +17,11 @@ public class ChooseAndAddUntilEOPStrengthBonusEffect extends ChooseActiveCardEff
|
||||
private PhysicalCard _source;
|
||||
private Evaluator _bonusEvaluator;
|
||||
|
||||
public ChooseAndAddUntilEOPStrengthBonusEffect(CostToEffectAction action, PhysicalCard source, String playerId, int bonus, Filter... selectionFilter) {
|
||||
public ChooseAndAddUntilEOPStrengthBonusEffect(CostToEffectAction action, PhysicalCard source, String playerId, int bonus, Filterable... selectionFilter) {
|
||||
this(action, source, playerId, new ConstantEvaluator(bonus), selectionFilter);
|
||||
}
|
||||
|
||||
public ChooseAndAddUntilEOPStrengthBonusEffect(CostToEffectAction action, PhysicalCard source, String playerId, Evaluator bonusEvaluator, Filter... selectionFilter) {
|
||||
public ChooseAndAddUntilEOPStrengthBonusEffect(CostToEffectAction action, PhysicalCard source, String playerId, Evaluator bonusEvaluator, Filterable... selectionFilter) {
|
||||
super(source, playerId, "Choose character", selectionFilter);
|
||||
_action = action;
|
||||
_source = source;
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.gempukku.lotro.cards.set4.rohan;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractAlly;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.effects.ExertCharactersEffect;
|
||||
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.actions.RequiredTriggerAction;
|
||||
import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect;
|
||||
import com.gempukku.lotro.logic.timing.Action;
|
||||
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: 1
|
||||
* Type: Ally • Home 4T • Man
|
||||
* Strength: 4
|
||||
* Vitality: 2
|
||||
* Site: 4T
|
||||
* Game Text: Villager. Discard Leod if an opponent controls his home site. Skirmish: Exert Leod to make a mounted
|
||||
* companion strength +2.
|
||||
*/
|
||||
public class Card4_285 extends AbstractAlly {
|
||||
public Card4_285() {
|
||||
super(1, Block.TWO_TOWERS, 4, 4, 2, Race.MAN, Culture.ROHAN, "Leod", true);
|
||||
addKeyword(Keyword.VILLAGER);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<? extends Action> getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
|
||||
if (PlayConditions.canUseFPCardDuringPhase(game.getGameState(), Phase.SKIRMISH, self)
|
||||
&& PlayConditions.canSelfExert(self, game)) {
|
||||
ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(
|
||||
new ExertCharactersEffect(self, self));
|
||||
action.appendEffect(
|
||||
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, playerId, 2, Filters.mounted, CardType.COMPANION));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (Filters.countActive(game.getGameState(), game.getModifiersQuerying(),
|
||||
Filters.siteControlledByShadowPlayer(self.getOwner()),
|
||||
Filters.siteNumber(4),
|
||||
Filters.siteBlock(Block.TWO_TOWERS)) > 0) {
|
||||
RequiredTriggerAction action = new RequiredTriggerAction(self);
|
||||
action.appendEffect(
|
||||
new DiscardCardsFromPlayEffect(self, self));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -433,17 +433,20 @@ public class Filters {
|
||||
}
|
||||
|
||||
public static Filter and(final Filterable... filters) {
|
||||
Filter[] filtersInt = new Filter[filters.length];
|
||||
for (int i = 0; i < filtersInt.length; i++)
|
||||
filtersInt[i] = changeToFilter(filters[i]);
|
||||
Filter[] filtersInt = convertToFilters(filters);
|
||||
return andInternal(filtersInt);
|
||||
}
|
||||
|
||||
public static Filter or(final Filterable... filters) {
|
||||
Filter[] filtersInt = convertToFilters(filters);
|
||||
return orInternal(filtersInt);
|
||||
}
|
||||
|
||||
private static Filter[] convertToFilters(Filterable... filters) {
|
||||
Filter[] filtersInt = new Filter[filters.length];
|
||||
for (int i = 0; i < filtersInt.length; i++)
|
||||
filtersInt[i] = changeToFilter(filters[i]);
|
||||
return orInternal(filtersInt);
|
||||
return filtersInt;
|
||||
}
|
||||
|
||||
private static Filter changeToFilter(Filterable filter) {
|
||||
@@ -482,15 +485,17 @@ public class Filters {
|
||||
};
|
||||
}
|
||||
|
||||
public static Filter and(final Filter[] filters1, final Filter... filters2) {
|
||||
public static Filter and(final Filterable[] filters1, final Filterable... filters2) {
|
||||
final Filter[] newFilters1 = convertToFilters(filters1);
|
||||
final Filter[] newFilters2 = convertToFilters(filters2);
|
||||
return new Filter() {
|
||||
@Override
|
||||
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
|
||||
for (Filter filter : filters1) {
|
||||
for (Filter filter : newFilters1) {
|
||||
if (!filter.accepts(gameState, modifiersQuerying, physicalCard))
|
||||
return false;
|
||||
}
|
||||
for (Filter filter : filters2) {
|
||||
for (Filter filter : newFilters2) {
|
||||
if (!filter.accepts(gameState, modifiersQuerying, physicalCard))
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package com.gempukku.lotro.logic.effects;
|
||||
|
||||
import com.gempukku.lotro.filters.Filter;
|
||||
import com.gempukku.lotro.common.Filterable;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public abstract class ChooseActiveCardEffect extends ChooseActiveCardsEffect {
|
||||
public ChooseActiveCardEffect(PhysicalCard source, String playerId, String choiceText, Filter... filters) {
|
||||
public ChooseActiveCardEffect(PhysicalCard source, String playerId, String choiceText, Filterable... filters) {
|
||||
super(source, playerId, choiceText, 1, 1, filters);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.gempukku.lotro.logic.effects;
|
||||
|
||||
import com.gempukku.lotro.common.Filterable;
|
||||
import com.gempukku.lotro.filters.Filter;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
@@ -18,9 +19,9 @@ public abstract class ChooseActiveCardsEffect extends AbstractEffect {
|
||||
private String _choiceText;
|
||||
private final int _minimum;
|
||||
private final int _maximum;
|
||||
private final Filter[] _filters;
|
||||
private final Filterable[] _filters;
|
||||
|
||||
public ChooseActiveCardsEffect(PhysicalCard source, String playerId, String choiceText, int minimum, int maximum, Filter... filters) {
|
||||
public ChooseActiveCardsEffect(PhysicalCard source, String playerId, String choiceText, int minimum, int maximum, Filterable... filters) {
|
||||
_source = source;
|
||||
_playerId = playerId;
|
||||
_choiceText = choiceText;
|
||||
|
||||
Reference in New Issue
Block a user