convert Pestermite to triggers

This commit is contained in:
jendave
2011-08-06 19:37:13 +00:00
parent 48f5e84d56
commit f97c1e1f11
2 changed files with 3 additions and 57 deletions

View File

@@ -1,10 +1,12 @@
Name:Pestermite
ManaCost:2 U
Types:Creature Faerie Rogue
Text:When CARDNAME enters the battlefield, you may tap or untap target permanent.
Text:no text
PT:2/1
K:Flying
K:Flash
T:Mode$ ChangesZone | ValidCard$ Card.Self | Origin$ Any | Destination$ Battlefield | Execute$ TrigTapOrUntap | Optional$ True | TriggerDescription$ When CARDNAME enters the battlefield, you may tap or untap target permanent.
SVar:TrigTapOrUntap:AB$TapOrUntap | Cost$ 0 | ValidTgts$ Permanent | TgtPrompt$ Select target permanent
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/pestermite.jpg
SetInfo:LRW|Common|http://magiccards.info/scans/en/lw/78.jpg

View File

@@ -3350,62 +3350,6 @@ public class CardFactory_Creatures {
copyTokens1.setStackDescription(sb.toString());
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Pestermite")) {
final SpellAbility ability = new Ability(card, "0") {
@Override
public void resolve() {
Card c = getTargetCard();
if(AllZone.GameAction.isCardInPlay(c) && CardFactoryUtil.canTarget(card, c)) {
if(c.isTapped()) c.untap();
else c.tap();
}
}
};
Command intoPlay = new Command() {
private static final long serialVersionUID = 5202575895575352408L;
public void execute() {
CardList all = AllZoneUtil.getCardsInPlay();
CardList hum = AllZoneUtil.getPlayerCardsInPlay(AllZone.HumanPlayer);
if(all.size() != 0) {
if(card.getController().isHuman()) {
AllZone.InputControl.setInput(CardFactoryUtil.input_targetSpecific(ability, all,
"Select target permanent to tap/untap.", true, false));
ButtonUtil.enableAll();
} else {
Card human = CardFactoryUtil.AI_getBestCreature(hum);
ability.setTargetCard(human);
AllZone.Stack.add(ability);
}
}
}//execute()
};//Command
card.addComesIntoPlayCommand(intoPlay);
card.clearSpellAbility();
card.addSpellAbility(new Spell_Permanent(card) {
private static final long serialVersionUID = -3055232264358172133L;
@Override
public boolean canPlayAI() {
CardList list = CardFactoryUtil.AI_getHumanCreature(card, true);
list = list.filter(new CardListFilter() {
public boolean addCard(Card c) {
return c.isUntapped();
}
});
return (list.size() > 0) && AllZone.getZone(getSourceCard()).is(Constant.Zone.Hand);
}
});
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Mystic Snake")) {