- Convert Harbingers to Trigger

- Warning/moveTo cleanups
This commit is contained in:
jendave
2011-08-06 15:45:58 +00:00
parent a8f8d9d53c
commit f9ae144448
19 changed files with 62 additions and 506 deletions

View File

@@ -1,8 +1,10 @@
Name:Boggart Harbinger
ManaCost:2 B
Types:Creature Goblin Shaman
Text:When Boggart Harbinger enters the battlefield, you may search your library for a Goblin card, reveal it, then shuffle your library and put that card on top of it.
Text:no text
PT:2/1
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | TriggerZones$ Battlefield | Execute$ TrigChange | TriggerDescription$ When CARDNAME enters the battlefield, you may search your library for a Goblin card, reveal it, then shuffle your library and put that card on top of it.
SVar:TrigChange:AB$ChangeZone | Cost$ 0 | Origin$ Library | Destination$ Library | LibraryPosition$ 0 | ChangeType$ Goblin | ChangeNum$ 1
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/boggart_harbinger.jpg
SetInfo:LRW|Uncommon|http://magiccards.info/scans/en/lw/102.jpg

View File

@@ -1,13 +1,15 @@
Name:Elvish Harbinger
ManaCost:2 G
Types:Creature Elf Druid
Text:When Elvish Harbinger enters the battlefield, you may search your library for an Elf card, reveal it, then shuffle your library and put that card on top of it.
Text:no text
PT:1/2
A:AB$Mana|Cost$T|Produced$W|SpellDescription$Add W to your mana pool.
A:AB$Mana|Cost$T|Produced$B|SpellDescription$Add B to your mana pool.
A:AB$Mana|Cost$T|Produced$U|SpellDescription$Add U to your mana pool.
A:AB$Mana|Cost$T|Produced$R|SpellDescription$Add R to your mana pool.
A:AB$Mana|Cost$T|Produced$G|SpellDescription$Add G to your mana pool.
A:AB$Mana | Cost$T | Produced$W | SpellDescription$Add W to your mana pool.
A:AB$Mana | Cost$T | Produced$B | SpellDescription$Add B to your mana pool.
A:AB$Mana | Cost$T | Produced$U | SpellDescription$Add U to your mana pool.
A:AB$Mana | Cost$T | Produced$R | SpellDescription$Add R to your mana pool.
A:AB$Mana | Cost$T | Produced$G | SpellDescription$Add G to your mana pool.
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | TriggerZones$ Battlefield | Execute$ TrigChange | TriggerDescription$ When CARDNAME enters the battlefield, you may search your library for an Elf card, reveal it, then shuffle your library and put that card on top of it.
SVar:TrigChange:AB$ChangeZone | Cost$ 0 | Origin$ Library | Destination$ Library | LibraryPosition$ 0 | ChangeType$ Elf | ChangeNum$ 1
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/elvish_harbinger.jpg
SetInfo:LRW|Uncommon|http://magiccards.info/scans/en/lw/207.jpg

View File

@@ -1,10 +1,12 @@
Name:Faerie Harbinger
ManaCost:3 U
Types:Creature Faerie Wizard
Text:When Faerie Harbinger enters the battlefield, you may search your library for a Faerie card, reveal it, then shuffle your library and put that card on top of it.
Text:no text
PT:2/2
K:Flying
K:Flash
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | TriggerZones$ Battlefield | Execute$ TrigChange | TriggerDescription$ When CARDNAME enters the battlefield, you may search your library for a Merfolk card, reveal it, then shuffle your library and put that card on top of it.
SVar:TrigChange:AB$ChangeZone | Cost$ 0 | Origin$ Library | Destination$ Library | LibraryPosition$ 0 | ChangeType$ Merfolk | ChangeNum$ 1
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/faerie_harbinger.jpg
SetInfo:LRW|Uncommon|http://magiccards.info/scans/en/lw/61.jpg

View File

@@ -1,8 +1,10 @@
Name:Flamekin Harbinger
ManaCost:R
Types:Creature Elemental Shaman
Text:When Flamekin Harbinger enters the battlefield, you may search your library for an Elemental card, reveal it, then shuffle your library and put that card on top of it.
Text:no text
PT:1/1
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | TriggerZones$ Battlefield | Execute$ TrigChange | TriggerDescription$ When CARDNAME enters the battlefield, you may search your library for a Elemental card, reveal it, then shuffle your library and put that card on top of it.
SVar:TrigChange:AB$ChangeZone | Cost$ 0 | Origin$ Library | Destination$ Library | LibraryPosition$ 0 | ChangeType$ Elemental | ChangeNum$ 1
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/flamekin_harbinger.jpg
SetInfo:LRW|Uncommon|http://magiccards.info/scans/en/lw/167.jpg

View File

@@ -1,8 +1,10 @@
Name:Giant Harbinger
ManaCost:4 R
Types:Creature Giant
Text:When Giant Harbinger enters the battlefield, you may search your library for a Giant card, reveal it, then shuffle your library and put that card on top of it.
Text:no text
PT:3/4
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | TriggerZones$ Battlefield | Execute$ TrigChange | TriggerDescription$ When CARDNAME enters the battlefield, you may search your library for a Giant card, reveal it, then shuffle your library and put that card on top of it.
SVar:TrigChange:AB$ChangeZone | Cost$ 0 | Origin$ Library | Destination$ Library | LibraryPosition$ 0 | ChangeType$ Giant | ChangeNum$ 1
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/giant_harbinger.jpg
SetInfo:LRW|Uncommon|http://magiccards.info/scans/en/lw/169.jpg

View File

@@ -1,8 +1,10 @@
Name:Kithkin Harbinger
ManaCost:2 W
Types:Creature Kithkin Wizard
Text:When CARDNAME enters the battlefield, you may search your library for a Kithkin card, reveal it, then shuffle your library and put that card on top of it.
Text:no text
PT:1/3
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | TriggerZones$ Battlefield | Execute$ TrigChange | TriggerDescription$ When CARDNAME enters the battlefield, you may search your library for a Goblin card, reveal it, then shuffle your library and put that card on top of it.
SVar:TrigChange:AB$ChangeZone | Cost$ 0 | Origin$ Library | Destination$ Library | LibraryPosition$ 0 | ChangeType$ Kithkin | ChangeNum$ 1
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/kithkin_harbinger.jpg
SetInfo:LRW|Uncommon|http://magiccards.info/scans/en/lw/26.jpg

View File

@@ -1,9 +1,11 @@
Name:Merrow Harbinger
ManaCost:3 U
Types:Creature Merfolk Wizard
Text:When Merrow Harbinger enters the battlefield, you may search your library for a Merfolk card, reveal it, then shuffle your library and put that card on top of it.
Text:no text
PT:2/3
K:Islandwalk
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | TriggerZones$ Battlefield | Execute$ TrigChange | TriggerDescription$ When CARDNAME enters the battlefield, you may search your library for a Merfolk card, reveal it, then shuffle your library and put that card on top of it.
SVar:TrigChange:AB$ChangeZone | Cost$ 0 | Origin$ Library | Destination$ Library | LibraryPosition$ 0 | ChangeType$ Merfolk | ChangeNum$ 1
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/merrow_harbinger.jpg
SetInfo:LRW|Uncommon|http://magiccards.info/scans/en/lw/73.jpg

View File

@@ -1,8 +1,10 @@
Name:Treefolk Harbinger
ManaCost:G
Types:Creature Treefolk Druid
Text:When CARDNAME enters the battlefield, you may search your library for a Treefolk or Forest card, reveal it, then shuffle your library and put that card on top of it.
Text:no text
PT:0/3
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | TriggerZones$ Battlefield | Execute$ TrigChange | TriggerDescription$ When CARDNAME enters the battlefield, you may search your library for a Treefolk or Forest card, reveal it, then shuffle your library and put that card on top of it.
SVar:TrigChange:AB$ChangeZone | Cost$ 0 | Origin$ Library | Destination$ Library | LibraryPosition$ 0 | ChangeType$ Treefolk,Forest | ChangeNum$ 1
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/treefolk_harbinger.jpg
SetInfo:LRW|Uncommon|http://magiccards.info/scans/en/lw/239.jpg

View File

@@ -710,7 +710,6 @@ public class AbilityFactory {
String defined = (def == null) ? "Self" : def;
if (defined.equals("Targeted")){
Target tgt = sa.getTarget();
SpellAbility parent = sa;
do{
parent = ((Ability_Sub)parent).getParent();

View File

@@ -5992,10 +5992,7 @@ public class CardFactory implements NewConstants {
final Ability ability1 = new Ability(card, "0") {
@Override
public void resolve() {
//String player = card.getController();
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, AllZone.HumanPlayer);
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, AllZone.HumanPlayer);
if(hand.size() == 0) return;
@@ -6013,9 +6010,7 @@ public class CardFactory implements NewConstants {
creatures.toArray());
if(o != null) {
Card c = (Card) o;
hand.remove(c);
play.add(c);
c.setSickness(true);
AllZone.Stack.add(c.getSpellPermanent());
}

View File

@@ -968,7 +968,6 @@ public class CardFactoryUtil {
*/
public static SpellAbility ability_Morph_Down(final Card sourceCard) {
final Player player = sourceCard.getController();
final SpellAbility morph_down = new Spell(sourceCard) {
private static final long serialVersionUID = -1438810964807867610L;

View File

@@ -5864,114 +5864,6 @@ public class CardFactory_Creatures {
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Kithkin Harbinger")) {
final SpellAbility ability = new Ability(card, "0") {
@Override
public void resolve() {
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController());
if(AllZone.GameAction.isCardInZone(getTargetCard(), lib)) {
Card c = getTargetCard();
card.getController().shuffle();
lib.remove(c);
lib.add(c, 0);
if (card.getController().isPlayer(AllZone.ComputerPlayer))
GuiUtils.getChoiceOptional(card + " - Computer picked:", c);
}
}//resolve()
};
Command intoPlay = new Command() {
private static final long serialVersionUID = 4022442363194287539L;
public void execute() {
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController());
CardList cards = new CardList(lib.getCards());
CardList kithkin = new CardList();
for(int i = 0; i < cards.size(); i++) {
if(cards.get(i).isType("Kithkin")) {
kithkin.add(cards.get(i));
}
}
Player controller = card.getController();
if(kithkin.size() == 0) return;
if(controller.equals(AllZone.HumanPlayer)) {
Object o = GuiUtils.getChoiceOptional("Select target card", kithkin.toArray());
if(o != null) {
ability.setTargetCard((Card) o);
AllZone.Stack.add(ability);
}
} else //computer
{
kithkin.shuffle();
ability.setTargetCard(kithkin.get(0));
AllZone.Stack.add(ability);
}
}//execute()
};//Command
card.addComesIntoPlayCommand(intoPlay);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Treefolk Harbinger")) {
final SpellAbility ability = new Ability(card, "0") {
@Override
public void resolve() {
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController());
if(AllZone.GameAction.isCardInZone(getTargetCard(), lib)) {
Card c = getTargetCard();
card.getController().shuffle();
lib.remove(c);
lib.add(c, 0);
if (card.getController().isPlayer(AllZone.ComputerPlayer))
GuiUtils.getChoiceOptional(card + " - Computer picked:", c);
}
}//resolve()
};
Command intoPlay = new Command() {
private static final long serialVersionUID = 9170723718484515120L;
public void execute() {
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController());
CardList cards = new CardList(lib.getCards());
CardList treefolkForests = new CardList();
for(int i = 0; i < cards.size(); i++) {
if((cards.get(i).getType().contains("Treefolk") || cards.get(i).getKeyword().contains(
"Changeling"))
|| cards.get(i).getType().contains("Forest")) {
treefolkForests.add(cards.get(i));
}
}
Player controller = card.getController();
if(treefolkForests.size() == 0) return;
if(controller.equals(AllZone.HumanPlayer)) {
Object o = GuiUtils.getChoiceOptional("Select target card",
treefolkForests.toArray());
if(o != null) {
ability.setTargetCard((Card) o);
AllZone.Stack.add(ability);
}
} else //computer
{
treefolkForests.shuffle();
ability.setTargetCard(treefolkForests.get(0));
AllZone.Stack.add(ability);
}
}//execute()
};//Command
card.addComesIntoPlayCommand(intoPlay);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Knight of the White Orchid")) {
final Ability ability = new Ability(card, "0") {
@@ -8431,168 +8323,6 @@ public class CardFactory_Creatures {
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Boggart Harbinger")) {
final SpellAbility ability = new Ability(card, "0") {
@Override
public void resolve() {
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController());
if(AllZone.GameAction.isCardInZone(getTargetCard(), lib)) {
Card c = getTargetCard();
card.getController().shuffle();
lib.remove(c);
lib.add(c, 0);
if (card.getController().isPlayer(AllZone.ComputerPlayer))
GuiUtils.getChoiceOptional(card + " - Computer picked:", c);
}
}//resolve()
};
Command intoPlay = new Command() {
private static final long serialVersionUID = 4022442363194287539L;
public void execute() {
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController());
CardList cards = new CardList(lib.getCards());
CardList goblins = new CardList();
for(int i = 0; i < cards.size(); i++) {
if(cards.get(i).getType().contains("Goblin")
|| cards.get(i).getKeyword().contains("Changeling")) {
goblins.add(cards.get(i));
}
}
Player controller = card.getController();
if(goblins.size() == 0) return;
if(controller.equals(AllZone.HumanPlayer)) {
Object o = GuiUtils.getChoiceOptional("Select target card", goblins.toArray());
if(o != null) {
ability.setTargetCard((Card) o);
AllZone.Stack.add(ability);
}
} else //computer
{
goblins.shuffle();
ability.setTargetCard(goblins.get(0));
AllZone.Stack.add(ability);
}
}//execute()
};//Command
card.addComesIntoPlayCommand(intoPlay);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Merrow Harbinger")) {
final SpellAbility ability = new Ability(card, "0") {
@Override
public void resolve() {
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController());
if(AllZone.GameAction.isCardInZone(getTargetCard(), lib)) {
Card c = getTargetCard();
card.getController().shuffle();
lib.remove(c);
lib.add(c, 0);
if (card.getController().isPlayer(AllZone.ComputerPlayer))
GuiUtils.getChoiceOptional(card + " - Computer picked:", c);
}
}//resolve()
};
Command intoPlay = new Command() {
private static final long serialVersionUID = 4022442363194287539L;
public void execute() {
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController());
CardList cards = new CardList(lib.getCards());
CardList merfolk = new CardList();
for(int i = 0; i < cards.size(); i++) {
if(cards.get(i).getType().contains("Merfolk")
|| cards.get(i).getKeyword().contains("Changeling")) {
merfolk.add(cards.get(i));
}
}
Player controller = card.getController();
if(merfolk.size() == 0) return;
if(controller.equals(AllZone.HumanPlayer)) {
Object o = GuiUtils.getChoiceOptional("Select target card", merfolk.toArray());
if(o != null) {
ability.setTargetCard((Card) o);
AllZone.Stack.add(ability);
}
} else //computer
{
merfolk.shuffle();
ability.setTargetCard(merfolk.get(0));
AllZone.Stack.add(ability);
}
}//execute()
};//Command
card.addComesIntoPlayCommand(intoPlay);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Elvish Harbinger")) {
final SpellAbility ability = new Ability(card, "0") {
@Override
public void resolve() {
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController());
if(AllZone.GameAction.isCardInZone(getTargetCard(), lib)) {
Card c = getTargetCard();
card.getController().shuffle();
lib.remove(c);
lib.add(c, 0);
if (card.getController().isPlayer(AllZone.ComputerPlayer))
GuiUtils.getChoiceOptional(card + " - Computer picked:", c);
}
}//resolve()
};
Command intoPlay = new Command() {
private static final long serialVersionUID = 4022442363194287539L;
public void execute() {
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController());
CardList cards = new CardList(lib.getCards());
CardList elves = new CardList();
for(int i = 0; i < cards.size(); i++) {
if(cards.get(i).getType().contains("Elf")
|| cards.get(i).getKeyword().contains("Changeling")) {
elves.add(cards.get(i));
}
}
Player controller = card.getController();
if(elves.size() == 0) return;
if(controller.equals(AllZone.HumanPlayer)) {
Object o = GuiUtils.getChoiceOptional("Select target card", elves.toArray());
if(o != null) {
ability.setTargetCard((Card) o);
AllZone.Stack.add(ability);
}
} else //computer
{
elves.shuffle();
ability.setTargetCard(elves.get(0));
AllZone.Stack.add(ability);
}
}//execute()
};//Command
card.addComesIntoPlayCommand(intoPlay);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Vendilion Clique")) {
final SpellAbility ability = new Ability(card, "0") {
@@ -8652,169 +8382,6 @@ public class CardFactory_Creatures {
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Faerie Harbinger")) {
final SpellAbility ability = new Ability(card, "0") {
@Override
public void resolve() {
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController());
if(AllZone.GameAction.isCardInZone(getTargetCard(), lib)) {
Card c = getTargetCard();
card.getController().shuffle();
lib.remove(c);
lib.add(c, 0);
if (card.getController().isPlayer(AllZone.ComputerPlayer))
GuiUtils.getChoiceOptional(card + " - Computer picked:", c);
}
}//resolve()
};
Command intoPlay = new Command() {
private static final long serialVersionUID = -708639335039567945L;
public void execute() {
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController());
CardList cards = new CardList(lib.getCards());
CardList faeries = new CardList();
for(int i = 0; i < cards.size(); i++) {
if(cards.get(i).getType().contains("Faerie")
|| cards.get(i).getKeyword().contains("Changeling")) {
faeries.add(cards.get(i));
}
}
Player controller = card.getController();
if(faeries.size() == 0) return;
if(controller.equals(AllZone.HumanPlayer)) {
Object o = GuiUtils.getChoiceOptional("Select target card", faeries.toArray());
if(o != null) {
ability.setTargetCard((Card) o);
AllZone.Stack.add(ability);
}
} else //computer
{
faeries.shuffle();
ability.setTargetCard(faeries.get(0));
AllZone.Stack.add(ability);
}
}//execute()
};//Command
card.addComesIntoPlayCommand(intoPlay);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Flamekin Harbinger")) {
final SpellAbility ability = new Ability(card, "0") {
@Override
public void resolve() {
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController());
if(AllZone.GameAction.isCardInZone(getTargetCard(), lib)) {
Card c = getTargetCard();
card.getController().shuffle();
lib.remove(c);
lib.add(c, 0);
if (card.getController().isPlayer(AllZone.ComputerPlayer))
GuiUtils.getChoiceOptional(card + " - Computer picked:", c);
}
}//resolve()
};
Command intoPlay = new Command() {
private static final long serialVersionUID = 7114265436722599216L;
public void execute() {
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController());
CardList cards = new CardList(lib.getCards());
CardList ele = new CardList();
for(int i = 0; i < cards.size(); i++) {
if(cards.get(i).getType().contains("Elemental")
|| cards.get(i).getKeyword().contains("Changeling")) {
ele.add(cards.get(i));
}
}
Player controller = card.getController();
if(ele.size() == 0) return;
if(controller.equals(AllZone.HumanPlayer)) {
Object o = GuiUtils.getChoiceOptional("Select target card", ele.toArray());
if(o != null) {
ability.setTargetCard((Card) o);
AllZone.Stack.add(ability);
}
} else //computer
{
ele.shuffle();
ability.setTargetCard(ele.get(0));
AllZone.Stack.add(ability);
}
}//execute()
};//Command
card.addComesIntoPlayCommand(intoPlay);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Giant Harbinger")) {
final SpellAbility ability = new Ability(card, "0") {
@Override
public void resolve() {
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController());
if(AllZone.GameAction.isCardInZone(getTargetCard(), lib)) {
Card c = getTargetCard();
card.getController().shuffle();
lib.remove(c);
lib.add(c, 0);
if (card.getController().isPlayer(AllZone.ComputerPlayer))
GuiUtils.getChoiceOptional(card + " - Computer picked:", c);
}
}//resolve()
};
Command intoPlay = new Command() {
private static final long serialVersionUID = -2671592749882297551L;
public void execute() {
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController());
CardList cards = new CardList(lib.getCards());
CardList giants = new CardList();
for(int i = 0; i < cards.size(); i++) {
if(cards.get(i).getType().contains("Giant")
|| cards.get(i).getKeyword().contains("Changeling")) {
giants.add(cards.get(i));
}
}
Player controller = card.getController();
if(giants.size() == 0) return;
if(controller.equals(AllZone.HumanPlayer)) {
Object o = GuiUtils.getChoiceOptional("Select target card", giants.toArray());
if(o != null) {
ability.setTargetCard((Card) o);
AllZone.Stack.add(ability);
}
} else //computer
{
giants.shuffle();
ability.setTargetCard(giants.get(0));
AllZone.Stack.add(ability);
}
}//execute()
};//Command
card.addComesIntoPlayCommand(intoPlay);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Kor Cartographer")) {
final Ability ab1 = new Ability(card, "no cost") {

View File

@@ -1630,7 +1630,6 @@ class CardFactory_Planeswalkers {
public void humanResolve() {
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, AllZone.HumanPlayer);
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, AllZone.HumanPlayer);
CardList putOnTop = new CardList(hand.getCards());

View File

@@ -2430,19 +2430,14 @@ public class CardFactory_Sorceries {
}//computerResolve()
public void resolve(Card selectedCard) {
Player opponent = card.getController().getOpponent();
PlayerZone library = AllZone.getZone(Constant.Zone.Library, opponent);
Player opponent = card.getController().getOpponent();
Card c = selectedCard;
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
//need to set controller before adding it to "play"
c.setController(card.getController());
c.setSickness(true);
library.remove(c);
play.add(c);
AllZone.GameAction.moveToPlay(c, card.getController());
opponent.shuffle();
}//resolve()

View File

@@ -2,7 +2,6 @@ package forge;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
public class ComputerUtil

View File

@@ -223,6 +223,11 @@ public class GameAction {
return moveTo(play, c);
}
public Card moveToPlay(Card c, Player p) {
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, p);
return moveTo(play, c);
}
public Card moveToBottomOfLibrary(Card c) {
return moveToLibrary(c, -1);
}

View File

@@ -4071,23 +4071,20 @@ public class GameActionUtil {
@Override
public void resolve() {
// should check if Genesis is still there
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, player);
PlayerZone graveyard = AllZone.getZone(Constant.Zone.Graveyard, player);
if(player.equals(AllZone.HumanPlayer) && grave.size() > 0) {
CardList creatures = AllZoneUtil.getPlayerGraveyard(player);
creatures = creatures.filter(creatureFilter);
Object creatureChoice = GuiUtils.getChoice("Creature to move to hand", creatures.toArray());
Card creatureCard = (Card) creatureChoice;
graveyard.remove(creatureCard);
hand.add(creatureCard);
;
AllZone.GameAction.moveToHand(creatureCard);
//}//end choice="Yes"
}
else{ //computer resolve
CardList compCreatures = AllZoneUtil.getPlayerGraveyard(player);
compCreatures = compCreatures.filter(creatureFilter);
Card target = CardFactoryUtil.AI_getBestCreature(compCreatures);
graveyard.remove(target);
hand.add(target);
AllZone.GameAction.moveToHand(target);
}
}
};
@@ -7859,7 +7856,6 @@ public class GameActionUtil {
@Override
public void resolve() {
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, player);
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, player);
CardList rats = new CardList(lib.getCards());
rats = rats.getType("Rat");
@@ -7870,14 +7866,13 @@ public class GameActionUtil {
rats.toArray());
if(o != null) {
Card card = (Card) o;
lib.remove(card);
hand.add(card);
AllZone.GameAction.moveToHand(card);
}
} else if(player.equals(AllZone.ComputerPlayer)) {
Card card = rats.get(0);
lib.remove(card);
hand.add(card);
AllZone.GameAction.moveToHand(card);
}
player.shuffle();
}
@@ -8215,7 +8210,6 @@ public class GameActionUtil {
if (player.isHuman()) {
Card c = library.get(0);
AllZone.GameAction.playCardNoCost(c);
library.remove(c);
}
// player isComputer()
else {
@@ -9113,8 +9107,6 @@ public class GameActionUtil {
@Override
public void resolve() {
CardList graveyardCreatures = AllZoneUtil.getPlayerTypeInGraveyard(player, "Creature");
PlayerZone graveyard = AllZone.getZone(Constant.Zone.Graveyard, player);
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, player);
if(graveyardCreatures.size() >= 4) {
if(player.equals(AllZone.HumanPlayer)) {
@@ -9122,14 +9114,13 @@ public class GameActionUtil {
graveyardCreatures.toArray());
if(o != null) {
Card card = (Card) o;
graveyard.remove(card);
hand.add(card);
AllZone.GameAction.moveToHand(card);
}
}
else if(player.equals(AllZone.ComputerPlayer)) {
Card card = graveyardCreatures.get(0);
graveyard.remove(card);
hand.add(card);
AllZone.GameAction.moveToHand(card);
}
}
}
@@ -9156,7 +9147,6 @@ public class GameActionUtil {
@Override
public void resolve() {
PlayerZone graveyard = AllZone.getZone(Constant.Zone.Graveyard, player);
PlayerZone playZone = AllZone.getZone(Constant.Zone.Battlefield, player);
CardList creatures = new CardList(graveyard.getCards());
creatures = creatures.getType("Creature");
@@ -9166,14 +9156,12 @@ public class GameActionUtil {
creatures.toArray());
if(o != null) {
Card card = (Card) o;
graveyard.remove(card);
playZone.add(card);
AllZone.GameAction.moveToPlay(card);
}
} else if(player.equals(AllZone.ComputerPlayer)) {
Card card = creatures.get(0);
graveyard.remove(card);
playZone.add(card);
AllZone.GameAction.moveToPlay(card);
}
}
@@ -9186,7 +9174,6 @@ public class GameActionUtil {
private static void upkeep_Nether_Spirit() {
final Player player = AllZone.Phase.getPlayerTurn();
final PlayerZone graveyard = AllZone.getZone(Constant.Zone.Graveyard, player);
final PlayerZone playZone = AllZone.getZone(Constant.Zone.Battlefield, player);
CardList all = new CardList(graveyard.getCards());
all = all.getType("Creature");
@@ -9199,8 +9186,7 @@ public class GameActionUtil {
Ability ability = new Ability(list.get(0), "0") {
@Override
public void resolve() {
graveyard.remove(nether);
playZone.add(nether);
AllZone.GameAction.moveToHand(nether);
}
};
@@ -9507,8 +9493,6 @@ public class GameActionUtil {
@Override
public void resolve() {
CardList graveyardCreatures = AllZoneUtil.getPlayerTypeInGraveyard(player, "Creature");
PlayerZone graveyard = AllZone.getZone(Constant.Zone.Graveyard, player);
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, player);
if(AllZoneUtil.compareTypeAmountInGraveyard(player, "Creature") > 0) {
if(player.equals(AllZone.HumanPlayer)) {
@@ -9516,14 +9500,14 @@ public class GameActionUtil {
graveyardCreatures.toArray());
if(o != null) {
Card card = (Card) o;
graveyard.remove(card);
hand.add(card);
AllZone.GameAction.moveToHand(card);
}
}
else if(player.equals(AllZone.ComputerPlayer)) {
Card card = graveyardCreatures.get(0);
graveyard.remove(card);
hand.add(card);
AllZone.GameAction.moveToHand(card);
}
}
}
@@ -10320,6 +10304,7 @@ public class GameActionUtil {
}//upkeep_Shapeshifter
private static void upkeep_Vesuvan_Doppelganger_Keyword() {
// todo: what about enchantments? i dont know how great this solution is
final Player player = AllZone.Phase.getPlayerTurn();
final String keyword = "At the beginning of your upkeep, you may have this creature become a copy of target creature except it doesn't copy that creature's color. If you do, this creature gains this ability.";
CardList list = AllZoneUtil.getPlayerCardsInPlay(player);

View File

@@ -328,7 +328,6 @@ public class PlayerZone_ComesIntoPlay extends DefaultPlayerZone {
}
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, c.getController());
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, c.getController());
CardList meek = new CardList(grave.getCards());
meek = meek.getName("Sword of the Meek");
@@ -338,7 +337,7 @@ public class PlayerZone_ComesIntoPlay extends DefaultPlayerZone {
final Card crd = meek.get(i);
final Card creat = c;
final PlayerZone graveZone = grave;
final PlayerZone playZone = play;
Ability ability = new Ability(meek.get(i), "0") {
@Override
public void resolve() {
@@ -347,8 +346,7 @@ public class PlayerZone_ComesIntoPlay extends DefaultPlayerZone {
if(AllZone.GameAction.isCardInZone(crd, graveZone)
&& AllZone.GameAction.isCardInPlay(creat) && creat.isCreature()
&& creat.getNetAttack() == 1 && creat.getNetDefense() == 1) {
graveZone.remove(crd);
playZone.add(crd);
AllZone.GameAction.moveToPlay(crd);
crd.equipCard(creat);
}
@@ -359,8 +357,7 @@ public class PlayerZone_ComesIntoPlay extends DefaultPlayerZone {
if(AllZone.GameAction.isCardInZone(crd, graveZone)
&& AllZone.GameAction.isCardInPlay(creat) && creat.isCreature()
&& creat.getNetAttack() == 1 && creat.getNetDefense() == 1) {
graveZone.remove(crd);
playZone.add(crd);
AllZone.GameAction.moveToPlay(crd);
crd.equipCard(creat);
}

View File

@@ -48,8 +48,8 @@ public class SpellAbility_Requirements {
// cancel ability during target choosing
Card c = ability.getSourceCard();
if (bCasting && !c.isCopiedSpell()){ // and not a copy
// add back to hand
AllZone.GameAction.moveToHand(c);
// add back to where it came from
AllZone.GameAction.moveTo(fromZone, c);
}
select.resetTargets();
@@ -78,8 +78,8 @@ public class SpellAbility_Requirements {
else if (payment.isCanceled()){
Card c = ability.getSourceCard();
if (bCasting && !c.isCopiedSpell()){ // and not a copy
// add back to hand
AllZone.GameAction.moveToHand(c);
// add back to Previous Zone
AllZone.GameAction.moveTo(fromZone, c);
}
if (select != null)