Re: Programming a card
Looking at Treetop village i decided to rewrite it's code for other living lands that aren't implemented yet.
1. Should i add "c.setManaCost("R")" string to give a colour to creatures ?
2. Should i change serialVersionUID?
If the code is right, i'll write it for other living lands.
Ghitu Encampment
1. Should i add "c.setManaCost("R")" string to give a colour to creatures ?
2. Should i change serialVersionUID?
If the code is right, i'll write it for other living lands.
Ghitu Encampment
- Code: Select all
Cardfactory_Lands.java
else if(cardName.equals("Ghitu Encampment"))
{
card.addComesIntoPlayCommand(new Command()
{
private static final long serialVersionUID = -2246560994818997231L;
public void execute()
{
card.tap();
}
});
final Command eot1 = new Command()
{
private static final long serialVersionUID = -8535770979347971863L;
public void execute()
{
Card c = card;
c.setBaseAttack(0);
c.setBaseDefense(0);
c.removeType("Creature");
c.removeType("Warrior");
c.removeIntrinsicKeyword("First Strike");
}
};
final SpellAbility a1 = new Ability(card, "1 R")
{
public boolean canPlayAI()
{
return ! card.getType().contains("Creature");
}
public void resolve()
{
Card c = card;
c.setBaseAttack(2);
c.setBaseDefense(1);
//to prevent like duplication like "Creature Creature"
if(! c.getIntrinsicKeyword().contains("First Strike"))
{
c.addType("Creature");
c.addType("Warrior");
c.addIntrinsicKeyword("First Strike");
}
AllZone.EndOfTurn.addUntil(eot1);
}
};//SpellAbility
card.clearSpellKeepManaAbility();
card.addSpellAbility(a1);
a1.setStackDescription(card +" becomes a 2/1 creature with first strike until EOT");
Command paid1 = new Command() {
private static final long serialVersionUID = -6800983290478844750L;
public void execute() {AllZone.Stack.add(a1);}
};
a1.setBeforePayMana(new Input_PayManaCost_Ability(a1.getManaCost(), paid1));
================================================================================================
cards.txt:
Ghitu Encampment
R
Land
Ghitu Encampment comes into play tapped. 1R: Ghitu Encampment becomes a 2/1 red Warrior creature with first strike until end of turn. It's still a land.
tap: add R
=================================================================================================
cards_pictures.txt:
ghitu_encampment.jpg http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=106564
