- Little tweak for playStack in ComputerUtil.

This commit is contained in:
Sloth
2012-03-08 17:34:37 +00:00
parent 7244ba7ab3
commit 0a54d18e60

View File

@@ -302,17 +302,22 @@ public class ComputerUtil {
* a {@link forge.card.spellability.SpellAbility} object. * a {@link forge.card.spellability.SpellAbility} object.
*/ */
public static final void playStack(final SpellAbility sa) { public static final void playStack(final SpellAbility sa) {
sa.setActivatingPlayer(AllZone.getComputerPlayer());
if (ComputerUtil.canPayCost(sa)) { if (ComputerUtil.canPayCost(sa)) {
final Card source = sa.getSourceCard(); final Card source = sa.getSourceCard();
if (sa.isSpell() && !source.isCopiedSpell()) { if (sa.isSpell() && !source.isCopiedSpell()) {
sa.setSourceCard(Singletons.getModel().getGameAction().moveToStack(source)); sa.setSourceCard(Singletons.getModel().getGameAction().moveToStack(source));
} }
final Cost cost = sa.getPayCosts();
sa.setActivatingPlayer(AllZone.getComputerPlayer()); if (cost == null) {
ComputerUtil.payManaCost(sa);
ComputerUtil.payManaCost(sa); AllZone.getStack().add(sa);
} else {
AllZone.getStack().add(sa); final CostPayment pay = new CostPayment(cost, sa);
if (pay.payComputerCosts()) {
AllZone.getStack().add(sa);
}
}
} }
} }