"Filibert Bolger"
This commit is contained in:
@@ -10,15 +10,22 @@ import java.util.Collection;
|
||||
|
||||
public class ChooseAndExertCharactersCost extends ChooseActiveCardsCost {
|
||||
private CostToEffectAction _action;
|
||||
private int _exertCount;
|
||||
|
||||
public ChooseAndExertCharactersCost(CostToEffectAction action, String playerId, int minimum, int maximum, Filter... filters) {
|
||||
this(action, playerId, minimum, maximum, 1, filters);
|
||||
}
|
||||
|
||||
public ChooseAndExertCharactersCost(CostToEffectAction action, String playerId, int minimum, int maximum, int exertCount, Filter... filters) {
|
||||
super(playerId, "Choose characters to exert", minimum, maximum, filters);
|
||||
_action = action;
|
||||
_exertCount = exertCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void cardsSelected(Collection<PhysicalCard> characters, boolean success) {
|
||||
_action.insertCost(new ExertCharactersCost(_action.getActionSource(), characters.toArray(new PhysicalCard[characters.size()])));
|
||||
for (int i = 0; i < _exertCount; i++)
|
||||
_action.insertCost(new ExertCharactersCost(_action.getActionSource(), characters.toArray(new PhysicalCard[characters.size()])));
|
||||
if (!success)
|
||||
_action.appendCost(new FailCost());
|
||||
}
|
||||
@@ -29,7 +36,7 @@ public class ChooseAndExertCharactersCost extends ChooseActiveCardsCost {
|
||||
@Override
|
||||
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
|
||||
return modifiersQuerying.canBeExerted(gameState, _action.getActionSource(), physicalCard)
|
||||
&& modifiersQuerying.getVitality(gameState, physicalCard) > 1;
|
||||
&& modifiersQuerying.getVitality(gameState, physicalCard) > _exertCount;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.gempukku.lotro.cards.set2.shire;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractAlly;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.costs.ChooseAndExertCharactersCost;
|
||||
import com.gempukku.lotro.cards.effects.CancelSkirmishEffect;
|
||||
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.actions.ActivateCardAction;
|
||||
import com.gempukku.lotro.logic.timing.Action;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Set: Mines of Moria
|
||||
* Side: Free
|
||||
* Culture: Shire
|
||||
* Twilight Cost: 1
|
||||
* Type: Ally • Home 1 • Hobbit
|
||||
* Strength: 1
|
||||
* Vitality: 2
|
||||
* Site: 1
|
||||
* Game Text: Skirmish: Exert a Hobbit companion twice to cancel a fierce skirmish involving that Hobbit.
|
||||
*/
|
||||
public class Card2_101 extends AbstractAlly {
|
||||
public Card2_101() {
|
||||
super(1, 1, 1, 2, Race.HOBBIT, Culture.SHIRE, "Filibert Bolger", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<? extends Action> getExtraInPlayPhaseActions(String playerId, final LotroGame game, PhysicalCard self) {
|
||||
if (PlayConditions.canUseFPCardDuringPhase(game.getGameState(), Phase.SKIRMISH, self)
|
||||
&& PlayConditions.canExert(self, game.getGameState(), game.getModifiersQuerying(), 2, Filters.race(Race.HOBBIT), Filters.type(CardType.COMPANION))) {
|
||||
final ActivateCardAction action = new ActivateCardAction(self, Keyword.SKIRMISH);
|
||||
action.appendCost(
|
||||
new ChooseAndExertCharactersCost(action, playerId, 1, 1, 2, Filters.race(Race.HOBBIT), Filters.type(CardType.COMPANION)) {
|
||||
@Override
|
||||
protected void cardsSelected(Collection<PhysicalCard> characters, boolean success) {
|
||||
super.cardsSelected(characters, success);
|
||||
if (success) {
|
||||
PhysicalCard companion = characters.iterator().next();
|
||||
Skirmish skirmish = game.getGameState().getSkirmish();
|
||||
if (skirmish != null
|
||||
&& skirmish.getFellowshipCharacter() == companion
|
||||
&& game.getGameState().isFierceSkirmishes()) {
|
||||
action.appendEffect(
|
||||
new CancelSkirmishEffect());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user