It is currently 01 Nov 2025, 17:19
   
Text Size

Converting Exile to AF_Bounce

Post MTG Forge Related Programming Questions Here

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

Converting Exile to AF_Bounce

Postby Chris H. » 12 Nov 2010, 12:55

I converted Exile to use AbilityFactory_Bounce and the target nonwhite attacking creature was exiled. Great! But I can not get the drawback to work. AbilityFactory_Bounce has a call to CardFactoryUtil.doDrawBack().

For the drawback, the spBounceTgt keyword successfully uses:

Code: Select all
K:spBounceTgt:Creature.attacking+nonWhite:Exile:Drawback$YouGainLife/dX
SVar:dX:Count$TgtCardToughness
`
This is the changes that I made while converting Exile to use AbilityFactory_Bounce:

Code: Select all
Name:Exile
ManaCost:2 W
Types:Instant
Text:no text
A:SP$Bounce|Cost$2 W|ValidTgts$Creature.attacking+nonWhite|TgtPrompt$Select target nonwhite attacking creature|Destination$Exile|SpellDescription$Exile target nonwhite attacking creature. You gain life equal to its toughness.|Drawback$YouGainLife/dX
SVar:dX:Count$TgtCardToughness
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/exile.jpg
End
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: Converting Exile to AF_Bounce

Postby Sloth » 12 Nov 2010, 13:56

I think the correct parameter is "SubAbility" instead of "Drawback". So it would be:

SubAbility$YouGainLife/dX

Did you try it like this, Chris?
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Converting Exile to AF_Bounce

Postby Chris H. » 12 Nov 2010, 15:14

Sloth wrote:I think the correct parameter is "SubAbility" instead of "Drawback". So it would be:

SubAbility$YouGainLife/dX

Did you try it like this, Chris?
`
I will give this "SubAbility" a try. :D
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: Converting Exile to AF_Bounce

Postby Chris H. » 12 Nov 2010, 15:33

Sloth wrote:SubAbility$YouGainLife/dX
`
I got an error exception with "SubAbility$YouGainLife/dX":

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


null


Version:
Forge -- official beta: $Date: 2010-09-14 08:34:27 -0400 (Tue, 14 Sep 2010) $, SVN revision: $Revision: 2039 $

OS: Mac OS X Version: 10.6.4 Architecture: x86_64

Java Version: 1.6.0_22 Vendor: Apple Inc.

Detailed error trace:
java.lang.NullPointerException
   at forge.CardFactoryUtil.xCount(CardFactoryUtil.java:3645)
   at forge.CardFactoryUtil.doDrawBack(CardFactoryUtil.java:3997)
   at forge.AbilityFactory_Bounce.bounceResolve(AbilityFactory_Bounce.java:255)
   at forge.AbilityFactory_Bounce$2.resolve(AbilityFactory_Bounce.java:112)
   at forge.MagicStack.resolveStack(MagicStack.java:488)
   at forge.Phase.passPriority(Phase.java:562)
   at forge.ComputerAI_General.stackResponse(ComputerAI_General.java:278)
   at forge.ComputerAI_General.stack_not_empty(ComputerAI_General.java:243)
   at forge.ComputerAI_Input.think(ComputerAI_Input.java:43)
   at forge.ComputerAI_Input.showMessage(ComputerAI_Input.java:31)
   at forge.GuiInput.setInput(GuiInput.java:27)
   at forge.GuiInput.update(GuiInput.java:21)
   at java.util.Observable.notifyObservers(Observable.java:142)
   at java.util.Observable.notifyObservers(Observable.java:98)
   at forge.MyObservable.updateObservers(MyObservable.java:9)
   at forge.InputControl.resetInput(InputControl.java:32)
   at forge.Phase.passPriority(Phase.java:553)
   at forge.Input_PassPriority.selectButtonOK(Input_PassPriority.java:35)
   at forge.GuiInput.selectButtonOK(GuiInput.java:35)
   at forge.GuiDisplay3.okButtonActionPerformed(GuiDisplay3.java:1001)
   at forge.GuiDisplay3.access$3(GuiDisplay3.java:1000)
   at forge.GuiDisplay3$26.actionPerformed(GuiDisplay3.java:795)
   at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
   at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
   at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
   at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
   at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
   at java.awt.Component.processMouseEvent(Component.java:6352)
   at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
   at java.awt.Component.processEvent(Component.java:6117)
   at java.awt.Container.processEvent(Container.java:2085)
   at java.awt.Component.dispatchEventImpl(Component.java:4714)
   at java.awt.Container.dispatchEventImpl(Container.java:2143)
   at java.awt.Component.dispatchEvent(Component.java:4544)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4621)
   at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4282)
   at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4212)
   at java.awt.Container.dispatchEventImpl(Container.java:2129)
   at java.awt.Window.dispatchEventImpl(Window.java:2478)
   at java.awt.Component.dispatchEvent(Component.java:4544)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:635)
   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: Converting Exile to AF_Bounce

Postby friarsol » 12 Nov 2010, 16:04

Ah good. Someone testing the new targeting with drawbacks. Fix is up.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Converting Exile to AF_Bounce

Postby Chris H. » 12 Nov 2010, 16:06

friarsol wrote:Ah good. Someone testing the new targeting with drawbacks. Fix is up.
`
Thank you. :D
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


Return to Developer's Corner

Who is online

Users browsing this forum: ArchieRoW and 23 guests

Main Menu

User Menu

Our Partners


Who is online

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

Login Form