It is currently 03 Jun 2025, 10:30
   
Text Size

Card Development Questions

Post MTG Forge Related Programming Questions Here

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

Re: Card Development Questions

Postby jeffwadsworth » 07 Oct 2011, 04:00

slapshot5 wrote:
jeffwadsworth wrote:
friarsol wrote:Yea that looks right. Not sure if you need the .YouCtrl or not.
It will have to wait until SVar:Y:Exiled$SumPower is done.
Did you try just Exiled$CardPower? I think it might sum the list for you.

-slapshot5
It does. Thanks.
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Card Development Questions

Postby jeffwadsworth » 07 Oct 2011, 22:35

Testing Urborg Panther

| Open
Name:Urborg Panther
ManaCost:2 B
Types:Creature Nightstalker Cat
Text:no text
PT:2/2
A:AB$ Destroy | Cost$ B Sac<1/CARDNAME> | ValidTgts$ Creature.blockingSource | TgtPrompt$ Select target creature blocking Urborg Panther | SpellDescription$ Destroy target creature blocking CARDNAME.
A:AB$ ChangeZone | Cost$ Sac<1/Creature.namedFeral Shadow> Sac<1/Creature.namedBreathstealer> Sac<1/CARDNAME> | Origin$ Library | Destination$ Battlefield | ChangeType$ Creature.namedSpirit of the Night | ChangeNum$ 1 | SpellDescription$ Search your library for a card named Spirit of the Night and put that card onto the battlefield. Then shuffle your library.
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/urborg_panther.jpg
End


Apparently, there is a timing issue with the first ability. Attack with Urborg Panther. Blocked by Eater of the Dead. Fire the ability to destroy it. Urborg Panther is sacrificed but the Eater of the Dead is not destroyed. Can anyone confirm?
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Card Development Questions

Postby jeffwadsworth » 08 Oct 2011, 04:06

This one is driving me bonkers. Skeletonize is evil.

| Open
Name:Skeletonize
ManaCost:4 R
Types:Instant
Text:no text
A:SP$ DealDamage | Cost$ 4 R | NumDmg$ 3 | ValidTgts$ Creature | TgtPrompt$ Select target creature | RememberTargets$ True | ForgetOtherTargets$ True | SubAbility$ DBEffect | SpellDescription$ CARDNAME deals 3 damage to target creature. When a creature dealt damage this way dies this turn, put a 1/1 black Skeleton creature token onto the battlefield with "B: Regenerate this creature."
SVar:DBEffect:DB$ Effect | Name$ Skeletonize Effect | Triggers$ TrigDies | SVars$ ABToken,ABRegen | RememberCard$ Remembered
SVar:TrigDies:Mode$ ChangesZone | ValidCard$ Remembered | Origin$ Battlefield | Destination$ Graveyard | Execute$ ABToken | TriggerDescription$ When a creature dealt damage this way dies this turn, put a 1/1 black Skeleton creature token onto the battlefield with "B: Regenerate this creature."
SVar:ABToken:AB$ Token | Cost$ 0 | TokenAmount$ 1 | TokenName$ Skeleton | TokenTypes$ Creature,Skeleton | TokenColors$ Black | TokenOwner$ You | TokenPower$ 1 | TokenToughness$ 1 | TokenAbilities$ ABRegen
SVar:ABRegen:AB$ Regenerate | Cost$ B | Defined$ Self
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/skeletonize.jpg
End


The effect fires and displays the remembered target of the spell. If the target creature dies, the effect does not produce the token. Does anyone see the problem?

Edit: I found the solution and had a beer.
Last edited by jeffwadsworth on 09 Oct 2011, 05:24, edited 1 time in total.
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Card Development Questions

Postby jeffwadsworth » 08 Oct 2011, 15:59

Looking at Snapcaster Mage. We can add the keyword "cumulative upkeep" and others, but not flashback. Is that keyword more difficult to implement?
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Card Development Questions

Postby jeffwadsworth » 08 Oct 2011, 17:39

Lion's Eye Diamond. We have a "sorceryspeed" spell restriction but no "instantspeed".
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Card Development Questions

Postby jeffwadsworth » 08 Oct 2011, 18:42

Testing Reborn Hero. I have removed the Threshold restriction to demonstrate a possible problem.

| Open
Name:Reborn Hero
ManaCost:2 W
Types:Creature Human Soldier
Text:no text
PT:2/2
K:Vigilance
S:Mode$ Continuous | Affected$ Card.Self | AddTrigger$ TriggerBounce | AddSVar$ TriggeredBounce | Description$ Threshold — As long as seven or more cards are in your graveyard, CARDNAME has "When Reborn Hero dies, you may pay W W. If you do, return Reborn Hero to the battlefield under your control."
SVar:TriggerBounce:Mode$ ChangesZone | Defined$ Card.Self | Origin$ Battlefield | Destination$ Graveyard | Execute$ TriggeredBounce | TriggerDescription$ Bounce me test.
SVar:TriggeredBounce:AB$ ChangeZone | Cost$ W W | ValidCard$ Card.Self | Origin$ Graveyard | Destination$ Battlefield
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/reborn_hero.jpg
End


When the Reborn Hero is brought back into play, it will have 2 instances of the static effect on it. The next time, 3, etc.
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Card Development Questions

Postby Sloth » 08 Oct 2011, 18:58

jeffwadsworth wrote:Testing Reborn Hero. I have removed the Threshold restriction to demonstrate a possible problem.

| Open
Name:Reborn Hero
ManaCost:2 W
Types:Creature Human Soldier
Text:no text
PT:2/2
K:Vigilance
S:Mode$ Continuous | Affected$ Card.Self | AddTrigger$ TriggerBounce | AddSVar$ TriggeredBounce | Description$ Threshold — As long as seven or more cards are in your graveyard, CARDNAME has "When Reborn Hero dies, you may pay W W. If you do, return Reborn Hero to the battlefield under your control."
SVar:TriggerBounce:Mode$ ChangesZone | Defined$ Card.Self | Origin$ Battlefield | Destination$ Graveyard | Execute$ TriggeredBounce | TriggerDescription$ Bounce me test.
SVar:TriggeredBounce:AB$ ChangeZone | Cost$ W W | ValidCard$ Card.Self | Origin$ Graveyard | Destination$ Battlefield
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/reborn_hero.jpg
End


When the Reborn Hero is brought back into play, it will have 2 instances of the static effect on it. The next time, 3, etc.
I will take a look at this.

jeffwadsworth wrote:Looking at Snapcaster Mage. We can add the keyword "cumulative upkeep" and others, but not flashback. Is that keyword more difficult to implement?
Flashback is converted into a spellability when a card is loaded (or just scripted as an alternate spell ability).
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Card Development Questions

Postby Sloth » 08 Oct 2011, 20:22

OK I give up on Reborn Hero. There are so many timing issues involved that I have no clue why the triggers actually work. I would not try to hack it in by just adding a trigger with Threshold requirement since it should not check threshold on resolution (intervening if clause would do this).
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Card Development Questions

Postby jeffwadsworth » 08 Oct 2011, 22:58

Here is a script for Apathy.

| Open
Name:Apathy
ManaCost:U
Types:Enchantment Aura
Text:no text
K:Enchant creature
A:SP$ Attach | Cost$ U | ValidTgts$ Creature | AILogic$ Curse
S:Mode$ Continuous | Affected$ Card.EnchantedBy | AddKeyword$ CARDNAME doesn't untap during your untap step. | AddTrigger$ TrigUpkeep | AddSVar$ TrigUntap | Description$ Enchanted creature doesn't untap during its controller's untap step.
SVar:TrigUpkeep:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigUntap | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of the upkeep of enchanted creature's controller, that player may discard a card at random. If he or she does, untap that creature.
SVar:TrigUntap:AB$ Untap | Cost$ Discard<1/Random> | Defined$ Self | OptionalDecider$ You | SpellDescription$ Untap enchanted creature
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/apathy.jpg
End


Now, I would expect "OptionalDecider" to query the enchanted controller to see if they wished to untap the enchanted creature. It doesn't. Perhaps it is related to the Cost$ code?
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Card Development Questions

Postby slapshot5 » 08 Oct 2011, 23:17

jeffwadsworth wrote:Here is a script for Apathy.

| Open
Name:Apathy
ManaCost:U
Types:Enchantment Aura
Text:no text
K:Enchant creature
A:SP$ Attach | Cost$ U | ValidTgts$ Creature | AILogic$ Curse
S:Mode$ Continuous | Affected$ Card.EnchantedBy | AddKeyword$ CARDNAME doesn't untap during your untap step. | AddTrigger$ TrigUpkeep | AddSVar$ TrigUntap | Description$ Enchanted creature doesn't untap during its controller's untap step.
SVar:TrigUpkeep:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigUntap | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of the upkeep of enchanted creature's controller, that player may discard a card at random. If he or she does, untap that creature.
SVar:TrigUntap:AB$ Untap | Cost$ Discard<1/Random> | Defined$ Self | OptionalDecider$ You | SpellDescription$ Untap enchanted creature
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/apathy.jpg
End


Now, I would expect "OptionalDecider" to query the enchanted controller to see if they wished to untap the enchanted creature. It doesn't. Perhaps it is related to the Cost$ code?
Doesn't OptionalDecider need to go in the Trigger and not the ability? Also, what if you use OptionalDecider$ EnchantedController instead of OptionalDecider$ You?
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: Card Development Questions

Postby jeffwadsworth » 08 Oct 2011, 23:28

slapshot5 wrote:
jeffwadsworth wrote:Here is a script for Apathy.

| Open
Name:Apathy
ManaCost:U
Types:Enchantment Aura
Text:no text
K:Enchant creature
A:SP$ Attach | Cost$ U | ValidTgts$ Creature | AILogic$ Curse
S:Mode$ Continuous | Affected$ Card.EnchantedBy | AddKeyword$ CARDNAME doesn't untap during your untap step. | AddTrigger$ TrigUpkeep | AddSVar$ TrigUntap | Description$ Enchanted creature doesn't untap during its controller's untap step.
SVar:TrigUpkeep:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigUntap | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of the upkeep of enchanted creature's controller, that player may discard a card at random. If he or she does, untap that creature.
SVar:TrigUntap:AB$ Untap | Cost$ Discard<1/Random> | Defined$ Self | OptionalDecider$ You | SpellDescription$ Untap enchanted creature
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/apathy.jpg
End


Now, I would expect "OptionalDecider" to query the enchanted controller to see if they wished to untap the enchanted creature. It doesn't. Perhaps it is related to the Cost$ code?
Doesn't OptionalDecider need to go in the Trigger and not the ability? Also, what if you use OptionalDecider$ EnchantedController instead of OptionalDecider$ You?
Of course OptionalDecider goes on the trigger...major brainfart on my part. Thanks. It stays as You.
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Card Development Questions

Postby jeffwadsworth » 09 Oct 2011, 20:19

I was testing Mana Chains. Using Breath of Dreams as an example ( I know this worked fine in the past ). Well, it produces an error.

| Open
Name:Mana Chains
ManaCost:U
Types:Enchantment Aura
Text:no text
K:Enchant creature
A:SP$ Attach | Cost$ U | ValidTgts$ Creature | AILogic$ Curse
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddKeyword$ Cumulative upkeep 1 | Description$ Enchanted creature has "Cumulative upkeep 1."
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/mana_chains.jpg
End


Error produced at the end of turn.

| Open
Detailed error trace:
java.lang.ArrayIndexOutOfBoundsException: 1
at forge.Upkeep.upkeep_UpkeepCost(Upkeep.java:354)
at forge.Upkeep.executeAt(Upkeep.java:83)
at forge.PhaseUtil.handleUpkeep(PhaseUtil.java:390)
at forge.Phase.handleBeginPhase(Phase.java:287)
at forge.gui.input.InputControl.updateInput(InputControl.java:155)
at forge.GuiInput.update(GuiInput.java:30)
at java.util.Observable.notifyObservers(Unknown Source)
at java.util.Observable.notifyObservers(Unknown Source)
at forge.MyObservable.updateObservers(MyObservable.java:17)
at forge.Phase.nextPhase(Phase.java:468)
at forge.Phase.nextPhase(Phase.java:471)
at forge.gui.input.Input_Cleanup.showMessage(Input_Cleanup.java:45)
at forge.gui.input.Input_Cleanup.selectCard(Input_Cleanup.java:55)
at forge.GuiInput.selectCard(GuiInput.java:83)
at forge.GuiDisplay4$19.mousePressed(GuiDisplay4.java:594)
at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Card Development Questions

Postby Sloth » 09 Oct 2011, 20:29

jeffwadsworth wrote:I was testing Mana Chains. Using Breath of Dreams as an example ( I know this worked fine in the past ). Well, it produces an error.

| Open
Name:Mana Chains
ManaCost:U
Types:Enchantment Aura
Text:no text
K:Enchant creature
A:SP$ Attach | Cost$ U | ValidTgts$ Creature | AILogic$ Curse
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddKeyword$ Cumulative upkeep 1 | Description$ Enchanted creature has "Cumulative upkeep 1."
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/mana_chains.jpg
End


Error produced at the end of turn.

| Open
Detailed error trace:
java.lang.ArrayIndexOutOfBoundsException: 1
at forge.Upkeep.upkeep_UpkeepCost(Upkeep.java:354)
at forge.Upkeep.executeAt(Upkeep.java:83)
at forge.PhaseUtil.handleUpkeep(PhaseUtil.java:390)
at forge.Phase.handleBeginPhase(Phase.java:287)
at forge.gui.input.InputControl.updateInput(InputControl.java:155)
at forge.GuiInput.update(GuiInput.java:30)
at java.util.Observable.notifyObservers(Unknown Source)
at java.util.Observable.notifyObservers(Unknown Source)
at forge.MyObservable.updateObservers(MyObservable.java:17)
at forge.Phase.nextPhase(Phase.java:468)
at forge.Phase.nextPhase(Phase.java:471)
at forge.gui.input.Input_Cleanup.showMessage(Input_Cleanup.java:45)
at forge.gui.input.Input_Cleanup.selectCard(Input_Cleanup.java:55)
at forge.GuiInput.selectCard(GuiInput.java:83)
at forge.GuiDisplay4$19.mousePressed(GuiDisplay4.java:594)
at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
It has to be "Cumulative upkeep:1".
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Card Development Questions

Postby jeffwadsworth » 09 Oct 2011, 22:35

Testing Master of Arms.

| Open
Remember that normally, tapped blockers still deal and receive damage in combat. Master of Arms prevents the damage that the targeted creature would deal, but the creature will still receive combat damage.


Pasted from this page: http://gatherer.wizards.com/Pages/Card/ ... rseid=4582

In the test, Master of Arms tapped a blocker, but still received damage from it. Blocker was a Gemhide Sliver.

Script for Master of Arms:

| Open
Name:Master of Arms
ManaCost:2 W
Types:Creature Human Soldier
Text:no text
PT:2/2
K:First strike
A:AB$ Tap | Cost$ 1 W | ValidTgts$ Creature.blockingSource | TgtPrompt$ Select target creature blocking Master of Arms | SpellDescription$ Tap target creature blocking CARDNAME.
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/master_of_arms.jpg
End
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Card Development Questions

Postby friarsol » 10 Oct 2011, 01:16

jeffwadsworth wrote:In the test, Master of Arms tapped a blocker, but still received damage from it. Blocker was a Gemhide Sliver.
Back in the day, blockers that were tapped didn't do combat damage. At some point (probably around 2007) when tapped blockers started doing damage, this card had errata to say that it prevented combat damage by that creature. It seems like that errata doesn't exist anymore, making Master of Arms pretty useless as far as abilities go. The card dealing damage is fine, since that's how the card works now, even if that's not how the card worked 10+ years ago.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 32 guests


Who is online

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

Login Form