diff --git a/Mage.Sets/src/mage/cards/c/CauldronHaze.java b/Mage.Sets/src/mage/cards/c/CauldronHaze.java index db95a2d1e11..28f0e6d9c7e 100644 --- a/Mage.Sets/src/mage/cards/c/CauldronHaze.java +++ b/Mage.Sets/src/mage/cards/c/CauldronHaze.java @@ -1,7 +1,6 @@ package mage.cards.c; -import java.util.UUID; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.keyword.PersistAbility; import mage.cards.CardImpl; @@ -10,13 +9,14 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.target.common.TargetCreaturePermanent; +import java.util.UUID; + /** - * * @author jeffwadsworth */ public final class CauldronHaze extends CardImpl { - private final String rule = "Choose any number of target creatures. Each of those creatures gains persist until end of turn"; + private static final String rule = "Choose any number of target creatures. Each of those creatures gains persist until end of turn"; public CauldronHaze(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{W/B}"); @@ -24,7 +24,6 @@ public final class CauldronHaze extends CardImpl { // Choose any number of target creatures. Each of those creatures gains persist until end of turn. this.getSpellAbility().addEffect(new GainAbilityTargetEffect(new PersistAbility(), Duration.EndOfTurn, rule)); this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, Integer.MAX_VALUE)); - } public CauldronHaze(final CauldronHaze card) { diff --git a/Mage.Sets/src/mage/cards/n/NoxiousGhoul.java b/Mage.Sets/src/mage/cards/n/NoxiousGhoul.java index 6f7d1807571..3ab6917bec2 100644 --- a/Mage.Sets/src/mage/cards/n/NoxiousGhoul.java +++ b/Mage.Sets/src/mage/cards/n/NoxiousGhoul.java @@ -1,7 +1,6 @@ package mage.cards.n; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; import mage.abilities.effects.common.continuous.BoostAllEffect; @@ -10,42 +9,31 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SubType; -import mage.constants.Zone; -import mage.filter.FilterPermanent; +import mage.filter.StaticFilters; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; -import mage.filter.predicate.mageobject.CardIdPredicate; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; + +import java.util.UUID; /** - * * @author jeffwadsworth */ public final class NoxiousGhoul extends CardImpl { - final FilterPermanent filter = new FilterPermanent("Noxious Ghoul or another Zombie"); - final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("non-Zombie"); - public NoxiousGhoul(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}"); this.subtype.add(SubType.ZOMBIE); this.power = new MageInt(3); this.toughness = new MageInt(3); - filter.add(Predicates.or( - new CardIdPredicate(this.getId()), - new SubtypePredicate(SubType.ZOMBIE))); - - filter2.add(new CardTypePredicate(CardType.CREATURE)); - filter2.add(Predicates.not( - new SubtypePredicate(SubType.ZOMBIE))); - - final String rule = "Whenever {this} or another Zombie enters the battlefield, all non-Zombie creatures get -1/-1 until end of turn."; - // Whenever Noxious Ghoul or another Zombie enters the battlefield, all non-Zombie creatures get -1/-1 until end of turn. - this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new BoostAllEffect(-1, -1, Duration.EndOfTurn, filter2, false), filter, false, rule)); + this.addAbility(new NoxiousGhoulTriggeredAbility()); } public NoxiousGhoul(final NoxiousGhoul card) { @@ -57,3 +45,34 @@ public final class NoxiousGhoul extends CardImpl { return new NoxiousGhoul(this); } } + +class NoxiousGhoulTriggeredAbility extends EntersBattlefieldAllTriggeredAbility { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("non-Zombie"); + + static { + filter.add(new CardTypePredicate(CardType.CREATURE)); + filter.add(Predicates.not( + new SubtypePredicate(SubType.ZOMBIE))); + } + + NoxiousGhoulTriggeredAbility() { + super( + new BoostAllEffect(-1, -1, Duration.EndOfTurn, filter, false), + StaticFilters.FILTER_PERMANENT, "Whenever {this} or another Zombie enters the battlefield, " + + "all non-Zombie creatures get -1/-1 until end of turn." + ); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (super.checkTrigger(event, game)) { + Permanent permanent = game.getPermanent(event.getTargetId()); + if (permanent != null) { + return permanent.hasSubtype(SubType.ZOMBIE, game) + || permanent.getId().equals(sourceId); + } + } + return false; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/s/SkullbriarTheWalkingGrave.java b/Mage.Sets/src/mage/cards/s/SkullbriarTheWalkingGrave.java index 7c217863635..d37ca591ece 100644 --- a/Mage.Sets/src/mage/cards/s/SkullbriarTheWalkingGrave.java +++ b/Mage.Sets/src/mage/cards/s/SkullbriarTheWalkingGrave.java @@ -1,7 +1,6 @@ package mage.cards.s; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.StaticAbility; @@ -22,15 +21,15 @@ import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.ZoneChangeEvent; +import java.util.UUID; + /** - * * @author anonymous */ public final class SkullbriarTheWalkingGrave extends CardImpl { - private Counters counters; public SkullbriarTheWalkingGrave(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{B}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}{G}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.ZOMBIE); this.subtype.add(SubType.ELEMENTAL); @@ -46,7 +45,9 @@ public final class SkullbriarTheWalkingGrave extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.ALL, new SkullbriarEffect())); } - public SkullbriarTheWalkingGrave(SkullbriarTheWalkingGrave card) { super(card); } + public SkullbriarTheWalkingGrave(SkullbriarTheWalkingGrave card) { + super(card); + } @Override public SkullbriarTheWalkingGrave copy() { @@ -58,7 +59,7 @@ public final class SkullbriarTheWalkingGrave extends CardImpl { public void updateZoneChangeCounter(Game game, ZoneChangeEvent event) { boolean skullBriarEffectApplied = false; if (event.getToZone() != Zone.HAND && event.getToZone() != Zone.LIBRARY) { - for (StaticAbility ability : getAbilities (game).getStaticAbilities(event.getFromZone())) { + for (StaticAbility ability : getAbilities(game).getStaticAbilities(event.getFromZone())) { for (Effect effect : ability.getEffects(game, EffectType.REPLACEMENT)) { if (effect instanceof SkullbriarEffect && event.getAppliedEffects().contains(effect.getId())) { skullBriarEffectApplied = true; @@ -84,7 +85,7 @@ public final class SkullbriarTheWalkingGrave extends CardImpl { copyTo = this.getCounters(game); } if (copyTo != null && copyFrom != null) { - for(Counter counter : copyFrom.values()) { + for (Counter counter : copyFrom.values()) { copyTo.addCounter(counter); } } diff --git a/Mage.Sets/src/mage/cards/v/VesuvanShapeshifter.java b/Mage.Sets/src/mage/cards/v/VesuvanShapeshifter.java index c86743811ea..545769453bb 100644 --- a/Mage.Sets/src/mage/cards/v/VesuvanShapeshifter.java +++ b/Mage.Sets/src/mage/cards/v/VesuvanShapeshifter.java @@ -33,8 +33,6 @@ import java.util.UUID; */ public final class VesuvanShapeshifter extends CardImpl { - private static final String effectText = "as a copy of any creature on the battlefield until {this} is turned faced down"; - public VesuvanShapeshifter(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); this.subtype.add(SubType.SHAPESHIFTER); @@ -48,7 +46,7 @@ public final class VesuvanShapeshifter extends CardImpl { // As Vesuvan Shapeshifter etbs, you may choose another creature. If you do, until Vesuvan Shapeshifter is turned face down, it becomes a copy of that creature Effect effect = new CopyPermanentEffect(StaticFilters.FILTER_PERMANENT_CREATURE, new VesuvanShapeShifterFaceUpApplier()); - effect.setText(effectText); + effect.setText("as a copy of any creature on the battlefield until {this} is turned faced down"); ability = new EntersBattlefieldAbility(effect, true); ability.setWorksFaceDown(false); this.addAbility(ability);