Page 1 of 1

Stack - the problem zone

PostPosted: 11 Jun 2009, 18:32
by mtgrares
Hi, I just wanted to get everyone's opinion about the stack. Technically only spells and abilities go on the stack and it is the only zone that doesn't hold cards. Currently MTG Forge just treats it like a special zone. In version 2 I'm planning on letting the stack hold Card objects. This won't affect how the game plays and it will be transparent to the user. By allowing the stack to hold Card objects, I can use one method moveCard(Card, Zone to, Zone from) for all card movement.

Currently MTG Forge only allows SpellAbility objects to be put on the stack, but every SpellAbility has a reference to the Card object, Elvish Piper activated ability holds a reference back to the card Elvish Piper, SpellAbility -> Card. In version 2 I'm just going to reverse SpellAbility and Card, and put the Card on the stack that points to the SpellAbility that is being played, Card -> SpellAbility. You the player won't notice but I think it will make a few things much easier.

Re: Stack - the problem zone

PostPosted: 11 Jun 2009, 20:21
by Snacko
The stack can hold cards, but while they're on the stack they're called spells.
213.1 - Every nonland card is a spell while it's being played (see Rule 409, "Playing Spells and Activated Abilities.") and while it's on the stack. Once it's played, a card remains a spell until it resolves, is countered, or otherwise leaves the stack. For more information, see Rule 401, "Spells on the Stack." CompRules 2003/07/01
217.6a - When a spell is played, the physical card is put on the stack. When an ability is played, it goes on top of the stack without any card associated with it (See Rule 409.1a). CompRules 2007/10/01
So it would be the direction to make the software more rules compliant. You need to however watch out for pitfalls, because the stack isn't an ordinary zone as it can hold activated and triggered abilities as well.

Re: Stack - the problem zone

PostPosted: 12 Jun 2009, 01:32
by frwololo
mtgrares wrote:it is the only zone that doesn't hold cards.
I don't know where you read it couldn't hold cards. So, as Snacko said.

Re: Stack - the problem zone

PostPosted: 12 Jun 2009, 18:12
by mtgrares
I just meant that the stack doesn't hold cards (or Card objects) since it technically only holds spells or abilities. Currently MTG Forge treats the stack separately and it only holds SpellAbility objects. In version 2 I was thinking about adding Card objects to the stack so the stack just holds cards like any other zone. The player wouldn't notice any difference but it might make some of the programming more general and better, I hate dealing with special cases,.

Re: Stack - the problem zone

PostPosted: 14 Jun 2009, 12:03
by frwololo
mtgrares wrote:I just meant that the stack doesn't hold cards (or Card objects) since it technically only holds spells or abilities.
Again, just read what Snacko said. "Spell" is the name given to the cards when it's on the stack, but it's still the same object. rule 217.6 : "the physical card is put on the stack"

Re: Stack - the problem zone

PostPosted: 17 Jun 2009, 05:15
by staggerwingjtstw
I think a good visual example is in order. U is going to be a card. So my hand looks like this:

UUUUUU

And the stack looks like this:

Then I play a spell, so my hand looks like this:

UUUUU

And the stack looks like this:

U

If my opponent uses Voidmage Prodigy's ability, then I Voidslime that, the stack looks like this with a card and an ability and a card:

UAU