"The Witch-king"

This commit is contained in:
marcins78@gmail.com
2011-12-14 20:52:17 +00:00
parent c97d198845
commit 254185888f
5 changed files with 83 additions and 0 deletions

View File

@@ -196,6 +196,11 @@ public abstract class AbstractLotroCardBlueprint implements LotroCardBlueprint {
return null;
}
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggersFromHand(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
return null;
}
@Override
public List<? extends Action> getOptionalAfterActions(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
return null;

View File

@@ -72,6 +72,11 @@ public class SimpleLotroCardBlueprint implements LotroCardBlueprint {
return null;
}
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggersFromHand(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
return null;
}
@Override
public List<? extends Action> getOptionalBeforeActions(String playerId, LotroGame game, Effect effect, PhysicalCard self) {
return null;

View File

@@ -0,0 +1,58 @@
package com.gempukku.lotro.cards.set12.wraith;
import com.gempukku.lotro.cards.AbstractMinion;
import com.gempukku.lotro.cards.TriggerConditions;
import com.gempukku.lotro.cards.effects.RevealCardEffect;
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
import com.gempukku.lotro.common.CardType;
import com.gempukku.lotro.common.Culture;
import com.gempukku.lotro.common.Keyword;
import com.gempukku.lotro.common.Race;
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.OptionalTriggerAction;
import com.gempukku.lotro.logic.modifiers.ModifiersQuerying;
import com.gempukku.lotro.logic.timing.EffectResult;
import java.util.Collections;
import java.util.List;
/**
* Set: Black Rider
* Side: Shadow
* Culture: Wraith
* Twilight Cost: 8
* Type: Minion • Nazgul
* Strength: 14
* Vitality: 4
* Site: 3
* Game Text: Fierce. The Witch-King is twilight cost -1 for each wound on the Ring-bearer. Each time a companion is
* played, you may reveal this card from hand to exert the Ring-bearer.
*/
public class Card12_183 extends AbstractMinion {
public Card12_183() {
super(8, 14, 4, 3, Race.NAZGUL, Culture.WRAITH, "The Witch-king", true);
addKeyword(Keyword.FIERCE);
}
@Override
public int getTwilightCostModifier(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard self) {
return -gameState.getWounds(gameState.getRingBearer(gameState.getCurrentPlayerId()));
}
@Override
public List<OptionalTriggerAction> getOptionalAfterTriggersFromHand(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
if (TriggerConditions.played(game, effectResult, CardType.COMPANION)
&& !playerId.equals(game.getGameState().getCurrentPlayerId())) {
OptionalTriggerAction action = new OptionalTriggerAction(self);
action.appendCost(
new RevealCardEffect(self, self));
action.appendEffect(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, Filters.ringBearer));
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -69,6 +69,8 @@ public interface LotroCardBlueprint {
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self);
public List<OptionalTriggerAction> getOptionalAfterTriggersFromHand(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self);
public List<? extends Action> getOptionalAfterActions(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self);
public RequiredTriggerAction getDiscardedFromPlayRequiredTrigger(LotroGame game, PhysicalCard self);

View File

@@ -203,6 +203,19 @@ public class DefaultActionsEnvironment implements ActionsEnvironment {
}
}
}
// Optional triggers from hand
for (PhysicalCard cardInHand : _lotroGame.getGameState().getHand(playerId)) {
for (EffectResult effectResult : effectResults) {
List<OptionalTriggerAction> actions = cardInHand.getBlueprint().getOptionalAfterTriggersFromHand(playerId, _lotroGame, effectResult, cardInHand);
if (actions != null) {
for (OptionalTriggerAction action : actions) {
if (!effectResult.wasOptionalTriggerUsed(action))
gatheredActions.put(action, effectResult);
}
}
}
}
}
for (Action gatheredAction : gatheredActions.keySet())