"Gandalf"
This commit is contained in:
@@ -0,0 +1,98 @@
|
|||||||
|
package com.gempukku.lotro.cards.set7.gandalf;
|
||||||
|
|
||||||
|
import com.gempukku.lotro.cards.AbstractCompanion;
|
||||||
|
import com.gempukku.lotro.cards.PlayConditions;
|
||||||
|
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
|
||||||
|
import com.gempukku.lotro.cards.effects.PreventableEffect;
|
||||||
|
import com.gempukku.lotro.cards.effects.PutCardFromHandOnTopOfDeckEffect;
|
||||||
|
import com.gempukku.lotro.cards.effects.choose.ChooseCardsFromHandEffect;
|
||||||
|
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.logic.GameUtils;
|
||||||
|
import com.gempukku.lotro.logic.actions.ActivateCardAction;
|
||||||
|
import com.gempukku.lotro.logic.actions.SubAction;
|
||||||
|
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
|
||||||
|
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
|
||||||
|
import com.gempukku.lotro.logic.timing.Action;
|
||||||
|
import com.gempukku.lotro.logic.timing.Effect;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set: The Return of the King
|
||||||
|
* Side: Free
|
||||||
|
* Culture: Gandalf
|
||||||
|
* Twilight Cost: 4
|
||||||
|
* Type: Companion • Wizard
|
||||||
|
* Strength: 7
|
||||||
|
* Vitality: 4
|
||||||
|
* Resistance: 6
|
||||||
|
* Signet: Theoden
|
||||||
|
* Game Text: Skirmish: Place 3 cards from hand on top of your draw deck to make a minion skirmishing an unbound
|
||||||
|
* companion strength -3. Any Shadow player may place 3 cards from his or her hand on top of his or her draw deck
|
||||||
|
* to prevent this.
|
||||||
|
*/
|
||||||
|
public class Card7_037 extends AbstractCompanion {
|
||||||
|
public Card7_037() {
|
||||||
|
super(4, 7, 4, Culture.GANDALF, Race.WIZARD, Signet.THÉODEN, "Gandalf", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected List<? extends Action> getExtraInPlayPhaseActions(final String playerId, LotroGame game, final PhysicalCard self) {
|
||||||
|
if (PlayConditions.canUseFPCardDuringPhase(game.getGameState(), Phase.SKIRMISH, self)
|
||||||
|
&& game.getGameState().getHand(playerId).size() >= 3) {
|
||||||
|
final ActivateCardAction action = new ActivateCardAction(self);
|
||||||
|
action.appendCost(
|
||||||
|
new ChooseCardsFromHandEffect(playerId, 3, 3, Filters.any) {
|
||||||
|
@Override
|
||||||
|
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> selectedCards) {
|
||||||
|
for (PhysicalCard selectedCard : selectedCards) {
|
||||||
|
action.insertCost(
|
||||||
|
new PutCardFromHandOnTopOfDeckEffect(selectedCard));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
action.appendEffect(
|
||||||
|
new ChooseActiveCardEffect(self, playerId, "Choose minion", CardType.MINION, Filters.inSkirmishAgainst(Filters.unboundCompanion)) {
|
||||||
|
@Override
|
||||||
|
protected void cardSelected(LotroGame game, final PhysicalCard card) {
|
||||||
|
action.insertEffect(
|
||||||
|
new PreventableEffect(action,
|
||||||
|
new AddUntilEndOfPhaseModifierEffect(
|
||||||
|
new StrengthModifier(self, card, -3), Phase.SKIRMISH) {
|
||||||
|
@Override
|
||||||
|
public String getText(LotroGame game) {
|
||||||
|
return "Make " + GameUtils.getCardLink(card) + " strength -3";
|
||||||
|
}
|
||||||
|
}, GameUtils.getOpponents(game, playerId),
|
||||||
|
new PreventableEffect.PreventionCost() {
|
||||||
|
@Override
|
||||||
|
public Effect createPreventionCostForPlayer(final SubAction subAction, String playerId) {
|
||||||
|
return new ChooseCardsFromHandEffect(playerId, 3, 3, Filters.any) {
|
||||||
|
@Override
|
||||||
|
public String getText(LotroGame game) {
|
||||||
|
return "Place 3 cards from hand on top of draw deck";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> selectedCards) {
|
||||||
|
for (PhysicalCard selectedCard : selectedCards) {
|
||||||
|
subAction.appendEffect(
|
||||||
|
new PutCardFromHandOnTopOfDeckEffect(selectedCard));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return Collections.singletonList(action);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user