mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
convert Pestermite to triggers
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -3351,62 +3351,6 @@ public class CardFactory_Creatures {
|
||||
}//*************** 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")) {
|
||||
final SpellAbility ability = new Ability(card, "0") {
|
||||
|
||||
Reference in New Issue
Block a user