From aedf570c59c39832b42b5b4e284fed9adc1f48d4 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 15:48:41 +0000 Subject: [PATCH] - Converted Firebolt, Tinker, Oust, Path to Exile to AF - moveTo Tweaks --- res/cardsfolder/firebolt.txt | 5 +- res/cardsfolder/oust.txt | 5 +- res/cardsfolder/path_to_exile.txt | 2 + res/cardsfolder/tinker.txt | 3 +- src/forge/AbilityFactory.java | 9 + src/forge/AbilityFactory_ChangeZone.java | 3 +- src/forge/CardFactory_Instants.java | 76 ---- src/forge/CardFactory_Sorceries.java | 497 +---------------------- src/forge/GameAction.java | 2 +- 9 files changed, 26 insertions(+), 576 deletions(-) diff --git a/res/cardsfolder/firebolt.txt b/res/cardsfolder/firebolt.txt index 73f538fd1e8..60498533702 100644 --- a/res/cardsfolder/firebolt.txt +++ b/res/cardsfolder/firebolt.txt @@ -1,7 +1,10 @@ Name:Firebolt ManaCost:R Types:Sorcery -Text:Firebolt deals 2 damage to target creature or player. +Text:no text +A:SP$DealDamage | Cost$ R | Tgt$ TgtCP | NumDmg$ 2 | SpellDescription$ CARDNAME deals 2 damage to target creature or player. +A:SP$DealDamage | Cost$ 4 R | Tgt$ TgtCP | NumDmg$ 2 | Flashback$ True | CostDesc$ Flashback 4 R | SpellDescription$ (You may cast this card from your graveyard for its flashback cost. Then exile it.) + SVar:Rarity:Common SVar:Picture:http://resources.wizards.com/magic/cards/od/en-us/card30570.jpg SetInfo:ODY|Common|http://magiccards.info/scans/en/od/193.jpg diff --git a/res/cardsfolder/oust.txt b/res/cardsfolder/oust.txt index 2cf0abc7f9f..57aa4c2d731 100644 --- a/res/cardsfolder/oust.txt +++ b/res/cardsfolder/oust.txt @@ -1,7 +1,10 @@ Name:Oust ManaCost:W Types:Sorcery -Text:Put target creature into its owner's library second from the top. Its controller gains 3 life. +Text:no text +A:SP$ChangeZone | Cost$ W | Origin$ Battlefield | Destination$ Library | ValidTgts$ Creature | LibraryPosition$ 1 | SubAbility$ SVar=DBGainLife | SpellDescription$ Put target creature into its owner's library second from the top. Its controller gains 3 life. +# Library Position is zero indexed. So 1 is second from the top +SVar:DBGainLife:DB$GainLife | Defined$ TargetedController | LifeAmount$ 3 SVar:PlayMain1:TRUE SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/oust.jpg diff --git a/res/cardsfolder/path_to_exile.txt b/res/cardsfolder/path_to_exile.txt index fa71f1b077d..aef822a782a 100644 --- a/res/cardsfolder/path_to_exile.txt +++ b/res/cardsfolder/path_to_exile.txt @@ -2,6 +2,8 @@ Name:Path to Exile ManaCost:W Types:Instant Text:Exile target creature. Its controller may search his or her library for a basic land card, put that card onto the battlefield tapped, then shuffle his or her library. +A:SP$ChangeZone | Cost$ W | Origin$ Battlefield | Destination$ Exile | ValidTgts$ Creature | SubAbility$ SVar=DBChange | SpellDescription$ Exile target creature. Its controller may search his or her library for a basic land card, put that card onto the battlefield tapped, then shuffle his or her library. +SVar:DBChange:DB$ChangeZone | Origin$ Library | Destination$ Battlefield | Tapped$ True | ChangeType$ Land.Basic | ChangeNum$ 1 | Defined$ TargetedController SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/path_to_exile.jpg SetInfo:CFX|Uncommon|http://magiccards.info/scans/en/cfx/15.jpg diff --git a/res/cardsfolder/tinker.txt b/res/cardsfolder/tinker.txt index 884a77aad50..ed6377f1223 100644 --- a/res/cardsfolder/tinker.txt +++ b/res/cardsfolder/tinker.txt @@ -1,7 +1,8 @@ Name:Tinker ManaCost:2 U Types:Sorcery -Text:As an additional cost to cast Tinker, sacrifice an artifact.\r\nSearch your library for an artifact card and put that card onto the battlefield. Then shuffle your library. +Text:no text +A:SP$ChangeZone | Cost$ 2 U Sac<1/Artifact> | Origin$ Library | Destination$ Battlefield | ChangeType$ Artifact | ChangeNum$ 1 | SpellDescription$ Search your library for an artifact card and put that card onto the battlefield. Then shuffle your library. SVar:Rarity:Uncommon SVar:Picture:http://www.wizards.com/global/images/magic/general/tinker.jpg SetInfo:ULG|Uncommon|http://magiccards.info/scans/en/ul/45.jpg diff --git a/src/forge/AbilityFactory.java b/src/forge/AbilityFactory.java index 9557a6e3e70..d7bf6c7dc95 100644 --- a/src/forge/AbilityFactory.java +++ b/src/forge/AbilityFactory.java @@ -695,6 +695,15 @@ public class AbilityFactory { players.addAll(tgt.getTargetPlayers()); } + else if (defined.equals("TargetedController")){ + ArrayList list = getDefinedCards(card, "Targeted", sa); + + for(Card c : list){ + Player p = c.getController(); + if (!players.contains(p)) + players.add(p); + } + } else{ if (defined.equals("You") || defined.equals("Each")) players.add(sa.getActivatingPlayer()); diff --git a/src/forge/AbilityFactory_ChangeZone.java b/src/forge/AbilityFactory_ChangeZone.java index de581742588..d12c15af9fc 100644 --- a/src/forge/AbilityFactory_ChangeZone.java +++ b/src/forge/AbilityFactory_ChangeZone.java @@ -782,7 +782,7 @@ public class AbilityFactory_ChangeZone { else if (libraryPosition == 0) sb.append(" on top of").append(pronoun).append("owner's library."); else - sb.append(libraryPosition-1).append(" from the top of").append(pronoun).append("owner's library."); + sb.append(" ").append(libraryPosition+1).append(" from the top of").append(pronoun).append("owner's library."); } } @@ -890,4 +890,5 @@ public class AbilityFactory_ChangeZone { return AbilityFactory.getDefinedCards(sa.getSourceCard(), defined, sa).get(0); } + } diff --git a/src/forge/CardFactory_Instants.java b/src/forge/CardFactory_Instants.java index da4b285f269..d7e3071a665 100644 --- a/src/forge/CardFactory_Instants.java +++ b/src/forge/CardFactory_Instants.java @@ -2282,82 +2282,6 @@ public class CardFactory_Instants { card.addSpellAbility(spell); }//*************** END ************ END ************************** - //*************** START *********** START ************************** - else if (cardName.equals("Path to Exile")) { - SpellAbility spell = new Spell(card) { - private static final long serialVersionUID = 4752934806606319269L; - - @Override - public void resolve() { - if (AllZone.GameAction.isCardInPlay(getTargetCard()) - && CardFactoryUtil.canTarget(card, getTargetCard())) { - Player player = getTargetCard().getController(); - PlayerZone lib = AllZone.getZone(Constant.Zone.Library, player); - - //remove card from play - AllZone.GameAction.exile(getTargetCard()); - - //Retrieve basic land - CardList lands = new CardList(lib.getCards()); - lands = lands.getType("Basic"); - - if (player.equals(AllZone.HumanPlayer) && lands.size() > 0) { - String question = "Pick a basic land card to put onto the battlefield tapped?"; - - if (GameActionUtil.showYesNoDialog(card, question)) { - Object o = GuiUtils.getChoiceOptional("Choose a Basic Land", lands.toArray()); - - if (o != null) { - Card card = (Card) o; - lib.remove(card); - AllZone.Human_Battlefield.add(card); - card.tap(); - lands.remove(card); - player.shuffle(); - } - }// if choice yes - - } // player equals human - - // // player equals computer - else if (player.equals(AllZone.ComputerPlayer) && lands.size() > 0) { - Card card = lands.get(0); - lib.remove(card); - // hand.add(card); - AllZone.Computer_Battlefield.add(card); - card.tap(); - lands.remove(card); - player.shuffle(); - } - } - }//resolve() - - @Override - public boolean canPlayAI() { - CardList creature = new CardList(AllZone.Human_Battlefield.getCards()); - creature = creature.getType("Creature"); - creature = creature.filter(new CardListFilter() { - public boolean addCard(Card c) { - return CardFactoryUtil.canTarget(card, c); - } - }); - return creature.size() != 0 && (AllZone.Phase.getTurn() > 4); - } - - @Override - public void chooseTargetAI() { - CardList play = new CardList(AllZone.Human_Battlefield.getCards()); - Card target = CardFactoryUtil.AI_getBestCreature(play, card); - setTargetCard(target); - } - }; - spell.setBeforePayMana(CardFactoryUtil.input_targetCreature(spell)); - - card.clearSpellAbility(); - card.addSpellAbility(spell); - }//*************** END ************ END ************************** - - //*************** START *********** START ************************** else if(cardName.equals("Force of Will")) { final SpellAbility spell = new Spell(card) { diff --git a/src/forge/CardFactory_Sorceries.java b/src/forge/CardFactory_Sorceries.java index 5d775f3bb16..d51667bb8c7 100644 --- a/src/forge/CardFactory_Sorceries.java +++ b/src/forge/CardFactory_Sorceries.java @@ -1571,313 +1571,7 @@ public class CardFactory_Sorceries { spell.setBeforePayMana(target); }//*************** END ************ END *************************** - - - //*************** START *********** START ************************** - else if(cardName.equals("Firebolt")) { - final SpellAbility spell = new Spell(card) { - private static final long serialVersionUID = -4100322462753117988L; - - int damage = 2; - Card check; - - @Override - public boolean canPlayAI() { - PlayerZone compHand = AllZone.getZone(Constant.Zone.Hand, AllZone.ComputerPlayer); - CardList hand = new CardList(compHand.getCards()); - - if(AllZone.HumanPlayer.getLife() <= damage) return AllZone.GameAction.isCardInZone(card, - compHand); - - if(hand.size() >= 8) return true && AllZone.GameAction.isCardInZone(card, compHand); - - check = getFlying(); - return check != null && AllZone.GameAction.isCardInZone(card, compHand); - } - - @Override - public void chooseTargetAI() { - if(AllZone.HumanPlayer.getLife() <= damage) { - setTargetPlayer(AllZone.HumanPlayer); - return; - } - - Card c = getFlying(); - if((c == null) || (!check.equals(c))) { - c = getAnyCreature(); - if (c == null) { - setTargetPlayer(AllZone.HumanPlayer); - return; - } - } - - setTargetCard(c); - }//chooseTargetAI() - - //uses "damage" variable - Card getFlying() { - CardList flying = CardFactoryUtil.AI_getHumanCreature("Flying", card, true); - for(int i = 0; i < flying.size(); i++) - if(flying.get(i).getNetDefense() <= damage) return flying.get(i); - - return null; - } - - Card getAnyCreature() { - CardList creatures = CardFactoryUtil.AI_getHumanCreature(card, true); - for(int i = 0; i < creatures.size(); i++) - if(creatures.get(i).getNetDefense() <= damage) return creatures.get(i); - - return null; - } - - @Override - public void resolve() { - if(getTargetCard() != null) { - if(AllZone.GameAction.isCardInPlay(getTargetCard()) - && CardFactoryUtil.canTarget(card, getTargetCard())) { - Card c = getTargetCard(); - c.addDamage(damage, card); - } - } else getTargetPlayer().addDamage(damage, card); - } - };//SpellAbility - - final SpellAbility flashback = new Spell(card) { - - private static final long serialVersionUID = -4811352682106571233L; - int damage = 2; - Card check; - - @Override - public boolean canPlay() { - PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController()); - - return AllZone.GameAction.isCardInZone(card, grave) - && Phase.canCastSorcery(card.getController()); - } - - @Override - public boolean canPlayAI() { - if(AllZone.HumanPlayer.getLife() <= damage) return true; - - check = getFlying(); - return check != null; - } - - @Override - public void chooseTargetAI() { - if(AllZone.HumanPlayer.getLife() <= damage) { - setTargetPlayer(AllZone.HumanPlayer); - return; - } - - Card c = getFlying(); - if((c == null) || (!check.equals(c))) throw new RuntimeException(card - + " error in chooseTargetAI() - Card c is " + c + ", Card check is " + check); - - setTargetCard(c); - }//chooseTargetAI() - - //uses "damage" variable - Card getFlying() { - CardList flying = CardFactoryUtil.AI_getHumanCreature("Flying", card, true); - for(int i = 0; i < flying.size(); i++) - if(flying.get(i).getNetDefense() <= damage) return flying.get(i); - - return null; - } - - @Override - public void resolve() { - PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController()); - PlayerZone removed = AllZone.getZone(Constant.Zone.Exile, card.getController()); - - if(getTargetCard() != null) { - if(AllZone.GameAction.isCardInPlay(getTargetCard()) - && CardFactoryUtil.canTarget(card, getTargetCard())) { - Card c = getTargetCard(); - c.addDamage(damage, card); - } - } else getTargetPlayer().addDamage(damage, card); - - grave.remove(card); - removed.add(card); - - } - };//flashback - flashback.setFlashBackAbility(true); - flashback.setManaCost("4 R"); - flashback.setBeforePayMana(CardFactoryUtil.input_targetCreaturePlayer(flashback, true, false)); - flashback.setDescription("Flashback: 4 R"); - - card.clearSpellAbility(); - card.addSpellAbility(spell); - card.addSpellAbility(flashback); - - spell.setBeforePayMana(CardFactoryUtil.input_targetCreaturePlayer(spell, true, false)); - card.setFlashback(true); - - card.setSVar("PlayMain1", "TRUE"); - }//*************** END ************ END ************************** - - /* - //*************** START *********** START ************************** - else if (cardName.equals("Morbid Hunger")) { - final SpellAbility spell = new Spell(card) { - private static final long serialVersionUID = -5460524956297956293L; - - int damage = 3; - Card check; - - @Override - public boolean canPlayAI() { - PlayerZone compHand = AllZone.getZone(Constant.Zone.Hand, AllZone.ComputerPlayer); - CardList hand = new CardList(compHand.getCards()); - - if (AllZone.HumanPlayer.getLife() <= damage) return AllZone.GameAction.isCardInZone(card, compHand); - - if (hand.size() >= 8) return true && AllZone.GameAction.isCardInZone(card, compHand); - - check = getFlying(); - return check != null && AllZone.GameAction.isCardInZone(card, compHand); - } - - @Override - public void chooseTargetAI() { - if (AllZone.HumanPlayer.getLife() <= damage) { - setTargetPlayer(AllZone.HumanPlayer); - return; - } - - Card c = getFlying(); - if ((c == null) || (!check.equals(c))) { - c = getAnyCreature(); - if (c == null) { - setTargetPlayer(AllZone.HumanPlayer); - return; - } - } - - setTargetCard(c); - }//chooseTargetAI() - - //uses "damage" variable - Card getFlying() { - CardList flying = CardFactoryUtil.AI_getHumanCreature("Flying", card, true); - for (int i = 0; i < flying.size(); i++) - if (flying.get(i).getNetDefense() <= damage) return flying.get(i); - - return null; - } - - Card getAnyCreature() { - CardList creatures = CardFactoryUtil.AI_getHumanCreature(card, true); - for (int i = 0; i < creatures.size(); i++) - if (creatures.get(i).getNetDefense() <= damage) return creatures.get(i); - - return null; - } - - @Override - public void resolve() { - if (getTargetCard() != null) { - if (AllZone.GameAction.isCardInPlay(getTargetCard()) - && CardFactoryUtil.canTarget(card, getTargetCard())) { - Card c = getTargetCard(); - c.addDamage(damage, card); - card.getController().gainLife(3, card); - } - } else { - getTargetPlayer().addDamage(damage, card); - card.getController().gainLife(3, card); - } - } - };//SpellAbility - - final SpellAbility flashback = new Spell(card) { - private static final long serialVersionUID = 4193073989624300707L; - - int damage = 3; - Card check; - - @Override - public boolean canPlay() { - PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController()); - - return AllZone.GameAction.isCardInZone(card, grave) - && Phase.canCastSorcery(card.getController()); - } - - @Override - public boolean canPlayAI() { - if (AllZone.HumanPlayer.getLife() <= damage) return true; - - check = getFlying(); - return check != null; - } - - @Override - public void chooseTargetAI() { - if (AllZone.HumanPlayer.getLife() <= damage) { - setTargetPlayer(AllZone.HumanPlayer); - return; - } - - Card c = getFlying(); - if ((c == null) || (!check.equals(c))) throw new RuntimeException(card - + " error in chooseTargetAI() - Card c is " + c + ", Card check is " + check); - - setTargetCard(c); - }//chooseTargetAI() - - //uses "damage" variable - Card getFlying() { - CardList flying = CardFactoryUtil.AI_getHumanCreature("Flying", card, true); - for (int i = 0; i < flying.size(); i++) - if (flying.get(i).getNetDefense() <= damage) return flying.get(i); - - return null; - } - - @Override - public void resolve() { - PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController()); - PlayerZone removed = AllZone.getZone(Constant.Zone.Exile, card.getController()); - - if (getTargetCard() != null) { - if (AllZone.GameAction.isCardInPlay(getTargetCard()) - && CardFactoryUtil.canTarget(card, getTargetCard())) { - Card c = getTargetCard(); - c.addDamage(damage, card); - card.getController().gainLife(3, card); - } - } else { - getTargetPlayer().addDamage(damage, card); - card.getController().gainLife(3, card); - } - - grave.remove(card); - removed.add(card); - - } - };//flashback - flashback.setFlashBackAbility(true); - flashback.setManaCost("7 B B"); - flashback.setBeforePayMana(CardFactoryUtil.input_targetCreaturePlayer(flashback, true, false)); - flashback.setDescription("Flashback: 7 B B"); - - card.clearSpellAbility(); - card.addSpellAbility(spell); - card.addSpellAbility(flashback); - - spell.setBeforePayMana(CardFactoryUtil.input_targetCreaturePlayer(spell, true, false)); - card.setFlashback(true); - - card.setSVar("PlayMain1", "TRUE"); - }//*************** END ************ END ************************** - */ //*************** START *********** START ************************** else if(cardName.equals("Erratic Explosion")) { @@ -3439,122 +3133,6 @@ public class CardFactory_Sorceries { }//*************** END ************ END ************************** - //*************** START *********** START ************************** - else if(cardName.equals("Tinker")) { - final SpellAbility spell = new Spell(card) { - private static final long serialVersionUID = -5878957726445248334L; - - @Override - public boolean canPlay() { - PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController()); - CardList list = new CardList(play.getCards()); - list = list.getType("Artifact"); - - return list.size() > 0; - } - - @Override - public boolean canPlayAI() { - PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, AllZone.ComputerPlayer); - PlayerZone lib = AllZone.getZone(Constant.Zone.Library, AllZone.ComputerPlayer); - - CardList playList = new CardList(play.getCards()); - playList = playList.filter(new CardListFilter() { - public boolean addCard(Card c) { - return c.isArtifact() && CardUtil.getConvertedManaCost(c.getManaCost()) <= 2; - } - }); - - CardList libList = new CardList(lib.getCards()); - libList = libList.filter(new CardListFilter() { - public boolean addCard(Card c) { - return c.isArtifact() && CardUtil.getConvertedManaCost(c.getManaCost()) > 5; - } - }); - - if(libList.size() > 0 && playList.size() > 0) { - playList.shuffle(); - setTargetCard(playList.get(0)); - return true; - } - return false; - - } - - @Override - public void resolve() { - Card c = getTargetCard(); - - PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController()); - PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController()); - - if(AllZone.GameAction.isCardInPlay(c)) { - - AllZone.GameAction.sacrifice(c); - - if(card.getController().equals(AllZone.ComputerPlayer)) { - - CardList list = new CardList(lib.getCards()); - list = list.filter(new CardListFilter() { - public boolean addCard(Card c) { - return c.isArtifact() && CardUtil.getConvertedManaCost(c.getManaCost()) > 5; - } - }); - - if(list.size() > 0) { - Card crd = CardFactoryUtil.AI_getBestArtifact(list); - lib.remove(crd); - play.add(crd); - AllZone.ComputerPlayer.shuffle(); - } - } else //human - { - CardList list = new CardList(lib.getCards()); - list = list.filter(new CardListFilter() { - public boolean addCard(Card c) { - return c.isArtifact(); - } - }); - if(list.size() > 0) { - Object o = GuiUtils.getChoiceOptional("Select artifact", list.toArray()); - - if(o != null) { - Card crd = (Card) o; - lib.remove(crd); - play.add(crd); - - } - AllZone.HumanPlayer.shuffle(); - } - } - }//if isCardInPlay - } - }; - - Input runtime = new Input() { - private static final long serialVersionUID = -4653972223582155502L; - - @Override - public void showMessage() { - CardList choice = new CardList(); - choice.addAll(AllZone.Human_Battlefield.getCards()); - choice = choice.getType("Artifact"); - - boolean free = false; - if(this.isFree()) free = true; - - stopSetNext(CardFactoryUtil.input_targetSpecific(spell, choice, - "Select artifact to sacrifice.", false, free)); - } - }; - spell.setBeforePayMana(runtime); - - - card.clearSpellAbility(); - card.addSpellAbility(spell); - }//*************** END ************ END ************************** - - //*************** START *********** START ************************** else if(cardName.equals("Stitch in Time")) { final SpellAbility spell = new Spell(card) { @@ -3588,17 +3166,9 @@ public class CardFactory_Sorceries { public void resolve() { Player player = getTargetPlayer(); - PlayerZone lib = AllZone.getZone(Constant.Zone.Library, player); - PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, player); - CardList libList = new CardList(lib.getCards()); + int max = AllZoneUtil.getPlayerCardsInLibrary(player).size() / 2; - int max = libList.size() / 2; - - for(int i = 0; i < max; i++) { - Card c = libList.get(i); - lib.remove(c); - grave.add(c); - } + player.mill(max); } };//SpellAbility @@ -5239,69 +4809,6 @@ public class CardFactory_Sorceries { }//*************** END ************ END ************************** - //*************** START *********** START ************************** - else if (cardName.equals("Oust")) { - /* - * Put target creature into its owner's library second from the - * top. Its controller gains 3 life. - */ - final SpellAbility spell = new Spell(card){ - private static final long serialVersionUID = 4305992990847699048L; - - @Override - public void resolve() { - if (AllZone.GameAction.isCardInPlay(getTargetCard()) - && CardFactoryUtil.canTarget(card, getTargetCard())) { - - Card tgt = getTargetCard(); - if (null != tgt) { - if (tgt.isToken()) { - AllZone.GameAction.exile(tgt); - } else { - PlayerZone lib = AllZone.getZone(Constant.Zone.Library, tgt.getOwner()); - PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, tgt.getController()); - play.remove(tgt); - if (lib.size() > 0) { - lib.add(tgt, 1); //add second from top if lib not empty - } else { - lib.add(tgt); //add to top if lib is empty - } - }//else - tgt.getController().gainLife(3, card); - } - }//if isCardInPlay() && canTarget() - }//resolve() - - @Override - public boolean canPlayAI() { - return getHumanCreatures().size() != 0; - }//canPlayAI() - - @Override - public void chooseTargetAI() { - Card best = CardFactoryUtil.AI_getBestCreature(getHumanCreatures()); - setTargetCard(best); - }//chooseTargetAI() - - CardList getHumanCreatures() { - CardList list = new CardList(AllZone.Human_Battlefield.getCards()); - list = list.filter(new CardListFilter() { - public boolean addCard(Card c) { - return c.isCreature() - && c.getNetAttack() > 2 - && CardFactoryUtil.canTarget(card, c); - } - }); - return list; - }//getHumanCreature() - };//SpellAbility - - spell.setBeforePayMana(CardFactoryUtil.input_targetCreature(spell)); - card.clearSpellAbility(); - card.addSpellAbility(spell); - }//*************** END ************ END ************************** - - //*************** START *********** START ************************** else if(cardName.equals("Fireball")) { /* diff --git a/src/forge/GameAction.java b/src/forge/GameAction.java index 8a492774433..e77b55e311d 100644 --- a/src/forge/GameAction.java +++ b/src/forge/GameAction.java @@ -248,7 +248,7 @@ public class GameAction { // todo is this copy necessary? c = AllZone.CardFactory.copyCard(c); - if (libPosition == -1) + if (libPosition == -1 || libPosition > library.getCards().length) libPosition = library.getCards().length; library.add(c, libPosition);