Firemox uses XML to represent cards which is much better than using Java itself. On the plus side XML is usually shorter than Java and allows non-programmers to help. Using an "in-between" language like XML allows the programmer greater freedom when changing the code. For example, the damage code could be changed for all of the cards simultaneously because the damage code for each card is generated "on the fly" from the XML.
On the negative side, it hard to create XML code or any "do it yourself" language that is very flexible. The Firemox XML code below has a "colors" property which simply states the color of the card. Usually a card's color is determined by its mana cost but there are a few cards like Transguild Courier that are the exception.
I would hate to have to create an XML schema for Magic cards because it would be a very hard task. It would literally take weeks if not months. I'm sure that many hours of work was spent creating Firemox's XML language.
p.s. When I use the phrase "in-between" or "do it yourself" language, I'm talking about a problem domain language that only applies to a specific problem, like controlling a robot.
Firemox - Royal Assassin
<card>
<rules-author-comment>By fabdouglas</rules-author-comment>
<init>
<registers>
<register index="colorless" value="1"/>
<register index="black" value="2"/>
<register index="power" value="1"/>
<register index="toughness" value="1"/>
</registers>
<colors>black</colors>
<idcards>creature </idcards>
<properties>assassin</properties>
</init>
<abilities>
<ability ref="cast-spell"/>
<activated-ability playable="instant" name="" zone="play">
<cost>
<action ref="T"/>
<action ref="target-creature">
<test>
<in-zone zone="playANDtapped"/>
</test>
</action>
</cost>
<effects>
<action ref="destroy"/>
</effects>
</activated-ability>
</abilities>
Firemox - Shock
<card>
<rules-author-comment>riclas</rules-author-comment>
<init>
<registers>
<register index='red' value='1'/>
</registers>
<colors>red </colors>
<idcards>instant </idcards>
</init>
<abilities>
<activated-ability playable='this' name='' zone='hand'>
<cost>
<pay-mana value='manacost'/>
<action ref='target-dealtable'/>
</cost>
<effects>
<assign-damage value='2' type='damage-normal'/>
<action ref='finish-spell'/>
</effects>
</activated-ability>
</abilities>
</card>
I remember I tried Firemox a year and half ago, but it was tooo slow even when playing on localhost (so it was not because of inet traffic problems) ;(
ReplyDeletehave anybody else tried it?
I haven't tried Firemox, I just ran it to see if it worked.
ReplyDelete