Problem with unless costs
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
2 posts
• Page 1 of 1
Problem with unless costs
by Sloth » 08 Jun 2011, 14:56
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:
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).
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);
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).
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Problem with unless costs
by Sloth » 15 Jun 2011, 16:04
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.
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.
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 8 guests