Fix to The Hobbit "Goblin Song"

Checks if costs can be paid to play from discard before playing
This commit is contained in:
PhallenCassidy
2018-03-08 11:53:03 -05:00
committed by GitHub
parent e9064f35fe
commit ddcb217a9b

View File

@@ -11,6 +11,7 @@ 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.ActivateCardAction;
import com.gempukku.lotro.logic.timing.Action;
import java.util.Collections;
@@ -39,8 +40,8 @@ public class Card31_033 extends AbstractEvent {
@Override
public PlayEventAction getPlayCardAction(String playerId, LotroGame game, PhysicalCard self, int twilightModifier, boolean ignoreRoamingPenalty) {
PlayEventAction action = new PlayEventAction(self);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 2, 2, Race.ORC));
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 2, 2, Race.ORC));
action.appendEffect(
new ChooseAndDiscardCardsFromPlayEffect(action, playerId, 1, 1, Filters.or(CardType.POSSESSION, CardType.ARTIFACT), Filters.attachedTo(Filters.and(CardType.COMPANION, Race.DWARF))));
return action;
@@ -50,12 +51,18 @@ public class Card31_033 extends AbstractEvent {
public List<? extends Action> getPhaseActionsFromDiscard(String playerId, LotroGame game, final PhysicalCard self) {
if (PlayConditions.isPhase(game, Phase.MANEUVER)
&& PlayConditions.canExert(self, game, 2, Filters.name("The Great Goblin"))
&& PlayConditions.canPlayFromDiscard(playerId, game, self)) {
final PlayEventAction action = getPlayCardAction(playerId, game, self, 0, false);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, 2, Filters.name("The Great Goblin")));
&& (PlayConditions.canExert(self, game, 1, 2, Filters.and(Race.ORC, Filters.not(Filters.name("The Great Goblin"))))
|| (PlayConditions.canExert(self, game, 1, Filters.and(Race.ORC, Filters.not(Filters.name("The Great Goblin"))))
&& PlayConditions.canExert(self, game, 3, Filters.name("The Great Goblin"))))) {
ActivateCardAction action = new ActivateCardAction(self);
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 1, 1, 2, Filters.name("The Great Goblin")));
action.appendCost(
new ChooseAndExertCharactersEffect(action, playerId, 2, 2, Race.ORC));
action.appendEffect(
new ChooseAndDiscardCardsFromPlayEffect(action, playerId, 1, 1, Filters.or(CardType.POSSESSION, CardType.ARTIFACT), Filters.attachedTo(Filters.and(CardType.COMPANION, Race.DWARF))));
return Collections.singletonList(action);
}
return null;
}
}
}