New card
Hello.
I am beginner Java programmer.
I write one card`s code.
Add to cards.txt

I hope my code is correct.
If this code is right, please add it to project.
I am beginner Java programmer.
I write one card`s code.
Add to cards.txt
- Code: Select all
Acolyte of Xathrid
B
Creature Human Cleric
no text
0/1
- Code: Select all
//*************** START *********** START **************************
else if(cardName.equals("Acolyte of Xathrid"))
{
final SpellAbility ability = new Ability_Tap(card, "1 B")
{
private static final long serialVersionUID = -560200331236516099L;
public void resolve()
{
String opponent = AllZone.GameAction.getOpponent(card.getController());
AllZone.GameAction.getPlayerLife(opponent).subtractLife(1);
}
public boolean canPlayAI()
{
//computer should play ability if this creature doesn't attack
Combat c = ComputerUtil.getAttackers();
CardList list = new CardList(c.getAttackers());
//could this creature attack?, if attacks, do not use ability
return (! list.contains(card));
}
};//SpellAbility
card.addSpellAbility(ability);
ability.setDescription("1 B, tap: Target player loses 1 life.");
ability.setStackDescription(card.getName() + " - Opponent loses 1 life.");
}//*************** END ************ END **************************

I hope my code is correct.
If this code is right, please add it to project.

