From 185f56a7da80299224af74fb0c869ec59fc92d58 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Mon, 20 Jun 2016 16:23:03 +0200 Subject: [PATCH] * Fireblast - Fixed that a wrong text was shown for the land sacrifice. Also that the spell was wrongly marked as castable also if only one mountain was on the battlefield. --- Mage.Sets/src/mage/sets/visions/Fireblast.java | 17 ++++++++--------- .../costs/common/SacrificeTargetCost.java | 11 ++++++++--- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Mage.Sets/src/mage/sets/visions/Fireblast.java b/Mage.Sets/src/mage/sets/visions/Fireblast.java index ddc68e0bc0..44203dea41 100644 --- a/Mage.Sets/src/mage/sets/visions/Fireblast.java +++ b/Mage.Sets/src/mage/sets/visions/Fireblast.java @@ -28,12 +28,12 @@ package mage.sets.visions; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Rarity; import mage.abilities.costs.AlternativeCostSourceAbility; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.common.DamageTargetEffect; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetControlledPermanent; @@ -42,12 +42,12 @@ import mage.target.common.TargetCreatureOrPlayer; /** * * @author jeffwadsworth - + * */ public class Fireblast extends CardImpl { - - private static final FilterControlledPermanent filter = new FilterControlledPermanent("Mountain"); - + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("two Mountains"); + static { filter.add(new SubtypePredicate("Mountain")); } @@ -56,14 +56,13 @@ public class Fireblast extends CardImpl { super(ownerId, 79, "Fireblast", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{4}{R}{R}"); this.expansionSetCode = "VIS"; - // You may sacrifice two Mountains rather than pay Fireblast's mana cost. this.addAbility(new AlternativeCostSourceAbility(new SacrificeTargetCost(new TargetControlledPermanent(2, 2, filter, true)))); - + // Fireblast deals 4 damage to target creature or player. this.getSpellAbility().addEffect(new DamageTargetEffect(4)); this.getSpellAbility().addTarget(new TargetCreatureOrPlayer()); - + } public Fireblast(final Fireblast card) { diff --git a/Mage/src/main/java/mage/abilities/costs/common/SacrificeTargetCost.java b/Mage/src/main/java/mage/abilities/costs/common/SacrificeTargetCost.java index 6e8211707b..7e385b6042 100644 --- a/Mage/src/main/java/mage/abilities/costs/common/SacrificeTargetCost.java +++ b/Mage/src/main/java/mage/abilities/costs/common/SacrificeTargetCost.java @@ -51,7 +51,9 @@ public class SacrificeTargetCost extends CostImpl { public SacrificeTargetCost(TargetControlledPermanent target) { this.addTarget(target); target.setNotTarget(true); // sacrifice is never targeted - this.text = "sacrifice " + (target.getTargetName().startsWith("an") || target.getTargetName().startsWith("a ") ? "" : "a ") + target.getTargetName(); + this.text = "sacrifice " + + ((target.getNumberOfTargets() != 1 || (target.getTargetName().startsWith("an") || target.getTargetName().startsWith("a "))) + ? "" : "a ") + target.getTargetName(); target.setTargetName(target.getTargetName() + " (to sacrifice)"); } @@ -101,13 +103,16 @@ public class SacrificeTargetCost extends CostImpl { } int validTargets = 0; + int neededtargets = targets.get(0).getNumberOfTargets(); for (Permanent permanent : game.getBattlefield().getAllActivePermanents(((TargetControlledPermanent) targets.get(0)).getFilter(), controllerId, game)) { if (game.getPlayer(activator).canPaySacrificeCost(permanent, sourceId, controllerId, game)) { validTargets++; + if (validTargets >= neededtargets) { + return true; + } } } - - return validTargets > 0; + return false; } @Override