Page 1 of 1

Card scripting question about Parapet

PostPosted: 28 Mar 2011, 18:58
by mtgrares
I received the email message below about a guy trying to implement Parapet. It is an unusual card since it is an enchantment which can also be played like an instant.

My name is Leonardo and I discovered Forge a few days ago. I'm a big free
software supporter and I'm glad to have found a way to play MTG from my
GNU/Linux box and I'm glad that your software is free as in freedom.

I hadn't played MTG in quite a while. When I was trying to rebuild my old
white deck I found out that some cards were missing and I wanted to add them.
One that's giving me a little problem is Parapet, from Visions [0].
This card is an enchantment that gives +0/+1 to all creatures you control. The
particularity of this card is that it can be played as an instant and buried
at the end of turn. That's what's giving me problems.
Reading other cards I found a way to make Parapet be a +0/+1 enchantment for
all the creatures I control, but I couldn't find a way to also make it work as
an instant.
I know about the Flash ability, but that's for creatures and they aren't sent
to the graveyard at the end of the turn as with Parapet.

Is there any way to implement this particular thing?

Here's what I have so far for Parapet:

Name:Parapet
ManaCost:1 W
Types:Enchantment
K:stPumpAll:Creature.YouCtrl:0/1:You may choose to play Parapet as an instant;
if you do, bury it at the end of turn. All creates you control get +0/+1.
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/parapet.jpg
SetInfo:WTH|Common|http://magiccards.info/scans/en/vi/114.jpg
End

That's all for now. I should mention that your game has made me very happy.

Regards,
Leonardo

Re: Card scripting question about Parapet

PostPosted: 28 Mar 2011, 19:19
by Hellfish
Always good to see people enjoying Forge. You should invite him to the forums.

Unfortunately, unusual cards with unusual mechanics like this are rarely 100% scriptable.Pretty sure it can be done hardcoded already, though, meaning there is no special situation that will occur and break things.

Re: Card scripting question about Parapet

PostPosted: 28 Mar 2011, 19:59
by leorockway
Hellfish wrote:Always good to see people enjoying Forge. You should invite him to the forums.
He linked me to this thread, so here I am. =]

Hellfish wrote:Unfortunately, unusual cards with unusual mechanics like this are rarely 100% scriptable.Pretty sure it can be done hardcoded already, though, meaning there is no special situation that will occur and break things.
Thanks for your answer. Hardcoded how? Does that mean writing Java (I don't speak Java and it's not really in my plans to learn it).

I was thinking that once I understand more about card scripting I could make a little app (in Python) so people can point and click to create new cards.

Re: Card scripting question about Parapet

PostPosted: 28 Mar 2011, 20:09
by Hellfish
Hehe, Welcome! :)
Yes, I meant writing java code for it. Don't get me wrong, we've made great strides in what can be accomplished in script alone, but knowing and reacting how and when a card was played is not one of those things. You can still help even without knowing java, check out The Wiki for a rundown of what you CAN do in script. And of course ask around the forums, there's usually someone around who can answer questions and fix found bugs. :)

Re: Card scripting question about Parapet

PostPosted: 28 Mar 2011, 20:29
by leorockway
I had already been reading the wiki, thank you. Reading other existing cards helps too.
The thing is that I haven't played MTG in years (Tempest was brand new when I stopped playing) so I need to reacquaint myself with all the cards and find out about all the new stuff. It should be fun, but I don't have a lot of free time available to do that, so my progress will be slow.

Re: Card scripting question about Parapet

PostPosted: 28 Mar 2011, 20:30
by Chris H.
There might still be a few hundred cards or so that are candidates for implementing via scripting. Check out the forge wiki, read the topic about keywords and look for examples among the implemented cards.

I have a few hard coded cards that I would like to try to convert over to script. I also have some maintenance work to do and that will keep me busy for a few more weeks.

Jeff may still be helping to add new cards via script and I am sure that he could use a hand. A new set of eyes and a fresh mind can help to find the cards that other people have overlooked. :)

Re: Card scripting question about Parapet

PostPosted: 28 Mar 2011, 21:32
by friarsol
Leonardo, I played back then as well and IIRC there were at least 10 cards that had similar, "Flash but sacrifice EOT if you played it as an instant" which is probably enough to write a Keyword for it. We probably wouldn't want the AI using that function, but the actual code shouldn't be too difficult. On resolution, if the casting player can't cast a sorcery (!canCastSorcery()) then we could add the appropriate delayed trigger. I'm not sure how quickly someone will want to do that, if you aren't interested in learning the bloated language of Java.

But as the otehrs said, always good to have more hands helping out, and any tools you want to write will be welcome.