mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
more code simplification in CF_Sorceries
This commit is contained in:
@@ -131,74 +131,20 @@ public class CardFactory_Sorceries {
|
|||||||
card.addSpellAbility(spell);
|
card.addSpellAbility(spell);
|
||||||
spell.setBeforePayMana(runtime);
|
spell.setBeforePayMana(runtime);
|
||||||
}//*************** END ************ END **************************
|
}//*************** END ************ END **************************
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
//*************** START *********** START **************************
|
|
||||||
//should REALLY be an aura:
|
|
||||||
else if(cardName.equals("Lignify")) {
|
|
||||||
final SpellAbility spell = new Spell(card) {
|
|
||||||
private static final long serialVersionUID = 5323770119451400755L;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canPlayAI() {
|
|
||||||
CardList c = CardFactoryUtil.AI_getHumanCreature(card, true);
|
|
||||||
CardListUtil.sortAttack(c);
|
|
||||||
CardListUtil.sortFlying(c);
|
|
||||||
|
|
||||||
if(c.isEmpty()) return false;
|
|
||||||
|
|
||||||
if(2 <= c.get(0).getNetAttack() && c.get(0).getKeyword().contains("Flying")) {
|
|
||||||
setTargetCard(c.get(0));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
CardListUtil.sortAttack(c);
|
|
||||||
if(4 <= c.get(0).getNetAttack()) {
|
|
||||||
setTargetCard(c.get(0));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}//canPlayAI()
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void resolve() {
|
|
||||||
Card c = getTargetCard();
|
|
||||||
if(AllZoneUtil.isCardInPlay(c) && CardFactoryUtil.canTarget(card, c)) {
|
|
||||||
c.setBaseAttack(0);
|
|
||||||
c.setBaseDefense(4);
|
|
||||||
|
|
||||||
c.setType(new ArrayList<String>());
|
|
||||||
c.addType("Creature");
|
|
||||||
c.addType("Treefolk");
|
|
||||||
|
|
||||||
c.setIntrinsicKeyword(new ArrayList<String>());
|
|
||||||
|
|
||||||
c.clearSpellAbility();
|
|
||||||
}
|
|
||||||
}//resolve()
|
|
||||||
};//SpellAbility
|
|
||||||
|
|
||||||
// Do not remove SpellAbilities created by AbilityFactory or Keywords.
|
|
||||||
card.clearFirstSpellAbility();
|
|
||||||
card.addSpellAbility(spell);
|
|
||||||
|
|
||||||
spell.setBeforePayMana(CardFactoryUtil.input_targetCreature(spell));
|
|
||||||
}//*************** END ************ END **************************
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Identity Crisis")) {
|
else if(cardName.equals("Identity Crisis")) {
|
||||||
final SpellAbility spell = new Spell(card) {
|
Target t = new Target(card, "Select target player", "Player");
|
||||||
|
Cost cost = new Cost("2 W W B B", cardName, false);
|
||||||
|
|
||||||
|
final SpellAbility spell = new Spell(card, cost, t) {
|
||||||
private static final long serialVersionUID = 42470566751344693L;
|
private static final long serialVersionUID = 42470566751344693L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlayAI() {
|
public boolean canPlayAI() {
|
||||||
Player player = getTargetPlayer();
|
Player player = AllZone.HumanPlayer;
|
||||||
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, player);
|
CardList libList = AllZoneUtil.getPlayerCardsInLibrary(player);
|
||||||
CardList libList = new CardList(lib.getCards());
|
|
||||||
return libList.size() > 0;
|
return libList.size() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -206,27 +152,22 @@ public class CardFactory_Sorceries {
|
|||||||
public void resolve() {
|
public void resolve() {
|
||||||
Player player = getTargetPlayer();
|
Player player = getTargetPlayer();
|
||||||
|
|
||||||
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, player);
|
CardList handList = AllZoneUtil.getPlayerHand(player);
|
||||||
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, player);
|
CardList graveList = AllZoneUtil.getPlayerGraveyard(player);
|
||||||
PlayerZone exiled = AllZone.getZone(Constant.Zone.Exile, player);
|
|
||||||
CardList handList = new CardList(hand.getCards());
|
|
||||||
CardList graveList = new CardList(grave.getCards());
|
|
||||||
|
|
||||||
int max = handList.size();
|
int max = handList.size();
|
||||||
for(int i = 0; i < max; i++) {
|
for(int i = 0; i < max; i++) {
|
||||||
Card c = handList.get(i);
|
Card c = handList.get(i);
|
||||||
hand.remove(c);
|
AllZone.GameAction.exile(c);
|
||||||
exiled.add(c);
|
|
||||||
}
|
}
|
||||||
int grv = graveList.size();
|
int grv = graveList.size();
|
||||||
for(int i = 0; i < grv; i++) {
|
for(int i = 0; i < grv; i++) {
|
||||||
Card c = graveList.get(i);
|
Card c = graveList.get(i);
|
||||||
grave.remove(c);
|
AllZone.GameAction.exile(c);
|
||||||
exiled.add(c);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};//SpellAbility
|
};//SpellAbility
|
||||||
spell.setBeforePayMana(CardFactoryUtil.input_targetPlayer(spell));
|
spell.setChooseTargetAI(CardFactoryUtil.AI_targetHuman());
|
||||||
|
|
||||||
// Do not remove SpellAbilities created by AbilityFactory or Keywords.
|
// Do not remove SpellAbilities created by AbilityFactory or Keywords.
|
||||||
card.clearFirstSpellAbility();
|
card.clearFirstSpellAbility();
|
||||||
@@ -335,32 +276,29 @@ public class CardFactory_Sorceries {
|
|||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Ignite Memories")) {
|
else if(cardName.equals("Ignite Memories")) {
|
||||||
SpellAbility spell = new Spell(card) {
|
Target t = new Target(card, "Select target player", "Player");
|
||||||
|
Cost cost = new Cost("4 R", cardName, false);
|
||||||
|
|
||||||
|
SpellAbility spell = new Spell(card, cost, t) {
|
||||||
private static final long serialVersionUID = 143904782338241969L;
|
private static final long serialVersionUID = 143904782338241969L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlayAI() {
|
public boolean canPlayAI() {
|
||||||
return AllZone.Phase.getPhase().equals(Constant.Phase.Main2);
|
return AllZone.Phase.getPhase().equals(Constant.Phase.Main2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
Card choice = null;
|
|
||||||
Player player = getTargetPlayer();
|
Player player = getTargetPlayer();
|
||||||
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, player);
|
CardList handChoices = AllZoneUtil.getPlayerHand(player);
|
||||||
Card[] handChoices = hand.getCards();
|
if (handChoices.size() > 0) {
|
||||||
if (handChoices.length > 0)
|
Card choice = CardUtil.getRandom(handChoices.toArray());
|
||||||
{
|
GuiUtils.getChoice("Random card", new CardList(choice));
|
||||||
choice = CardUtil.getRandom(handChoices);
|
|
||||||
handChoices[0] = choice;
|
|
||||||
for(int i = 1; i < handChoices.length; i++) {
|
|
||||||
handChoices[i] = null;
|
|
||||||
}
|
|
||||||
GuiUtils.getChoice("Random card", handChoices);
|
|
||||||
player.addDamage(CardUtil.getConvertedManaCost(choice.getManaCost()), card);
|
player.addDamage(CardUtil.getConvertedManaCost(choice.getManaCost()), card);
|
||||||
}
|
}
|
||||||
}//resolve()
|
}//resolve()
|
||||||
};
|
};
|
||||||
spell.setChooseTargetAI(CardFactoryUtil.AI_targetHuman());
|
spell.setChooseTargetAI(CardFactoryUtil.AI_targetHuman());
|
||||||
spell.setBeforePayMana(CardFactoryUtil.input_targetPlayer(spell));
|
|
||||||
|
|
||||||
// Do not remove SpellAbilities created by AbilityFactory or Keywords.
|
// Do not remove SpellAbilities created by AbilityFactory or Keywords.
|
||||||
card.clearFirstSpellAbility();
|
card.clearFirstSpellAbility();
|
||||||
@@ -368,11 +306,8 @@ public class CardFactory_Sorceries {
|
|||||||
}//*************** END ************ END **************************
|
}//*************** END ************ END **************************
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Roiling Terrain")) {
|
else if(cardName.equals("Roiling Terrain")) {
|
||||||
//SpellAbility spell = new Spell(card) {
|
|
||||||
Cost cost = new Cost("2 R R", cardName, false);
|
Cost cost = new Cost("2 R R", cardName, false);
|
||||||
final Target tgt = new Target(card, "Select a Land", "Land".split(","));
|
final Target tgt = new Target(card, "Select a Land", "Land".split(","));
|
||||||
|
|
||||||
@@ -393,8 +328,7 @@ public class CardFactory_Sorceries {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlayAI() {
|
public boolean canPlayAI() {
|
||||||
CardList land = new CardList(AllZone.Human_Battlefield.getCards());
|
CardList land = AllZoneUtil.getPlayerLandsInPlay(AllZone.HumanPlayer);
|
||||||
land = land.getType("Land");
|
|
||||||
|
|
||||||
if (land.size() != 0)
|
if (land.size() != 0)
|
||||||
return false;
|
return false;
|
||||||
@@ -520,15 +454,14 @@ public class CardFactory_Sorceries {
|
|||||||
PlayerZone Play = AllZone.getZone(Constant.Zone.Battlefield, player);
|
PlayerZone Play = AllZone.getZone(Constant.Zone.Battlefield, player);
|
||||||
Card Minds_D = card;
|
Card Minds_D = card;
|
||||||
if(player.isHuman()) card.getController().shuffle();
|
if(player.isHuman()) card.getController().shuffle();
|
||||||
CardList MindsList = new CardList(Play.getCards());
|
CardList MindsList = AllZoneUtil.getPlayerCardsInPlay(player);
|
||||||
MindsList = MindsList.getName("Mind's Desire");
|
MindsList = MindsList.getName("Mind's Desire");
|
||||||
MindsList.remove(card);
|
MindsList.remove(card);
|
||||||
if(MindsList.size() > 0) {
|
if(MindsList.size() > 0) {
|
||||||
Play.remove(card);
|
Play.remove(card);
|
||||||
Minds_D = MindsList.get(0);
|
Minds_D = MindsList.get(0);
|
||||||
} else JOptionPane.showMessageDialog(null, "Click Mind's Desire to see the available cards to play without paying its mana cost.", "", JOptionPane.INFORMATION_MESSAGE);
|
} else JOptionPane.showMessageDialog(null, "Click Mind's Desire to see the available cards to play without paying its mana cost.", "", JOptionPane.INFORMATION_MESSAGE);
|
||||||
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, player);
|
CardList libList = AllZoneUtil.getPlayerCardsInLibrary(player);
|
||||||
CardList libList = new CardList(lib.getCards());
|
|
||||||
Card c = null;
|
Card c = null;
|
||||||
if(libList.size() > 0) {
|
if(libList.size() > 0) {
|
||||||
c = libList.get(0);
|
c = libList.get(0);
|
||||||
@@ -571,166 +504,161 @@ public class CardFactory_Sorceries {
|
|||||||
}
|
}
|
||||||
//*************** END ************ END **************************
|
//*************** END ************ END **************************
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//*************** START *********** START **************************
|
//*************** START *********** START **************************
|
||||||
else if(cardName.equals("Brilliant Ultimatum")) {
|
else if(cardName.equals("Brilliant Ultimatum")) {
|
||||||
final SpellAbility spell = new Spell(card) {
|
final SpellAbility spell = new Spell(card) {
|
||||||
private static final long serialVersionUID = 1481112451519L;
|
private static final long serialVersionUID = 1481112451519L;
|
||||||
|
|
||||||
@Override
|
|
||||||
public void resolve() {
|
|
||||||
|
|
||||||
Card choice = null;
|
|
||||||
|
|
||||||
//check for no cards in hand on resolve
|
|
||||||
PlayerZone Library = AllZone.getZone(Constant.Zone.Library, card.getController());
|
|
||||||
CardList Lib = new CardList(Library.getCards());
|
|
||||||
PlayerZone Exile = AllZone.getZone(Constant.Zone.Exile, card.getController());
|
|
||||||
CardList cards = new CardList();
|
|
||||||
CardList Exiled = new CardList();
|
|
||||||
if(Lib.size() == 0) {
|
|
||||||
JOptionPane.showMessageDialog(null, "No more cards in library.", "", JOptionPane.INFORMATION_MESSAGE);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
int Count = 5;
|
|
||||||
if(Lib.size() < 5) Count = Lib.size();
|
|
||||||
for(int i = 0; i < Count; i++) cards.add(Lib.get(i));
|
|
||||||
for(int i = 0; i < Count; i++) {
|
|
||||||
Exiled.add(Lib.get(i));
|
|
||||||
AllZone.GameAction.moveTo(Exile, Lib.get(i));
|
|
||||||
}
|
|
||||||
CardList Pile1 = new CardList();
|
|
||||||
CardList Pile2 = new CardList();
|
|
||||||
boolean stop = false;
|
|
||||||
int Pile1CMC = 0;
|
|
||||||
int Pile2CMC = 0;
|
|
||||||
|
|
||||||
|
|
||||||
GuiUtils.getChoice("Revealing top " + Count + " cards of library: ", cards.toArray());
|
@Override
|
||||||
//Human chooses
|
public void resolve() {
|
||||||
if(card.getController().isComputer()) {
|
|
||||||
for(int i = 0; i < Count; i++) {
|
|
||||||
if(stop == false) {
|
|
||||||
choice = GuiUtils.getChoiceOptional("Choose cards to put into the first pile: ", cards.toArray());
|
|
||||||
if(choice != null) {
|
|
||||||
Pile1.add(choice);
|
|
||||||
cards.remove(choice);
|
|
||||||
Pile1CMC = Pile1CMC + CardUtil.getConvertedManaCost(choice);
|
|
||||||
}
|
|
||||||
else stop = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for(int i = 0; i < Count; i++) {
|
|
||||||
if(!Pile1.contains(Exiled.get(i))) {
|
|
||||||
Pile2.add(Exiled.get(i));
|
|
||||||
Pile2CMC = Pile2CMC + CardUtil.getConvertedManaCost(Exiled.get(i));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("You have spilt the cards into the following piles" + "\r\n" + "\r\n");
|
|
||||||
sb.append("Pile 1: " + "\r\n");
|
|
||||||
for(int i = 0; i < Pile1.size(); i++) sb.append(Pile1.get(i).getName() + "\r\n");
|
|
||||||
sb.append("\r\n" + "Pile 2: " + "\r\n");
|
|
||||||
for(int i = 0; i < Pile2.size(); i++) sb.append(Pile2.get(i).getName() + "\r\n");
|
|
||||||
JOptionPane.showMessageDialog(null, sb, "", JOptionPane.INFORMATION_MESSAGE);
|
|
||||||
if(Pile1CMC >= Pile2CMC) {
|
|
||||||
JOptionPane.showMessageDialog(null, "Computer chooses the Pile 1", "", JOptionPane.INFORMATION_MESSAGE);
|
|
||||||
for(int i = 0; i < Pile1.size(); i++) {
|
|
||||||
ArrayList<SpellAbility> choices = Pile1.get(i).getBasicSpells();
|
|
||||||
|
|
||||||
for(SpellAbility sa:choices) {
|
Card choice = null;
|
||||||
if(sa.canPlayAI()) {
|
|
||||||
ComputerUtil.playStackFree(sa);
|
|
||||||
if(Pile1.get(i).isPermanent()) Exiled.remove(Pile1.get(i));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
JOptionPane.showMessageDialog(null, "Computer chooses the Pile 2", "", JOptionPane.INFORMATION_MESSAGE);
|
|
||||||
for(int i = 0; i < Pile2.size(); i++) {
|
|
||||||
ArrayList<SpellAbility> choices = Pile2.get(i).getBasicSpells();
|
|
||||||
|
|
||||||
for(SpellAbility sa:choices) {
|
//check for no cards in hand on resolve
|
||||||
if(sa.canPlayAI()) {
|
CardList lib = AllZoneUtil.getPlayerCardsInLibrary(card.getController());
|
||||||
ComputerUtil.playStackFree(sa);
|
CardList cards = new CardList();
|
||||||
if(Pile2.get(i).isPermanent()) Exiled.remove(Pile2.get(i));
|
CardList exiled = new CardList();
|
||||||
break;
|
if(lib.size() == 0) {
|
||||||
}
|
JOptionPane.showMessageDialog(null, "No more cards in library.", "", JOptionPane.INFORMATION_MESSAGE);
|
||||||
}
|
return;
|
||||||
}
|
}
|
||||||
}
|
int Count = 5;
|
||||||
|
if(lib.size() < 5) Count = lib.size();
|
||||||
}
|
for(int i = 0; i < Count; i++) cards.add(lib.get(i));
|
||||||
else{//Computer chooses (It picks the highest converted mana cost card and 1 random card.)
|
for(int i = 0; i < Count; i++) {
|
||||||
Card biggest = Exiled.get(0);
|
exiled.add(lib.get(i));
|
||||||
|
AllZone.GameAction.exile(lib.get(i));
|
||||||
for(Card c : Exiled)
|
}
|
||||||
if(CardUtil.getConvertedManaCost(biggest.getManaCost()) < CardUtil.getConvertedManaCost(c.getManaCost()))
|
CardList Pile1 = new CardList();
|
||||||
biggest = c;
|
CardList Pile2 = new CardList();
|
||||||
|
boolean stop = false;
|
||||||
|
int Pile1CMC = 0;
|
||||||
|
int Pile2CMC = 0;
|
||||||
|
|
||||||
Pile1.add(biggest);
|
|
||||||
cards.remove(biggest);
|
|
||||||
if(cards.size() > 2) {
|
|
||||||
Card Random = CardUtil.getRandom(cards.toArray());
|
|
||||||
Pile1.add(Random);
|
|
||||||
}
|
|
||||||
for(int i = 0; i < Count; i++) if(!Pile1.contains(Exiled.get(i))) Pile2.add(Exiled.get(i));
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("Choose a pile to add to your hand: " + "\r\n" + "\r\n");
|
|
||||||
sb.append("Pile 1: " + "\r\n");
|
|
||||||
for(int i = 0; i < Pile1.size(); i++) sb.append(Pile1.get(i).getName() + "\r\n");
|
|
||||||
sb.append("\r\n" + "Pile 2: " + "\r\n");
|
|
||||||
for(int i = 0; i < Pile2.size(); i++) sb.append(Pile2.get(i).getName() + "\r\n");
|
|
||||||
Object[] possibleValues = {"Pile 1", "Pile 2"};
|
|
||||||
Object q = JOptionPane.showOptionDialog(null, sb, "Brilliant Ultimatum",
|
|
||||||
JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE,
|
|
||||||
null, possibleValues, possibleValues[0]);
|
|
||||||
|
|
||||||
CardList chosen;
|
GuiUtils.getChoice("Revealing top " + Count + " cards of library: ", cards.toArray());
|
||||||
if (q.equals(0))
|
//Human chooses
|
||||||
chosen = Pile1;
|
if(card.getController().isComputer()) {
|
||||||
else
|
for(int i = 0; i < Count; i++) {
|
||||||
chosen = Pile2;
|
if(stop == false) {
|
||||||
|
choice = GuiUtils.getChoiceOptional("Choose cards to put into the first pile: ", cards.toArray());
|
||||||
int numChosen = chosen.size();
|
if(choice != null) {
|
||||||
for( int i = 0; i < numChosen; i++) {
|
Pile1.add(choice);
|
||||||
Object check = GuiUtils.getChoiceOptional("Select spells to play in reverse order: ", chosen.toArray());
|
cards.remove(choice);
|
||||||
if (check == null)
|
Pile1CMC = Pile1CMC + CardUtil.getConvertedManaCost(choice);
|
||||||
break;
|
}
|
||||||
|
else stop = true;
|
||||||
Card playing = (Card)check;
|
}
|
||||||
if(playing.isLand()) {
|
}
|
||||||
if(card.getController().canPlayLand()) {
|
for(int i = 0; i < Count; i++) {
|
||||||
card.getController().playLand(playing);
|
if(!Pile1.contains(exiled.get(i))) {
|
||||||
} else {
|
Pile2.add(exiled.get(i));
|
||||||
JOptionPane.showMessageDialog(null, "You can't play any more lands this turn.", "", JOptionPane.INFORMATION_MESSAGE);
|
Pile2CMC = Pile2CMC + CardUtil.getConvertedManaCost(exiled.get(i));
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
AllZone.GameAction.playCardNoCost(playing);
|
StringBuilder sb = new StringBuilder();
|
||||||
}
|
sb.append("You have spilt the cards into the following piles" + "\r\n" + "\r\n");
|
||||||
chosen.remove(playing);
|
sb.append("Pile 1: " + "\r\n");
|
||||||
}
|
for(int i = 0; i < Pile1.size(); i++) sb.append(Pile1.get(i).getName() + "\r\n");
|
||||||
|
sb.append("\r\n" + "Pile 2: " + "\r\n");
|
||||||
|
for(int i = 0; i < Pile2.size(); i++) sb.append(Pile2.get(i).getName() + "\r\n");
|
||||||
|
JOptionPane.showMessageDialog(null, sb, "", JOptionPane.INFORMATION_MESSAGE);
|
||||||
|
if(Pile1CMC >= Pile2CMC) {
|
||||||
|
JOptionPane.showMessageDialog(null, "Computer chooses the Pile 1", "", JOptionPane.INFORMATION_MESSAGE);
|
||||||
|
for(int i = 0; i < Pile1.size(); i++) {
|
||||||
|
ArrayList<SpellAbility> choices = Pile1.get(i).getBasicSpells();
|
||||||
|
|
||||||
}
|
for(SpellAbility sa:choices) {
|
||||||
Pile1.clear();
|
if(sa.canPlayAI()) {
|
||||||
Pile2.clear();
|
ComputerUtil.playStackFree(sa);
|
||||||
}//resolve()
|
if(Pile1.get(i).isPermanent()) exiled.remove(Pile1.get(i));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
JOptionPane.showMessageDialog(null, "Computer chooses the Pile 2", "", JOptionPane.INFORMATION_MESSAGE);
|
||||||
|
for(int i = 0; i < Pile2.size(); i++) {
|
||||||
|
ArrayList<SpellAbility> choices = Pile2.get(i).getBasicSpells();
|
||||||
|
|
||||||
|
for(SpellAbility sa:choices) {
|
||||||
@Override
|
if(sa.canPlayAI()) {
|
||||||
public boolean canPlayAI() {
|
ComputerUtil.playStackFree(sa);
|
||||||
PlayerZone Library = AllZone.getZone(Constant.Zone.Library, card.getController());
|
if(Pile2.get(i).isPermanent()) exiled.remove(Pile2.get(i));
|
||||||
CardList cards = new CardList(Library.getCards());
|
break;
|
||||||
return cards.size() >= 8;
|
}
|
||||||
}
|
}
|
||||||
};//SpellAbility
|
}
|
||||||
|
}
|
||||||
// Do not remove SpellAbilities created by AbilityFactory or Keywords.
|
|
||||||
card.clearFirstSpellAbility();
|
}
|
||||||
card.addSpellAbility(spell);
|
else{//Computer chooses (It picks the highest converted mana cost card and 1 random card.)
|
||||||
|
Card biggest = exiled.get(0);
|
||||||
|
|
||||||
|
for(Card c : exiled)
|
||||||
|
if(CardUtil.getConvertedManaCost(biggest.getManaCost()) < CardUtil.getConvertedManaCost(c.getManaCost()))
|
||||||
|
biggest = c;
|
||||||
|
|
||||||
|
Pile1.add(biggest);
|
||||||
|
cards.remove(biggest);
|
||||||
|
if(cards.size() > 2) {
|
||||||
|
Card Random = CardUtil.getRandom(cards.toArray());
|
||||||
|
Pile1.add(Random);
|
||||||
|
}
|
||||||
|
for(int i = 0; i < Count; i++) if(!Pile1.contains(exiled.get(i))) Pile2.add(exiled.get(i));
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("Choose a pile to add to your hand: " + "\r\n" + "\r\n");
|
||||||
|
sb.append("Pile 1: " + "\r\n");
|
||||||
|
for(int i = 0; i < Pile1.size(); i++) sb.append(Pile1.get(i).getName() + "\r\n");
|
||||||
|
sb.append("\r\n" + "Pile 2: " + "\r\n");
|
||||||
|
for(int i = 0; i < Pile2.size(); i++) sb.append(Pile2.get(i).getName() + "\r\n");
|
||||||
|
Object[] possibleValues = {"Pile 1", "Pile 2"};
|
||||||
|
Object q = JOptionPane.showOptionDialog(null, sb, "Brilliant Ultimatum",
|
||||||
|
JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE,
|
||||||
|
null, possibleValues, possibleValues[0]);
|
||||||
|
|
||||||
|
CardList chosen;
|
||||||
|
if (q.equals(0))
|
||||||
|
chosen = Pile1;
|
||||||
|
else
|
||||||
|
chosen = Pile2;
|
||||||
|
|
||||||
|
int numChosen = chosen.size();
|
||||||
|
for( int i = 0; i < numChosen; i++) {
|
||||||
|
Object check = GuiUtils.getChoiceOptional("Select spells to play in reverse order: ", chosen.toArray());
|
||||||
|
if (check == null)
|
||||||
|
break;
|
||||||
|
|
||||||
|
Card playing = (Card)check;
|
||||||
|
if(playing.isLand()) {
|
||||||
|
if(card.getController().canPlayLand()) {
|
||||||
|
card.getController().playLand(playing);
|
||||||
|
} else {
|
||||||
|
JOptionPane.showMessageDialog(null, "You can't play any more lands this turn.", "", JOptionPane.INFORMATION_MESSAGE);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
AllZone.GameAction.playCardNoCost(playing);
|
||||||
|
}
|
||||||
|
chosen.remove(playing);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
Pile1.clear();
|
||||||
|
Pile2.clear();
|
||||||
|
}//resolve()
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canPlayAI() {
|
||||||
|
CardList cards = AllZoneUtil.getPlayerCardsInLibrary(AllZone.ComputerPlayer);
|
||||||
|
return cards.size() >= 8;
|
||||||
|
}
|
||||||
|
};//SpellAbility
|
||||||
|
|
||||||
|
// Do not remove SpellAbilities created by AbilityFactory or Keywords.
|
||||||
|
card.clearFirstSpellAbility();
|
||||||
|
card.addSpellAbility(spell);
|
||||||
}//*************** END ************ END **************************
|
}//*************** END ************ END **************************
|
||||||
|
|
||||||
|
|
||||||
@@ -983,13 +911,8 @@ public class CardFactory_Sorceries {
|
|||||||
|
|
||||||
//randomly choose a nonland card
|
//randomly choose a nonland card
|
||||||
int getDamage() {
|
int getDamage() {
|
||||||
PlayerZone library = AllZone.getZone(Constant.Zone.Library, card.getController());
|
CardList notLand = AllZoneUtil.getPlayerCardsInLibrary(card.getController());
|
||||||
CardList notLand = new CardList(library.getCards());
|
notLand = notLand.filter(AllZoneUtil.nonlands);
|
||||||
notLand = notLand.filter(new CardListFilter() {
|
|
||||||
public boolean addCard(Card c) {
|
|
||||||
return !c.isLand();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
notLand.shuffle();
|
notLand.shuffle();
|
||||||
|
|
||||||
if(notLand.isEmpty()) return 0;
|
if(notLand.isEmpty()) return 0;
|
||||||
@@ -1018,17 +941,17 @@ public class CardFactory_Sorceries {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
CardList all = AllZoneUtil.getCardsInPlay();
|
CardList all = AllZoneUtil.getCardsInPlay();
|
||||||
int Soldiers = card.getXManaCostPaid();
|
int Soldiers = card.getXManaCostPaid();
|
||||||
for(int i = 0; i < Soldiers; i++) {
|
for(int i = 0; i < Soldiers; i++) {
|
||||||
CardFactoryUtil.makeToken("Soldier", "W 1 1 Soldier", card.getController(), "W", new String[] {
|
CardFactoryUtil.makeToken("Soldier", "W 1 1 Soldier", card.getController(), "W", new String[] {
|
||||||
"Creature", "Soldier"}, 1, 1, new String[] {""});
|
"Creature", "Soldier"}, 1, 1, new String[] {""});
|
||||||
}
|
}
|
||||||
if(Soldiers >= 5) {
|
if(Soldiers >= 5) {
|
||||||
for(int i = 0; i < all.size(); i++) {
|
for(int i = 0; i < all.size(); i++) {
|
||||||
Card c = all.get(i);
|
Card c = all.get(i);
|
||||||
if(c.isCreature()) AllZone.GameAction.destroy(c);
|
if(c.isCreature()) AllZone.GameAction.destroy(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}// resolve()
|
}// resolve()
|
||||||
|
|
||||||
@@ -1084,33 +1007,27 @@ public class CardFactory_Sorceries {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//"Incendiary Command deals 2 damage to each creature",
|
//"Incendiary Command deals 2 damage to each creature",
|
||||||
if(userChoice.contains(cardChoice[1]) || card.getChoices().contains(cardChoice[1])) {
|
if(userChoice.contains(cardChoice[1]) || card.getChoices().contains(cardChoice[1])) {
|
||||||
//get all creatures
|
CardList list = AllZoneUtil.getCreaturesInPlay();
|
||||||
CardList list = AllZoneUtil.getCreaturesInPlay();
|
|
||||||
|
|
||||||
|
|
||||||
for(int i = 0; i < list.size(); i++) {
|
for(int i = 0; i < list.size(); i++) {
|
||||||
list.get(i).addDamage(2, card);
|
list.get(i).addDamage(2, card);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//"Destroy target nonbasic land",
|
|
||||||
for(int i = 0; i <card.getChoices().size(); i++) {
|
|
||||||
if(card.getChoice(i).equals(cardChoice[2])) {
|
|
||||||
PlayerZone Hplay = AllZone.getZone(Constant.Zone.Battlefield, AllZone.HumanPlayer);
|
|
||||||
PlayerZone Cplay = AllZone.getZone(Constant.Zone.Battlefield, AllZone.ComputerPlayer);
|
|
||||||
// CardList all = AllZone.CardFactory.getAllCards();
|
|
||||||
CardList all = new CardList(Hplay.getCards());
|
|
||||||
all.add(new CardList(Cplay.getCards()));
|
|
||||||
for(int i2 = 0; i2 < all.size(); i2++) {
|
|
||||||
if(String.valueOf(all.get(i2).getUniqueNumber()).equals(card.getChoiceTarget(card.getChoices().size() - 1))) {
|
|
||||||
setTargetCard(all.get(i2));
|
|
||||||
AllZone.GameAction.destroy(getTargetCard());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//"Destroy target nonbasic land",
|
||||||
|
for(int i = 0; i <card.getChoices().size(); i++) {
|
||||||
|
if(card.getChoice(i).equals(cardChoice[2])) {
|
||||||
|
CardList all = AllZoneUtil.getCardsInPlay();
|
||||||
|
for(int i2 = 0; i2 < all.size(); i2++) {
|
||||||
|
if(String.valueOf(all.get(i2).getUniqueNumber()).equals(card.getChoiceTarget(card.getChoices().size() - 1))) {
|
||||||
|
setTargetCard(all.get(i2));
|
||||||
|
AllZone.GameAction.destroy(getTargetCard());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//"Each player discards all cards in his or her hand, then draws that many cards"
|
//"Each player discards all cards in his or her hand, then draws that many cards"
|
||||||
if(userChoice.contains(cardChoice[3]) || card.getChoices().contains(cardChoice[3])) {
|
if(userChoice.contains(cardChoice[3]) || card.getChoices().contains(cardChoice[3])) {
|
||||||
@@ -1120,7 +1037,7 @@ public class CardFactory_Sorceries {
|
|||||||
}//resolve()
|
}//resolve()
|
||||||
|
|
||||||
void discardDraw(Player player) {
|
void discardDraw(Player player) {
|
||||||
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, player);
|
CardList hand = AllZoneUtil.getPlayerHand(player);
|
||||||
int n = hand.size();
|
int n = hand.size();
|
||||||
|
|
||||||
//technically should let the user discard one card at a time
|
//technically should let the user discard one card at a time
|
||||||
@@ -1239,9 +1156,7 @@ public class CardFactory_Sorceries {
|
|||||||
ArrayList<String> display = new ArrayList<String>();
|
ArrayList<String> display = new ArrayList<String>();
|
||||||
|
|
||||||
//get all
|
//get all
|
||||||
CardList list = new CardList();
|
CardList list = AllZoneUtil.getCardsInPlay();
|
||||||
list.addAll(AllZone.Human_Battlefield.getCards());
|
|
||||||
list.addAll(AllZone.Computer_Battlefield.getCards());
|
|
||||||
|
|
||||||
CardList land = list.getType("Land");
|
CardList land = list.getType("Land");
|
||||||
CardList basicLand = list.getType("Basic");
|
CardList basicLand = list.getType("Basic");
|
||||||
@@ -1461,8 +1376,7 @@ public class CardFactory_Sorceries {
|
|||||||
&& c.getType().contains(humanBasic.get(count))
|
&& c.getType().contains(humanBasic.get(count))
|
||||||
/*&& !saveList.contains(c) */) {
|
/*&& !saveList.contains(c) */) {
|
||||||
//get all other basic[count] lands human player controls and add them to target
|
//get all other basic[count] lands human player controls and add them to target
|
||||||
PlayerZone humanPlay = AllZone.getZone(Constant.Zone.Battlefield, AllZone.HumanPlayer);
|
CardList land = AllZoneUtil.getPlayerLandsInPlay(AllZone.HumanPlayer);
|
||||||
CardList land = new CardList(humanPlay.getCards()).getType("Land");
|
|
||||||
CardList cl = land.getType(humanBasic.get(count));
|
CardList cl = land.getType(humanBasic.get(count));
|
||||||
cl = cl.filter(new CardListFilter()
|
cl = cl.filter(new CardListFilter()
|
||||||
{
|
{
|
||||||
@@ -1683,23 +1597,17 @@ public class CardFactory_Sorceries {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void chooseTargetAI() {
|
public void chooseTargetAI() {
|
||||||
PlayerZone zone = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
CardList creature = AllZoneUtil.getCreaturesInPlay();
|
||||||
if(zone != null) {
|
creature = creature.filter(new CardListFilter() {
|
||||||
CardList creature = new CardList();
|
public boolean addCard(Card card) {
|
||||||
creature.addAll(zone.getCards());
|
return (!card.getType().contains("Legendary"));
|
||||||
creature.addAll(AllZone.getZone(Constant.Zone.Battlefield, card.getController().getOpponent()).getCards());
|
|
||||||
creature = creature.getType("Creature");
|
|
||||||
creature = creature.filter(new CardListFilter() {
|
|
||||||
public boolean addCard(Card card) {
|
|
||||||
return (!card.getType().contains("Legendary"));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if(creature.size() > 0) {
|
|
||||||
Card biggest = creature.get(0);
|
|
||||||
for(int i = 0; i < creature.size(); i++)
|
|
||||||
if(biggest.getNetAttack() < creature.get(i).getNetAttack()) biggest = creature.get(i);
|
|
||||||
setTargetCard(biggest);
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
if(creature.size() > 0) {
|
||||||
|
Card biggest = creature.get(0);
|
||||||
|
for(int i = 0; i < creature.size(); i++)
|
||||||
|
if(biggest.getNetAttack() < creature.get(i).getNetAttack()) biggest = creature.get(i);
|
||||||
|
setTargetCard(biggest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1720,10 +1628,6 @@ public class CardFactory_Sorceries {
|
|||||||
AllZone.TriggerHandler.registerTrigger(t);
|
AllZone.TriggerHandler.registerTrigger(t);
|
||||||
}
|
}
|
||||||
Copy.addLeavesPlayCommand(new Command() {
|
Copy.addLeavesPlayCommand(new Command() {
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = 1988240749380718859L;
|
private static final long serialVersionUID = 1988240749380718859L;
|
||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
@@ -1749,46 +1653,38 @@ public class CardFactory_Sorceries {
|
|||||||
|
|
||||||
SpellAbility kicker = new Spell(card) {
|
SpellAbility kicker = new Spell(card) {
|
||||||
private static final long serialVersionUID = 13762512058673590L;
|
private static final long serialVersionUID = 13762512058673590L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlayAI() {
|
public boolean canPlayAI() {
|
||||||
PlayerZone zone = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
Card biggest = null;
|
||||||
Card biggest = null;
|
CardList creature = AllZoneUtil.getCreaturesInPlay(card.getController());
|
||||||
if(zone != null) {
|
creature = creature.filter(new CardListFilter() {
|
||||||
CardList creature = new CardList();
|
public boolean addCard(Card card) {
|
||||||
creature.addAll(zone.getCards());
|
return (!card.getType().contains("Legendary"));
|
||||||
creature = creature.getType("Creature");
|
}
|
||||||
creature = creature.filter(new CardListFilter() {
|
});
|
||||||
public boolean addCard(Card card) {
|
if(creature.size() == 0) return false;
|
||||||
return (!card.getType().contains("Legendary"));
|
biggest = creature.get(0);
|
||||||
}
|
for(int i = 0; i < creature.size(); i++)
|
||||||
});
|
if(biggest.getNetAttack() < creature.get(i).getNetAttack()) biggest = creature.get(i);
|
||||||
if(creature.size() == 0) return false;
|
setTargetCard(biggest);
|
||||||
biggest = creature.get(0);
|
|
||||||
for(int i = 0; i < creature.size(); i++)
|
return biggest.getNetAttack() > 3;
|
||||||
if(biggest.getNetAttack() < creature.get(i).getNetAttack()) biggest = creature.get(i);
|
|
||||||
setTargetCard(biggest);
|
|
||||||
}
|
|
||||||
return biggest.getNetAttack() > 3;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void chooseTargetAI() {
|
public void chooseTargetAI() {
|
||||||
PlayerZone zone = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
|
CardList creature = AllZoneUtil.getCreaturesInPlay(card.getController());
|
||||||
if(zone != null) {
|
creature = creature.filter(new CardListFilter() {
|
||||||
CardList creature = new CardList();
|
public boolean addCard(Card card) {
|
||||||
creature.addAll(zone.getCards());
|
return (!card.getType().contains("Legendary"));
|
||||||
creature = creature.getType("Creature");
|
|
||||||
creature = creature.filter(new CardListFilter() {
|
|
||||||
public boolean addCard(Card card) {
|
|
||||||
return (!card.getType().contains("Legendary"));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if(creature.size() > 0) {
|
|
||||||
Card biggest = creature.get(0);
|
|
||||||
for(int i = 0; i < creature.size(); i++)
|
|
||||||
if(biggest.getNetAttack() < creature.get(i).getNetAttack()) biggest = creature.get(i);
|
|
||||||
setTargetCard(biggest);
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
if(creature.size() > 0) {
|
||||||
|
Card biggest = creature.get(0);
|
||||||
|
for(int i = 0; i < creature.size(); i++)
|
||||||
|
if(biggest.getNetAttack() < creature.get(i).getNetAttack()) biggest = creature.get(i);
|
||||||
|
setTargetCard(biggest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2140,8 +2036,7 @@ public class CardFactory_Sorceries {
|
|||||||
int damage = card.getXManaCostPaid();
|
int damage = card.getXManaCostPaid();
|
||||||
|
|
||||||
Player player = getTargetPlayer();
|
Player player = getTargetPlayer();
|
||||||
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, player);
|
CardList list = AllZoneUtil.getPlayerCardsInPlay(player);
|
||||||
CardList list = new CardList(play.getCards());
|
|
||||||
|
|
||||||
list = list.filter(new CardListFilter()
|
list = list.filter(new CardListFilter()
|
||||||
{
|
{
|
||||||
@@ -2172,7 +2067,7 @@ public class CardFactory_Sorceries {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
CardList killableCreatures = new CardList(AllZone.Human_Battlefield.getCards());
|
CardList killableCreatures = AllZoneUtil.getPlayerCardsInPlay(AllZone.HumanPlayer);
|
||||||
killableCreatures = killableCreatures.filter(filter);
|
killableCreatures = killableCreatures.filter(filter);
|
||||||
|
|
||||||
return (killableCreatures.size() >= 2); // kill at least two of the human's creatures
|
return (killableCreatures.size() >= 2); // kill at least two of the human's creatures
|
||||||
@@ -2324,10 +2219,7 @@ public class CardFactory_Sorceries {
|
|||||||
// The computer should only play this card if it has at least
|
// The computer should only play this card if it has at least
|
||||||
// one land in its hand. Because of the way the computer turn
|
// one land in its hand. Because of the way the computer turn
|
||||||
// is structured, it will already have played its first land.
|
// is structured, it will already have played its first land.
|
||||||
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand,
|
CardList list = AllZoneUtil.getPlayerHand(AllZone.ComputerPlayer);
|
||||||
AllZone.ComputerPlayer);
|
|
||||||
|
|
||||||
CardList list = new CardList(hand.getCards());
|
|
||||||
|
|
||||||
list = list.getType("Land");
|
list = list.getType("Land");
|
||||||
if (list.size() > 0)
|
if (list.size() > 0)
|
||||||
@@ -2342,7 +2234,6 @@ public class CardFactory_Sorceries {
|
|||||||
|
|
||||||
Command untilEOT = new Command()
|
Command untilEOT = new Command()
|
||||||
{
|
{
|
||||||
|
|
||||||
private static final long serialVersionUID = -2618916698575607634L;
|
private static final long serialVersionUID = -2618916698575607634L;
|
||||||
|
|
||||||
public void execute(){
|
public void execute(){
|
||||||
@@ -2928,25 +2819,17 @@ public class CardFactory_Sorceries {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean canPlayAI() {
|
public boolean canPlayAI() {
|
||||||
CardList check = new CardList();
|
CardList check = AllZoneUtil.getPlayerGraveyard(card.getController());
|
||||||
PlayerZone zone = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
|
||||||
check.addAll(zone.getCards());
|
|
||||||
return getCreaturesAI().length != 0 || check.size() >= 7;
|
return getCreaturesAI().length != 0 || check.size() >= 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Card[] getCreatures() {
|
public Card[] getCreatures() {
|
||||||
CardList creature = new CardList();
|
CardList creature = AllZoneUtil.getPlayerTypeInGraveyard(card.getController(), "Creature");
|
||||||
PlayerZone zone = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
|
||||||
creature.addAll(zone.getCards());
|
|
||||||
creature = creature.getType("Creature");
|
|
||||||
return creature.toArray();
|
return creature.toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Card[] getCreaturesAI() {
|
public Card[] getCreaturesAI() {
|
||||||
CardList creature = new CardList();
|
CardList creature = AllZoneUtil.getPlayerTypeInGraveyard(card.getController(), "Creature");
|
||||||
PlayerZone zone = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
|
||||||
creature.addAll(zone.getCards());
|
|
||||||
creature = creature.getType("Creature");
|
|
||||||
creature = creature.filter(new CardListFilter() {
|
creature = creature.filter(new CardListFilter() {
|
||||||
public boolean addCard(Card c) {
|
public boolean addCard(Card c) {
|
||||||
return c.getNetAttack() > 4;
|
return c.getNetAttack() > 4;
|
||||||
@@ -2975,20 +2858,13 @@ public class CardFactory_Sorceries {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showMessage() {
|
public void showMessage() {
|
||||||
Object check = GuiUtils.getChoiceOptional("Select creature", getCreatures());
|
CardList creature = AllZoneUtil.getPlayerTypeInGraveyard(card.getController(), "Creature");
|
||||||
|
Object check = GuiUtils.getChoiceOptional("Select creature", creature);
|
||||||
if(check != null) {
|
if(check != null) {
|
||||||
spell.setTargetCard((Card) check);
|
spell.setTargetCard((Card) check);
|
||||||
stopSetNext(new Input_PayManaCost(spell));
|
stopSetNext(new Input_PayManaCost(spell));
|
||||||
} else stop();
|
} else stop();
|
||||||
}//showMessage()
|
}//showMessage()
|
||||||
|
|
||||||
public Card[] getCreatures() {
|
|
||||||
CardList creature = new CardList();
|
|
||||||
PlayerZone zone = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
|
||||||
creature.addAll(zone.getCards());
|
|
||||||
creature = creature.getType("Creature");
|
|
||||||
return creature.toArray();
|
|
||||||
}
|
|
||||||
};//Input
|
};//Input
|
||||||
spell.setBeforePayMana(target);
|
spell.setBeforePayMana(target);
|
||||||
}//*************** END ************ END **************************
|
}//*************** END ************ END **************************
|
||||||
@@ -3016,9 +2892,8 @@ public class CardFactory_Sorceries {
|
|||||||
|
|
||||||
if(input[0] == null) input[0] = "";
|
if(input[0] == null) input[0] = "";
|
||||||
|
|
||||||
PlayerZone aiGrave = AllZone.getZone(Constant.Zone.Graveyard, AllZone.ComputerPlayer);
|
|
||||||
HashMap<String,Integer> countInGraveyard = new HashMap<String,Integer>();
|
HashMap<String,Integer> countInGraveyard = new HashMap<String,Integer>();
|
||||||
CardList allGrave = new CardList(aiGrave.getCards());
|
CardList allGrave = AllZoneUtil.getPlayerGraveyard(AllZone.ComputerPlayer);
|
||||||
allGrave.getType("Creature");
|
allGrave.getType("Creature");
|
||||||
for(Card c:allGrave)
|
for(Card c:allGrave)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user