From 47af1efc0cfc629d618cf9e96f061411f57fdce4 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 15:25:58 +0000 Subject: [PATCH] - Convert Archon of Justice and Wort, Boggart Auntie to Trigger --- res/cardsfolder/archon_of_justice.txt | 4 +- res/cardsfolder/wort_boggart_auntie.txt | 2 + src/forge/CardFactory_Creatures.java | 62 +------------------------ src/forge/GameActionUtil.java | 48 ------------------- 4 files changed, 6 insertions(+), 110 deletions(-) diff --git a/res/cardsfolder/archon_of_justice.txt b/res/cardsfolder/archon_of_justice.txt index 13b2d25c440..db397259c61 100644 --- a/res/cardsfolder/archon_of_justice.txt +++ b/res/cardsfolder/archon_of_justice.txt @@ -1,7 +1,9 @@ Name:Archon of Justice ManaCost:3 W W Types:Creature Archon -Text:When Archon of Justice is put into a graveyard from the battlefield, exile target permanent. +Text:no text +T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ TrigChange | TriggerDescription$ When Archon of Justice is put into a graveyard from the battlefield, exile target permanent. +SVar:TrigChange:AB$ChangeZone | Cost$ 0 | ValidTgts$ Permanent | Origin$ Battlefield | Destination$ Exile PT:4/4 K:Flying SVar:Rarity:Rare diff --git a/res/cardsfolder/wort_boggart_auntie.txt b/res/cardsfolder/wort_boggart_auntie.txt index 078a5ea87d3..6fc99c48678 100644 --- a/res/cardsfolder/wort_boggart_auntie.txt +++ b/res/cardsfolder/wort_boggart_auntie.txt @@ -4,6 +4,8 @@ Types:Legendary Creature Goblin Shaman Text:At the beginning of your upkeep, you may return target Goblin card from your graveyard to your hand. PT:3/3 K:Fear +T:Mode$ Phase | Phase$ Upkeep | Player$ You | Execute$ TrigChangeZone | Optional$ True | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your upkeep, you may return target Goblin card from your graveyard to your hand. +SVar:TrigChangeZone:AB$ChangeZone | Cost$ 0 | Origin$ Graveyard | Destination$ Hand | TgtPrompt$ Choose target Goblin card in your graveyard | ValidTgts$ Goblin.YouCtrl SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/wort_boggart_auntie.jpg SetInfo:LRW|Rare|http://magiccards.info/scans/en/lw/252.jpg diff --git a/src/forge/CardFactory_Creatures.java b/src/forge/CardFactory_Creatures.java index cea777b7f61..c1f50cf3614 100644 --- a/src/forge/CardFactory_Creatures.java +++ b/src/forge/CardFactory_Creatures.java @@ -6115,67 +6115,7 @@ public class CardFactory_Creatures { };//Command card.addComesIntoPlayCommand(intoPlay); }//*************** END ************ END ************************** - - - //*************** START *********** START ************************** - else if(cardName.equals("Archon of Justice")) { - final SpellAbility ability = new Ability(card, "0") { - @Override - public void resolve() { - if(getTargetCard() != null) { - if(AllZone.GameAction.isCardInPlay(getTargetCard()) - && CardFactoryUtil.canTarget(card, getTargetCard())) { - AllZone.GameAction.exile(getTargetCard()); - } - } - } - }; - ability.setStackDescription("Archon of Justice - Exile target permanent."); - - Command leavesPlay = new Command() { - private static final long serialVersionUID = 7552566264976488465L; - - public void execute() { - if(card.getController().equals(AllZone.HumanPlayer)) AllZone.InputControl.setInput(CardFactoryUtil.input_targetPermanent(ability)); - else { - /* - * if computer controlled Archon of Justice have it select the best creature, or enchantment, - * or artifact, whatever the human controllers, and as a last option a card it controls. - */ - Card temp; - - CardList human_list = new CardList(AllZone.Human_Battlefield.getCards()); - human_list.remove("Mana Pool"); - temp = CardFactoryUtil.AI_getBestCreature(human_list); - if(temp != null) ability.setTargetCard(CardFactoryUtil.AI_getBestCreature(human_list)); - if(ability.getTargetCard() == null) { - temp = CardFactoryUtil.AI_getBestEnchantment(human_list, card, false); - if(temp != null) ability.setTargetCard(CardFactoryUtil.AI_getBestEnchantment( - human_list, card, true)); - } - if(ability.getTargetCard() == null) { - temp = CardFactoryUtil.AI_getBestArtifact(human_list); - if(temp != null) ability.setTargetCard(CardFactoryUtil.AI_getBestArtifact(human_list)); - } - if(ability.getTargetCard() == null) { - if(human_list.size() == 0) { - CardList computer_list = new CardList(AllZone.Computer_Battlefield.getCards()); - if(computer_list.size() == 0) { - return; //we have nothing in play to destroy. - } else { - ability.setTargetCard(computer_list.get(0)); //should determine the worst card to destroy, but this case wont be hit much. - } - } - ability.setTargetCard(human_list.get(0)); - } - AllZone.Stack.add(ability); - } - }//execute() - };//Command - card.addDestroyCommand(leavesPlay); - }//*************** END ************ END ************************** - - + //*************** START *********** START ************************** else if(cardName.equals("Knight of the White Orchid")) { final Ability ability = new Ability(card, "0") { diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index 4583315ae3b..3c756ebfbfd 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -67,7 +67,6 @@ public class GameActionUtil { upkeep_Festering_Wound_Counter(); upkeep_Festering_Wound_Damage(); upkeep_Greener_Pastures(); - upkeep_Wort(); upkeep_Squee(); upkeep_Sporesower_Thallid(); upkeep_Dragonmaster_Outcast(); @@ -9183,53 +9182,6 @@ public class GameActionUtil { } // if creatures > 0 } // reya - private static void upkeep_Wort() { - final Player player = AllZone.Phase.getPlayerTurn(); - PlayerZone playZone = AllZone.getZone(Constant.Zone.Battlefield, player); - PlayerZone graveyard = AllZone.getZone(Constant.Zone.Graveyard, player); - - CardList creatures = new CardList(graveyard.getCards()); - creatures = creatures.getType("Goblin"); - - CardList list = new CardList(playZone.getCards()); - list = list.getName("Wort, Boggart Auntie"); - - if(creatures.size() > 0 && list.size() > 0) { - Ability ability = new Ability(list.get(0), "0") { - @Override - public void resolve() { - PlayerZone graveyard = AllZone.getZone(Constant.Zone.Graveyard, player); - PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, player); - - CardList creatures = new CardList(graveyard.getCards()); - creatures = creatures.getType("Goblin"); - - if(player.equals(AllZone.HumanPlayer)) { - Object o = GuiUtils.getChoiceOptional("Pick a goblin to put into your hand", - creatures.toArray()); - if(o != null) { - Card card = (Card) o; - graveyard.remove(card); - hand.add(card); - } - } else if(player.equals(AllZone.ComputerPlayer)) { - Card card = creatures.get(0); - graveyard.remove(card); - hand.add(card); - - } - } - - };// Ability - - StringBuilder sb = new StringBuilder(); - sb.append("Wort returns creature from graveyard to ").append(player).append("'s hand"); - ability.setStackDescription(sb.toString()); - - AllZone.Stack.add(ability); - } // if creatures > 0 - } // Wort - private static void upkeep_Nether_Spirit() { final Player player = AllZone.Phase.getPlayerTurn(); final PlayerZone graveyard = AllZone.getZone(Constant.Zone.Graveyard, player);