From 795c4cbead7d0ba0d73ba6e82e3cb3dec22d58bb Mon Sep 17 00:00:00 2001 From: Hellfish Date: Thu, 22 Sep 2011 09:23:03 +0000 Subject: [PATCH] *Added Radiance parameter to AF_Destroy. *Converted Leave No Trace to Radiance parameter. --- res/cardsfolder/l/leave_no_trace.txt | 4 +--- .../abilityFactory/AbilityFactory_Destroy.java | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/res/cardsfolder/l/leave_no_trace.txt b/res/cardsfolder/l/leave_no_trace.txt index 825832f235c..2adfa12208a 100644 --- a/res/cardsfolder/l/leave_no_trace.txt +++ b/res/cardsfolder/l/leave_no_trace.txt @@ -2,9 +2,7 @@ Name:Leave No Trace ManaCost:1 W Types:Instant Text:no text -A:SP$ Destroy | Cost$ 1 W | ValidTgts$ Enchantment | TgtPrompt$ Select target enchantment | SubAbility$ SVar=DBDestroyAll | RememberTargets$ True | ForgetOtherTargets$ True | SpellDescription$ Radiance - Destroy target enchantment and each other enchantment that shares a color with it. -SVar:DBDestroyAll:DB$DestroyAll | ValidCards$ Remembered.Enchantment+Other+SharesColorWith | SubAbility$ DBCleanup -SVar:DBCleanup:DB$Cleanup | ClearRemembered$ True +A:SP$ Destroy | Cost$ 1 W | ValidTgts$ Enchantment | TgtPrompt$ Select target enchantment | Radiance$ True | SpellDescription$ Radiance - Destroy target enchantment and each other enchantment that shares a color with it. SVar:RemAIDeck:True SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/leave_no_trace.jpg diff --git a/src/main/java/forge/card/abilityFactory/AbilityFactory_Destroy.java b/src/main/java/forge/card/abilityFactory/AbilityFactory_Destroy.java index 53935e0c411..d3e9e7f5b4b 100644 --- a/src/main/java/forge/card/abilityFactory/AbilityFactory_Destroy.java +++ b/src/main/java/forge/card/abilityFactory/AbilityFactory_Destroy.java @@ -389,6 +389,7 @@ public class AbilityFactory_Destroy { Card card = sa.getSourceCard(); ArrayList tgtCards; + ArrayList untargetedCards = new ArrayList(); Target tgt = af.getAbTgt(); if (tgt != null) @@ -396,6 +397,12 @@ public class AbilityFactory_Destroy { else { tgtCards = AbilityFactory.getDefinedCards(sa.getSourceCard(), params.get("Defined"), sa); } + + if(params.containsKey("Radiance")) { + for(Card c : CardUtil.getRadiance(af.getHostCard(), tgtCards.get(0), params.get("ValidTgts").split(","))) { + untargetedCards.add(c); + } + } for (Card tgtC : tgtCards) { if (AllZoneUtil.isCardInPlay(tgtC) && (tgt == null || CardFactoryUtil.canTarget(card, tgtC))) { @@ -405,6 +412,15 @@ public class AbilityFactory_Destroy { AllZone.getGameAction().destroy(tgtC); } } + + for(Card unTgtC : untargetedCards) { + if(AllZoneUtil.isCardInPlay(unTgtC)) { + if(noRegen) + AllZone.getGameAction().destroyNoRegeneration(unTgtC); + else + AllZone.getGameAction().destroy(unTgtC); + } + } } // *********************************************************************************