From 3562047beb24a79fe4d0674453eff1c8f213684a Mon Sep 17 00:00:00 2001 From: LoneFox Date: Tue, 27 Oct 2015 13:26:18 +0200 Subject: [PATCH] Fix some cards that care about subtypes to include non-creature cards of the subtype --- .../mage/sets/onslaught/BrightstoneRitual.java | 10 +++++++++- .../src/mage/sets/onslaught/CabalArchon.java | 17 ++++++++++------- .../src/mage/sets/onslaught/FeedingFrenzy.java | 16 ++++++++++++---- .../mage/sets/onslaught/RiptideLaboratory.java | 13 +++++++------ .../mage/sets/onslaught/VoiceOfTheWoods.java | 10 +++++----- .../src/mage/sets/onslaught/Wellwisher.java | 4 ++-- .../src/mage/sets/onslaught/WirewoodHerald.java | 4 ++-- .../src/mage/sets/onslaught/WirewoodLodge.java | 13 +++++++------ .../src/mage/sets/onslaught/WirewoodSavage.java | 4 ++-- 9 files changed, 56 insertions(+), 35 deletions(-) diff --git a/Mage.Sets/src/mage/sets/onslaught/BrightstoneRitual.java b/Mage.Sets/src/mage/sets/onslaught/BrightstoneRitual.java index 896507e5b5..5ed1e6e408 100644 --- a/Mage.Sets/src/mage/sets/onslaught/BrightstoneRitual.java +++ b/Mage.Sets/src/mage/sets/onslaught/BrightstoneRitual.java @@ -34,7 +34,9 @@ import mage.abilities.effects.common.DynamicManaEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; +import mage.filter.FilterPermanent; import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * @@ -42,12 +44,18 @@ import mage.filter.common.FilterCreaturePermanent; */ public class BrightstoneRitual extends CardImpl { + private static final FilterPermanent filter = new FilterPermanent("Goblin on the battlefield"); + + static { + filter.add(new SubtypePredicate("Goblin")); + } + public BrightstoneRitual(UUID ownerId) { super(ownerId, 191, "Brightstone Ritual", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); this.expansionSetCode = "ONS"; // Add {R} to your mana pool for each Goblin on the battlefield. - this.getSpellAbility().addEffect(new DynamicManaEffect(Mana.RedMana, new PermanentsOnBattlefieldCount(new FilterCreaturePermanent("Goblin","Goblin on the battlefield")))); + this.getSpellAbility().addEffect(new DynamicManaEffect(Mana.RedMana, new PermanentsOnBattlefieldCount(filter))); } public BrightstoneRitual(final BrightstoneRitual card) { diff --git a/Mage.Sets/src/mage/sets/onslaught/CabalArchon.java b/Mage.Sets/src/mage/sets/onslaught/CabalArchon.java index e67cd3fa84..9f666a50fe 100644 --- a/Mage.Sets/src/mage/sets/onslaught/CabalArchon.java +++ b/Mage.Sets/src/mage/sets/onslaught/CabalArchon.java @@ -33,25 +33,26 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.TargetPlayer; -import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetControlledPermanent; /** * * @author fireshoes */ public class CabalArchon extends CardImpl { - - private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Cleric"); - + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("a Cleric"); + static { filter.add(new SubtypePredicate("Cleric")); } @@ -66,8 +67,10 @@ public class CabalArchon extends CardImpl { // {B}, Sacrifice a Cleric: Target player loses 2 life and you gain 2 life. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LoseLifeTargetEffect(2), new ManaCostsImpl("{B}")); - ability.addEffect(new GainLifeEffect(2)); - ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent(1, 1, filter, false))); + Effect effect = new GainLifeEffect(2); + effect.setText("and you gain 2 life"); + ability.addEffect(effect); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(1, 1, filter, false))); ability.addTarget(new TargetPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/onslaught/FeedingFrenzy.java b/Mage.Sets/src/mage/sets/onslaught/FeedingFrenzy.java index ff57cf267b..55d168c309 100644 --- a/Mage.Sets/src/mage/sets/onslaught/FeedingFrenzy.java +++ b/Mage.Sets/src/mage/sets/onslaught/FeedingFrenzy.java @@ -28,20 +28,20 @@ package mage.sets.onslaught; import java.util.UUID; - import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.CountersCount; import mage.abilities.dynamicvalue.common.ManacostVariableValue; import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; import mage.abilities.dynamicvalue.common.SignInversionDynamicValue; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; import mage.counters.CounterType; +import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledPermanent; -import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCreaturePermanent; @@ -51,13 +51,21 @@ import mage.target.common.TargetCreaturePermanent; */ public class FeedingFrenzy extends CardImpl { + private static final FilterPermanent filter = new FilterPermanent(); + + static { + filter.add(new SubtypePredicate("Zombie")); + } + public FeedingFrenzy(UUID ownerId) { super(ownerId, 147, "Feeding Frenzy", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{B}"); this.expansionSetCode = "ONS"; // Target creature gets -X/-X until end of turn, where X is the number of Zombies on the battlefield. - DynamicValue x = new PermanentsOnBattlefieldCount(new FilterCreaturePermanent("Zombie", "Zombie on the battlefield"), -1); - this.getSpellAbility().addEffect(new BoostTargetEffect(x, x, Duration.EndOfTurn)); + DynamicValue x = new PermanentsOnBattlefieldCount(filter, -1); + Effect effect = new BoostTargetEffect(x, x, Duration.EndOfTurn); + effect.setText("Target creature gets -X/-X until end of turn, where X is the number of Zombies on the battlefield"); + this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/sets/onslaught/RiptideLaboratory.java b/Mage.Sets/src/mage/sets/onslaught/RiptideLaboratory.java index 06b74c0ec8..808150e100 100644 --- a/Mage.Sets/src/mage/sets/onslaught/RiptideLaboratory.java +++ b/Mage.Sets/src/mage/sets/onslaught/RiptideLaboratory.java @@ -38,17 +38,18 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetControlledPermanent; /** * * @author emerald000 */ public class RiptideLaboratory extends CardImpl { - - private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Wizard"); + + private final static FilterControlledPermanent filter = new FilterControlledPermanent("Wizard you control"); + static { filter.add(new SubtypePredicate("Wizard")); } @@ -59,11 +60,11 @@ public class RiptideLaboratory extends CardImpl { // {tap}: Add {1} to your mana pool. this.addAbility(new ColorlessManaAbility()); - + // {1}{U}, {tap}: Return target Wizard you control to its owner's hand. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new ManaCostsImpl("{1}{U}")); ability.addCost(new TapSourceCost()); - ability.addTarget(new TargetControlledCreaturePermanent(filter)); + ability.addTarget(new TargetControlledPermanent(filter)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/onslaught/VoiceOfTheWoods.java b/Mage.Sets/src/mage/sets/onslaught/VoiceOfTheWoods.java index b10c2dfa80..5395bdf833 100644 --- a/Mage.Sets/src/mage/sets/onslaught/VoiceOfTheWoods.java +++ b/Mage.Sets/src/mage/sets/onslaught/VoiceOfTheWoods.java @@ -38,12 +38,12 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.permanent.TappedPredicate; import mage.game.permanent.token.Token; -import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetControlledPermanent; /** * @@ -51,7 +51,7 @@ import mage.target.common.TargetControlledCreaturePermanent; */ public class VoiceOfTheWoods extends CardImpl { - private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped Elves you control"); + private static final FilterControlledPermanent filter = new FilterControlledPermanent("untapped Elves you control"); static { filter.add(Predicates.not(new TappedPredicate())); @@ -69,7 +69,7 @@ public class VoiceOfTheWoods extends CardImpl { // Tap five untapped Elves you control: Put a 7/7 green Elemental creature token with trample onto the battlefield. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new VoiceOfTheWoodsElementalToken()), - new TapTargetCost(new TargetControlledCreaturePermanent(5,5, filter, false))); + new TapTargetCost(new TargetControlledPermanent(5,5, filter, false))); this.addAbility(ability); } @@ -97,4 +97,4 @@ class VoiceOfTheWoodsElementalToken extends Token { addAbility(TrampleAbility.getInstance()); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/onslaught/Wellwisher.java b/Mage.Sets/src/mage/sets/onslaught/Wellwisher.java index 43851a1fd7..eb80dcfae3 100644 --- a/Mage.Sets/src/mage/sets/onslaught/Wellwisher.java +++ b/Mage.Sets/src/mage/sets/onslaught/Wellwisher.java @@ -37,7 +37,7 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; +import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; /** @@ -46,7 +46,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; */ public class Wellwisher extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Elf on the battlefield"); + private static final FilterPermanent filter = new FilterPermanent("Elf on the battlefield"); static { filter.add(new SubtypePredicate("Elf")); diff --git a/Mage.Sets/src/mage/sets/onslaught/WirewoodHerald.java b/Mage.Sets/src/mage/sets/onslaught/WirewoodHerald.java index 209057bb5e..1db7010397 100644 --- a/Mage.Sets/src/mage/sets/onslaught/WirewoodHerald.java +++ b/Mage.Sets/src/mage/sets/onslaught/WirewoodHerald.java @@ -34,7 +34,7 @@ import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.filter.common.FilterCreatureCard; +import mage.filter.FilterCard; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCardInLibrary; @@ -44,7 +44,7 @@ import mage.target.common.TargetCardInLibrary; */ public class WirewoodHerald extends CardImpl { - private static final FilterCreatureCard filter = new FilterCreatureCard("Elf card"); + private static final FilterCard filter = new FilterCard("Elf card"); static { filter.add(new SubtypePredicate("Elf")); diff --git a/Mage.Sets/src/mage/sets/onslaught/WirewoodLodge.java b/Mage.Sets/src/mage/sets/onslaught/WirewoodLodge.java index be1dc8700a..594d11f12b 100644 --- a/Mage.Sets/src/mage/sets/onslaught/WirewoodLodge.java +++ b/Mage.Sets/src/mage/sets/onslaught/WirewoodLodge.java @@ -38,9 +38,9 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; +import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.target.common.TargetCreaturePermanent; +import mage.target.TargetPermanent; /** * @@ -48,7 +48,8 @@ import mage.target.common.TargetCreaturePermanent; */ public class WirewoodLodge extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Elf"); + private static final FilterPermanent filter = new FilterPermanent("Elf"); + static { filter.add(new SubtypePredicate("Elf")); } @@ -56,14 +57,14 @@ public class WirewoodLodge extends CardImpl { public WirewoodLodge(UUID ownerId) { super(ownerId, 329, "Wirewood Lodge", Rarity.RARE, new CardType[]{CardType.LAND}, ""); this.expansionSetCode = "ONS"; - + // {T}: Add {1} to your mana pool. this.addAbility(new ColorlessManaAbility()); - + // {G}, {T}: Untap target Elf. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new ManaCostsImpl("{G}")); ability.addCost(new TapSourceCost()); - ability.addTarget(new TargetCreaturePermanent(filter)); + ability.addTarget(new TargetPermanent(filter)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/onslaught/WirewoodSavage.java b/Mage.Sets/src/mage/sets/onslaught/WirewoodSavage.java index e6935282b5..1f91cb2fb1 100644 --- a/Mage.Sets/src/mage/sets/onslaught/WirewoodSavage.java +++ b/Mage.Sets/src/mage/sets/onslaught/WirewoodSavage.java @@ -35,7 +35,7 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; +import mage.filter.FilterPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; /** @@ -44,7 +44,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; */ public class WirewoodSavage extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a Beast"); + private static final FilterPermanent filter = new FilterPermanent("a Beast"); static { filter.add(new SubtypePredicate("Beast"));