diff --git a/Mage.Sets/src/mage/cards/t/ThirstForKnowledge.java b/Mage.Sets/src/mage/cards/t/ThirstForKnowledge.java index bc4fb767d9..4a3d27c634 100644 --- a/Mage.Sets/src/mage/cards/t/ThirstForKnowledge.java +++ b/Mage.Sets/src/mage/cards/t/ThirstForKnowledge.java @@ -1,4 +1,3 @@ - package mage.cards.t; import mage.abilities.costs.common.DiscardCardCost; @@ -24,9 +23,13 @@ public final class ThirstForKnowledge extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}"); // Draw three cards. Then discard two cards unless you discard an artifact card. + DiscardCardCost cost = new DiscardCardCost(filter); + cost.setText("discard one artifact card instead two cards"); this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(3)); this.getSpellAbility().addEffect(new DoIfCostPaid( - null, new DiscardControllerEffect(2), new DiscardCardCost(filter) + null, + new DiscardControllerEffect(2), + cost ).setText("Then discard two cards unless you discard an artifact card")); } diff --git a/Mage.Sets/src/mage/cards/t/ThirstForMeaning.java b/Mage.Sets/src/mage/cards/t/ThirstForMeaning.java index 1f8472559c..65c452f0d1 100644 --- a/Mage.Sets/src/mage/cards/t/ThirstForMeaning.java +++ b/Mage.Sets/src/mage/cards/t/ThirstForMeaning.java @@ -23,9 +23,13 @@ public final class ThirstForMeaning extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}"); // Draw three cards. Then discard two cards unless you discard an enchantment card. + DiscardCardCost cost = new DiscardCardCost(filter); + cost.setText("discard one enchantment card instead two cards"); this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(3)); this.getSpellAbility().addEffect(new DoIfCostPaid( - null, new DiscardControllerEffect(2), new DiscardCardCost(filter) + null, + new DiscardControllerEffect(2), + cost ).setText("Then discard two cards unless you discard an enchantment card")); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/DoIfCostPaid.java b/Mage/src/main/java/mage/abilities/effects/common/DoIfCostPaid.java index 5a8c7f408d..7277831f43 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DoIfCostPaid.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DoIfCostPaid.java @@ -23,27 +23,27 @@ public class DoIfCostPaid extends OneShotEffect { private String chooseUseText; private boolean optional; - public DoIfCostPaid(Effect effect, Cost cost) { - this(effect, cost, null); + public DoIfCostPaid(Effect effectOnPaid, Cost cost) { + this(effectOnPaid, cost, null); } - public DoIfCostPaid(Effect effect, Effect effect2, Cost cost) { - this(effect, effect2, cost, true); + public DoIfCostPaid(Effect effectOnPaid, Effect effectOnNotPaid, Cost cost) { + this(effectOnPaid, effectOnNotPaid, cost, true); } - public DoIfCostPaid(Effect effect, Effect effect2, Cost cost, boolean optional) { - this(effect, cost, null, optional); - this.otherwiseEffects.add(effect2); + public DoIfCostPaid(Effect effectOnPaid, Effect effectOnNotPaid, Cost cost, boolean optional) { + this(effectOnPaid, cost, null, optional); + this.otherwiseEffects.add(effectOnNotPaid); } - public DoIfCostPaid(Effect effect, Cost cost, String chooseUseText) { - this(effect, cost, chooseUseText, true); + public DoIfCostPaid(Effect effectOnPaid, Cost cost, String chooseUseText) { + this(effectOnPaid, cost, chooseUseText, true); } - public DoIfCostPaid(Effect effect, Cost cost, String chooseUseText, boolean optional) { + public DoIfCostPaid(Effect effectOnPaid, Cost cost, String chooseUseText, boolean optional) { super(Outcome.Benefit); - if (effect != null) { - this.executingEffects.add(effect); + if (effectOnPaid != null) { + this.executingEffects.add(effectOnPaid); } this.cost = cost; this.chooseUseText = chooseUseText; @@ -83,7 +83,7 @@ public class DoIfCostPaid extends OneShotEffect { if (!effectText.isEmpty() && effectText.charAt(effectText.length() - 1) == '.') { effectText = effectText.substring(0, effectText.length() - 1); } - message = getCostText() + " and " + effectText + '?'; + message = getCostText() + (effectText.isEmpty() ? "" : " and " + effectText) + "?"; message = Character.toUpperCase(message.charAt(0)) + message.substring(1); CardUtil.replaceSourceName(message, mageObject.getName()); } else { @@ -91,8 +91,9 @@ public class DoIfCostPaid extends OneShotEffect { } message = CardUtil.replaceSourceName(message, mageObject.getLogName()); boolean result = true; + Outcome payOutcome = executingEffects.size() > 0 ? executingEffects.get(0).getOutcome() : this.outcome; if (cost.canPay(source, source.getSourceId(), player.getId(), game) - && executingEffects.size() > 0 && (!optional || player.chooseUse(executingEffects.get(0).getOutcome(), message, source, game))) { + && (!optional || player.chooseUse(payOutcome, message, source, game))) { cost.clearPaid(); int bookmark = game.bookmarkState(); if (cost.pay(source, game, source.getSourceId(), player.getId(), false)) {