"Goblin Messenger"
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
package com.gempukku.lotro.cards.effects.choose;
|
||||
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.effects.StackCardFromPlayEffect;
|
||||
import com.gempukku.lotro.common.Filterable;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.actions.SubAction;
|
||||
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
|
||||
import com.gempukku.lotro.logic.timing.AbstractSubActionEffect;
|
||||
import com.gempukku.lotro.logic.timing.Action;
|
||||
|
||||
public class ChooseAndStackCardFromPlayEffect extends AbstractSubActionEffect {
|
||||
private Action _action;
|
||||
private String _playerId;
|
||||
private Filterable _stackOnFilter;
|
||||
private Filterable[] _cardFilter;
|
||||
|
||||
public ChooseAndStackCardFromPlayEffect(Action action, String playerId, Filterable stackOn, Filterable... filter) {
|
||||
_action = action;
|
||||
_playerId = playerId;
|
||||
_stackOnFilter = stackOn;
|
||||
_cardFilter = filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type getType() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(LotroGame game) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPlayableInFull(LotroGame game) {
|
||||
return PlayConditions.isActive(game, _cardFilter) && PlayConditions.isActive(game, _stackOnFilter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void playEffect(LotroGame game) {
|
||||
final SubAction subAction = new SubAction(_action);
|
||||
subAction.appendEffect(
|
||||
new ChooseActiveCardEffect(_action.getActionSource(), _playerId, "Choose card to stack", _cardFilter) {
|
||||
@Override
|
||||
protected void cardSelected(LotroGame game, final PhysicalCard cardToStack) {
|
||||
subAction.appendEffect(
|
||||
new ChooseActiveCardEffect(_action.getActionSource(), _playerId, "Choose card to stack on", _stackOnFilter) {
|
||||
@Override
|
||||
protected void cardSelected(LotroGame game, PhysicalCard cardToStackOn) {
|
||||
subAction.appendEffect(
|
||||
new StackCardFromPlayEffect(cardToStack, cardToStackOn));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
processSubAction(game, subAction);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.gempukku.lotro.cards.set20.moria;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractMinion;
|
||||
import com.gempukku.lotro.cards.TriggerConditions;
|
||||
import com.gempukku.lotro.cards.effects.choose.ChooseAndStackCardFromPlayEffect;
|
||||
import com.gempukku.lotro.common.CardType;
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
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.OptionalTriggerAction;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 2
|
||||
* Goblin Messenger
|
||||
* Moria Minion • Goblin
|
||||
* 5 1 4
|
||||
* When you play this minion, you may stack a Goblin on a [Moria] condition.
|
||||
*/
|
||||
public class Card20_262 extends AbstractMinion {
|
||||
public Card20_262() {
|
||||
super(2, 5, 1, 4, Race.GOBLIN, Culture.MORIA, "Goblin Messenger");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OptionalTriggerAction> getOptionalAfterTriggers(String playerId, LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (TriggerConditions.played(game, effectResult, self)) {
|
||||
OptionalTriggerAction action = new OptionalTriggerAction(self);
|
||||
action.appendCost(
|
||||
new ChooseAndStackCardFromPlayEffect(action, playerId, Filters.and(Culture.MORIA, CardType.CONDITION), Race.GOBLIN));
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user