"The Dead City"

This commit is contained in:
marcins78@gmail.com
2011-11-01 12:14:58 +00:00
parent c6f5a93db5
commit 5a45684f53
2 changed files with 57 additions and 3 deletions

View File

@@ -0,0 +1,46 @@
package com.gempukku.lotro.cards.set7.gollum;
import com.gempukku.lotro.cards.AbstractAttachable;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.common.*;
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.effects.DiscardCardsFromPlayEffect;
import com.gempukku.lotro.logic.timing.Effect;
import java.util.Collections;
import java.util.List;
/**
* Set: The Return of the King
* Side: Free
* Culture: Gollum
* Twilight Cost: 3
* Type: Condition
* Game Text: Stealth. Bearer must be Smeagol. If Smeagol is about to be killed in a skirmish, he is discarded instead.
*/
public class Card7_056 extends AbstractAttachable {
public Card7_056() {
super(Side.FREE_PEOPLE, CardType.CONDITION, 3, Culture.GOLLUM, null, "The Dead City");
addKeyword(Keyword.STEALTH);
}
@Override
protected Filterable getValidTargetFilter(String playerId, LotroGame game, PhysicalCard self) {
return Filters.name("Smeagol");
}
@Override
public List<RequiredTriggerAction> getRequiredBeforeTriggers(LotroGame game, Effect effect, PhysicalCard self) {
if (PlayConditions.isGettingKilled(effect, game, Filters.hasAttached(self))
&& game.getGameState().getCurrentPhase() == Phase.SKIRMISH) {
RequiredTriggerAction action = new RequiredTriggerAction(self);
action.appendEffect(
new DiscardCardsFromPlayEffect(self, Filters.hasAttached(self)));
return Collections.singletonList(action);
}
return null;
}
}

View File

@@ -27,7 +27,13 @@ public class KillEffect extends AbstractSuccessfulEffect {
}
public List<PhysicalCard> getCharactersToBeKilled() {
return _cards;
List<PhysicalCard> result = new LinkedList<PhysicalCard>();
for (PhysicalCard card : _cards) {
if (card.getZone().isInPlay())
result.add(card);
}
return result;
}
@Override
@@ -38,9 +44,11 @@ public class KillEffect extends AbstractSuccessfulEffect {
@Override
public Collection<? extends EffectResult> playEffect(LotroGame game) {
List<PhysicalCard> toBeKilled = getCharactersToBeKilled();
GameState gameState = game.getGameState();
for (PhysicalCard card : _cards)
for (PhysicalCard card : toBeKilled)
gameState.sendMessage(GameUtils.getCardLink(card) + " gets killed");
// For result
@@ -52,7 +60,7 @@ public class KillEffect extends AbstractSuccessfulEffect {
Set<PhysicalCard> toAddToDeadPile = new HashSet<PhysicalCard>();
Set<PhysicalCard> toAddToDiscard = new HashSet<PhysicalCard>();
for (PhysicalCard card : _cards) {
for (PhysicalCard card : toBeKilled) {
toRemoveFromZone.add(card);
if (card.getBlueprint().getSide() == Side.FREE_PEOPLE) {