Adding new cards with Groovy

This is a new series of posts to show how easy it is to add new cards to Magarena. The files listed can be dropped into your Magarena/scripts folder and used right away. Interested to see more examples? Just look at the files in your Magarena/scripts folder.
We begin with two cards that have similar characteristic defining abilities. The card metadata (*.txt) was submitted by Aunukia to our mailing list. The groovy script added later to complete the card.

Reckless One.txt

Soulless_One.txt
We begin with two cards that have similar characteristic defining abilities. The card metadata (*.txt) was submitted by Aunukia to our mailing list. The groovy script added later to complete the card.

Reckless One.txt
- Code: Select all
name=Reckless One
url=http://magiccards.info/evg/en/48.html
image=http://magiccards.info/scans/en/evg/48.jpg
value=3.909
rarity=U
type=Creature
subtype=Goblin,Avatar
cost={3}{R}
ability=haste
timing=fmain
requires_groovy_code
- Code: Select all
[
new MagicCDA() {
@Override
public void modPowerToughness(final MagicGame game,final MagicPlayer player,final MagicPowerToughness pt) {
final int amount =
player.getNrOfPermanentsWithSubType(MagicSubType.Goblin) +
player.getOpponent().getNrOfPermanentsWithSubType(MagicSubType.Goblin);
pt.set(amount,amount);
}
}
]

Soulless_One.txt
- Code: Select all
name=Soulless One
url=http://magiccards.info/pch/en/41.html
image=http://magiccards.info/scans/en/pch/41.jpg
value=4.329
rarity=U
type=Creature
subtype=Zombie,Avatar
cost={3}{B}
timing=main
requires_groovy_code
- Code: Select all
[
new MagicCDA() {
@Override
public void modPowerToughness(final MagicGame game,final MagicPlayer player,final MagicPowerToughness pt) {
final int battlefield =
player.getNrOfPermanentsWithSubType(MagicSubType.Zombie) +
player.getOpponent().getNrOfPermanentsWithSubType(MagicSubType.Zombie);
final int graveyard =
game.filterCards(player,MagicTargetFilter.TARGET_ZOMBIE_CARD_FROM_GRAVEYARD).size() +
game.filterCards(player.getOpponent(),MagicTargetFilter.TARGET_ZOMBIE_CARD_FROM_GRAVEYARD).size();
final int amount = battlefield + graveyard;
pt.set(amount,amount);
}
}
]