From 589b69f3eba0545b17d12f785a8c1e3b2cbd463c Mon Sep 17 00:00:00 2001 From: Sloth Date: Tue, 27 Sep 2011 18:09:25 +0000 Subject: [PATCH] - Added support for targeting in AF DestroyAll. - Added Primeval Light by Night Shadow. --- .gitattributes | 1 + res/cardsfolder/p/primeval_light.txt | 10 ++++++++++ .../abilityFactory/AbilityFactory_Destroy.java | 17 +++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 res/cardsfolder/p/primeval_light.txt diff --git a/.gitattributes b/.gitattributes index 213f1475732..75af1b93634 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5900,6 +5900,7 @@ res/cardsfolder/p/primal_plasma.txt svneol=native#text/plain res/cardsfolder/p/primal_rage.txt svneol=native#text/plain res/cardsfolder/p/primal_whisperer.txt svneol=native#text/plain res/cardsfolder/p/primalcrux.txt svneol=native#text/plain +res/cardsfolder/p/primeval_light.txt -text res/cardsfolder/p/primeval_shambler.txt svneol=native#text/plain res/cardsfolder/p/primeval_titan.txt svneol=native#text/plain res/cardsfolder/p/primoc_escapee.txt svneol=native#text/plain diff --git a/res/cardsfolder/p/primeval_light.txt b/res/cardsfolder/p/primeval_light.txt new file mode 100644 index 00000000000..ab2714fbe2a --- /dev/null +++ b/res/cardsfolder/p/primeval_light.txt @@ -0,0 +1,10 @@ +Name:Primeval Light +ManaCost:3 G +Types:Sorcery +Text:no text +A:SP$ DestroyAll | Cost$ 3 G | ValidTgts$ Player | TgtPrompt$ Select target player | ValidCards$ Enchantment | SpellDescription$ Destroy all Enchantments target player controls. +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/primeval_light.jpg +SetInfo:GPT|Uncommon|http://magiccards.info/scans/en/gp/93.jpg +Oracle:Destroy all enchantments target player controls. +End \ No newline at end of file diff --git a/src/main/java/forge/card/abilityFactory/AbilityFactory_Destroy.java b/src/main/java/forge/card/abilityFactory/AbilityFactory_Destroy.java index 868af1d4501..b8ea780f793 100644 --- a/src/main/java/forge/card/abilityFactory/AbilityFactory_Destroy.java +++ b/src/main/java/forge/card/abilityFactory/AbilityFactory_Destroy.java @@ -618,6 +618,14 @@ public class AbilityFactory_Destroy { CardList humanlist = AllZone.getHumanPlayer().getCardsIn(Zone.Battlefield); CardList computerlist = AllZone.getComputerPlayer().getCardsIn(Zone.Battlefield); + + Target tgt = sa.getTarget(); + + if (sa.getTarget() != null) { + tgt.resetTargets(); + sa.getTarget().addTarget(AllZone.getHumanPlayer()); + computerlist.clear(); + } humanlist = humanlist.getValidCards(Valid.split(","), source.getController(), source); computerlist = computerlist.getValidCards(Valid.split(","), source.getController(), source); @@ -665,6 +673,11 @@ public class AbilityFactory_Destroy { HashMap params = af.getMapParams(); Card card = sa.getSourceCard(); + + Target tgt = af.getAbTgt(); + Player targetPlayer = null; + if (tgt != null) + targetPlayer = tgt.getTargetPlayers().get(0); String Valid = ""; @@ -677,6 +690,10 @@ public class AbilityFactory_Destroy { Valid = Valid.replace("X", Integer.toString(AbilityFactory.calculateAmount(card, "X", sa))); CardList list = AllZoneUtil.getCardsIn(Zone.Battlefield); + + if (targetPlayer != null) { + list = list.getController(targetPlayer); + } list = AbilityFactory.filterListByType(list, Valid, sa);