From 544131410e2da76abff5aaa060323005eb71ed67 Mon Sep 17 00:00:00 2001 From: moomarc Date: Wed, 21 Mar 2012 09:53:45 +0000 Subject: [PATCH] Added Keeper of the Dead Finally figured out how to add TargetedPlayerCtrl to isValid in Cards.java --- .gitattributes | 1 + res/cardsfolder/k/keeper_of_the_dead.txt | 15 +++++++++++++++ src/main/java/forge/Card.java | 17 +++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 res/cardsfolder/k/keeper_of_the_dead.txt diff --git a/.gitattributes b/.gitattributes index 36b7ea01397..00a64988bc2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4715,6 +4715,7 @@ res/cardsfolder/k/keep_watch.txt svneol=native#text/plain res/cardsfolder/k/keeper_of_kookus.txt svneol=native#text/plain res/cardsfolder/k/keeper_of_progenitus.txt -text svneol=unset#text/plain res/cardsfolder/k/keeper_of_the_beasts.txt -text +res/cardsfolder/k/keeper_of_the_dead.txt -text res/cardsfolder/k/keeper_of_the_flame.txt -text res/cardsfolder/k/keeper_of_the_light.txt -text res/cardsfolder/k/keeper_of_the_mind.txt -text diff --git a/res/cardsfolder/k/keeper_of_the_dead.txt b/res/cardsfolder/k/keeper_of_the_dead.txt new file mode 100644 index 00000000000..95db8ceab64 --- /dev/null +++ b/res/cardsfolder/k/keeper_of_the_dead.txt @@ -0,0 +1,15 @@ +Name:Keeper of the Dead +ManaCost:B B +Types:Creature Human Wizard +Text:no text +PT:1/2 +A:AB$ Pump | Cost$ B T | ValidTgts$ Opponent | TgtPrompt$ Choose target opponent with at least two fewer creature cards in his or her graveyard than you | CheckSVar$ X | SVarCompare$ GEY | SubAbility$ DeadKeepersDestroy | StackDescription$ None | SpellDescription$ Choose target opponent who had at least two fewer creature cards in his or her graveyard than you did as you activated this ability. Destroy target nonblack creature he or she controls. +SVar:DeadKeepersDestroy:DB$ Destroy | ValidTgts$ Creature.nonBlack+TargetedPlayerCtrl | TgtPrompt$ Select target nonblack creature targeted player controls +SVar:X:Count$InYourYard/Minus.2 +SVar:Y:Count$InOppYard +SVar:Z:Remembered$Amount +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/keeper_of_the_dead.jpg +SetInfo:EXO|Uncommon|http://magiccards.info/scans/en/ex/65.jpg +Oracle:{B}, {T}: Choose target opponent who had at least two fewer creature cards in his or her graveyard than you did as you activated this ability. Destroy target nonblack creature he or she controls. +End \ No newline at end of file diff --git a/src/main/java/forge/Card.java b/src/main/java/forge/Card.java index 6942b247241..4541fa7bb8a 100644 --- a/src/main/java/forge/Card.java +++ b/src/main/java/forge/Card.java @@ -34,6 +34,7 @@ import com.esotericsoftware.minlog.Log; import forge.Constant.Zone; import forge.card.CardCharacteristics; import forge.card.EditionInfo; +import forge.card.abilityfactory.AbilityFactory; import forge.card.cardfactory.CardFactoryUtil; import forge.card.cost.Cost; import forge.card.mana.ManaCost; @@ -6798,6 +6799,22 @@ public class Card extends GameEntity implements Comparable { } } } + + } else if (property.equals("TargetedPlayerCtrl")) { + for (final SpellAbility sa : source.getCharacteristics().getSpellAbility()) { + final SpellAbility parent = AbilityFactory.findParentsTargetedPlayer(sa); + if (parent != null) { + if (parent.getTarget() != null) { + for (final Object o : parent.getTarget().getTargetPlayers()) { + if (o instanceof Player) { + if (!this.getController().isPlayer((Player) o)) { + return false; + } + } + } + } + } + } } else if (property.startsWith("YouOwn")) { if (!this.getOwner().isPlayer(sourceController)) { return false;