It is currently 22 Jun 2018, 09:00
   
Text Size

Playing a Land/Spell/Ability, Timing

General Discussion of the Intricacies

Moderator: CCGHQ Admins

Playing a Land/Spell/Ability, Timing

Postby silly freak » 01 Apr 2010, 07:36

Hi all!

I'm currently on my first user action, but I can't really catch its essence. According to the rules, "To play a land, a player puts that land onto the battlefield from the zone it was in", so I guess that's exactly what to do. I worry more about the "when" (not specific to lands, btw): If I hardcode the "any time you could play a sorcery" into the land play, I can't account for effects that change that time.

So I guess the question has finally evolved into "how to store rules-changing effects?"
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 597
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 90 times
Been thanked: 25 times

Re: Playing a Land/Spell/Ability, Timing

Postby MageKing17 » 02 Apr 2010, 21:16

silly freak wrote:If I hardcode the "any time you could play a sorcery" into the land play, I can't account for effects that change that time.
If something says "Sorcery's can't be cast", it doesn't actually prevent you from playing lands, even though you couldn't actually play a Sorcery. You really just need to code the land-playing special action to work on your main phase while the stack is empty.
User avatar
MageKing17
Programmer
 
Posts: 473
Joined: 12 Jun 2008, 20:40
Has thanked: 5 times
Been thanked: 9 times

Re: Playing a Land/Spell/Ability, Timing

Postby silly freak » 02 Apr 2010, 22:35

"any time you could play a sorcery" was really just a metaphor for exactly that. there's probably nothing like that for lands, but plenty for spells, say Teferi, Mage of Zhalfir. If the time when playing a spell is legal is coded into the action, I can't modify that time.
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 597
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 90 times
Been thanked: 25 times

Re: Playing a Land/Spell/Ability, Timing

Postby MageKing17 » 03 Apr 2010, 00:55

silly freak wrote:"any time you could play a sorcery" was really just a metaphor for exactly that. there's probably nothing like that for lands, but plenty for spells, say Teferi, Mage of Zhalfir. If the time when playing a spell is legal is coded into the action, I can't modify that time.
Teferi may as well read "Opponent's can't cast spells unless the stack is empty and it's their turn", because that's what effect it has. Even if someone were to play Vedalken Orrery, it doesn't change when they "could play a sorcery" for the purposes of Teferi's ability.
User avatar
MageKing17
Programmer
 
Posts: 473
Joined: 12 Jun 2008, 20:40
Has thanked: 5 times
Been thanked: 9 times

Re: Playing a Land/Spell/Ability, Timing

Postby silly freak » 03 Apr 2010, 08:21

I'm not talking about the definition of "any time you could play a sorcery", but how abilities affect the time you can play spells in general. if my playing action does a check like

Code: Select all
if(instant || ability) {
  check for priority
} else {
  check for priority, your turn, main phase, stack empty
}
then this doesn't account for teferi. so once again: how can I store such effects to be more flexible?

such effects are rules-changing effects, and all affect the rules in different ways. Giving the game a list of effects for when lands can be played, then a list of effects for when spells can be played... you see, this doesn't sound like fun...
___

where's the "trust me, that will work!" switch for the compiler?
Laterna Magica - blog, forum, project, 2010/09/06 release!
silly freak
DEVELOPER
 
Posts: 597
Joined: 26 Mar 2009, 07:18
Location: Vienna, Austria
Has thanked: 90 times
Been thanked: 25 times

Re: Playing a Land/Spell/Ability, Timing

Postby Marek14 » 03 Apr 2010, 09:53

The base two timings are instant and sorcery timing. There are other restrictions (cast this only during combat etc.), but those don't figure here and are added later.

In addition, there's the "immediate playing" during resolution of spell or ability, like cascade, for example. This ignores timing rules completely, with one single exception - not even this allows you to play land outside of your turn.

So, the complete tree says that a spell can be played as an instant if:

1. It's a spell with the type Instant.
2. It has the ability "flash".
3. There is an effect which allows you to cast the spell as though it had flash. These are:
Aluren
Armor of Thorns/Grave Servitude/Lightning Reflexes/Mystic Veil/Necromancy/Parapet/Relic Ward/Soar/Spider Climb/Ward of Lights
Qasali Ambusher
Quick Sliver
Quicken
Rootwater Shaman
Scout's Warning
Tawnos (Vanguard)
Vedalken Orrery
Vernal Equinox
Winding Canyons

For activated abilities, default is instant timing, except for mana abilities, of course (which can have "instant" limitation, like Lion's Eye Diamond). Any other limitations are added on top of that and checked afterwards.

In case of Teferi, he doesn't really override the basic timing. He adds flash to your creature cards (that is what overrides their timing), but he doesn't actually change timing of opponent's spells - he simply adds an additional condition to them, which is not too different from what, say, Rule of Law does.
Marek14
Tester
 
Posts: 2622
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 249 times


Return to Magic Rules Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest


Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 10 minutes)
Most users ever online was 279 on 11 Jul 2013, 22:03

Users browsing this forum: No registered users and 1 guest

Login Form