"Seven We Had"
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package com.gempukku.lotro.cards.effects.choose;
|
||||
|
||||
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;
|
||||
@@ -14,7 +14,7 @@ import java.util.Collection;
|
||||
public class ChooseAndDiscardCardsFromPlayEffect extends ChooseActiveCardsEffect {
|
||||
private Action _action;
|
||||
|
||||
public ChooseAndDiscardCardsFromPlayEffect(Action action, String playerId, int minimum, int maximum, Filter... filters) {
|
||||
public ChooseAndDiscardCardsFromPlayEffect(Action action, String playerId, int minimum, int maximum, Filterable... filters) {
|
||||
super(action.getActionSource(), playerId, "Choose cards to discard", minimum, maximum, filters);
|
||||
_action = action;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.gempukku.lotro.cards.set4.shire;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractEvent;
|
||||
import com.gempukku.lotro.cards.actions.PlayEventAction;
|
||||
import com.gempukku.lotro.cards.effects.AddBurdenEffect;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndDiscardCardsFromPlayEffect;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
|
||||
/**
|
||||
* Set: The Two Towers
|
||||
* Side: Free
|
||||
* Culture: Shire
|
||||
* Twilight Cost: 0
|
||||
* Type: Event
|
||||
* Game Text: Fellowship: Add a burden to discard a condition borne by a Hobbit.
|
||||
*/
|
||||
public class Card4_318 extends AbstractEvent {
|
||||
public Card4_318() {
|
||||
super(Side.FREE_PEOPLE, 0, Culture.SHIRE, "Seven We Had", Phase.FELLOWSHIP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlayEventAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
|
||||
PlayEventAction action = new PlayEventAction(self);
|
||||
action.appendCost(
|
||||
new AddBurdenEffect(self, 1));
|
||||
action.appendEffect(
|
||||
new ChooseAndDiscardCardsFromPlayEffect(action, playerId, 1, 1, CardType.CONDITION, Filters.attachedTo(Race.HOBBIT)));
|
||||
return action;
|
||||
}
|
||||
}
|
||||
@@ -387,11 +387,11 @@ public class Filters {
|
||||
};
|
||||
}
|
||||
|
||||
public static Filter attachedTo(final Filter filter) {
|
||||
public static Filter attachedTo(final Filterable... filters) {
|
||||
return new Filter() {
|
||||
@Override
|
||||
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
|
||||
return physicalCard.getAttachedTo() != null && filter.accepts(gameState, modifiersQuerying, physicalCard.getAttachedTo());
|
||||
return physicalCard.getAttachedTo() != null && Filters.and(filters).accepts(gameState, modifiersQuerying, physicalCard.getAttachedTo());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user