diff --git a/Mage.Sets/src/mage/cards/b/BaralChiefOfCompliance.java b/Mage.Sets/src/mage/cards/b/BaralChiefOfCompliance.java index f22bd18f2f..6a6bc26cd0 100644 --- a/Mage.Sets/src/mage/cards/b/BaralChiefOfCompliance.java +++ b/Mage.Sets/src/mage/cards/b/BaralChiefOfCompliance.java @@ -18,7 +18,6 @@ import mage.filter.predicate.Predicates; import java.util.UUID; /** - * * @author fireshoes */ public final class BaralChiefOfCompliance extends CardImpl { @@ -35,7 +34,7 @@ public final class BaralChiefOfCompliance extends CardImpl { public BaralChiefOfCompliance(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}"); - addSuperType(SuperType.LEGENDARY); + addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.HUMAN, SubType.WIZARD); this.power = new MageInt(1); this.toughness = new MageInt(3); @@ -44,7 +43,7 @@ public final class BaralChiefOfCompliance extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostReductionControllerEffect(filter, 1))); // Whenever a spell or ability you control counters a spell, you may draw a card. If you do, discard a card. - this.addAbility(new SpellCounteredControllerTriggeredAbility(new DrawDiscardControllerEffect(), true)); + this.addAbility(new SpellCounteredControllerTriggeredAbility(new DrawDiscardControllerEffect(true))); } private BaralChiefOfCompliance(final BaralChiefOfCompliance card) { diff --git a/Mage.Sets/src/mage/cards/i/InspiredSprite.java b/Mage.Sets/src/mage/cards/i/InspiredSprite.java index be6fdb24fa..1363a2fd65 100644 --- a/Mage.Sets/src/mage/cards/i/InspiredSprite.java +++ b/Mage.Sets/src/mage/cards/i/InspiredSprite.java @@ -23,7 +23,7 @@ import mage.filter.FilterSpell; */ public final class InspiredSprite extends CardImpl { - private static final FilterSpell filter = new FilterSpell("Wizard"); + private static final FilterSpell filter = new FilterSpell("a Wizard spell"); static { filter.add(SubType.WIZARD.getPredicate()); diff --git a/Mage.Sets/src/mage/cards/l/LamplighterOfSelhoff.java b/Mage.Sets/src/mage/cards/l/LamplighterOfSelhoff.java index a354078460..b19c75453f 100644 --- a/Mage.Sets/src/mage/cards/l/LamplighterOfSelhoff.java +++ b/Mage.Sets/src/mage/cards/l/LamplighterOfSelhoff.java @@ -41,7 +41,7 @@ public final class LamplighterOfSelhoff extends CardImpl { this.addAbility(new ConditionalInterveningIfTriggeredAbility( triggeredAbility, new PermanentsOnTheBattlefieldCondition(filter), - "When {this} enters the battlefield, if you control another Zombie, you may a draw card. If you do, discard a card.")); + "When {this} enters the battlefield, if you control another Zombie, you may draw a card. If you do, discard a card.")); } private LamplighterOfSelhoff(final LamplighterOfSelhoff card) { diff --git a/Mage.Sets/src/mage/cards/m/MaraudingLooter.java b/Mage.Sets/src/mage/cards/m/MaraudingLooter.java index 945b6d21e5..18878bafd2 100644 --- a/Mage.Sets/src/mage/cards/m/MaraudingLooter.java +++ b/Mage.Sets/src/mage/cards/m/MaraudingLooter.java @@ -34,7 +34,7 @@ public final class MaraudingLooter extends CardImpl { Ability ability = new ConditionalInterveningIfTriggeredAbility( new BeginningOfEndStepTriggeredAbility(new DrawDiscardControllerEffect(1, 1, true), TargetController.YOU, false), RaidCondition.instance, - "Raid — At the beginning of your end step, " + "At the beginning of your end step, " + "if you attacked this turn, " + "you may draw a card. If you do, discard a card."); ability.setAbilityWord(AbilityWord.RAID); diff --git a/Mage.Sets/src/mage/cards/n/NivixGuildmage.java b/Mage.Sets/src/mage/cards/n/NivixGuildmage.java index e04068bd74..6e6c4ad78b 100644 --- a/Mage.Sets/src/mage/cards/n/NivixGuildmage.java +++ b/Mage.Sets/src/mage/cards/n/NivixGuildmage.java @@ -24,7 +24,7 @@ import mage.target.TargetSpell; */ public final class NivixGuildmage extends CardImpl { - private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); + private static final FilterSpell filter = new FilterSpell("instant or sorcery spell you control"); static { filter.add(Predicates.or( diff --git a/Mage.Sets/src/mage/cards/p/Probe.java b/Mage.Sets/src/mage/cards/p/Probe.java index b7c63cd728..a21c1aa04c 100644 --- a/Mage.Sets/src/mage/cards/p/Probe.java +++ b/Mage.Sets/src/mage/cards/p/Probe.java @@ -32,7 +32,7 @@ public final class Probe extends CardImpl { this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new DiscardTargetEffect(2), KickedCondition.instance, - "

If this spell was kicked, target player discards two cards")); + "If this spell was kicked, target player discards two cards")); this.getSpellAbility().setTargetAdjuster(ProbeAdjuster.instance); } diff --git a/Mage.Sets/src/mage/cards/r/Riddlesmith.java b/Mage.Sets/src/mage/cards/r/Riddlesmith.java index 87f35b3b36..e5eb409d95 100644 --- a/Mage.Sets/src/mage/cards/r/Riddlesmith.java +++ b/Mage.Sets/src/mage/cards/r/Riddlesmith.java @@ -1,8 +1,5 @@ - - package mage.cards.r; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.SpellCastControllerTriggeredAbility; import mage.abilities.effects.common.DrawDiscardControllerEffect; @@ -10,15 +7,20 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; +import mage.filter.FilterSpell; import mage.filter.common.FilterArtifactSpell; +import java.util.UUID; + /** - * * @author Loki, North */ public final class Riddlesmith extends CardImpl { - public Riddlesmith (UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}"); + + private static final FilterSpell filter = new FilterArtifactSpell("an artifact spell"); + + public Riddlesmith(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.ARTIFICER); @@ -26,10 +28,12 @@ public final class Riddlesmith extends CardImpl { this.toughness = new MageInt(1); // Whenever you cast an artifact spell, you may draw a card. If you do, discard a card. - this.addAbility(new SpellCastControllerTriggeredAbility(new DrawDiscardControllerEffect(), new FilterArtifactSpell("an artifact spell"), true)); + this.addAbility(new SpellCastControllerTriggeredAbility( + new DrawDiscardControllerEffect(true), filter, false + )); } - public Riddlesmith (final Riddlesmith card) { + public Riddlesmith(final Riddlesmith card) { super(card); } diff --git a/Mage.Sets/src/mage/cards/s/ShipwreckLooter.java b/Mage.Sets/src/mage/cards/s/ShipwreckLooter.java index 7976888aa4..74b45ec082 100644 --- a/Mage.Sets/src/mage/cards/s/ShipwreckLooter.java +++ b/Mage.Sets/src/mage/cards/s/ShipwreckLooter.java @@ -32,8 +32,7 @@ public final class ShipwreckLooter extends CardImpl { // Raid - When Shipwreck Looter enters the battlefield,if you attacked this turn, you may draw a card. If you do, discard a card. Ability ability = new ConditionalInterveningIfTriggeredAbility( new EntersBattlefieldTriggeredAbility(new DrawDiscardControllerEffect(1, 1, true)), - RaidCondition.instance, - "Raid — When {this} enters the battlefield, if you attacked this turn, you may draw a card. If you do, discard a card."); + RaidCondition.instance, "When {this} enters the battlefield, if you attacked this turn, you may draw a card. If you do, discard a card."); ability.setAbilityWord(AbilityWord.RAID); ability.addHint(RaidHint.instance); this.addAbility(ability, new PlayerAttackedWatcher()); diff --git a/Mage.Sets/src/mage/cards/t/TrialOfKnowledge.java b/Mage.Sets/src/mage/cards/t/TrialOfKnowledge.java index ed566e6181..0e5eceeade 100644 --- a/Mage.Sets/src/mage/cards/t/TrialOfKnowledge.java +++ b/Mage.Sets/src/mage/cards/t/TrialOfKnowledge.java @@ -32,7 +32,7 @@ public final class TrialOfKnowledge extends CardImpl { // When a Cartouche enters the battlefield under your control, return Trial of Knowledge to its owner's hand. this.addAbility(new EntersBattlefieldControlledTriggeredAbility(new ReturnToHandSourceEffect(), filter, - "When a Cartouche enters the battlefield under your control, return {this} to its owner's hand")); + "When a Cartouche enters the battlefield under your control, return {this} to its owner's hand.")); } private TrialOfKnowledge(final TrialOfKnowledge card) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/DrawDiscardControllerEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DrawDiscardControllerEffect.java index 280d110768..9f80cb3b89 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DrawDiscardControllerEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DrawDiscardControllerEffect.java @@ -1,7 +1,7 @@ - package mage.abilities.effects.common; import mage.abilities.Ability; +import mage.abilities.Mode; import mage.abilities.effects.OneShotEffect; import mage.constants.Outcome; import mage.game.Game; @@ -9,19 +9,22 @@ import mage.players.Player; import mage.util.CardUtil; /** - * * @author BetaSteward_at_googlemail.com */ public class DrawDiscardControllerEffect extends OneShotEffect { - private int cardsToDraw; - private int cardsToDiscard; - private boolean optional; + private final int cardsToDraw; + private final int cardsToDiscard; + private final boolean optional; public DrawDiscardControllerEffect() { this(1, 1); } + public DrawDiscardControllerEffect(boolean optional) { + this(1, 1, optional); + } + public DrawDiscardControllerEffect(int cardsToDraw, int cardsToDiscard) { this(cardsToDraw, cardsToDiscard, false); } @@ -31,14 +34,6 @@ public class DrawDiscardControllerEffect extends OneShotEffect { this.cardsToDraw = cardsToDraw; this.cardsToDiscard = cardsToDiscard; this.optional = optional; - staticText = new StringBuilder(optional ? "you may " : "") - .append("draw ") - .append(cardsToDraw == 1 ? "a" : CardUtil.numberToText(cardsToDraw)) - .append(" card").append(cardsToDraw == 1 ? "" : "s") - .append(optional ? ", if you do" : ", then") - .append(" discard ") - .append(cardsToDiscard == 1 ? "a" : CardUtil.numberToText(cardsToDiscard)) - .append(" card").append(cardsToDiscard == 1 ? "" : "s").toString(); } public DrawDiscardControllerEffect(final DrawDiscardControllerEffect effect) { @@ -56,14 +51,31 @@ public class DrawDiscardControllerEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - if (!optional || player.chooseUse(outcome, "Use draw, then discard effect?", source, game)) { - player.drawCards(cardsToDraw, source, game); - player.discard(cardsToDiscard, false, false, source, game); - } + if (player == null) { + return false; + } + if (optional && !player.chooseUse(outcome, "Draw, then discard?", source, game)) { return true; } - return false; + player.drawCards(cardsToDraw, source, game); + player.discard(cardsToDiscard, false, false, source, game); + return true; } + @Override + public String getText(Mode mode) { + if (staticText != null && !staticText.isEmpty()) { + return staticText; + } + return (optional ? "you may " : "") + + "draw " + + (cardsToDraw == 1 ? "a" : CardUtil.numberToText(cardsToDraw)) + + " card" + + (cardsToDraw == 1 ? "" : "s") + + (optional ? ". If you do," : ", then") + + " discard " + + (cardsToDiscard == 1 ? "a" : CardUtil.numberToText(cardsToDiscard)) + + " card" + + (cardsToDiscard == 1 ? "" : "s"); + } }