play lands from devmode

This commit is contained in:
Maxmtg
2013-06-02 07:28:14 +00:00
parent 91ec9b6409
commit 4e48eb476f

View File

@@ -406,33 +406,33 @@ public final class GuiDisplayUtil {
return; return;
} }
final Card forgeCard = c.toForgeCard(p);
final Game game = getGame(); final Game game = getGame();
if (forgeCard.getType().contains("Land")) { game.getAction().invoke(new Runnable() {
forgeCard.setOwner(p); @Override public void run() {
game.getAction().moveToPlay(forgeCard); final Card forgeCard = c.toForgeCard(p);
} else {
final List<SpellAbility> choices = forgeCard.getBasicSpells();
if (choices.isEmpty()) {
return; // when would it happen?
}
final SpellAbility sa = choices.size() == 1 ? choices.get(0) : GuiChoose.oneOrNone("Choose", choices); if (c.getRules().getType().isLand()) {
if (sa == null) { forgeCard.setOwner(p);
return; // happens if cancelled game.getAction().moveToPlay(forgeCard);
}
} else {
game.getAction().invoke(new Runnable() { final List<SpellAbility> choices = forgeCard.getBasicSpells();
@Override if (choices.isEmpty()) {
public void run() { return; // when would it happen?
}
final SpellAbility sa = choices.size() == 1 ? choices.get(0) : GuiChoose.oneOrNone("Choose", choices);
if (sa == null) {
return; // happens if cancelled
}
game.getAction().moveToHand(forgeCard); // this is really needed (for rollbacks at least) game.getAction().moveToHand(forgeCard); // this is really needed (for rollbacks at least)
// Human player is choosing targets for an ability controlled by chosen player. // Human player is choosing targets for an ability controlled by chosen player.
sa.setActivatingPlayer(p); sa.setActivatingPlayer(p);
HumanPlay.playSaWithoutPayingManaCost(game, sa); HumanPlay.playSaWithoutPayingManaCost(game, sa);
} }
}); }
} });
} }