From b11c8b5c709d5973ffeb553245cf2ba0766fa3d8 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Thu, 2 Sep 2021 19:53:29 -0400 Subject: [PATCH] [MID] Implemented Arrogant Outlaw --- .../src/mage/cards/a/ArrogantOutlaw.java | 50 +++++++++++++++++++ Mage.Sets/src/mage/cards/g/Gutterbones.java | 34 ++++--------- .../src/mage/cards/r/RakdosLordOfRiots.java | 5 +- Mage.Sets/src/mage/cards/s/SavageGorger.java | 25 ++-------- .../src/mage/cards/t/TheaterOfHorrors.java | 5 +- .../src/mage/sets/InnistradMidnightHunt.java | 1 + .../common/OpponentsLostLifeCondition.java | 3 +- ...leHint.java => OpponentsLostLifeHint.java} | 2 +- .../abilities/keyword/SpectacleAbility.java | 4 +- 9 files changed, 76 insertions(+), 53 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/a/ArrogantOutlaw.java rename Mage/src/main/java/mage/abilities/hint/common/{SpectacleHint.java => OpponentsLostLifeHint.java} (92%) diff --git a/Mage.Sets/src/mage/cards/a/ArrogantOutlaw.java b/Mage.Sets/src/mage/cards/a/ArrogantOutlaw.java new file mode 100644 index 0000000000..119a46a9b1 --- /dev/null +++ b/Mage.Sets/src/mage/cards/a/ArrogantOutlaw.java @@ -0,0 +1,50 @@ +package mage.cards.a; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.condition.common.OpponentsLostLifeCondition; +import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.LoseLifeOpponentsEffect; +import mage.abilities.hint.common.OpponentsLostLifeHint; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class ArrogantOutlaw extends CardImpl { + + public ArrogantOutlaw(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}"); + + this.subtype.add(SubType.VAMPIRE); + this.subtype.add(SubType.NOBLE); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // When Arrogant Outlaw enters the battlefield, if an opponent lost life this turn, each opponent loses 2 life and you gain 2 life. + Ability ability = new ConditionalInterveningIfTriggeredAbility( + new EntersBattlefieldTriggeredAbility( + new LoseLifeOpponentsEffect(2), false + ), OpponentsLostLifeCondition.instance, "When {this} enters the battlefield, " + + "if an opponent lost life this turn, each opponent loses 2 life and you gain 2 life." + ); + ability.addEffect(new GainLifeEffect(2)); + this.addAbility(ability.addHint(OpponentsLostLifeHint.instance)); + } + + private ArrogantOutlaw(final ArrogantOutlaw card) { + super(card); + } + + @Override + public ArrogantOutlaw copy() { + return new ArrogantOutlaw(this); + } +} diff --git a/Mage.Sets/src/mage/cards/g/Gutterbones.java b/Mage.Sets/src/mage/cards/g/Gutterbones.java index fe3aefee96..b06f079c87 100644 --- a/Mage.Sets/src/mage/cards/g/Gutterbones.java +++ b/Mage.Sets/src/mage/cards/g/Gutterbones.java @@ -1,19 +1,20 @@ package mage.cards.g; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTappedAbility; +import mage.abilities.condition.CompoundCondition; import mage.abilities.condition.Condition; +import mage.abilities.condition.common.MyTurnCondition; +import mage.abilities.condition.common.OpponentsLostLifeCondition; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.decorator.ConditionalActivatedAbility; import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect; +import mage.abilities.hint.common.OpponentsLostLifeHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.constants.Zone; -import mage.game.Game; -import mage.watchers.common.PlayerLostLifeWatcher; import java.util.UUID; @@ -22,6 +23,11 @@ import java.util.UUID; */ public final class Gutterbones extends CardImpl { + private static final Condition condition = new CompoundCondition( + "during your turn and only if an opponent lost life this turn", + MyTurnCondition.instance, OpponentsLostLifeCondition.instance + ); + public Gutterbones(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{B}"); @@ -36,8 +42,8 @@ public final class Gutterbones extends CardImpl { // {1}{B}: Return Gutterbones from your graveyard to your hand. Activate this ability only during your turn and only if an opponent lost life this turn. this.addAbility(new ConditionalActivatedAbility( Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), - new ManaCostsImpl("{1}{B}"), GutterbonesCondition.instance - )); + new ManaCostsImpl<>("{1}{B}"), condition + ).addHint(OpponentsLostLifeHint.instance)); } private Gutterbones(final Gutterbones card) { @@ -49,21 +55,3 @@ public final class Gutterbones extends CardImpl { return new Gutterbones(this); } } - -enum GutterbonesCondition implements Condition { - instance; - - @Override - public boolean apply(Game game, Ability source) { - if (game.isActivePlayer(source.getControllerId())) { - PlayerLostLifeWatcher watcher = game.getState().getWatcher(PlayerLostLifeWatcher.class); - return watcher != null && watcher.getAllOppLifeLost(source.getControllerId(), game) > 0; - } - return false; - } - - @Override - public String toString() { - return "during your turn and only if an opponent lost life this turn"; - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/r/RakdosLordOfRiots.java b/Mage.Sets/src/mage/cards/r/RakdosLordOfRiots.java index 484a298127..902db4f620 100644 --- a/Mage.Sets/src/mage/cards/r/RakdosLordOfRiots.java +++ b/Mage.Sets/src/mage/cards/r/RakdosLordOfRiots.java @@ -7,8 +7,10 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.OpponentsLostLifeCount; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; import mage.abilities.effects.common.cost.CostModificationEffectImpl; +import mage.abilities.hint.common.OpponentsLostLifeHint; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.TrampleAbility; +import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -17,7 +19,6 @@ import mage.game.events.GameEvent; import mage.util.CardUtil; import java.util.UUID; -import mage.cards.Card; /** * @author LevelX2 @@ -33,7 +34,7 @@ public final class RakdosLordOfRiots extends CardImpl { this.toughness = new MageInt(6); // You can't cast Rakdos, Lord of Riots unless an opponent lost life this turn. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new RakdosLordOfRiotsCantCastEffect())); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new RakdosLordOfRiotsCantCastEffect()).addHint(OpponentsLostLifeHint.instance)); // Flying, trample this.addAbility(FlyingAbility.getInstance()); diff --git a/Mage.Sets/src/mage/cards/s/SavageGorger.java b/Mage.Sets/src/mage/cards/s/SavageGorger.java index 68a2e25950..50c7c156c9 100644 --- a/Mage.Sets/src/mage/cards/s/SavageGorger.java +++ b/Mage.Sets/src/mage/cards/s/SavageGorger.java @@ -1,11 +1,11 @@ package mage.cards.s; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.BeginningOfEndStepTriggeredAbility; -import mage.abilities.condition.Condition; +import mage.abilities.condition.common.OpponentsLostLifeCondition; import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.abilities.hint.common.OpponentsLostLifeHint; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -13,8 +13,6 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.constants.TargetController; import mage.counters.CounterType; -import mage.game.Game; -import mage.watchers.common.PlayerLostLifeWatcher; import java.util.UUID; @@ -37,9 +35,9 @@ public final class SavageGorger extends CardImpl { this.addAbility(new ConditionalInterveningIfTriggeredAbility( new BeginningOfEndStepTriggeredAbility(new AddCountersSourceEffect( CounterType.P1P1.createInstance()), TargetController.YOU, false - ), SavageGorgerCondition.instance, "At the beginning of your end step, " + + ), OpponentsLostLifeCondition.instance, "At the beginning of your end step, " + "if an opponent lost life this turn, put a +1/+1 counter on {this}." - )); + ).addHint(OpponentsLostLifeHint.instance)); } private SavageGorger(final SavageGorger card) { @@ -51,18 +49,3 @@ public final class SavageGorger extends CardImpl { return new SavageGorger(this); } } - -enum SavageGorgerCondition implements Condition { - instance; - - @Override - public boolean apply(Game game, Ability source) { - PlayerLostLifeWatcher watcher = game.getState().getWatcher(PlayerLostLifeWatcher.class); - return watcher != null && watcher.getAllOppLifeLost(source.getControllerId(), game) > 0; - } - - @Override - public String toString() { - return ""; - } -} diff --git a/Mage.Sets/src/mage/cards/t/TheaterOfHorrors.java b/Mage.Sets/src/mage/cards/t/TheaterOfHorrors.java index aa5a876037..73608f08a9 100644 --- a/Mage.Sets/src/mage/cards/t/TheaterOfHorrors.java +++ b/Mage.Sets/src/mage/cards/t/TheaterOfHorrors.java @@ -8,6 +8,7 @@ import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.AsThoughEffectImpl; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.hint.common.OpponentsLostLifeHint; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -36,12 +37,12 @@ public final class TheaterOfHorrors extends CardImpl { )); // During your turn, if an opponent lost life this turn, you may play cards exiled with Theater of Horrors. - this.addAbility(new SimpleStaticAbility(new TheaterOfHorrorsCastEffect())); + this.addAbility(new SimpleStaticAbility(new TheaterOfHorrorsCastEffect()).addHint(OpponentsLostLifeHint.instance)); // {3}{R}: Theater of Horrors deals 1 damage to target opponent or planeswalker. Ability ability = new SimpleActivatedAbility( new DamageTargetEffect(1), - new ManaCostsImpl("{3}{R}") + new ManaCostsImpl<>("{3}{R}") ); ability.addTarget(new TargetOpponentOrPlaneswalker()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java b/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java index deed196183..146b3a6d6d 100644 --- a/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java +++ b/Mage.Sets/src/mage/sets/InnistradMidnightHunt.java @@ -27,6 +27,7 @@ public final class InnistradMidnightHunt extends ExpansionSet { this.ratioBoosterMythic = 8; this.numBoosterDoubleFaced = 1; + cards.add(new SetCardInfo("Arrogant Outlaw", 84, Rarity.COMMON, mage.cards.a.ArrogantOutlaw.class)); cards.add(new SetCardInfo("Candlelit Cavalry", 175, Rarity.COMMON, mage.cards.c.CandlelitCavalry.class)); cards.add(new SetCardInfo("Champion of the Perished", 91, Rarity.RARE, mage.cards.c.ChampionOfThePerished.class)); cards.add(new SetCardInfo("Consider", 44, Rarity.COMMON, mage.cards.c.Consider.class)); diff --git a/Mage/src/main/java/mage/abilities/condition/common/OpponentsLostLifeCondition.java b/Mage/src/main/java/mage/abilities/condition/common/OpponentsLostLifeCondition.java index 84ae6a0376..7f43136dc1 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/OpponentsLostLifeCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/OpponentsLostLifeCondition.java @@ -9,7 +9,6 @@ import mage.game.Game; * @author JayDi85 */ public enum OpponentsLostLifeCondition implements Condition { - instance; @Override @@ -19,6 +18,6 @@ public enum OpponentsLostLifeCondition implements Condition { @Override public String toString() { - return "opponents lost life"; + return "an opponent lost life this turn"; } } diff --git a/Mage/src/main/java/mage/abilities/hint/common/SpectacleHint.java b/Mage/src/main/java/mage/abilities/hint/common/OpponentsLostLifeHint.java similarity index 92% rename from Mage/src/main/java/mage/abilities/hint/common/SpectacleHint.java rename to Mage/src/main/java/mage/abilities/hint/common/OpponentsLostLifeHint.java index 81d7d3afa6..51d5914da0 100644 --- a/Mage/src/main/java/mage/abilities/hint/common/SpectacleHint.java +++ b/Mage/src/main/java/mage/abilities/hint/common/OpponentsLostLifeHint.java @@ -9,7 +9,7 @@ import mage.game.Game; /** * @author JayDi85 */ -public enum SpectacleHint implements Hint { +public enum OpponentsLostLifeHint implements Hint { instance; private static final ConditionHint hint = new ConditionHint(OpponentsLostLifeCondition.instance, "Opponents lost life this turn"); diff --git a/Mage/src/main/java/mage/abilities/keyword/SpectacleAbility.java b/Mage/src/main/java/mage/abilities/keyword/SpectacleAbility.java index 3dbcbc2a67..e86f749509 100644 --- a/Mage/src/main/java/mage/abilities/keyword/SpectacleAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/SpectacleAbility.java @@ -3,7 +3,7 @@ package mage.abilities.keyword; import mage.abilities.SpellAbility; import mage.abilities.costs.mana.ManaCost; import mage.abilities.dynamicvalue.common.OpponentsLostLifeCount; -import mage.abilities.hint.common.SpectacleHint; +import mage.abilities.hint.common.OpponentsLostLifeHint; import mage.cards.Card; import mage.constants.SpellAbilityType; import mage.constants.Zone; @@ -36,7 +36,7 @@ public class SpectacleAbility extends SpellAbility { this.setRuleAtTheTop(true); this.rule = "Spectacle " + spectacleCosts.getText() + " (You may cast this spell for its spectacle cost rather than its mana cost if an opponent lost life this turn.)"; - this.addHint(SpectacleHint.instance); + this.addHint(OpponentsLostLifeHint.instance); } public SpectacleAbility(final SpectacleAbility ability) {