Issue 113 Converting Hardcoded Cards to AFs/Trigger
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by jeffwadsworth » 21 Feb 2011, 17:15
Edit: Exhume, Decree of Justice, Perish the Thought, Roiling Terrain can not be done at this time in script.jeffwadsworth wrote:I will get these.friarsol wrote:And the Sorceries:
- Code: Select all
Lab Rats
Roiling Terrain
Plague Wind
Wheel of Fortune (if Discard works)
Deep Analysis
Grizzly Fate (Threshold 4.2)
Delirium Skeins
Ichor Slick
Reminisce
Innocent Blood
Identity Crisis
Bestial Menace
Exhume?
Prosperity
Hurricane
Earthquake
Rolling Earthquake
Savage Twister
Stream of Life
Lavalanche
Psychic Drain
Channel the Suns
Perish the Thought(this is a changeZone not a Discard)
Burning Inquiry
Reanimate
Ashes to Ashes
Last Stand
Decree of Justice
- jeffwadsworth
- Super Tester Elite
- Posts: 1172
- Joined: 20 Oct 2010, 04:47
- Location: USA
- Has thanked: 287 times
- Been thanked: 70 times
Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by Chris H. » 21 Feb 2011, 22:44
Slapshot and I have now finished converting the cards that used the etbMakeToken keyword. I see there is a problem with several (18) of the Flashback cards that I converted early in the AF project, so I will now fix those.
We still have these cards left over from the creature category that need to be converted:
Arctic Nishoba
Deadly Grub
Doomsday Specter
Glory
Kargan Dragonlord
Nemata, Grove Guardian
Plague Spitter
Rootwater Thief
Slaughterhouse Bouncer
Stangg
We still have these cards left over from the creature category that need to be converted:
Arctic Nishoba
Deadly Grub
Doomsday Specter
Glory
Kargan Dragonlord
Nemata, Grove Guardian
Plague Spitter
Rootwater Thief
Slaughterhouse Bouncer
Stangg
Last edited by Chris H. on 22 Feb 2011, 00:15, edited 2 times in total.
Reason: EDIT #1: Removed two recently converted cards from list.
Reason: EDIT #1: Removed two recently converted cards from list.
-
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: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by slapshot5 » 21 Feb 2011, 23:17
And when Chris says "Slapshot and I" he means "Chris". He did all the work.Chris H. wrote:Slapshot and I have now finished converting the cards that used the etbMakeToken keyword.

-slapshot5
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by slapshot5 » 21 Feb 2011, 23:42
Running into an issue converting Dread to triggers:
When DamageDone triggers, Dread itself is destroyed:
Any reason for this? Any bad side effect of changing destroyResolve to use getDefinedCards?
-slapshot5
When DamageDone triggers, Dread itself is destroyed:
- Code: Select all
Name:Dread
ManaCost:3 B B B
Types:Creature Elemental Incarnation
Text:no text
PT:6/6
K:Fear
T:Mode$ DamageDone | ValidSource$ Creature | ValidTarget$ You | Execute$ TrigDestroy | TriggerZones$ Battlefield | TriggerDescription$ Whenever a creature deals damage to you, destroy it.
T:Mode$ ChangesZone | Origin$ Any | Destination$ Graveyard | ValidCard$ Creature.Self | Execute$ TrigShuffle | TriggerDescription$ When CARDNAME is put into a graveyard from anywhere, shuffle it into its owner's library.
SVar:TrigShuffle:AB$ChangeZone | Cost$ 0 | Origin$ Graveyard | Destination$ Library | Shuffle$ True | Defined$ Self
SVar:TrigDestroy:AB$Destroy | Cost$ 0 | Defined$ Triggered
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/dread.jpg
SetInfo:LRW|Rare|http://magiccards.info/scans/en/lw/107.jpg
End
Any reason for this? Any bad side effect of changing destroyResolve to use getDefinedCards?
-slapshot5
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by friarsol » 22 Feb 2011, 00:07
Probably just an oversight.slapshot5 wrote:Looking into AF_Destroy, destroyStackDescription uses getDefinedCards, but destroyResolve does not.
Any reason for this? Any bad side effect of changing destroyResolve to use getDefinedCards?
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by slapshot5 » 22 Feb 2011, 00:52
Ok. I'll take care of it and spot test a few cards.friarsol wrote:Probably just an oversight.slapshot5 wrote:Looking into AF_Destroy, destroyStackDescription uses getDefinedCards, but destroyResolve does not.
Any reason for this? Any bad side effect of changing destroyResolve to use getDefinedCards?
-slapshot5
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by slapshot5 » 22 Feb 2011, 01:15
Changing to use Defined makes Parallax Dementia not work. There probably needs to be some kind of remembering.
Do we have a system in place to handle this?
-slapshot5
Do we have a system in place to handle this?
-slapshot5
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by friarsol » 22 Feb 2011, 01:50
There's some code in place in moveTo that handles LKI, but for some reason the auras aren't using the right version of the card. I'll have to look into it when I get some time.slapshot5 wrote:Do we have a system in place to handle this?
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by Chris H. » 26 Feb 2011, 16:30
I tried to convert Arctic Nishoba but you do not gain any life. I think that it may be because the AGE counters are being removed prior to when X is being calculated.
There was a message on the console refering to trying to gain zero or negative life.
There was a message on the console refering to trying to gain zero or negative life.
- Arctic Nishoba card | Open
- Name:Arctic Nishoba
ManaCost:5 G
Types:Creature Cat Warrior
Text:no text
PT:6/6
K:Trample
K:Cumulative upkeep:GW
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ TrigGainLife | TriggerDescription$ When CARDNAME is put into a graveyard from the battlefield, you gain 2 life for each age counter on it.
SVar:TrigGainLife:AB$GainLife | Cost$ 0 | Defined$ You | LifeAmount$ X
SVar:X:Count$CardCounters.AGE/Times.2
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/arctic_nishoba.jpg
SetInfo:CSP|Uncommon|http://magiccards.info/scans/en/cs/102.jpg
End
-
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: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by Zirbert » 28 Feb 2011, 02:42
Can we now set triggers to go off at any of these using "T:Mode$ Phase | Phase$ [one from this list]", or is that still limited to Untap, Upkeep, Draw or EoT? Being able to set off phase triggers at different points in the turn would open up quite a few more scriptable cards.Hellfish wrote:Triggers can now be limited to phases using a comma-separated list of phases in the TriggerPhases$ parameter.Phase names for reference:
- Code: Select all
Untap
Upkeep
Draw
Main1
BeginCombat
Declare Attackers
Declare Attackers - Play Instants and Abilities
Declare Blockers
Declare Blockers - Play Instants and Abilities
Combat Damage
First Strike Damage
EndCombat
Main2
End of Turn
Cleanup
Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by Hellfish » 28 Feb 2011, 11:14
I'm doing some timing tests right now. If they check out fine,I'll commit a change which will allow any one step from that list to be used.
EDIT: Should work as of r6917.
EDIT: Should work as of r6917.
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
-
Hellfish - Programmer
- Posts: 1297
- Joined: 07 Jun 2009, 10:41
- Location: South of the Pumphouse
- Has thanked: 110 times
- Been thanked: 169 times
Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by friarsol » 28 Feb 2011, 14:47
I'm going to make a small change to it, but should work pretty much the same as before.Hellfish wrote:I'm doing some timing tests right now. If they check out fine,I'll commit a change which will allow any one step from that list to be used.
EDIT: Should work as of r6917.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by slapshot5 » 03 Mar 2011, 17:51
I tried to convert Fecundity to triggers, but ran into a problem. When AI's creatures were put into the graveyard when I had Fecundity in play, I was prompted for the Optional$ use of Fecundity.
Here is my Fecundity with triggers:
Note: If I choose to use the Fecundity trigger, the AI - correctly - is the one to draw the card for his/her creatures.
-slapshot5
Here is my Fecundity with triggers:
- Code: Select all
Name:Fecundity
ManaCost:2 G
Types:Enchantment
Text:no text
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature | TriggerZones$ Battlefield | Execute$ TrigDraw | Optional$ True | TriggerDescription$ Whenever a creature is put into a graveyard from the battlefield, that creature's controller may draw a card.
SVar:TrigDraw:AB$Draw | Cost$ 0 | Defined$ TriggeredController | NumCards$ 1
SVar:RemAIDeck:True
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/fecundity.jpg
SetInfo:8ED|Uncommon|http://magiccards.info/scans/en/8e/247.jpg
SetInfo:USG|Uncommon|http://magiccards.info/scans/en/us/251.jpg
End
Note: If I choose to use the Fecundity trigger, the AI - correctly - is the one to draw the card for his/her creatures.
-slapshot5
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by slapshot5 » 03 Mar 2011, 18:35
What do people think about adding getTriggeringPlayer() - similar to getTriggeringCard()?
This could be used for cards like Horn of Green, or "whenever a player draws a card, that player..."
Would this be overridden in just a couple trigger classes like Drawn, LandPlayed, LifeGained, LifeLost, (others?) ? Or would it be abstract and overridden in each trigger class and default to getTriggeringCard().getController()?
-slapshot5
This could be used for cards like Horn of Green, or "whenever a player draws a card, that player..."
Would this be overridden in just a couple trigger classes like Drawn, LandPlayed, LifeGained, LifeLost, (others?) ? Or would it be abstract and overridden in each trigger class and default to getTriggeringCard().getController()?
-slapshot5
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger
by slapshot5 » 04 Mar 2011, 04:21
Defined$ Triggered doesn't work in the triggered ability when used with the Trigger_DamageDone class.
This can be seen with Rite of Passage implemented as triggers:
This can be seen with Rite of Passage implemented as triggers:
- Code: Select all
Name:Rite of Passage
ManaCost:2 G
Types:Enchantment
Text:no text
T:Mode$ DamageDone | ValidTarget$ Creature.YouCtrl | TriggerZones$ Battlefield | Execute$ TrigPutCounter | TriggerDescription$ Whenever a creature you control is dealt damage, put a +1/+1 counter on it. (The damage is dealt before the counter is put on.)
SVar:TrigPutCounter:AB$PutCounter | Cost$ 0 | Defined$ Triggered | CounterType$ P1P1 | CounterNum$ 1
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/rite_of_passage.jpg
SetInfo:5DN|Rare|http://magiccards.info/scans/en/5dn/91.jpg
End
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Who is online
Users browsing this forum: No registered users and 33 guests