Goblin Scavengers only shows playable cards from discard.
This commit is contained in:
@@ -42,7 +42,7 @@ public class Card1_179 extends AbstractMinion {
|
||||
new ChooseArbitraryCardsEffect(playerId, "Choose card to play", game.getGameState().getDiscard(playerId),
|
||||
Filters.and(
|
||||
Filters.weapon,
|
||||
ExtraFilters.attachableTo(game, additionalAttachmentFilter)), 1, 1) {
|
||||
ExtraFilters.attachableTo(game, additionalAttachmentFilter)), 1, 1, true) {
|
||||
@Override
|
||||
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> selectedCards) {
|
||||
if (selectedCards.size() > 0) {
|
||||
|
||||
@@ -38,7 +38,7 @@ public class Card20_269 extends AbstractMinion {
|
||||
new ChooseArbitraryCardsEffect(playerId, "Choose card to play", game.getGameState().getDiscard(playerId),
|
||||
Filters.and(
|
||||
Filters.weapon,
|
||||
ExtraFilters.attachableTo(game, additionalAttachmentFilter)), 1, 1) {
|
||||
ExtraFilters.attachableTo(game, additionalAttachmentFilter)), 1, 1, true) {
|
||||
@Override
|
||||
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> selectedCards) {
|
||||
if (selectedCards.size() > 0) {
|
||||
|
||||
@@ -16,6 +16,7 @@ import java.util.HashSet;
|
||||
public abstract class ChooseArbitraryCardsEffect extends AbstractEffect {
|
||||
private String _playerId;
|
||||
private String _choiceText;
|
||||
private boolean _showMatchingOnly;
|
||||
private Collection<PhysicalCard> _cards;
|
||||
private Filterable _filter;
|
||||
private int _minimum;
|
||||
@@ -26,8 +27,13 @@ public abstract class ChooseArbitraryCardsEffect extends AbstractEffect {
|
||||
}
|
||||
|
||||
public ChooseArbitraryCardsEffect(String playerId, String choiceText, Collection<? extends PhysicalCard> cards, Filterable filter, int minimum, int maximum) {
|
||||
this(playerId, choiceText, cards, filter, minimum, maximum, false);
|
||||
}
|
||||
|
||||
public ChooseArbitraryCardsEffect(String playerId, String choiceText, Collection<? extends PhysicalCard> cards, Filterable filter, int minimum, int maximum, boolean showMatchingOnly) {
|
||||
_playerId = playerId;
|
||||
_choiceText = choiceText;
|
||||
_showMatchingOnly = showMatchingOnly;
|
||||
_cards = new HashSet<PhysicalCard>(cards);
|
||||
_filter = filter;
|
||||
_minimum = minimum;
|
||||
@@ -65,8 +71,12 @@ public abstract class ChooseArbitraryCardsEffect extends AbstractEffect {
|
||||
} else if (possibleCards.size() == minimum) {
|
||||
cardsSelected(game, possibleCards);
|
||||
} else {
|
||||
Collection<PhysicalCard> toShow = _cards;
|
||||
if (_showMatchingOnly)
|
||||
toShow = possibleCards;
|
||||
|
||||
game.getUserFeedback().sendAwaitingDecision(_playerId,
|
||||
new ArbitraryCardsSelectionDecision(1, _choiceText, _cards, possibleCards, _minimum, _maximum) {
|
||||
new ArbitraryCardsSelectionDecision(1, _choiceText, toShow, possibleCards, _minimum, _maximum) {
|
||||
@Override
|
||||
public void decisionMade(String result) throws DecisionResultInvalidException {
|
||||
cardsSelected(game, getSelectedCardsByResponse(result));
|
||||
|
||||
Reference in New Issue
Block a user