Page 1 of 1

Problem with unless costs

PostPosted: 08 Jun 2011, 14:56
by Sloth
I just noticed that the unless cost has a problem:
When the human has to pay the cost (it doesn't matter who is the controller) for a spell (abilities work fine), the spell on the stack vanishes and won't resolve no matter if the cost is paid.
The problem lies here:
Code: Select all
GameActionUtil.payManaDuringAbilityResolve(source + "\r\n", ability.getManaCost(), Command.Blank, unpaidCommand);
Without this input there is no problem.

I'm pretty sure the problem is related to the "when you cast" triggers killing the original spell on the stack (Ulamog, the Infinite Gyre), which is also only a problem for the human player if there is an input required (Emrakul, the Aeons Torn works fine and both work for the AI).

Re: Problem with unless costs

PostPosted: 15 Jun 2011, 16:04
by Sloth
As Sol suggested I split the resolve function in MagicStack into more parts to fix this issue.

1. resolve is now pretty small.

2. finishResolving will take care of everything after the sa resolved (af abilities will call finishResolving themselves when they are finished).

3. removeCardFromStack is a side product to streamline the different things that may happen with a card on the stack (Buyback, flashback, fizzling).

Please post if you see something weird.