From d05d3bbc971d9d45013228b5ff8c9aa19b55709b Mon Sep 17 00:00:00 2001 From: theelk801 Date: Wed, 4 Jun 2025 14:56:12 -0400 Subject: [PATCH] refactor some instances of ConditionalInterveningIfTriggeredAbility --- .../src/mage/cards/a/AbzanBeastmaster.java | 19 ++++++----- .../src/mage/cards/a/AcclaimedContender.java | 14 +++----- .../src/mage/cards/a/AcererakTheArchlich.java | 18 +++++------ .../src/mage/cards/a/AdherentOfHope.java | 26 +++++++-------- Mage.Sets/src/mage/cards/a/Adrestia.java | 32 +++++++++---------- .../src/mage/cards/a/AerialSurveyor.java | 17 +++++----- .../emblems/LolthSpiderQueenEmblem.java | 17 +++++----- .../game/command/emblems/RadiationEmblem.java | 17 +++++----- ...AshiokWickedManipulatorNightmareToken.java | 16 +++------- .../permanent/token/YoungHeroRoleToken.java | 11 +++---- 10 files changed, 85 insertions(+), 102 deletions(-) diff --git a/Mage.Sets/src/mage/cards/a/AbzanBeastmaster.java b/Mage.Sets/src/mage/cards/a/AbzanBeastmaster.java index 07baf140a0e..a413743d361 100644 --- a/Mage.Sets/src/mage/cards/a/AbzanBeastmaster.java +++ b/Mage.Sets/src/mage/cards/a/AbzanBeastmaster.java @@ -1,36 +1,35 @@ package mage.cards.a; -import java.util.UUID; import mage.MageInt; -import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility; import mage.abilities.condition.common.ControlsCreatureGreatestToughnessCondition; -import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.triggers.BeginningOfUpkeepTriggeredAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class AbzanBeastmaster extends CardImpl { public AbzanBeastmaster(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}"); this.subtype.add(SubType.DOG); this.subtype.add(SubType.SHAMAN); this.power = new MageInt(2); this.toughness = new MageInt(1); // At the beginning of your upkeep, draw a card if you control the creature with the greatest toughness or tied for the greatest toughness. - this.addAbility(new ConditionalInterveningIfTriggeredAbility( - new BeginningOfUpkeepTriggeredAbility(new DrawCardSourceControllerEffect(1)), - ControlsCreatureGreatestToughnessCondition.instance, - "At the beginning of your upkeep, draw a card if you control the creature with the greatest toughness or tied for the greatest toughness." - )); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new ConditionalOneShotEffect( + new DrawCardSourceControllerEffect(1), ControlsCreatureGreatestToughnessCondition.instance, + "draw a card if you control the creature with the greatest toughness or tied for the greatest toughness" + ))); } private AbzanBeastmaster(final AbzanBeastmaster card) { diff --git a/Mage.Sets/src/mage/cards/a/AcclaimedContender.java b/Mage.Sets/src/mage/cards/a/AcclaimedContender.java index 0450d449e5f..2fbf272c272 100644 --- a/Mage.Sets/src/mage/cards/a/AcclaimedContender.java +++ b/Mage.Sets/src/mage/cards/a/AcclaimedContender.java @@ -4,7 +4,6 @@ import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.condition.Condition; import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; -import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -25,7 +24,7 @@ import java.util.UUID; */ public final class AcclaimedContender extends CardImpl { - private static final FilterPermanent filter = new FilterControlledPermanent(SubType.KNIGHT); + private static final FilterPermanent filter = new FilterControlledPermanent(SubType.KNIGHT, "you control another Knight"); private static final FilterCard filter2 = new FilterCard("a Knight, Aura, Equipment, or legendary artifact card"); @@ -53,14 +52,9 @@ public final class AcclaimedContender extends CardImpl { this.toughness = new MageInt(3); // When Acclaimed Contender enters the battlefield, if you control another Knight, look at the top five cards of your library. You may reveal a Knight, Aura, Equipment, or legendary artifact card from among them and put it into your hand. Put the rest on the bottom of your library in a random order. - this.addAbility(new ConditionalInterveningIfTriggeredAbility( - new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect( - 5, 1, filter2, PutCards.HAND, PutCards.BOTTOM_RANDOM - )), condition, "When {this} enters, " + - "if you control another Knight, look at the top five cards of your library. " + - "You may reveal a Knight, Aura, Equipment, or legendary artifact card from among them " + - "and put it into your hand. Put the rest on the bottom of your library in a random order." - )); + this.addAbility(new EntersBattlefieldTriggeredAbility(new LookLibraryAndPickControllerEffect( + 5, 1, filter2, PutCards.HAND, PutCards.BOTTOM_RANDOM + )).withInterveningIf(condition)); } private AcclaimedContender(final AcclaimedContender card) { diff --git a/Mage.Sets/src/mage/cards/a/AcererakTheArchlich.java b/Mage.Sets/src/mage/cards/a/AcererakTheArchlich.java index 11eda4d0318..d429f82da8c 100644 --- a/Mage.Sets/src/mage/cards/a/AcererakTheArchlich.java +++ b/Mage.Sets/src/mage/cards/a/AcererakTheArchlich.java @@ -6,7 +6,6 @@ import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.condition.Condition; import mage.abilities.condition.common.CompletedDungeonCondition; -import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ReturnToHandSourceEffect; import mage.abilities.effects.keyword.VentureIntoTheDungeonEffect; @@ -22,8 +21,6 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.game.permanent.token.ZombieToken; import mage.players.Player; -import mage.target.TargetPermanent; -import mage.target.common.TargetControlledCreaturePermanent; import mage.target.common.TargetSacrifice; import mage.watchers.common.CompletedDungeonWatcher; @@ -44,13 +41,9 @@ public final class AcererakTheArchlich extends CardImpl { this.toughness = new MageInt(5); // When Acererak the Archlich enters the battlefield, if you have not completed Tomb of Annihilation, return Acererak the Archlich to its owner's hand and venture into the dungeon. - Ability ability = new ConditionalInterveningIfTriggeredAbility( - new EntersBattlefieldTriggeredAbility(new ReturnToHandSourceEffect(true)), - AcererakTheArchlichCondition.instance, "When {this} enters, " + - "if you haven't completed Tomb of Annihilation, return {this} " + - "to its owner's hand and venture into the dungeon." - ); - ability.addEffect(new VentureIntoTheDungeonEffect()); + Ability ability = new EntersBattlefieldTriggeredAbility(new ReturnToHandSourceEffect(true)) + .withInterveningIf(AcererakTheArchlichCondition.instance); + ability.addEffect(new VentureIntoTheDungeonEffect().concatBy("and")); ability.addHint(CurrentDungeonHint.instance); ability.addHint(CompletedDungeonCondition.getHint()); this.addAbility(ability, new CompletedDungeonWatcher()); @@ -78,6 +71,11 @@ enum AcererakTheArchlichCondition implements Condition { source.getControllerId(), game ).contains("Tomb of Annihilation"); } + + @Override + public String toString() { + return "you haven't completed Tomb of Annihilation"; + } } class AcererakTheArchlichEffect extends OneShotEffect { diff --git a/Mage.Sets/src/mage/cards/a/AdherentOfHope.java b/Mage.Sets/src/mage/cards/a/AdherentOfHope.java index df3e76f6db4..62f145afd02 100644 --- a/Mage.Sets/src/mage/cards/a/AdherentOfHope.java +++ b/Mage.Sets/src/mage/cards/a/AdherentOfHope.java @@ -1,45 +1,41 @@ package mage.cards.a; import mage.MageInt; -import mage.abilities.triggers.BeginningOfCombatTriggeredAbility; +import mage.abilities.condition.Condition; import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; -import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.hint.ConditionHint; +import mage.abilities.hint.Hint; +import mage.abilities.triggers.BeginningOfCombatTriggeredAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.counters.CounterType; -import mage.filter.common.FilterControlledPermanent; +import mage.filter.common.FilterControlledPlaneswalkerPermanent; import java.util.UUID; /** - * * @author htrajan */ public final class AdherentOfHope extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent(); - - static { - filter.add(CardType.PLANESWALKER.getPredicate()); - filter.add(SubType.BASRI.getPredicate()); - } + private static final Condition condition = new PermanentsOnTheBattlefieldCondition( + new FilterControlledPlaneswalkerPermanent(SubType.BASRI, "you control a Basri planeswalker") + ); + private static final Hint hint = new ConditionHint(condition); public AdherentOfHope(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}"); - + this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.SOLDIER); this.power = new MageInt(2); this.toughness = new MageInt(1); // At the beginning of combat on your turn, if you control a Basri planeswalker, put a +1/+1 counter on Adherent of Hope. - this.addAbility(new ConditionalInterveningIfTriggeredAbility( - new BeginningOfCombatTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance())), - new PermanentsOnTheBattlefieldCondition(filter), - "At the beginning of combat on your turn, if you control a Basri planeswalker, put a +1/+1 counter on {this}.")); + this.addAbility(new BeginningOfCombatTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance())).withInterveningIf(condition).addHint(hint)); } private AdherentOfHope(final AdherentOfHope card) { diff --git a/Mage.Sets/src/mage/cards/a/Adrestia.java b/Mage.Sets/src/mage/cards/a/Adrestia.java index c0df6888563..7536ee8ad98 100644 --- a/Mage.Sets/src/mage/cards/a/Adrestia.java +++ b/Mage.Sets/src/mage/cards/a/Adrestia.java @@ -1,40 +1,38 @@ package mage.cards.a; -import java.util.*; - import mage.MageInt; import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.condition.Condition; -import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; -import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.continuous.AddCardSubTypeSourceEffect; import mage.abilities.hint.ConditionHint; import mage.abilities.hint.Hint; -import mage.constants.*; -import mage.abilities.keyword.IslandwalkAbility; import mage.abilities.keyword.CrewAbility; +import mage.abilities.keyword.IslandwalkAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; +import mage.constants.*; import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.permanent.Permanent; import mage.watchers.Watcher; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + /** - * * @author Grath */ public final class Adrestia extends CardImpl { - private static final Condition condition = AdrestiaCondition.instance; public Adrestia(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); - + this.supertype.add(SuperType.LEGENDARY); this.subtype.add(SubType.VEHICLE); this.power = new MageInt(4); @@ -44,16 +42,14 @@ public final class Adrestia extends CardImpl { this.addAbility(new IslandwalkAbility()); // Whenever Adrestia attacks, if an Assassin crewed it this turn, draw a card. Adrestia becomes an Assassin in addition to its other types until end of turn. - Ability ability = new ConditionalInterveningIfTriggeredAbility( - new AttacksTriggeredAbility(new DrawCardSourceControllerEffect(1), false), - condition, "Whenever {this} attacks, if an Assassin crewed it this turn, draw a card. {this} becomes an Assassin in addition to its other types until end of turn."); + Ability ability = new AttacksTriggeredAbility(new DrawCardSourceControllerEffect(1), false) + .withInterveningIf(AdrestiaCondition.instance); ability.addEffect(new AddCardSubTypeSourceEffect(Duration.EndOfTurn, true, SubType.ASSASSIN)); ability.addHint(AdrestiaCondition.getHint()); this.addAbility(ability, new AdrestiaWatcher()); // Crew 1 this.addAbility(new CrewAbility(1)); - } private Adrestia(final Adrestia card) { @@ -68,13 +64,18 @@ public final class Adrestia extends CardImpl { enum AdrestiaCondition implements Condition { instance; - private static final Hint hint = new ConditionHint(instance, "an Assassin crewed it this turn"); + private static final Hint hint = new ConditionHint(instance); @Override public boolean apply(Game game, Ability source) { return AdrestiaWatcher.checkIfAssassinCrewed(source.getSourcePermanentOrLKI(game), game); } + @Override + public String toString() { + return "an Assassin crewed it this turn"; + } + public static Hint getHint() { return hint; } @@ -97,8 +98,7 @@ class AdrestiaWatcher extends Watcher { if (crewer != null) { if (!crewMap.containsKey(vehicle)) { crewMap.put(vehicle, filter.match(crewer, game)); - } - else { + } else { crewMap.put(vehicle, crewMap.get(vehicle) || filter.match(crewer, game)); } } diff --git a/Mage.Sets/src/mage/cards/a/AerialSurveyor.java b/Mage.Sets/src/mage/cards/a/AerialSurveyor.java index fae375b3700..0aaed9d279b 100644 --- a/Mage.Sets/src/mage/cards/a/AerialSurveyor.java +++ b/Mage.Sets/src/mage/cards/a/AerialSurveyor.java @@ -4,7 +4,6 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.condition.Condition; -import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.abilities.hint.Hint; import mage.abilities.hint.common.LandsYouControlHint; @@ -46,13 +45,10 @@ public final class AerialSurveyor extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Whenever Aerial Surveyor attacks, if defending player controls more lands than you, search your library for a basic Plains card, put it onto the battlefield tapped, then shuffle. - this.addAbility(new ConditionalInterveningIfTriggeredAbility( - new AttacksTriggeredAbility( - new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter), true) - ), AerialSurveyorCondition.instance, "Whenever {this} attacks, if defending player " + - "controls more lands than you, search your library for a basic Plains card, " + - "put it onto the battlefield tapped, then shuffle." - ).addHint(LandsYouControlHint.instance).addHint(AerialSurveyorHint.instance)); + this.addAbility(new AttacksTriggeredAbility(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter), true)) + .withInterveningIf(AerialSurveyorCondition.instance) + .addHint(LandsYouControlHint.instance) + .addHint(AerialSurveyorHint.instance)); // Crew 2 this.addAbility(new CrewAbility(2)); @@ -85,6 +81,11 @@ enum AerialSurveyorCondition implements Condition { source.getControllerId(), source, game ); } + + @Override + public String toString() { + return ""; + } } enum AerialSurveyorHint implements Hint { diff --git a/Mage/src/main/java/mage/game/command/emblems/LolthSpiderQueenEmblem.java b/Mage/src/main/java/mage/game/command/emblems/LolthSpiderQueenEmblem.java index b45be6875a4..9e775d88d92 100644 --- a/Mage/src/main/java/mage/game/command/emblems/LolthSpiderQueenEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/LolthSpiderQueenEmblem.java @@ -3,7 +3,6 @@ package mage.game.command.emblems; import mage.abilities.Ability; import mage.abilities.common.OneOrMoreCombatDamagePlayerTriggeredAbility; import mage.abilities.condition.Condition; -import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.constants.Outcome; @@ -25,13 +24,9 @@ public final class LolthSpiderQueenEmblem extends Emblem { // −8: You get an emblem with "Whenever an opponent is dealt combat damage by one or more creatures you control, if that player lost less than 8 life this turn, they lose life equal to the difference." public LolthSpiderQueenEmblem() { super("Emblem Lolth"); - this.getAbilities().add(new ConditionalInterveningIfTriggeredAbility( - new OneOrMoreCombatDamagePlayerTriggeredAbility( - Zone.COMMAND, new LolthSpiderQueenEmblemEffect(), StaticFilters.FILTER_PERMANENT_CREATURES, SetTargetPointer.PLAYER, false - ), LolthSpiderQueenEmblemCondition.instance, "Whenever an opponent " + - "is dealt combat damage by one or more creatures you control, " + - "if that player lost less than 8 life this turn, they lose life equal to the difference." - )); + this.getAbilities().add(new OneOrMoreCombatDamagePlayerTriggeredAbility( + Zone.COMMAND, new LolthSpiderQueenEmblemEffect(), StaticFilters.FILTER_PERMANENT_CREATURES, SetTargetPointer.PLAYER, false + ).withInterveningIf(LolthSpiderQueenEmblemCondition.instance).setTriggerPhrase("Whenever an opponent is dealt combat damage by one or more creatures you control, ")); } private LolthSpiderQueenEmblem(final LolthSpiderQueenEmblem card) { @@ -61,12 +56,18 @@ enum LolthSpiderQueenEmblemCondition implements Condition { PlayerLostLifeWatcher watcher = game.getState().getWatcher(PlayerLostLifeWatcher.class); return player != null && watcher != null && watcher.getLifeLost(player.getId()) < 8; } + + @Override + public String toString() { + return "that player lost less than 8 life this turn"; + } } class LolthSpiderQueenEmblemEffect extends OneShotEffect { LolthSpiderQueenEmblemEffect() { super(Outcome.Benefit); + staticText = "they lose life equal to the difference"; } private LolthSpiderQueenEmblemEffect(final LolthSpiderQueenEmblemEffect effect) { diff --git a/Mage/src/main/java/mage/game/command/emblems/RadiationEmblem.java b/Mage/src/main/java/mage/game/command/emblems/RadiationEmblem.java index 9c2fcd54a1a..7f72bf4b36c 100644 --- a/Mage/src/main/java/mage/game/command/emblems/RadiationEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/RadiationEmblem.java @@ -1,10 +1,9 @@ package mage.game.command.emblems; import mage.abilities.Ability; -import mage.abilities.triggers.BeginningOfFirstMainTriggeredAbility; import mage.abilities.condition.Condition; -import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; import mage.abilities.effects.OneShotEffect; +import mage.abilities.triggers.BeginningOfFirstMainTriggeredAbility; import mage.cards.Cards; import mage.cards.FrameStyle; import mage.cards.repository.TokenInfo; @@ -31,12 +30,9 @@ public class RadiationEmblem extends Emblem { super("Radiation"); this.frameStyle = FrameStyle.M15_NORMAL; - this.getAbilities().add(new ConditionalInterveningIfTriggeredAbility( - new BeginningOfFirstMainTriggeredAbility(Zone.ALL, TargetController.YOU, new RadiationEffect(), false), - RadiationCondition.instance, - "At the beginning of your precombat main phase, if you have any rad counters, " - + "mill that many cards. For each nonland card milled this way, you lose 1 life and a rad counter." - )); + this.getAbilities().add(new BeginningOfFirstMainTriggeredAbility( + Zone.ALL, TargetController.YOU, new RadiationEffect(), false + ).withInterveningIf(RadiationCondition.instance).setTriggerPhrase("At the beginning of each player's precombat main phase, ")); TokenInfo foundInfo = TokenRepository.instance.findPreferredTokenInfoForXmage(TokenRepository.XMAGE_IMAGE_NAME_RADIATION, null); if (foundInfo != null) { @@ -69,6 +65,11 @@ enum RadiationCondition implements Condition { Player player = game.getPlayer(source.getControllerId()); return player != null && player.getCountersCount(CounterType.RAD) > 0; } + + @Override + public String toString() { + return "that player has one or more rad counters"; + } } /** diff --git a/Mage/src/main/java/mage/game/permanent/token/AshiokWickedManipulatorNightmareToken.java b/Mage/src/main/java/mage/game/permanent/token/AshiokWickedManipulatorNightmareToken.java index 4e2812f731c..afa3fcf91cd 100644 --- a/Mage/src/main/java/mage/game/permanent/token/AshiokWickedManipulatorNightmareToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/AshiokWickedManipulatorNightmareToken.java @@ -1,12 +1,11 @@ package mage.game.permanent.token; import mage.MageInt; -import mage.abilities.triggers.BeginningOfCombatTriggeredAbility; import mage.abilities.condition.common.WasCardExiledThisTurnCondition; -import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.hint.ConditionHint; import mage.abilities.hint.Hint; +import mage.abilities.triggers.BeginningOfCombatTriggeredAbility; import mage.constants.CardType; import mage.constants.SubType; import mage.counters.CounterType; @@ -22,21 +21,16 @@ public final class AshiokWickedManipulatorNightmareToken extends TokenImpl { * /!\ You need to add CardsExiledThisTurnWatcher to any card using this token */ public AshiokWickedManipulatorNightmareToken() { - super("Nightmare Token", "1/1 black Nightmare creature tokens with \"At the beginning of combat on your turn, if a card was put into exile this turn, put a +1/+1 counter on this creature.\""); + super("Nightmare Token", "1/1 black Nightmare creature token with \"At the beginning of combat on your turn, if a card was put into exile this turn, put a +1/+1 counter on this token.\""); cardType.add(CardType.CREATURE); color.setBlack(true); subtype.add(SubType.NIGHTMARE); power = new MageInt(1); toughness = new MageInt(1); - this.addAbility(new ConditionalInterveningIfTriggeredAbility( - new BeginningOfCombatTriggeredAbility( - new AddCountersSourceEffect(CounterType.P1P1.createInstance()) - ), - WasCardExiledThisTurnCondition.instance, - "At the beginning of combat on your turn, if a card was put into exile " - + "this turn, put a +1/+1 counter on this creature." - ).addHint(hint)); + this.addAbility(new BeginningOfCombatTriggeredAbility( + new AddCountersSourceEffect(CounterType.P1P1.createInstance()) + ).withInterveningIf(WasCardExiledThisTurnCondition.instance).addHint(hint)); } private AshiokWickedManipulatorNightmareToken(final AshiokWickedManipulatorNightmareToken token) { diff --git a/Mage/src/main/java/mage/game/permanent/token/YoungHeroRoleToken.java b/Mage/src/main/java/mage/game/permanent/token/YoungHeroRoleToken.java index d73aaf07a81..04eeb1a0090 100644 --- a/Mage/src/main/java/mage/game/permanent/token/YoungHeroRoleToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/YoungHeroRoleToken.java @@ -5,7 +5,6 @@ import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.Condition; import mage.abilities.condition.common.SourceMatchesFilterCondition; -import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; @@ -23,7 +22,7 @@ import mage.target.common.TargetCreaturePermanent; */ public final class YoungHeroRoleToken extends TokenImpl { - private static final FilterPermanent filter = new FilterCreaturePermanent(); + private static final FilterPermanent filter = new FilterCreaturePermanent("its toughness is 3 or less"); static { filter.add(new ToughnessPredicate(ComparisonType.FEWER_THAN, 4)); @@ -45,10 +44,10 @@ public final class YoungHeroRoleToken extends TokenImpl { // Enchanted creature has "Whenever this creature attacks, if its toughness is 3 or less, put a +1/+1 counter on it." this.addAbility(new SimpleStaticAbility(new GainAbilityAttachedEffect( - new ConditionalInterveningIfTriggeredAbility( - new AttacksTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance())), - condition, "Whenever this creature attacks, if its toughness is 3 or less, put a +1/+1 counter on it." - ), AttachmentType.AURA + new AttacksTriggeredAbility( + new AddCountersSourceEffect(CounterType.P1P1.createInstance()) + .setText("put a +1/+1 counter on it") + ).withInterveningIf(condition), AttachmentType.AURA ))); }