Re: Card Development Questions
Soul Foundry currently needs hardcoding, as AF_Token can't handle copying cards.
High Quality Resources for Collectible Card Games and Home of the CCGHQ Team
https://www.slightlymagic.net/forum/
https://www.slightlymagic.net/forum/viewtopic.php?f=52&t=3760
Name:Agadeem Occultist
ManaCost:2 B
Types:Creature Human Shaman Ally
Text:no text
PT:0/2
A:AB$ChangeZone | Cost$ T | Origin$ Graveyard | Destination$ Battlefield | GainControl$ True | TgtPrompt$ Choose target creature card in your opponent's graveyard | ValidTgts$ Creature.YouDontCtrl+cmcLEX | ChangeNum$ 1 | SpellDescription$ Put target creature card from an opponent's graveyard onto the battlefield under your control if its converted mana cost is less than or equal to the number of Allies you control.
SVar:X:Count$ Valid Ally.YouCtrl
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/agadeem_occultist.jpg
End
Name:Walking Atlas
ManaCost:2
Types:Creature Construct
Text:no text
PT:1/1
A:AB$ChangeZone | Cost$ T | Origin$ Hand | Destination$ Battlefield | ValidTgts$ Land.YouCtrl | TgtPrompt$ Select a target land from your hand. | Optional$ True | SpellDescription$ You may put a land card from your hand onto the battlefield.
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/Walking_Atlas.jpg
End
Detailed error trace:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at forge.AbilityFactory_ChangeZone.changeHiddenOriginResolveHuman(Unknown Source)
at forge.AbilityFactory_ChangeZone.changeHiddenOriginResolve(Unknown Source)
at forge.AbilityFactory_ChangeZone.changeZoneResolve(Unknown Source)
at forge.AbilityFactory_ChangeZone.access$1(Unknown Source)
at forge.AbilityFactory_ChangeZone$1.resolve(Unknown Source)
at forge.MagicStack.resolveStack(Unknown Source)
at forge.Phase.passPriority(Unknown Source)
at forge.ComputerAI_General.stackResponse(Unknown Source)
at forge.ComputerAI_General.stack_not_empty(Unknown Source)
at forge.InputControl.updateInput(Unknown Source)
at forge.GuiInput.update(Unknown Source)
at java.util.Observable.notifyObservers(Unknown Source)
at java.util.Observable.notifyObservers(Unknown Source)
at forge.MyObservable.updateObservers(Unknown Source)
at forge.InputControl.resetInput(Unknown Source)
at forge.Phase.passPriority(Unknown Source)
at forge.Input_PassPriority.selectButtonOK(Unknown Source)
at forge.GuiInput.selectButtonOK(Unknown Source)
at forge.GuiDisplay4.okButtonActionPerformed(Unknown Source)
at forge.GuiDisplay4.access$3(Unknown Source)
at forge.GuiDisplay4$25.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(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.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)
Try:jeffwadsworth wrote:This test card produces the error below after displaying a list of lands in your hand.
- Code: Select all
Name:Walking Atlas
ManaCost:2
Types:Creature Construct
Text:no text
PT:1/1
A:AB$ChangeZone | Cost$ T | Origin$ Hand | Destination$ Battlefield | ValidTgts$ Land.YouCtrl | TgtPrompt$ Select a target land from your hand. | Optional$ True | SpellDescription$ You may put a land card from your hand onto the battlefield.
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/Walking_Atlas.jpg
End
- Code: Select all
Detailed error trace:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at forge.AbilityFactory_ChangeZone.changeHiddenOriginResolveHuman(Unknown Source)
at forge.AbilityFactory_ChangeZone.changeHiddenOriginResolve(Unknown Source)
at forge.AbilityFactory_ChangeZone.changeZoneResolve(Unknown Source)
at forge.AbilityFactory_ChangeZone.access$1(Unknown Source)
at forge.AbilityFactory_ChangeZone$1.resolve(Unknown Source)
at forge.MagicStack.resolveStack(Unknown Source)
at forge.Phase.passPriority(Unknown Source)
at forge.ComputerAI_General.stackResponse(Unknown Source)
at forge.ComputerAI_General.stack_not_empty(Unknown Source)
at forge.InputControl.updateInput(Unknown Source)
at forge.GuiInput.update(Unknown Source)
at java.util.Observable.notifyObservers(Unknown Source)
at java.util.Observable.notifyObservers(Unknown Source)
at forge.MyObservable.updateObservers(Unknown Source)
at forge.InputControl.resetInput(Unknown Source)
at forge.Phase.passPriority(Unknown Source)
at forge.Input_PassPriority.selectButtonOK(Unknown Source)
at forge.GuiInput.selectButtonOK(Unknown Source)
at forge.GuiDisplay4.okButtonActionPerformed(Unknown Source)
at forge.GuiDisplay4.access$3(Unknown Source)
at forge.GuiDisplay4$25.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(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.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)
| ChangeType$ Land | ChangeNum$ 1 |Yeah. I never know what to use for ChangeZone. I just search for a card with the same Origin$ and Destination$ and copy it.jeffwadsworth wrote:Thanks. So much for following the wiki examples.
Just some clarification since I've done the most work on the wiki, and I'd like to make the docs as useful as possible. I understand the wiki isn't perfect and definitely can be fleshed out more.jeffwadsworth wrote:Thanks. So much for following the wiki examples.
The first is hidden, generally used for Origin zones that are not known information, like the Library or the Hand. The choice of "What card is changing zones?" happens during resolution.
ChangeZone (Hidden)
A:SP$ChangeZone | Cost$ W | Origin$ Library | Destination$ Library | LibraryPosition$ 0 | ChangeType$ Artifact,Enchantment | ChangeNum$ 1 | SpellDescription$ Search your library for an artifact or enchantment card and reveal that card. Shuffle your library, then put the card on top of it.
Similarly, you will only use Targeting in AFs when the thing you want to target is in a known zone. Mostly the Battlfield, but also the Graveyard and rarely Exile.For Hidden, things like ChangeType and ChangeNum are used to restrict what can ChangeZone, and how many do.
Name:Momentary Blink
ManaCost:1 W
Types:Instant
Text:no text
K:Flashback:3 U
A:SP$ChangeZone | Cost$ 1 W | TargetMin$ 1 | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control | RememberTargets$ True | ForgetOtherTargets$ True | Origin$ Battlefield | Destination$ Exile | SubAbility$ SVar=DBReturn | SpellDescription$ Exile target creature you control, then return it to the battlefield under your control.
SVar:DBReturn:DB$ChangeZone | Cost$ 0 | Defined$ Remembered | Origin$ Exile | Destination$ Battlefield
SVar:RemAIDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/ruin_ghost.jpg
SVar:Rarity:Uncommon
SetInfo:WWK|Uncmmon|http://magiccards.info/scans/en/wwk/19.jpg
End
Monday mornings are for troll slaying.jeffwadsworth wrote:@Sol. I was just trolling. The Forge Wiki is invaluable. I will read it more carefully next time.
Name:Deathforge Shaman
ManaCost:4 R
Types:Creature Ogre Shaman
Text:no text
PT:4/3
K:Multikicker R
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDamage | TriggerDescription$ When CARDNAME enters the battlefield, it deals damage to target player equal to twice the number of times it was kicked.
SVar:TrigDamage:AB$DealDamage | Cost$ 0 | Tgt$ TgtP | NumDmg$ X
SVar:X:Count$TimesKicked/Twice
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/Deathforge_Shaman.jpg
End