"Come Here Lad"
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
package com.gempukku.lotro.cards.effects;
|
||||
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.timing.AbstractEffect;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
|
||||
public class StackTopCardsFromDeckEffect extends AbstractEffect {
|
||||
private PhysicalCard _source;
|
||||
private String _playerId;
|
||||
private int _count;
|
||||
private PhysicalCard _target;
|
||||
|
||||
public StackTopCardsFromDeckEffect(PhysicalCard source, String playerId, int count, PhysicalCard target) {
|
||||
_source = source;
|
||||
_playerId = playerId;
|
||||
_count = count;
|
||||
_target = target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(LotroGame game) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EffectResult.Type getType() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPlayableInFull(LotroGame game) {
|
||||
return !PlayConditions.nonPlayZone(_target.getZone()) && game.getGameState().getDeck(_playerId).size() >= _count;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected FullEffectResult playEffectReturningResult(LotroGame game) {
|
||||
if (!PlayConditions.nonPlayZone(_target.getZone())) {
|
||||
int stacked = 0;
|
||||
for (int i = 0; i < _count; i++) {
|
||||
final PhysicalCard card = game.getGameState().removeTopDeckCard(_playerId);
|
||||
if (card != null) {
|
||||
game.getGameState().stackCard(card, _target);
|
||||
stacked++;
|
||||
}
|
||||
}
|
||||
return new FullEffectResult(null, stacked == _count, stacked == _count);
|
||||
}
|
||||
return new FullEffectResult(null, false, false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.gempukku.lotro.cards.set4.dwarven;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractEvent;
|
||||
import com.gempukku.lotro.cards.actions.PlayEventAction;
|
||||
import com.gempukku.lotro.cards.effects.StackTopCardsFromDeckEffect;
|
||||
import com.gempukku.lotro.common.CardType;
|
||||
import com.gempukku.lotro.common.Culture;
|
||||
import com.gempukku.lotro.common.Phase;
|
||||
import com.gempukku.lotro.common.Side;
|
||||
import com.gempukku.lotro.filters.Filters;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.effects.ChooseActiveCardEffect;
|
||||
|
||||
/**
|
||||
* Set: The Two Towers
|
||||
* Side: Free
|
||||
* Culture: Dwarven
|
||||
* Twilight Cost: 0
|
||||
* Type: Event
|
||||
* Game Text: Fellowship: Stack the top 2 cards from your draw deck on a [DWARVEN] condition that has a card already stacked on it.
|
||||
*/
|
||||
public class Card4_043 extends AbstractEvent {
|
||||
public Card4_043() {
|
||||
super(Side.FREE_PEOPLE, Culture.DWARVEN, "Come Here Lad", Phase.FELLOWSHIP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlayEventAction getPlayCardAction(final String playerId, LotroGame game, final PhysicalCard self, int twilightModifier) {
|
||||
final PlayEventAction action = new PlayEventAction(self);
|
||||
action.appendEffect(
|
||||
new ChooseActiveCardEffect(self, playerId, "Choose DWARVEN condition", Filters.culture(Culture.DWARVEN), Filters.type(CardType.CONDITION), Filters.hasStacked(Filters.any())) {
|
||||
@Override
|
||||
protected void cardSelected(PhysicalCard card) {
|
||||
action.insertEffect(
|
||||
new StackTopCardsFromDeckEffect(self, playerId, 2, card));
|
||||
}
|
||||
});
|
||||
return action;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTwilightCost() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user