3 Cards from RotEL

This commit is contained in:
marcins78@gmail.com
2011-10-01 05:25:09 +00:00
parent cff2c69339
commit 13a982f92f
5 changed files with 227 additions and 1 deletions

View File

@@ -27,7 +27,8 @@ public class PutCardFromDiscardIntoHandEffect implements Effect {
@Override
public EffectResult[] playEffect(LotroGame game) {
if (game.getModifiersQuerying().canDrawCardAndIncrement(game.getGameState(), _card.getOwner())) {
if (game.getModifiersQuerying().canDrawCardAndIncrement(game.getGameState(), _card.getOwner())
&& _card.getZone() == Zone.DISCARD) {
GameState gameState = game.getGameState();
gameState.sendMessage(_card.getOwner() + " puts " + _card.getBlueprint().getName() + " from discard into his or her hand");
gameState.removeCardFromZone(_card);

View File

@@ -0,0 +1,41 @@
package com.gempukku.lotro.cards.effects;
import com.gempukku.lotro.common.Zone;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.GameState;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.timing.Effect;
import com.gempukku.lotro.logic.timing.EffectResult;
import com.gempukku.lotro.logic.timing.results.DrawCardOrPutIntoHandResult;
public class PutCardFromStackedIntoHandEffect implements Effect {
private PhysicalCard _card;
public PutCardFromStackedIntoHandEffect(PhysicalCard card) {
_card = card;
}
@Override
public String getText(LotroGame game) {
return "Put card from stacked into hand";
}
@Override
public EffectResult.Type getType() {
return EffectResult.Type.DRAW_CARD_OR_PUT_INTO_HAND;
}
@Override
public EffectResult[] playEffect(LotroGame game) {
if (game.getModifiersQuerying().canDrawCardAndIncrement(game.getGameState(), _card.getOwner())
&& _card.getZone() == Zone.STACKED) {
GameState gameState = game.getGameState();
gameState.sendMessage(_card.getOwner() + " puts " + _card.getBlueprint().getName() + " from stacked on another card into his or her hand");
gameState.removeCardFromZone(_card);
gameState.addCardToZone(_card, Zone.HAND);
return new EffectResult[]{new DrawCardOrPutIntoHandResult(_card.getOwner(), 1)};
}
return null;
}
}

View File

@@ -0,0 +1,84 @@
package com.gempukku.lotro.cards.set3.gondor;
import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.*;
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.timing.Action;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
/**
* Set: Realms of Elf-lords
* Side: Free
* Culture: Gondor
* Twilight Cost: 1
* Type: Artifact
* Game Text: Plays to your support area. Fellowship: Stack a [GONDOR] card from hand here. Fellowship: Add (1) to take
* a card stacked here into hand.
*/
public class Card3_044 extends AbstractPermanent {
public Card3_044() {
super(Side.FREE_PEOPLE, 1, CardType.ARTIFACT, Culture.GONDOR, Zone.FREE_SUPPORT, "The Shards of Narsil", true);
}
@Override
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, final PhysicalCard self) {
List<Action> actions = new LinkedList<Action>();
if (PlayConditions.canUseFPCardDuringPhase(game.getGameState(), Phase.FELLOWSHIP, self)) {
if (Filters.filter(game.getGameState().getHand(playerId), game.getGameState(), game.getModifiersQuerying(), Filters.culture(Culture.GONDOR)).size() > 0) {
final ActivateCardAction action = new ActivateCardAction(self, Keyword.FELLOWSHIP) {
@Override
public String getText(LotroGame game) {
return "Stack a GONDOR card from hand here";
}
};
action.appendEffect(
new ChooseCardsFromHandEffect(playerId, 1, 1, Filters.culture(Culture.GONDOR)) {
@Override
protected void cardsSelected(Collection<PhysicalCard> selectedCards) {
for (PhysicalCard selectedCard : selectedCards) {
action.appendEffect(
new StackCardFromHandEffect(selectedCard, self));
}
}
}
);
actions.add(action);
}
List<PhysicalCard> stackedCards = game.getGameState().getStackedCards(self);
if (stackedCards.size() > 0) {
final ActivateCardAction action = new ActivateCardAction(self, Keyword.FELLOWSHIP) {
@Override
public String getText(LotroGame game) {
return "Add (1) to take card stacked here into hand";
}
};
action.appendCost(
new AddTwilightEffect(1));
action.appendEffect(
new ChooseArbitraryCardsEffect(playerId, "Choose card", stackedCards, 1, 1) {
@Override
protected void cardsSelected(List<PhysicalCard> selectedCards) {
for (PhysicalCard selectedCard : selectedCards) {
action.appendEffect(
new PutCardFromStackedIntoHandEffect(selectedCard));
}
}
});
actions.add(action);
}
}
return actions;
}
}

View File

@@ -0,0 +1,45 @@
package com.gempukku.lotro.cards.set3.gondor;
import com.gempukku.lotro.cards.AbstractEvent;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
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.modifiers.TwilightCostModifier;
/**
* Set: Realms of Elf-lords
* Side: Free
* Culture: Gondor
* Twilight Cost: 0
* Type: Event
* Game Text: Tale. Maneuver: Spot a [GONDOR] companion to make the twilight cost of each maneuver event +2.
*/
public class Card3_045 extends AbstractEvent {
public Card3_045() {
super(Side.FREE_PEOPLE, Culture.GONDOR, "Some Who Resisted", Phase.MANEUVER);
addKeyword(Keyword.TALE);
}
@Override
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
return super.checkPlayRequirements(playerId, game, self, twilightModifier)
&& Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.culture(Culture.GONDOR), Filters.type(CardType.COMPANION));
}
@Override
public int getTwilightCost() {
return 0;
}
@Override
public PlayEventAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
PlayEventAction action = new PlayEventAction(self);
action.appendEffect(
new AddUntilEndOfPhaseModifierEffect(
new TwilightCostModifier(self, Filters.and(Filters.type(CardType.EVENT), Filters.keyword(Keyword.MANEUVER)), 2), Phase.MANEUVER));
return action;
}
}

View File

@@ -0,0 +1,55 @@
package com.gempukku.lotro.cards.set3.gondor;
import com.gempukku.lotro.cards.AbstractEvent;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
import com.gempukku.lotro.cards.modifiers.StrengthModifier;
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.modifiers.KeywordModifier;
/**
* Set: Realms of Elf-lords
* Side: Free
* Culture: Gondor
* Twilight Cost: 0
* Type: Event
* Game Text: Skirmish: Spot The Shards of Narsil to make a [GONDOR] companion strength +3 and damage +1.
*/
public class Card3_046 extends AbstractEvent {
public Card3_046() {
super(Side.FREE_PEOPLE, Culture.GONDOR, "Still Sharp", Phase.SKIRMISH);
}
@Override
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) {
return super.checkPlayRequirements(playerId, game, self, twilightModifier)
&& Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.name("The Shards of Narsil"));
}
@Override
public int getTwilightCost() {
return 0;
}
@Override
public PlayEventAction getPlayCardAction(String playerId, LotroGame game, final PhysicalCard self, int twilightModifier) {
final PlayEventAction action = new PlayEventAction(self);
action.appendEffect(
new ChooseActiveCardEffect(playerId, "Choose GONDOR companion", Filters.culture(Culture.GONDOR), Filters.type(CardType.COMPANION)) {
@Override
protected void cardSelected(PhysicalCard card) {
action.insertEffect(
new AddUntilEndOfPhaseModifierEffect(
new StrengthModifier(self, Filters.sameCard(card), 3), Phase.SKIRMISH));
action.insertEffect(
new AddUntilEndOfPhaseModifierEffect(
new KeywordModifier(self, Filters.sameCard(card), Keyword.DAMAGE), Phase.SKIRMISH));
}
});
return action;
}
}