It is currently 16 Apr 2024, 21:56
   
Text Size

Stack - the problem zone

General Discussion of the Intricacies

Moderator: CCGHQ Admins

Stack - the problem zone

Postby 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.
mtgrares
DEVELOPER
 
Posts: 1352
Joined: 08 Sep 2008, 22:10
Has thanked: 3 times
Been thanked: 12 times

Re: Stack - the problem zone

Postby 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
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.
Snacko
DEVELOPER
 
Posts: 826
Joined: 29 May 2008, 19:35
Has thanked: 4 times
Been thanked: 74 times

Re: Stack - the problem zone

Postby frwololo » 12 Jun 2009, 01:32

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.
frwololo
DEVELOPER
 
Posts: 265
Joined: 21 Jun 2008, 04:33
Has thanked: 0 time
Been thanked: 3 times

Re: Stack - the problem zone

Postby 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

Postby frwololo » 14 Jun 2009, 12:03

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"
frwololo
DEVELOPER
 
Posts: 265
Joined: 21 Jun 2008, 04:33
Has thanked: 0 time
Been thanked: 3 times

Re: Stack - the problem zone

Postby 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
I like being bad... it makes me happy...
User avatar
staggerwingjtstw
 
Posts: 181
Joined: 31 May 2008, 18:03
Has thanked: 3 times
Been thanked: 1 time


Return to Magic Rules Engine Programming

Who is online

Users browsing this forum: No registered users and 11 guests


Who is online

In total there are 11 users online :: 0 registered, 0 hidden and 11 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 11 guests

Login Form