From 5961911bd683b6b383146e1d54c9ee3f26a71734 Mon Sep 17 00:00:00 2001 From: "marcins78@gmail.com" Date: Mon, 17 Oct 2011 10:34:13 +0000 Subject: [PATCH] "Wild Men of the Hills" --- .../lotro/cards/set5/dunland/Card5_003.java | 58 ++++++++++++++ .../lotro/cards/set5/dunland/Card5_004.java | 77 +++++++++++++++++++ .../gempukku/lotro/game/state/GameState.java | 2 +- 3 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set5/dunland/Card5_003.java create mode 100644 gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set5/dunland/Card5_004.java diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set5/dunland/Card5_003.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set5/dunland/Card5_003.java new file mode 100644 index 000000000..9f84a90d7 --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set5/dunland/Card5_003.java @@ -0,0 +1,58 @@ +package com.gempukku.lotro.cards.set5.dunland; + +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.PreventableEffect; +import com.gempukku.lotro.cards.effects.choose.ChooseAndDiscardCardsFromHandEffect; +import com.gempukku.lotro.common.CardType; +import com.gempukku.lotro.common.Culture; +import com.gempukku.lotro.common.Phase; +import com.gempukku.lotro.common.Side; +import com.gempukku.lotro.game.PhysicalCard; +import com.gempukku.lotro.game.state.LotroGame; +import com.gempukku.lotro.logic.effects.DrawCardEffect; +import com.gempukku.lotro.logic.timing.UnrespondableEffect; + +/** + * Set: Battle of Helm's Deep + * Side: Shadow + * Culture: Dunland + * Twilight Cost: 1 + * Type: Event + * Game Text: Shadow: Spot 3 [DUNLAND] minions to shuffle your hand into your draw deck and draw 8 cards. + * The Free Peoples player may discard 3 cards from hand to prevent this. + */ +public class Card5_003 extends AbstractEvent { + public Card5_003() { + super(Side.SHADOW, 1, Culture.DUNLAND, "Leaping Blaze", Phase.SHADOW); + } + + @Override + public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) { + return super.checkPlayRequirements(playerId, game, self, twilightModifier) + && PlayConditions.canSpot(game, 3, Culture.DUNLAND, CardType.MINION); + } + + @Override + public PlayEventAction getPlayCardAction(final String playerId, LotroGame game, PhysicalCard self, int twilightModifier) { + final PlayEventAction action = new PlayEventAction(self); + action.appendEffect( + new PreventableEffect(action, + new UnrespondableEffect() { + @Override + protected void doPlayEffect(LotroGame game) { + game.getGameState().shuffleCardsIntoDeck(game.getGameState().getHand(playerId), playerId); + action.appendEffect( + new DrawCardEffect(playerId, 8)); + } + + @Override + public String getText(LotroGame game) { + return "Shuffle hand into draw deck and draw 8 cards"; + } + }, game.getGameState().getCurrentPlayerId(), + new ChooseAndDiscardCardsFromHandEffect(action, game.getGameState().getCurrentPlayerId(), false, 3))); + return action; + } +} diff --git a/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set5/dunland/Card5_004.java b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set5/dunland/Card5_004.java new file mode 100644 index 000000000..8d166c29c --- /dev/null +++ b/gemp-lotr/gemp-lotr-cards/src/main/java/com/gempukku/lotro/cards/set5/dunland/Card5_004.java @@ -0,0 +1,77 @@ +package com.gempukku.lotro.cards.set5.dunland; + +import com.gempukku.lotro.cards.AbstractMinion; +import com.gempukku.lotro.cards.PlayConditions; +import com.gempukku.lotro.cards.actions.PlayPermanentAction; +import com.gempukku.lotro.cards.effects.choose.ChooseAndDiscardCardsFromHandEffect; +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.RequiredTriggerAction; +import com.gempukku.lotro.logic.decisions.MultipleChoiceAwaitingDecision; +import com.gempukku.lotro.logic.effects.DiscardCardsFromPlayEffect; +import com.gempukku.lotro.logic.effects.PlayoutDecisionEffect; +import com.gempukku.lotro.logic.timing.EffectResult; + +import java.util.Collections; +import java.util.List; + +/** + * Set: Battle of Helm's Deep + * Side: Shadow + * Culture: Dunland + * Twilight Cost: 6 + * Type: Minion • Man + * Strength: 18 + * Vitality: 2 + * Site: 3 + * Game Text: The twilight cost of this minion is -2 during the skirmish phase. When you play this minion, the Free + * Peoples player may discard 4 cards from hand to discard it. + */ +public class Card5_004 extends AbstractMinion { + public Card5_004() { + super(6, 18, 2, 3, Race.MAN, Culture.DUNLAND, "Wild Men of the Hills"); + } + + @Override + public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) { + if (game.getGameState().getCurrentPhase() == Phase.SKIRMISH) + twilightModifier -= 2; + return super.checkPlayRequirements(playerId, game, self, twilightModifier) + && Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.culture(Culture.MORIA), Filters.race(Race.ORC)); + } + + @Override + public PlayPermanentAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier) { + if (game.getGameState().getCurrentPhase() == Phase.SKIRMISH) + twilightModifier -= 2; + return super.getPlayCardAction(playerId, game, self, twilightModifier); + } + + + @Override + public List getRequiredAfterTriggers(final LotroGame game, EffectResult effectResult, final PhysicalCard self) { + if (PlayConditions.played(game, effectResult, Filters.sameCard(self)) + && game.getGameState().getHand(game.getGameState().getCurrentPlayerId()).size() >= 4) { + final RequiredTriggerAction action = new RequiredTriggerAction(self); + action.appendCost( + new PlayoutDecisionEffect(game.getUserFeedback(), game.getGameState().getCurrentPlayerId(), + new MultipleChoiceAwaitingDecision(1, "Do you want to discard 4 cards from hand to discard this minion?", new String[]{"Yes", "No"}) { + @Override + protected void validDecisionMade(int index, String result) { + if (result.equals("Yes")) { + action.insertCost( + new ChooseAndDiscardCardsFromHandEffect(action, game.getGameState().getCurrentPlayerId(), false, 4)); + action.appendEffect( + new DiscardCardsFromPlayEffect(self, self)); + } + } + })); + return Collections.singletonList(action); + } + return null; + } +} diff --git a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/GameState.java b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/GameState.java index 549e3be64..fdf066e5c 100644 --- a/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/GameState.java +++ b/gemp-lotr/gemp-lotr-logic/src/main/java/com/gempukku/lotro/game/state/GameState.java @@ -369,7 +369,7 @@ public class GameState { } } - public void shuffleCardsIntoDeck(Collection cards, String playerId) { + public void shuffleCardsIntoDeck(Collection cards, String playerId) { List zoneCards = _decks.get(playerId); for (PhysicalCard card : cards) {