From d89976fd0c48a61c2c2f63c4129661a9fcabe4a7 Mon Sep 17 00:00:00 2001 From: Sloth Date: Sun, 13 Nov 2011 14:01:26 +0000 Subject: [PATCH] - Added the optional parameter AffectedZone to CantTarget. - Added Ground Seal. --- .gitattributes | 1 + res/cardsfolder/g/ground_seal.txt | 13 +++++++++++++ .../forge/card/spellability/TargetSelection.java | 2 +- .../card/staticability/StaticAbilityCantTarget.java | 12 ++++++++++++ 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 res/cardsfolder/g/ground_seal.txt diff --git a/.gitattributes b/.gitattributes index f43c62a7012..0774c7eecc4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3569,6 +3569,7 @@ res/cardsfolder/g/grotag_siege_runner.txt svneol=native#text/plain res/cardsfolder/g/grotag_thrasher.txt svneol=native#text/plain res/cardsfolder/g/grotesque_hybrid.txt svneol=native#text/plain res/cardsfolder/g/ground_rift.txt svneol=native#text/plain +res/cardsfolder/g/ground_seal.txt -text res/cardsfolder/g/groundbreaker.txt svneol=native#text/plain res/cardsfolder/g/groundling_pouncer.txt svneol=native#text/plain res/cardsfolder/g/groundskeeper.txt svneol=native#text/plain diff --git a/res/cardsfolder/g/ground_seal.txt b/res/cardsfolder/g/ground_seal.txt new file mode 100644 index 00000000000..68c1371b609 --- /dev/null +++ b/res/cardsfolder/g/ground_seal.txt @@ -0,0 +1,13 @@ +Name:Ground Seal +ManaCost:1 G +Types:Enchantment +Text:no text +T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDraw | TriggerDescription$ When CARDNAME enters the battlefield, draw a card. +SVar:TrigDraw:AB$Draw | Cost$ 0 | Defined$ You | NumCards$ 1 +S:Mode$ CantTarget | AffectedZone$ Graveyard | Description$ Cards in graveyards can't be the targets of spells or abilities. +SVar:RemRandomDeck:True +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/ground_seal.jpg +SetInfo:ODY|Rare|http://magiccards.info/scans/en/od/242.jpg +Oracle:When Ground Seal enters the battlefield, draw a card.\nCards in graveyards can't be the targets of spells or abilities. +End \ No newline at end of file diff --git a/src/main/java/forge/card/spellability/TargetSelection.java b/src/main/java/forge/card/spellability/TargetSelection.java index e49400696ef..8746c0f428e 100644 --- a/src/main/java/forge/card/spellability/TargetSelection.java +++ b/src/main/java/forge/card/spellability/TargetSelection.java @@ -241,7 +241,7 @@ public class TargetSelection { } final CardList choices = AllZoneUtil.getCardsIn(zone).getValidCards(this.target.getValidTgts(), - this.ability.getActivatingPlayer(), this.ability.getSourceCard()); + this.ability.getActivatingPlayer(), this.ability.getSourceCard()).getTargetableCards(this.ability); ArrayList objects = new ArrayList(); if (tgt.isUniqueTargets()) { diff --git a/src/main/java/forge/card/staticability/StaticAbilityCantTarget.java b/src/main/java/forge/card/staticability/StaticAbilityCantTarget.java index 7e6bb900b0d..b7049f818a1 100644 --- a/src/main/java/forge/card/staticability/StaticAbilityCantTarget.java +++ b/src/main/java/forge/card/staticability/StaticAbilityCantTarget.java @@ -3,7 +3,9 @@ package forge.card.staticability; import java.util.HashMap; import forge.Card; +import forge.Constant; import forge.Player; +import forge.Constant.Zone; import forge.card.spellability.SpellAbility; /** @@ -17,6 +19,16 @@ public class StaticAbilityCantTarget { final Card source = sa.getSourceCard(); final Player activator = sa.getActivatingPlayer(); + if (params.containsKey("AffectedZone")) { + if(!card.isInZone(Zone.smartValueOf(params.get("AffectedZone")))) { + return false; + } + } else { // default zone is battlefield + if (!card.isInZone(Constant.Zone.Battlefield)) { + return false; + } + } + if (params.containsKey("Spell") && !sa.isSpell()) { return false; }