MagicWars 1.2.0 With Script Engine!
Posted: 08 Dec 2009, 17:29
Hi everyone!
I'd like to share with you what's happening with MagicWars and what will appear in new version that comes soon.
Along with many bugs fixes (and for sure new bugs )), MagicWars 1.2.0 will have the following features:
1) Different Printings Support: you can add different versions of the same card (e.g. 2 copies of Shock Tenth Edition and 2 copies from Onslaught set) to your deck and see then in play
2) Script Engine: now you can create your own cards! read about this below
3) Basic AI: once you've added your card, you can try one of three decks to play with
Today I'd like to start cycle of topics here describing what Script Engine is and how to add new cards to MagicWars.
So what does Script Engine mean for players? It means that since now you can add new cards by yourself. No need to wait for new releases just to get to know whether a card you wanted to play so much online was added or not. All you need is just study groovy a little (really easy language) and read future articles. They would explain what should be done to create some specific cards, what API is available and, for sure, will bring some examples of existing cards.
Let's start with card description format today.
Card location
All scripted cards are stored in cards/groovy folders. As there can be too many cards in future, we separated them using first three letters of card names. So "Shock" will be stored in cards/groovy/S/h/o/Shock.card while "Goblin Guide" in cards/groovy/G/o/b/Goblin Guide.card.
We have already generated some cards for you to help you to create magic cards. They are saved in cards/todo/<SET_NAME>. They are not counted as implemented, so to start with you need to copy them from there to cards/groovy folder (with keeping in mind 3 letter structure: S/h/o/Shock).
Card data
Here is the card file for "Shock":
name
card name, nothing special to add here
only is that it should be the same as file name
types
includes card type and its sub types
card types are "Instant", "Sorcery", "Creature", "Artifact", "Planeswalker", "Enchantment", "Land"
sub type are additional info about card type
it may be "Equipment", "Aura", as well as "Merfolk", "Wolf", etc.
manacost
mana symbols devided by spaces and with slash for hybrid, examples:
"0", "2", "B B", "B\R", "3 B R G", "2 G\U"
text
oracle text
it can be used by script so it's better to divide them into several parts
prints
sets where this card was printed
you will see all of them in deck editor and can use any of them in your decks
print entry format:
["set code", "rarity", "multiverseId", "collectorId"]
set code should be official code of a set(you can find it here: http://en.wikipedia.org/wiki/Core_Sets)
rarity: "M","R","U" or "C"
multiverseId comes from gatherer for every card and should be unique even for the same card but from different sets http://gatherer.wizards.com/Pages/Default.aspx
collectorId can also be found in gatherer (it's an ordinal number in the set)
n.b. don't forget to put comma between several prints
script
the most important thing: script by itself
can be empty if card is so called "vanilla creature" - creature with static abilities only
there are also power and toughness for creatures
and not mandatory property color (by default card color is defined by its manacost)
That's it for today!
Finally I will give you an example how to fill data for vanilla creatures:
First opening gatherer Gatherer, type "Sky Ruin Drake" and press "Search"
it will open a card with such url:
http://gatherer.wizards.com/Pages/Card/ ... eid=192211
look at the number at the end, multiveseid, we will use it in prints:
["ZEN", "C", 192211, 66]
where 66 is collector number and can be found at the bottom:
Card #: 66
the final result will look like:
Then start MagicWars and you can try it!
See you
I'd like to share with you what's happening with MagicWars and what will appear in new version that comes soon.
Along with many bugs fixes (and for sure new bugs )), MagicWars 1.2.0 will have the following features:
1) Different Printings Support: you can add different versions of the same card (e.g. 2 copies of Shock Tenth Edition and 2 copies from Onslaught set) to your deck and see then in play
2) Script Engine: now you can create your own cards! read about this below
3) Basic AI: once you've added your card, you can try one of three decks to play with
Today I'd like to start cycle of topics here describing what Script Engine is and how to add new cards to MagicWars.
So what does Script Engine mean for players? It means that since now you can add new cards by yourself. No need to wait for new releases just to get to know whether a card you wanted to play so much online was added or not. All you need is just study groovy a little (really easy language) and read future articles. They would explain what should be done to create some specific cards, what API is available and, for sure, will bring some examples of existing cards.
Let's start with card description format today.
Card location
All scripted cards are stored in cards/groovy folders. As there can be too many cards in future, we separated them using first three letters of card names. So "Shock" will be stored in cards/groovy/S/h/o/Shock.card while "Goblin Guide" in cards/groovy/G/o/b/Goblin Guide.card.
We have already generated some cards for you to help you to create magic cards. They are saved in cards/todo/<SET_NAME>. They are not counted as implemented, so to start with you need to copy them from there to cards/groovy folder (with keeping in mind 3 letter structure: S/h/o/Shock).
Card data
Here is the card file for "Shock":
- Code: Select all
name = "Shock"
types = ["Instant"]
manacost = "R"
text = ["Shock deals 2 damage to target creature or player."]
prints = [
["10E", "C", 129732, 232],
["9ED", "C", 83261, 220],
["8ED", "C", 45352, 222],
["7ED", "C", 13074, 219],
["6ED", "C", 14609, 206],
["STH", "C", 5143, 98],
["BTD", "C", 26645, 45],
["ONS", "C", 39482, 227]
]
script = '''\
addSpell({
dealDamage($target, 2, $this)
})
setTarget("Creature|Player")
'''
name
card name, nothing special to add here
only is that it should be the same as file name
types
includes card type and its sub types
card types are "Instant", "Sorcery", "Creature", "Artifact", "Planeswalker", "Enchantment", "Land"
sub type are additional info about card type
it may be "Equipment", "Aura", as well as "Merfolk", "Wolf", etc.
manacost
mana symbols devided by spaces and with slash for hybrid, examples:
"0", "2", "B B", "B\R", "3 B R G", "2 G\U"
text
oracle text
it can be used by script so it's better to divide them into several parts
- Code: Select all
addAbility({
$player.drawCard()
})
setDescription(text[2])
prints
sets where this card was printed
you will see all of them in deck editor and can use any of them in your decks
print entry format:
["set code", "rarity", "multiverseId", "collectorId"]
set code should be official code of a set(you can find it here: http://en.wikipedia.org/wiki/Core_Sets)
rarity: "M","R","U" or "C"
multiverseId comes from gatherer for every card and should be unique even for the same card but from different sets http://gatherer.wizards.com/Pages/Default.aspx
collectorId can also be found in gatherer (it's an ordinal number in the set)
n.b. don't forget to put comma between several prints
script
the most important thing: script by itself
can be empty if card is so called "vanilla creature" - creature with static abilities only
there are also power and toughness for creatures
and not mandatory property color (by default card color is defined by its manacost)
That's it for today!
Finally I will give you an example how to fill data for vanilla creatures:
First opening gatherer Gatherer, type "Sky Ruin Drake" and press "Search"
it will open a card with such url:
http://gatherer.wizards.com/Pages/Card/ ... eid=192211
look at the number at the end, multiveseid, we will use it in prints:
["ZEN", "C", 192211, 66]
where 66 is collector number and can be found at the bottom:
Card #: 66
the final result will look like:
- Code: Select all
name = "Sky Ruin Drake"
manacost = "4 U"
types = [ "Creature", "Drake" ]
power = 2
toughness = 5
text = ["Flying"]
prints = [
["ZEN", "C", 192211, 66]
]
Then start MagicWars and you can try it!
See you