Another fixes.

This commit is contained in:
marcins78@gmail.com
2011-08-30 21:45:17 +00:00
parent 402cc0c9cb
commit f4c804fd5b
4 changed files with 42 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ package com.gempukku.lotro.cards.set1.elven;
import com.gempukku.lotro.cards.AbstractLotroCardBlueprint;
import com.gempukku.lotro.cards.PlayConditions;
import com.gempukku.lotro.cards.actions.PlayEventAction;
import com.gempukku.lotro.cards.effects.AddUntilEndOfPhaseModifierEffect;
import com.gempukku.lotro.cards.effects.SpotEffect;
import com.gempukku.lotro.cards.modifiers.ArcheryTotalModifier;
@@ -9,7 +10,6 @@ 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.CostToEffectAction;
import com.gempukku.lotro.logic.timing.Action;
import java.util.Collections;
@@ -38,7 +38,7 @@ public class Card1_052 extends AbstractLotroCardBlueprint {
public List<? extends Action> getPlayablePhaseActions(String playerId, LotroGame game, PhysicalCard self) {
if (PlayConditions.canPlayFPCardDuringPhase(game.getGameState(), Phase.ARCHERY, self)
&& Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.keyword(Keyword.ELF), Filters.type(CardType.COMPANION))) {
CostToEffectAction action = new CostToEffectAction(self, "Make the minion archery total -1");
PlayEventAction action = new PlayEventAction(self);
action.addCost(new SpotEffect(Filters.and(Filters.keyword(Keyword.ELF), Filters.type(CardType.COMPANION))));
action.addEffect(
new AddUntilEndOfPhaseModifierEffect(

View File

@@ -1,6 +1,7 @@
package com.gempukku.lotro.logic.actions;
import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.logic.effects.DiscardAttachedCardsEffect;
import com.gempukku.lotro.logic.effects.KillEffect;
public class KillAction extends CostToEffectAction {
@@ -8,5 +9,6 @@ public class KillAction extends CostToEffectAction {
super(null, "Kill the character");
addEffect(new KillEffect(card));
addEffect(new DiscardAttachedCardsEffect(card));
}
}

View File

@@ -0,0 +1,28 @@
package com.gempukku.lotro.logic.effects;
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 java.util.List;
public class DiscardAttachedCardsEffect extends UnrespondableEffect {
private PhysicalCard _card;
public DiscardAttachedCardsEffect(PhysicalCard card) {
_card = card;
}
@Override
public void playEffect(LotroGame game) {
GameState gameState = game.getGameState();
List<PhysicalCard> attachedCards = gameState.getAttachedCards(_card);
for (PhysicalCard attachedCard : attachedCards) {
gameState.stopAffecting(attachedCard);
gameState.removeCardFromZone(attachedCard);
gameState.addCardToZone(attachedCard, Zone.DISCARD);
}
}
}

View File

@@ -6,6 +6,8 @@ import com.gempukku.lotro.game.state.GameState;
import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.timing.UnrespondableEffect;
import java.util.List;
public class DiscardCardFromPlayEffect extends UnrespondableEffect {
private PhysicalCard _card;
@@ -25,5 +27,13 @@ public class DiscardCardFromPlayEffect extends UnrespondableEffect {
gameState.stopAffecting(_card);
gameState.removeCardFromZone(_card);
gameState.addCardToZone(_card, Zone.DISCARD);
List<PhysicalCard> attachedCards = gameState.getAttachedCards(_card);
for (PhysicalCard attachedCard : attachedCards) {
gameState.stopAffecting(attachedCard);
gameState.removeCardFromZone(attachedCard);
gameState.addCardToZone(attachedCard, Zone.DISCARD);
}
}
}