From cff44f14362e514cb4023e15ac787016cbeeee2a Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Sun, 12 Jan 2020 07:54:00 +0400 Subject: [PATCH] fixed Destiny Spinner (missing card hint); --- .../src/mage/cards/d/DestinySpinner.java | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/cards/d/DestinySpinner.java b/Mage.Sets/src/mage/cards/d/DestinySpinner.java index 659539ab81..c3feab1f98 100644 --- a/Mage.Sets/src/mage/cards/d/DestinySpinner.java +++ b/Mage.Sets/src/mage/cards/d/DestinySpinner.java @@ -5,9 +5,12 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CantBeCounteredControlledEffect; import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect; +import mage.abilities.hint.ValueHint; import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; @@ -54,6 +57,7 @@ public final class DestinySpinner extends CardImpl { // {3}{G}: Target land you control becomes an X/X Elemental creature with trample and haste until end of turn, where X is the number of enchantments you control. It's still a land. Ability ability = new SimpleActivatedAbility(new DestinySpinnerEffect(), new ManaCostsImpl("{3}{G}")); ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_LAND)); + ability.addHint(new ValueHint("Enchantments you control", DestinySpinnerCount.instance)); this.addAbility(ability); } @@ -67,6 +71,30 @@ public final class DestinySpinner extends CardImpl { } } +enum DestinySpinnerCount implements DynamicValue { + instance; + + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + return game.getBattlefield().countAll(StaticFilters.FILTER_ENCHANTMENT_PERMANENT, sourceAbility.getControllerId(), game); + } + + @Override + public DynamicValue copy() { + return instance; + } + + @Override + public String toString() { + return "X"; + } + + @Override + public String getMessage() { + return ""; + } +} + class DestinySpinnerEffect extends OneShotEffect { DestinySpinnerEffect() { @@ -86,7 +114,7 @@ class DestinySpinnerEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - int pt = game.getBattlefield().countAll(StaticFilters.FILTER_ENCHANTMENT_PERMANENT, source.getControllerId(), game); + int pt = DestinySpinnerCount.instance.calculate(game, source, this); game.addEffect(new BecomesCreatureTargetEffect( new CreatureToken(pt, pt, "") .withSubType(SubType.ELEMENTAL)