Page 3 of 7

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

PostPosted: 21 Feb 2011, 17:15
by jeffwadsworth

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

PostPosted: 21 Feb 2011, 22:44
by Chris H.
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

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

PostPosted: 21 Feb 2011, 23:17
by slapshot5
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

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

PostPosted: 21 Feb 2011, 23:42
by slapshot5
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

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

PostPosted: 22 Feb 2011, 00:07
by friarsol
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.

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

PostPosted: 22 Feb 2011, 00:52
by slapshot5
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

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

PostPosted: 22 Feb 2011, 01:15
by slapshot5
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

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

PostPosted: 22 Feb 2011, 01:50
by friarsol
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.

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

PostPosted: 26 Feb 2011, 16:30
by Chris H.
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

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

PostPosted: 28 Feb 2011, 02:42
by Zirbert
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.

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

PostPosted: 28 Feb 2011, 11:14
by Hellfish
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.

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

PostPosted: 28 Feb 2011, 14:47
by friarsol
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.

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

PostPosted: 03 Mar 2011, 17:51
by slapshot5
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

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

PostPosted: 03 Mar 2011, 18:35
by slapshot5
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

Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger

PostPosted: 04 Mar 2011, 04:21
by slapshot5
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