It is currently 16 Sep 2025, 22:51
   
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 moomarc » 06 Feb 2013, 12:27

moomarc wrote:What needs to happen to make keywords in CardFactoryUtil.parseKeywords pumpable? I'm specifically looking at Unearth (for Sedris, the Traitor King) and Devour (for the Jund plane).
Okay, I worked out that Sedris could be done with this script:
Code: Select all
S:Mode$ Continuous | EffectZone$ Battlefield | AffectedZone$ Graveyard | Affected$ Creature.YouCtrl | AddAbility$ Unearth | AddSVar$ Unearthed | Description$ Each creature card in your graveyard has unearth 2 B. (2 B: Return the card to the battlefield. The creature gains haste. Exile it at the beginning of the next end step or if it would leave the battlefield. Unearth only as a sorcery.)
SVar:Unearth:AB$ ChangeZone | Cost$ 2 B | Defined$ Self | Origin$ Graveyard | Destination$ Battlefield | SorcerySpeed$ True | ActivationZone$ Graveyard | SubAbility$ Unearthed | PrecostDesc$ Unearth | CostDesc$ 2 B | StackDescription$ Unearth: Return CARDNAME to the battlefield. | SpellDescription$ (2 B: Return CARDNAME to the battlefield. It gains haste. Exile it at the beginning of the next end step or if it would leave the battlefield. Unearth only as a sorcery.)
SVar:Unearthed:DB$ Pump | Defined$ Self | KW$ Haste & HIDDEN At the beginning of the end step, exile CARDNAME. & HIDDEN If CARDNAME would leave the battlefield, exile it instead of putting it anywhere else. | Permanent$ True | StackDescription$ It gains haste. Exile it at the beginning of the next end step or if it would leave the battlefield.
There's two issues though, neither specific to this implementation. Firstly, the exile at the beginning of the next end step trigger can't be Stifle 'd. This seems to be a proplem with this keyword in general though. So I scripted the effect as a triggered ability which is when I came across the second issue: if it does get countered, this keyword needs to be removed. Is there any way to go about this? And is this situation handled by the unearth keyword? Perhaps I should add an Unearth$True param to pump that sets the card as unearthed (c.setUnearthed(true)). Nevermind, that would only affect the leaves play replacement which is already handled.

Edit: For the end step trigger, we probably need to have some sort of run once trigger parameter. Once it hits the stack the trigger won't run again until the card changes zones. Then if the trigger is countered or the turn ended while it's on the stack, things would function properly afterwards.

Edit 2: I see that Unearth uses the same keyword to exile at EOT, so this should handle the same way as existing unearth cards at least. I'll commit as per the above script.
-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 » 06 Feb 2013, 13:05

moomarc wrote:Still not entirely sure why, seeing as getDefenderPlayerByAttacker should return the controller of a card if it is the attacked entity. Oh well, was a simple fix anyway.
I think because it says Player.getDefenderPlayerByAttacker. So that first Player is filtering out cards.
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 » 06 Feb 2013, 13:09

friarsol wrote:
moomarc wrote:Still not entirely sure why, seeing as getDefenderPlayerByAttacker should return the controller of a card if it is the attacked entity. Oh well, was a simple fix anyway.
I think because it says Player.getDefenderPlayerByAttacker. So that first Player is filtering out cards.
That would probably be it #-o :D
-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 » 06 Feb 2013, 13:38

I've improved the script for Sedris. The "exile at the beginning of the next end step" is handled with a delayed trigger and now interacts correctly with Stifle, Sundial of the Infinite etc. Only question I have is, would the "HIDDEN If CARDNAME would leave the battlefield, exile it instead..." keyword is suseptible in it's current form, to being removed by ability clearing cards? If so I'll have to add an unearth param to Pump. Should I convert Unearth to use a macro script based on this?
-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 Rooger » 07 Feb 2013, 17:32

is it possible to code Sewer Nemesis? I'm trying to build a deck with this but i can't seem to make it work correctly. here is the code i tested with bits from other cards (mostly some tweaks on Entropic Specter)

Code: Select all
Name:Sewer Nemesis
ManaCost:3 B
Types:Creature Horror
Text:no text
PT:*/*
K:ETBReplacement:Other:ChooseP
SVar:ChooseP:DB$ ChoosePlayer | Defined$ You | Choices$ Player.Opponent | AILogic$ Curse | SpellDescription$ As CARDNAME enters the battlefield, choose an opponent.
S:Mode$ Continuous | EffectZone$ All | CharacteristicDefining$ True | SetPower$ X | SetToughness$ X | Description$ CARDNAME's power and toughness are each equal to the number of cards in the chosen player's graveyard.
SVar:X:Count$InChosenYard
T:Mode$ SpellCast | ValidActivatingPlayer$ Opponent | ValidTarget$ Opponent  | Execute$ TrigDiscard | TriggerZones$ Battlefield | TriggerDescription$ Whenever the chosen player casts a spell, that player puts the top card of his or her library into his or her graveyard.
SVar:TrigDiscard:AB$ Discard | Cost$ 0 | Defined$ TriggeredTarget | NumCards$ 1 | Mode$ TgtChoose
SVar:Rarity:Rare
Oracle:As Sewer Nemesis enters the battlefield, choose a player.\nSewer Nemesis's power and toughness are each equal to the number of cards in the chosen player's graveyard.\nWhenever the chosen player casts a spell, that player puts the top card of his or her library into his or her graveyard.
End
i never coded a card and i'm just starting to, so there are some mistakes i made. for instance this card should target a player (me included) but it just allows me to target opponents (apparently Entropic Specter works the same way, so i'm guessing that it could be a feature not implemented yet, i don't know), even thou it recognizes their graveyard and sets the power and toughness accordingly.the second part of the card is broken, when the player casts a spell it prompts me that it's going to discard a card but nothing happens...are someone works on this card that can help me, programmin is really not my thing hehe i'm more a graphics guy and btw i'm working on a skin liliana theme that when it's finished i will gladly share it, see if you guys apreciate my work has much has i apreciate yours, forge f*** rullez ahah
Rooger
 
Posts: 88
Joined: 06 Jan 2013, 06:59
Has thanked: 44 times
Been thanked: 35 times

Re: Card Development Questions

Postby moomarc » 07 Feb 2013, 18:06

Rooger wrote:is it possible to code Sewer Nemesis? I'm trying to build a deck with this but i can't seem to make it work correctly. here is the code i tested with bits from other cards (mostly some tweaks on Entropic Specter)

Code: Select all
Name:Sewer Nemesis
ManaCost:3 B
Types:Creature Horror
Text:no text
PT:*/*
K:ETBReplacement:Other:ChooseP
SVar:ChooseP:DB$ ChoosePlayer | Defined$ You | Choices$ Player.Opponent | AILogic$ Curse | SpellDescription$ As CARDNAME enters the battlefield, choose an opponent.
S:Mode$ Continuous | EffectZone$ All | CharacteristicDefining$ True | SetPower$ X | SetToughness$ X | Description$ CARDNAME's power and toughness are each equal to the number of cards in the chosen player's graveyard.
SVar:X:Count$InChosenYard
T:Mode$ SpellCast | ValidActivatingPlayer$ Opponent | ValidTarget$ Opponent  | Execute$ TrigDiscard | TriggerZones$ Battlefield | TriggerDescription$ Whenever the chosen player casts a spell, that player puts the top card of his or her library into his or her graveyard.
SVar:TrigDiscard:AB$ Discard | Cost$ 0 | Defined$ TriggeredTarget | NumCards$ 1 | Mode$ TgtChoose
SVar:Rarity:Rare
Oracle:As Sewer Nemesis enters the battlefield, choose a player.\nSewer Nemesis's power and toughness are each equal to the number of cards in the chosen player's graveyard.\nWhenever the chosen player casts a spell, that player puts the top card of his or her library into his or her graveyard.
End
i never coded a card and i'm just starting to, so there are some mistakes i made. for instance this card should target a player (me included) but it just allows me to target opponents (apparently Entropic Specter works the same way, so i'm guessing that it could be a feature not implemented yet, i don't know), even thou it recognizes their graveyard and sets the power and toughness accordingly.the second part of the card is broken, when the player casts a spell it prompts me that it's going to discard a card but nothing happens...are someone works on this card that can help me
You were closer than you think. There is no targeting involved (the card text specifically says "target" when one is needed. You just had a few small problems with the SpellCast trigger and then the subability should mill the card from the top of the chosen player's library, not make them discard. The correct portion of the script is:
Code: Select all
T:Mode$ SpellCast | ValidCard$ Card | ValidActivatingPlayer$ Player.Chosen | Execute$ TrigMill | TriggerZones$ Battlefield | TriggerDescription$ Whenever the chosen player casts a spell, that player puts the top card of his or her library into his or her graveyard.
SVar:TrigMill:AB$ Mill | Cost$ 0 | Defined$ TriggeredPlayer | NumCards$ 1
I've committed your code to the repository. Thanks!

Rooger wrote:programmin is really not my thing hehe i'm more a graphics guy and btw i'm working on a skin liliana theme that when it's finished i will gladly share it, see if you guys apreciate my work has much has i apreciate yours, forge f*** rullez ahah
I'm also more a graphics guy, but Forge pulled me in; first with the scripting API, then eventually a little java too. Additional skins would be greatly appreciated though. I haven't made the time to make a new one for a 'while' 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 Rooger » 07 Feb 2013, 19:05

Ah I see, i'm going to test your code now, i was a bit confused because i didn't really understand what was going wrong with the target because i didn't knew about the mill svar hehe noob speaking right here :lol:

I'm starting the same path you went, i'm messing around with the game files see what i can do and improve to my knowledge (wich isn't really that great but i'm learning, i'm learning hehe) i've managed to include in the database one of the duel decks sets, the two decks of divine vs demonic, i know it's just the same cards printed for a different set with a couple of them with new artwork but i guess that it could be some cool additions to the precon decks available to buy in the bazaar, i'm planning to implement a few more.

Ok i tested it and it works perfectly at least in the game i played, the thing now is that if i want to choose myself as the player to mill the cards? is that possible in the engine?

EDIT: well i don't know if thats the right solution but i found a way to choose me as the player to mill, in the svar:choosep options the propriety Choices$ must be Player.Player instead of player.opponent, so the code for the card is:

Code: Select all
Name:Sewer Nemesis
ManaCost:3 B
Types:Creature Horror
Text:no text
PT:*/*
K:ETBReplacement:Other:ChooseP
SVar:ChooseP:DB$ ChoosePlayer | Defined$ You | Choices$ Player.Player | AILogic$ Curse | SpellDescription$ As CARDNAME enters the battlefield, choose an opponent.
S:Mode$ Continuous | EffectZone$ All | CharacteristicDefining$ True | SetPower$ X | SetToughness$ X | Description$ CARDNAME's power and toughness are each equal to the number of cards in the chosen player's graveyard.
SVar:X:Count$InChosenYard
T:Mode$ SpellCast | ValidCard$ Card | ValidActivatingPlayer$ Player.Chosen | Execute$ TrigMill | TriggerZones$ Battlefield | TriggerDescription$ Whenever the chosen player casts a spell, that player puts the top card of his or her library into his or her graveyard.
SVar:TrigMill:AB$ Mill | Cost$ 0 | Defined$ TriggeredPlayer | NumCards$ 1
SVar:Rarity:Rare
SVar:Picture:*****************
SetInfo:COM|Rare|******************
Oracle:As Sewer Nemesis enters the battlefield, choose a player.\nSewer Nemesis's power and toughness are each equal to the number of cards in the chosen player's graveyard.\nWhenever the chosen player casts a spell, that player puts the top card of his or her library into his or her graveyard.
End
it's missing the image links because of the spam protection but thats easy to get any way :P
Last edited by Rooger on 07 Feb 2013, 19:20, edited 1 time in total.
Rooger
 
Posts: 88
Joined: 06 Jan 2013, 06:59
Has thanked: 44 times
Been thanked: 35 times

Re: Card Development Questions

Postby moomarc » 07 Feb 2013, 19:19

Oops, I just didn't read the card properly. You just need to change ChoosePlayer to Player instead of Player.Opponent (Opponent filters the valid players you can choose from). You should check out the Card Scripting API in the Forge wiki in conjunction with looking at existing scripts to understand it better. Anyway, I'll fix the script in the morning.
-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 Rooger » 07 Feb 2013, 19:25

Perfect timing ahah, yes i will read it prehaps i can contribute with more cards in the future, this is one hell of peice of software i'm glad i can contribute in any way. Thanks again for the help ;)

EDIT: ok one more card, i think that this one isn't that hard to code but there is a bit of code that i'm not getting right. it's Protean Hulk, it's really similar with Fierce Empath, except that you can choose any number of creatures with the total converted mana cost between them instead of just one this is the code i have right now, it works to the point where you choose the creatures, the game only filters the creatures with 6 mana cost and i can only choose one of them, it's possible to have some kind of cumulative mana cost between the chosen creatures from the library?

Code: Select all
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature.Self | Execute$ TrigChange | OptionalDecider$ You | TriggerDescription$ When CARDNAME dies, search your library for any number of creature cards with total converted mana cost 6 or less and put them onto the battlefield. Then shuffle your library.
SVar:TrigChange:AB$ChangeZone | Cost$ 0 | Origin$ Library | Destination$ Battlefield | ChangeType$ Creature.cmcGE6 | ChangeNum$ 1
Rooger
 
Posts: 88
Joined: 06 Jan 2013, 06:59
Has thanked: 44 times
Been thanked: 35 times

Re: Card Development Questions

Postby swordshine » 08 Feb 2013, 15:26

Protean Hulk need check the remaining cmc during the loop, I think I figured it out. Another card, Flash, which can make combos with Protean Hulk, I don't know how to do it. ToT
swordshine
 
Posts: 682
Joined: 11 Jul 2010, 02:37
Has thanked: 116 times
Been thanked: 87 times

Re: Card Development Questions

Postby friarsol » 08 Feb 2013, 16:51

swordshine wrote:Protean Hulk need check the remaining cmc during the loop, I think I figured it out. Another card, Flash, which can make combos with Protean Hulk, I don't know how to do it. ToT
I'm not sure if there's a way to do UnlessCost$ RememberedCastingCost and reduce that by two colorless. Sloth may know.
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 » 08 Feb 2013, 19:13

friarsol wrote:I'm not sure if there's a way to do UnlessCost$ RememberedCastingCost and reduce that by two colorless. Sloth may know.
There isn't anything like that yet. I will take a look at implementing Flash.
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 Rooger » 08 Feb 2013, 22:10

swordshine wrote:Protean Hulk need check the remaining cmc during the loop, I think I figured it out. Another card, Flash, which can make combos with Protean Hulk, I don't know how to do it. ToT
That's a good combo, Flash would be a nice addition to the database, casting one or more creatures with a total mana cost of 6 for just 1U is sweet, I can't code it thou but good luck to all that are trying ;)
Rooger
 
Posts: 88
Joined: 06 Jan 2013, 06:59
Has thanked: 44 times
Been thanked: 35 times

Re: Card Development Questions

Postby friarsol » 09 Feb 2013, 18:45

I'm trying to convert the Tribelands (like Ancient Amphitheater) to ETBReplacement, but it doesn't seem to work (or it gets wiped by something else?) When I play Vesuva on that land, the Vesuva doesn't give me input box and enters play tapped. When I play the Amphitheater nothing pops up and the land is untapped.

If anyone wants to fiddle with it feel free:

Tribelands | Open
Name:Ancient Amphitheater
ManaCost:no cost
Types:Land
Text:no text
K:ETBReplacement:Other:RevealOrTapped
SVar:RevealOrTapped:DB$ Tap | Defined$ Self | UnlessCost$ Reveal<1/Card.Giant> | SpellDescription$ As CARDNAME enters the battlefield, you may reveal a Giant card from your hand. If you don't, CARDNAME enters the battlefield tapped.
A:AB$ Mana | Cost$ T | Produced$ R | SpellDescription$ Add R to your mana pool.
A:AB$ Mana | Cost$ T | Produced$ W | SpellDescription$ Add W to your mana pool.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/ancient_amphitheater.jpg
SetInfo:LRW|Rare|http://magiccards.info/scans/en/lw/266.jpg
Oracle:As Ancient Amphitheater enters the battlefield, you may reveal a Giant card from your hand. If you don't, Ancient Amphitheater enters the battlefield tapped.\n{T}: Add {R} or {W} to your mana pool.
End
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 » 09 Feb 2013, 18:53

I'm not booted up or anything so can't test, but don't you just need to add an UnlessPayer$You parameter? Maybe it defaults to the opponent?
-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 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