Added Gandalf cards for Main Deck

This commit is contained in:
PhallenCassidy
2016-10-08 22:50:01 -04:00
committed by GitHub
parent 4f28f3852c
commit 2764f09c5a
8 changed files with 487 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
package com.gempukku.lotro.cards.set21.gandalf;
import com.gempukku.lotro.cards.AbstractEvent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.choose.ChooseAndDiscardCardsFromPlayEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
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.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.effects.ChooseAndWoundCharactersEffect;
import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect;
/**
* Set: Main Deck
* Side: Free
* Culture: Gandalf
* Twilight Cost: 3
* Type: Event
* Game Text: Spell. Exert Gandalf twice to wound a minion twice or discard a Troll.
*/
public class Card21_24 extends AbstractEvent {
public Card21_24() {
super(Side.FREE_PEOPLE, 3, Culture.GANDALF, "Dawn Take You All", Phase.MANEUVER);
addKeyword(Keyword.SPELL);
}
@Override
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int withTwilightRemoved, int twilightModifier, boolean ignoreRoamingPenalty, boolean ignoreCheckingDeadPile) {
return super.checkPlayRequirements(playerId, game, self, withTwilightRemoved, twilightModifier, ignoreRoamingPenalty, ignoreCheckingDeadPile)
&& PlayConditions.canExert(self, game, 2, Filters.gandalf);
}
@Override
public PlayEventAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
PlayEventAction action = new PlayEventAction(self);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, 2, Filters.gandalf));
List<Effect> possibleEffects = new LinkedList<Effect>();
possibleEffects.add(
new ChooseAndWoundCharactersEffect(action, playerId, 1, 1, 2, CardType.MINION) {
@Override
public String getText(LotroGame game) {
return "Wound a minion twice";
}
});
possibleEffects.add(
new ChooseAndDiscardCardsFromPlayEffect(action, playerId, 1, 1, Race.TROLL) {
@Override
public String getText(LotroGame game) {
return "Discard a Troll";
}
});
action.appendEffect(
new ChoiceEffect(action, playerId, possibleEffects));
return action;
}
}

View File

@@ -0,0 +1,70 @@
package com.gempukku.lotro.cards.set21.gandalf;
import com.gempukku.lotro.cards.AbstractCompanion;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.SelfExertEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseCardsFromDeckEffect;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.filters.Filters;
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.actions.OptionalTriggerAction;
import com.gempukku.lotro.logic.effects.AddTwilightEffect;
import com.gempukku.lotro.logic.timing.EffectResult;
import com.gempukku.lotro.logic.timing.Action;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
/**
* Set: Main Deck
* Side: Free
* Culture: Gandalf
* Twilight Cost: 4
* Type: Companion • Wizard
* Strength: 7
* Vitality: 4
* Resistance: 6
* Game Text: Wise. At the start of each of your turns, you may exert Gandalf to play a Dwarf companion
* from your draw deck. Maneuver: Discard 2 Dwarf followers to play Gandalf from your discard pile.
*/
public class Card21_25 extends AbstractCompanion {
public Card21_25() {
super(4, 7, 4, 6, Culture.GANDALF, Race.WIZARD, null, "Gandalf", "Leader of Dwarves", true);
}
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggers(final String playerId, LotroGame game, EffectResult effectResult, final PhysicalCard self) {
if (TriggerConditions.startOfTurn(game, effectResult)) {
final OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendCost(
new SelfExertEffect(action, self));
action.appendEffect(
new ChooseAndPlayCardFromDeckEffect(self.getOwner(), Race.DWARF, CardType.COMPANION));
return Collections.singletonList(action);
}
return null;
}
@Override
public List<? extends Action> getPhaseActionsFromDiscard(String playerId, LotroGame game, final PhysicalCard self) {
if (PlayConditions.isPhase(game, Phase.Maneuver)
&& PlayConditions.canDiscardFromPlay(self, game, 2, Race.DWARF, CardType.FOLLOWER))
&& PlayConditions.canPlayFromDiscard(playerId, game, self)) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new ChooseAndDiscardCardsFromPlayEffect(action, playerId, 2, 2, Race.DWARF, CardType.FOLLOWER));
action.appendEffect(
new getPlayCardAction(playerId, game, self, 0, false));
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -0,0 +1,63 @@
package com.gempukku.lotro.cards.set21.gandalf;
import com.gempukku.lotro.cards.AbstractCompanion;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.PreventCardEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndDiscardCardsFromPlayEffect;
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.actions.ActivateCardAction;
import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect;
import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.modifiers.SpotCondition;
import com.gempukku.lotro.logic.modifiers.TwilightCostModifier;
import java.util.LinkedList;
import java.util.List;
/**
* Set: Main Deck
* Side: Free
* Culture: Gandalf
* Twilight Cost: 1
* Type: Companion • Wizard
* Strength: 7
* Vitality: 4
* Resitance: 6
* Game Text: The twilight cost of Thorin is -2. Fellowship: Discard 2 Dwarf followers to prevent
* Gandalf from being discarded until the end of turn.
*/
public class Card21_26 extends AbstractCompanion {
public Card21_26() {
super(1, 7, 4, 6, Culture.GANDALF, Race.WIZARD, null, "Gandalf", "Friend of Thorin", true);
addKeyword(Keyword.WISE);
}
@Override
public List<? extends Modifier> getAlwaysOnModifiers(LotroGame game, PhysicalCard self) {
List<Modifier> modifiers = new LinkedList<Modifier>();
modifiers.add(
new TwilightCostModifier(self, Filters.name("Thorin"), -2));
return modifiers;
}
@Override
protected List<ActivateCardAction> getExtraInPlayPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.FELLOWSHIP, self)
&& PlayConditions.canDiscardFromPlay(self, game, 2, Race.DWARF, CardType.FOLLOWER)) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(new ChooseAndDiscardCardsFromPlayEffect(action, playerID, 2, 2, Race.DWARF, CardType.FOLLOWER));
action.appendEffect(new AddUntilEndOfTurnModifierEffect(
new PreventCardEffect(discardEffect, "Choose Gandalf", Filters.gandalf)));
return Collections.singletonList(action);
}
return null;
}
}
}
}

View File

@@ -0,0 +1,80 @@
package com.gempukku.lotro.cards.set21.gandalf;
import com.gempukku.lotro.cards.AbstractCompanion;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.AddBurdenEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndPlayCardFromDeckEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndPlayCardFromDiscardEffect;
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.actions.ActivateCardAction;
import com.gempukku.lotro.logic.actions.OptionalTriggerAction;
import com.gempukku.lotro.logic.effects.ChooseAndWoundCharactersEffect;
import com.gempukku.lotro.logic.effects.DrawCardsEffect;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collections;
import java.util.List;
/**
* Set: Main Deck
* Side: Free
* Culture: Gandalf
* Twilight Cost: 2
* Type: Companion • Wizard
* Strength: 7
* Vitality: 4
* Resistance: 6
* Game Text: Wise. Each time you play a [GANDALF] event, you may wound a minion. Fellowship: Add 2 doubts to play an
* artifact or a Dwarf companion from your draw deck or discard pile
*/
public class Card21_27 extends AbstractCompanion {
public Card21_27() {
super(2, 7, 4, 6, Culture.GANDALF, Race.WIZARD, null, "Gandalf", "Powerful Guide", true);
addKeyword(Keyword.WISE);
}
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.played(game, effectResult, Culture.GANDALF, CardType.EVENT)) {
OptionalTriggerAction action = new OptionalTriggerAction(self);
action.insertEffect(
new ChooseAndWoundCharactersEffect(action, playerId, 1, 1, CardType.MINION));
return Collections.singletonList(action);
}
return null;
}
@Override
protected List<? extends Action> getExtraInPlayPhaseActions(final String playerId, LotroGame game, final PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.FELLOWSHIP, self)) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new AddBurdenEffect(self.getOwner(), self, 2));
List<Effect> possibleEffects = new LinkedList<Effect>();
possibleEffects.add(
new ChooseAndPlayCardFromDeckEffect(playerId, Filters.or(Filters.and(CardType.COMPANION, Race.DWARF), CardType.ARTIFACT)) {
@Override
public String getText(LotroGame game) {
return "Play an artifact or Dwarf companion from your draw deck";
}
});
if (PlayConditions.canPlayFromDiscard(playerId, game, Filters.or(Filters.and(CardType.COMPANION, Race.DWARF), CardType.ARTIFACT))) {
possibleEffects.add(
new ChooseAndPlayCardFromDiscardEffect(playerId, game, Filters.or(Filters.and(CardType.COMPANION, Race.DWARF), CardType.ARTIFACT)) {
@Override
public String getText(LotroGame game) {
return "Play an artifact or Dwarf companion from your discard pile";
}
});
}
action.appendEffect(
new ChoiceEffect(action, playerId, possibleEffects));
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -0,0 +1,58 @@
package com.gempukku.lotro.cards.set21.gandalf;
import com.gempukku.lotro.cards.AbstractCompanion;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.AddBurdenEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndPlayCardFromDeckEffect;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Phase;
import com.gempukku.lotro.common.Race;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.OptionalTriggerAction;
import com.gempukku.lotro.logic.effects.AddTwilightEffect;
import com.gempukku.lotro.logic.modifiers.CantDiscardFromPlayModifier;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
/**
* Set: Main Deck
* Side: Free
* Culture: Gandalf
* Twilight Cost: 4
* Type: Companion • Wizard
* Strength: 7
* Vitality: 4
* Resistance: 6
* Game Text: Wise. Gandalf cannot be discarded. At the start of the fellowship phase, you may add a doubt to play a
* Dwarf companion from your draw deck.
*/
public class Card21_28 extends AbstractCompanion {
public Card21_28() {
super(4, 7, 4, 6, Culture.GANDALF, Race.WIZARD, null, "Gandalf", "Leader of the Company", true);
}
@Override
public List<? extends Modifier> getAlwaysOnModifiers(LotroGame game, PhysicalCard self) {
return Collections.singletonList(
new CantDiscardFromPlayModifier(self, "Gandalf cannot be discarded", self));
}
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggers(final String playerId, LotroGame game, EffectResult effectResult, final PhysicalCard self) {
if (TriggerConditions.startOfPhase(game, effectResult, Phase.FELLOWSHIP)) {
final OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendCost(
new AddBurdenEffect(self.getOwner(), self, 1));;
action.appendEffect(
new ChooseAndPlayCardFromDeckEffect(playerId, Culture.DWARVEN, CardType.COMPANION));
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -0,0 +1,47 @@
package com.gempukku.lotro.cards.set21.gandalf;
import com.gempukku.lotro.cards.AbstractAttachableFPPossession;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.RemoveBurdenEffect;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Filterable;
import com.gempukku.lotro.common.PossessionClass;
import com.gempukku.lotro.filters.Filters;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.OptionalTriggerAction;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collections;
import java.util.List;
/**
* Set: Shadows
* Side: Free
* Culture: Gandalf
* Twilight Cost: 2
* Type: Artifact • Hand Weapon
* Strength: +2
* Game Text: Bearer must be Gandalf. Each time Gandalf wins a skirmish, you may remove a doubt.
*/
public class Card21_29 extends AbstractAttachableFPPossession {
public Card21_29) {
super(2, 2, 0, Culture.GANDALF, CardType.ARTIFACT, PossessionClass.HAND_WEAPON, "Glamdring", null, true);
}
@Override
protected Filterable getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
return Filters.gandalf;
}
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.winsSkirmish(game, effectResult, Filters.gandalf)) {
OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendEffect(
new RemoveBurdenEffect(playerId, self));
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -0,0 +1,66 @@
package com.gempukku.lotro.cards.set21.gandalf;
import com.gempukku.lotro.cards.AbstractEvent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.RemoveBurdenEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
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 java.util.Collections;
import java.util.List;
/**
* Set: Main Deck
* Side: Free
* Culture: Gandalf
* Twilight Cost: 2
* Type: Event • Maneuver
* Game Text: Spot Gandalf to remove a burden (or 2 burdens, if you exert Gandalf and a [ELVEN] Wise Ally).
*/
public class Card21_30 extends AbstractEvent {
public Card21_30() {
super(Side.FREE_PEOPLE, 2, Culture.GANDALF, "He Gives Me Courage", Phase.MANEUVER);
}
@Override
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int withTwilightRemoved, int twilightModifier, boolean ignoreRoamingPenalty, boolean ignoreCheckingDeadPile) {
return super.checkPlayRequirements(playerId, game, self, withTwilightRemoved, twilightModifier, ignoreRoamingPenalty, ignoreCheckingDeadPile)
&& PlayConditions.canSpot(self, game, Filters.gandalf);
}
@Override
public PlayEventAction getPlayCardAction(final String playerId, LotroGame game, final PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
final PlayEventAction action = new PlayEventAction(self);
if (PlayConditions.canExert(self, game, Filters.gandalf))
&& PlayConditions.canExert(self, game, Keyword.WISE, CardType.ALLY) {
action.appendCost(
new PlayoutDecisionEffect(playerId,
new YesNoDecision("Do you want to exert Gandalf and a Wise ally?") {
@Override
protected void yes() {
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.gandalf));
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Keyword.WISE, CardType.ALLY));
action.appendEffect(
new RemoveBurdenEffect(playerId, self, 2));
});
@Override
protected void no() {
action.appendEffect(
new RemoveBurdenEffect(playerId, self, 1));
}
}));
} else {
action.appendEffect(
new RemoveBurdenEffect(playerId, self, 1));
}
return action;
}
}

View File

@@ -0,0 +1,41 @@
package com.gempukku.lotro.cards.set21.gandalf;
import com.gempukku.lotro.cards.AbstractEvent;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.choose.ChooseAndAddUntilEOPStrengthBonusEffect;
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 java.util.Collections;
import java.util.List;
/**
* Set: Main Deck
* Side: Free
* Culture: Gandalf
* Twilight Cost: 1
* Type: Event
* Game Text: Spell. Skirmish: Spot Gandalf to make a minion strength -3.
*/
public class Card21_31 extends AbstractEvent {
public Card21_31() {
super(Side.FREE_PEOPLE, 1, Culture.GANDALF, "Take Up Arms", Phase.SKIRMISH);
addKeyword(Keyword.SPELL);
}
@Override
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int withTwilightRemoved, int twilightModifier, boolean ignoreRoamingPenalty, boolean ignoreCheckingDeadPile) {
return super.checkPlayRequirements(playerId, game, self, withTwilightRemoved, twilightModifier, ignoreRoamingPenalty, ignoreCheckingDeadPile)
&& Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.gandalf);
}
@Override
public PlayEventAction getPlayCardAction(String playerId, LotroGame game, final PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
final PlayEventAction action = new PlayEventAction(self);
action.appendEffect(
new ChooseAndAddUntilEOPStrengthBonusEffect(action, self, playerId, -3, CardType.MINION));
return action;
}
}