Another fixes.
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user