From 5036c3360ec665e41314ce8ae5b2581caae64749 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 09:05:11 +0000 Subject: [PATCH] 1) update Target_Selection.input_targetValid() to call getValidCards(Tgts, controller) 2) add Witch Hunter (from The Dark) --- .gitattributes | 1 + res/cardsfolder/witch_hunter.txt | 9 +++++++ src/forge/Card.java | 2 +- src/forge/CardFactory_Creatures.java | 36 ++++++++++++++++++++++++++++ src/forge/Target_Selection.java | 2 +- 5 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 res/cardsfolder/witch_hunter.txt diff --git a/.gitattributes b/.gitattributes index 637deb58855..a687e0591db 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4649,6 +4649,7 @@ res/cardsfolder/wirewood_savage.txt -text svneol=native#text/plain res/cardsfolder/wispmare.txt -text svneol=native#text/plain res/cardsfolder/wistful_selkie.txt -text svneol=native#text/plain res/cardsfolder/wistful_thinking.txt -text svneol=native#text/plain +res/cardsfolder/witch_hunter.txt -text svneol=native#text/plain res/cardsfolder/witch_maw_nephilim.txt -text svneol=native#text/plain res/cardsfolder/withstand_death.txt -text svneol=native#text/plain res/cardsfolder/wits_end.txt -text svneol=native#text/plain diff --git a/res/cardsfolder/witch_hunter.txt b/res/cardsfolder/witch_hunter.txt new file mode 100644 index 00000000000..4c0a07247de --- /dev/null +++ b/res/cardsfolder/witch_hunter.txt @@ -0,0 +1,9 @@ +Name:Witch Hunter +ManaCost:2 W W +Types:Creature Human Cleric +Text:no text +PT:1/1 +K:abDamageTgtP T:1 +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/witch_hunter.jpg +End diff --git a/src/forge/Card.java b/src/forge/Card.java index d4e87dd8618..a2aa95a96b8 100644 --- a/src/forge/Card.java +++ b/src/forge/Card.java @@ -2436,7 +2436,7 @@ public class Card extends MyObservable { if (r == true) return true; } return false; - }//getValidCards + }//isValidCard public void setImmutable(boolean isImmutable) { this.isImmutable = isImmutable; diff --git a/src/forge/CardFactory_Creatures.java b/src/forge/CardFactory_Creatures.java index 3a7d1980551..2d196270243 100644 --- a/src/forge/CardFactory_Creatures.java +++ b/src/forge/CardFactory_Creatures.java @@ -20271,6 +20271,42 @@ public class CardFactory_Creatures { card.addSpellAbility(ability); }//*************** END ************ END ************************** + //*************** START *********** START ************************** + else if(cardName.equals("Witch Hunter")) { + final String Tgts[] = {"Creature+YouDontCtrl"}; + Target target = new Target("TgtV", "Select target creature you don't control.", Tgts); + final Ability_Cost abCost = new Ability_Cost("1 W W T", card.getName(), true); + + final SpellAbility ability = new Ability_Activated(card, abCost, target) { + private static final long serialVersionUID = -7134239527522243583L; + + @Override + public void resolve() { + Card target = getTargetCard(); + if( AllZone.GameAction.isCardInPlay(target) && CardFactoryUtil.canTarget(card, target)) { + AllZone.GameAction.moveToHand(target); + } + } + + @Override + public boolean canPlay() { + String opp = AllZone.GameAction.getOpponent(card.getController()); + CardList targets = AllZoneUtil.getCreaturesInPlay(opp); + return AllZoneUtil.isCardInPlay(card) && targets.size() > 0 && super.canPlay(); + } + + @Override + public boolean canPlayAI() { + return false; + } + };//SpellAbility + + card.addSpellAbility(ability); + ability.setDescription(abCost+"Return target creature an opponent controls to its owner's hand."); + ability.setStackDescription(card.getName() + " - return target creature to owner's hand."); + //ability.setBeforePayMana(runtime); + }//*************** END ************ END ************************** + // Cards with Cycling abilities // -1 means keyword "Cycling" not found diff --git a/src/forge/Target_Selection.java b/src/forge/Target_Selection.java index 5d8b04d944b..8b99cee2fbe 100644 --- a/src/forge/Target_Selection.java +++ b/src/forge/Target_Selection.java @@ -209,7 +209,7 @@ public class Target_Selection { CardList allCards = new CardList(); allCards.addAll(AllZone.Human_Play.getCards()); allCards.addAll(AllZone.Computer_Play.getCards()); - CardList choices = allCards.getValidCards(Tgts); + CardList choices = allCards.getValidCards(Tgts, sa.getSourceCard().getController()); boolean canTargetPlayer = false; for(String s : Tgts)