"Mordor Guard"
This commit is contained in:
@@ -192,6 +192,11 @@ public abstract class AbstractLotroCardBlueprint implements LotroCardBlueprint {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RequiredTriggerAction getDiscardedFromPlayTrigger(LotroGame game, PhysicalCard self) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Signet getSignet() {
|
||||
throw new UnsupportedOperationException("This method should not be called on this card");
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.gempukku.lotro.cards.set7.sauron;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractMinion;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndExertCharactersEffect;
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
import com.gempukku.lotro.common.Phase;
|
||||
import com.gempukku.lotro.common.Race;
|
||||
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.actions.RequiredTriggerAction;
|
||||
import com.gempukku.lotro.logic.effects.AddThreatsEffect;
|
||||
import com.gempukku.lotro.logic.effects.RemoveThreatsEffect;
|
||||
import com.gempukku.lotro.logic.timing.Action;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Set: The Return of the King
|
||||
* Side: Shadow
|
||||
* Culture: Sauron
|
||||
* Twilight Cost: 3
|
||||
* Type: Minion • Orc
|
||||
* Strength: 9
|
||||
* Vitality: 3
|
||||
* Site: 6
|
||||
* Game Text: Skirmish: Exert 3 [SAURON] Orcs to add 3 threats. When this minion is discarded, remove 3 threats.
|
||||
*/
|
||||
public class Card7_287 extends AbstractMinion {
|
||||
public Card7_287() {
|
||||
super(3, 9, 3, 6, Race.ORC, Culture.SAURON, "Mordor Guard");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<? extends Action> getExtraPhaseActions(String playerId, LotroGame game, PhysicalCard self) {
|
||||
if (PlayConditions.canUseShadowCardDuringPhase(game, Phase.SKIRMISH, self, 0)
|
||||
&& PlayConditions.canExertMultiple(self, game, 1, 3, Culture.SAURON, Race.ORC)) {
|
||||
ActivateCardAction action = new ActivateCardAction(self);
|
||||
action.appendCost(
|
||||
new ChooseAndExertCharactersEffect(action, playerId, 3, 3, Culture.SAURON, Race.ORC));
|
||||
action.appendEffect(
|
||||
new AddThreatsEffect(playerId, self, 3));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RequiredTriggerAction getDiscardedFromPlayTrigger(LotroGame game, PhysicalCard self) {
|
||||
RequiredTriggerAction action = new RequiredTriggerAction(self);
|
||||
action.appendEffect(
|
||||
new RemoveThreatsEffect(self, 3));
|
||||
return action;
|
||||
}
|
||||
}
|
||||
@@ -71,6 +71,8 @@ public interface LotroCardBlueprint {
|
||||
|
||||
public List<? extends Action> getOptionalAfterActions(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self);
|
||||
|
||||
public RequiredTriggerAction getDiscardedFromPlayTrigger(LotroGame game, PhysicalCard self);
|
||||
|
||||
public Block getSiteBlock();
|
||||
|
||||
public int getSiteNumber();
|
||||
|
||||
@@ -28,6 +28,8 @@ public class RuleSet {
|
||||
|
||||
new WinConditionRule(_actionsEnvironment).applyRule();
|
||||
|
||||
new DiscardedCardRule(_actionsEnvironment).applyRule();
|
||||
|
||||
new FrodoAndSamRule(_modifiersLogic).applyRule();
|
||||
|
||||
new ThreatRule(_actionsEnvironment).applyRule();
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.gempukku.lotro.logic.timing.rules;
|
||||
|
||||
import com.gempukku.lotro.game.AbstractActionProxy;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.game.state.actions.DefaultActionsEnvironment;
|
||||
import com.gempukku.lotro.logic.actions.RequiredTriggerAction;
|
||||
import com.gempukku.lotro.logic.timing.Action;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
import com.gempukku.lotro.logic.timing.results.DiscardCardsFromPlayResult;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public class DiscardedCardRule {
|
||||
private DefaultActionsEnvironment _actionsEnvironment;
|
||||
|
||||
public DiscardedCardRule(DefaultActionsEnvironment actionsEnvironment) {
|
||||
_actionsEnvironment = actionsEnvironment;
|
||||
}
|
||||
|
||||
public void applyRule() {
|
||||
_actionsEnvironment.addAlwaysOnActionProxy(
|
||||
new AbstractActionProxy() {
|
||||
@Override
|
||||
public List<? extends Action> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult) {
|
||||
if (effectResult.getType() == EffectResult.Type.DISCARD_FROM_PLAY) {
|
||||
DiscardCardsFromPlayResult discardResult = (DiscardCardsFromPlayResult) effectResult;
|
||||
Collection<PhysicalCard> discardedCards = discardResult.getDiscardedCards();
|
||||
List<RequiredTriggerAction> actions = new LinkedList<RequiredTriggerAction>();
|
||||
for (PhysicalCard discardedCard : discardedCards) {
|
||||
RequiredTriggerAction trigger = discardedCard.getBlueprint().getDiscardedFromPlayTrigger(game, discardedCard);
|
||||
if (trigger != null)
|
||||
actions.add(trigger);
|
||||
}
|
||||
return actions;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user