"Legolas"

This commit is contained in:
marcins78@gmail.com
2012-01-17 12:38:41 +00:00
parent 9356deb2e3
commit 44b464255a
2 changed files with 51 additions and 5 deletions

View File

@@ -16,17 +16,17 @@ import java.util.Collection;
public class ChooseAndExertCharactersEffect extends ChooseActiveCardsEffect {
private Action _action;
private int _count;
private int _times;
private SubAction _resultSubAction;
public ChooseAndExertCharactersEffect(Action action, String playerId, int minimum, int maximum, Filterable... filters) {
this(action, playerId, minimum, maximum, 1, filters);
}
public ChooseAndExertCharactersEffect(Action action, String playerId, int minimum, int maximum, int count, Filterable... filters) {
public ChooseAndExertCharactersEffect(Action action, String playerId, int minimum, int maximum, int times, Filterable... filters) {
super(action.getActionSource(), playerId, "Choose characters to exert", minimum, maximum, filters);
_action = action;
_count = count;
_times = times;
}
@Override
@@ -35,7 +35,7 @@ public class ChooseAndExertCharactersEffect extends ChooseActiveCardsEffect {
@Override
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
return modifiersQuerying.canBeExerted(gameState, _action.getActionSource(), physicalCard)
&& modifiersQuerying.getVitality(gameState, physicalCard) > _count;
&& modifiersQuerying.getVitality(gameState, physicalCard) > _times;
}
};
}
@@ -43,7 +43,7 @@ public class ChooseAndExertCharactersEffect extends ChooseActiveCardsEffect {
@Override
protected final void cardsSelected(LotroGame game, Collection<PhysicalCard> characters) {
_resultSubAction = new SubAction(_action);
for (int i = 0; i < _count; i++) {
for (int i = 0; i < _times; i++) {
_resultSubAction.appendEffect(new ExertCharactersEffect(_action, _action.getActionSource(), Filters.in(characters)));
}
game.getActionsEnvironment().addActionToStack(_resultSubAction);

View File

@@ -0,0 +1,46 @@
package com.gempukku.lotro.cards.set15.elven;
import com.gempukku.lotro.cards.AbstractCompanion;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
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 com.gempukku.lotro.logic.effects.DrawCardsEffect;
import java.util.Collections;
import java.util.List;
/**
* Set: The Hunters
* Side: Free
* Culture: Elven
* Twilight Cost: 2
* Type: Companion • Elf
* Strength: 6
* Vitality: 3
* Resistance: 6
* Game Text: Hunter 1. (While skirmishing a non-hunter character, this character is strength +1.)
* Regroup: Exert 2 hunter companions to draw a card.
*/
public class Card15_018 extends AbstractCompanion {
public Card15_018() {
super(2, 6, 3, 6, Culture.ELVEN, Race.ELF, null, "Legolas", true);
addKeyword(Keyword.HUNTER, 1);
}
@Override
protected List<ActivateCardAction> getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.REGROUP, self)
&& PlayConditions.canExert(self, game, 1, 2, CardType.COMPANION, Keyword.HUNTER)) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 2, 2, 1, CardType.COMPANION, Keyword.HUNTER));
action.appendEffect(
new DrawCardsEffect(playerId, 1));
return Collections.singletonList(action);
}
return null;
}
}