The Short Rest: Dwarven culture

This commit is contained in:
PhallenCassidy
2016-12-04 05:17:32 -05:00
committed by GitHub
parent 6f12fe8a68
commit 8662a20ccc
6 changed files with 431 additions and 0 deletions

View File

@@ -0,0 +1,73 @@
package com.gempukku.lotro.cards.set31.dwarven;
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.ShuffleDeckEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndDiscardCardsFromPlayEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndPutCardFromDeckIntoHandEffect;
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.decisions.MultipleChoiceAwaitingDecision;
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
import com.gempukku.lotro.logic.effects.PlayoutDecisionEffect;
import java.util.Collections;
import java.util.List;
/**
* Set: The Short Rest
* Side: Free
* Culture: Dwarven
* Twilight Cost: 3
* Type: Event
* Game Text: Regroup: Discard an attached [DWARVEN] follower with a twilight cost of X to play X [DWARVEN] possessions
* or X [DWARVEN] artifacts from your draw deck.
*/
public class Card31_002 extends AbstractEvent {
public Card31_002() {
super(Side.FREE_PEOPLE, 1, Culture.DWARVEN, "Dwarven Song", Phase.REGROUP);
}
@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.canDiscardFromPlay(self, game, Filters.and(Culture.DWARVEN, CardType.FOLLOWER), Filters.attachedTo(CardType.COMPANION));
}
@Override
public PlayEventAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
PlayEventAction action = new PlayEventAction(self);
action.appendCost(
new ChooseActiveCardEffect(self, playerId, "Choose an attached Dwarven follower", Filters.and(Culture.DWARVEN, CardType.FOLLOWER), Filters.attachedTo(CardType.COMPANION)) {
@Override
protected void cardSelected(LotroGame game, final PhysicalCard follower) {
action.insertCost(new ChooseAndDiscardCardsFromPlayEffect(action, playerId, 1, 1, follower));
int twilightCost = follower.getBlueprint().getTwilightCost();
action.appendEffect(
new PlayoutDecisionEffect(playerId,
new MultipleChoiceAwaitingDecision(1, "What would you like to do", new String[]{"Play " + twilightCost + " Dwarven artifacts", "Play " + twilightCost + " Dwarven possessions"}) {
@Override
protected void validDecisionMade(int index, String result) {
new ChooseAndPutCardFromDeckIntoHandEffect(action, playerId, 1, 1, Culture.GONDOR);
for (int i = 0; i < twilightCost; i++) {
if (index == 0) {
action.appendEffect(
new ChooseAndPutCardFromDeckIntoHandEffect(action, playerId, 0, 1, Culture.DWARVEN, CardType.ARTIFACT));
} else {
action.appendEffect(
new ChooseAndPutCardFromDeckIntoHandEffect(action, playerId, 1, 1, Culture.DWARVEN, CardType.POSSESSION));
}
}
action.appendEffect(new ShuffleDeckEffect(playerId));
}
}));
}
});
return action;
}
}

View File

@@ -0,0 +1,77 @@
package com.gempukku.lotro.cards.set31.dwarven;
import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.ChoiceEffect;
import com.gempukku.lotro.cards.effects.SelfDiscardEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
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.effects.ChooseAndHealCharactersEffect;
import com.gempukku.lotro.logic.timing.Effect;
import com.gempukku.lotro.logic.timing.Action;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
/**
* Set: The Short Rest
* Side: Free
* Culture: Dwarven
* Twilight Cost: 2
* Type: Artifact • Support Area
* Game Text: Fellowship: Exert an Elf to heal a Man. Regroup: Exert a Man and discard this artifact to play an Elf from
* your draw deck or discard pile.
*/
public class Card31_003 extends AbstractPermanent {
public Card31_003() {
super(Side.FREE_PEOPLE, 2, CardType.ARTIFACT, Culture.DWARVEN, Zone.SUPPORT, "Emeralds of Girion", null, true);
}
@Override
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, final PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.FELLOWSHIP, self)) {
final ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Race.ELF));
action.appendEffect(
new ChooseAndHealCharactersEffect(action, playerId, 1, 1, Race.MAN));
return Collections.singletonList(action);
}
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.REGROUP, self)) {
final ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Race.MAN));
action.appendCost(
new SelfDiscardEffect(self));
List<Effect> possibleEffects = new LinkedList<Effect>();
possibleEffects.add(
new ChooseAndPlayCardFromDeckEffect(playerId, Race.ELF) {
@Override
public String getText(LotroGame game) {
return "Play an Elf from your draw deck";
}
});
if (PlayConditions.canPlayFromDiscard(playerId, game, Race.ELF)) {
possibleEffects.add(
new ChooseAndPlayCardFromDiscardEffect(playerId, game, Race.ELF) {
@Override
public String getText(LotroGame game) {
return "Play an Elf from your discard pile";
}
});
}
action.appendEffect(
new ChoiceEffect(action, playerId, possibleEffects));
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -0,0 +1,89 @@
package com.gempukku.lotro.cards.set31.dwarven;
import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.actions.PlayPermanentAction;
import com.gempukku.lotro.cards.effects.SelfDiscardEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
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.GameState;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.actions.RequiredTriggerAction;
import com.gempukku.lotro.logic.modifiers.Condition;
import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
import com.gempukku.lotro.logic.modifiers.StrengthModifier;
import com.gempukku.lotro.logic.timing.Action;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collections;
import java.util.List;
/**
* Set: The Short Rest
* Side: Free
* Culture: Dwarven
* Twilight Cost: 2
* Type: Possession • Support Area
* Game Text: Fortification. To play, exert a [DWARVEN] companion. If the fellowship moves during the regroup phase,
* discard this possession. At sites 7 and 8, each minion skirmishing a [DWARVEN] companion is strength -3.
*/
public class Card31_004 extends AbstractPermanent {
public Card31_004() {
super(Side.FREE_PEOPLE, 1, CardType.POSSESSION, Culture.DWARVEN, Zone.SUPPORT, "Great Barricade", null, true);
addKeyword(Keyword.FORTIFICATION);
}
@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, Race.DWARF);
}
@Override
public PlayPermanentAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
PlayPermanentAction permanentAction = super.getPlayCardAction(playerId, game, self, twilightModifier, ignoreRoamingPenalty);
permanentAction.appendCost(
new ChooseAndExertCharactersEffect(permanentAction, playerId, 1, 1, Race.DWARF));
return permanentAction;
}
@Override
public List<? extends Modifier> getAlwaysOnModifiers(LotroGame game, PhysicalCard self) {
return Collections.singletonList(
new StrengthModifier(self,
Filters.and(
CardType.MINION,
Filters.inSkirmishAgainst(
Filters.and(
CardType.COMPANION,
Culture.DWARVEN
)
)
),
new Condition() {
@Override
public boolean isFullfilled(GameState gameState, ModifiersQuerying modifiersQuerying) {
return (gameState.getCurrentSiteNumber() == 7 || gameState.getCurrentSiteNumber() == 8)
&& gameState.getCurrentSiteBlock() == Block.HOBBIT;
}
}, -3));
}
@Override
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.moves(game, effectResult)
&& PlayConditions.isPhase(game, Phase.REGROUP)) {
RequiredTriggerAction action = new RequiredTriggerAction(self);
action.appendEffect(
new SelfDiscardEffect(self));
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -0,0 +1,57 @@
package com.gempukku.lotro.cards.set31.dwarven;
import com.gempukku.lotro.cards.AbstractAttachableFPPossession;
import com.gempukku.lotro.cards.modifiers.ArcheryTotalModifier;
import com.gempukku.lotro.cards.modifiers.CancelStrengthBonusTargetModifier;
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.GameState;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.modifiers.Condition;
import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
import com.gempukku.lotro.logic.modifiers.RemoveKeywordModifier;
import com.gempukku.lotro.logic.modifiers.TwilightCostModifier;
import java.util.LinkedList;
import java.util.List;
/**
* Set: The Short Rest
* Side: Free
* Culture: Shire
* Twilight Cost: 2
* Type: Artifact
* Vitality: +1
* Game Text: Bearer must be Bilbo. The minion archery total is -1. While Bilbo is skirmishing, the twilight cost
* of each Shadow event is +2.
*/
public class Card31_005 extends AbstractAttachableFPPossession {
public Card31_005() {
super(2, 0, 1, Culture.SHIRE, CardType.ARTIFACT, PossessionClass.ARMOR, "Mithril-coat", null, true);
}
@Override
protected Filter getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
return Filters.name("Bilbo");
}
@Override
protected List<? extends Modifier> getNonBasicStatsModifiers(PhysicalCard self) {
List<Modifier> modifiers = new LinkedList<Modifier>();
modifiers.add(
new ArcheryTotalModifier(self, Side.SHADOW, -1));
modifiers.add(
new TwilightCostModifier(self, Filters.and(Side.SHADOW, CardType.POSSESSION),
new Condition() {
@Override
public boolean isFullfilled(GameState gameState, ModifiersQuerying modifiersQuerying) {
return gameState.getSkirmish() != null
&& gameState.getSkirmish().getFellowshipCharacter() == self.getAttachedTo();
}
}, 2));
return modifiers;
}
}

View File

@@ -0,0 +1,61 @@
package com.gempukku.lotro.cards.set31.dwarven;
import com.gempukku.lotro.cards.AbstractAttachableFPPossession;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.PreventCardEffect;
import com.gempukku.lotro.cards.effects.SelfDiscardEffect;
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.WoundCharactersEffect;
import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.modifiers.TwilightCostModifier;
import com.gempukku.lotro.logic.timing.Action;
import com.gempukku.lotro.logic.timing.Effect;
import java.util.Collections;
import java.util.List;
/**
* Set: The Short Rest
* Side: Free
* Culture: Dwarven
* Twilight Cost: 1
* Type: Possession • Shield
* Strength: +1
* Game Text: Bearer must be Thorin. The twilight cost of each [DWARVEN] event is -1.
* Response: If Thorin is about to take a wound, discard this possession to prevent that wound.
*/
public class Card31_006 extends AbstractAttachableFPPossession {
public Card31_006() {
super(1, 0, 0, Culture.DWARVEN, PossessionClass.SHIELD, "Oakenshield", null, true);
}
@Override
protected Filter getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
return Filters.name("Thorin");
}
@Override
protected List<? extends Modifier> getNonBasicStatsModifiers(PhysicalCard self) {
return Collections.singletonList(
new TwilightCostModifier(self, Filters.and(Culture.DWARVEN, CardType.EVENT, Filters.owner(self.getOwner())), -1));
}
@Override
public List<? extends Action> getOptionalInPlayBeforeActions(String playerId, LotroGame game, Effect effect, PhysicalCard self) {
if (TriggerConditions.isGettingWounded(effect, game, Filters.hasAttached(self))) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new SelfDiscardEffect(self));
action.appendEffect(
new PreventCardEffect((WoundCharactersEffect) effect, self.getAttachedTo()));
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -0,0 +1,74 @@
package com.gempukku.lotro.cards.set31.dwarven;
import com.gempukku.lotro.cards.AbstractPermanent;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.effects.PutCardFromStackedIntoHandEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndStackCardsFromHandEffect;
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.AddTwilightEffect;
import com.gempukku.lotro.logic.effects.ChooseArbitraryCardsEffect;
import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.modifiers.TwilightCostModifier;
import com.gempukku.lotro.logic.timing.Action;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
/**
* Set: The Short Rest
* Side: Free
* Culture: Dwarven
* Twilight Cost: 2
* Type: Artifact • Support Area
* Game Text: Smaug's twilight cost is -4. Fellowship: Add (1) to take a card stacked here into hand.
* Maneuver: Stack a [DWARVEN] card from hand on The Arkenstone.
*/
public class Card31_007 extends AbstractPermanent {
public Card31_007() {
super(Side.FREE_PEOPLE, 2, CardType.ARTIFACT, Culture.DWARVEN, Zone.SUPPORT, "The Arkenstone", null, true);
}
@Override
public Modifier getAlwaysOnModifier(LotroGame game, PhysicalCard self) {
return new TwilightCostModifier(self, Filters.name("Smaug"), -4);
}
@Override
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, final PhysicalCard self) {
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.FELLOWSHIP, self)) {
List<PhysicalCard> stackedCards = game.getGameState().getStackedCards(self);
if (stackedCards.size() > 0) {
final ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new AddTwilightEffect(self, 1));
action.appendEffect(
new ChooseArbitraryCardsEffect(playerId, "Choose card", stackedCards, 1, 1) {
@Override
protected void cardsSelected(LotroGame game, Collection<PhysicalCard> selectedCards) {
for (PhysicalCard selectedCard : selectedCards) {
action.appendEffect(
new PutCardFromStackedIntoHandEffect(selectedCard));
}
}
});
return Collections.singletonList(action);
}
}
if (PlayConditions.canUseFPCardDuringPhase(game, Phase.MANEUVER, self)) {
if (Filters.filter(game.getGameState().getHand(playerId), game.getGameState(), game.getModifiersQuerying(), Culture.DWARVEN).size() > 0) {
final ActivateCardAction action = new ActivateCardAction(self);
action.appendEffect(
new ChooseAndStackCardsFromHandEffect(action, playerId, 1, 1, self, Culture.DWARVEN));
return Collections.singletonList(action);
}
}
return null;
}
}