From e2cf4d8d6e8650aa9cca2849fd92b27fa3e754c6 Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Sat, 8 Oct 2011 01:00:22 +0000 Subject: [PATCH] "Well Met Indeed" --- .../lotro/cards/set4/gandalf/Card4_106.java | 58 +++++++++++++++++++ .../src/main/webapp/js/deckBuildingUi.js | 4 +- 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/gandalf/Card4_106.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/gandalf/Card4_106.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/gandalf/Card4_106.java new file mode 100644 index 000000000..49c0b6314 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/gandalf/Card4_106.java @@ -0,0 +1,58 @@ +package com.gempukku.lotro.cards.set4.gandalf; + +import com.gempukku.lotro.cards.AbstractEvent; +import com.gempukku.lotro.cards.actions.PlayEventAction; +import com.gempukku.lotro.cards.effects.ChooseArbitraryCardsEffect; +import com.gempukku.lotro.common.Culture; +import com.gempukku.lotro.common.Phase; +import com.gempukku.lotro.common.Race; +import com.gempukku.lotro.common.Side; +import com.gempukku.lotro.filters.Filters; +import com.gempukku.lotro.game.PhysicalCard; +import com.gempukku.lotro.game.state.LotroGame; + +import java.util.Collection; + +/** + * Set: The Two Towers + * Side: Free + * Culture: Gandalf + * Twilight Cost: 5 + * Type: Event + * Game Text: Fellowship: Spot an Elf, a [GONDOR] Man, and a Dwarf to play Gandalf from your dead pile. + */ +public class Card4_106 extends AbstractEvent { + public Card4_106() { + super(Side.FREE_PEOPLE, Culture.GANDALF, "Well Met Indeed", Phase.FELLOWSHIP); + } + + @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.race(Race.ELF)) + && Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.culture(Culture.GONDOR), Filters.race(Race.MAN)) + && Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.race(Race.DWARF)) + && Filters.filter(game.getGameState().getDeadPile(playerId), game.getGameState(), game.getModifiersQuerying(), Filters.name("Gandalf")).size() > 0; + } + + @Override + public int getTwilightCost() { + return 5; + } + + @Override + public PlayEventAction getPlayCardAction(final String playerId, LotroGame game, PhysicalCard self, int twilightModifier) { + PlayEventAction action = new PlayEventAction(self); + action.appendEffect( + new ChooseArbitraryCardsEffect(playerId, "Choose Gandalf in dead pile", game.getGameState().getDeadPile(playerId), Filters.name("Gandalf"), 1, 1) { + @Override + protected void cardsSelected(LotroGame game, Collection selectedCards) { + if (selectedCards.size() > 0) { + PhysicalCard gandalf = selectedCards.iterator().next(); + game.getActionsEnvironment().addActionToStack(gandalf.getBlueprint().getPlayCardAction(playerId, game, gandalf, 0)); + } + } + }); + return action; + } +} diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/deckBuildingUi.js b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/deckBuildingUi.js index 6599f0f67..f66a38382 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/deckBuildingUi.js +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/deckBuildingUi.js @@ -53,12 +53,14 @@ var GempLotrDeckBuildingUI = Class.extend({ + "" + "" + "" + + "" + "" + ""); this.filterDiv.append("
" + "" + "" + "" + + "" + "" + "" + "
"); @@ -104,7 +106,7 @@ var GempLotrDeckBuildingUI = Class.extend({ $("#set").change(filterOut); $("#cardType").change(filterOut); - $("#labelDWARVEN,#labelELVEN,#labelGANDALF,#labelGONDOR,#labelSHIRE,#labelDUNLAND,#labelISENGARD,#labelMORIA,#labelSAURON,#labelWRAITH").click(filterOut); + $("#labelDWARVEN,#labelELVEN,#labelGANDALF,#labelGONDOR,#labelROHAN,#labelSHIRE,#labelDUNLAND,#labelISENGARD,#labelMORIA,#labelRAIDER,#labelSAURON,#labelWRAITH").click(filterOut); $("#countSlider").slider({ value:18,