Cromat

Finally got Cromat coded
. Spent a bunch of the time hunting a bug in the last ability... here's the code:
Now it's back in/to the mana pool for me
.

- Code: Select all
Cromat
W U B R G
Legendary Creature Illusion
no text
5/5
KPump U R:Flying
RegenerateMe:B G
PTPump R W:+1/+1
- Code: Select all
if (cardName.equals("Cromat")){
//LibBounce Ability
final Ability a1 = new Ability(card, "G U")
{
public boolean canPlayAI() {return false;}
public void resolve()
{
if(AllZone.GameAction.isCardInPlay(card) )
{
card.setBaseAttack(5);
card.setBaseDefense(5);
card.setAssignedDamage(0);
card.setDamage(0);
card.untap();
AllZone.getZone(card).remove(card);
//put card on top of library
PlayerZone library = AllZone.getZone(Constant.Zone.Library, card.getOwner());
library.add(card, 0);
}
}//resolve()
};//SpellAbility
Input runtime1 = new Input()
{
private static final long serialVersionUID = 1469011418219527227L;
public void showMessage()
{
a1.setStackDescription("Put " +card +" on top of its owner's library");
stopSetNext(new Input_PayManaCost(a1));
}
};
a1.setDescription("G U: Put Cromat on top of its owner's library.");
a1.setStackDescription("Put Cromat on top of its owner's library.");
card.addSpellAbility(a1);
a1.setBeforePayMana(runtime1);
//Kill ability
final Ability a2 = new Ability(card, "W B"){
public boolean canPlay()
{
return (AllZone.GameAction.isCardInPlay(card) && (AllZone.Combat.isBlocked(card) || AllZone.Combat.getAllBlockers().contains(card)));
}
public boolean canPlayAI()
{
return false;
//TODO
}
public void resolve()
{
AllZone.GameAction.destroy(getTargetCard());
}//resolve()
};
Input runtime2 = new Input()
{
/**
*
*/
private static final long serialVersionUID = 1L;
public void showMessage()
{
CardList targets = new CardList();
if(AllZone.Combat.isBlocked(card) || AllZone.Combat.getAllBlockers().contains(card)){
if (AllZone.Combat.isBlocked(card)){ targets = AllZone.Combat.getBlockers(card); }
else {
targets = new CardList();
for (Card c : AllZone.Combat.getAttackers()){
if (AllZone.Combat.isBlocked(c))
if (AllZone.Combat.getBlockers(c).contains(card)) targets.add(c);
}
}
}
stopSetNext(CardFactoryUtil.input_targetSpecific(a2, targets, "Select target blocking or blocked by Cromat.", true));
}
};
card.addSpellAbility(a2);
a2.setBeforePayMana(runtime2);
a2.setDescription("W B: Destroy target creature blocking or blocked by Cromat.");
}
Now it's back in/to the mana pool for me
