It is currently 29 Oct 2025, 09:18
   
Text Size

UntapAll as a SubAbility?

Post MTG Forge Related Programming Questions Here

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

UntapAll as a SubAbility?

Postby Chris H. » 22 Jan 2011, 15:19

I am a wee bit puzzled. I was able to convert Call to Glory to AF sa with the following card text and it works.

Code: Select all
Name:Call to Glory
ManaCost:1 W
Types:Instant
Text:no text
A:SP$ UntapAll | Cost$ 1 W | ValidCards$ Creature.YouCtrl | SpellDescription$ Untap all creatures you control. Samurai creatures you control get +1/+1 until end of turn. | SubAbility$ SVar=DBPumpYourSamurai
SVar:DBPumpYourSamurai:DB$ PumpAll | ValidCards$ Creature.Samurai+YouCtrl | NumAtt$+1 | NumDef$ +1
SVar:PlayMain1:TRUE
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/call_to_glory.jpg
SetInfo:CHK|Common|http://magiccards.info/scans/en/chk/4.jpg
End
`
Yet Gleam of Resistance does not work. I suspect that UntapAll can not be used as a SubAbility at this time.

Code: Select all
Name:Gleam of Resistance
ManaCost:4 W
Types:Instant
Text:no text
A:SP$ PumpAll | Cost$ 4 W | ValidCards$ Creature.YouCtrl | NumAtt$ +1 | NumDef$ +2 | SpellDescription$ Creatures you control get +1/+2 until end of turn. Untap those creatures. | SubAbility$ SVar=DBUntapYourCreatures
SVar:DBUntapYourCreatures:DB$ UntapAll | ValidCards$ Creature.YouCtrl
K:TypeCycling:Basic:1 W
SVar:RemAIDeck:True
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/gleam_of_resistance.jpg
SetInfo:CFX|Common|http://magiccards.info/scans/en/cfx/8.jpg
End
`
This is the error exception that I get at start up.

Code: Select all
An error has occured. You can copy/paste this message or save it to a file.
Please report this, plus what you tried to do, to:
   http://www.slightlymagic.net/forum/viewforum.php?f=26
If you don't want to register an account, you can mail it directly to
   mtgerror@yahoo.com


AbilityFactory : SpellAbility was not created for Gleam of Resistance. Did you add the API section?


Version:
Forge -- official beta: $Date: 2011-01-06 11:34:48 -0500 (Thu, 06 Jan 2011) $, SVN revision: $Revision: 4891 $

OS: Mac OS X Version: 10.6.6 Architecture: x86_64

Java Version: 1.6.0_22 Vendor: Apple Inc.

Detailed error trace:
java.lang.RuntimeException: AbilityFactory : SpellAbility was not created for Gleam of Resistance. Did you add the API section?
   at forge.AbilityFactory.getAbility(AbilityFactory.java:483)
   at forge.AbilityFactory.getSubAbility(AbilityFactory.java:534)
   at forge.AbilityFactory.getAbility(AbilityFactory.java:491)
   at forge.CardFactory.getCard2(CardFactory.java:4832)
   at forge.CardFactory.getCard(CardFactory.java:238)
   at forge.CardFactory.<init>(CardFactory.java:74)
   at forge.AllZone.<clinit>(AllZone.java:29)
   at forge.Gui_NewGame$2.run(Gui_NewGame.java:182)
   at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:633)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: UntapAll as a SubAbility?

Postby friarsol » 22 Jan 2011, 15:22

Code: Select all
if (API.equals("UntapAll")){
   if (isAb)
      SA = AbilityFactory_PermanentState.createAbilityUntapAll(this);
   else if (isSp)
      SA = AbilityFactory_PermanentState.createSpellUntapAll(this);
   //else if (isDb)
      //SA = AbilityFactory_PermanentState.createDrawbackUntapAll(this);
}
The UntapAll Drawback is commented out (or isn't written). Not sure who wrote the AF but we should make sure Drawbacks get written so things like this don't happen.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: UntapAll as a SubAbility?

Postby slapshot5 » 23 Jan 2011, 03:13

friarsol wrote:
Code: Select all
if (API.equals("UntapAll")){
   if (isAb)
      SA = AbilityFactory_PermanentState.createAbilityUntapAll(this);
   else if (isSp)
      SA = AbilityFactory_PermanentState.createSpellUntapAll(this);
   //else if (isDb)
      //SA = AbilityFactory_PermanentState.createDrawbackUntapAll(this);
}
The UntapAll Drawback is commented out (or isn't written). Not sure who wrote the AF but we should make sure Drawbacks get written so things like this don't happen.
The Drawback for Destroy/DestroyAll also is not written.

-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 5 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 5 users online :: 0 registered, 0 hidden and 5 guests (based on users active over the past 10 minutes)
Most users ever online was 9298 on 10 Oct 2025, 12:54

Users browsing this forum: No registered users and 5 guests

Login Form