From 988740ab5364cbc167e8cdc8404218e1fb9e5af6 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 26 May 2021 18:23:40 -0400 Subject: [PATCH] added hint for domain --- .../src/mage/cards/a/AlliedStrategies.java | 2 + .../src/mage/cards/a/AvenTrailblazer.java | 3 +- .../src/mage/cards/c/CollapsingBorders.java | 3 +- .../src/mage/cards/c/CollectiveRestraint.java | 3 +- Mage.Sets/src/mage/cards/d/Draco.java | 3 +- Mage.Sets/src/mage/cards/d/DragDown.java | 2 + Mage.Sets/src/mage/cards/e/EvasiveAction.java | 2 + Mage.Sets/src/mage/cards/e/ExoticCurse.java | 3 +- Mage.Sets/src/mage/cards/e/ExoticDisease.java | 4 +- .../src/mage/cards/e/ExplodingBorders.java | 2 + Mage.Sets/src/mage/cards/g/GaeasMight.java | 2 + Mage.Sets/src/mage/cards/k/KavuScout.java | 3 +- Mage.Sets/src/mage/cards/m/ManaforceMace.java | 3 +- .../src/mage/cards/m/MaskOfIntolerance.java | 3 +- Mage.Sets/src/mage/cards/m/MatcaRioters.java | 5 +- Mage.Sets/src/mage/cards/m/MightOfAlara.java | 2 + .../src/mage/cards/o/OrderedMigration.java | 2 + Mage.Sets/src/mage/cards/p/PlanarDespair.java | 4 +- Mage.Sets/src/mage/cards/p/PowerArmor.java | 3 +- .../src/mage/cards/p/PrismaticGeoscope.java | 3 +- Mage.Sets/src/mage/cards/s/SamitePilgrim.java | 3 +- Mage.Sets/src/mage/cards/s/SporeBurst.java | 2 + Mage.Sets/src/mage/cards/s/Stratadon.java | 3 +- .../src/mage/cards/s/StrengthOfUnity.java | 5 +- Mage.Sets/src/mage/cards/t/TribalFlames.java | 2 + .../src/mage/cards/t/TrompTheDomains.java | 2 + .../src/mage/cards/v/VoicesFromTheVoid.java | 2 + .../src/mage/cards/w/WanderingGoblins.java | 3 +- .../src/mage/cards/w/WanderingStream.java | 4 +- .../src/mage/cards/w/WayfaringGiant.java | 5 +- .../src/mage/cards/w/WorldlyCounsel.java | 2 + .../dynamicvalue/common/DomainValue.java | 47 ++++++++----------- .../abilities/hint/common/DomainHint.java | 47 +++++++++++++++++++ 33 files changed, 134 insertions(+), 50 deletions(-) create mode 100644 Mage/src/main/java/mage/abilities/hint/common/DomainHint.java diff --git a/Mage.Sets/src/mage/cards/a/AlliedStrategies.java b/Mage.Sets/src/mage/cards/a/AlliedStrategies.java index cb1ea357a5..c91c6d71cf 100644 --- a/Mage.Sets/src/mage/cards/a/AlliedStrategies.java +++ b/Mage.Sets/src/mage/cards/a/AlliedStrategies.java @@ -4,6 +4,7 @@ package mage.cards.a; import java.util.UUID; import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.common.DrawCardTargetEffect; +import mage.abilities.hint.common.DomainHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.AbilityWord; @@ -23,6 +24,7 @@ public final class AlliedStrategies extends CardImpl { this.getSpellAbility().addEffect(new DrawCardTargetEffect(new DomainValue(true))); this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN); + this.getSpellAbility().addHint(DomainHint.instance); } diff --git a/Mage.Sets/src/mage/cards/a/AvenTrailblazer.java b/Mage.Sets/src/mage/cards/a/AvenTrailblazer.java index cdc179d486..dffb444432 100644 --- a/Mage.Sets/src/mage/cards/a/AvenTrailblazer.java +++ b/Mage.Sets/src/mage/cards/a/AvenTrailblazer.java @@ -6,6 +6,7 @@ import mage.MageInt; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.common.continuous.SetToughnessSourceEffect; +import mage.abilities.hint.common.DomainHint; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -32,7 +33,7 @@ public final class AvenTrailblazer extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Domain - Aven Trailblazer's toughness is equal to the number of basic land types among lands you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetToughnessSourceEffect(new DomainValue(), Duration.EndOfGame))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetToughnessSourceEffect(new DomainValue(), Duration.EndOfGame)).addHint(DomainHint.instance)); } diff --git a/Mage.Sets/src/mage/cards/c/CollapsingBorders.java b/Mage.Sets/src/mage/cards/c/CollapsingBorders.java index aef636a993..9a066fe61a 100644 --- a/Mage.Sets/src/mage/cards/c/CollapsingBorders.java +++ b/Mage.Sets/src/mage/cards/c/CollapsingBorders.java @@ -8,6 +8,7 @@ import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.GainLifeTargetEffect; +import mage.abilities.hint.common.DomainHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.AbilityWord; @@ -32,7 +33,7 @@ public final class CollapsingBorders extends CardImpl { effect.setText("Then {this} deals 3 damage to that player"); ability.addEffect(effect); ability.setAbilityWord(AbilityWord.DOMAIN); - this.addAbility(ability); + this.addAbility(ability.addHint(DomainHint.instance)); } private CollapsingBorders(final CollapsingBorders card) { diff --git a/Mage.Sets/src/mage/cards/c/CollectiveRestraint.java b/Mage.Sets/src/mage/cards/c/CollectiveRestraint.java index 0cb4732cca..fc36ceb624 100644 --- a/Mage.Sets/src/mage/cards/c/CollectiveRestraint.java +++ b/Mage.Sets/src/mage/cards/c/CollectiveRestraint.java @@ -8,6 +8,7 @@ import mage.abilities.costs.mana.ManaCosts; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.common.combat.CantAttackYouUnlessPayManaAllEffect; +import mage.abilities.hint.common.DomainHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.AbilityWord; @@ -28,7 +29,7 @@ public final class CollectiveRestraint extends CardImpl { // Domain - Creatures can't attack you unless their controller pays {X} for each creature they control that's attacking you, where X is the number of basic land types you control. Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new CollectiveRestraintPayManaToAttackAllEffect()); ability.setAbilityWord(AbilityWord.DOMAIN); - this.addAbility(ability); + this.addAbility(ability.addHint(DomainHint.instance)); } diff --git a/Mage.Sets/src/mage/cards/d/Draco.java b/Mage.Sets/src/mage/cards/d/Draco.java index cee7ac1fe5..ee19347500 100644 --- a/Mage.Sets/src/mage/cards/d/Draco.java +++ b/Mage.Sets/src/mage/cards/d/Draco.java @@ -8,6 +8,7 @@ import mage.abilities.costs.Cost; import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.cost.CostModificationEffectImpl; +import mage.abilities.hint.common.DomainHint; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -35,7 +36,7 @@ public final class Draco extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Domain - Draco costs {2} less to cast for each basic land type among lands you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new DracoCostReductionEffect())); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new DracoCostReductionEffect()).addHint(DomainHint.instance)); // Domain - At the beginning of your upkeep, sacrifice Draco unless you pay {10}. This cost is reduced by {2} for each basic land type among lands you control. this.addAbility(new BeginningOfUpkeepTriggeredAbility(new DracoSacrificeUnlessPaysEffect(), TargetController.YOU, false)); diff --git a/Mage.Sets/src/mage/cards/d/DragDown.java b/Mage.Sets/src/mage/cards/d/DragDown.java index 60b9d4bb1f..b06002ca0b 100644 --- a/Mage.Sets/src/mage/cards/d/DragDown.java +++ b/Mage.Sets/src/mage/cards/d/DragDown.java @@ -4,6 +4,7 @@ package mage.cards.d; import java.util.UUID; import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.hint.common.DomainHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -23,6 +24,7 @@ public final class DragDown extends CardImpl { // Domain - Target creature gets -1/-1 until end of turn for each basic land type among lands you control. this.getSpellAbility().addEffect(new BoostTargetEffect(new DomainValue(-1), new DomainValue(-1), Duration.EndOfTurn, true)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addHint(DomainHint.instance); } private DragDown(final DragDown card) { diff --git a/Mage.Sets/src/mage/cards/e/EvasiveAction.java b/Mage.Sets/src/mage/cards/e/EvasiveAction.java index 0ae5d0f73e..b3b81d4e1a 100644 --- a/Mage.Sets/src/mage/cards/e/EvasiveAction.java +++ b/Mage.Sets/src/mage/cards/e/EvasiveAction.java @@ -4,6 +4,7 @@ package mage.cards.e; import java.util.UUID; import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.common.CounterUnlessPaysEffect; +import mage.abilities.hint.common.DomainHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.AbilityWord; @@ -23,6 +24,7 @@ public final class EvasiveAction extends CardImpl { this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new DomainValue())); this.getSpellAbility().addTarget(new TargetSpell()); this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN); + this.getSpellAbility().addHint(DomainHint.instance); } private EvasiveAction(final EvasiveAction card) { diff --git a/Mage.Sets/src/mage/cards/e/ExoticCurse.java b/Mage.Sets/src/mage/cards/e/ExoticCurse.java index 71562f8393..dbd5f7c720 100644 --- a/Mage.Sets/src/mage/cards/e/ExoticCurse.java +++ b/Mage.Sets/src/mage/cards/e/ExoticCurse.java @@ -7,6 +7,7 @@ import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.dynamicvalue.common.SignInversionDynamicValue; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.hint.common.DomainHint; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -35,7 +36,7 @@ public final class ExoticCurse extends CardImpl { DynamicValue unboost = new SignInversionDynamicValue(new DomainValue()); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(unboost, unboost, Duration.WhileOnBattlefield)); ability.setAbilityWord(AbilityWord.DOMAIN); - this.addAbility(ability); + this.addAbility(ability.addHint(DomainHint.instance)); } private ExoticCurse(final ExoticCurse card) { diff --git a/Mage.Sets/src/mage/cards/e/ExoticDisease.java b/Mage.Sets/src/mage/cards/e/ExoticDisease.java index 37cd28a57f..15b82d9d6b 100644 --- a/Mage.Sets/src/mage/cards/e/ExoticDisease.java +++ b/Mage.Sets/src/mage/cards/e/ExoticDisease.java @@ -6,6 +6,7 @@ import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.Effect; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.abilities.hint.common.DomainHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -23,12 +24,13 @@ public final class ExoticDisease extends CardImpl { // Domain - Target player loses X life and you gain X life, where X is the number of basic land types among lands you control. DomainValue dv = new DomainValue(); Effect effect = new LoseLifeTargetEffect(dv); - effect.setText("Domain - Target player loses X life"); + effect.setText("Domain — Target player loses X life"); this.getSpellAbility().addEffect(effect); effect = new GainLifeEffect(dv); effect.setText("and you gain X life, where X is the number of basic land types among lands you control"); this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addHint(DomainHint.instance); } private ExoticDisease(final ExoticDisease card) { diff --git a/Mage.Sets/src/mage/cards/e/ExplodingBorders.java b/Mage.Sets/src/mage/cards/e/ExplodingBorders.java index 392cc82517..5100de8de8 100644 --- a/Mage.Sets/src/mage/cards/e/ExplodingBorders.java +++ b/Mage.Sets/src/mage/cards/e/ExplodingBorders.java @@ -4,6 +4,7 @@ package mage.cards.e; import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.abilities.hint.common.DomainHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -26,6 +27,7 @@ public final class ExplodingBorders extends CardImpl { this.getSpellAbility().addEffect(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND), true)); this.getSpellAbility().addEffect(new DamageTargetEffect(new DomainValue())); this.getSpellAbility().addTarget(new TargetPlayerOrPlaneswalker()); + this.getSpellAbility().addHint(DomainHint.instance); } private ExplodingBorders(final ExplodingBorders card) { diff --git a/Mage.Sets/src/mage/cards/g/GaeasMight.java b/Mage.Sets/src/mage/cards/g/GaeasMight.java index 0334b2dcd9..43338fa1f8 100644 --- a/Mage.Sets/src/mage/cards/g/GaeasMight.java +++ b/Mage.Sets/src/mage/cards/g/GaeasMight.java @@ -4,6 +4,7 @@ package mage.cards.g; import java.util.UUID; import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.hint.common.DomainHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.AbilityWord; @@ -24,6 +25,7 @@ public final class GaeasMight extends CardImpl { this.getSpellAbility().addEffect(new BoostTargetEffect(new DomainValue(), new DomainValue(), Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN); + this.getSpellAbility().addHint(DomainHint.instance); } private GaeasMight(final GaeasMight card) { diff --git a/Mage.Sets/src/mage/cards/k/KavuScout.java b/Mage.Sets/src/mage/cards/k/KavuScout.java index 7b1cf17bb3..49f0682e84 100644 --- a/Mage.Sets/src/mage/cards/k/KavuScout.java +++ b/Mage.Sets/src/mage/cards/k/KavuScout.java @@ -8,6 +8,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.hint.common.DomainHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.AbilityWord; @@ -33,7 +34,7 @@ public final class KavuScout extends CardImpl { // Domain - Kavu Scout gets +1/+0 for each basic land type among lands you control. Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(new DomainValue(), StaticValue.get(0), Duration.WhileOnBattlefield)); ability.setAbilityWord(AbilityWord.DOMAIN); - this.addAbility(ability); + this.addAbility(ability.addHint(DomainHint.instance)); } private KavuScout(final KavuScout card) { diff --git a/Mage.Sets/src/mage/cards/m/ManaforceMace.java b/Mage.Sets/src/mage/cards/m/ManaforceMace.java index 9cf6c9a0de..c85889259a 100644 --- a/Mage.Sets/src/mage/cards/m/ManaforceMace.java +++ b/Mage.Sets/src/mage/cards/m/ManaforceMace.java @@ -6,6 +6,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.common.continuous.BoostEquippedEffect; +import mage.abilities.hint.common.DomainHint; import mage.abilities.keyword.EquipAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -26,7 +27,7 @@ public final class ManaforceMace extends CardImpl { // Domain - Equipped creature gets +1/+1 for each basic land type among lands you control. DomainValue value = new DomainValue(); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(value, value))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(value, value)).addHint(DomainHint.instance)); // Equip {3} this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(3))); } diff --git a/Mage.Sets/src/mage/cards/m/MaskOfIntolerance.java b/Mage.Sets/src/mage/cards/m/MaskOfIntolerance.java index d1d58cb31a..d685e2e230 100644 --- a/Mage.Sets/src/mage/cards/m/MaskOfIntolerance.java +++ b/Mage.Sets/src/mage/cards/m/MaskOfIntolerance.java @@ -9,6 +9,7 @@ import mage.abilities.condition.IntCompareCondition; import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.hint.common.DomainHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -29,7 +30,7 @@ public final class MaskOfIntolerance extends CardImpl { // At the beginning of each player's upkeep, if there are four or more basic land types among lands that player controls, Mask of Intolerance deals 3 damage to that player. TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new DamageTargetEffect(3), TargetController.ANY, false); this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new MaskOfIntoleranceCondition(), - "At the beginning of each player's upkeep, if there are four or more basic land types among lands that player controls, {this} deals 3 damage to that player.")); + "At the beginning of each player's upkeep, if there are four or more basic land types among lands that player controls, {this} deals 3 damage to that player.").addHint(DomainHint.instance)); } private MaskOfIntolerance(final MaskOfIntolerance card) { diff --git a/Mage.Sets/src/mage/cards/m/MatcaRioters.java b/Mage.Sets/src/mage/cards/m/MatcaRioters.java index 86c8465d0e..ded107e59e 100644 --- a/Mage.Sets/src/mage/cards/m/MatcaRioters.java +++ b/Mage.Sets/src/mage/cards/m/MatcaRioters.java @@ -7,6 +7,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect; +import mage.abilities.hint.common.DomainHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -30,8 +31,8 @@ public final class MatcaRioters extends CardImpl { // Domain - Matca Rioters's power and toughness are each equal to the number of basic land types among lands you control. Effect effect = new SetPowerToughnessSourceEffect(new DomainValue(), Duration.EndOfGame); - effect.setText("Domain - {this}'s power and toughness are each equal to the number of basic land types among lands you control."); - this.addAbility(new SimpleStaticAbility(Zone.ALL, effect)); + effect.setText("Domain — {this}'s power and toughness are each equal to the number of basic land types among lands you control."); + this.addAbility(new SimpleStaticAbility(Zone.ALL, effect).addHint(DomainHint.instance)); } private MatcaRioters(final MatcaRioters card) { diff --git a/Mage.Sets/src/mage/cards/m/MightOfAlara.java b/Mage.Sets/src/mage/cards/m/MightOfAlara.java index 9e77d4115e..ab22da911f 100644 --- a/Mage.Sets/src/mage/cards/m/MightOfAlara.java +++ b/Mage.Sets/src/mage/cards/m/MightOfAlara.java @@ -4,6 +4,7 @@ package mage.cards.m; import java.util.UUID; import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.hint.common.DomainHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -23,6 +24,7 @@ public final class MightOfAlara extends CardImpl { // Domain - Target creature gets +1/+1 until end of turn for each basic land type among lands you control. this.getSpellAbility().addEffect(new BoostTargetEffect(new DomainValue(), new DomainValue(), Duration.EndOfTurn, true)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addHint(DomainHint.instance); } private MightOfAlara(final MightOfAlara card) { diff --git a/Mage.Sets/src/mage/cards/o/OrderedMigration.java b/Mage.Sets/src/mage/cards/o/OrderedMigration.java index b7c7629eab..9076afaa5c 100644 --- a/Mage.Sets/src/mage/cards/o/OrderedMigration.java +++ b/Mage.Sets/src/mage/cards/o/OrderedMigration.java @@ -4,6 +4,7 @@ package mage.cards.o; import java.util.UUID; import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.hint.common.DomainHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.AbilityWord; @@ -23,6 +24,7 @@ public final class OrderedMigration extends CardImpl { // Domain - Create a 1/1 blue Bird creature token with flying for each basic land type among lands you control. this.getSpellAbility().addEffect(new CreateTokenEffect(new OrderedMigrationBirdToken(), new DomainValue())); this.getSpellAbility().setAbilityWord(AbilityWord.DOMAIN); + this.getSpellAbility().addHint(DomainHint.instance); } private OrderedMigration(final OrderedMigration card) { diff --git a/Mage.Sets/src/mage/cards/p/PlanarDespair.java b/Mage.Sets/src/mage/cards/p/PlanarDespair.java index d194acc353..65bdb3dcf5 100644 --- a/Mage.Sets/src/mage/cards/p/PlanarDespair.java +++ b/Mage.Sets/src/mage/cards/p/PlanarDespair.java @@ -7,6 +7,7 @@ import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.dynamicvalue.common.SignInversionDynamicValue; import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.abilities.hint.common.DomainHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -25,8 +26,9 @@ public final class PlanarDespair extends CardImpl { // Domain - All creatures get -1/-1 until end of turn for each basic land type among lands you control. DynamicValue dv = new SignInversionDynamicValue(new DomainValue()); Effect effect = new BoostAllEffect(dv, dv, Duration.EndOfTurn); - effect.setText("Domain - All creatures get -1/-1 until end of turn for each basic land type among lands you control."); + effect.setText("Domain — All creatures get -1/-1 until end of turn for each basic land type among lands you control."); this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addHint(DomainHint.instance); } private PlanarDespair(final PlanarDespair card) { diff --git a/Mage.Sets/src/mage/cards/p/PowerArmor.java b/Mage.Sets/src/mage/cards/p/PowerArmor.java index 647790ab49..691283bce2 100644 --- a/Mage.Sets/src/mage/cards/p/PowerArmor.java +++ b/Mage.Sets/src/mage/cards/p/PowerArmor.java @@ -8,6 +8,7 @@ import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.hint.common.DomainHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.AbilityWord; @@ -31,7 +32,7 @@ public final class PowerArmor extends CardImpl { ability.addCost(new ManaCostsImpl("{3}")); ability.addTarget(new TargetCreaturePermanent()); ability.setAbilityWord(AbilityWord.DOMAIN); - this.addAbility(ability); + this.addAbility(ability.addHint(DomainHint.instance)); } private PowerArmor(final PowerArmor card) { diff --git a/Mage.Sets/src/mage/cards/p/PrismaticGeoscope.java b/Mage.Sets/src/mage/cards/p/PrismaticGeoscope.java index 3d4aff05f8..9ac57bc9f9 100644 --- a/Mage.Sets/src/mage/cards/p/PrismaticGeoscope.java +++ b/Mage.Sets/src/mage/cards/p/PrismaticGeoscope.java @@ -7,6 +7,7 @@ import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.dynamicvalue.common.DomainValue; +import mage.abilities.hint.common.DomainHint; import mage.abilities.mana.DynamicManaAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -32,7 +33,7 @@ public final class PrismaticGeoscope extends CardImpl { + " where X is the number of basic land types among lands you control." ); ability.setAbilityWord(AbilityWord.DOMAIN); - this.addAbility(ability); + this.addAbility(ability.addHint(DomainHint.instance)); } private PrismaticGeoscope(final PrismaticGeoscope card) { diff --git a/Mage.Sets/src/mage/cards/s/SamitePilgrim.java b/Mage.Sets/src/mage/cards/s/SamitePilgrim.java index 708492a71e..7dc7467ba7 100644 --- a/Mage.Sets/src/mage/cards/s/SamitePilgrim.java +++ b/Mage.Sets/src/mage/cards/s/SamitePilgrim.java @@ -8,6 +8,7 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.PreventionEffectImpl; +import mage.abilities.hint.common.DomainHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -32,7 +33,7 @@ public final class SamitePilgrim extends CardImpl { Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SamitePilgrimPreventDamageToTargetEffect(), new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent()); ability.setAbilityWord(AbilityWord.DOMAIN); - this.addAbility(ability); + this.addAbility(ability.addHint(DomainHint.instance)); } private SamitePilgrim(final SamitePilgrim card) { diff --git a/Mage.Sets/src/mage/cards/s/SporeBurst.java b/Mage.Sets/src/mage/cards/s/SporeBurst.java index 9921e46913..90153777de 100644 --- a/Mage.Sets/src/mage/cards/s/SporeBurst.java +++ b/Mage.Sets/src/mage/cards/s/SporeBurst.java @@ -4,6 +4,7 @@ package mage.cards.s; import java.util.UUID; import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.hint.common.DomainHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -21,6 +22,7 @@ public final class SporeBurst extends CardImpl { // Domain - Create a 1/1 green Saproling creature token for each basic land type among lands you control. this.getSpellAbility().addEffect(new CreateTokenEffect(new SaprolingToken(), new DomainValue())); + this.getSpellAbility().addHint(DomainHint.instance); } private SporeBurst(final SporeBurst card) { diff --git a/Mage.Sets/src/mage/cards/s/Stratadon.java b/Mage.Sets/src/mage/cards/s/Stratadon.java index 3fbe22ffc0..c786703af2 100644 --- a/Mage.Sets/src/mage/cards/s/Stratadon.java +++ b/Mage.Sets/src/mage/cards/s/Stratadon.java @@ -7,6 +7,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.common.cost.CostModificationEffectImpl; +import mage.abilities.hint.common.DomainHint; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -32,7 +33,7 @@ public final class Stratadon extends CardImpl { this.toughness = new MageInt(5); // Domain - Stratadon costs {1} less to cast for each basic land type among lands you control. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new StratadonCostReductionEffect())); + this.addAbility(new SimpleStaticAbility(Zone.ALL, new StratadonCostReductionEffect()).addHint(DomainHint.instance)); // Trample this.addAbility(TrampleAbility.getInstance()); } diff --git a/Mage.Sets/src/mage/cards/s/StrengthOfUnity.java b/Mage.Sets/src/mage/cards/s/StrengthOfUnity.java index 67f1592567..324c9db937 100644 --- a/Mage.Sets/src/mage/cards/s/StrengthOfUnity.java +++ b/Mage.Sets/src/mage/cards/s/StrengthOfUnity.java @@ -8,6 +8,7 @@ import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.Effect; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.hint.common.DomainHint; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -38,8 +39,8 @@ public final class StrengthOfUnity extends CardImpl { // Domain - Enchanted creature gets +1/+1 for each basic land type among lands you control. DomainValue dv = new DomainValue(); Effect effect = new BoostEnchantedEffect(dv, dv); - effect.setText("Domain - Enchanted creature gets +1/+1 for each basic land type among lands you control."); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + effect.setText("Domain — Enchanted creature gets +1/+1 for each basic land type among lands you control."); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect).addHint(DomainHint.instance)); } private StrengthOfUnity(final StrengthOfUnity card) { diff --git a/Mage.Sets/src/mage/cards/t/TribalFlames.java b/Mage.Sets/src/mage/cards/t/TribalFlames.java index 0229acb1dd..24eef4f202 100644 --- a/Mage.Sets/src/mage/cards/t/TribalFlames.java +++ b/Mage.Sets/src/mage/cards/t/TribalFlames.java @@ -4,6 +4,7 @@ package mage.cards.t; import java.util.UUID; import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.hint.common.DomainHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -22,6 +23,7 @@ public final class TribalFlames extends CardImpl { // Domain - Tribal Flames deals X damage to any target, where X is the number of basic land types among lands you control. this.getSpellAbility().addEffect(new DamageTargetEffect(new DomainValue())); this.getSpellAbility().addTarget(new TargetAnyTarget()); + this.getSpellAbility().addHint(DomainHint.instance); } private TribalFlames(final TribalFlames card) { diff --git a/Mage.Sets/src/mage/cards/t/TrompTheDomains.java b/Mage.Sets/src/mage/cards/t/TrompTheDomains.java index 7c22189199..bea637c779 100644 --- a/Mage.Sets/src/mage/cards/t/TrompTheDomains.java +++ b/Mage.Sets/src/mage/cards/t/TrompTheDomains.java @@ -7,6 +7,7 @@ import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.BoostControlledEffect; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.hint.common.DomainHint; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -31,6 +32,7 @@ public final class TrompTheDomains extends CardImpl { effect = new BoostControlledEffect(domain, domain, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false); effect.setText("and get +1/+1 for each basic land type among lands you control"); this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addHint(DomainHint.instance); } diff --git a/Mage.Sets/src/mage/cards/v/VoicesFromTheVoid.java b/Mage.Sets/src/mage/cards/v/VoicesFromTheVoid.java index 8452c79416..bea4bb4db9 100644 --- a/Mage.Sets/src/mage/cards/v/VoicesFromTheVoid.java +++ b/Mage.Sets/src/mage/cards/v/VoicesFromTheVoid.java @@ -4,6 +4,7 @@ package mage.cards.v; import java.util.UUID; import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.abilities.hint.common.DomainHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -22,6 +23,7 @@ public final class VoicesFromTheVoid extends CardImpl { // Domain - Target player discards a card for each basic land type among lands you control. this.getSpellAbility().addEffect(new DiscardTargetEffect(new DomainValue())); this.getSpellAbility().addTarget(new TargetPlayer()); + this.getSpellAbility().addHint(DomainHint.instance); } private VoicesFromTheVoid(final VoicesFromTheVoid card) { diff --git a/Mage.Sets/src/mage/cards/w/WanderingGoblins.java b/Mage.Sets/src/mage/cards/w/WanderingGoblins.java index e23908fd01..836158673e 100644 --- a/Mage.Sets/src/mage/cards/w/WanderingGoblins.java +++ b/Mage.Sets/src/mage/cards/w/WanderingGoblins.java @@ -8,6 +8,7 @@ import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.hint.common.DomainHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -30,7 +31,7 @@ public final class WanderingGoblins extends CardImpl { this.toughness = new MageInt(3); // Domain - {3}: Wandering Goblins gets +1/+0 until end of turn for each basic land type among lands you control. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(new DomainValue(), StaticValue.get(0), Duration.EndOfTurn), new GenericManaCost(3))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(new DomainValue(), StaticValue.get(0), Duration.EndOfTurn, true), new GenericManaCost(3)).addHint(DomainHint.instance)); } private WanderingGoblins(final WanderingGoblins card) { diff --git a/Mage.Sets/src/mage/cards/w/WanderingStream.java b/Mage.Sets/src/mage/cards/w/WanderingStream.java index 71718b39a5..c876fde215 100644 --- a/Mage.Sets/src/mage/cards/w/WanderingStream.java +++ b/Mage.Sets/src/mage/cards/w/WanderingStream.java @@ -6,6 +6,7 @@ import mage.abilities.dynamicvalue.MultipliedValue; import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.Effect; import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.hint.common.DomainHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -21,8 +22,9 @@ public final class WanderingStream extends CardImpl { // Domain - You gain 2 life for each basic land type among lands you control. Effect effect = new GainLifeEffect(new MultipliedValue(new DomainValue(), 2)); - effect.setText("Domain - You gain 2 life for each basic land type among lands you control"); + effect.setText("Domain — You gain 2 life for each basic land type among lands you control"); this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addHint(DomainHint.instance); } private WanderingStream(final WanderingStream card) { diff --git a/Mage.Sets/src/mage/cards/w/WayfaringGiant.java b/Mage.Sets/src/mage/cards/w/WayfaringGiant.java index 019f031a3b..93ba8004d7 100644 --- a/Mage.Sets/src/mage/cards/w/WayfaringGiant.java +++ b/Mage.Sets/src/mage/cards/w/WayfaringGiant.java @@ -7,6 +7,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.hint.common.DomainHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -30,8 +31,8 @@ public final class WayfaringGiant extends CardImpl { // Domain - Wayfaring Giant gets +1/+1 for each basic land type among lands you control. DomainValue dv = new DomainValue(); Effect effect = new BoostSourceEffect(dv, dv, Duration.WhileOnBattlefield); - effect.setText("Domain - {this} gets +1/+1 for each basic land type among lands you control."); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + effect.setText("Domain — {this} gets +1/+1 for each basic land type among lands you control."); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect).addHint(DomainHint.instance)); } private WayfaringGiant(final WayfaringGiant card) { diff --git a/Mage.Sets/src/mage/cards/w/WorldlyCounsel.java b/Mage.Sets/src/mage/cards/w/WorldlyCounsel.java index 1d28504d13..204e8fa281 100644 --- a/Mage.Sets/src/mage/cards/w/WorldlyCounsel.java +++ b/Mage.Sets/src/mage/cards/w/WorldlyCounsel.java @@ -5,6 +5,7 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.dynamicvalue.common.DomainValue; import mage.abilities.effects.OneShotEffect; +import mage.abilities.hint.common.DomainHint; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -29,6 +30,7 @@ public final class WorldlyCounsel extends CardImpl { // Domain - Look at the top X cards of your library, where X is the number of basic land types among lands you control. Put one of those cards into your hand and the rest on the bottom of your library in any order. this.getSpellAbility().addEffect(new WorldlyCounselEffect()); + this.getSpellAbility().addHint(DomainHint.instance); } private WorldlyCounsel(final WorldlyCounsel card) { diff --git a/Mage/src/main/java/mage/abilities/dynamicvalue/common/DomainValue.java b/Mage/src/main/java/mage/abilities/dynamicvalue/common/DomainValue.java index c4bc6caaaa..2bbbae7b01 100644 --- a/Mage/src/main/java/mage/abilities/dynamicvalue/common/DomainValue.java +++ b/Mage/src/main/java/mage/abilities/dynamicvalue/common/DomainValue.java @@ -4,18 +4,20 @@ import mage.abilities.Ability; import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; import mage.constants.SubType; +import mage.filter.StaticFilters; import mage.game.Game; -import mage.game.permanent.Permanent; +import java.util.Collection; import java.util.UUID; +import java.util.stream.Collectors; /** * @author Loki */ public class DomainValue implements DynamicValue { - private int amount; - private boolean countTargetPlayer; + private final int amount; + private final boolean countTargetPlayer; private UUID playerId; public DomainValue() { @@ -48,11 +50,6 @@ public class DomainValue implements DynamicValue { @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { - int havePlains = 0; - int haveIslands = 0; - int haveMountains = 0; - int haveSwamps = 0; - int haveForests = 0; UUID targetPlayer; if (playerId != null) { targetPlayer = playerId; @@ -61,26 +58,20 @@ public class DomainValue implements DynamicValue { } else { targetPlayer = sourceAbility.getControllerId(); } - for (Permanent p : game.getBattlefield().getAllActivePermanents(targetPlayer)) { - if (p.isLand()) { - if (havePlains == 0 && p.hasSubtype(SubType.PLAINS, game)) { - havePlains = 1; - } - if (haveIslands == 0 && p.hasSubtype(SubType.ISLAND, game)) { - haveIslands = 1; - } - if (haveMountains == 0 && p.hasSubtype(SubType.MOUNTAIN, game)) { - haveMountains = 1; - } - if (haveSwamps == 0 && p.hasSubtype(SubType.SWAMP, game)) { - haveSwamps = 1; - } - if (haveForests == 0 && p.hasSubtype(SubType.FOREST, game)) { - haveForests = 1; - } - } - } - return amount * (haveForests + haveIslands + haveMountains + havePlains + haveSwamps); + return game.getBattlefield() + .getActivePermanents( + StaticFilters.FILTER_CONTROLLED_PERMANENT_LANDS, + targetPlayer, sourceAbility.getSourceId(), game + ).stream() + .map(permanent -> SubType + .getBasicLands() + .stream() + .filter(subType -> permanent.hasSubtype(subType, game)) + .collect(Collectors.toSet())) + .flatMap(Collection::stream) + .distinct() + .mapToInt(x -> amount) + .sum(); } @Override diff --git a/Mage/src/main/java/mage/abilities/hint/common/DomainHint.java b/Mage/src/main/java/mage/abilities/hint/common/DomainHint.java new file mode 100644 index 0000000000..3b0233e341 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/hint/common/DomainHint.java @@ -0,0 +1,47 @@ +package mage.abilities.hint.common; + +import mage.abilities.Ability; +import mage.abilities.hint.Hint; +import mage.constants.SubType; +import mage.filter.StaticFilters; +import mage.game.Game; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Comparator; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author TheElk801 + */ +public enum DomainHint implements Hint { + instance; + private static final List typesInOrder = Arrays.asList("Plains", "Island", "Swamp", "Mountain", "Forest"); + + @Override + public String getText(Game game, Ability ability) { + List landTypes = game.getBattlefield() + .getActivePermanents( + StaticFilters.FILTER_CONTROLLED_PERMANENT_LANDS, + ability.getControllerId(), ability.getSourceId(), game + ).stream() + .map(permanent -> SubType + .getBasicLands() + .stream() + .filter(subType -> permanent.hasSubtype(subType, game)) + .collect(Collectors.toSet())) + .flatMap(Collection::stream) + .distinct() + .map(SubType::getDescription) + .sorted(Comparator.comparing(typesInOrder::indexOf)) + .collect(Collectors.toList()); + return "Basic land types among lands you control: " + landTypes.size() + + (landTypes.size() > 0 ? " (" + String.join(", ", landTypes) + ')' : ""); + } + + @Override + public DomainHint copy() { + return instance; + } +}