Re: Issue 113 Converting Hardcoded Cards to AFs/Trigger
Sweet, just what I was hoping for 
High Quality Resources for Collectible Card Games and Home of the CCGHQ Team
https://www.slightlymagic.net/forum/
https://www.slightlymagic.net/forum/viewtopic.php?f=52&t=3959
Name:Kodama of the Center Tree
ManaCost:4 G
Types:Legendary Creature Spirit
Text:no text
PT:*/*
K:stSetPT:Count$Valid Spirit.YouCtrl:Count$Valid Spirit.YouCtrl:CARDNAME's power and toughness are each equal to the number of Spirits you control.
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | Optional$ True | ValidCard$ Card.Self | Execute$ TrigChange | TriggerDescription$ CARDNAME has soulshift X, where X is the number of Spirits you control. (When this is put into a graveyard from the battlefield, you may return target Spirit card with converted mana cost X or less from your graveyard to your hand.)
SVar:TrigChange:AB$ChangeZone | Cost$ 0 | Origin$ Graveyard | Destination$ Hand | ValidTgts$ Spirit.YouCtrl+cmcLEX
SVar:X:Count$Valid Spirit.YouCtrl
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/kodama_of_the_center_tree.jpg
End
Name:Sword of Light and Shadow
ManaCost:3
Types:Artifact Equipment
Text:Equipped creature gets +2/+2 and has protection from white and from black.
K:eqPump 2:+2/+2/Protection from white & Protection from black
#
#Testing ability without trigger
A:AB$GainLife | Cost$ 1 | Defined$ You | LifeAmount$ 3 | SubAbility$ SVar=DBReturn | SpellDescription$ Gain 3 life and return creature.
#
T:Mode$ DamageDone | ValidSource$ Creature.AttachedBy | ValidTarget$ Player | CombatDamage$ True | Execute$ TrigGainLife | TriggerZones$ Battlefield | TriggerDescription$ Whenever equipped creature deals combat damage to a player, you gain 3 life and you may return up to one target creature card from your graveyard to your hand.
SVar:TrigGainLife:AB$GainLife | Cost$ 0 | Defined$ You | LifeAmount$ 3 | SubAbility$ SVar=DBReturn
SVar:DBReturn:DB$ChangeZone | Origin$ Graveyard | Destination$ Hand | ValidTgts$ Creature | TargetMin$ 0 | TargetMax$ 1 | TgtPrompt$ Select target creature in your graveyard
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/sword_of_light_and_shadow.jpg
SetInfo:DST|Rare|http://magiccards.info/scans/en/ds/149.jpg
End
I don't think it has anything to do with the how you are using ChangeZone. What's more likely is the target input is getting cleared out by the CombatDamage input. And so you just never get a chance to target.slapshot5 wrote:Well, the Sword of Light and Shadow issue is something to do with ChangeZone or my use of it. If I take the DBReturn out, I gain life as expected when the trigger resolves.
-slapshot5
//petCard.addIntrinsicKeyword("Whenever this creature attacks alone, it gets +2/+0 until end of turn.");
final Trigger myTrigger = TriggerHandler.parseTrigger("Mode$ Attacks | ValidCard$ Card.Self | Alone$ True | TriggerDescription$ Whenever CARDNAME attacks alone, it gets +2/+0 until end of turn.", petCard);
AbilityFactory af = new AbilityFactory();
myTrigger.setOverridingAbility(af.getAbility("AB$Pump | Cost$ 0 | Defined$ Self | NumAtt$ 2", petCard));
petCard.addTrigger(myTrigger);
AllZone.TriggerHandler.registerTrigger(myTrigger);
I was going to say "Hey, it still doesn't work", but then I thought maybe if I updated my source tree, there was a better chance it would... *sigh*Hellfish wrote:Slapshot5: The Attacks-trigger didn't get all the data it needed, must've gotten lost in a move somewhere. It works now.
Name:Mana Drain
ManaCost:U U
Types:Instant
Text:no text
A:SP$Counter | Cost$ U U | TargetType$ Spell | RememberTargets$ True | ForgetOtherTargets$ True | ValidTgts$ Card | SubAbility$SVar=DBDelTrig | SpellDescription$ Counter target spell. At the beginning of your next main phase, add X to your mana pool, where X is that spell's converted mana cost.
SVar:DBDelTrig:DB$DelayedTrigger | Mode$ Phase | Phase$ Main1,Main2 | ValidPlayer$ You | Execute$ AddMana | TriggerDescription$ CARDNAME - At the beginning of your next main phase, add X to your mana pool, where X is the countered spell's converted mana cost.
SVar:AddMana:AB$Mana | Cost$ 0 | Produced$ 1 | Amount$ X
SVar:X:Remembered$CardManaCost
SVar:RemAIDeck:True
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/mana_drain.jpg
SetInfo:LEG|Uncommon|http://magiccards.info/scans/en/lg/65.jpg
End