diff --git a/res/card-pictures.txt b/res/card-pictures.txt index a89fdec8ac1..d15c1635253 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 +hedron_matrix.jpg http://www.wizards.com/global/images/magic/general/hedron_matrix.jpg perish_the_thought.jpg http://www.wizards.com/global/images/magic/general/perish_the_thought.jpg khalni_heart_expedition.jpg http://www.wizards.com/global/images/magic/general/khalni_heart_expedition.jpg suffer_the_past.jpg http://www.wizards.com/global/images/magic/general/suffer_the_past.jpg diff --git a/res/cards.txt b/res/cards.txt index 1aac1e8c268..5c68ea84f8b 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,8 @@ +Hedron Matrix +4 +Artifact Equipment +Equipped creature gets +X/+X, where X is its converted mana cost. + Perish the Thought 2 B Sorcery diff --git a/src/forge/CardFactory_Equipment.java b/src/forge/CardFactory_Equipment.java index 813f414bf6a..f50efd22d0e 100644 --- a/src/forge/CardFactory_Equipment.java +++ b/src/forge/CardFactory_Equipment.java @@ -486,6 +486,123 @@ class CardFactory_Equipment { } //*************** END ************ END ************************** + //*************** START *********** START ************************** + if(cardName.equals("Hedron Matrix")) { + /* + * Equipped creature gets +X/+X, where X is its converted mana cost. + */ + final Ability equip = new Ability(card, "4") { + + //not changed + @Override + public void resolve() { + if(AllZone.GameAction.isCardInPlay(getTargetCard()) + && CardFactoryUtil.canTarget(card, getTargetCard())) { + if(card.isEquipping()) { + Card crd = card.getEquipping().get(0); + if(crd.equals(getTargetCard())) return; + + card.unEquipCard(crd); + } + card.equipCard(getTargetCard()); + } + } + + //not changed + @Override + public boolean canPlay() { + return AllZone.getZone(card).is(Constant.Zone.Play) + && AllZone.Phase.getActivePlayer().equals(card.getController()) + && (AllZone.Phase.getPhase().equals("Main1") || AllZone.Phase.getPhase().equals( + "Main2")); + } + + //not changed + @Override + public boolean canPlayAI() { + return getCreature().size() != 0 && !card.isEquipping(); + } + + //not changed + @Override + public void chooseTargetAI() { + Card target = CardFactoryUtil.AI_getBestCreature(getCreature()); + setTargetCard(target); + } + + //not changed + CardList getCreature() { + CardList list = new CardList(AllZone.Computer_Play.getCards()); + list = list.filter(new CardListFilter() { + public boolean addCard(Card c) { + return c.isCreature() && (!CardFactoryUtil.AI_doesCreatureAttack(c)) + && CardFactoryUtil.canTarget(card, c) + && (!c.getKeyword().contains("Defender")); + } + }); + + // is there at least 1 Loxodon Punisher to target + CardList equipMagnetList = list.getName("Loxodon Punisher"); + if (equipMagnetList.size() != 0) { + return equipMagnetList; + } + + return list; + }//getCreature() + + };//equip ability + + + Command onEquip = new Command() { + public void execute() { + if(card.isEquipping()) { + Card crd = card.getEquipping().get(0); + int pump = CardUtil.getConvertedManaCost(crd.getManaCost()); + crd.addSemiPermanentAttackBoost(pump); + crd.addSemiPermanentDefenseBoost(pump); + } + }//execute() + };//Command + + + Command onUnEquip = new Command() { + public void execute() { + if(card.isEquipping()) { + Card crd = card.getEquipping().get(0); + int pump = CardUtil.getConvertedManaCost(crd.getManaCost()); + crd.addSemiPermanentAttackBoost(-pump); + crd.addSemiPermanentDefenseBoost(-pump); + + } + + }//execute() + };//Command + + + Input runtime = new Input() { + + @Override + public void showMessage() { + //get all creatures you control + CardList list = new CardList(); + list.addAll(AllZone.Human_Play.getCards()); + list = list.getType("Creature"); + + stopSetNext(CardFactoryUtil.input_targetSpecific(equip, list, + "Select target creature to equip", true, false)); + } + };//Input + + equip.setBeforePayMana(runtime); + + equip.setDescription("Equip: 4"); + card.addSpellAbility(equip); + + card.addEquipCommand(onEquip); + card.addUnEquipCommand(onUnEquip); + + } //*************** END ************ END ************************** + if (shouldEquip(card) != -1) { int n = shouldEquip(card);