Stack - the problem zone
General Discussion of the Intricacies
Moderator: CCGHQ Admins
Stack - the problem zone
by mtgrares » 11 Jun 2009, 18:32
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.
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.
- mtgrares
- DEVELOPER
- Posts: 1352
- Joined: 08 Sep 2008, 22:10
- Has thanked: 3 times
- Been thanked: 12 times
Re: Stack - the problem zone
by Snacko » 11 Jun 2009, 20:21
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
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.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
Re: Stack - the problem zone
by frwololo » 12 Jun 2009, 01:32
I don't know where you read it couldn't hold cards. So, as Snacko said.mtgrares wrote:it is the only zone that doesn't hold cards.
Re: Stack - the problem zone
by mtgrares » 12 Jun 2009, 18:12
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,.
- mtgrares
- DEVELOPER
- Posts: 1352
- Joined: 08 Sep 2008, 22:10
- Has thanked: 3 times
- Been thanked: 12 times
Re: Stack - the problem zone
by frwololo » 14 Jun 2009, 12:03
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"mtgrares wrote:I just meant that the stack doesn't hold cards (or Card objects) since it technically only holds spells or abilities.
Re: Stack - the problem zone
by staggerwingjtstw » 17 Jun 2009, 05:15
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
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
I like being bad... it makes me happy...
-
staggerwingjtstw - Posts: 181
- Joined: 31 May 2008, 18:03
- Has thanked: 3 times
- Been thanked: 1 time
6 posts
• Page 1 of 1
Return to Magic Rules Engine Programming
Who is online
Users browsing this forum: No registered users and 4 guests