diff --git a/Mage.Sets/src/mage/cards/b/BellowingSaddlebrute.java b/Mage.Sets/src/mage/cards/b/BellowingSaddlebrute.java index 08b697864d..3c8be02555 100644 --- a/Mage.Sets/src/mage/cards/b/BellowingSaddlebrute.java +++ b/Mage.Sets/src/mage/cards/b/BellowingSaddlebrute.java @@ -1,10 +1,11 @@ package mage.cards.b; import mage.MageInt; +import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.condition.InvertCondition; import mage.abilities.condition.common.RaidCondition; -import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.effects.common.LoseLifeSourceControllerEffect; import mage.abilities.hint.common.RaidHint; import mage.cards.CardImpl; @@ -17,7 +18,7 @@ import mage.watchers.common.PlayerAttackedWatcher; import java.util.UUID; /** - * @author LevelX2 + * @author awjackson */ public final class BellowingSaddlebrute extends CardImpl { @@ -28,14 +29,15 @@ public final class BellowingSaddlebrute extends CardImpl { this.power = new MageInt(4); this.toughness = new MageInt(5); - // Raid - When Bellowing Saddlebrute enters the battlefield, you lose 4 life unless you attacked with a creature this turn - this.addAbility(new ConditionalInterveningIfTriggeredAbility( - new EntersBattlefieldTriggeredAbility(new LoseLifeSourceControllerEffect(4)), - new InvertCondition(RaidCondition.instance), - "When {this} enters the battlefield, you lose 4 life unless you attacked this turn.") - .setAbilityWord(AbilityWord.RAID) - .addHint(RaidHint.instance), - new PlayerAttackedWatcher()); + // Raid - When Bellowing Saddlebrute enters the battlefield, you lose 4 life unless you attacked this turn + Ability ability = new EntersBattlefieldTriggeredAbility(new ConditionalOneShotEffect( + new LoseLifeSourceControllerEffect(4), + new InvertCondition(RaidCondition.instance), + "you lose 4 life unless you attacked this turn" + )); + ability.setAbilityWord(AbilityWord.RAID); + ability.addHint(RaidHint.instance); + this.addAbility(ability, new PlayerAttackedWatcher()); } private BellowingSaddlebrute(final BellowingSaddlebrute card) { diff --git a/Mage.Sets/src/mage/cards/c/CuriousObsession.java b/Mage.Sets/src/mage/cards/c/CuriousObsession.java index 37a97a4d12..4683947c73 100644 --- a/Mage.Sets/src/mage/cards/c/CuriousObsession.java +++ b/Mage.Sets/src/mage/cards/c/CuriousObsession.java @@ -6,7 +6,7 @@ import mage.abilities.common.BeginningOfYourEndStepTriggeredAbility; import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.InvertCondition; -import mage.abilities.condition.common.ControllerAttackedThisTurnCondition; +import mage.abilities.condition.common.RaidCondition; import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; @@ -14,6 +14,7 @@ import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.SacrificeSourceEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.hint.common.RaidHint; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -24,7 +25,7 @@ import mage.constants.Outcome; import mage.constants.SubType; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; -import mage.watchers.common.AttackedThisTurnWatcher; +import mage.watchers.common.PlayerAttackedWatcher; /** * @@ -53,10 +54,13 @@ public final class CuriousObsession extends CardImpl { this.addAbility(ability); // At the beginning of your end step, if you didn't attack with a creature this turn sacrifice Curious Obsession. - this.addAbility(new ConditionalInterveningIfTriggeredAbility( + ability = new ConditionalInterveningIfTriggeredAbility( new BeginningOfYourEndStepTriggeredAbility(new SacrificeSourceEffect(), false), - new InvertCondition(ControllerAttackedThisTurnCondition.instance), - "At the beginning of your end step, if you didn't attack with a creature this turn, sacrifice {this}."), new AttackedThisTurnWatcher()); + new InvertCondition(RaidCondition.instance), + "At the beginning of your end step, if you didn't attack with a creature this turn, sacrifice {this}." + ); + ability.addHint(RaidHint.instance); + this.addAbility(ability, new PlayerAttackedWatcher()); } private CuriousObsession(final CuriousObsession card) { diff --git a/Mage.Sets/src/mage/cards/e/ErgRaiders.java b/Mage.Sets/src/mage/cards/e/ErgRaiders.java index 7e0483100e..5fcf9a75b6 100644 --- a/Mage.Sets/src/mage/cards/e/ErgRaiders.java +++ b/Mage.Sets/src/mage/cards/e/ErgRaiders.java @@ -1,14 +1,15 @@ - package mage.cards.e; import java.util.UUID; import mage.MageInt; -import mage.MageObjectReference; import mage.abilities.Ability; -import mage.abilities.TriggeredAbility; import mage.abilities.common.BeginningOfEndStepTriggeredAbility; import mage.abilities.condition.Condition; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.AttackedThisTurnSourceCondition; import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageControllerEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -21,21 +22,27 @@ import mage.watchers.common.AttackedThisTurnWatcher; /** * - * @author LoneFox + * @author awjackson * */ public final class ErgRaiders extends CardImpl { public ErgRaiders(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}"); - this.subtype.add(SubType.HUMAN); - this.subtype.add(SubType.WARRIOR); + this.subtype.add(SubType.HUMAN, SubType.WARRIOR); this.power = new MageInt(2); this.toughness = new MageInt(3); // At the beginning of your end step, if Erg Raiders didn't attack this turn, Erg Raiders deals 2 damage to you unless it came under your control this turn. - TriggeredAbility ability = new ConditionalInterveningIfTriggeredAbility(new BeginningOfEndStepTriggeredAbility(new DamageControllerEffect(2), TargetController.YOU, false), - new ErgRaidersCondition(), "At the beginning of your end step, if {this} didn't attack this turn, {this} deals 2 damage to you unless it came under your control this turn."); + Effect effect = new ConditionalOneShotEffect( + new DamageControllerEffect(2), + ErgRaidersCondition.instance, + "{this} deals 2 damage to you unless it came under your control this turn" + ); + Ability ability = new ConditionalInterveningIfTriggeredAbility( + new BeginningOfEndStepTriggeredAbility(effect, TargetController.YOU, false), + new InvertCondition(AttackedThisTurnSourceCondition.instance), + "At the beginning of your end step, if {this} didn't attack this turn, {this} deals 2 damage to you unless it came under your control this turn."); ability.addWatcher(new AttackedThisTurnWatcher()); this.addAbility(ability); } @@ -50,13 +57,12 @@ public final class ErgRaiders extends CardImpl { } } -class ErgRaidersCondition implements Condition { +enum ErgRaidersCondition implements Condition { + instance; @Override public boolean apply(Game game, Ability source) { - Permanent raiders = game.getPermanentOrLKIBattlefield(source.getSourceId()); - AttackedThisTurnWatcher watcher = game.getState().getWatcher(AttackedThisTurnWatcher.class); - // wasControlledFromStartOfControllerTurn should be checked during resolution I guess, but shouldn't be relevant - return raiders != null &&raiders.wasControlledFromStartOfControllerTurn() && watcher != null && !watcher.getAttackedThisTurnCreatures().contains(new MageObjectReference(raiders, game)); + Permanent raiders = source.getSourcePermanentOrLKI(game); + return raiders != null && raiders.wasControlledFromStartOfControllerTurn(); } } diff --git a/Mage.Sets/src/mage/cards/r/RingOfEvosIsle.java b/Mage.Sets/src/mage/cards/r/RingOfEvosIsle.java index f44db9e186..60b9a6450e 100644 --- a/Mage.Sets/src/mage/cards/r/RingOfEvosIsle.java +++ b/Mage.Sets/src/mage/cards/r/RingOfEvosIsle.java @@ -1,4 +1,3 @@ - package mage.cards.r; import java.util.UUID; @@ -8,26 +7,21 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.condition.common.AttachedToMatchesFilterCondition; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.effects.common.counter.AddPlusOneCountersAttachedEffect; import mage.abilities.keyword.EquipAbility; import mage.abilities.keyword.HexproofAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.AttachmentType; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.TargetController; -import mage.constants.Zone; +import mage.constants.*; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.ColorPredicate; /** * - * @author jeffwadsworth + * @author awjackson */ public final class RingOfEvosIsle extends CardImpl { @@ -42,12 +36,15 @@ public final class RingOfEvosIsle extends CardImpl { this.subtype.add(SubType.EQUIPMENT); // {2}: Equipped creature gains hexproof until end of turn. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HexproofAbility.getInstance(), AttachmentType.EQUIPMENT, Duration.EndOfTurn), new GenericManaCost(2))); + this.addAbility(new SimpleActivatedAbility(new GainAbilityAttachedEffect(HexproofAbility.getInstance(), AttachmentType.EQUIPMENT, Duration.EndOfTurn), new GenericManaCost(2))); // At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's blue. - TriggeredAbility triggeredAbility = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new AddPlusOneCountersAttachedEffect(1), TargetController.YOU, false); - ConditionalInterveningIfTriggeredAbility ability2 = new ConditionalInterveningIfTriggeredAbility(triggeredAbility, new AttachedToMatchesFilterCondition(filter), "At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's blue."); - this.addAbility(ability2); + Effect effect = new ConditionalOneShotEffect( + new AddPlusOneCountersAttachedEffect(1), + new AttachedToMatchesFilterCondition(filter), + "put a +1/+1 counter on equipped creature if it's blue" + ); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(effect, TargetController.YOU, false)); // Equip {1} this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(1))); diff --git a/Mage.Sets/src/mage/cards/r/RingOfKalonia.java b/Mage.Sets/src/mage/cards/r/RingOfKalonia.java index 98f2b2d8f8..5b60ddee44 100644 --- a/Mage.Sets/src/mage/cards/r/RingOfKalonia.java +++ b/Mage.Sets/src/mage/cards/r/RingOfKalonia.java @@ -1,4 +1,3 @@ - package mage.cards.r; import java.util.UUID; @@ -8,7 +7,8 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.AttachedToMatchesFilterCondition; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.effects.common.counter.AddPlusOneCountersAttachedEffect; import mage.abilities.keyword.EquipAbility; @@ -21,12 +21,12 @@ import mage.filter.predicate.mageobject.ColorPredicate; /** * - * @author jeffwadsworth + * @author awjackson */ public final class RingOfKalonia extends CardImpl { - + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); - + static { filter.add(new ColorPredicate(ObjectColor.GREEN)); } @@ -36,13 +36,16 @@ public final class RingOfKalonia extends CardImpl { this.subtype.add(SubType.EQUIPMENT); // Equipped creature has trample. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.EQUIPMENT))); - + this.addAbility(new SimpleStaticAbility(new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.EQUIPMENT))); + // At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's green. - TriggeredAbility triggeredAbility = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new AddPlusOneCountersAttachedEffect(1), TargetController.YOU, false); - ConditionalInterveningIfTriggeredAbility ability = new ConditionalInterveningIfTriggeredAbility(triggeredAbility, new AttachedToMatchesFilterCondition(filter), "At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's green"); - this.addAbility(ability); - + Effect effect = new ConditionalOneShotEffect( + new AddPlusOneCountersAttachedEffect(1), + new AttachedToMatchesFilterCondition(filter), + "put a +1/+1 counter on equipped creature if it's green" + ); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(effect, TargetController.YOU, false)); + // Equip {1} this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(1))); } diff --git a/Mage.Sets/src/mage/cards/r/RingOfThune.java b/Mage.Sets/src/mage/cards/r/RingOfThune.java index 84732e19ac..65350a71cd 100644 --- a/Mage.Sets/src/mage/cards/r/RingOfThune.java +++ b/Mage.Sets/src/mage/cards/r/RingOfThune.java @@ -1,4 +1,3 @@ - package mage.cards.r; import java.util.UUID; @@ -8,7 +7,8 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.AttachedToMatchesFilterCondition; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.effects.common.counter.AddPlusOneCountersAttachedEffect; import mage.abilities.keyword.EquipAbility; @@ -21,12 +21,12 @@ import mage.filter.predicate.mageobject.ColorPredicate; /** * - * @author jeffwadsworth + * @author awjackson */ public final class RingOfThune extends CardImpl { - + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); - + static { filter.add(new ColorPredicate(ObjectColor.WHITE)); } @@ -36,13 +36,16 @@ public final class RingOfThune extends CardImpl { this.subtype.add(SubType.EQUIPMENT); // Equipped creature has vigilance. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), AttachmentType.EQUIPMENT))); - + this.addAbility(new SimpleStaticAbility(new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), AttachmentType.EQUIPMENT))); + // At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's white. - TriggeredAbility triggeredAbility = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new AddPlusOneCountersAttachedEffect(1), TargetController.YOU, false); - ConditionalInterveningIfTriggeredAbility ability = new ConditionalInterveningIfTriggeredAbility(triggeredAbility, new AttachedToMatchesFilterCondition(filter), "At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's white."); - this.addAbility(ability); - + Effect effect = new ConditionalOneShotEffect( + new AddPlusOneCountersAttachedEffect(1), + new AttachedToMatchesFilterCondition(filter), + "put a +1/+1 counter on equipped creature if it's white" + ); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(effect, TargetController.YOU, false)); + // Equip {1} this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(1))); } diff --git a/Mage.Sets/src/mage/cards/r/RingOfValkas.java b/Mage.Sets/src/mage/cards/r/RingOfValkas.java index 403c07ea06..1d425031b8 100644 --- a/Mage.Sets/src/mage/cards/r/RingOfValkas.java +++ b/Mage.Sets/src/mage/cards/r/RingOfValkas.java @@ -1,4 +1,3 @@ - package mage.cards.r; import java.util.UUID; @@ -8,7 +7,8 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.AttachedToMatchesFilterCondition; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.effects.common.counter.AddPlusOneCountersAttachedEffect; import mage.abilities.keyword.EquipAbility; @@ -21,12 +21,12 @@ import mage.filter.predicate.mageobject.ColorPredicate; /** * - * @author jeffwadsworth + * @author awjackson */ public final class RingOfValkas extends CardImpl { - + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); - + static { filter.add(new ColorPredicate(ObjectColor.RED)); } @@ -36,13 +36,16 @@ public final class RingOfValkas extends CardImpl { this.subtype.add(SubType.EQUIPMENT); // Equipped creature has haste. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HasteAbility.getInstance(), AttachmentType.EQUIPMENT))); - + this.addAbility(new SimpleStaticAbility(new GainAbilityAttachedEffect(HasteAbility.getInstance(), AttachmentType.EQUIPMENT))); + // At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's red. - TriggeredAbility triggeredAbility = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new AddPlusOneCountersAttachedEffect(1), TargetController.YOU, false); - ConditionalInterveningIfTriggeredAbility ability = new ConditionalInterveningIfTriggeredAbility(triggeredAbility, new AttachedToMatchesFilterCondition(filter), "At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's red."); - this.addAbility(ability); - + Effect effect = new ConditionalOneShotEffect( + new AddPlusOneCountersAttachedEffect(1), + new AttachedToMatchesFilterCondition(filter), + "put a +1/+1 counter on equipped creature if it's red" + ); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(effect, TargetController.YOU, false)); + // Equip {1} this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(1))); } diff --git a/Mage.Sets/src/mage/cards/r/RingOfXathrid.java b/Mage.Sets/src/mage/cards/r/RingOfXathrid.java index 25de095bb6..49709d1a72 100644 --- a/Mage.Sets/src/mage/cards/r/RingOfXathrid.java +++ b/Mage.Sets/src/mage/cards/r/RingOfXathrid.java @@ -1,4 +1,3 @@ - package mage.cards.r; import java.util.UUID; @@ -8,7 +7,8 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.condition.common.AttachedToMatchesFilterCondition; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.decorator.ConditionalOneShotEffect; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.RegenerateAttachedEffect; import mage.abilities.effects.common.counter.AddPlusOneCountersAttachedEffect; import mage.abilities.keyword.EquipAbility; @@ -20,12 +20,12 @@ import mage.filter.predicate.mageobject.ColorPredicate; /** * - * @author jeffwadsworth + * @author awjackson */ public final class RingOfXathrid extends CardImpl { - + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent(); - + static { filter.add(new ColorPredicate(ObjectColor.BLACK)); } @@ -35,13 +35,16 @@ public final class RingOfXathrid extends CardImpl { this.subtype.add(SubType.EQUIPMENT); // {2}: Regenerate equipped creature. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateAttachedEffect(AttachmentType.EQUIPMENT), new GenericManaCost(2))); - + this.addAbility(new SimpleActivatedAbility(new RegenerateAttachedEffect(AttachmentType.EQUIPMENT), new GenericManaCost(2))); + // At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's black. - TriggeredAbility triggeredAbility = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new AddPlusOneCountersAttachedEffect(1), TargetController.YOU, false); - ConditionalInterveningIfTriggeredAbility ability = new ConditionalInterveningIfTriggeredAbility(triggeredAbility, new AttachedToMatchesFilterCondition(filter), "At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's black"); - this.addAbility(ability); - + Effect effect = new ConditionalOneShotEffect( + new AddPlusOneCountersAttachedEffect(1), + new AttachedToMatchesFilterCondition(filter), + "put a +1/+1 counter on equipped creature if it's black" + ); + this.addAbility(new BeginningOfUpkeepTriggeredAbility(effect, TargetController.YOU, false)); + // Equip {1} this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(1))); } diff --git a/Mage.Sets/src/mage/cards/s/SeeRed.java b/Mage.Sets/src/mage/cards/s/SeeRed.java index ee1682983b..72c1cfa025 100644 --- a/Mage.Sets/src/mage/cards/s/SeeRed.java +++ b/Mage.Sets/src/mage/cards/s/SeeRed.java @@ -6,13 +6,14 @@ import mage.abilities.Ability; import mage.abilities.common.BeginningOfYourEndStepTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.InvertCondition; -import mage.abilities.condition.common.ControllerAttackedThisTurnCondition; +import mage.abilities.condition.common.RaidCondition; import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.SacrificeSourceEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.hint.common.RaidHint; import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.FirstStrikeAbility; import mage.cards.CardImpl; @@ -25,7 +26,7 @@ import mage.constants.SubType; import mage.constants.Zone; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; -import mage.watchers.common.AttackedThisTurnWatcher; +import mage.watchers.common.PlayerAttackedWatcher; /** * @@ -53,10 +54,13 @@ public final class SeeRed extends CardImpl { this.addAbility(ability); // At the beginning of your end step, if you didn't attack with a creature this turn, sacrifice See Red. - this.addAbility(new ConditionalInterveningIfTriggeredAbility( + ability = new ConditionalInterveningIfTriggeredAbility( new BeginningOfYourEndStepTriggeredAbility(new SacrificeSourceEffect(), false), - new InvertCondition(ControllerAttackedThisTurnCondition.instance), - "At the beginning of your end step, if you didn't attack with a creature this turn, sacrifice {this}."), new AttackedThisTurnWatcher()); + new InvertCondition(RaidCondition.instance), + "At the beginning of your end step, if you didn't attack with a creature this turn, sacrifice {this}." + ); + ability.addHint(RaidHint.instance); + this.addAbility(ability, new PlayerAttackedWatcher()); } private SeeRed(final SeeRed card) { diff --git a/Mage.Sets/src/mage/cards/t/TrynnChampionOfFreedom.java b/Mage.Sets/src/mage/cards/t/TrynnChampionOfFreedom.java index 1554b12592..94e663e19e 100644 --- a/Mage.Sets/src/mage/cards/t/TrynnChampionOfFreedom.java +++ b/Mage.Sets/src/mage/cards/t/TrynnChampionOfFreedom.java @@ -1,10 +1,11 @@ package mage.cards.t; import mage.MageInt; +import mage.abilities.Ability; import mage.abilities.common.BeginningOfEndStepTriggeredAbility; -import mage.abilities.condition.common.AttackedThisTurnCondition; -import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.condition.common.RaidCondition; import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.hint.common.RaidHint; import mage.abilities.keyword.PartnerWithAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -13,7 +14,7 @@ import mage.constants.SubType; import mage.constants.SuperType; import mage.constants.TargetController; import mage.game.permanent.token.HumanSoldierToken; -import mage.watchers.common.AttackedThisTurnWatcher; +import mage.watchers.common.PlayerAttackedWatcher; import java.util.UUID; @@ -35,13 +36,14 @@ public final class TrynnChampionOfFreedom extends CardImpl { this.addAbility(new PartnerWithAbility("Silvar, Devourer of the Free")); // At the beginning of your end step, if you attacked this turn, create a 1/1 white Human Soldier creature token. - this.addAbility(new ConditionalInterveningIfTriggeredAbility( - new BeginningOfEndStepTriggeredAbility( - new CreateTokenEffect(new HumanSoldierToken()), - TargetController.YOU, false - ), AttackedThisTurnCondition.instance, "At the beginning of your end step, " + - "if you attacked this turn, create a 1/1 white Human Soldier creature token." - ), new AttackedThisTurnWatcher()); + Ability ability = new BeginningOfEndStepTriggeredAbility( + new CreateTokenEffect(new HumanSoldierToken()), + TargetController.YOU, + RaidCondition.instance, + false + ); + ability.addHint(RaidHint.instance); + this.addAbility(ability, new PlayerAttackedWatcher()); } private TrynnChampionOfFreedom(final TrynnChampionOfFreedom card) { diff --git a/Mage/src/main/java/mage/abilities/condition/common/AttackedThisTurnCondition.java b/Mage/src/main/java/mage/abilities/condition/common/AttackedThisTurnCondition.java deleted file mode 100644 index fdea49e2d4..0000000000 --- a/Mage/src/main/java/mage/abilities/condition/common/AttackedThisTurnCondition.java +++ /dev/null @@ -1,20 +0,0 @@ -package mage.abilities.condition.common; - -import mage.abilities.Ability; -import mage.abilities.condition.Condition; -import mage.game.Game; -import mage.watchers.common.AttackedThisTurnWatcher; - -/** - * - * @author LevelX2 - */ -public enum AttackedThisTurnCondition implements Condition { - instance; - - @Override - public boolean apply(Game game, Ability source) { - AttackedThisTurnWatcher watcher = game.getState().getWatcher(AttackedThisTurnWatcher.class); - return watcher != null && !watcher.getAttackedThisTurnCreatures().isEmpty(); - } -} diff --git a/Mage/src/main/java/mage/abilities/condition/common/ControllerAttackedThisTurnCondition.java b/Mage/src/main/java/mage/abilities/condition/common/ControllerAttackedThisTurnCondition.java deleted file mode 100644 index d7f732d11a..0000000000 --- a/Mage/src/main/java/mage/abilities/condition/common/ControllerAttackedThisTurnCondition.java +++ /dev/null @@ -1,21 +0,0 @@ - -package mage.abilities.condition.common; - -import mage.abilities.Ability; -import mage.abilities.condition.Condition; -import mage.game.Game; -import mage.watchers.common.AttackedThisTurnWatcher; - -/** - * - * @author LevelX2 - */ -public enum ControllerAttackedThisTurnCondition implements Condition { - instance; - - @Override - public boolean apply(Game game, Ability source) { - AttackedThisTurnWatcher watcher = game.getState().getWatcher(AttackedThisTurnWatcher.class); - return source.isControlledBy(game.getActivePlayerId()) && watcher != null && !watcher.getAttackedThisTurnCreatures().isEmpty(); - } -}