From a2e053166b88c0c4af538ba766669e2fb1a7bca5 Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Sat, 8 Oct 2011 01:29:43 +0000 Subject: [PATCH] "Windows in a Stone Wall" --- .../cards/actions/AttachPermanentAction.java | 11 +++ .../lotro/cards/set4/gandalf/Card4_107.java | 97 +++++++++++++++++++ .../lotro/logic/effects/KillEffect.java | 1 + .../css/dark-hive/jquery-ui-1.8.16.custom.css | 6 +- .../src/main/webapp/deckBuild.html | 1 - 5 files changed, 112 insertions(+), 4 deletions(-) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/gandalf/Card4_107.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/actions/AttachPermanentAction.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/actions/AttachPermanentAction.java index 4d781c360..cecd0a172 100644 --- a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/actions/AttachPermanentAction.java +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/actions/AttachPermanentAction.java @@ -38,6 +38,8 @@ public class AttachPermanentAction extends AbstractCostToEffectAction { private Effect _discardCardEffect; private boolean _cardDiscarded; + private boolean _exertTarget; + public AttachPermanentAction(final LotroGame game, final PhysicalCard card, Filter filter, final Map attachCostModifiers, final int twilightModifier) { _source = card; @@ -47,6 +49,11 @@ public class AttachPermanentAction extends AbstractCostToEffectAction { new ChooseActiveCardEffect(null, card.getOwner(), "Attach " + card.getBlueprint().getName() + ". Choose target to attach to", filter) { @Override protected void cardSelected(PhysicalCard target) { + if (_exertTarget) { + appendCost( + new ExertCharactersEffect(target, target)); + } + _putCardIntoPlayEffect = new AttachCardEffect(_source, target); int modifier = twilightModifier; @@ -68,6 +75,10 @@ public class AttachPermanentAction extends AbstractCostToEffectAction { _discardCardEffect = new PutCardIntoDiscardEffect(card); } + public void setExertTarget(boolean exertTarget) { + _exertTarget = exertTarget; + } + @Override public PhysicalCard getActionSource() { return _source; diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/gandalf/Card4_107.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/gandalf/Card4_107.java new file mode 100644 index 000000000..af61be21e --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set4/gandalf/Card4_107.java @@ -0,0 +1,97 @@ +package com.gempukku.lotro.cards.set4.gandalf; + +import com.gempukku.lotro.cards.AbstractAttachable; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.actions.AttachPermanentAction; +import com.gempukku.lotro.cards.effects.*; +import com.gempukku.lotro.common.*; +import com.gempukku.lotro.filters.Filter; +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.timing.Action; +import com.gempukku.lotro.logic.timing.EffectResult; +import com.gempukku.lotro.logic.timing.results.KillResult; + +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +/** + * Set: The Two Towers + * Side: Free + * Culture: Gandalf + * Twilight Cost: 1 + * Type: Condition + * Game Text: To play, exert an Ent. Plays on that Ent. + * Response: If an [ISENGARD] minion is killed, discard this condition to reveal the top 10 cards of an opponent's + * draw deck. Discard 1 Shadow card and 1 Free Peoples card revealed. Your opponent reshuffles that deck. + */ +public class Card4_107 extends AbstractAttachable { + public Card4_107() { + super(Side.FREE_PEOPLE, CardType.CONDITION, 1, Culture.GANDALF, null, "Windows in a Stone Wall"); + } + + @Override + protected Filter getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) { + return Filters.and(Filters.race(Race.ELF), Filters.canExert(self)); + } + + @Override + public AttachPermanentAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, Filter additionalAttachmentFilter, int twilightModifier) { + AttachPermanentAction permanentAction = super.getPlayCardAction(playerId, game, self, additionalAttachmentFilter, twilightModifier); + permanentAction.setExertTarget(true); + return permanentAction; + } + + @Override + public List getOptionalAfterActions(final String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) { + if (effectResult.getType() == EffectResult.Type.KILL + && PlayConditions.canUseFPCardDuringPhase(game.getGameState(), null, self)) { + KillResult killResult = (KillResult) effectResult; + if (Filters.filter(killResult.getKilledCards(), game.getGameState(), game.getModifiersQuerying(), Filters.type(CardType.MINION), Filters.culture(Culture.ISENGARD)).size() > 0) { + final ActivateCardAction action = new ActivateCardAction(self, Keyword.RESPONSE); + action.appendCost( + new DiscardCardsFromPlayEffect(self, self)); + action.appendEffect( + new ChooseOpponentEffect(playerId) { + @Override + protected void opponentChosen(final String opponentId) { + action.insertEffect( + new RevealTopCardsOfDrawDeckEffect(opponentId, 10) { + @Override + protected void cardsRevealed(final List cards) { + action.appendEffect( + new ChooseArbitraryCardsEffect(playerId, "Choose shadow card", cards, Filters.side(Side.SHADOW), 1, 1) { + @Override + protected void cardsSelected(LotroGame game, Collection selectedCards) { + for (PhysicalCard selectedCard : selectedCards) { + action.insertEffect( + new DiscardCardFromDeckEffect(playerId, selectedCard)); + } + } + }); + action.appendEffect( + new ChooseArbitraryCardsEffect(playerId, "Choose free people card", cards, Filters.side(Side.FREE_PEOPLE), 1, 1) { + @Override + protected void cardsSelected(LotroGame game, Collection selectedCards) { + for (PhysicalCard selectedCard : selectedCards) { + action.insertEffect( + new DiscardCardFromDeckEffect(playerId, selectedCard)); + } + } + }); + action.appendEffect( + new ShuffleDeckEffect(opponentId)); + } + }); + } + }); + return Collections.singletonList(action); + } + } + return null; + } +} diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/effects/KillEffect.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/effects/KillEffect.java index 93ac60c06..e1822a8b3 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/effects/KillEffect.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/logic/effects/KillEffect.java @@ -51,6 +51,7 @@ public class KillEffect extends AbstractSuccessfulEffect { killedCards.add(card); gameState.addCardToZone(card, Zone.DEAD); } else { + killedCards.add(card); discardedCards.add(card); gameState.addCardToZone(card, Zone.DISCARD); } diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/css/dark-hive/jquery-ui-1.8.16.custom.css b/gemp-lotr/gemp-lotr-web/src/main/webapp/css/dark-hive/jquery-ui-1.8.16.custom.css index 3cdda7cbf..2de437492 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/css/dark-hive/jquery-ui-1.8.16.custom.css +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/css/dark-hive/jquery-ui-1.8.16.custom.css @@ -1289,7 +1289,7 @@ button.ui-button-icons-only { } .ui-button-text-only .ui-button-text { - padding: .4em 1em; + padding: .2em .3em; } .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { @@ -1345,8 +1345,8 @@ input.ui-button { } .ui-buttonset .ui-button { - margin-left: 0; - margin-right: -.3em; + margin-left: .2em; + margin-right: -.2em; } /* workarounds */ diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/deckBuild.html b/gemp-lotr/gemp-lotr-web/src/main/webapp/deckBuild.html index 3f470bd09..ae4ca23a9 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/deckBuild.html +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/deckBuild.html @@ -38,7 +38,6 @@ .ui-button-text-only .ui-button-text { font-size: 70%; - padding: .05em .05em; } #set {