* Champion of Lambholt, Goldnight Commander, Griffin Protector and Healer of the Pride - Fixed that the triggered ability also triggered for not controlled permanents.

This commit is contained in:
LevelX2 2017-01-13 20:47:43 +01:00
parent 8d7582a7ef
commit 9b14795032
7 changed files with 38 additions and 33 deletions

View file

@ -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) {

View file

@ -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());

View file

@ -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());

View file

@ -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());

View file

@ -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);
}
}
}

View file

@ -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");

View file

@ -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(", ");