It is currently 25 May 2025, 21:39
   
Text Size

Card Development Questions

Post MTG Forge Related Programming Questions Here

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

Re: Card Development Questions

Postby jeffwadsworth » 13 Dec 2011, 23:19

Looking at Burning of Xinye. It requires SP$ ChooseCard. Where is the code for "Logic$" located? Apparently, it is not in AbilityFactoryChoose.java. I am using Sundering Titan as a template. The script for Sundering Titan.

| Open
Name:Sundering Titan
ManaCost:8
Types:Artifact Creature Golem
Text:no text
PT:7/10
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ TrigChoose | TriggerDescription$ When CARDNAME enters the battlefield or leaves the battlefield, choose a land of each basic land type, then destroy those lands.
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | ValidCard$ Card.Self | Execute$ TrigChoose | Secondary$ True | TriggerDescription$ When CARDNAME enters the battlefield or leaves the battlefield, choose a land of each basic land type, then destroy those lands.
SVar:TrigChoose:AB$ ChooseCard | Cost$ 0 | Defined$ You | Logic$ EachBasicType | SubAbility$ DBDestroy
SVar:DBDestroy:DB$ DestroyAll | ValidCards$ Card.ChosenCard | SpellDescription$ Destroy all chosen cards.
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/sundering_titan.jpg
SetInfo:DST|Rare|http://magiccards.info/scans/en/ds/146.jpg
Oracle:When Sundering Titan enters the battlefield or leaves the battlefield, choose a land of each basic land type, then destroy those lands.
End


Note that Burning of Xinye has this oracle text:

Choose four lands you control and destroy those lands. Then target opponent chooses four lands he or she controls. Destroy those lands. Then Burning of Xinye deals 4 damage to each creature.
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Card Development Questions

Postby slapshot5 » 14 Dec 2011, 00:15

Jeff,

Burning of Xinye is not doable with ChooseCard. Where is the rest of the code located? It's not. ChooseCard would need to be expanded for this to be doable.

-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: Card Development Questions

Postby timmermac » 14 Dec 2011, 03:09

Isn't Burning of Xinye essentially Wildfire?
"I just woke up, haven't had coffee, let alone a pee in 7 days, and I find out you stole my ass and made a ...mini-me! Carter, I should be irked currently, yes?" - Jack O'Neill
User avatar
timmermac
Tester
 
Posts: 1512
Joined: 17 May 2010, 20:36
Has thanked: 18 times
Been thanked: 95 times

Re: Card Development Questions

Postby slapshot5 » 14 Dec 2011, 03:42

timmermac wrote:Isn't Burning of Xinye essentially Wildfire?
Somewhat, but the Destroy and Sacrifice AbilityFactory classes are written very differently.

Maybe there is some script-fu to make this work, but I wrote ChooseCard, and I can guarantee it won't work as is for Burning of Xinye.

-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: Card Development Questions

Postby Sloth » 16 Dec 2011, 19:55

I fixed Jester's Mask today. It's possible that Tatsumasa, the Dragon's Fang works now. Please test again.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Card Development Questions

Postby moomarc » 16 Dec 2011, 20:01

Sloth wrote:I fixed Jester's Mask today. It's possible that Tatsumasa, the Dragon's Fang works now. Please test again.
Thanks Sloth. I'll try when I wake up tomorrow if nobody else has yet.
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Card Development Questions

Postby friarsol » 17 Dec 2011, 03:01

Anyone want to try converting Cursed Scroll to script? I'm not 100% the NamedCard can be compared the Revealed Card, but it might work.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby Sloth » 17 Dec 2011, 15:06

moomarc wrote:
Sloth wrote:I fixed Jester's Mask today. It's possible that Tatsumasa, the Dragon's Fang works now. Please test again.
Thanks Sloth. I'll try when I wake up tomorrow if nobody else has yet.
I commited some more code, that should do the trick.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Card Development Questions

Postby moomarc » 17 Dec 2011, 16:03

Sloth wrote:
moomarc wrote:
Sloth wrote:I fixed Jester's Mask today. It's possible that Tatsumasa, the Dragon's Fang works now. Please test again.
Thanks Sloth. I'll try when I wake up tomorrow if nobody else has yet.
I commited some more code, that should do the trick.
I just tried my original script, but the created token is still not added to Tatsumasa before it's exiled as part of the cost.
| Open
Code: Select all
Name:Tatsumasa, the Dragon's Fang
ManaCost:6
Types:Legendary Artifact Equipment
Text:Equipped creature gets +5/+5.
K:eqPump 3:+5/+5
A:AB$ Token | Cost$ 6 Exile<1/CARDNAME> | TokenAmount$ 1 | TokenName$ Dragon Spirit | TokenTypes$ Creature,Dragon,Spirit | TokenOwner$ You | TokenColors$ Blue | TokenPower$ 5 | TokenToughness$ 5 | RememberTokens$ True | DelayedTrigger$ DelTrigDies | TokenKeywords$ Flying | SpellDescription$ Put a 5/5 blue Dragon Spirit creature token with flying onto the battlefield. Return Tatsumasa to the battlefield under its owner's control when that token dies.
SVar:DelTrigDies:DB$DelayedTrigger | Mode$ ChangesZone | ValidCard$ Creature.IsRemembered | Origin$ Battlefield | Destination$ Graveyard | TriggerZones$ Exile |Execute$ TrigReturn | TriggerDescription$ Return CARDNAME to the battlefield under its owner's control.
SVar:TrigReturn:AB$ChangeZone | Cost$ 0 | Origin$ Exile | Destination$ Battlefield | Defined$ Self | SubAbility$ DBCleanUp
SVar:DBCleanUp:DB$Cleanup | ClearRemembered$ True
SVar:Rarity:Rare
SetInfo:CHK|Rare|http://magiccards.info/scans/en/chk/270.jpg
Oracle:Equipped creature gets +5/+5.\n{6}, Exile Tatsumasa, the Dragon's Fang: Put a 5/5 blue Dragon Spirit creature token with flying onto the battlefield. Return Tatsumasa to the battlefield under its owner's control when that token dies.\nEquip {3}
End
Then I tried SoulStorm's version that adds the return trigger to the token created, but that doesn't work either.
| Open
Code: Select all
Name:Tatsumasa, the Dragon's Fang
ManaCost:6
Types:Legendary Artifact Equipment
Text:Equipped creature gets +5/+5.
K:eqPump 3:+5/+5
A:AB$ Token | Cost$ 6 Exile<1/CARDNAME> | TokenAmount$ 1 | TokenName$ Dragon Spirit | TokenTypes$ Creature,Dragon,Spirit | TokenOwner$ You | TokenColors$ Blue | TokenPower$ 5 | TokenToughness$ 5 | TokenKeywords$ Flying | TokenTriggers$ TriggerJunior | TokenSVars$ TrigReturn | SpellDescription$ Put a 5/5 blue Dragon Spirit creature token with flying onto the battlefield. Return Tatsumasa to the battlefield under its owner's control when that token dies.
SVar:TriggerJunior:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ TrigReturn | TriggerDescription$ Return Tatsumasa to the battlefield under its owner's control when that token dies.
SVar:TrigReturn:AB$ChangeZone | Cost$ 0 | ChangeType$ Card.namedTatsumasa, the Dragon's Fang | ChangeNum$ 1 | Origin$ Exile | Destination$ Battlefield | Hidden$ True | SpellDescription$ Return Tatsumasa to the battlefield under its owner's control when that token dies.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/tatsumasa_the_dragons_fang.jpg
End
So looks like we're still out of luck. :( Thanks for trying though. Really appreciate it.

----------------

On a different note, is there any code in place to count all mana in the mana pool? I'm trying Glissa Sunseeker and it almost works. But the math fuctions only seem to take the first 2 inputs so my current method only counts white and blue mana:
Glissa Sunseeker | Open
Code: Select all
Name:Glissa Sunseeker
ManaCost:2 G G
Types:Legendary Creature Elf
Text:no text
PT:3/2
K:First Strike
A:AB$ Destroy | Cost$ T | ValidTgts$ Artifact | TgtPrompt$ Select target artifact | ConditionCheckSVar$ Y | ConditionSVarCompare$ EQX | SpellDescription$ Destroy target artifact if its converted mana cost is equal to the amount of mana in your mana pool.
SVar:A:Count$ManaPool:white
SVar:B:Count$ManaPool:blue
SVar:C:Count$ManaPool:black
SVar:D:Count$ManaPool:red
SVar:E:Count$ManaPool:green
SVar:X:SVar$A/Plus.B/Plus.C/Plus.D/Plus.E
SVar:Y:Targeted$CardManaCost
#AI doesn't have a mana pool
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/glissa_sunseeker.jpg
SetInfo:MRD|Rare|http://magiccards.info/scans/en/mi/120.jpg
Oracle:First strike\n{T}: Destroy target artifact if its converted mana cost is equal to the amount of mana in your mana pool.
End
For easy testing of the mana counting, just add this to the script:
Code: Select all
A:AB$ GainLife | Cost$ 0 | ValidTgts$ Player | TgtPrompt$ Select target player | LifeAmount$ X | SpellDescription$ Target player gains X life
Its also proven a great testing script for Sol's new mana code. But I'll post feedback on that in the relevant thread.

Anyway, is there a way to add more than 2 SVar values in the same line if there isn't a Count$ManaPool:All equivalent? I've even tried cheating it by splitting it into smaller parts, but that had the same result:
Code: Select all
SVar:A:Count$ManaPool:white
SVar:B:Count$ManaPool:blue
SVar:C:Count$ManaPool:black
SVar:D:Count$ManaPool:red
SVar:E:Count$ManaPool:green
SVar:F:SVar$A/Plus.B
SVar:G:SVar$C/Plus.D
SVar:H:SVar$F/Plus.G
SVar:X:SVar$H/Plus.E
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Card Development Questions

Postby moomarc » 17 Dec 2011, 17:48

Testing War's Toll, the second ability doesn't quite work.
War's Toll | Open
Code: Select all
Name:War's Toll
ManaCost:3 R
Types:Enchantment
Text:no text
T:Mode$ TapsForMana | ValidCard$ Land.YouDontCtrl | Execute$ TrigTapAll | TriggerZones$ Battlefield | TriggerDescription$ Whenever an opponent taps a land for mana, tap all lands that player controls.
T:Mode$ Attacks | ValidCard$ Creature.YouDontCtrl | TriggerZones$ Battlefield | Execute$ TrigAttack | TriggerDescription$ If a creature an opponent controls attacks, all creatures that opponent controls attack if able.
SVar:TrigTapAll:AB$TapAll | Cost$ 0 | Defined$ TriggeredPlayer | ValidCards$ Land
SVar:TrigAttack:DB$PumpAll | Defined$ TriggeredPlayer | ValidCards$ Creature | KW$ HIDDEN CARDNAME attacks each turn if able.
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/wars_toll.jpg
SetInfo:DIS|Rare|http://magiccards.info/scans/en/di/77.jpg
Oracle:Whenever an opponent taps a land for mana, tap all lands that player controls.\nIf a creature an opponent controls attacks, all creatures that opponent controls attack if able.
End
The ability is only added after the attackers are declared so this method doesn't work. Do we have anything for this situation? Something to make valid cards attack NOW?
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Card Development Questions

Postby Sloth » 17 Dec 2011, 18:54

moomarc wrote:Testing War's Toll, the second ability doesn't quite work.
War's Toll | Open
Code: Select all
Name:War's Toll
ManaCost:3 R
Types:Enchantment
Text:no text
T:Mode$ TapsForMana | ValidCard$ Land.YouDontCtrl | Execute$ TrigTapAll | TriggerZones$ Battlefield | TriggerDescription$ Whenever an opponent taps a land for mana, tap all lands that player controls.
T:Mode$ Attacks | ValidCard$ Creature.YouDontCtrl | TriggerZones$ Battlefield | Execute$ TrigAttack | TriggerDescription$ If a creature an opponent controls attacks, all creatures that opponent controls attack if able.
SVar:TrigTapAll:AB$TapAll | Cost$ 0 | Defined$ TriggeredPlayer | ValidCards$ Land
SVar:TrigAttack:DB$PumpAll | Defined$ TriggeredPlayer | ValidCards$ Creature | KW$ HIDDEN CARDNAME attacks each turn if able.
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/wars_toll.jpg
SetInfo:DIS|Rare|http://magiccards.info/scans/en/di/77.jpg
Oracle:Whenever an opponent taps a land for mana, tap all lands that player controls.\nIf a creature an opponent controls attacks, all creatures that opponent controls attack if able.
End
The ability is only added after the attackers are declared so this method doesn't work. Do we have anything for this situation? Something to make valid cards attack NOW?
The second ability is not a triggered ability (because that wouldn't work with the rules). I will take a look if I can script a static ability that will cover this.

On Tatsumasa, the Dragon's Fang: I managed that the exiled Tatsumasa remembers the token, but the delayed trigger will still not fire. I think it's possible to put a normal trigger on Tatsumasa that will trigger when it's exiled and its remembered token will die.
I will try to script this myself.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Card Development Questions

Postby moomarc » 17 Dec 2011, 19:17

Sloth wrote:
moomarc wrote:Testing War's Toll, the second ability doesn't quite work.
War's Toll | Open
Code: Select all
Name:War's Toll
ManaCost:3 R
Types:Enchantment
Text:no text
T:Mode$ TapsForMana | ValidCard$ Land.YouDontCtrl | Execute$ TrigTapAll | TriggerZones$ Battlefield | TriggerDescription$ Whenever an opponent taps a land for mana, tap all lands that player controls.
T:Mode$ Attacks | ValidCard$ Creature.YouDontCtrl | TriggerZones$ Battlefield | Execute$ TrigAttack | TriggerDescription$ If a creature an opponent controls attacks, all creatures that opponent controls attack if able.
SVar:TrigTapAll:AB$TapAll | Cost$ 0 | Defined$ TriggeredPlayer | ValidCards$ Land
SVar:TrigAttack:DB$PumpAll | Defined$ TriggeredPlayer | ValidCards$ Creature | KW$ HIDDEN CARDNAME attacks each turn if able.
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/wars_toll.jpg
SetInfo:DIS|Rare|http://magiccards.info/scans/en/di/77.jpg
Oracle:Whenever an opponent taps a land for mana, tap all lands that player controls.\nIf a creature an opponent controls attacks, all creatures that opponent controls attack if able.
End
The ability is only added after the attackers are declared so this method doesn't work. Do we have anything for this situation? Something to make valid cards attack NOW?
The second ability is not a triggered ability (because that wouldn't work with the rules). I will take a look if I can script a static ability that will cover this.
Take your time. Whenever you can get to it and don't have more important parts to attend to would be great. :D I'm just having fun taking a day off from work and doing some Forging and attempting loads of scripts.

Sloth wrote:On Tatsumasa, the Dragon's Fang: I managed that the exiled Tatsumasa remembers the token, but the delayed trigger will still not fire. I think it's possible to put a normal trigger on Tatsumasa that will trigger when it's exiled and its remembered token will die.
I will try to script this myself.
Wow! Looks like you've committed already! =D> Thanks
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Card Development Questions

Postby moomarc » 17 Dec 2011, 23:46

I've just tested Knight of the Mists and it works as expected, but feels a bit clunky and just want some extra feedback if anyone else wants to test it.
Knight of the Mists | Open
Code: Select all
Name:Knight of the Mists
ManaCost:2 U
Types:Creature Human Knight
Text:no text
PT:2/2
K:Flanking
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDestroy | OptionalDecider$ True | TriggerDescription$ When CARDNAME enters the battlefield, you may pay U. If you don't, destroy target Knight and it can't be regenerated.
SVar:TrigDestroy:AB$ Destroy | Cost$ 0 | ValidTgts$ Creature.Knight | TgtPrompt$ Select target Knight | NoRegen$ True | UnlessCost$ U | UnlessPayer$ You
SVar:ManaNeededToAvoidNegativeEffect:blue
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/knight_of_the_mists.jpg
End
The clunkiness is from having the optional decider on the trigger as well as the unless cost, but it's necessary to prevent a creature from being targeted (illusions that have also become knights wouldn't like this) before the unless cost is paid or not.

The other small point is that rather than adding RemAIDeck, I rather added ManaNeededToAvoidNegativeEffect SVar so that the Ai can still play it as a 2/2 flanker for {2} {U} {U} as he'll wait to have the extra mana and will always pay the unless cost to avoid potentially having to target itself.
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

Re: Card Development Questions

Postby friarsol » 18 Dec 2011, 00:21

moomarc wrote:The clunkiness is from having the optional decider on the trigger as well as the unless cost, but it's necessary to prevent a creature from being targeted (illusions that have also become knights wouldn't like this) before the unless cost is paid or not.
I'm not sure what you mean by this, but you have to target something when this triggers. Then you get to pay the mana or not to protect the targeted Knight.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Card Development Questions

Postby moomarc » 18 Dec 2011, 00:45

friarsol wrote:
moomarc wrote:The clunkiness is from having the optional decider on the trigger as well as the unless cost, but it's necessary to prevent a creature from being targeted (illusions that have also become knights wouldn't like this) before the unless cost is paid or not.
I'm not sure what you mean by this, but you have to target something when this triggers. Then you get to pay the mana or not to protect the targeted Knight.
Are you sure? Its the reverse of a normal unless cost. The actual wording is ...you may pay {U}. IF YOU DON'T... So my understanding is that you would only have to target a knight if you choose not to pay, unlike with a normal unless cost where you select the target first then choose whether to pay the unless cost. That's why I gave the trigger the optional decider so you can opt out before targeting anything.

But you're the rules lawyer so I'll stand by your decision. :mrgreen:

revised Knight of the Mists | Open
Name:Knight of the Mists
ManaCost:2 U
Types:Creature Human Knight
Text:no text
PT:2/2
K:Flanking
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDestroy | TriggerDescription$ When CARDNAME enters the battlefield, you may pay U. If you don't, destroy target Knight and it can't be regenerated.
SVar:TrigDestroy:AB$ Destroy | Cost$ 0 | ValidTgts$ Creature.Knight | TgtPrompt$ Select target Knight | NoRegen$ True | UnlessCost$ U | UnlessPayer$ You
SVar:ManaNeededToAvoidNegativeEffect:blue
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/knight_of_the_mists.jpg
End
-Marc
User avatar
moomarc
Pixel Commander
 
Posts: 2091
Joined: 04 Jun 2010, 15:22
Location: Johannesburg, South Africa
Has thanked: 371 times
Been thanked: 372 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 51 guests


Who is online

In total there are 51 users online :: 0 registered, 0 hidden and 51 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 51 guests

Login Form