"Memories of Darkness"
This commit is contained in:
@@ -173,6 +173,15 @@ public class PlayConditions {
|
||||
return game.getModifiersQuerying().hasInitiative(game.getGameState()) == side;
|
||||
}
|
||||
|
||||
public static boolean loseInitiative(EffectResult effectResult, Side side) {
|
||||
if (effectResult.getType() == EffectResult.Type.INITIATIVE_CHANGE) {
|
||||
InitiativeChangeResult initiativeChangeResult = (InitiativeChangeResult) effectResult;
|
||||
if (initiativeChangeResult.getSide() != side)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean canAddThreat(LotroGame game, PhysicalCard card, int count) {
|
||||
return Filters.countActive(game.getGameState(), game.getModifiersQuerying(), CardType.COMPANION) - game.getGameState().getThreats() >= count;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.gempukku.lotro.cards.set10.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.choose.ChooseAndPlayCardFromDiscardEffect;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndPlayCardFromHandEffect;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.actions.OptionalTriggerAction;
|
||||
import com.gempukku.lotro.logic.timing.Effect;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Set: Mount Doom
|
||||
* Side: Free
|
||||
* Culture: Dwarven
|
||||
* Twilight Cost: 1
|
||||
* Type: Condition • Support Area
|
||||
* Game Text: To play, spot a Dwarf. Each time you lose initiative (except during the fellowship phase), you may play
|
||||
* a [DWARVEN] condition from hand or from your discard pile.
|
||||
*/
|
||||
public class Card10_002 extends AbstractPermanent {
|
||||
public Card10_002() {
|
||||
super(Side.FREE_PEOPLE, 1, CardType.CONDITION, Culture.DWARVEN, Zone.SUPPORT, "Memories of Darkness", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
|
||||
return super.checkPlayRequirements(playerId, game, self, twilightModifier, ignoreRoamingPenalty)
|
||||
&& PlayConditions.canSpot(game, Race.DWARF);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (PlayConditions.loseInitiative(effectResult, Side.FREE_PEOPLE)
|
||||
&& game.getGameState().getCurrentPhase() != Phase.FELLOWSHIP
|
||||
&& (
|
||||
PlayConditions.canPlayFromHand(playerId, game, Culture.DWARVEN, CardType.CONDITION)
|
||||
|| PlayConditions.canPlayFromDiscard(playerId, game, Culture.DWARVEN, CardType.CONDITION))) {
|
||||
OptionalTriggerAction action = new OptionalTriggerAction(self);
|
||||
List<Effect> possibleEffects = new LinkedList<Effect>();
|
||||
possibleEffects.add(
|
||||
new ChooseAndPlayCardFromHandEffect(playerId, game.getGameState().getHand(playerId), Culture.DWARVEN, CardType.CONDITION));
|
||||
possibleEffects.add(
|
||||
new ChooseAndPlayCardFromDiscardEffect(playerId, game.getGameState().getDiscard(playerId), Culture.DWARVEN, CardType.CONDITION));
|
||||
action.appendEffect(
|
||||
new ChoiceEffect(action, playerId, possibleEffects));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user