convert Wren's Run Packmaster to Champion keyword and AB$Token

This commit is contained in:
jendave
2011-08-06 13:58:02 +00:00
parent f8a19bf01d
commit 3a42097836
2 changed files with 2 additions and 162 deletions

View File

@@ -4,7 +4,8 @@ Types:Creature Elf Warrior
Text:Champion an Elf (When this enters the battlefield, sacrifice it unless you exile another Elf you control. When this leaves the battlefield, that card returns to the battlefield.)
PT:5/5
K:stPumpAll:Wolf.YouCtrl:0/0/Deathtouch:No Condition:Each Wolf you control has deathtouch. (Any amount of damage it deals to a creature is enough to destroy that creature.)
SVar:RemAIDeck:True
K:Champion:Elf
A:AB$Token | Cost$ 2 G | TokenAmount$ 1 | TokenName$ Wolf | TokenTypes$ Creature,Wolf | TokenOwner$ Controller | TokenColors$ Green | TokenPower$ 2 | TokenToughness$ 2 | SpellDescription$ Put a 2/2 green Wolf creature token onto the battlefield.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/wrens_run_packmaster.jpg
SetInfo:LRW|Rare|http://magiccards.info/scans/en/lw/244.jpg

View File

@@ -3676,167 +3676,6 @@ public class CardFactory_Creatures {
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Wren's Run Packmaster")) {
final CommandReturn getCreature = new CommandReturn() {
public Object execute() {
//get all creatures
CardList list = new CardList();
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
list.addAll(play.getCards());
list = list.filter(new CardListFilter() {
public boolean addCard(Card c) {
return c.getType().contains("Elf") || c.getKeyword().contains("Changeling");
}
});
return list;
}
};//CommandReturn
final SpellAbility abilityComes = new Ability(card, "0") {
@Override
public void resolve() {
if(getTargetCard() == null || getTargetCard() == card) AllZone.GameAction.sacrifice(card);
else if(AllZone.GameAction.isCardInPlay(getTargetCard())) {
AllZone.GameAction.exile(getTargetCard());
}
}//resolve()
};
final Input inputComes = new Input() {
private static final long serialVersionUID = 5210700665533271691L;
@Override
public void showMessage() {
CardList choice = (CardList) getCreature.execute();
stopSetNext(CardFactoryUtil.input_targetChampionSac(card, abilityComes, choice,
"Select Elf to remove from the game", false, false));
ButtonUtil.disableAll(); //target this card means: sacrifice this card
}
};
Command commandComes = new Command() {
private static final long serialVersionUID = -3580408066322945328L;
public void execute() {
CardList creature = (CardList) getCreature.execute();
Player s = card.getController();
if(creature.size() == 0) {
AllZone.GameAction.sacrifice(card);
return;
} else if(s.equals(AllZone.HumanPlayer)) AllZone.InputControl.setInput(inputComes);
else //computer
{
Card target;
//must target computer creature
CardList computer = new CardList(AllZone.Computer_Battlefield.getCards());
computer = computer.getType("Elf");
computer.remove(card);
computer.shuffle();
if(computer.size() != 0) {
target = computer.get(0);
abilityComes.setTargetCard(target);
AllZone.Stack.add(abilityComes);
}
else
AllZone.GameAction.sacrifice(card);
}//computer
}//execute()
};//CommandComes
Command commandLeavesPlay = new Command() {
private static final long serialVersionUID = -5903638227914705191L;
public void execute() {
//System.out.println(abilityComes.getTargetCard().getName());
Object o = abilityComes.getTargetCard();
if(o == null || ((Card) o).isToken() || !AllZone.GameAction.isCardExiled((Card) o)) return;
SpellAbility ability = new Ability(card, "0") {
@Override
public void resolve() {
//copy card to reset card attributes like attack and defense
Card c = abilityComes.getTargetCard();
if(!c.isToken()) {
c = AllZone.CardFactory.copyCard(c);
c.setController(c.getOwner());
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, c.getOwner());
PlayerZone removed = AllZone.getZone(Constant.Zone.Exile, c.getOwner());
removed.remove(c);
play.add(c);
}
}//resolve()
};//SpellAbility
StringBuilder sb = new StringBuilder();
sb.append(card.getName()).append(" - returning creature to play");
ability.setStackDescription(sb.toString());
AllZone.Stack.add(ability);
}//execute()
};//Command
final SpellAbility a1 = new Ability(card, "2 G") {
@Override
public boolean canPlayAI() {
return MyRandom.random.nextBoolean();
}
@Override
public boolean canPlay() {
SpellAbility sa;
//this is a hack, check the stack to see if this card has an ability on the stack
//if so, we can't use the ability
for(int i = 0; i < AllZone.Stack.size(); i++) {
sa = AllZone.Stack.peek(i);
if(sa.getSourceCard().equals(card)) return false;
}
return AllZone.GameAction.isCardInPlay(card) && super.canPlay();
}
@Override
public void resolve() {
CardFactoryUtil.makeToken("Wolf", "G 2 2 Wolf", card.getController(), "G", new String[] {"Creature", "Wolf"},
2, 2, new String[] {""});
}
};//SpellAbility
a1.setDescription("2 G: Put a 2/2 green Wolf creature token into play.");
a1.setStackDescription("Put a 2/2 Wolf into play.");
card.clearSpellAbility();
card.addComesIntoPlayCommand(commandComes);
card.addLeavesPlayCommand(commandLeavesPlay);
card.addSpellAbility(new Spell_Permanent(card) {
private static final long serialVersionUID = 2583297503017070549L;
@Override
public boolean canPlayAI() {
Object o = getCreature.execute();
if(o == null) return false;
CardList cl = (CardList) getCreature.execute();
return (o != null) && cl.size() > 0 && AllZone.getZone(getSourceCard()).is(Constant.Zone.Hand);
}
});
card.addSpellAbility(a1);
a1.setBeforePayMana(new Input_PayManaCost(a1));
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Faceless Butcher")) {
final CommandReturn getCreature = new CommandReturn() {