Card Development Questions
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Card Development Questions
by Marek14 » 10 Aug 2013, 16:12
Seeing the cards with multizone targeting in the remaining cards file: are things like Chaoslace implemented correctly? (i.e. able to change target from spell to permanent or vice versa)?
Re: Card Development Questions
by friarsol » 11 Aug 2013, 01:22
I think they should be alright. I didn't test redirection at the time (because it didn't exist), but I don't see why they should suffer the same way Clockspinning does. A card will only be in the Stack zone if it's a Spell, and will only be in the Battlefield zone if it's a Permanent. But by allowing for targets to either zone, it should be able to change targets from one to the other without a problem.Marek14 wrote:Seeing the cards with multizone targeting in the remaining cards file: are things like Chaoslace implemented correctly? (i.e. able to change target from spell to permanent or vice versa)?
Also, I believe those cards were scripted recently.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Marek14 » 12 Aug 2013, 05:35
Noted we're missing Nix, so I have to ask: do cards like Clone work correctly with sunburst? Both this interaction and Nix requires to be always aware what types of mana were used to cast something (as Nix can be basically reworded into "if no white/blue/black/red/green/colorless mana was spent to cast the spell"...
Re: Card Development Questions
by moomarc » 12 Aug 2013, 05:57
I actually looked at Nix the other day and the problem is that sunburst doesn't track colorless mana. I looked at another potential way of tracking it but ran out of time before I could get it working.Marek14 wrote:Noted we're missing Nix, so I have to ask: do cards like Clone work correctly with sunburst? Both this interaction and Nix requires to be always aware what types of mana were used to cast something (as Nix can be basically reworded into "if no white/blue/black/red/green/colorless mana was spent to cast the spell"...
-Marc
-
moomarc - Pixel Commander
- Posts: 2091
- Joined: 04 Jun 2010, 15:22
- Location: Johannesburg, South Africa
- Has thanked: 371 times
- Been thanked: 372 times
Re: Card Development Questions
by Sloth » 12 Aug 2013, 06:14
The spoiled legends of the Commander 2013 set also need to know how much mana was paid to cast them.Marek14 wrote:Noted we're missing Nix, so I have to ask: do cards like Clone work correctly with sunburst? Both this interaction and Nix requires to be always aware what types of mana were used to cast something (as Nix can be basically reworded into "if no white/blue/black/red/green/colorless mana was spent to cast the spell"...
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Card Development Questions
by Marek14 » 12 Aug 2013, 09:05
True...Sloth wrote:The spoiled legends of the Commander 2013 set also need to know how much mana was paid to cast them.Marek14 wrote:Noted we're missing Nix, so I have to ask: do cards like Clone work correctly with sunburst? Both this interaction and Nix requires to be always aware what types of mana were used to cast something (as Nix can be basically reworded into "if no white/blue/black/red/green/colorless mana was spent to cast the spell"...
Re: Card Development Questions
by Marek14 » 14 Aug 2013, 19:41
As for Equinox: the Google file is not entirely correct. Equinox doesn't have a targeting restriction; it can target any spell, it merely has a condition on when the spell is countered. Of course, this condition is pretty hard. The best way to implement it would probably be to:
1. Save a snapshot of the game
2. Resolve the targeted spell immediately regardless on what else is on stack. Find out if at least one land controlled by the controller of the Equinox's ability is destroyed, with all effects counted: Pyramids, regeneration, indestructibility or even Totem armor means the land wouldn't be destroyed (of course, regeneration can be prevented).
3. Restore the snapshot and counter the spell if the check ends up "true". It will be probably more economical if uncounterability of target spell is checked at the very beginning to avoid the complicated process when not necessary.
1. Save a snapshot of the game
2. Resolve the targeted spell immediately regardless on what else is on stack. Find out if at least one land controlled by the controller of the Equinox's ability is destroyed, with all effects counted: Pyramids, regeneration, indestructibility or even Totem armor means the land wouldn't be destroyed (of course, regeneration can be prevented).
3. Restore the snapshot and counter the spell if the check ends up "true". It will be probably more economical if uncounterability of target spell is checked at the very beginning to avoid the complicated process when not necessary.
Re: Card Development Questions
by friarsol » 14 Aug 2013, 20:06
I wouldn't take those descriptions too much to heart. They are just very brief descriptions about what needs to happen. Equinox is stupidly complex, one of my college buddies and I have a discussion about coding it basically everytime I see him if we end up talking Magic. I wouldn't be surprised if it ends up in the last 20 to get scripted.
And of course, your description doesn't even cover "10/4/2004: Equinox will not counter a spell that has a random chance of destroying a land." or "10/1/2008: Will not counter a spell which would destroy a land only if a choice is made." scenarios.
Since I don't particularly see snapshots happening anytime soon, I always pictured it as something like this:
1. Check if Targeted Spell has a Destroy or DestroyAll ability effect somewhere in it's Ability Chain.
2. Check if a land you control is a legal target of or Defined to be destroyed by any of the Destroy effects, and check to make sure this destruction is not behind any random chance or other choices.
3. Check if all of those lands have active destruction prevention via (pseudo)regeneration or indestructible.
But once again, very very complex.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Marek14 » 14 Aug 2013, 21:26
Yes, some cards are like thatfriarsol wrote:I wouldn't take those descriptions too much to heart. They are just very brief descriptions about what needs to happen. Equinox is stupidly complex, one of my college buddies and I have a discussion about coding it basically everytime I see him if we end up talking Magic. I wouldn't be surprised if it ends up in the last 20 to get scripted.
And of course, your description doesn't even cover "10/4/2004: Equinox will not counter a spell that has a random chance of destroying a land." or "10/1/2008: Will not counter a spell which would destroy a land only if a choice is made." scenarios.
Since I don't particularly see snapshots happening anytime soon, I always pictured it as something like this:
1. Check if Targeted Spell has a Destroy or DestroyAll ability effect somewhere in it's Ability Chain.
2. Check if a land you control is a legal target of or Defined to be destroyed by any of the Destroy effects, and check to make sure this destruction is not behind any random chance or other choices.
3. Check if all of those lands have active destruction prevention via (pseudo)regeneration or indestructible.
But once again, very very complex.


Re: Card Development Questions
by friarsol » 14 Aug 2013, 23:19
Hah, I'm not sure if that should matter. We would just need to check if there's a singular creature type check in the Targeting, and that type is the one that Wall of Shadows cares about (usually walls).Marek14 wrote:Yes, some cards are like thatAnd Wall of Shadows would ideally need a full list of cards that target creature types on the off-chance some smart guy Artificially Evolves it
Elvish Pathcutter
AB$ Pump | Cost$ 2 G | ValidTgts$ Creature.Elf | KW$ Forestwalk
Ali Baba
AB$ Tap | Cost$ R | ValidTgts$ Wall
Grassland Crusader
AB$ Pump | Cost$ T | NumAtt$ +2 | NumDef$ +2 | ValidTgts$ Creature.Elf,Creature.Soldier
The hardest part of that is allowing modal spells like Chaos Charm (I roughly count 6 of these right now), due to this note: 10/4/2004: Can be targeted by a modal spell that can target a non-Wall in one of its modes, even if it has a mode that targets only Walls. That spell can, in theory, target a non-Wall, so it is not a "spell that can target only walls".
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Marek14 » 15 Aug 2013, 06:38
Are you sure Grassland Crusader counts? It can normally target creatures of two different types, so unless it's Artificially Evolved to mention the same type twice... 

Re: Card Development Questions
by friarsol » 15 Aug 2013, 11:51
No it definitely doesn't count. I was showing examples of what we would be looking for.Marek14 wrote:Are you sure Grassland Crusader counts? It can normally target creatures of two different types, so unless it's Artificially Evolved to mention the same type twice...
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by Marek14 » 19 Aug 2013, 10:58
Spend as other mana: The easiest way would probably be to intercept mana costs before they are paid and replace them with different mana costs (so it only changes what you're asked to pay).
Effects are:
Celestial Dawn: You may spend white mana as though it were mana of any color. You may spend other mana only as though it were colorless mana.
False Dawn: Until end of turn, you may spend white mana as though it were mana of any color.
Mycosynth Lattice: Players may spend mana as though it were mana of any color.
North Star: For one spell this turn, you may spend mana as though it were mana of any color to pay that spell's mana cost.
Quicksilver Elemental: You may spend blue mana as though it were mana of any color to pay the activation costs of Quicksilver Elemental's abilities.
Sunglasses of Urza: You may spend white mana as though it were red mana.
First of all, there's the question of how these effects interact with each other. My best guess is that you can imagine a 6x6 (5 colors + colorless) table of rules: Can I pay mana X when the cost calls for mana Y?
Each of these effects would then modify the rules in timestamp order.
The standard table looks like this:
If we go by timestamp order, let's look at Celestial Dawn + Quicksilver Elemental situation:
Celestial Dawn first would look like this:
So: mana display. Once you have a valid table, mana display is simple.
1. Generic mana symbol stays generic -- none of these effects change the last column of the table.
2. For colored mana symbol, look its column in table - if there's only one entry, it will be displayed as that mana symbol, if there are multiple entries, it will be displayed as hybrid symbol (with more than 2 choices, potentially), and if all entries are true (which happens with Mycosynth Lattice), it will be displayed as generic mana symbol (and added to other generic symbols).
3. For hybrid mana symbol, look the two columns, otherwise it works identically to option 2.
4. For 2/C or Phyrexian symbols, look the colored column and add the 2 or P option to the resulting symbol.
For example, a hybrid mana {R/G} would become
under Celestial Dawn, {R/G/W} under False Darn, {U/R/G} under Quicksilver Elemental,
under Mycosynth Lattice and {R/G/W} under Sunglasses of Urza.
This way, every symbol of the cost to be paid will be converted to a symbol depicting mana you are actually allowed to pay for it. However, additional symbols would have to be introduced.
1. A symbol for colorless mana -- if you have Mycosynth Lattice and then Celestial Dawn enters the battlefield, it will wipe uses of colored mana, but not the enhanced use of colorless mana. So a
symbol would be payable by white or colorless mana and would have to be displayed as a hybrid cost {W/C}.
2. I suspect there might be a way, eventually, to make a symbol completely unpayable. This should be signified by {!} and a cost including such symbol couldn't be paid.
Effects are:
Celestial Dawn: You may spend white mana as though it were mana of any color. You may spend other mana only as though it were colorless mana.
False Dawn: Until end of turn, you may spend white mana as though it were mana of any color.
Mycosynth Lattice: Players may spend mana as though it were mana of any color.
North Star: For one spell this turn, you may spend mana as though it were mana of any color to pay that spell's mana cost.
Quicksilver Elemental: You may spend blue mana as though it were mana of any color to pay the activation costs of Quicksilver Elemental's abilities.
Sunglasses of Urza: You may spend white mana as though it were red mana.
First of all, there's the question of how these effects interact with each other. My best guess is that you can imagine a 6x6 (5 colors + colorless) table of rules: Can I pay mana X when the cost calls for mana Y?
Each of these effects would then modify the rules in timestamp order.
The standard table looks like this:
- Code: Select all
| W U B R G 1
-+------------
W| X O O O O X
U| O X O O O X
B| O O X O O X
R| O O O X O X
G| O O O O X X
1| O O O O O X
- Code: Select all
| W U B R G 1
-+------------
W| X X X X X X
U| O O O O O X
B| O O O O O X
R| O O O O O X
G| O O O O O X
1| O O O O O X
- Code: Select all
| W U B R G 1
-+------------
W| X X X X X X
U| O X O O O X
B| O O X O O X
R| O O O X O X
G| O O O O X X
1| O O O O O X
- Code: Select all
| W U B R G 1
-+------------
W| X X X X X X
U| X X X X X X
B| X X X X X X
R| X X X X X X
G| X X X X X X
1| X X X X X X
- Code: Select all
| W U B R G 1
-+------------
W| X O O O O X
U| X X X X X X
B| O O X O O X
R| O O O X O X
G| O O O O X X
1| O O O O O X
- Code: Select all
| W U B R G 1
-+------------
W| X O O X O X
U| O X O O O X
B| O O X O O X
R| O O O X O X
G| O O O O X X
1| O O O O O X
- Code: Select all
| W U B R G 1
-+------------
W| O O O O O X
U| O O O O O X
B| X X X X X X
R| O O O O O X
G| O O O O O X
1| O O O O O X
If we go by timestamp order, let's look at Celestial Dawn + Quicksilver Elemental situation:
Celestial Dawn first would look like this:
- Code: Select all
| W U B R G 1
-+------------
W| X X X X X X
U| X X X X X X
B| O O O O O X
R| O O O O O X
G| O O O O O X
1| O O O O O X
So: mana display. Once you have a valid table, mana display is simple.
1. Generic mana symbol stays generic -- none of these effects change the last column of the table.
2. For colored mana symbol, look its column in table - if there's only one entry, it will be displayed as that mana symbol, if there are multiple entries, it will be displayed as hybrid symbol (with more than 2 choices, potentially), and if all entries are true (which happens with Mycosynth Lattice), it will be displayed as generic mana symbol (and added to other generic symbols).
3. For hybrid mana symbol, look the two columns, otherwise it works identically to option 2.
4. For 2/C or Phyrexian symbols, look the colored column and add the 2 or P option to the resulting symbol.
For example, a hybrid mana {R/G} would become


This way, every symbol of the cost to be paid will be converted to a symbol depicting mana you are actually allowed to pay for it. However, additional symbols would have to be introduced.
1. A symbol for colorless mana -- if you have Mycosynth Lattice and then Celestial Dawn enters the battlefield, it will wipe uses of colored mana, but not the enhanced use of colorless mana. So a

2. I suspect there might be a way, eventually, to make a symbol completely unpayable. This should be signified by {!} and a cost including such symbol couldn't be paid.
Re: Card Development Questions
by timmermac » 19 Aug 2013, 12:46
Marek, does Celestial Dawn work like that on BotArena? I haven't tried playing that in ages.
"I just woke up, haven't had coffee, let alone a pee in 7 days, and I find out you stole my ass and made a ...mini-me! Carter, I should be irked currently, yes?" - Jack O'Neill
Re: Card Development Questions
by Marek14 » 19 Aug 2013, 13:18
I don't think we have thattimmermac wrote:Marek, does Celestial Dawn work like that on BotArena? I haven't tried playing that in ages.

Who is online
Users browsing this forum: No registered users and 48 guests