diff --git a/res/card-pictures.txt b/res/card-pictures.txt index 933c247d4cb..ec228e75759 100644 --- a/res/card-pictures.txt +++ b/res/card-pictures.txt @@ -38,6 +38,7 @@ snow_covered_mountain.jpg http://www.wizards.com/global/images/magic/gene snow_covered_mountain1.jpg http://www.wizards.com/global/images/magic/general/snow_covered_mountain.jpg snow_covered_mountain2.jpg http://www.magickartenmarkt.de/img/cards/Ice_Age/snow_covered_mountain.jpg snow_covered_mountain3.jpg http://www.magickartenmarkt.de/img/cards/Ice_Age/snow_covered_mountain.jpg +psychic_drain.jpg http://www.wizards.com/global/images/magic/general/psychic_drain.jpg mind_shatter.jpg http://www.wizards.com/global/images/magic/general/mind_shatter.jpg mind_twist.jpg http://www.wizards.com/global/images/magic/general/mind_twist.jpg icy_manipulator.jpg http://www.wizards.com/global/images/magic/general/icy_manipulator.jpg diff --git a/res/cards.txt b/res/cards.txt index e9b95f6bfca..51d1969466a 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,8 @@ +Psychic Drain +X U B +Sorcery +no text + Mind Shatter X B B Sorcery diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index b0032b26203..d7409d4690d 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -17660,6 +17660,52 @@ public class CardFactory implements NewConstants { }//*************** END ************ END ************************** + //*************** START *********** START ************************** + else if (cardName.equals("Psychic Drain")) + { + final SpellAbility spell = new Spell(card){ + private static final long serialVersionUID = -5739635875246083152L; + + public void resolve() + { + String player = getTargetPlayer(); + + PlayerZone lib = AllZone.getZone(Constant.Zone.Library, player); + PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, player); + CardList libList = new CardList(lib.getCards()); + + for (int i = 0; i < card.getXManaCostPaid(); i++) { + Card c = libList.get(i); + lib.remove(c); + grave.add(c); + } + + AllZone.GameAction.getPlayerLife(card.getController()).addLife(card.getXManaCostPaid()); + card.setXManaCostPaid(0); + } + + public boolean canPlayAI() + { + String player = getTargetPlayer(); + PlayerZone lib = AllZone.getZone(Constant.Zone.Library, player); + CardList libList = new CardList(lib.getCards()); + + int humanLife = AllZone.Human_Life.getLife(); + int computerLife = AllZone.Computer_Life.getLife(); + + final int maxX = ComputerUtil.getAvailableMana().size() - 2; + return (maxX >= 3) && (humanLife >= computerLife) && (libList.size() > 0); + } + }; + spell.setDescription("Target player puts the top X cards of his or her library into his or her graveyard and you gain X life."); + spell.setStackDescription("Psychic Drain - Target player puts the top X cards of his or her library into his or her graveyard and you gain X life."); + spell.setBeforePayMana(CardFactoryUtil.input_targetPlayer(spell)); + card.clearSpellAbility(); + card.addSpellAbility(spell); + } + //*************** END ************ END ************************** + + // Cards with Cycling abilities // -1 means keyword "Cycling" not found if(hasKeyword(card, "Cycling") != -1) {