sneak attack

here's some working sneak code. is this the proper place to post card code? or should i just submit it via svn in the future?
cards.txt
cards.txt
- Code: Select all
Sneak Attack
3 R
Enchantment
R: Put a creature from your into play. It has haste. Sacrafice it at the end of turn.
- Code: Select all
//******************START SNEAK ATTACK**************************888
else if (cardName.equals("Sneak Attack"))
{
final CardList SneakCards = new CardList();
final Command sneak = new Command()
{
private static final long serialVersionUID = 4511445425867383367L;
public void execute()
{
if(AllZone.GameAction.isCardInPlay(card))
{
//put cards removed by Necropotence into player's hand
if(SneakCards.size() > 0){
GameAction ga = new GameAction();
for(int i = 0;i<SneakCards.size();i++){
Card c = SneakCards.get(i);
if (ga.isCardInPlay(c)){
ga.sacrifice(c); // change to AllZone.GameAction.sacrifice(c); ??
}
}
SneakCards.clear();
}
}
}
};
final SpellAbility ability = new Ability(card, "R")
{
private static final long serialVersionUID = 4414609319033894302L;
public void resolve()
{
Card c = getTargetCard();
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController());
PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController());
if(AllZone.GameAction.isCardInZone(c, hand))
{
hand.remove(c);
play.add(c);
SneakCards.add(c);
c.addIntrinsicKeyword("Haste"); //give c haste
AllZone.EndOfTurn.addAt(sneak);
}
}
};
ability.setBeforePayMana(new Input()
{
private static final long serialVersionUID = -1647181037510967127L;
public void showMessage()
{
String controller = card.getController();
CardList creats = new CardList(AllZone.getZone(Constant.Zone.Hand, controller).getCards());
creats = creats.filter(new CardListFilter()
{
public boolean addCard(Card c)
{
PlayerZone zone = AllZone.getZone(c);
return c.isCreature() && zone.is(Constant.Zone.Hand);
}
});
stopSetNext(CardFactoryUtil.input_targetSpecific(ability, creats, "Select a creature", false, false));
}
});
card.addSpellAbility(ability);
}//*************** END ************ END **************************SNEAK ATTACK