Card Development Questions
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
Re: Card Development Questions
by jmartus » 07 Feb 2012, 04:55
yay thanks guys for adding Rathi Dragon one of my favorite cards
Re: Card Development Questions
by moomarc » 07 Feb 2012, 16:37
Would Overabundance be too unfair to the AI at present? Otherwise easy enough to script.
-Marc
-

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
by squee1968 » 07 Feb 2012, 19:34
On a similar note, would this script for Megatherium be unfair to the AI? Maybe someone could add an SVar Mana needed.
- Code: Select all
Name:Megatherium
ManaCost:2 G
Types:Creature Beast
Text:no text
PT:4/4
K:Trample
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigSac | TriggerDescription$ When CARDNAME enters the battlefield, sacrifice it unless you pay {1} for each card in your hand.
SVar:TrigSac:AB$Sacrifice | Cost$ 0 | Defined$ Self | UnlessCost$ X | UnlessPayer$ You
SVar:X:Count$InYourHand
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/megatherium.jpg
SetInfo:MMQ|Rare|http://magiccards.info/scans/mm/en/259.jpg
Oracle:Trample\nWhen Megatherium enters the battlefield, sacrifice it unless you pay {1} for each card in your hand.
End
Re: Card Development Questions
by jeffwadsworth » 07 Feb 2012, 20:08
It is quite different from those. This is a mana cost, those are non-mana.squee1968 wrote:On a similar note, would this script for Megatherium be unfair to the AI? Maybe someone could add an SVar Mana needed.I swear that I had this card scripted before I saw Sloth's flurry of "sacrifice unless" cards.
- Code: Select all
Name:Megatherium
ManaCost:2 G
Types:Creature Beast
Text:no text
PT:4/4
K:Trample
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigSac | TriggerDescription$ When CARDNAME enters the battlefield, sacrifice it unless you pay {1} for each card in your hand.
SVar:TrigSac:AB$Sacrifice | Cost$ 0 | Defined$ Self | UnlessCost$ X | UnlessPayer$ You
SVar:X:Count$InYourHand
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/megatherium.jpg
SetInfo:MMQ|Rare|http://magiccards.info/scans/mm/en/259.jpg
Oracle:Trample\nWhen Megatherium enters the battlefield, sacrifice it unless you pay {1} for each card in your hand.
End
- 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
by Sloth » 07 Feb 2012, 20:36
The AI could kill itself for some unimportant spell, so i would say too unfair.moomarc wrote:Would Overabundance be too unfair to the AI at present? Otherwise easy enough to script.
You have to differentiate between cards only the human can use and cards that force the AI to play differently (which it mostly can't).squee1968 wrote:On a similar note, would this script for Megatherium be unfair to the AI? Maybe someone could add an SVar Mana needed.
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Card Development Questions
by jeffwadsworth » 07 Feb 2012, 23:45
Testing Sedris, the Traitor King. The keyword Unearth:2 B shows up on the creature cards, but the flashback window is clear. Does anyone see a problem with the script?
- | Open
- Name:Sedris, the Traitor King
ManaCost:3 U B R
Types:Legendary Creature Zombie Warrior
Text:no text
PT:5/5
S:Mode$ Continuous | Affected$ Creature.YouCtrl | AffectedZone$ Graveyard | EffectZone$ Battlefield | AddKeyword$ Unearth:2 B | Description$ Each creature card in your graveyard has unearth 2 B.
SVar:Rarity:Mythic
SVar:Picture:http://www.wizards.com/global/images/magic/general/sedris_the_traitor_king.jpg
End
- 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
by friarsol » 08 Feb 2012, 03:45
Isn't Unearth one of those keywords that are pre-parsed? If so, granting Unearth wouldn't really do anything.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Development Questions
by jeffwadsworth » 08 Feb 2012, 21:29
If the Discard AbilityFactory had "Optional$" we could trample foes with Lim-Dul's Paladin.
- | Open
- Name:Lim-Dul's Paladin
ManaCost:2 B R
Types:Creature Human Knight
Text:no text
PT:0/3
K:Trample
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigDiscard | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your upkeep, you may discard a card. If you don't, sacrifice CARDNAME and draw a card. Whenever CARDNAME becomes blocked, it gets +6/+3 until end of turn. Whenever CARDNAME attacks and isn't blocked, it assigns no combat damage to defending player this turn and that player loses 4 life.
SVar:TrigDiscard:AB$ Discard | Cost$ 0 | NumCards$ 1 | Mode$ TgtChoose | Optional$ True | RememberDiscarded$ True | SubAbility$ DBSacrifice
SVar:DBSacrifice:DB$ Sacrifice | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ0 | SubAbility$ DBDraw
SVar:DBDraw:DB$ Draw | NumCards$ 1 | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ0 | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
T:Mode$ Blocks | ValidCard$ Creature | ValidBlocked$ Card.Self | TriggerZones$ Battlefield | Execute$ TrigBlockedPump | TriggerDescription$ Whenever CARDNAME becomes blocked by a creature, CARDNAME get +6/+3 until end of turn.
SVar:TrigBlockedPump:AB$Pump | Cost$ 0 | Defined$ Self | NumAtt$ 6 | NumDef$ 3
T:Mode$ AttackerUnblocked | ValidCard$ Card.Self | Execute$ TrigUnBlockedPump | TriggerZones$ Battlefield | TriggerDescription$ Whenever CARDNAME attacks and isn't blocked, it assigns no combat damage to defending player this turn and that player loses 4 life.
SVar:TrigUnBlockedPump:AB$ Pump | Cost$ 0 | KW$ HIDDEN Prevent all combat damage that would be dealt by CARDNAME. | SubAbility$ DBLoseLife
SVar:DBLoseLife:DB$ LoseLife | Defined$ Opponent | LifeAmount$ 4
SVar:X:Remembered$Amount
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/lim_duls_paladin.jpg
End
- 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
by jeffwadsworth » 09 Feb 2012, 16:36
While testing Entrails Feaster, I noticed that a ChangeZone Origin$ Graveyard ChangeType$ Creature will only access your graveyard. Is there any technique that would allow it to access both graveyards?
- | Open
- Name:Entrails Feaster
ManaCost:B
Types:Creature Zombie Cat
Text:no text
PT:1/1
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigExile | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your upkeep, you may exile a creature card from a graveyard. If you do, put a +1/+1 counter on CARDNAME. If you don't, tap CARDNAME.
SVar:TrigExile:AB$ ChangeZone | Cost$ 0 | ChangeType$ Creature | ChangeNum$ 1 | Origin$ Graveyard | Destination$ Exile | Optional$ True | IsCurse$ True | RememberChanged$ True | Hidden$ True | Chooser$ You | SubAbility$ DBPutCounter
SVar:DBPutCounter:DB$ PutCounter | CounterType$ P1P1 | ConditionCheckSVar$ X | ConditionSVarCompare$ GE1 | SubAbility$ DBTap
SVar:DBTap:DB$ Tap | ConditionCheckSVar$ X | ConditionSVarCompare$ LE0 | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:X:Remembered$Amount
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/entrails_feaster.jpg
End
- 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
by ArsenalNut » 09 Feb 2012, 16:52
Look at the Cemetery Reaper script, it uses a similar mechanic.jeffwadsworth wrote:While testing Entrails Feaster, I noticed that a ChangeZone Origin$ Graveyard ChangeType$ Creature will only access your graveyard. Is there any technique that would allow it to access both graveyards?
- | Open
- Name:Entrails Feaster
ManaCost:B
Types:Creature Zombie Cat
Text:no text
PT:1/1
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigExile | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your upkeep, you may exile a creature card from a graveyard. If you do, put a +1/+1 counter on CARDNAME. If you don't, tap CARDNAME.
SVar:TrigExile:AB$ ChangeZone | Cost$ 0 | ChangeType$ Creature | ChangeNum$ 1 | Origin$ Graveyard | Destination$ Exile | Optional$ True | IsCurse$ True | RememberChanged$ True | Hidden$ True | Chooser$ You | SubAbility$ DBPutCounter
SVar:DBPutCounter:DB$ PutCounter | CounterType$ P1P1 | ConditionCheckSVar$ X | ConditionSVarCompare$ GE1 | SubAbility$ DBTap
SVar:DBTap:DB$ Tap | ConditionCheckSVar$ X | ConditionSVarCompare$ LE0 | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:X:Remembered$Amount
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/entrails_feaster.jpg
End
So many cards, so little time
-

ArsenalNut - Posts: 512
- Joined: 08 Jul 2011, 03:49
- Has thanked: 27 times
- Been thanked: 121 times
Re: Card Development Questions
by jeffwadsworth » 09 Feb 2012, 16:56
No, that is a targeted card.ArsenalNut wrote:Look at the Cemetery Reaper script, it uses a similar mechanic.jeffwadsworth wrote:While testing Entrails Feaster, I noticed that a ChangeZone Origin$ Graveyard ChangeType$ Creature will only access your graveyard. Is there any technique that would allow it to access both graveyards?
- | Open
- Name:Entrails Feaster
ManaCost:B
Types:Creature Zombie Cat
Text:no text
PT:1/1
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigExile | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your upkeep, you may exile a creature card from a graveyard. If you do, put a +1/+1 counter on CARDNAME. If you don't, tap CARDNAME.
SVar:TrigExile:AB$ ChangeZone | Cost$ 0 | ChangeType$ Creature | ChangeNum$ 1 | Origin$ Graveyard | Destination$ Exile | Optional$ True | IsCurse$ True | RememberChanged$ True | Hidden$ True | Chooser$ You | SubAbility$ DBPutCounter
SVar:DBPutCounter:DB$ PutCounter | CounterType$ P1P1 | ConditionCheckSVar$ X | ConditionSVarCompare$ GE1 | SubAbility$ DBTap
SVar:DBTap:DB$ Tap | ConditionCheckSVar$ X | ConditionSVarCompare$ LE0 | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:X:Remembered$Amount
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/entrails_feaster.jpg
End
- 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
by jeffwadsworth » 09 Feb 2012, 23:01
Testing Mindblaze. Does anyone see any issues with this script? It produces a "Defined" null error within the AB DealDamage. If TargetedPlayer is used for the Defined, it does not give an error, but damage is not dealt.
- | Open
- Name:Mindblaze
ManaCost:5 R
Types:Sorcery
Text:no text
A:SP$ NameCard | Cost$ 5 R | ValidCards$ Card.nonLand | ValidDesc$ nonland | SubAbility$ DBChooseNumber | SpellDescription$ Name a nonland card and choose a number greater than 0. Target player reveals his or her library. If that library contains exactly the chosen number of the named card, CARDNAME deals 8 damage to that player. Then that player shuffles his or her library.
SVar:DBChooseNumber:DB$ ChooseNumber | Min$ 1 | SubAbility$ DBDig
SVar:DBDig:DB$ Dig | DigNum$ X | ValidTgts$ Player | TgtPrompt$ Select target player | Reveal$ True | NoMove$ True | RememberRevealed$ True | DestinationZone$ Library | LibraryPosition$ 0 | LibraryPosition2$ 0 | SubAbility$ DBDamage
SVar:DBDamage:DB$ DealDamage | NumDmg$ 8 | Defined$ Targeted | ConditionCheckSVar$ Y | ConditionSVarCompare$ EQZ | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:X:TargetedPlayer$CardsInLibrary
SVar:Y:Remembered$Valid Card.NamedCard
SVar:Z:Number$ChosenNumber
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/mindblaze.jpg
End
- 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
by ArsenalNut » 10 Feb 2012, 06:18
I added some null pointer checks in r13931 that fix the problem with "Defined$ Targeted". Also TargetedPlayer didn't work because its not a supported keyword in the getDefinedPlayers method.jeffwadsworth wrote:Testing Mindblaze. Does anyone see any issues with this script? It produces a "Defined" null error within the AB DealDamage. If TargetedPlayer is used for the Defined, it does not give an error, but damage is not dealt.
- | Open
- Name:Mindblaze
ManaCost:5 R
Types:Sorcery
Text:no text
A:SP$ NameCard | Cost$ 5 R | ValidCards$ Card.nonLand | ValidDesc$ nonland | SubAbility$ DBChooseNumber | SpellDescription$ Name a nonland card and choose a number greater than 0. Target player reveals his or her library. If that library contains exactly the chosen number of the named card, CARDNAME deals 8 damage to that player. Then that player shuffles his or her library.
SVar:DBChooseNumber:DB$ ChooseNumber | Min$ 1 | SubAbility$ DBDig
SVar:DBDig:DB$ Dig | DigNum$ X | ValidTgts$ Player | TgtPrompt$ Select target player | Reveal$ True | NoMove$ True | RememberRevealed$ True | DestinationZone$ Library | LibraryPosition$ 0 | LibraryPosition2$ 0 | SubAbility$ DBDamage
SVar:DBDamage:DB$ DealDamage | NumDmg$ 8 | Defined$ Targeted | ConditionCheckSVar$ Y | ConditionSVarCompare$ EQZ | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:X:TargetedPlayer$CardsInLibrary
SVar:Y:Remembered$Valid Card.NamedCard
SVar:Z:Number$ChosenNumber
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/mindblaze.jpg
End
So many cards, so little time
-

ArsenalNut - Posts: 512
- Joined: 08 Jul 2011, 03:49
- Has thanked: 27 times
- Been thanked: 121 times
Re: Card Development Questions
by moomarc » 10 Feb 2012, 13:51
Just scripted Soulblast, but for some reason it deals twice the damage it's supposed to. Can anyone see the problem?
- Code: Select all
Name:Soulblast
ManaCost:3 R R R
Types:Instant
Text:no text
A:SP$ DealDamage | Cost$ 3 R R R Sac<All/Creature> | NumDmg$ X | Tgt$ TgtCP | CostDesc$ As an additional cost to cast CARDNAME, sacrifice all creatures you control. | SpellDescription$ CARDNAME deals damage to target creature or player equal to the total power of the sacrificed creatures.
SVar:X:Sacrificed$CardPower
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/soulblast.jpg
SetInfo:CHK|Rare|http://magiccards.info/scans/en/chk/190.jpg
SetInfo:10E|Rare|http://magiccards.info/scans/en/10e/236.jpg
Oracle:As an additional cost to cast Soulblast, sacrifice all creatures you control.\nSoulblast deals damage to target creature or player equal to the total power of the sacrificed creatures.
End
-Marc
-

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
by Sloth » 10 Feb 2012, 15:24
I think i've found and fixed the problem. Please try again.moomarc wrote:Just scripted Soulblast, but for some reason it deals twice the damage it's supposed to. Can anyone see the problem?
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Who is online
Users browsing this forum: No registered users and 23 guests