"Verily I Come"
This commit is contained in:
@@ -3,9 +3,11 @@ package com.gempukku.lotro.cards.effects;
|
||||
import com.gempukku.lotro.common.Zone;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.timing.UnrespondableEffect;
|
||||
import com.gempukku.lotro.logic.timing.Effect;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
import com.gempukku.lotro.logic.timing.results.DrawCardOrPutIntoHandResult;
|
||||
|
||||
public class PutCardFromDeckIntoHandOrDiscardEffect extends UnrespondableEffect {
|
||||
public class PutCardFromDeckIntoHandOrDiscardEffect implements Effect {
|
||||
private PhysicalCard _physicalCard;
|
||||
|
||||
public PutCardFromDeckIntoHandOrDiscardEffect(PhysicalCard physicalCard) {
|
||||
@@ -16,23 +18,30 @@ public class PutCardFromDeckIntoHandOrDiscardEffect extends UnrespondableEffect
|
||||
return _physicalCard;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EffectResult.Type getType() {
|
||||
return EffectResult.Type.DRAW_CARD_OR_PUT_INTO_HAND;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(LotroGame game) {
|
||||
return "Put card from deck into hand";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doPlayEffect(LotroGame game) {
|
||||
public EffectResult[] playEffect(LotroGame game) {
|
||||
if (_physicalCard.getZone() == Zone.DECK) {
|
||||
if (game.getModifiersQuerying().canDrawCardAndIncrement(game.getGameState(), _physicalCard.getOwner())) {
|
||||
game.getGameState().sendMessage(_physicalCard.getOwner() + " puts card from deck into his or her hand");
|
||||
game.getGameState().removeCardFromZone(_physicalCard);
|
||||
game.getGameState().addCardToZone(_physicalCard, Zone.HAND);
|
||||
return new EffectResult[]{new DrawCardOrPutIntoHandResult(_physicalCard.getOwner(), 1)};
|
||||
} else {
|
||||
game.getGameState().sendMessage(_physicalCard.getOwner() + " discards " + _physicalCard.getBlueprint().getName() + " from deck");
|
||||
game.getGameState().removeCardFromZone(_physicalCard);
|
||||
game.getGameState().addCardToZone(_physicalCard, Zone.DISCARD);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,9 +4,11 @@ import com.gempukku.lotro.common.Zone;
|
||||
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.timing.UnrespondableEffect;
|
||||
import com.gempukku.lotro.logic.timing.Effect;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
import com.gempukku.lotro.logic.timing.results.DrawCardOrPutIntoHandResult;
|
||||
|
||||
public class PutCardFromDiscardIntoHandEffect extends UnrespondableEffect {
|
||||
public class PutCardFromDiscardIntoHandEffect implements Effect {
|
||||
private PhysicalCard _card;
|
||||
|
||||
public PutCardFromDiscardIntoHandEffect(PhysicalCard card) {
|
||||
@@ -14,12 +16,25 @@ public class PutCardFromDiscardIntoHandEffect extends UnrespondableEffect {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doPlayEffect(LotroGame game) {
|
||||
public String getText(LotroGame game) {
|
||||
return "Put card from discard into hand";
|
||||
}
|
||||
|
||||
@Override
|
||||
public EffectResult.Type getType() {
|
||||
return EffectResult.Type.DRAW_CARD_OR_PUT_INTO_HAND;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EffectResult[] playEffect(LotroGame game) {
|
||||
if (game.getModifiersQuerying().canDrawCardAndIncrement(game.getGameState(), _card.getOwner())) {
|
||||
GameState gameState = game.getGameState();
|
||||
gameState.sendMessage(_card.getOwner() + " puts " + _card.getBlueprint().getName() + " from discard into his or her hand");
|
||||
gameState.removeCardFromZone(_card);
|
||||
gameState.addCardToZone(_card, Zone.HAND);
|
||||
|
||||
return new EffectResult[]{new DrawCardOrPutIntoHandResult(_card.getOwner(), 1)};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.gempukku.lotro.cards.set2.sauron;
|
||||
|
||||
import com.gempukku.lotro.cards.AbstractAttachable;
|
||||
import com.gempukku.lotro.cards.PlayConditions;
|
||||
import com.gempukku.lotro.cards.effects.AddBurdenEffect;
|
||||
import com.gempukku.lotro.common.*;
|
||||
import com.gempukku.lotro.filters.Filter;
|
||||
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.RequiredTriggerAction;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
import com.gempukku.lotro.logic.timing.results.DrawCardOrPutIntoHandResult;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Set: Mines of Moria
|
||||
* Side: Shadow
|
||||
* Culture: Sauron
|
||||
* Twilight Cost: 0
|
||||
* Type: Condition
|
||||
* Game Text: To play, exert a [SAURON] Orc. Plays on the Ring-bearer. Each time the Free Peoples player draws a card
|
||||
* (or takes a card into hand) during the fellowship phase, add a burden.
|
||||
*/
|
||||
public class Card2_094 extends AbstractAttachable {
|
||||
public Card2_094() {
|
||||
super(Side.SHADOW, CardType.CONDITION, 0, Culture.SAURON, null, "Verily I Come");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self, Filter additionalAttachmentFilter, int twilightModifier) {
|
||||
return super.checkPlayRequirements(playerId, game, self, additionalAttachmentFilter, twilightModifier)
|
||||
&& PlayConditions.canExert(self, game.getGameState(), game.getModifiersQuerying(), Filters.culture(Culture.SAURON), Filters.race(Race.ORC));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Filter getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
|
||||
return Filters.keyword(Keyword.RING_BEARER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RequiredTriggerAction> getRequiredAfterTriggers(LotroGame game, EffectResult effectResult, PhysicalCard self) {
|
||||
if (effectResult.getType() == EffectResult.Type.DRAW_CARD_OR_PUT_INTO_HAND
|
||||
&& ((DrawCardOrPutIntoHandResult) effectResult).getPlayerId().equals(game.getGameState().getCurrentPlayerId())
|
||||
&& game.getGameState().getCurrentPhase() == Phase.FELLOWSHIP) {
|
||||
RequiredTriggerAction action = new RequiredTriggerAction(self);
|
||||
for (int i = 0; i < ((DrawCardOrPutIntoHandResult) effectResult).getCount(); i++) {
|
||||
action.appendEffect(
|
||||
new AddBurdenEffect(self.getOwner()));
|
||||
}
|
||||
return Collections.singletonList(action);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.gempukku.lotro.logic.effects;
|
||||
import com.gempukku.lotro.game.state.LotroGame;
|
||||
import com.gempukku.lotro.logic.timing.Effect;
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
import com.gempukku.lotro.logic.timing.results.DrawCardOrPutIntoHandResult;
|
||||
|
||||
public class DrawCardEffect implements Effect {
|
||||
private String _playerId;
|
||||
@@ -34,6 +35,9 @@ public class DrawCardEffect implements Effect {
|
||||
}
|
||||
game.getGameState().sendMessage(_playerId + " draws " + drawn + " card(s)");
|
||||
|
||||
return null;
|
||||
if (drawn > 0)
|
||||
return new EffectResult[]{new DrawCardOrPutIntoHandResult(_playerId, drawn)};
|
||||
else
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ public abstract class EffectResult {
|
||||
START_OF_TURN,
|
||||
END_OF_TURN,
|
||||
|
||||
PLAY,
|
||||
PLAY, DRAW_CARD_OR_PUT_INTO_HAND,
|
||||
|
||||
PUT_ON_THE_ONE_RING, REMOVE_BURDEN,
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.gempukku.lotro.logic.timing.results;
|
||||
|
||||
import com.gempukku.lotro.logic.timing.EffectResult;
|
||||
|
||||
public class DrawCardOrPutIntoHandResult extends EffectResult {
|
||||
private String _playerId;
|
||||
private int _count;
|
||||
|
||||
public DrawCardOrPutIntoHandResult(String playerId, int count) {
|
||||
super(EffectResult.Type.DRAW_CARD_OR_PUT_INTO_HAND);
|
||||
_playerId = playerId;
|
||||
_count = count;
|
||||
}
|
||||
|
||||
public String getPlayerId() {
|
||||
return _playerId;
|
||||
}
|
||||
|
||||
public int getCount() {
|
||||
return _count;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user