It is currently 29 Oct 2025, 07:05
   
Text Size

Problem with unless costs

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins

Problem with unless costs

Postby 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:
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).
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Problem with unless costs

Postby 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.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 8 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 8 users online :: 0 registered, 0 hidden and 8 guests (based on users active over the past 10 minutes)
Most users ever online was 9298 on 10 Oct 2025, 12:54

Users browsing this forum: No registered users and 8 guests

Login Form