It is currently 26 Apr 2024, 10:20
   
Text Size

Dragon Presence Cards

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Dragon Presence Cards

Postby friarsol » 04 May 2015, 03:51

Ok, so I was playing around with the Dragon Presence cards tonight to see if I could make any progress. I got Draconic Roar working with this script (and some code changes related to my Undergrowth change from earlier)

Draconic Roar | Open
Name:Draconic Roar
ManaCost:1 R
Types:Instant
Text:As an additional cost to cast Draconic Roar, you may reveal a Dragon card from your hand.\n
K:Kicker Reveal<1/Dragon> : Generic
A:SP$ DealDamage | Cost$ 1 R | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumDmg$ 3 | SubAbility$ DBDamageController | SpellDescription$ CARDNAME deals 3 damage to target creature. If you revealed a Dragon card or controlled a Dragon as you cast CARDNAME, CARDNAME deals 3 damage to that creature's controller. | StackDescription$ SpellDescription
SVar:DBDamageController:DB$ DealDamage | Defined$ TargetedController | NumDmg$ 3 | ConditionDragonPresence$ True | StackDescription$ None
T:Mode$ SpellCast | ValidCard$ Card.Self | Execute$ StoreDragons | Static$ True
SVar:StoreDragons:DB$ StoreSVar | SVar$ DragonPresence | Type$ Number | Expression$ 1 | ConditionPresent$ Dragon.YouCtrl | SubAbility$ StoreNoDragons
SVar:StoreNoDragons:DB$ StoreSVar | SVar$ DragonPresence | Type$ Number | Expression$ 0 | ConditionPresent$ Dragon.YouCtrl | ConditionCompare$ EQ0
SVar:Picture:http://www.wizards.com/global/images/magic/general/draconic_roar.jpg
Oracle:As an additional cost to cast Draconic Roar, you may reveal a Dragon card from your hand.\nDraconic Roar deals 3 damage to target creature. If you revealed a Dragon card or controlled a Dragon as you cast Draconic Roar, Draconic Roar deals 3 damage to that creature's controller.


I'm not really sure if this is good enough to make it into Forge. It definitely does not pass the Clone test. (For the permanent based Dragon Presence cards, since the Clone wouldn't have the attached SVar Storing when the spell is cast.) I'm not sure if it passes the Fork test. I'll try that out when I have some time, hopefully tomorrow.

The best case here is being able to look up game state from when the casting happens, and check Valid$ Dragon.YouCtrl at this exact time. The OptionalCost should be ok with the work I was doing for Undergrowth, although it might need some ironing out in a few cases...

Anyone have any ideas on how we can lookup game state manner in this way? Any comments? If the consensus is that this doesn't hold up, I'll probably throw the scripts in the Unofficial Script Thread, for people who want to be able to play with decks that rely on these cards...
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Dragon Presence Cards

Postby Agetian » 10 May 2015, 04:36

My $0.02: I think that we already had (and currently have) some cards in Forge that we know do not work 100% rule-correct in certain corner cases but that are there nonetheless. For instance, Drain Life and Soul Burn both do not pass the mana cost reduction tests when mana cost is reduced by anything more than 1 (for Drain Life) and 2 (for Soul Burn). There are probably some other notable cases too but I can't remember what they might be and if they're still topical. That being said, we have to consider if Dragon Presence rule-inconsistent behavior is considerably worse than that or not - how often will the players encounter these inconsistencies compared to e.g. the one I named above? If they're about on par, we can probably release them with a line or two specified in "Known Issues" until we figure out how to make them work correctly. If the wrong behavior is considerably more noticeable than that (as in "there are popular strategies based on those particular plays that people will always or nearly always want to go for and will notice every time that their strategy fails because the related rules are not implemented correctly"), I'd vote against it.

That being said, if we decide that these cases are more serious and we decide not to make these cards official yet, it's still worth releasing them in an Unofficial Scripts thread such that players can read what's wrong with these cards at the moment and willingly update their games to use those scripts *if* they consider that this type of inconsistency is OK with them.

By the way, have you released the scripts anywhere already? I was trying to find the Unofficial Scripts thread but couldn't... I was away for a while, so I don't know all the new things that you guys have added to Forge and to the boards just yet :)

- Agetian
Agetian
Programmer
 
Posts: 3472
Joined: 14 Mar 2011, 05:58
Has thanked: 677 times
Been thanked: 561 times

Re: Dragon Presence Cards

Postby friarsol » 10 May 2015, 18:13

Agetian wrote:By the way, have you released the scripts anywhere already? I was trying to find the Unofficial Scripts thread but couldn't... I was away for a while, so I don't know all the new things that you guys have added to Forge and to the boards just yet :)
No, haven't had time to resolve it. Undergrowth was having a weird display issue that didn't affect functionality, that I wanted to get fixed before I started adding new stuff. We'll see if I have any time this week to iron out more specifics.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Dragon Presence Cards

Postby Agetian » 10 May 2015, 18:22

Oh, OK, sounds good! Good luck! :)

- Agetian
Agetian
Programmer
 
Posts: 3472
Joined: 14 Mar 2011, 05:58
Has thanked: 677 times
Been thanked: 561 times

Re: Dragon Presence Cards

Postby friarsol » 12 May 2015, 03:47

Ok, I believe Draconic Roar above and Foul-Tongue Invocation should both generally function with my latest commit. Still haven't tested the different corner cases (Fork/Clone/etc). The SpellCast static trigger probably needs to be moved into the codebase to help pass some of the corner cases.

Foul Tongue Invocation | Open
Name:Foul-Tongue Invocation
ManaCost:2 B
Types:Instant
Text:As an additional cost to cast Foul-Tongue Invocation, you may reveal a Dragon card from your hand.\n
K:Kicker Reveal<1/Dragon> : Generic
A:SP$ Sacrifice | Cost$ 2 B | ValidTgts$ Player | SacValid$ Creature | SacMessage$ Creature | SubAbility$ DBGainLife | SpellDescription$ Target player sacrifices a creature. If you revealed a Dragon card or controlled a Dragon as you cast CARDNAME, you gain 4 life. | StackDescription$ SpellDescription
SVar:DBGainLife:DB$ GainLife | Defined$ You | LifeAmount$ 3 | ConditionDragonPresence$ True
T:Mode$ SpellCast | ValidCard$ Card.Self | Execute$ StoreDragons | Static$ True
SVar:StoreDragons:DB$ StoreSVar | SVar$ DragonPresence | Type$ Number | Expression$ 1 | ConditionPresent$ Dragon.YouCtrl | SubAbility$ StoreNoDragons
SVar:StoreNoDragons:DB$ StoreSVar | SVar$ DragonPresence | Type$ Number | Expression$ 0 | ConditionPresent$ Dragon.YouCtrl | ConditionCompare$ EQ0
SVar:Picture:http://www.wizards.com/global/images/magic/general/foul_tongue_invocation.jpg
Oracle:As an additional cost to cast Foul-Tongue Invocation, you may reveal a Dragon card from your hand.\nTarget player sacrifices a creature. If you revealed a Dragon card or controlled a Dragon as you cast Foul-Tongue Invocation, you gain 4 life.


If someone wants to try to script the other 4 feel free to post them up in this thread. Not sure about Dragonlord's Prerogative since it's actually a static based on Dragon Presence.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Dragon Presence Cards

Postby Agetian » 12 May 2015, 05:49

Thanks for your efforts, Friarsol! Even though my next few days are going to be very busy, I'll try to find some time to carry out some tests. If you have a minute, can you please outline what exactly should be tested? (e.g. in the cases of Clone and Fork, what is the expected behavior and what should I look out for?)

- Agetian
Agetian
Programmer
 
Posts: 3472
Joined: 14 Mar 2011, 05:58
Has thanked: 677 times
Been thanked: 561 times

Re: Dragon Presence Cards

Postby Marek14 » 12 May 2015, 07:36

In case of Clone:

Clone of Scaleguard Sentinels can't pay the alternate cost (of course), but if you controlled a Dragon as you cast it, the condition is satisfied and Clone should get a +1/+1 counter. This should be also tested with Infinite Reflection.
This is similar to interaction of Clone-type cards with sunburst.

The case of Fork is simpler: as a copy of spell like Draconic Roar created by Fork was not cast, the condition can be never satisfied. This is a bit different from cards that check whether an additional cost was paid (this data is transferred to the copies), but Dragon Presence cards specifically mention that you have to reveal a Dragon card or control a Dragon as you cast them. A copy of Dragonlord's Prerogative is not uncounterable.
Note that this only holds for copies of spells -- copies of CARDS, like from Isochron Scepter, are still cast and so Dragon Presence works normally for them.

Two more corner cases that should be tested are Commandeer/Gather Specimens/Perplexing Chimera and Artificial Evolution.

Commandeer and friends: if the spell resolves under a control of a different player than the one that cast it, then the "as you cast" condition can't be satisfied since YOU didn't cast it and Dragon Presence is off. Similar when Scaleguard Sentinels enters the battlefield under someone else's control due to Gather Specimens.
I'm actually not 100% sure whether this interaction is implemented for things like Coal Stoker... never tried it.
Dragonlord's Prerogative has its Dragon Presence off when under control of a different player than the one who cast it.

Artificial Evolution: This one is a doozy. Artificial Evolution can modify a Dragon Presence card while it's on stack. This is too late to affect the alternate cost (that will always be revealing a Dragon card from hand), but it can modify the creature type that the spell is looking for. When the spell resolves, if the new creature type was present on the battlefield when the spell was cast, or if a card was revealed and it had this type as well as Dragon (for example if you reveal a changeling), then Dragon Presence (or Elf Presence or whatever) is on. This can be used as a fringe boost to your spell, or, more likely, to mess up the opponent's spell.
In case of Dragonlord's Prerogative, resolving Artificial Evolution on it can change it from counterable to uncounterable or vice versa.
Marek14
Tester
 
Posts: 2761
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 297 times

Re: Dragon Presence Cards

Postby Agetian » 12 May 2015, 18:54

For now, I tested Fork/Draconic Roar and it copies the card with the Dragon Presence condition (e.g. if I fork a Draconic Roar that is targeting Aboroth and to which I revealed a dragon, both the original and the copy deal 3 damage to the player). I couldn't test Clone because Scaleguard Sentinels is not scripted, and actually no creature with Dragon Presence is scripted yet so I'm not sure how to test Clone properly...

- Agetian
Agetian
Programmer
 
Posts: 3472
Joined: 14 Mar 2011, 05:58
Has thanked: 677 times
Been thanked: 561 times

Re: Dragon Presence Cards

Postby friarsol » 12 May 2015, 19:07

Agetian wrote:For now, I tested Fork/Draconic Roar and it copies the card with the Dragon Presence condition (e.g. if I fork a Draconic Roar that is targeting Aboroth and to which I revealed a dragon, both the original and the copy deal 3 damage to the player). I couldn't test Clone because Scaleguard Sentinels is not scripted, and actually no creature with Dragon Presence is scripted yet so I'm not sure how to test Clone properly...

- Agetian
2/25/2015 - If one of these spells is copied, the controller of the copy will get the “Dragon bonus” only if a Dragon card was revealed as an additional cost. The copy wasn’t cast, so whether you controlled a Dragon won’t matter.

Did you test it when you don't reveal a dragon, but have one in play?
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Dragon Presence Cards

Postby Agetian » 12 May 2015, 19:13

Just tested it - in that case both spells (the original one and the copied one) also act as if a dragon was revealed [even if you do not reveal a dragon from your hand].

- Agetian
Agetian
Programmer
 
Posts: 3472
Joined: 14 Mar 2011, 05:58
Has thanked: 677 times
Been thanked: 561 times

Re: Dragon Presence Cards

Postby friarsol » 12 May 2015, 19:23

Agetian wrote:Just tested it - in that case both spells (the original one and the copied one) also act as if a dragon was revealed [even if you do not reveal a dragon from your hand].
Hmm ok thanks. I guess Fork is copying over the SVar that I'm using to record the presence aspect of things. But copying the cost is fine, and should be how it works (which is different than what Marek suggests below)
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Dragon Presence Cards

Postby friarsol » 13 May 2015, 01:48

Ok, here's Orator of Ojutai, which is a bit more complicated, if I have the time, I'm going to move all of the extra maintenance coding for these into the actual engine.

Orator | Open
Name:Orator of Ojutai
ManaCost:1 W
Types:Creature Bird Monk
PT:0/4
Text:As an additional cost to cast Orator of Ojutai, you may reveal a Dragon card from your hand.
K:Kicker Reveal<1/Dragon> : Generic
K:Defender
K:Flying
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self+pseudokicked+wasCast | Execute$ TrigKicker | TriggerDescription$ When CARDNAME enters the battlefield, if you revealed a Dragon card or controlled a Dragon as you cast CARDNAME, draw a card.
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self+notpseudokicked+wasCast | CheckSVar$ DragonPresence | SVarCompare$ EQ1 | Execute$ TrigKicker | Secondary$ True | TriggerDescription$ When CARDNAME enters the battlefield, if you revealed a Dragon card or controlled a Dragon as you cast CARDNAME, draw a card.
SVar:TrigKicker:DB$ Draw | Defined$ You | NumCards$ 1
T:Mode$ SpellCast | ValidCard$ Card.Self | Execute$ StoreDragons | Static$ True
SVar:DragonPresence:Number$0
SVar:StoreDragons:DB$ StoreSVar | SVar$ DragonPresence | Type$ Number | Expression$ 1 | ConditionPresent$ Dragon.YouCtrl | SubAbility$ StoreNoDragons
SVar:StoreNoDragons:DB$ StoreSVar | SVar$ DragonPresence | Type$ Number | Expression$ 0 | ConditionPresent$ Dragon.YouCtrl | ConditionCompare$ EQ0
SVar:Picture:http://www.wizards.com/global/images/magic/general/orator_of_ojutai.jpg
Oracle:As an additional cost to cast Orator of Ojutai, you may reveal a Dragon card from your hand.\nDefender, flying\nWhen Orator of Ojutai enters the battlefield, if you revealed a Dragon card or controlled a Dragon as you cast Orator of Ojutai, draw a card.


So I did some testing with this:

It works properly in all 3 of it's typical modes (normal, optional cost, dragon present). It clears it's knowledge of dragon presence when Flickered. Or resurrected.

When Cloning an Orator that was cast with Dragon presence, the Clone doesn't draw a card. (Good)
When Cloning an Orator that was cast with pseudokicker, the Clone doesn't draw a card. (Good)
When Cloning an Orator, if there is a Dragon presence, the Clone doesn't draw a card. (Bad)
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Dragon Presence Cards

Postby Marek14 » 13 May 2015, 06:05

friarsol wrote:2/25/2015 - If one of these spells is copied, the controller of the copy will get the “Dragon bonus” only if a Dragon card was revealed as an additional cost. The copy wasn’t cast, so whether you controlled a Dragon won’t matter.
I see, so the first part IS treated as paying of additional cost and can be copied... that thing is just worded awkwardly...
Marek14
Tester
 
Posts: 2761
Joined: 07 Jun 2008, 07:54
Has thanked: 0 time
Been thanked: 297 times

Re: Dragon Presence Cards

Postby Agetian » 13 May 2015, 15:58

I think that so far it works in most cases but fails in some, personally I think it may as well pass as a part of Forge with a known issues clause. At any rate, how many cards like that are there? Is anybody willing to join in and script more of them? I'll run some additional tests as time permits in the upcoming days.

- Agetian
Agetian
Programmer
 
Posts: 3472
Joined: 14 Mar 2011, 05:58
Has thanked: 677 times
Been thanked: 561 times

Re: Dragon Presence Cards

Postby friarsol » 13 May 2015, 16:07

Agetian wrote:I think that so far it works in most cases but fails in some, personally I think it may as well pass as a part of Forge with a known issues clause. At any rate, how many cards like that are there? Is anybody willing to join in and script more of them? I'll run some additional tests as time permits in the upcoming days.
There's 3 left:

http://magiccards.info/query?q=e%3Adtk+ ... rd&s=cname

Dragonlord's Prerogative
Scaleguard Sentinels
Silumgar's Scorn
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Next

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 101 guests

cron

Who is online

In total there are 101 users online :: 0 registered, 0 hidden and 101 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 101 guests

Login Form