From 2662fa7799d712c1517843bc94a94133d8ae0264 Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Wed, 6 Jun 2018 15:30:16 -0400 Subject: [PATCH] Updated wordings and refactored class name for effects which prompt the player to choose a card name --- Mage.Sets/src/mage/cards/b/BrainPry.java | 6 ++--- Mage.Sets/src/mage/cards/c/CabalTherapy.java | 18 ++++++------- .../src/mage/cards/c/CheeringFanatic.java | 8 +++--- .../mage/cards/c/CouncilOfTheAbsolute.java | 15 +++++------ Mage.Sets/src/mage/cards/c/CursedScroll.java | 9 +++---- .../src/mage/cards/d/DeclarationOfNaught.java | 4 +-- .../src/mage/cards/d/DementiaSliver.java | 9 +++---- .../src/mage/cards/d/DesperateResearch.java | 6 ++--- Mage.Sets/src/mage/cards/d/Dispossess.java | 6 ++--- Mage.Sets/src/mage/cards/f/FailureComply.java | 8 +++--- Mage.Sets/src/mage/cards/f/Foreshadow.java | 6 ++--- .../src/mage/cards/g/GideonsIntervention.java | 10 +++---- .../mage/cards/i/IsperiaTheInscrutable.java | 8 +++--- .../src/mage/cards/l/LammastideWeave.java | 9 +++---- Mage.Sets/src/mage/cards/l/LostLegacy.java | 6 ++--- .../src/mage/cards/m/MagusOfTheScroll.java | 8 +++--- Mage.Sets/src/mage/cards/m/MeddlingMage.java | 13 +++++----- Mage.Sets/src/mage/cards/m/Memoricide.java | 11 ++++---- .../src/mage/cards/n/Nebuchadnezzar.java | 9 +++---- Mage.Sets/src/mage/cards/n/Nevermore.java | 11 ++++---- .../src/mage/cards/p/PhyrexianRevoker.java | 6 ++--- Mage.Sets/src/mage/cards/p/PithingNeedle.java | 6 ++--- Mage.Sets/src/mage/cards/p/Predict.java | 26 +++++++++---------- Mage.Sets/src/mage/cards/r/RunedHalo.java | 6 ++--- .../src/mage/cards/s/SlaughterGames.java | 6 ++--- .../src/mage/cards/s/SorcerousSpyglass.java | 8 +++--- .../src/mage/cards/s/SpoilsOfTheVault.java | 10 +++---- Mage.Sets/src/mage/cards/s/StainTheMind.java | 6 ++--- .../src/mage/cards/t/ThoughtHemorrhage.java | 12 +++++---- Mage.Sets/src/mage/cards/t/TunnelVision.java | 13 ++++++---- .../src/mage/cards/v/VoidstoneGargoyle.java | 15 +++++------ ...Effect.java => ChooseACardNameEffect.java} | 10 +++---- Mage/src/main/java/mage/cards/CardImpl.java | 4 +-- 33 files changed, 149 insertions(+), 159 deletions(-) rename Mage/src/main/java/mage/abilities/effects/common/{NameACardEffect.java => ChooseACardNameEffect.java} (94%) diff --git a/Mage.Sets/src/mage/cards/b/BrainPry.java b/Mage.Sets/src/mage/cards/b/BrainPry.java index bcb0a8920d1..2bebd65d8db 100644 --- a/Mage.Sets/src/mage/cards/b/BrainPry.java +++ b/Mage.Sets/src/mage/cards/b/BrainPry.java @@ -5,7 +5,7 @@ import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -25,7 +25,7 @@ public final class BrainPry extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{B}"); //Name a nonland card. Target player reveals their hand. That player discards a card with that name. If he or she can't, you draw a card. - this.getSpellAbility().addEffect((new NameACardEffect(NameACardEffect.TypeOfName.NON_LAND_NAME))); + this.getSpellAbility().addEffect((new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NON_LAND_NAME))); this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addEffect(new BrainPryEffect()); } @@ -56,7 +56,7 @@ class BrainPryEffect extends OneShotEffect { Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); - String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); + String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); if (targetPlayer != null && controller != null && sourceObject != null && cardName != null) { boolean hasDiscarded = false; for (Card card : targetPlayer.getHand().getCards(game)) { diff --git a/Mage.Sets/src/mage/cards/c/CabalTherapy.java b/Mage.Sets/src/mage/cards/c/CabalTherapy.java index 75e691855c9..70d7f7863cb 100644 --- a/Mage.Sets/src/mage/cards/c/CabalTherapy.java +++ b/Mage.Sets/src/mage/cards/c/CabalTherapy.java @@ -1,11 +1,10 @@ - package mage.cards.c; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.costs.common.SacrificeTargetCost; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.abilities.keyword.FlashbackAbility; import mage.cards.*; import mage.constants.CardType; @@ -26,10 +25,10 @@ import java.util.UUID; public final class CabalTherapy extends CardImpl { public CabalTherapy(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{B}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B}"); // Name a nonland card. Target player reveals their hand and discards all cards with that name. - this.getSpellAbility().addEffect((new NameACardEffect(NameACardEffect.TypeOfName.NON_LAND_NAME))); + this.getSpellAbility().addEffect((new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NON_LAND_NAME))); this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addEffect(new CabalTherapyEffect()); @@ -53,7 +52,7 @@ class CabalTherapyEffect extends OneShotEffect { public CabalTherapyEffect() { super(Outcome.Discard); - staticText = "Name a nonland card. Target player reveals their hand and discards all cards with that name"; + staticText = "Target player reveals their hand and discards all cards with that name"; } public CabalTherapyEffect(final CabalTherapyEffect effect) { @@ -66,16 +65,15 @@ class CabalTherapyEffect extends OneShotEffect { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); if (targetPlayer != null && controller != null && sourceObject != null) { - String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); + String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); Cards hand = targetPlayer.getHand(); for (Card card : hand.getCards(game)) { - if(card.isSplitCard()){ + if (card.isSplitCard()) { SplitCard splitCard = (SplitCard) card; - if(splitCard.getLeftHalfCard().getName().equals(cardName)){ + if (splitCard.getLeftHalfCard().getName().equals(cardName)) { targetPlayer.discard(card, source, game); - } - else if(splitCard.getRightHalfCard().getName().equals(cardName)){ + } else if (splitCard.getRightHalfCard().getName().equals(cardName)) { targetPlayer.discard(card, source, game); } } diff --git a/Mage.Sets/src/mage/cards/c/CheeringFanatic.java b/Mage.Sets/src/mage/cards/c/CheeringFanatic.java index 277fa9c6578..e0288f1af83 100644 --- a/Mage.Sets/src/mage/cards/c/CheeringFanatic.java +++ b/Mage.Sets/src/mage/cards/c/CheeringFanatic.java @@ -7,8 +7,8 @@ import mage.abilities.Ability; import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.NameACardEffect; -import mage.abilities.effects.common.NameACardEffect.TypeOfName; +import mage.abilities.effects.common.ChooseACardNameEffect; +import mage.abilities.effects.common.ChooseACardNameEffect.TypeOfName; import mage.abilities.effects.common.cost.SpellsCostReductionAllEffect; import mage.constants.SubType; import mage.cards.CardImpl; @@ -65,8 +65,8 @@ class CheeringFanaticEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - new NameACardEffect(TypeOfName.ALL).apply(game, source); - String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); + new ChooseACardNameEffect(TypeOfName.ALL).apply(game, source); + String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); FilterCard filter = new FilterCard(); filter.add(new NamePredicate(cardName)); ContinuousEffect effect = new SpellsCostReductionAllEffect(filter, 1); diff --git a/Mage.Sets/src/mage/cards/c/CouncilOfTheAbsolute.java b/Mage.Sets/src/mage/cards/c/CouncilOfTheAbsolute.java index ae6c87c0950..7349f4100e4 100644 --- a/Mage.Sets/src/mage/cards/c/CouncilOfTheAbsolute.java +++ b/Mage.Sets/src/mage/cards/c/CouncilOfTheAbsolute.java @@ -1,4 +1,3 @@ - package mage.cards.c; import java.util.UUID; @@ -9,7 +8,7 @@ import mage.abilities.SpellAbility; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.abilities.effects.common.cost.CostModificationEffectImpl; import mage.cards.Card; import mage.cards.CardImpl; @@ -35,7 +34,7 @@ public final class CouncilOfTheAbsolute extends CardImpl { this.toughness = new MageInt(4); // As Council of the Absolute enters the battlefield, name a card other than a creature or a land card. - this.addAbility(new AsEntersBattlefieldAbility(new NameACardEffect(NameACardEffect.TypeOfName.NON_LAND_AND_NON_CREATURE_NAME))); + this.addAbility(new AsEntersBattlefieldAbility(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NON_LAND_AND_NON_CREATURE_NAME))); // Your opponents can't cast the chosen card. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CouncilOfTheAbsoluteReplacementEffect())); // Spells with the chosen name cost 2 less for you to cast. @@ -58,7 +57,7 @@ class CouncilOfTheAbsoluteReplacementEffect extends ContinuousRuleModifyingEffec public CouncilOfTheAbsoluteReplacementEffect() { super(Duration.WhileOnBattlefield, Outcome.Detriment); - staticText = "Your opponents can't cast the chosen card"; + staticText = "Your opponents can't cast spells with the chosen name"; } public CouncilOfTheAbsoluteReplacementEffect(final CouncilOfTheAbsoluteReplacementEffect effect) { @@ -79,7 +78,7 @@ class CouncilOfTheAbsoluteReplacementEffect extends ContinuousRuleModifyingEffec public String getInfoMessage(Ability source, GameEvent event, Game game) { MageObject mageObject = game.getObject(source.getSourceId()); if (mageObject != null) { - return "You can't cast a card with that name (" + mageObject.getLogName() + " in play)."; + return "You can't cast a spell with that name (" + mageObject.getLogName() + " in play)."; } return null; } @@ -93,7 +92,7 @@ class CouncilOfTheAbsoluteReplacementEffect extends ContinuousRuleModifyingEffec public boolean applies(GameEvent event, Ability source, Game game) { if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { MageObject object = game.getObject(event.getSourceId()); - if (object != null && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY))) { + if (object != null && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY))) { return true; } } @@ -105,7 +104,7 @@ class CouncilOfTheAbsoluteCostReductionEffect extends CostModificationEffectImpl public CouncilOfTheAbsoluteCostReductionEffect() { super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST); - this.staticText = "Spells with the chosen name cost 2 less for you to cast"; + this.staticText = "Spells with the chosen name you cast cost 2 less to cast"; } protected CouncilOfTheAbsoluteCostReductionEffect(CouncilOfTheAbsoluteCostReductionEffect effect) { @@ -123,7 +122,7 @@ class CouncilOfTheAbsoluteCostReductionEffect extends CostModificationEffectImpl if ((abilityToModify instanceof SpellAbility) && abilityToModify.getControllerId().equals(source.getControllerId())) { Card card = game.getCard(abilityToModify.getSourceId()); - return card.getName().equals(game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY)); + return card.getName().equals(game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY)); } return false; } diff --git a/Mage.Sets/src/mage/cards/c/CursedScroll.java b/Mage.Sets/src/mage/cards/c/CursedScroll.java index cf185e8b836..0278616567f 100644 --- a/Mage.Sets/src/mage/cards/c/CursedScroll.java +++ b/Mage.Sets/src/mage/cards/c/CursedScroll.java @@ -1,4 +1,3 @@ - package mage.cards.c; import java.util.UUID; @@ -8,7 +7,7 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.cards.*; import mage.constants.CardType; import mage.constants.Outcome; @@ -29,7 +28,7 @@ public final class CursedScroll extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}"); // {3}, {T}: Name a card. Reveal a card at random from your hand. If it's the named card, Cursed Scroll deals 2 damage to any target. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new NameACardEffect(NameACardEffect.TypeOfName.ALL), new ManaCostsImpl("{3}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL), new ManaCostsImpl("{3}")); ability.addEffect(new CursedScrollEffect()); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetAnyTarget()); @@ -50,7 +49,7 @@ class CursedScrollEffect extends OneShotEffect { public CursedScrollEffect() { super(Outcome.Neutral); - staticText = "Reveal a card at random from your hand. If it's the named card, {this} deals 2 damage to any target"; + staticText = ", then reveal a card at random from your hand. If that card has the chosen name, {this} deals 2 damage to any target"; } public CursedScrollEffect(final CursedScrollEffect effect) { @@ -61,7 +60,7 @@ class CursedScrollEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); - String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); + String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); if (sourceObject != null && controller != null && cardName != null && !cardName.isEmpty()) { if (!controller.getHand().isEmpty()) { Cards revealed = new CardsImpl(); diff --git a/Mage.Sets/src/mage/cards/d/DeclarationOfNaught.java b/Mage.Sets/src/mage/cards/d/DeclarationOfNaught.java index 31a5f63eaa1..7fef07ec16a 100644 --- a/Mage.Sets/src/mage/cards/d/DeclarationOfNaught.java +++ b/Mage.Sets/src/mage/cards/d/DeclarationOfNaught.java @@ -6,7 +6,7 @@ import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.CounterTargetEffect; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -27,7 +27,7 @@ public final class DeclarationOfNaught extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{U}{U}"); // As Declaration of Naught enters the battlefield, name a card. - this.addAbility(new AsEntersBattlefieldAbility(new NameACardEffect(NameACardEffect.TypeOfName.ALL))); + this.addAbility(new AsEntersBattlefieldAbility(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL))); // {U}: Counter target spell with the chosen name. SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), new ManaCostsImpl("{U}")); diff --git a/Mage.Sets/src/mage/cards/d/DementiaSliver.java b/Mage.Sets/src/mage/cards/d/DementiaSliver.java index b1c1fe3ea81..b6ed7191236 100644 --- a/Mage.Sets/src/mage/cards/d/DementiaSliver.java +++ b/Mage.Sets/src/mage/cards/d/DementiaSliver.java @@ -1,4 +1,3 @@ - package mage.cards.d; import java.util.UUID; @@ -10,7 +9,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.MyTurnCondition; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.abilities.effects.common.continuous.GainAbilityAllEffect; import mage.cards.*; import mage.constants.*; @@ -39,7 +38,7 @@ public final class DementiaSliver extends CardImpl { this.toughness = new MageInt(3); // All Slivers have "{T}: Name a card. Target opponent reveals a card at random from their hand. If it's the named card, that player discards it. Activate this ability only during your turn." - Ability gainedAbility = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new NameACardEffect(NameACardEffect.TypeOfName.ALL), new TapSourceCost(), MyTurnCondition.instance); + Ability gainedAbility = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL), new TapSourceCost(), MyTurnCondition.instance); gainedAbility.addEffect(new DementiaSliverEffect()); gainedAbility.addTarget(new TargetOpponent()); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, @@ -66,7 +65,7 @@ class DementiaSliverEffect extends OneShotEffect { public DementiaSliverEffect() { super(Outcome.Damage); - staticText = "Target opponent reveals a card at random from their hand. If it's the named card, that player discards it"; + staticText = "Target opponent reveals a card at random from their hand. If that card has the chose name, that player discards it"; } public DementiaSliverEffect(final DementiaSliverEffect effect) { @@ -77,7 +76,7 @@ class DementiaSliverEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player opponent = game.getPlayer(targetPointer.getFirst(game, source)); MageObject sourceObject = game.getObject(source.getSourceId()); - String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); + String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); if (opponent != null && sourceObject != null && !cardName.isEmpty()) { if (!opponent.getHand().isEmpty()) { Cards revealed = new CardsImpl(); diff --git a/Mage.Sets/src/mage/cards/d/DesperateResearch.java b/Mage.Sets/src/mage/cards/d/DesperateResearch.java index bccb8982891..3fc1f6d2ba4 100644 --- a/Mage.Sets/src/mage/cards/d/DesperateResearch.java +++ b/Mage.Sets/src/mage/cards/d/DesperateResearch.java @@ -3,7 +3,7 @@ package mage.cards.d; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.cards.Cards; @@ -26,7 +26,7 @@ public final class DesperateResearch extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}"); // Choose a card name other than a basic land card name. Reveal the top seven cards of your library and put all of them with that name into your hand. Exile the rest. - this.getSpellAbility().addEffect(new NameACardEffect(NameACardEffect.TypeOfName.NOT_BASIC_LAND_NAME)); + this.getSpellAbility().addEffect(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NOT_BASIC_LAND_NAME)); this.getSpellAbility().addEffect(new DesperateResearchEffect()); } @@ -58,7 +58,7 @@ class DesperateResearchEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); + String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); Player player = game.getPlayer(source.getControllerId()); if (player == null || cardName == null) { return false; diff --git a/Mage.Sets/src/mage/cards/d/Dispossess.java b/Mage.Sets/src/mage/cards/d/Dispossess.java index a0d9ef2a647..58569dcca46 100644 --- a/Mage.Sets/src/mage/cards/d/Dispossess.java +++ b/Mage.Sets/src/mage/cards/d/Dispossess.java @@ -3,7 +3,7 @@ package mage.cards.d; import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.abilities.effects.common.search.SearchTargetGraveyardHandLibraryForCardNameAndExileEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -21,7 +21,7 @@ public final class Dispossess extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}"); // Name an artifact card. Search target player's graveyard, hand, and library for any number of cards with that name and exile them. Then that player shuffles their library. - this.getSpellAbility().addEffect((new NameACardEffect(NameACardEffect.TypeOfName.ARTIFACT_NAME))); + this.getSpellAbility().addEffect((new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ARTIFACT_NAME))); this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addEffect(new DispossessEffect()); } @@ -48,7 +48,7 @@ class DispossessEffect extends SearchTargetGraveyardHandLibraryForCardNameAndExi @Override public boolean apply(Game game, Ability source) { - String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); + String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); return super.applySearchAndExile(game, source, cardName, targetPointer.getFirst(game, source)); } diff --git a/Mage.Sets/src/mage/cards/f/FailureComply.java b/Mage.Sets/src/mage/cards/f/FailureComply.java index 9dfb6e7238f..1dc66399d62 100644 --- a/Mage.Sets/src/mage/cards/f/FailureComply.java +++ b/Mage.Sets/src/mage/cards/f/FailureComply.java @@ -6,7 +6,7 @@ import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; import mage.abilities.effects.Effect; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.abilities.keyword.AftermathAbility; import mage.cards.CardImpl; @@ -38,7 +38,7 @@ public final class FailureComply extends SplitCard { // Comply // Choose a card name. Until your next turn, your opponents can't cast spells with the chosen name ((CardImpl) (getRightHalfCard())).addAbility(new AftermathAbility().setRuleAtTheTop(true)); - Effect effect = new NameACardEffect(NameACardEffect.TypeOfName.ALL); + Effect effect = new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL); effect.setText("Choose a card name"); getRightHalfCard().getSpellAbility().addEffect(effect); getRightHalfCard().getSpellAbility().addEffect(new ComplyCantCastEffect()); @@ -74,7 +74,7 @@ class ComplyCantCastEffect extends ContinuousRuleModifyingEffectImpl { public String getInfoMessage(Ability source, GameEvent event, Game game) { MageObject mageObject = game.getObject(source.getSourceId()); if (mageObject != null) { - String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); + String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); return "You may not cast a card named " + cardName + " (" + mageObject.getIdName() + ")."; } return null; @@ -87,7 +87,7 @@ class ComplyCantCastEffect extends ContinuousRuleModifyingEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); + String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { MageObject object = game.getObject(event.getSourceId()); if (object != null && object.getName().equals(cardName)) { diff --git a/Mage.Sets/src/mage/cards/f/Foreshadow.java b/Mage.Sets/src/mage/cards/f/Foreshadow.java index bdb5322e25e..6299ff05b75 100644 --- a/Mage.Sets/src/mage/cards/f/Foreshadow.java +++ b/Mage.Sets/src/mage/cards/f/Foreshadow.java @@ -7,7 +7,7 @@ import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbili import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -28,7 +28,7 @@ public final class Foreshadow extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{U}"); // Choose a card name, then target opponent puts the top card of their library into their graveyard. If that card has the chosen name, you draw a card. - this.getSpellAbility().addEffect(new NameACardEffect(NameACardEffect.TypeOfName.ALL)); + this.getSpellAbility().addEffect(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL)); this.getSpellAbility().addEffect(new ForeshadowEffect()); this.getSpellAbility().addTarget(new TargetOpponent()); @@ -67,7 +67,7 @@ class ForeshadowEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Player targetPlayer = game.getPlayer(source.getFirstTarget()); - String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); + String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); if (controller != null && targetPlayer != null && cardName != null && !cardName.isEmpty()) { Card card = targetPlayer.getLibrary().getFromTop(game); if (card != null) { diff --git a/Mage.Sets/src/mage/cards/g/GideonsIntervention.java b/Mage.Sets/src/mage/cards/g/GideonsIntervention.java index cbea3ec00ef..1c6d51538f1 100644 --- a/Mage.Sets/src/mage/cards/g/GideonsIntervention.java +++ b/Mage.Sets/src/mage/cards/g/GideonsIntervention.java @@ -9,7 +9,7 @@ import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.PreventionEffectImpl; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -31,7 +31,7 @@ public final class GideonsIntervention extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}"); // As Gideon's Intervention enters the battlefield, choose a card name. - Effect effect = new NameACardEffect(NameACardEffect.TypeOfName.ALL); + Effect effect = new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL); effect.setText("choose a card name"); this.addAbility(new AsEntersBattlefieldAbility(effect)); @@ -72,7 +72,7 @@ class GideonsInterventionCantCastEffect extends ContinuousRuleModifyingEffectImp public String getInfoMessage(Ability source, GameEvent event, Game game) { MageObject mageObject = game.getObject(source.getSourceId()); if (mageObject != null) { - String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); + String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); return "You may not cast a card named " + cardName + " (" + mageObject.getIdName() + ")."; } return null; @@ -85,7 +85,7 @@ class GideonsInterventionCantCastEffect extends ContinuousRuleModifyingEffectImp @Override public boolean applies(GameEvent event, Ability source, Game game) { - String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); + String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { MageObject object = game.getObject(event.getSourceId()); if (object != null && object.getName().equals(cardName)) { @@ -137,7 +137,7 @@ class GideonsInterventionPreventAllDamageEffect extends PreventionEffectImpl { if (object != null && (event.getType() == GameEvent.EventType.DAMAGE_PLAYER || targetPerm != null && (event.getType() == GameEvent.EventType.DAMAGE_CREATURE || event.getType() == GameEvent.EventType.DAMAGE_PLANESWALKER))) { - if (object.getName().equals(game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY)) + if (object.getName().equals(game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY)) && (event.getTargetId().equals(source.getControllerId()) || targetPerm != null && targetPerm.getControllerId().equals(source.getControllerId()))) { return super.applies(event, source, game); diff --git a/Mage.Sets/src/mage/cards/i/IsperiaTheInscrutable.java b/Mage.Sets/src/mage/cards/i/IsperiaTheInscrutable.java index 780652d79af..f1ca2a9a5ba 100644 --- a/Mage.Sets/src/mage/cards/i/IsperiaTheInscrutable.java +++ b/Mage.Sets/src/mage/cards/i/IsperiaTheInscrutable.java @@ -7,7 +7,7 @@ import mage.abilities.Ability; import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.Card; @@ -41,7 +41,7 @@ public final class IsperiaTheInscrutable extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Whenever Isperia the Inscrutable deals combat damage to a player, name a card. That player reveals their hand. If he or she reveals the named card, search your library for a creature card with flying, reveal it, put it into your hand, then shuffle your library. - Effect effect1 = new NameACardEffect(NameACardEffect.TypeOfName.ALL); + Effect effect1 = new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL); Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(effect1, false, true); Effect effect2 = new IsperiaTheInscrutableEffect(); ability.addEffect(effect2); @@ -69,7 +69,7 @@ class IsperiaTheInscrutableEffect extends OneShotEffect { public IsperiaTheInscrutableEffect() { super(Outcome.Neutral); - staticText = "That player reveals their hand. If he or she reveals the named card, search your library for a creature card with flying, reveal it, put it into your hand, then shuffle your library"; + staticText = "That player reveals their hand. If a card with the chosen name is revealed this way, search your library for a creature card with flying, reveal it, put it into your hand, then shuffle your library"; } public IsperiaTheInscrutableEffect(final IsperiaTheInscrutableEffect effect) { @@ -79,7 +79,7 @@ class IsperiaTheInscrutableEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(getTargetPointer().getFirst(game, source)); - Object object = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); + Object object = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); if (player != null && object instanceof String) { player.revealCards(player.getLogName() + " hand", player.getHand(), game, true); String namedCard = (String) object; diff --git a/Mage.Sets/src/mage/cards/l/LammastideWeave.java b/Mage.Sets/src/mage/cards/l/LammastideWeave.java index 1ba1a2ef624..a67cac45851 100644 --- a/Mage.Sets/src/mage/cards/l/LammastideWeave.java +++ b/Mage.Sets/src/mage/cards/l/LammastideWeave.java @@ -1,11 +1,10 @@ - package mage.cards.l; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -26,7 +25,7 @@ public final class LammastideWeave extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}"); // Name a card, then target player puts the top card of their library into their graveyard. If that card is the named card, you gain life equal to its converted mana cost. - this.getSpellAbility().addEffect(new NameACardEffect(NameACardEffect.TypeOfName.ALL)); + this.getSpellAbility().addEffect(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL)); this.getSpellAbility().addEffect(new LammastideWeaveEffect()); this.getSpellAbility().addTarget(new TargetPlayer()); @@ -50,7 +49,7 @@ class LammastideWeaveEffect extends OneShotEffect { public LammastideWeaveEffect() { super(Outcome.DrawCard); this.staticText = ", then target player puts the top card of their library into their graveyard. " - + "If that card is the named card, you gain life equal to its converted mana cost."; + + "If that card has the chosen name, you gain life equal to its converted mana cost."; } public LammastideWeaveEffect(final LammastideWeaveEffect effect) { @@ -66,7 +65,7 @@ class LammastideWeaveEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Player targetPlayer = game.getPlayer(source.getFirstTarget()); - String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); + String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); if (controller != null && targetPlayer != null && cardName != null && !cardName.isEmpty()) { Card card = targetPlayer.getLibrary().getFromTop(game); if (card != null) { diff --git a/Mage.Sets/src/mage/cards/l/LostLegacy.java b/Mage.Sets/src/mage/cards/l/LostLegacy.java index 6cb6d652549..a2eec689c1d 100644 --- a/Mage.Sets/src/mage/cards/l/LostLegacy.java +++ b/Mage.Sets/src/mage/cards/l/LostLegacy.java @@ -4,7 +4,7 @@ package mage.cards.l; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.Mode; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.abilities.effects.common.search.SearchTargetGraveyardHandLibraryForCardNameAndExileEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -25,7 +25,7 @@ public final class LostLegacy extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{B}{B}"); // Name a nonartifact, nonland card. Search target player's graveyard, hand and library for any number of cards with that name and exile them. That player shuffles their library, then draws a card for each card exiled from hand this way. - this.getSpellAbility().addEffect((new NameACardEffect(NameACardEffect.TypeOfName.NON_ARTIFACT_AND_NON_LAND_NAME))); + this.getSpellAbility().addEffect((new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NON_ARTIFACT_AND_NON_LAND_NAME))); this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addEffect(new LostLegacyEffect()); } @@ -52,7 +52,7 @@ class LostLegacyEffect extends SearchTargetGraveyardHandLibraryForCardNameAndExi @Override public boolean apply(Game game, Ability source) { - String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); + String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); if (targetPlayer != null && cardName != null && !cardName.isEmpty()) { FilterCard filter = new FilterCard(); diff --git a/Mage.Sets/src/mage/cards/m/MagusOfTheScroll.java b/Mage.Sets/src/mage/cards/m/MagusOfTheScroll.java index e5e17cad40d..cc23294d283 100644 --- a/Mage.Sets/src/mage/cards/m/MagusOfTheScroll.java +++ b/Mage.Sets/src/mage/cards/m/MagusOfTheScroll.java @@ -9,7 +9,7 @@ import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -38,7 +38,7 @@ public final class MagusOfTheScroll extends CardImpl { this.toughness = new MageInt(1); // {3}, {tap}: Name a card. Reveal a card at random from your hand. If it's the named card, Magus of the Scroll deals 2 damage to any target. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new NameACardEffect(NameACardEffect.TypeOfName.ALL), new ManaCostsImpl("{3}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL), new ManaCostsImpl("{3}")); ability.addEffect(new MagusOfTheScrollEffect()); ability.addCost(new TapSourceCost()); ability.addTarget(new TargetAnyTarget()); @@ -59,7 +59,7 @@ class MagusOfTheScrollEffect extends OneShotEffect { public MagusOfTheScrollEffect() { super(Outcome.Neutral); - staticText = ", then reveal a card at random from your hand. If it's the named card, {this} deals 2 damage to any target"; + staticText = ", then reveal a card at random from your hand. If that card has the chosen name, {this} deals 2 damage to any target"; } public MagusOfTheScrollEffect(final MagusOfTheScrollEffect effect) { @@ -70,7 +70,7 @@ class MagusOfTheScrollEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player you = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); - String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); + String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); if (sourceObject != null && you != null && cardName != null && !cardName.isEmpty()) { if (!you.getHand().isEmpty()) { Cards revealed = new CardsImpl(); diff --git a/Mage.Sets/src/mage/cards/m/MeddlingMage.java b/Mage.Sets/src/mage/cards/m/MeddlingMage.java index b7b7105730b..1b24760e5f6 100644 --- a/Mage.Sets/src/mage/cards/m/MeddlingMage.java +++ b/Mage.Sets/src/mage/cards/m/MeddlingMage.java @@ -1,4 +1,3 @@ - package mage.cards.m; import java.util.UUID; @@ -8,7 +7,7 @@ import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -27,7 +26,7 @@ import mage.game.events.GameEvent.EventType; public final class MeddlingMage extends CardImpl { public MeddlingMage(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}{U}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.WIZARD); @@ -35,7 +34,7 @@ public final class MeddlingMage extends CardImpl { this.toughness = new MageInt(2); // As Meddling Mage enters the battlefield, name a nonland card. - this.addAbility(new AsEntersBattlefieldAbility(new NameACardEffect(NameACardEffect.TypeOfName.NON_LAND_NAME))); + this.addAbility(new AsEntersBattlefieldAbility(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NON_LAND_NAME))); //The named card can't be cast. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MeddlingMageReplacementEffect())); @@ -55,7 +54,7 @@ class MeddlingMageReplacementEffect extends ContinuousRuleModifyingEffectImpl { public MeddlingMageReplacementEffect() { super(Duration.WhileOnBattlefield, Outcome.Detriment); - staticText = "The named card can't be cast"; + staticText = "Spells with the chosen name can’t be cast"; } public MeddlingMageReplacementEffect(final MeddlingMageReplacementEffect effect) { @@ -76,7 +75,7 @@ class MeddlingMageReplacementEffect extends ContinuousRuleModifyingEffectImpl { public String getInfoMessage(Ability source, GameEvent event, Game game) { MageObject mageObject = game.getObject(source.getSourceId()); if (mageObject != null) { - return "You can't cast a card with that name (" + mageObject.getLogName() + " in play)."; + return "You can't cast a spell with that name (" + mageObject.getLogName() + " in play)."; } return null; } @@ -90,7 +89,7 @@ class MeddlingMageReplacementEffect extends ContinuousRuleModifyingEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { MageObject object = game.getObject(event.getSourceId()); // fixes issue #1072 - return object != null && !object.isCopy() && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY)); + return object != null && !object.isCopy() && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY)); } } diff --git a/Mage.Sets/src/mage/cards/m/Memoricide.java b/Mage.Sets/src/mage/cards/m/Memoricide.java index fc4d0e8e40c..32d0e15f4a6 100644 --- a/Mage.Sets/src/mage/cards/m/Memoricide.java +++ b/Mage.Sets/src/mage/cards/m/Memoricide.java @@ -1,10 +1,9 @@ - package mage.cards.m; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.Mode; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.abilities.effects.common.search.SearchTargetGraveyardHandLibraryForCardNameAndExileEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -19,11 +18,11 @@ import mage.target.TargetPlayer; public final class Memoricide extends CardImpl { public Memoricide(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{3}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{B}"); // Name a nonland card. Search target player's graveyard, hand, and library for any number of cards with // that name and exile them. Then that player shuffles their library - this.getSpellAbility().addEffect((new NameACardEffect(NameACardEffect.TypeOfName.NON_LAND_NAME))); + this.getSpellAbility().addEffect((new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NON_LAND_NAME))); this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addEffect(new MemoricideEffect()); } @@ -51,7 +50,7 @@ class MemoricideEffect extends SearchTargetGraveyardHandLibraryForCardNameAndExi @Override public boolean apply(Game game, Ability source) { - String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); + String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); return super.applySearchAndExile(game, source, cardName, targetPointer.getFirst(game, source)); } @@ -62,6 +61,6 @@ class MemoricideEffect extends SearchTargetGraveyardHandLibraryForCardNameAndExi @Override public String getText(Mode mode) { - return "Name a nonland card. " + super.getText(mode); + return "Search target player’s graveyard, hand, and library for any number of cards with that name and exile them. Then that player shuffles their library"; } } diff --git a/Mage.Sets/src/mage/cards/n/Nebuchadnezzar.java b/Mage.Sets/src/mage/cards/n/Nebuchadnezzar.java index 9973b8d6fd5..6a9271a242a 100644 --- a/Mage.Sets/src/mage/cards/n/Nebuchadnezzar.java +++ b/Mage.Sets/src/mage/cards/n/Nebuchadnezzar.java @@ -1,4 +1,3 @@ - package mage.cards.n; import java.util.UUID; @@ -6,16 +5,14 @@ import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.common.ActivateIfConditionActivatedAbility; -import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.MyTurnCondition; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.cards.*; import mage.constants.CardType; import mage.constants.SubType; -import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.SuperType; import mage.constants.Zone; @@ -38,7 +35,7 @@ public final class Nebuchadnezzar extends CardImpl { this.toughness = new MageInt(3); // {X}, {T}: Choose a card name. Target opponent reveals X cards at random from their hand. Then that player discards all cards with that name revealed this way. Activate this ability only during your turn. - Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new NameACardEffect(NameACardEffect.TypeOfName.ALL), new ManaCostsImpl("{X}"), MyTurnCondition.instance); + Ability ability = new ActivateIfConditionActivatedAbility(Zone.BATTLEFIELD, new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL), new ManaCostsImpl("{X}"), MyTurnCondition.instance); ability.addCost(new TapSourceCost()); ability.addEffect(new NebuchadnezzarEffect()); ability.addTarget(new TargetOpponent()); @@ -70,7 +67,7 @@ class NebuchadnezzarEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player opponent = game.getPlayer(targetPointer.getFirst(game, source)); MageObject sourceObject = game.getObject(source.getSourceId()); - String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); + String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); if (opponent != null && sourceObject != null && !cardName.isEmpty()) { int costX = source.getManaCostsToPay().getX(); if (costX > 0 && !opponent.getHand().isEmpty()) { diff --git a/Mage.Sets/src/mage/cards/n/Nevermore.java b/Mage.Sets/src/mage/cards/n/Nevermore.java index 1fbd5332fcd..54f963753a6 100644 --- a/Mage.Sets/src/mage/cards/n/Nevermore.java +++ b/Mage.Sets/src/mage/cards/n/Nevermore.java @@ -1,4 +1,3 @@ - package mage.cards.n; import java.util.UUID; @@ -7,7 +6,7 @@ import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -25,10 +24,10 @@ import mage.game.events.GameEvent.EventType; public final class Nevermore extends CardImpl { public Nevermore(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{W}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}{W}"); // As Nevermore enters the battlefield, name a nonland card. - this.addAbility(new AsEntersBattlefieldAbility(new NameACardEffect(NameACardEffect.TypeOfName.NON_LAND_NAME))); + this.addAbility(new AsEntersBattlefieldAbility(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NON_LAND_NAME))); // The named card can't be cast. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new NevermoreEffect2())); @@ -50,7 +49,7 @@ class NevermoreEffect2 extends ContinuousRuleModifyingEffectImpl { public NevermoreEffect2() { super(Duration.WhileOnBattlefield, Outcome.Detriment); - staticText = "The named card can't be cast"; + staticText = "Spells with the chosen name can’t be cast"; } public NevermoreEffect2(final NevermoreEffect2 effect) { @@ -71,7 +70,7 @@ class NevermoreEffect2 extends ContinuousRuleModifyingEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (event.getType() == EventType.CAST_SPELL) { MageObject object = game.getObject(event.getSourceId()); - if (object != null && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY))) { + if (object != null && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY))) { return true; } } diff --git a/Mage.Sets/src/mage/cards/p/PhyrexianRevoker.java b/Mage.Sets/src/mage/cards/p/PhyrexianRevoker.java index 592fc1b0913..a0880af364a 100644 --- a/Mage.Sets/src/mage/cards/p/PhyrexianRevoker.java +++ b/Mage.Sets/src/mage/cards/p/PhyrexianRevoker.java @@ -8,7 +8,7 @@ import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -33,7 +33,7 @@ public final class PhyrexianRevoker extends CardImpl { this.toughness = new MageInt(1); // As Phyrexian Revoker enters the battlefield, name a nonland card. - this.addAbility(new AsEntersBattlefieldAbility(new NameACardEffect(NameACardEffect.TypeOfName.NON_LAND_NAME))); + this.addAbility(new AsEntersBattlefieldAbility(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NON_LAND_NAME))); // Activated abilities of sources with the chosen name can't be activated. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PhyrexianRevokerEffect2())); @@ -84,7 +84,7 @@ class PhyrexianRevokerEffect2 extends ContinuousRuleModifyingEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { if (event.getType() == EventType.ACTIVATE_ABILITY) { MageObject object = game.getObject(event.getSourceId()); - if (object != null && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY))) { + if (object != null && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY))) { return true; } } diff --git a/Mage.Sets/src/mage/cards/p/PithingNeedle.java b/Mage.Sets/src/mage/cards/p/PithingNeedle.java index e9b4196bb12..402cfba00d8 100644 --- a/Mage.Sets/src/mage/cards/p/PithingNeedle.java +++ b/Mage.Sets/src/mage/cards/p/PithingNeedle.java @@ -8,7 +8,7 @@ import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; @@ -25,7 +25,7 @@ public final class PithingNeedle extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}"); // As Pithing Needle enters the battlefield, name a card. - this.addAbility(new AsEntersBattlefieldAbility(new NameACardEffect(NameACardEffect.TypeOfName.ALL))); + this.addAbility(new AsEntersBattlefieldAbility(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL))); // Activated abilities of sources with the chosen name can't be activated unless they're mana abilities. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PithingNeedleEffect())); @@ -74,7 +74,7 @@ class PithingNeedleEffect extends ContinuousRuleModifyingEffectImpl { if (ability.isPresent() && object != null) { if (game.getState().getPlayersInRange(source.getControllerId(), game).contains(event.getPlayerId()) // controller in range && ability.get().getAbilityType() != AbilityType.MANA - && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY))) { + && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY))) { return true; } } diff --git a/Mage.Sets/src/mage/cards/p/Predict.java b/Mage.Sets/src/mage/cards/p/Predict.java index e29d6935864..193ae9b8c0f 100644 --- a/Mage.Sets/src/mage/cards/p/Predict.java +++ b/Mage.Sets/src/mage/cards/p/Predict.java @@ -1,10 +1,9 @@ - package mage.cards.p; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -22,11 +21,10 @@ import mage.target.TargetPlayer; public final class Predict extends CardImpl { public Predict(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{1}{U}"); - + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}"); // Name a card, then target player puts the top card of their library into their graveyard. If that card is the named card, you draw two cards. Otherwise, you draw a card. - this.getSpellAbility().addEffect(new NameACardEffect(NameACardEffect.TypeOfName.ALL)); + this.getSpellAbility().addEffect(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL)); this.getSpellAbility().addEffect(new PredictEffect()); this.getSpellAbility().addTarget(new TargetPlayer()); } @@ -46,9 +44,9 @@ class PredictEffect extends OneShotEffect { public PredictEffect() { super(Outcome.DrawCard); this.staticText = ", then target player puts the top card of their library into their graveyard. " - + "If that card is the named card, you draw two cards. Otherwise, you draw a card."; + + "If that card has the chosen name, you draw two cards. Otherwise, you draw a card."; } - + public PredictEffect(final PredictEffect effect) { super(effect); } @@ -57,25 +55,25 @@ class PredictEffect extends OneShotEffect { public PredictEffect copy() { return new PredictEffect(this); } - + @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Player targetPlayer = game.getPlayer(source.getFirstTarget()); - String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); - if (controller != null && targetPlayer != null && cardName != null && !cardName.isEmpty()) { - int amount = 1; + String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); + if (controller != null && targetPlayer != null && cardName != null && !cardName.isEmpty()) { + int amount = 1; Card card = targetPlayer.getLibrary().getFromTop(game); if (card != null) { controller.moveCards(card, Zone.GRAVEYARD, source, game); if (card.getName().equals(cardName)) { amount = 2; } - } - controller.drawCards(amount, game); + } + controller.drawCards(amount, game); return true; } return false; } - + } diff --git a/Mage.Sets/src/mage/cards/r/RunedHalo.java b/Mage.Sets/src/mage/cards/r/RunedHalo.java index 49b871326e4..3800320f377 100644 --- a/Mage.Sets/src/mage/cards/r/RunedHalo.java +++ b/Mage.Sets/src/mage/cards/r/RunedHalo.java @@ -6,7 +6,7 @@ import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.abilities.effects.common.continuous.GainAbilityControllerEffect; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; @@ -37,7 +37,7 @@ public final class RunedHalo extends CardImpl { // As Runed Halo enters the battlefield, name a card. - Ability ability = new AsEntersBattlefieldAbility(new NameACardEffect(NameACardEffect.TypeOfName.ALL)); + Ability ability = new AsEntersBattlefieldAbility(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL)); // You have protection from the chosen name. ability.addEffect(new RunedHaloSetProtectionEffect()); this.addAbility(ability); @@ -67,7 +67,7 @@ class RunedHaloSetProtectionEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); + String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); if (controller != null && cardName != null && !cardName.isEmpty()) { FilterObject filter = new FilterObject("the name [" + cardName + ']'); filter.add(new NamePredicate(cardName)); diff --git a/Mage.Sets/src/mage/cards/s/SlaughterGames.java b/Mage.Sets/src/mage/cards/s/SlaughterGames.java index bfd58589489..4201ffe68b9 100644 --- a/Mage.Sets/src/mage/cards/s/SlaughterGames.java +++ b/Mage.Sets/src/mage/cards/s/SlaughterGames.java @@ -6,7 +6,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.Effect; import mage.abilities.effects.common.CantBeCounteredSourceEffect; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.abilities.effects.common.search.SearchTargetGraveyardHandLibraryForCardNameAndExileEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -32,7 +32,7 @@ public final class SlaughterGames extends CardImpl { this.addAbility(ability); // Name a nonland card. Search target opponent's graveyard, hand, and library for any number of cards with that name and exile them. Then that player shuffles their library. - this.getSpellAbility().addEffect(new NameACardEffect(NameACardEffect.TypeOfName.NON_LAND_NAME)); + this.getSpellAbility().addEffect(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NON_LAND_NAME)); this.getSpellAbility().addEffect(new SlaughterGamesEffect()); this.getSpellAbility().addTarget(new TargetOpponent()); } @@ -59,7 +59,7 @@ class SlaughterGamesEffect extends SearchTargetGraveyardHandLibraryForCardNameAn @Override public boolean apply(Game game, Ability source) { - String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); + String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); return super.applySearchAndExile(game, source, cardName, targetPointer.getFirst(game, source)); } diff --git a/Mage.Sets/src/mage/cards/s/SorcerousSpyglass.java b/Mage.Sets/src/mage/cards/s/SorcerousSpyglass.java index 01df8ffbb3c..1e1735f9a22 100644 --- a/Mage.Sets/src/mage/cards/s/SorcerousSpyglass.java +++ b/Mage.Sets/src/mage/cards/s/SorcerousSpyglass.java @@ -8,7 +8,7 @@ import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.AbilityType; @@ -47,10 +47,10 @@ public final class SorcerousSpyglass extends CardImpl { } } -class SorcerousSpyglassEntersEffect extends NameACardEffect { +class SorcerousSpyglassEntersEffect extends ChooseACardNameEffect { SorcerousSpyglassEntersEffect() { - super(NameACardEffect.TypeOfName.ALL); + super(ChooseACardNameEffect.TypeOfName.ALL); staticText = "look at an opponent's hand, then choose any card name"; } @@ -114,7 +114,7 @@ class SorcerousSpyglassActivationEffect extends ContinuousRuleModifyingEffectImp if (ability.isPresent() && object != null) { if (game.getState().getPlayersInRange(source.getControllerId(), game).contains(event.getPlayerId()) // controller in range && ability.get().getAbilityType() != AbilityType.MANA - && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY))) { + && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY))) { return true; } } diff --git a/Mage.Sets/src/mage/cards/s/SpoilsOfTheVault.java b/Mage.Sets/src/mage/cards/s/SpoilsOfTheVault.java index d1a377ab461..622bf0c7f37 100644 --- a/Mage.Sets/src/mage/cards/s/SpoilsOfTheVault.java +++ b/Mage.Sets/src/mage/cards/s/SpoilsOfTheVault.java @@ -1,11 +1,10 @@ - package mage.cards.s; import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -27,7 +26,7 @@ public final class SpoilsOfTheVault extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}"); // Name a card. Reveal cards from the top of your library until you reveal the named card, then put that card into your hand. Exile all other cards revealed this way, and you lose 1 life for each of the exiled cards. - this.getSpellAbility().addEffect(new NameACardEffect(NameACardEffect.TypeOfName.ALL)); + this.getSpellAbility().addEffect(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL)); this.getSpellAbility().addEffect(new SpoilsOfTheVaultEffect()); } @@ -45,7 +44,8 @@ class SpoilsOfTheVaultEffect extends OneShotEffect { public SpoilsOfTheVaultEffect() { super(Outcome.Damage); - this.staticText = "Reveal cards from the top of your library until you reveal the named card, then put that card into your hand. Exile all other cards revealed this way, and you lose 1 life for each of the exiled cards"; + this.staticText = "Reveal cards from the top of your library until you reveal a card with that name, " + + "then put that card into your hand. Exile all other cards revealed this way, and you lose 1 life for each of the exiled cards"; } public SpoilsOfTheVaultEffect(final SpoilsOfTheVaultEffect effect) { @@ -61,7 +61,7 @@ class SpoilsOfTheVaultEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { MageObject sourceObject = game.getObject(source.getSourceId()); Player controller = game.getPlayer(source.getControllerId()); - String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); + String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); if (sourceObject == null || controller == null || cardName == null || cardName.isEmpty()) { return false; } diff --git a/Mage.Sets/src/mage/cards/s/StainTheMind.java b/Mage.Sets/src/mage/cards/s/StainTheMind.java index 7ba35dcfbb2..509edcca9b1 100644 --- a/Mage.Sets/src/mage/cards/s/StainTheMind.java +++ b/Mage.Sets/src/mage/cards/s/StainTheMind.java @@ -3,7 +3,7 @@ package mage.cards.s; import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.abilities.effects.common.search.SearchTargetGraveyardHandLibraryForCardNameAndExileEffect; import mage.abilities.keyword.ConvokeAbility; import mage.cards.CardImpl; @@ -24,7 +24,7 @@ public final class StainTheMind extends CardImpl { // Convoke this.addAbility(new ConvokeAbility()); // Name a nonland card. Search target player's graveyard, hand, and library for any number of card's with that name and exile them. Then that player shuffles their library. - this.getSpellAbility().addEffect((new NameACardEffect(NameACardEffect.TypeOfName.NON_LAND_NAME))); + this.getSpellAbility().addEffect((new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NON_LAND_NAME))); this.getSpellAbility().addEffect(new StainTheMindEffect()); this.getSpellAbility().addTarget(new TargetPlayer()); } @@ -51,7 +51,7 @@ class StainTheMindEffect extends SearchTargetGraveyardHandLibraryForCardNameAndE @Override public boolean apply(Game game, Ability source) { - String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); + String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); return super.applySearchAndExile(game, source, cardName, targetPointer.getFirst(game, source)); } diff --git a/Mage.Sets/src/mage/cards/t/ThoughtHemorrhage.java b/Mage.Sets/src/mage/cards/t/ThoughtHemorrhage.java index 3b51695df99..690de157f5d 100644 --- a/Mage.Sets/src/mage/cards/t/ThoughtHemorrhage.java +++ b/Mage.Sets/src/mage/cards/t/ThoughtHemorrhage.java @@ -1,4 +1,3 @@ - package mage.cards.t; import java.util.LinkedHashSet; @@ -8,7 +7,7 @@ import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -34,7 +33,7 @@ public final class ThoughtHemorrhage extends CardImpl { // Name a nonland card. Target player reveals their hand. Thought Hemorrhage deals 3 damage to that player for each card with that name revealed this way. Search that player's graveyard, hand, and library for all cards with that name and exile them. Then that player shuffles their library. this.getSpellAbility().addTarget(new TargetPlayer()); - this.getSpellAbility().addEffect(new NameACardEffect(NameACardEffect.TypeOfName.NON_LAND_NAME)); + this.getSpellAbility().addEffect(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NON_LAND_NAME)); this.getSpellAbility().addEffect(new ThoughtHemorrhageEffect()); } @@ -50,7 +49,10 @@ public final class ThoughtHemorrhage extends CardImpl { class ThoughtHemorrhageEffect extends OneShotEffect { - static final String rule = "Target player reveals their hand. {this} deals 3 damage to that player for each card with that name revealed this way. Search that player's graveyard, hand, and library for all cards with that name and exile them. Then that player shuffles their library"; + static final String rule = "Target player reveals their hand. " + + "{this} deals 3 damage to that player for each card with the chosen name revealed this way. " + + "Search that player’s graveyard, hand, and library for all cards with that name and exile them. " + + "Then that player shuffles their library"; public ThoughtHemorrhageEffect() { super(Outcome.Exile); @@ -65,7 +67,7 @@ class ThoughtHemorrhageEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); - String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); + String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); if (sourceObject != null && controller != null && cardName != null && !cardName.isEmpty()) { Player targetPlayer = game.getPlayer(source.getFirstTarget()); if (targetPlayer != null) { diff --git a/Mage.Sets/src/mage/cards/t/TunnelVision.java b/Mage.Sets/src/mage/cards/t/TunnelVision.java index b3433ed45ea..e7b2e0d9bc2 100644 --- a/Mage.Sets/src/mage/cards/t/TunnelVision.java +++ b/Mage.Sets/src/mage/cards/t/TunnelVision.java @@ -1,10 +1,9 @@ - package mage.cards.t; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -29,7 +28,7 @@ public final class TunnelVision extends CardImpl { // Name a card. Target player reveals cards from the top of their library until the named card is revealed. // If it is, that player puts the rest of the revealed cards into their graveyard and puts the named card on top of their library. // Otherwise, the player shuffles their library. - this.getSpellAbility().addEffect(new NameACardEffect(NameACardEffect.TypeOfName.ALL)); + this.getSpellAbility().addEffect(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.ALL)); this.getSpellAbility().addEffect(new TunnelVisionEffect()); this.getSpellAbility().addTarget(new TargetPlayer()); } @@ -48,7 +47,11 @@ class TunnelVisionEffect extends OneShotEffect { public TunnelVisionEffect() { super(Outcome.Benefit); - this.staticText = "Target player reveals cards from the top of their library until the named card is revealed. If it is, that player puts the rest of the revealed cards into their graveyard and puts the named card on top of their library. Otherwise, the player shuffles their library."; + this.staticText = "Target player reveals cards from the top of their library " + + "until a card with that name is revealed. If it is, that player puts " + + "the rest of the revealed cards into their graveyard and " + + "puts the card with the chosen name on top of their library. " + + "Otherwise, the player shuffles their library"; } public TunnelVisionEffect(final TunnelVisionEffect effect) { @@ -63,7 +66,7 @@ class TunnelVisionEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); - String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY); + String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); if (targetPlayer == null || cardName == null || cardName.isEmpty()) { return false; } diff --git a/Mage.Sets/src/mage/cards/v/VoidstoneGargoyle.java b/Mage.Sets/src/mage/cards/v/VoidstoneGargoyle.java index a538287e177..9f0109ecf5a 100644 --- a/Mage.Sets/src/mage/cards/v/VoidstoneGargoyle.java +++ b/Mage.Sets/src/mage/cards/v/VoidstoneGargoyle.java @@ -1,4 +1,3 @@ - package mage.cards.v; import java.util.UUID; @@ -8,7 +7,7 @@ import mage.abilities.Ability; import mage.abilities.common.AsEntersBattlefieldAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -28,7 +27,7 @@ import mage.game.events.GameEvent.EventType; public final class VoidstoneGargoyle extends CardImpl { public VoidstoneGargoyle(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); this.subtype.add(SubType.GARGOYLE); this.power = new MageInt(3); @@ -37,7 +36,7 @@ public final class VoidstoneGargoyle extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); // As Voidstone Gargoyle enters the battlefield, name a nonland card. - this.addAbility(new AsEntersBattlefieldAbility(new NameACardEffect(NameACardEffect.TypeOfName.NON_LAND_NAME))); + this.addAbility(new AsEntersBattlefieldAbility(new ChooseACardNameEffect(ChooseACardNameEffect.TypeOfName.NON_LAND_NAME))); // The named card can't be cast. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new VoidstoneGargoyleReplacementEffect1())); // Activated abilities of sources with the chosen name can't be activated. @@ -58,7 +57,7 @@ class VoidstoneGargoyleReplacementEffect1 extends ContinuousRuleModifyingEffectI public VoidstoneGargoyleReplacementEffect1() { super(Duration.WhileOnBattlefield, Outcome.Detriment); - staticText = "The named card can't be cast"; + staticText = "Spells with the chosen name can’t be cast"; } public VoidstoneGargoyleReplacementEffect1(final VoidstoneGargoyleReplacementEffect1 effect) { @@ -79,7 +78,7 @@ class VoidstoneGargoyleReplacementEffect1 extends ContinuousRuleModifyingEffectI public String getInfoMessage(Ability source, GameEvent event, Game game) { MageObject mageObject = game.getObject(source.getSourceId()); if (mageObject != null) { - return "You can't cast a card with that name (" + mageObject.getIdName() + ")."; + return "You can't cast a spell with that name (" + mageObject.getIdName() + ")."; } return null; } @@ -89,7 +88,7 @@ class VoidstoneGargoyleReplacementEffect1 extends ContinuousRuleModifyingEffectI if (event.getType() == GameEvent.EventType.CAST_SPELL) { MageObject object = game.getObject(event.getSourceId()); if (object != null - && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY))) { + && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY))) { return true; } } @@ -132,7 +131,7 @@ class VoidstoneGargoyleRuleModifyingEffect2 extends ContinuousRuleModifyingEffec public boolean applies(GameEvent event, Ability source, Game game) { if (event.getType() == EventType.ACTIVATE_ABILITY) { MageObject object = game.getObject(event.getSourceId()); - if (object != null && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY))) { + if (object != null && object.getName().equals(game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY))) { return true; } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/NameACardEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ChooseACardNameEffect.java similarity index 94% rename from Mage/src/main/java/mage/abilities/effects/common/NameACardEffect.java rename to Mage/src/main/java/mage/abilities/effects/common/ChooseACardNameEffect.java index d639da80a74..f0439a01cf9 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/NameACardEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ChooseACardNameEffect.java @@ -16,7 +16,7 @@ import mage.util.CardUtil; * * @author LevelX2 */ -public class NameACardEffect extends OneShotEffect { +public class ChooseACardNameEffect extends OneShotEffect { public static String INFO_KEY = "NAMED_CARD"; @@ -33,13 +33,13 @@ public class NameACardEffect extends OneShotEffect { private final TypeOfName typeOfName; - public NameACardEffect(TypeOfName typeOfName) { + public ChooseACardNameEffect(TypeOfName typeOfName) { super(Outcome.Detriment); this.typeOfName = typeOfName; staticText = setText(); } - public NameACardEffect(final NameACardEffect effect) { + public ChooseACardNameEffect(final ChooseACardNameEffect effect) { super(effect); this.typeOfName = effect.typeOfName; } @@ -100,8 +100,8 @@ public class NameACardEffect extends OneShotEffect { } @Override - public NameACardEffect copy() { - return new NameACardEffect(this); + public ChooseACardNameEffect copy() { + return new ChooseACardNameEffect(this); } private String setText() { diff --git a/Mage/src/main/java/mage/cards/CardImpl.java b/Mage/src/main/java/mage/cards/CardImpl.java index 8b6e87a77d2..d9283e95d79 100644 --- a/Mage/src/main/java/mage/cards/CardImpl.java +++ b/Mage/src/main/java/mage/cards/CardImpl.java @@ -12,7 +12,7 @@ import mage.abilities.*; import mage.abilities.costs.Cost; import mage.abilities.costs.VariableCost; import mage.abilities.costs.common.RemoveVariableCountersTargetCost; -import mage.abilities.effects.common.NameACardEffect; +import mage.abilities.effects.common.ChooseACardNameEffect; import mage.abilities.mana.ActivatedManaAbilityImpl; import mage.cards.repository.PluginClassloaderRegistery; import mage.constants.*; @@ -401,7 +401,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card { case CHOSEN_NAME: //Declaration of Naught only ability.getTargets().clear(); FilterSpell filterSpell = new FilterSpell("spell with the chosen name"); - filterSpell.add(new NamePredicate((String) game.getState().getValue(ability.getSourceId().toString() + NameACardEffect.INFO_KEY))); + filterSpell.add(new NamePredicate((String) game.getState().getValue(ability.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY))); TargetSpell target = new TargetSpell(1, filterSpell); ability.addTarget(target); break;