diff --git a/res/card-pictures.txt b/res/card-pictures.txt index 70a0bfe30cb..83cf3a84871 100644 --- a/res/card-pictures.txt +++ b/res/card-pictures.txt @@ -18,6 +18,18 @@ forest.jpg http://resources.wizards.com/magic/cards/unh/en-us/card73946.jpg forest1.jpg http://gatherer.wizards.com/handlers/image.ashx?type=card&multiverseid=2748 forest2.jpg http://gatherer.wizards.com/handlers/image.ashx?type=card&multiverseid=587 forest3.jpg http://gatherer.wizards.com/handlers/image.ashx?type=card&multiverseid=586 +merfolk_looter.jpg http://www.wizards.com/global/images/magic/general/merfolk_looter.jpg +thornscape_apprentice.jpg http://www.wizards.com/global/images/magic/general/thornscape_apprentice.jpg +scepter_of_insight.jpg http://www.wizards.com/global/images/magic/general/scepter_of_insight.jpg +ashas_favor.jpg http://www.wizards.com/global/images/magic/general/ashas_favor.jpg +frontline_sage.jpg http://www.wizards.com/global/images/magic/general/frontline_sage.jpg +blinding_mage.jpg http://www.wizards.com/global/images/magic/general/blinding_mage.jpg +ostiary_thrull.jpg http://www.wizards.com/global/images/magic/general/ostiary_thrull.jpg +whipcorder.jpg http://www.wizards.com/global/images/magic/general/whipcorder.jpg +borrowing_100000_arrows.jpg http://www.wizards.com/global/images/magic/general/borrowing_100000_arrows.jpg +cruel_bargain.jpg http://resources.wizards.com/magic/cards/po/en-us/card4214.jpg +infernal_contract.jpg http://www.wizards.com/global/images/magic/general/infernal_contract.jpg +theft_of_dreams.jpg http://www.wizards.com/global/images/magic/general/theft_of_dreams.jpg chilling_shade.jpg http://www.wizards.com/global/images/magic/general/chilling_shade.jpg arctic_flats.jpg http://www.wizards.com/global/images/magic/general/arctic_flats.jpg boreal_shelf.jpg http://www.wizards.com/global/images/magic/general/boreal_shelf.jpg diff --git a/res/cards.txt b/res/cards.txt index e30660d7a01..4fba07c10e4 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,137 @@ +Merfolk Looter +1 U +Creature Merfolk Rogue +no text +1/1 + +Thornscape Apprentice +G +Creature Human Wizard +no text +1/1 +TgtKpump R T: First strike + +Scepter of Insight +1 U U +Artifact +no text + +Asha's favor +2 W +Enchantment Aura +Enchanted creature gains flying, first strike and vigilance. +Enchant creature + +Frontline Sage +2 U +Creature Human Wizard +no text +0/1 +Exalted + +Blinding mage +1 W +Creature Human Wizard +no text +1/2 + +Ostiary Thrull +3 B +Creature Thrull +no text +2/2 + +Whipcorder +W W +Creature Human Soldier Rebel +no text +2/2 +Morph:W + +Borrowing 100,000 Arrows +2 U +Sorcery +no text +spDrawCards:Count$TypeOppCtrlTapped.Creature:Draw a card for each tapped creature target opponent controls.:Borrowing 100,000 Arrows - Draw cards. + +Cruel Bargain +B B B +Sorcery +no text +spDrawCards:4:Drawback$LoseLifeYou/Count$YourLifeTotal/HalfUp:Draw four cards.:You lose half your life, rounded up.:Cruel Bargain - Draw cards and lose half your life, rounded up. + +Infernal Contract +B B B +Sorcery +no text +spDrawCards:4:Drawback$LoseLifeYou/Count$YourLifeTotal/HalfUp:Draw four cards.:You lose half your life, rounded up.:Infernal Contract - Draw cards and lose half your life, rounded up. + +Theft of Dreams +2 U +Sorcery +no text +spDrawCards:Count$TypeOppCtrlTapped.Creature:Draw a card for each tapped creature target opponent controls.:Theft of Dreams - Draw cards. + +Night's Whisper +1 B +Sorcery +no text +spDrawCards:2:Drawback$YouLoseLife/2:You draw two cards and you lose 2 life.:Night's Whisper - draw 2 cards and lose 2 life. + +Words of Wisdom +1 U +Instant +no text +spDrawCards:2:Drawback$OppDraw/1:You draw two cards, then each other player draws a card.:Words of Wisdom - draw 2 cards and opponent draws 1 card. + +Counsel of the Soratami +2 U +Sorcery +no text +spDrawCards:2:Draw two cards.:Counsel of the Soratami - draw 2 cards. + +Touch of Brilliance +3 U +Sorcery +no text +spDrawCards:2:Draw two cards.:Touch of Brilliance - draw 2 cards. + +Inspiration +3 U +Sorcery +no text +spDrawCards:2:Draw two cards.:Inspiration - draw 2 cards. + +Concentrate +2 U U +Sorcery +no text +spDrawCards:3:Draw three cards.:Concentrate - draw 3 cards. + +Harmonize +2 G G +Sorcery +no text +spDrawCards:3:Draw three cards.:Harmonize - draw 3 cards. + +Ancestral Recall +U +Instant +no text +spDrawCardsTgt:3:Target player draws three cards.:Ancestral Recall - draw 3 cards. + +Minions' Murmurs +2 B B +Sorcery +no text +spDrawCards:Count$TypeYouCtrl.Creature:Drawback$YouLoseLife/X:You draw X cards and you lose X life, where X is the number of creatures you control.:Minion's Murmurs - draw cards and lose life. + +Brainstorm +U +Instant +no text +spDrawCards:3:Drawback$YouHandToLibrary/2/Top:Draw three cards, then put two cards from your hand on top of your library in any order.:Brainstorm - draw 3 cards and put 2 on top of your library. + Knighthood 2 W Enchantment @@ -222,7 +356,7 @@ Enchantment Aura Enchanted creature gets +2/+0 and has flying. Enchant creature -Benalish Hero +Benalish Trapper 1 W Creature Human Soldier no text @@ -2522,16 +2656,6 @@ Act of Treason Sorcery Untap target creature and gain control of it until end of turn. That creature gains haste until end of turn. (It can attack this turn.) -Touch of Brilliance -3 U -Sorcery -Draw two cards. - -Inspiration -3 U -Sorcery -Draw two cards. - Preemptive Strike 1 U Instant @@ -7980,11 +8104,6 @@ Legendary Creature Human Artificer no text 1/2 -Brainstorm -U -Instant -Draw three cards, then put two cards from your hand on top of your library in any order. - Jedit Ojanen of Efrava 3 G G G Legendary Creature Cat Warrior Lord @@ -11275,11 +11394,6 @@ Tendrils of Corruption Instant Tendrils of Corruption deals X damage to target creature and you gain X life, where X is the number of Swamps you control. -Minions' Murmurs -2 B B -Sorcery -You draw X cards and you lose X life, where X is the number of creatures you control. - Ichor Slick 2 B Sorcery @@ -11468,11 +11582,6 @@ Pyrohemia Enchantment At end of turn, if no creatures are in play, sacrifice Pyrohemia. -Harmonize -2 G G -Sorcery -Draw three cards. - Gaea's Anthem 1 G G Enchantment @@ -11682,11 +11791,6 @@ Creature Whale no text 3/5 -Concentrate -2 U U -Sorcery -Draw three cards. - Impulse 1 U Instant @@ -12088,11 +12192,6 @@ Infest Sorcery All creatures get -2/-2 until end of turn. -Night's Whisper -1 B -Sorcery -You draw two cards and you lose 2 life. - Do or Die 1 B Sorcery @@ -12373,11 +12472,6 @@ Remand Instant Counter target spell. If that spell is countered this way, put it into its owner's hand instead of into that player's graveyard. Draw a card. -Counsel of the Soratami -2 U -Sorcery -Draw two cards. - Counterspell U U Instant @@ -12393,11 +12487,6 @@ U Instant Look at the top card of your library. You may put that card on the bottom of your library. Draw a card. -Words of Wisdom -1 U -Instant -You draw two cards, then each other player draws a card. - Remove Soul 1 U Instant @@ -13170,11 +13259,6 @@ Creature Rat Relentless Rats gets +1/+1 for each other creature in play named Relentless Rats. A deck can have any number of cards named Relentless Rats. 2/2 -Ancestral Recall -U -Instant -Target player draws three cards. - Eternal Witness 1 G G Creature Human Shaman diff --git a/res/gui/display_layout.xml b/res/gui/display_layout.xml index fe383a754fe..26093eb2cad 100644 --- a/res/gui/display_layout.xml +++ b/res/gui/display_layout.xml @@ -1,5 +1,5 @@ - + diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index 4423f011a91..8577dfce9f3 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -1928,84 +1928,40 @@ public class CardFactory implements NewConstants { Tgt[0] = k[0].contains("Tgt"); final int NumCards[] = {-1}; - final String NumCardsType[] = {"none"}; - final boolean NumCardsTypeYouCtrl[] = {false}; - final boolean NumCardsTypeInPlay[] = {false}; - final boolean NumCardsTypeInYourYard[] = {false}; - final boolean NumCardsTypeInAllYards[] = {false}; - final boolean NumCardsDomain[] = {false}; - if (k[1].length() == 1) + final String NumCardsX[] = {"none"}; + + if (k[1].length() <= 2) NumCards[0] = Integer.parseInt(k[1]); else { - if (k[1].startsWith("NumCardsType")) - { - String kk[] = k[1].split("/"); - NumCardsType[0] = kk[1]; - NumCardsTypeYouCtrl[0] = kk[2].equals("YouCtrl"); - NumCardsTypeInPlay[0] = kk[2].equals("InPlay"); - NumCardsTypeInYourYard[0] = kk[2].equals("InYourYard"); - NumCardsTypeInAllYards[0] = kk[2].equals("InAllYards"); + if (k[1].startsWith("Count$")) + { + String kk[] = k[1].split("\\$"); + NumCardsX[0] = kk[1]; } - NumCardsDomain[0] = k[1].equals("Domain"); } - final int NumDiscard[] = {0}; - final String UnlessDiscardType[] = {"none"}; - final boolean AtRandom[] = {false}; - - final int NumLoseLife[] = {0}; - - final int NumToLibrary[] = {0}; - final String LibraryPosition[] = {"none"}; - - final int NumOppDraw[] = {0}; - + // drawbacks and descriptions + final String DrawBack[] = {"none"}; + final String spDesc[] = {"none"}; + final String stDesc[] = {"none"}; if (k.length > 2) { - if (k[2].contains("Discard")) + if (k[2].contains("Drawback$")) { - String kk[] = k[2].split("/"); - if (kk[1].equals("X")) - NumDiscard[0] = -1; - else - NumDiscard[0] = Integer.parseInt(kk[1]); - - if (kk.length > 2) - { - if (kk[2].equals("UnlessDiscardType")) - UnlessDiscardType[0] = kk[3]; - - AtRandom[0] = kk[2].equals("AtRandom"); - } + String kk[] = k[2].split("\\$"); + DrawBack[0] = kk[1]; + if (k.length > 3) + spDesc[0] = k[3]; + if (k.length > 4) + stDesc[0] = k[4]; } - - if (k[2].contains("LoseLife")) + else { - String kk[] = k[2].split("/"); - if (kk[1].equals("X")) - NumLoseLife[0] = -1; - else - NumLoseLife[0] = Integer.parseInt(kk[1]); - } - - if (k[2].contains("NumToLibrary")) - { - String kk[] = k[2].split("/"); - if (kk[1].equals("X")) - NumToLibrary[0] = -1; - else - NumToLibrary[0] = Integer.parseInt(kk[1]); - LibraryPosition[0] = kk[2]; - } - - if (k[2].contains("NumOppDraw")) - { - String kk[] = k[2].split("/"); - if (kk[1].equals("X")) - NumOppDraw[0] = -1; - else - NumOppDraw[0] = Integer.parseInt(kk[1]); + if (k.length > 2) + spDesc[0] = k[2]; + if (k.length > 3) + stDesc[0] = k[3]; } } @@ -2013,132 +1969,71 @@ public class CardFactory implements NewConstants { { private static final long serialVersionUID = -7049779241008089696L; + private int ncards; + public int getNumCards() { if (NumCards[0] != -1) return NumCards[0]; - int n = 0; - - String cardController = card.getController(); - PlayerZone myPlay = AllZone.getZone(Constant.Zone.Play, cardController); - PlayerZone opPlay = AllZone.getZone(Constant.Zone.Play, AllZone.GameAction.getOpponent(cardController)); - - PlayerZone myYard = AllZone.getZone(Constant.Zone.Graveyard, cardController); - PlayerZone opYard = AllZone.getZone(Constant.Zone.Graveyard, AllZone.GameAction.getOpponent(cardController)); - - CardList AllCards = new CardList(); - - if (! NumCardsType[0].equals("none")) - { - if (NumCardsTypeInYourYard[0] == false) - AllCards.addAll(myYard.getCards()); - - if (NumCardsTypeInAllYards[0] == false) - { - AllCards.addAll(myYard.getCards()); - AllCards.addAll(opYard.getCards()); - } - - if (NumCardsTypeYouCtrl[0] == true) - AllCards.addAll(myPlay.getCards()); - - if (NumCardsTypeInPlay[0] == true) - { - AllCards.addAll(myPlay.getCards()); - AllCards.addAll(opPlay.getCards()); - } - - AllCards = AllCards.filter(new CardListFilter() - { - public boolean addCard(Card c) - { - if (c.getType().contains(NumCardsType[0])) - return true; - - return false; - } - }); - - n = AllCards.size(); - } - if (NumCardsDomain[0] == true) - { - AllCards.addAll(myPlay.getCards()); - String basic[] = {"Forest", "Plains", "Mountain", "Island", "Swamp"}; - - for(int i = 0; i < basic.length; i++) - if (! AllCards.getType(basic[i]).isEmpty()) - n++; - } - - if (NumDiscard[0] == -1) - NumDiscard[0] = n; - if (NumLoseLife[0] == -1) - NumLoseLife[0] = n; - if (NumToLibrary[0] == -1) - NumToLibrary[0] = n; - if (NumOppDraw[0] == -1) - NumOppDraw[0] = n; - - return n; + if (! NumCardsX[0].equals("none")) + return CardFactoryUtil.xCount(card, NumCardsX[0]); + + return 0; } public boolean canPlayAI() { - int n = getNumCards(); + ncards = getNumCards(); int h = AllZone.getZone(Constant.Zone.Hand, Constant.Player.Computer).size(); + int hl = AllZone.getZone(Constant.Zone.Library, Constant.Player.Human).size(); + int cl = AllZone.getZone(Constant.Zone.Library, Constant.Player.Computer).size(); Random r = new Random(); - if (((h + n) - (NumDiscard[0] + NumToLibrary[0]) <= 7) - && (AllZone.GameAction.getPlayerLife(Constant.Player.Computer).getLife() - NumLoseLife[0]) >= 8 - && (r.nextInt(10) > 4)) + if (((hl - ncards) < 2) && Tgt[0]) { setTargetPlayer(Constant.Player.Computer); return true; } - + + if (((h + ncards) <= 7) && !((cl - ncards) < 1) && (r.nextInt(10) > 4)) + { + setTargetPlayer(Constant.Player.Computer); + return true; + } + return false; } public void resolve() { - int n = getNumCards(); + ncards = getNumCards(); String TgtPlayer = card.getController(); if (Tgt[0]) TgtPlayer = getTargetPlayer(); - for (int i=0; i < n; i++) + for (int i=0; i < ncards; i++) AllZone.GameAction.drawCard(TgtPlayer); - if (NumDiscard[0] > 0) - { - if (!UnlessDiscardType[0].equals("none")) - AllZone.GameAction.discardUnless(TgtPlayer, NumDiscard[0], UnlessDiscardType[0]); - else if (AtRandom[0] == true) - AllZone.GameAction.discardRandom(TgtPlayer, NumDiscard[0]); - else - AllZone.GameAction.discard(TgtPlayer, NumDiscard[0]); - } - - if (NumLoseLife[0] > 0) - AllZone.GameAction.getPlayerLife(TgtPlayer).subtractLife(NumLoseLife[0]); - - if (NumToLibrary[0] > 0) - AllZone.GameAction.handToLibrary(TgtPlayer, NumToLibrary[0], LibraryPosition[0]); - - if (NumOppDraw[0] > 0) - for (int i = 0; i < NumOppDraw[0]; i++) - AllZone.GameAction.drawCard(AllZone.GameAction.getOpponent(TgtPlayer)); + if (! DrawBack[0].equals("none")) + CardFactoryUtil.doDrawBack(DrawBack[0], ncards, card.getController(), AllZone.GameAction.getOpponent(card.getController()), TgtPlayer, card, null); } }; if (Tgt[0]) spDraw.setBeforePayMana(CardFactoryUtil.input_targetPlayer(spDraw)); - spDraw.setDescription(card.getText()); - card.setText(""); + if (! spDesc[0].equals("none")) + spDraw.setDescription(spDesc[0]); + else + spDraw.setDescription("Draw " + NumCards[0] + " cards."); + + if (! stDesc[0].equals("none")) + spDraw.setStackDescription(stDesc[0]); + else + spDraw.setStackDescription("You draw " + NumCards[0] + " cards."); + card.clearSpellAbility(); card.addSpellAbility(spDraw); }//spDrawCards @@ -4850,34 +4745,6 @@ public class CardFactory implements NewConstants { - //*************** START *********** START ************************** - else if(cardName.equals("Night's Whisper")) - { - final SpellAbility spell = new Spell(card) - { - private static final long serialVersionUID = -8594340516961923197L; - - public boolean canPlayAI() - { - return AllZone.Computer_Life.getLife()>2; - } - public void resolve() - { - //draw 2 cards, subtract 2 life - String player = card.getController(); - AllZone.GameAction.drawCard(player); - AllZone.GameAction.drawCard(player); - - AllZone.GameAction.getPlayerLife(player).subtractLife(2); - }//resolve() - }; - - card.clearSpellAbility(); - card.addSpellAbility(spell); - }//*************** END ************ END ************************** - - - //*************** START *********** START ************************** else if(cardName.equals("Infest")) { @@ -10371,68 +10238,6 @@ public class CardFactory implements NewConstants { card.addSpellAbility(spell); }//*************** END ************ END ************************** - - //*************** START *********** START ************************** - else if(cardName.equals("Words of Wisdom")) - { - SpellAbility spell = new Spell(card) - { - private static final long serialVersionUID = -7394898791285593737L; - - public void resolve() - { - AllZone.GameAction.drawCard(card.getController()); - AllZone.GameAction.drawCard(card.getController()); - - String opponent = AllZone.GameAction.getOpponent(card.getController()); - AllZone.GameAction.drawCard(opponent); - } - }; - card.clearSpellAbility(); - card.addSpellAbility(spell); - }//*************** END ************ END ************************** - - - - //*************** START *********** START ************************** - else if(cardName.equals("Counsel of the Soratami") || cardName.equals("Inspiration") || cardName.equals("Touch of Brilliance")) - { - SpellAbility spell = new Spell(card) - { - private static final long serialVersionUID = -1889094576060845154L; - - public void resolve() - { - AllZone.GameAction.drawCard(card.getController()); - AllZone.GameAction.drawCard(card.getController()); - } - }; - card.clearSpellAbility(); - card.addSpellAbility(spell); - }//*************** END ************ END ************************** - - - - //*************** START *********** START ************************** - else if(cardName.equals("Concentrate") || cardName.equals("Harmonize") ) - { - SpellAbility spell = new Spell(card) - { - private static final long serialVersionUID = -3561111468549060269L; - - public void resolve() - { - AllZone.GameAction.drawCard(card.getController()); - AllZone.GameAction.drawCard(card.getController()); - AllZone.GameAction.drawCard(card.getController()); - } - }; - card.clearSpellAbility(); - card.addSpellAbility(spell); - }//*************** END ************ END ************************** - - - //*************** START *********** START ************************** else if(cardName.equals("Amnesia")) { @@ -10535,32 +10340,7 @@ public class CardFactory implements NewConstants { } };//command card.addDestroyCommand(destroy); - } - - - //*************** START *********** START ************************** - else if(cardName.equals("Ancestral Recall")) - { - SpellAbility spell = new Spell(card) - { - private static final long serialVersionUID = 4696857462510589599L; - public void resolve() - { - AllZone.GameAction.drawCard(getTargetPlayer()); - AllZone.GameAction.drawCard(getTargetPlayer()); - AllZone.GameAction.drawCard(getTargetPlayer()); - } - public boolean canPlayAI() - { - return AllZone.Computer_Hand.getCards().length <= 5; - } - }; - spell.setChooseTargetAI(CardFactoryUtil.AI_targetComputer()); - - spell.setBeforePayMana(CardFactoryUtil.input_targetPlayer(spell)); - card.clearSpellAbility(); - card.addSpellAbility(spell); - }//*************** END ************ END ************************** + }//*************** START *********** START ************************** //*************** START *********** START ************************** else if(cardName.equals("Deep Analysis")) @@ -11616,46 +11396,6 @@ public class CardFactory implements NewConstants { card.setFlashback(true); }//*************** END ************ END ************************** - - - //*************** START *********** START ************************** - else if(cardName.equals("Minions' Murmurs")) - { - final SpellAbility spell = new Spell(card) - { - private static final long serialVersionUID = 7270026936498671973L; - - public boolean canPlayAI() - { - int n = countCreatures(); - return 0 < n && n < AllZone.Computer_Life.getLife(); - }//canPlayAI() - - public void resolve() - { - int n = countCreatures(); - for(int i = 0; i < n; i++) - AllZone.GameAction.drawCard(card.getController()); - - AllZone.GameAction.getPlayerLife(card.getController()).subtractLife(n); - }//resolve() - - int countCreatures() - { - PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController()); - CardList list = new CardList(play.getCards()); - list = list.getType("Creature"); - return list.size(); - } - };//SpellAbility - - card.clearSpellAbility(); - card.addSpellAbility(spell); - }//*************** END ************ END ************************** - - - - //*************** START *********** START ************************** else if(cardName.equals("Tendrils of Corruption")) { @@ -13818,87 +13558,6 @@ public class CardFactory implements NewConstants { }//*************** END ************ END ************************** - //*************** START *********** START ************************** - else if(cardName.equals("Brainstorm")) - { - final SpellAbility spell = new Spell(card) - { - private static final long serialVersionUID = -5722651962081633839L; - - public void resolve() - { - AllZone.GameAction.drawCard(card.getController()); - AllZone.GameAction.drawCard(card.getController()); - AllZone.GameAction.drawCard(card.getController()); - - String player = card.getController(); - if(player.equals(Constant.Player.Human)) - humanResolve(); - else - computerResolve(); - } - - public void humanResolve() - { - PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, Constant.Player.Human); - PlayerZone lib = AllZone.getZone(Constant.Zone.Library, Constant.Player.Human); - - CardList putOnTop = new CardList(hand.getCards()); - - Object o = AllZone.Display.getChoiceOptional("First card to put on top: ", putOnTop.toArray()); - if(o != null) - { - Card c1 = (Card)o; - putOnTop.remove(c1); - hand.remove(c1); - lib.add(c1,0); - } - o = AllZone.Display.getChoiceOptional("Second card to put on top: ", putOnTop.toArray()); - if(o != null) - { - Card c2 = (Card)o; - putOnTop.remove(c2); - hand.remove(c2); - lib.add(c2,0); - } - - } - - public void computerResolve() - { - PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, Constant.Player.Computer); - PlayerZone lib = AllZone.getZone(Constant.Zone.Library, Constant.Player.Computer); - - CardList putOnTop = new CardList(hand.getCards()); - - Card c1 = putOnTop.get(0); - putOnTop.remove(c1); - hand.remove(c1); - lib.add(c1, 0); - - Card c2 = putOnTop.get(0); - putOnTop.remove(c2); - hand.remove(c2); - lib.add(c2, 0); - //TODO: somehow find the least desirable cards at the moment, and put those on top - } - - public boolean canPlay() - { - PlayerZone lib = AllZone.getZone(Constant.Zone.Library, card.getController()); - - if (lib.size() >= 2) - return true; - else - return false; - } - - }; - card.clearSpellAbility(); - card.addSpellAbility(spell); - - - }//*************** END ************ END ************************** //*************** START *********** START ************************** else if(cardName.equals("Banishing Knack")) @@ -16013,7 +15672,7 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase(); }//*************** END ************ END ************************** - + //*************** START *********** START ************************** if (cardName.equals("Ior Ruin Expedition")) { final SpellAbility ability = new Ability(card, "0") @@ -16811,6 +16470,26 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase(); ability.setBeforePayMana(new Input_NoCost_TapAbility(ability)); }//*************** END ************ END ************************** + //*************** START *********** START ************************** + if(cardName.equals("Scepter of Insight")) + { + final SpellAbility ability = new Ability_Tap(card, "3 U") + { + private static final long serialVersionUID = -3567474686431369541L; + + public boolean canPlayAI() {return AllZone.Phase.getPhase().equals(Constant.Phase.Main2);} + + public void resolve() + { + AllZone.GameAction.drawCard(card.getController()); + } + + };//SpellAbility + card.addSpellAbility(ability); + ability.setDescription("3 U, tap: Draw a card."); + ability.setStackDescription(card.getName() + " - draw a card."); + }//*************** END ************ END ************************** + // Cards with Cycling abilities // -1 means keyword "Cycling" not found diff --git a/src/forge/CardFactory_Auras.java b/src/forge/CardFactory_Auras.java index ebcda421214..91f4d4cfa6f 100644 --- a/src/forge/CardFactory_Auras.java +++ b/src/forge/CardFactory_Auras.java @@ -5342,6 +5342,109 @@ class CardFactory_Auras { spell.setBeforePayMana(CardFactoryUtil.input_targetCreature(spell)); }//*************** END ************ END ************************** + + //*************** START *********** START ************************** + if(cardName.equals("Asha's Favor")) + { + final SpellAbility spell = new Spell(card) + { + + private static final long serialVersionUID = 8803901572203454960L; + public boolean canPlayAI() + { + CardList list = new CardList(AllZone.Computer_Play.getCards()); + list = list.getType("Creature"); + + if(list.isEmpty()) + return false; + + //else + CardListUtil.sortAttack(list); + CardListUtil.sortFlying(list); + + for (int i=0;i 0; + } + }; + card.clearSpellAbility(); + card.addSpellAbility(spell); + } + //*************** END ************ END ************************** + + //*************** START *********** START ************************** + else if(cardName.equals("Tethered Griffin")) + { + SpellAbility spell = new Spell_Permanent(card) + { + private static final long serialVersionUID = -7872917651421012893L; + + public boolean canPlayAI() + { + CardList list = new CardList(AllZone.getZone(Constant.Zone.Play, Constant.Player.Computer).getCards()); + list = list.getType("Enchantment"); + return super.canPlay() && list.size() > 0; + } + }; + card.clearSpellAbility(); + card.addSpellAbility(spell); + } + //*************** END ************ END ************************** + // Cards with Cycling abilities diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index 10f06dbf655..76ac5e140bf 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -8771,13 +8771,11 @@ public class GameActionUtil brigadiers.addAll(cPlay.getCards()); brigadiers = brigadiers.getName("Aven Brigadier"); return brigadiers.size()-1; - } public void execute() { - - + CardList creature = new CardList(); creature.addAll(AllZone.Human_Play.getCards()); creature.addAll(AllZone.Computer_Play.getCards()); @@ -8788,8 +8786,13 @@ public class GameActionUtil { Card c = creature.get(i); otherBrigadiers = countOtherBrigadiers(); - c.setOtherAttackBoost(2*otherBrigadiers); - c.setOtherDefenseBoost(2*otherBrigadiers); + int boost = 0; + if (c.getType().contains("Bird")) + boost++; + if (c.getType().contains("Soldier")) + boost++; + c.setOtherAttackBoost(boost*otherBrigadiers); + c.setOtherDefenseBoost(boost*otherBrigadiers); }// for inner }// execute() @@ -8851,8 +8854,7 @@ public class GameActionUtil private int countOtherScions(Card c) { - PlayerZone play = AllZone.getZone(Constant.Zone.Play, c - .getController()); + PlayerZone play = AllZone.getZone(Constant.Zone.Play, c.getController()); CardList scions = new CardList(play.getCards()); scions = scions.getName("Scion of Oona"); return scions.size()-1; @@ -8873,10 +8875,19 @@ public class GameActionUtil { Card c = creature.get(i); otherScions = countOtherScions(c); - c.setOtherAttackBoost(otherScions); - c.setOtherDefenseBoost(otherScions); - if (!c.getExtrinsicKeyword().contains("Shroud") && otherScions > 0) - c.addExtrinsicKeyword("Shroud"); + if (c.getType().equals("Faerie") || c.getKeyword().contains("Changeling")) + { + c.setOtherAttackBoost(otherScions); + c.setOtherDefenseBoost(otherScions); + if (!c.getExtrinsicKeyword().contains("Shroud") && otherScions > 0) + c.addExtrinsicKeyword("Shroud"); + } + else + { + c.setOtherAttackBoost(0); + c.setOtherDefenseBoost(0); + c.removeExtrinsicKeyword("Shroud"); + } }// for inner }// execute() diff --git a/src/forge/Gui_DeckEditorNew.java b/src/forge/Gui_DeckEditorNew.java index d23a677b740..815a04b39fa 100755 --- a/src/forge/Gui_DeckEditorNew.java +++ b/src/forge/Gui_DeckEditorNew.java @@ -48,7 +48,9 @@ import forge.properties.NewConstants.LANG; * @author Clemens Koza */ public class Gui_DeckEditorNew extends JFrame implements CardDetail, NewConstants.GUI.GuiDeckEditor { - public static void main(String[] args) { + private static final long serialVersionUID = 680850452718332565L; + + public static void main(String[] args) { // JFrame jf = new JFrame(); Gui_DeckEditorNew jf = new Gui_DeckEditorNew(); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);