From 4528663f1af0316652b4236b437dd4912c794f1b Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 10 Apr 2021 15:57:22 -0400 Subject: [PATCH] added life gain hints to various cards --- Mage.Sets/src/mage/cards/a/AngelicAccord.java | 8 ++-- .../src/mage/cards/c/CrestedSunmare.java | 31 +++++++------- .../src/mage/cards/o/OathswornVampire.java | 42 ++++++++----------- .../src/mage/cards/r/RegalBloodlord.java | 13 +++--- .../src/mage/cards/r/ResplendentAngel.java | 33 +++++---------- .../src/mage/cards/t/TivashGloomSummoner.java | 3 +- .../src/mage/cards/v/ValkyrieHarbinger.java | 3 +- .../src/mage/cards/w/WitchOfTheMoors.java | 3 +- 8 files changed, 61 insertions(+), 75 deletions(-) diff --git a/Mage.Sets/src/mage/cards/a/AngelicAccord.java b/Mage.Sets/src/mage/cards/a/AngelicAccord.java index dbdb8a8a61..64c40fc36d 100644 --- a/Mage.Sets/src/mage/cards/a/AngelicAccord.java +++ b/Mage.Sets/src/mage/cards/a/AngelicAccord.java @@ -2,6 +2,7 @@ package mage.cards.a; import mage.abilities.common.BeginningOfEndStepTriggeredAbility; import mage.abilities.condition.common.YouGainedLifeCondition; +import mage.abilities.dynamicvalue.common.ControllerGotLifeCount; import mage.abilities.effects.common.CreateTokenEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -23,9 +24,10 @@ public final class AngelicAccord extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}"); // At the beginning of each end step, if you gained 4 or more life this turn, create a 4/4 white Angel creature token with flying. - this.addAbility(new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new AngelToken()), TargetController.ANY, - new YouGainedLifeCondition(ComparisonType.MORE_THAN, 3), false), - new PlayerGainedLifeWatcher()); + this.addAbility(new BeginningOfEndStepTriggeredAbility( + Zone.BATTLEFIELD, new CreateTokenEffect(new AngelToken()), TargetController.ANY, + new YouGainedLifeCondition(ComparisonType.MORE_THAN, 3), false + ).addHint(ControllerGotLifeCount.getHint()), new PlayerGainedLifeWatcher()); } private AngelicAccord(final AngelicAccord card) { diff --git a/Mage.Sets/src/mage/cards/c/CrestedSunmare.java b/Mage.Sets/src/mage/cards/c/CrestedSunmare.java index 5020a37bdd..6d1e56f09e 100644 --- a/Mage.Sets/src/mage/cards/c/CrestedSunmare.java +++ b/Mage.Sets/src/mage/cards/c/CrestedSunmare.java @@ -1,29 +1,24 @@ - package mage.cards.c; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.BeginningOfEndStepTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.YouGainedLifeCondition; import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.dynamicvalue.common.ControllerGotLifeCount; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.continuous.GainAbilityAllEffect; import mage.abilities.keyword.IndestructibleAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.ComparisonType; -import mage.constants.Duration; -import mage.constants.SubType; -import mage.constants.TargetController; -import mage.constants.Zone; +import mage.constants.*; import mage.filter.common.FilterControlledPermanent; import mage.game.permanent.token.CrestedSunmareToken; import mage.watchers.common.PlayerGainedLifeWatcher; +import java.util.UUID; + /** - * * @author emerald000 */ public final class CrestedSunmare extends CardImpl { @@ -42,15 +37,19 @@ public final class CrestedSunmare extends CardImpl { this.toughness = new MageInt(5); // Other Horses you control have indestructible. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield, filter, true))); + this.addAbility(new SimpleStaticAbility(new GainAbilityAllEffect( + IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield, filter, true + ))); // At the beginning of each end step, if you gained life this turn, create a 5/5 white Horse creature token. - this.addAbility( - new ConditionalInterveningIfTriggeredAbility( - new BeginningOfEndStepTriggeredAbility(new CreateTokenEffect(new CrestedSunmareToken()), TargetController.ANY, false), - new YouGainedLifeCondition(ComparisonType.MORE_THAN, 0), - "At the beginning of each end step, if you gained life this turn, create a 5/5 white Horse creature token."), - new PlayerGainedLifeWatcher()); + this.addAbility(new ConditionalInterveningIfTriggeredAbility( + new BeginningOfEndStepTriggeredAbility( + new CreateTokenEffect(new CrestedSunmareToken()), + TargetController.ANY, false + ), new YouGainedLifeCondition(ComparisonType.MORE_THAN, 0), + "At the beginning of each end step, if you gained life this turn, " + + "create a 5/5 white Horse creature token." + ).addHint(ControllerGotLifeCount.getHint()), new PlayerGainedLifeWatcher()); } private CrestedSunmare(final CrestedSunmare card) { diff --git a/Mage.Sets/src/mage/cards/o/OathswornVampire.java b/Mage.Sets/src/mage/cards/o/OathswornVampire.java index 65a4b95ef5..a8c8563694 100644 --- a/Mage.Sets/src/mage/cards/o/OathswornVampire.java +++ b/Mage.Sets/src/mage/cards/o/OathswornVampire.java @@ -1,29 +1,21 @@ - package mage.cards.o; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.condition.Condition; -import mage.abilities.condition.common.YouGainedLifeCondition; +import mage.abilities.dynamicvalue.common.ControllerGotLifeCount; import mage.abilities.effects.AsThoughEffectImpl; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.AsThoughEffectType; -import mage.constants.CardType; -import mage.constants.ComparisonType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.SubType; -import mage.constants.Zone; +import mage.constants.*; import mage.game.Game; import mage.watchers.common.PlayerGainedLifeWatcher; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class OathswornVampire extends CardImpl { @@ -40,7 +32,9 @@ public final class OathswornVampire extends CardImpl { this.addAbility(new EntersBattlefieldTappedAbility()); // You may cast Oathsworn Vampire from your graveyard if you gained life this turn. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new OathswornVampirePlayEffect()), new PlayerGainedLifeWatcher()); + this.addAbility(new SimpleStaticAbility( + Zone.ALL, new OathswornVampirePlayEffect() + ).addHint(ControllerGotLifeCount.getHint()), new PlayerGainedLifeWatcher()); } private OathswornVampire(final OathswornVampire card) { @@ -55,17 +49,13 @@ public final class OathswornVampire extends CardImpl { class OathswornVampirePlayEffect extends AsThoughEffectImpl { - private Condition condition; - - public OathswornVampirePlayEffect() { + OathswornVampirePlayEffect() { super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfGame, Outcome.Benefit); staticText = "You may cast {this} from your graveyard if you gained life this turn"; - condition = new YouGainedLifeCondition(ComparisonType.MORE_THAN, 0); } - public OathswornVampirePlayEffect(final OathswornVampirePlayEffect effect) { + private OathswornVampirePlayEffect(final OathswornVampirePlayEffect effect) { super(effect); - this.condition = effect.condition; } @Override @@ -80,13 +70,15 @@ class OathswornVampirePlayEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { - if (sourceId.equals(source.getSourceId()) && source.isControlledBy(affectedControllerId)) { - Card card = game.getCard(source.getSourceId()); - if (card != null && game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) { - return condition.apply(game, source); - } + PlayerGainedLifeWatcher watcher = game.getState().getWatcher(PlayerGainedLifeWatcher.class); + if (watcher == null + || watcher.getLifeGained(source.getControllerId()) < 1 + || !sourceId.equals(source.getSourceId()) + || !source.isControlledBy(affectedControllerId)) { + return false; } - return false; + Card card = game.getCard(source.getSourceId()); + return card != null && game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD; } } diff --git a/Mage.Sets/src/mage/cards/r/RegalBloodlord.java b/Mage.Sets/src/mage/cards/r/RegalBloodlord.java index 0be1200cb4..505126bfce 100644 --- a/Mage.Sets/src/mage/cards/r/RegalBloodlord.java +++ b/Mage.Sets/src/mage/cards/r/RegalBloodlord.java @@ -1,23 +1,24 @@ package mage.cards.r; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.BeginningOfEndStepTriggeredAbility; import mage.abilities.condition.common.YouGainedLifeCondition; import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.dynamicvalue.common.ControllerGotLifeCount; import mage.abilities.effects.common.CreateTokenEffect; -import mage.constants.SubType; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.ComparisonType; +import mage.constants.SubType; import mage.constants.TargetController; import mage.game.permanent.token.BatToken; import mage.watchers.common.PlayerGainedLifeWatcher; +import java.util.UUID; + /** - * * @author TheElk801 */ public final class RegalBloodlord extends CardImpl { @@ -41,9 +42,9 @@ public final class RegalBloodlord extends CardImpl { ), new YouGainedLifeCondition(ComparisonType.MORE_THAN, 0), "At the beginning of each end step, " - + "if you gained life this turn, " - + "create a 1/1 black Bat creature token with flying." - ), new PlayerGainedLifeWatcher()); + + "if you gained life this turn, " + + "create a 1/1 black Bat creature token with flying." + ).addHint(ControllerGotLifeCount.getHint()), new PlayerGainedLifeWatcher()); } private RegalBloodlord(final RegalBloodlord card) { diff --git a/Mage.Sets/src/mage/cards/r/ResplendentAngel.java b/Mage.Sets/src/mage/cards/r/ResplendentAngel.java index 03622c8c2e..eef76d1ec9 100644 --- a/Mage.Sets/src/mage/cards/r/ResplendentAngel.java +++ b/Mage.Sets/src/mage/cards/r/ResplendentAngel.java @@ -1,30 +1,26 @@ package mage.cards.r; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.BeginningOfEndStepTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.condition.common.YouGainedLifeCondition; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.common.ControllerGotLifeCount; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; -import mage.constants.SubType; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.LifelinkAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.ComparisonType; -import mage.constants.Duration; -import mage.constants.TargetController; -import mage.constants.Zone; +import mage.constants.*; import mage.game.permanent.token.AngelVigilanceToken; import mage.watchers.common.PlayerGainedLifeWatcher; +import java.util.UUID; + /** - * * @author TheElk801 */ public final class ResplendentAngel extends CardImpl { @@ -41,23 +37,16 @@ public final class ResplendentAngel extends CardImpl { // At the beginning of each end step, if you gained 5 or more life this turn, create a 4/4 white Angel creature token with flying and vigilance. this.addAbility(new BeginningOfEndStepTriggeredAbility( - Zone.BATTLEFIELD, - new CreateTokenEffect(new AngelVigilanceToken()), - TargetController.ANY, - new YouGainedLifeCondition(ComparisonType.MORE_THAN, 4), - false - ), new PlayerGainedLifeWatcher()); + Zone.BATTLEFIELD, new CreateTokenEffect(new AngelVigilanceToken()), + TargetController.ANY, new YouGainedLifeCondition(ComparisonType.MORE_THAN, 4), false + ).addHint(ControllerGotLifeCount.getHint()), new PlayerGainedLifeWatcher()); // {3}{W}{W}{W}: Until end of turn, Resplendent Angel gets +2/+2 and gains lifelink. - Ability ability = new SimpleActivatedAbility( - new BoostSourceEffect( - 2, 2, Duration.EndOfTurn - ).setText("until end of turn, {this} gets +2/+2"), - new ManaCostsImpl("{3}{W}{W}{W}") - ); + Ability ability = new SimpleActivatedAbility(new BoostSourceEffect( + 2, 2, Duration.EndOfTurn + ).setText("until end of turn, {this} gets +2/+2"), new ManaCostsImpl("{3}{W}{W}{W}")); ability.addEffect(new GainAbilitySourceEffect( - LifelinkAbility.getInstance(), - Duration.EndOfTurn + LifelinkAbility.getInstance(), Duration.EndOfTurn ).setText("and gains lifelink")); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/t/TivashGloomSummoner.java b/Mage.Sets/src/mage/cards/t/TivashGloomSummoner.java index ed797b4f1b..c47e866568 100644 --- a/Mage.Sets/src/mage/cards/t/TivashGloomSummoner.java +++ b/Mage.Sets/src/mage/cards/t/TivashGloomSummoner.java @@ -7,6 +7,7 @@ import mage.abilities.condition.Condition; import mage.abilities.condition.common.YouGainedLifeCondition; import mage.abilities.costs.Cost; import mage.abilities.costs.common.PayLifeCost; +import mage.abilities.dynamicvalue.common.ControllerGotLifeCount; import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.LifelinkAbility; import mage.cards.CardImpl; @@ -42,7 +43,7 @@ public final class TivashGloomSummoner extends CardImpl { this.addAbility(new BeginningOfEndStepTriggeredAbility( Zone.BATTLEFIELD, new TivashGloomSummonerEffect(), TargetController.YOU, condition, false - ), new PlayerGainedLifeWatcher()); + ).addHint(ControllerGotLifeCount.getHint()), new PlayerGainedLifeWatcher()); } private TivashGloomSummoner(final TivashGloomSummoner card) { diff --git a/Mage.Sets/src/mage/cards/v/ValkyrieHarbinger.java b/Mage.Sets/src/mage/cards/v/ValkyrieHarbinger.java index 75b40b42ef..ab4cd6f783 100644 --- a/Mage.Sets/src/mage/cards/v/ValkyrieHarbinger.java +++ b/Mage.Sets/src/mage/cards/v/ValkyrieHarbinger.java @@ -5,6 +5,7 @@ import mage.abilities.common.BeginningOfEndStepTriggeredAbility; import mage.abilities.condition.Condition; import mage.abilities.condition.common.YouGainedLifeCondition; import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.dynamicvalue.common.ControllerGotLifeCount; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.LifelinkAbility; @@ -47,7 +48,7 @@ public final class ValkyrieHarbinger extends CardImpl { TargetController.ANY, false ), condition, "At the beginning of each end step, if you gained 4 or more life this turn, " + "create a 4/4 white Angel creature token with flying and vigilance." - ), new PlayerGainedLifeWatcher()); + ).addHint(ControllerGotLifeCount.getHint()), new PlayerGainedLifeWatcher()); } private ValkyrieHarbinger(final ValkyrieHarbinger card) { diff --git a/Mage.Sets/src/mage/cards/w/WitchOfTheMoors.java b/Mage.Sets/src/mage/cards/w/WitchOfTheMoors.java index 4a3f809262..7b2e00b095 100644 --- a/Mage.Sets/src/mage/cards/w/WitchOfTheMoors.java +++ b/Mage.Sets/src/mage/cards/w/WitchOfTheMoors.java @@ -6,6 +6,7 @@ import mage.abilities.common.BeginningOfEndStepTriggeredAbility; import mage.abilities.condition.Condition; import mage.abilities.condition.common.YouGainedLifeCondition; import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.dynamicvalue.common.ControllerGotLifeCount; import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; import mage.abilities.effects.common.SacrificeOpponentsEffect; import mage.abilities.keyword.DeathtouchAbility; @@ -53,7 +54,7 @@ public final class WitchOfTheMoors extends CardImpl { ability.addTarget(new TargetCardInYourGraveyard( 0, 1, StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD )); - this.addAbility(ability, new PlayerGainedLifeWatcher()); + this.addAbility(ability.addHint(ControllerGotLifeCount.getHint()), new PlayerGainedLifeWatcher()); } private WitchOfTheMoors(final WitchOfTheMoors card) {