It is currently 12 Sep 2025, 16:40
   
Text Size

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

Postby 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
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.
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: Issue 113 Converting Hardcoded Cards to AFs/Trigger

Postby slapshot5 » 21 Feb 2011, 23:17

Chris H. wrote:Slapshot and I have now finished converting the cards that used the etbMakeToken keyword.
And when Chris says "Slapshot and I" he means "Chris". He did all the work. :)

-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

Postby slapshot5 » 21 Feb 2011, 23:42

Running into an issue converting Dread to triggers:

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
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

Postby friarsol » 22 Feb 2011, 00:07

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?
Probably just an oversight.
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

Postby slapshot5 » 22 Feb 2011, 00:52

friarsol wrote:
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?
Probably just an oversight.
Ok. I'll take care of it and spot test a few cards.

-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

Postby 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
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

Postby friarsol » 22 Feb 2011, 01:50

slapshot5 wrote:Do we have a system in place to handle this?
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.
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

Postby 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.

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
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: Issue 113 Converting Hardcoded Cards to AFs/Trigger

Postby Zirbert » 28 Feb 2011, 02:42

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
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.
Zirbert
 
Posts: 512
Joined: 13 Oct 2010, 16:04
Has thanked: 104 times
Been thanked: 19 times

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

Postby 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.
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
User avatar
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

Postby friarsol » 28 Feb 2011, 14:47

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.
I'm going to make a small change to it, but should work pretty much the same as before.
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

Postby 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:
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
I'm pretty certain the trigger and ability are right. Is this just a edge case interaction of Optional$ True and Defined$ TriggeredController?

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

Postby 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
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

Postby 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:
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
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 42 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 42 users online :: 0 registered, 0 hidden and 42 guests (based on users active over the past 10 minutes)
Most users ever online was 7967 on 09 Sep 2025, 23:08

Users browsing this forum: No registered users and 42 guests

Login Form