"Grimbold"
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.gempukku.lotro.cards.effects;
|
||||
|
||||
import com.gempukku.lotro.common.Block;
|
||||
import com.gempukku.lotro.common.Filterable;
|
||||
import com.gempukku.lotro.common.Zone;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
@@ -20,19 +21,25 @@ public class PlaySiteEffect extends AbstractEffect {
|
||||
private String _playerId;
|
||||
private Block _siteBlock;
|
||||
private int _siteNumber;
|
||||
private Filterable[] _extraSiteFilters;
|
||||
|
||||
public PlaySiteEffect(String playerId, Block siteBlock, int siteNumber) {
|
||||
this(playerId, siteBlock, siteNumber, Filters.any);
|
||||
}
|
||||
|
||||
public PlaySiteEffect(String playerId, Block siteBlock, int siteNumber, Filterable... extraSiteFilters) {
|
||||
_playerId = playerId;
|
||||
_siteBlock = siteBlock;
|
||||
_siteNumber = siteNumber;
|
||||
_extraSiteFilters = extraSiteFilters;
|
||||
}
|
||||
|
||||
private PhysicalCard getMatchingSite(LotroGame game) {
|
||||
Collection<PhysicalCard> matching;
|
||||
if (_siteBlock != null) {
|
||||
matching = Filters.filter(game.getGameState().getAdventureDeck(_playerId), game.getGameState(), game.getModifiersQuerying(), Filters.siteNumber(_siteNumber), Filters.siteBlock(_siteBlock));
|
||||
matching = Filters.filter(game.getGameState().getAdventureDeck(_playerId), game.getGameState(), game.getModifiersQuerying(), Filters.and(_extraSiteFilters, Filters.siteNumber(_siteNumber), Filters.siteBlock(_siteBlock)));
|
||||
} else {
|
||||
matching = Filters.filter(game.getGameState().getAdventureDeck(_playerId), game.getGameState(), game.getModifiersQuerying(), Filters.siteNumber(_siteNumber));
|
||||
matching = Filters.filter(game.getGameState().getAdventureDeck(_playerId), game.getGameState(), game.getModifiersQuerying(), Filters.and(_extraSiteFilters, Filters.siteNumber(_siteNumber)));
|
||||
}
|
||||
if (matching.size() > 0)
|
||||
return matching.iterator().next();
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.gempukku.lotro.cards.set7.rohan;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractCompanion;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.effects.PlaySiteEffect;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndDiscardCardsFromHandEffect;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.actions.ActivateCardAction;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Set: The Return of the King
|
||||
* Side: Free
|
||||
* Culture: Rohan
|
||||
* Twilight Cost: 2
|
||||
* Type: Companion • Man
|
||||
* Strength: 6
|
||||
* Vitality: 3
|
||||
* Resistance: 6
|
||||
* Game Text: Valiant. Skirmish: Replace the fellowship's site with your plains site of the same number to discard
|
||||
* a card from hand.
|
||||
*/
|
||||
public class Card7_233 extends AbstractCompanion {
|
||||
public Card7_233() {
|
||||
super(2, 6, 3, Culture.ROHAN, Race.MAN, null, "Grimbold", true);
|
||||
addKeyword(Keyword.VALIANT);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<ActivateCardAction> getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
|
||||
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.SKIRMISH, self)) {
|
||||
ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(
|
||||
new PlaySiteEffect(playerId, Block.KING, game.getGameState().getCurrentSiteNumber(), Keyword.PLAINS));
|
||||
action.appendEffect(
|
||||
new ChooseAndDiscardCardsFromHandEffect(action, playerId, false, 1));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user