From 9b147950327d04c0954892f824c791c7f68510ad Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 13 Jan 2017 20:47:43 +0100 Subject: [PATCH] * Champion of Lambholt, Goldnight Commander, Griffin Protector and Healer of the Pride - Fixed that the triggered ability also triggered for not controlled permanents. --- .../src/mage/cards/c/ChampionOfLambholt.java | 16 +++++++++------- .../src/mage/cards/g/GoldnightCommander.java | 8 ++++---- Mage.Sets/src/mage/cards/g/GriffinProtector.java | 6 +++--- Mage.Sets/src/mage/cards/h/HealerOfThePride.java | 6 +++--- Mage.Sets/src/mage/cards/r/ReachOfBranches.java | 11 ++++++----- Mage.Sets/src/mage/cards/s/SagesRowDenizen.java | 10 ++++++---- .../EntersBattlefieldAllTriggeredAbility.java | 14 +++++++------- 7 files changed, 38 insertions(+), 33 deletions(-) diff --git a/Mage.Sets/src/mage/cards/c/ChampionOfLambholt.java b/Mage.Sets/src/mage/cards/c/ChampionOfLambholt.java index 564ff597ce..68e8bb8960 100644 --- a/Mage.Sets/src/mage/cards/c/ChampionOfLambholt.java +++ b/Mage.Sets/src/mage/cards/c/ChampionOfLambholt.java @@ -27,34 +27,36 @@ */ package mage.cards.c; -import mage.constants.CardType; +import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.RestrictionEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; +import mage.constants.CardType; import mage.constants.Duration; +import mage.constants.TargetController; import mage.constants.Zone; import mage.counters.CounterType; -import mage.game.Game; -import mage.game.permanent.Permanent; - -import java.util.UUID; -import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.AnotherPredicate; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; /** * @author noxx */ public class ChampionOfLambholt extends CardImpl { - private static FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature"); + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature"); static { filter.add(new AnotherPredicate()); + filter.add(new ControllerPredicate(TargetController.YOU)); } public ChampionOfLambholt(UUID ownerId, CardSetInfo setInfo) { diff --git a/Mage.Sets/src/mage/cards/g/GoldnightCommander.java b/Mage.Sets/src/mage/cards/g/GoldnightCommander.java index ab2e5db8c5..d58511e392 100644 --- a/Mage.Sets/src/mage/cards/g/GoldnightCommander.java +++ b/Mage.Sets/src/mage/cards/g/GoldnightCommander.java @@ -28,15 +28,15 @@ package mage.cards.g; import java.util.UUID; -import mage.constants.CardType; import mage.MageInt; +import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; import mage.abilities.effects.common.continuous.BoostControlledEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; +import mage.constants.CardType; import mage.constants.Duration; -import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; +import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.permanent.AnotherPredicate; /** @@ -44,7 +44,7 @@ import mage.filter.predicate.permanent.AnotherPredicate; */ public class GoldnightCommander extends CardImpl { - private static FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature"); + private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another creature"); static { filter.add(new AnotherPredicate()); diff --git a/Mage.Sets/src/mage/cards/g/GriffinProtector.java b/Mage.Sets/src/mage/cards/g/GriffinProtector.java index 08db606a29..d743791c1c 100644 --- a/Mage.Sets/src/mage/cards/g/GriffinProtector.java +++ b/Mage.Sets/src/mage/cards/g/GriffinProtector.java @@ -28,16 +28,16 @@ package mage.cards.g; import java.util.UUID; -import mage.constants.CardType; import mage.MageInt; import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; +import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; +import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.permanent.AnotherPredicate; /** @@ -46,7 +46,7 @@ import mage.filter.predicate.permanent.AnotherPredicate; */ public class GriffinProtector extends CardImpl { - private static FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature"); + private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another creature"); static { filter.add(new AnotherPredicate()); diff --git a/Mage.Sets/src/mage/cards/h/HealerOfThePride.java b/Mage.Sets/src/mage/cards/h/HealerOfThePride.java index b19844cfd5..eed2676f4f 100644 --- a/Mage.Sets/src/mage/cards/h/HealerOfThePride.java +++ b/Mage.Sets/src/mage/cards/h/HealerOfThePride.java @@ -28,14 +28,14 @@ package mage.cards.h; import java.util.UUID; -import mage.constants.CardType; import mage.MageInt; import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; import mage.abilities.effects.common.GainLifeEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; +import mage.constants.CardType; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; +import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.permanent.AnotherPredicate; /** @@ -44,7 +44,7 @@ import mage.filter.predicate.permanent.AnotherPredicate; */ public class HealerOfThePride extends CardImpl { - private static FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature"); + private final static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another creature"); static { filter.add(new AnotherPredicate()); diff --git a/Mage.Sets/src/mage/cards/r/ReachOfBranches.java b/Mage.Sets/src/mage/cards/r/ReachOfBranches.java index eaa25b81ce..ea73a8d792 100644 --- a/Mage.Sets/src/mage/cards/r/ReachOfBranches.java +++ b/Mage.Sets/src/mage/cards/r/ReachOfBranches.java @@ -48,21 +48,21 @@ import mage.game.permanent.token.Token; */ public class ReachOfBranches extends CardImpl { - private static final FilterLandPermanent filter = new FilterLandPermanent("Forest"); + private static final FilterLandPermanent filter = new FilterLandPermanent("a Forest"); + static { filter.add(new ControllerPredicate(TargetController.YOU)); filter.add(new SubtypePredicate("Forest")); } public ReachOfBranches(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.TRIBAL,CardType.INSTANT},"{4}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.TRIBAL, CardType.INSTANT}, "{4}{G}"); this.subtype.add("Treefolk"); - // Create a 2/5 green Treefolk Shaman creature token. this.getSpellAbility().addEffect(new CreateTokenEffect(new TreefolkShamanToken())); // Whenever a Forest enters the battlefield under your control, you may return Reach of Branches from your graveyard to your hand. - this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(),filter, true, "", true)); + this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), filter, true, "", true)); } public ReachOfBranches(final ReachOfBranches card) { @@ -76,6 +76,7 @@ public class ReachOfBranches extends CardImpl { } class TreefolkShamanToken extends Token { + TreefolkShamanToken() { super("Treefolk Shaman", "2/5 green Treefolk Shaman creature token"); cardType.add(CardType.CREATURE); @@ -85,4 +86,4 @@ class TreefolkShamanToken extends Token { power = new MageInt(2); toughness = new MageInt(5); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/s/SagesRowDenizen.java b/Mage.Sets/src/mage/cards/s/SagesRowDenizen.java index caa3ffd71d..ce0d9a83ee 100644 --- a/Mage.Sets/src/mage/cards/s/SagesRowDenizen.java +++ b/Mage.Sets/src/mage/cards/s/SagesRowDenizen.java @@ -28,9 +28,6 @@ package mage.cards.s; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.TargetController; -import mage.constants.Zone; import mage.MageInt; import mage.ObjectColor; import mage.abilities.Ability; @@ -38,6 +35,9 @@ import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.TargetController; +import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.ColorPredicate; import mage.filter.predicate.permanent.AnotherPredicate; @@ -51,13 +51,15 @@ import mage.target.TargetPlayer; public class SagesRowDenizen extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another blue creature"); + static { filter.add(new ColorPredicate(ObjectColor.BLUE)); filter.add(new AnotherPredicate()); filter.add(new ControllerPredicate(TargetController.YOU)); } + public SagesRowDenizen(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}"); this.subtype.add("Vedalken"); this.subtype.add("Wizard"); diff --git a/Mage/src/main/java/mage/abilities/common/EntersBattlefieldAllTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/EntersBattlefieldAllTriggeredAbility.java index e91b0fec3f..400e81d107 100644 --- a/Mage/src/main/java/mage/abilities/common/EntersBattlefieldAllTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/EntersBattlefieldAllTriggeredAbility.java @@ -46,7 +46,7 @@ public class EntersBattlefieldAllTriggeredAbility extends TriggeredAbilityImpl { protected FilterPermanent filter; protected String rule; - protected boolean controlled; + protected boolean controlledText; protected SetTargetPointer setTargetPointer; /** @@ -71,19 +71,19 @@ public class EntersBattlefieldAllTriggeredAbility extends TriggeredAbilityImpl { this(zone, effect, filter, optional, rule, false); } - public EntersBattlefieldAllTriggeredAbility(Zone zone, Effect effect, FilterPermanent filter, boolean optional, String rule, boolean controlled) { - this(zone, effect, filter, optional, SetTargetPointer.NONE, rule, controlled); + public EntersBattlefieldAllTriggeredAbility(Zone zone, Effect effect, FilterPermanent filter, boolean optional, String rule, boolean controlledText) { + this(zone, effect, filter, optional, SetTargetPointer.NONE, rule, controlledText); } public EntersBattlefieldAllTriggeredAbility(Zone zone, Effect effect, FilterPermanent filter, boolean optional, SetTargetPointer setTargetPointer, String rule) { this(zone, effect, filter, optional, setTargetPointer, rule, false); } - public EntersBattlefieldAllTriggeredAbility(Zone zone, Effect effect, FilterPermanent filter, boolean optional, SetTargetPointer setTargetPointer, String rule, boolean controlled) { + public EntersBattlefieldAllTriggeredAbility(Zone zone, Effect effect, FilterPermanent filter, boolean optional, SetTargetPointer setTargetPointer, String rule, boolean controlledText) { super(zone, effect, optional); this.filter = filter; this.rule = rule; - this.controlled = controlled; + this.controlledText = controlledText; this.setTargetPointer = setTargetPointer; } @@ -91,7 +91,7 @@ public class EntersBattlefieldAllTriggeredAbility extends TriggeredAbilityImpl { super(ability); this.filter = ability.filter; this.rule = ability.rule; - this.controlled = ability.controlled; + this.controlledText = ability.controlledText; this.setTargetPointer = ability.setTargetPointer; } @@ -130,7 +130,7 @@ public class EntersBattlefieldAllTriggeredAbility extends TriggeredAbilityImpl { } StringBuilder sb = new StringBuilder("Whenever ").append(filter.getMessage()); sb.append(" enters the battlefield"); - if (controlled) { + if (controlledText) { sb.append(" under your control, "); } else { sb.append(", ");