From e44bda4b1c4972f65f1bd9d285ce47df34f6b6cf Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 04:17:50 +0000 Subject: [PATCH] add Kor Line-Slinger from Rise of the Eldrazi --- res/card-pictures.txt | 1 + res/cards.txt | 6 +++ src/forge/CardFactory_Creatures.java | 56 ++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+) diff --git a/res/card-pictures.txt b/res/card-pictures.txt index dbec39fcab7..0bcf5b5d7b5 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 +kor_line_slinger.jpg http://www.wizards.com/global/images/magic/general/kor_line_slinger.jpg dawnglare_invoker.jpg http://www.wizards.com/global/images/magic/general/dawnglare_invoker.jpg perimeter_captain.jpg http://www.wizards.com/global/images/magic/general/perimeter_captain.jpg serpent_of_the_endless_sea.jpg http://www.wizards.com/global/images/magic/general/serpent_of_the_endless_sea.jpg diff --git a/res/cards.txt b/res/cards.txt index e3e8ea5f338..2424c5ab383 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,9 @@ +Kor Line-Slinger +1 W +Creature Kor Scout +tap: Tap target creature with power 3 or less. +0/1 + Dawnglare Invoker 2 W Creature Kor Wizard diff --git a/src/forge/CardFactory_Creatures.java b/src/forge/CardFactory_Creatures.java index 1c22d7948e8..d6f443936fe 100644 --- a/src/forge/CardFactory_Creatures.java +++ b/src/forge/CardFactory_Creatures.java @@ -17871,6 +17871,62 @@ public class CardFactory_Creatures { //ability.setStackDescription(cardName + " - Rearrange the top X cards in your library in any order."); }//*************** END ************ END ************************** + //*************** START *********** START ************************** + if(cardName.equals("Kor Line-Slinger")) { + final Ability_Tap ability = new Ability_Tap(card) { + private static final long serialVersionUID = -5883773208646266056L; + + @Override + public boolean canPlayAI() { + CardList list = new CardList(AllZone.Human_Play.getCards()); + list = list.filter(new CardListFilter() { + public boolean addCard(Card c) { + return c.isUntapped() &&c.isCreature() && + c.getNetAttack() <= 3 && CardFactoryUtil.canTarget(card, c); + } + }); + if (list.isEmpty()) return false; + + CardListUtil.sortAttack(list); + CardListUtil.sortFlying(list); + setTargetCard(list.get(0)); + return true; + }//canPlayAI() + + @Override + public void resolve() { + Card c = getTargetCard(); + if(AllZone.GameAction.isCardInPlay(c) && c.isUntapped()) { + c.tap(); + } + }//resolve + };//SpellAbility + + Input target = new Input() { + private static final long serialVersionUID = 5727787884951469579L; + @Override + public void showMessage() { + AllZone.Display.showMessage("Select target Creature to tap"); + ButtonUtil.enableOnlyCancel(); + } + @Override + public void selectButtonCancel() { + stop(); + } + @Override + public void selectCard(Card c, PlayerZone zone) { + if(zone.is(Constant.Zone.Play) && c.isUntapped() && + c.isCreature() && (c.getNetAttack() <= 3)) { + ability.setTargetCard(c); + AllZone.Stack.add(ability); + stop(); + } + } + };//input + card.addSpellAbility(ability); + ability.setBeforePayMana(target); + }//*************** END ************ END ************************** + // Cards with Cycling abilities // -1 means keyword "Cycling" not found if(shouldCycle(card) != -1) {