updated phrasing on player choice messages

This commit is contained in:
Evan Kranzler 2021-03-23 09:30:46 -04:00
parent d54e1c6eac
commit 043aae6dff
19 changed files with 44 additions and 94 deletions

View file

@ -711,7 +711,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
Object[] options = {"From file", "From clipboard (new deck)", "From clipboard (append cards)"}; Object[] options = {"From file", "From clipboard (new deck)", "From clipboard (append cards)"};
int n = JOptionPane.showOptionDialog(MageFrame.getDesktop(), int n = JOptionPane.showOptionDialog(MageFrame.getDesktop(),
"Where would you like to import from?", "Choose import location",
"Deck import", "Deck import",
JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.YES_NO_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE, JOptionPane.QUESTION_MESSAGE,
@ -817,7 +817,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
Object[] options = {"To file", "To clipboard"}; Object[] options = {"To file", "To clipboard"};
int n = JOptionPane.showOptionDialog(MageFrame.getDesktop(), int n = JOptionPane.showOptionDialog(MageFrame.getDesktop(),
"Where would you like to export?", "Choose export location",
"Deck export", "Deck export",
JOptionPane.YES_NO_OPTION, JOptionPane.YES_NO_OPTION,
JOptionPane.QUESTION_MESSAGE, JOptionPane.QUESTION_MESSAGE,

View file

@ -1,12 +1,10 @@
package mage.cards.b; package mage.cards.b;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.costs.Cost;
import mage.abilities.costs.mana.ManaCost;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.ManacostVariableValue; import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ClashEffect; import mage.abilities.effects.common.ClashEffect;
import mage.abilities.effects.common.CounterUnlessPaysEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.CardSetInfo; import mage.cards.CardSetInfo;
import mage.constants.CardType; import mage.constants.CardType;
@ -15,7 +13,6 @@ import mage.game.Game;
import mage.game.stack.Spell; import mage.game.stack.Spell;
import mage.players.Player; import mage.players.Player;
import mage.target.TargetSpell; import mage.target.TargetSpell;
import mage.util.ManaUtil;
import java.util.UUID; import java.util.UUID;
@ -28,7 +25,8 @@ public final class BrokenAmbitions extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{U}"); super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{U}");
// Counter target spell unless its controller pays {X}. Clash with an opponent. If you win, that spell's controller puts the top four cards of their library into their graveyard. // Counter target spell unless its controller pays {X}. Clash with an opponent. If you win, that spell's controller puts the top four cards of their library into their graveyard.
this.getSpellAbility().addEffect(new BrokenAmbitionsEffect(ManacostVariableValue.instance)); this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(ManacostVariableValue.instance));
this.getSpellAbility().addEffect(new BrokenAmbitionsEffect());
this.getSpellAbility().addTarget(new TargetSpell()); this.getSpellAbility().addTarget(new TargetSpell());
} }
@ -44,32 +42,13 @@ public final class BrokenAmbitions extends CardImpl {
class BrokenAmbitionsEffect extends OneShotEffect { class BrokenAmbitionsEffect extends OneShotEffect {
private static final String effectText = "Counter target spell unless its controller pays {X}. Clash with an opponent. If you win, that spell's controller mills four cards"; BrokenAmbitionsEffect() {
protected Cost cost;
protected DynamicValue genericMana;
public BrokenAmbitionsEffect(Cost cost) {
super(Outcome.Benefit); super(Outcome.Benefit);
this.cost = cost; this.staticText = "Clash with an opponent. If you win, that spell's controller mills four cards";
this.staticText = effectText;
} }
public BrokenAmbitionsEffect(DynamicValue genericMana) { private BrokenAmbitionsEffect(final BrokenAmbitionsEffect effect) {
super(Outcome.Detriment);
this.genericMana = genericMana;
this.staticText = effectText;
}
public BrokenAmbitionsEffect(final BrokenAmbitionsEffect effect) {
super(effect); super(effect);
if (effect.cost != null) {
this.cost = effect.cost.copy();
}
if (effect.genericMana != null) {
this.genericMana = effect.genericMana.copy();
}
this.staticText = effectText;
} }
@Override @Override
@ -79,37 +58,17 @@ class BrokenAmbitionsEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Spell spell = (Spell) game.getStack().getStackObject(getTargetPointer().getFirst(game, source)); Spell spell = game.getSpellOrLKIStack(source.getFirstTarget());
if (spell == null) {
return false;
}
Player player = game.getPlayer(spell.getControllerId()); Player player = game.getPlayer(spell.getControllerId());
if (player != null) { if (player == null) {
Cost costToPay; return false;
String costValueMessage;
if (cost != null) {
costToPay = cost.copy();
costValueMessage = costToPay.getText();
} else {
costToPay = ManaUtil.createManaCost(genericMana, game, source, this);
costValueMessage = "{" + genericMana.calculate(game, source, this) + "}";
} }
String message;
if (costToPay instanceof ManaCost) {
message = "Would you like to pay " + costValueMessage + " to prevent counter effect?";
} else {
message = costValueMessage + " to prevent counter effect?";
}
costToPay.clearPaid();
if (!(player.chooseUse(Outcome.Benefit, message, source, game) && costToPay.pay(source, game, source, spell.getControllerId(), false, null))) {
game.informPlayers(player.getLogName() + " chooses not to pay " + costValueMessage + " to prevent the counter effect");
game.getStack().counter(spell.getId(), source, game);
}
game.informPlayers(player.getLogName() + " chooses to pay " + costValueMessage + " to prevent the counter effect");
if (ClashEffect.getInstance().apply(game, source)) { if (ClashEffect.getInstance().apply(game, source)) {
player.millCards(4, source, game); player.millCards(4, source, game);
} }
return true; return true;
} }
return false;
}
} }

View file

@ -70,7 +70,7 @@ class ChannelHarmEffect extends PreventionEffectImpl {
if (preventionData.getPreventedDamage() > 0) { if (preventionData.getPreventedDamage() > 0) {
Permanent targetCreature = game.getPermanent(source.getFirstTarget()); Permanent targetCreature = game.getPermanent(source.getFirstTarget());
if (targetCreature != null) { if (targetCreature != null) {
if (sourceController != null && sourceController.chooseUse(outcome, "Would you like to have " + preventionData.getPreventedDamage() + " damage dealt to " + targetCreature.getLogName() + "?", source, game)) { if (sourceController != null && sourceController.chooseUse(outcome, "Have " + preventionData.getPreventedDamage() + " damage dealt to " + targetCreature.getLogName() + "?", source, game)) {
targetCreature.damage(preventionData.getPreventedDamage(), source.getSourceId(), source, game, false, true); targetCreature.damage(preventionData.getPreventedDamage(), source.getSourceId(), source, game, false, true);
} }
} }

View file

@ -91,7 +91,7 @@ class FastingReplacementEffect extends ReplacementEffectImpl {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (event.getPlayerId().equals(source.getControllerId()) if (event.getPlayerId().equals(source.getControllerId())
&& controller != null && controller != null
&& controller.chooseUse(outcome, "Would you like to skip your draw step to gain 2 life?", source, game)) { && controller.chooseUse(outcome, "Skip your draw step to gain 2 life?", source, game)) {
controller.gainLife(2, game, source); controller.gainLife(2, game, source);
return true; return true;
} }

View file

@ -68,8 +68,7 @@ class ForceOfNatureEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) { if (controller != null) {
Cost cost = new ManaCostsImpl("{G}{G}{G}{G}"); Cost cost = new ManaCostsImpl("{G}{G}{G}{G}");
String message = "Would you like to pay {G}{G}{G}{G} to prevent taking 8 damage from {this}?"; if (!(controller.chooseUse(Outcome.Benefit, "Pay {G}{G}{G}{G}?", source, game)
if (!(controller.chooseUse(Outcome.Benefit, message, source, game)
&& cost.pay(source, game, source, controller.getId(), false, null))) { && cost.pay(source, game, source, controller.getId(), false, null))) {
controller.damage(8, source.getSourceId(), source, game); controller.damage(8, source.getSourceId(), source, game);
} }

View file

@ -91,7 +91,7 @@ class GodEternalKefnetDrawCardReplacementEffect extends ReplacementEffectImpl {
// cast copy // cast copy
if (topCard.isInstantOrSorcery() if (topCard.isInstantOrSorcery()
&& you.chooseUse(outcome, "Would you like to copy " + topCard.getName() + " and cast it for {2} less?", source, game)) { && you.chooseUse(outcome, "Copy " + topCard.getName() + " and cast it for {2} less?", source, game)) {
Card blueprint = topCard.copy(); Card blueprint = topCard.copy();
if (blueprint instanceof SplitCard) { if (blueprint instanceof SplitCard) {
((SplitCard) blueprint).getLeftHalfCard().addAbility(new SimpleStaticAbility(Zone.ALL, new SpellCostReductionSourceEffect(2))); ((SplitCard) blueprint).getLeftHalfCard().addAbility(new SimpleStaticAbility(Zone.ALL, new SpellCostReductionSourceEffect(2)));
@ -157,7 +157,7 @@ class GodEternalKefnetDrawCardReplacementEffect extends ReplacementEffectImpl {
String mes = topCard.getName() + ", " + (topCard.isInstantOrSorcery() String mes = topCard.getName() + ", " + (topCard.isInstantOrSorcery()
? HintUtils.prepareText("you can copy it and cast {2} less", Color.green) ? HintUtils.prepareText("you can copy it and cast {2} less", Color.green)
: HintUtils.prepareText("you can't copy it", Color.red)); : HintUtils.prepareText("you can't copy it", Color.red));
return you.chooseUse(Outcome.Benefit, "Would you like to reveal first drawn card (" + mes + ")?", source, game); return you.chooseUse(Outcome.Benefit, "Reveal first drawn card (" + mes + ")?", source, game);
} }
} }

View file

@ -62,8 +62,7 @@ class HasranOgressEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) { if (controller != null) {
Cost cost = new ManaCostsImpl("{2}"); Cost cost = new ManaCostsImpl("{2}");
String message = "Would you like to pay {2} to prevent taking 3 damage from Hasran Ogress?"; if (!(controller.chooseUse(Outcome.Benefit, "Pay {2}?", source, game)
if (!(controller.chooseUse(Outcome.Benefit, message, source, game)
&& cost.pay(source, game, source, controller.getId(), false, null))) { && cost.pay(source, game, source, controller.getId(), false, null))) {
controller.damage(3, source.getSourceId(), source, game); controller.damage(3, source.getSourceId(), source, game);
} }

View file

@ -63,8 +63,7 @@ class LimDulsHexEffect extends OneShotEffect {
if (player != null) { if (player != null) {
OrCost costToPay = new OrCost(new ManaCostsImpl("{B}"), new ManaCostsImpl("{3}"), "{B} or {3}"); OrCost costToPay = new OrCost(new ManaCostsImpl("{B}"), new ManaCostsImpl("{3}"), "{B} or {3}");
costToPay.clearPaid(); costToPay.clearPaid();
String message = "Would you like to pay " + costToPay.getText() + " to prevent 1 damage from " + sourcePermanent.getLogName() + "?"; if (!(player.chooseUse(Outcome.Benefit, "Pay {B} or {3}?", source, game) && costToPay.pay(source, game, source, player.getId(), false, null))) {
if (!(player.chooseUse(Outcome.Benefit, message, source, game) && costToPay.pay(source, game, source, player.getId(), false, null))) {
game.informPlayers(player.getLogName() + " chooses not to pay " + costToPay.getText() + " to prevent 1 damage from " + sourcePermanent.getLogName()); game.informPlayers(player.getLogName() + " chooses not to pay " + costToPay.getText() + " to prevent 1 damage from " + sourcePermanent.getLogName());
player.damage(1, sourcePermanent.getId(), source, game); player.damage(1, sourcePermanent.getId(), source, game);
} else { } else {

View file

@ -118,8 +118,7 @@ class MysticRemoraEffect extends OneShotEffect {
if (controller != null && opponent != null && sourceObject != null) { if (controller != null && opponent != null && sourceObject != null) {
if (controller.chooseUse(Outcome.DrawCard, "Draw a card (" + sourceObject.getLogName() + ')', source, game)) { if (controller.chooseUse(Outcome.DrawCard, "Draw a card (" + sourceObject.getLogName() + ')', source, game)) {
Cost cost = ManaUtil.createManaCost(4, false); Cost cost = ManaUtil.createManaCost(4, false);
String message = "Would you like to pay {4} to prevent the opponent to draw a card?"; if (opponent.chooseUse(Outcome.Benefit, "Pay {4}?", source, game)
if (opponent.chooseUse(Outcome.Benefit, message, source, game)
&& cost.pay(source, game, source, opponent.getId(), false, null)) { && cost.pay(source, game, source, opponent.getId(), false, null)) {
return true; return true;
} }

View file

@ -69,7 +69,7 @@ class ObstinateFamiliarReplacementEffect extends ReplacementEffectImpl {
@Override @Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) { public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Player you = game.getPlayer(source.getControllerId()); Player you = game.getPlayer(source.getControllerId());
if (you != null && you.chooseUse(Outcome.AIDontUseIt, "Would you like to skip drawing a card?", source, game)){ if (you != null && you.chooseUse(Outcome.AIDontUseIt, "Skip this draw?", source, game)){
return true; return true;
} }
return false; return false;

View file

@ -64,8 +64,7 @@ class RhysticStudyDrawEffect extends OneShotEffect {
if (controller != null && opponent != null && sourceObject != null) { if (controller != null && opponent != null && sourceObject != null) {
if (controller.chooseUse(Outcome.DrawCard, "Draw a card (" + sourceObject.getLogName() + ')', source, game)) { if (controller.chooseUse(Outcome.DrawCard, "Draw a card (" + sourceObject.getLogName() + ')', source, game)) {
Cost cost = ManaUtil.createManaCost(1, false); Cost cost = ManaUtil.createManaCost(1, false);
String message = "Would you like to pay {1} to prevent the opponent to draw a card?"; if (opponent.chooseUse(Outcome.Benefit, "Pay {1}?", source, game)
if (opponent.chooseUse(Outcome.Benefit, message, source, game)
&& cost.pay(source, game, source, opponent.getId(), false, null)) { && cost.pay(source, game, source, opponent.getId(), false, null)) {
return true; return true;
} }

View file

@ -97,7 +97,7 @@ class SelvalaHeartOfTheWildsEffect extends OneShotEffect {
if (filter2.match(permanent, game)) { if (filter2.match(permanent, game)) {
Player permanentController = game.getPlayer(permanent.getControllerId()); Player permanentController = game.getPlayer(permanent.getControllerId());
if (permanentController != null if (permanentController != null
&& permanentController.chooseUse(Outcome.DrawCard, "Would you like to draw a card?", source, game)) { && permanentController.chooseUse(Outcome.DrawCard, "Draw a card?", source, game)) {
permanentController.drawCards(1, source, game); permanentController.drawCards(1, source, game);
} }
} }

View file

@ -64,8 +64,7 @@ class SoulBarrierEffect extends OneShotEffect {
if (player != null && permanent != null) { if (player != null && permanent != null) {
Cost cost = ManaUtil.createManaCost(2, false); Cost cost = ManaUtil.createManaCost(2, false);
String message = "Would you like to pay {2} to prevent taking 2 damage from " + permanent.getLogName() + "?"; if (!(player.chooseUse(Outcome.Benefit, "Pay {2}?", source, game)
if (!(player.chooseUse(Outcome.Benefit, message, source, game)
&& cost.pay(source, game, source, player.getId(), false, null))) { && cost.pay(source, game, source, player.getId(), false, null))) {
player.damage(2, source.getSourceId(), source, game); player.damage(2, source.getSourceId(), source, game);
} }

View file

@ -81,7 +81,7 @@ class SoulEchoOpponentsChoiceEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
Player opponent = game.getPlayer(targetPointer.getFirst(game, source)); Player opponent = game.getPlayer(targetPointer.getFirst(game, source));
if (controller != null && opponent != null && permanent != null) { if (controller != null && opponent != null && permanent != null) {
if (opponent.chooseUse(outcome, "Would you like to have all damage dealt to " + controller.getLogName() + " be decremented from echo counters on " + permanent.getLogName() + " until " + controller.getLogName() + "'s next upkeep instead?", source, game)) { if (opponent.chooseUse(outcome, "Have all damage dealt to " + controller.getLogName() + " be decremented from echo counters on " + permanent.getLogName() + " until " + controller.getLogName() + "'s next upkeep instead?", source, game)) {
game.informPlayers("Until " + controller.getLogName() + "'s next upkeep, for each 1 damage that would be dealt to " + controller.getLogName() + ", an echo counter from " + permanent.getLogName() + " is removed instead"); game.informPlayers("Until " + controller.getLogName() + "'s next upkeep, for each 1 damage that would be dealt to " + controller.getLogName() + ", an echo counter from " + permanent.getLogName() + " is removed instead");
game.addEffect(new SoulEchoReplacementEffect(), source); game.addEffect(new SoulEchoReplacementEffect(), source);
} }

View file

@ -70,7 +70,7 @@ class VaporousDjinnEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) { if (controller != null) {
Cost cost = new ManaCostsImpl("{U}{U}"); Cost cost = new ManaCostsImpl("{U}{U}");
String message = "Would you like to pay {U}{U} to prevent {this} from phasing out?"; String message = "Pay {U}{U} to prevent this permanent from phasing out?";
if (!(controller.chooseUse(Outcome.Benefit, message, source, game) if (!(controller.chooseUse(Outcome.Benefit, message, source, game)
&& cost.pay(source, game, source, controller.getId(), false, null))) { && cost.pay(source, game, source, controller.getId(), false, null))) {
permanent.phaseOut(game); permanent.phaseOut(game);

View file

@ -60,12 +60,11 @@ public class CounterUnlessPaysEffect extends OneShotEffect {
costToPay = ManaUtil.createManaCost(genericMana, game, source, this); costToPay = ManaUtil.createManaCost(genericMana, game, source, this);
costValueMessage = "{" + genericMana.calculate(game, source, this) + "}"; costValueMessage = "{" + genericMana.calculate(game, source, this) + "}";
} }
String message; String message = "";
if (costToPay instanceof ManaCost) { if (costToPay instanceof ManaCost) {
message = "Would you like to pay " + costValueMessage + " to prevent counter effect?"; message += "Pay ";
} else {
message = costValueMessage + " to prevent counter effect?";
} }
message += costValueMessage + '?';
costToPay.clearPaid(); costToPay.clearPaid();
if (!(player.chooseUse(Outcome.Benefit, message, source, game) if (!(player.chooseUse(Outcome.Benefit, message, source, game)

View file

@ -113,12 +113,11 @@ public class SacrificeOpponentsUnlessPayEffect extends OneShotEffect {
costToPay = ManaUtil.createManaCost(genericMana, game, source, this); costToPay = ManaUtil.createManaCost(genericMana, game, source, this);
costValueMessage = "{" + genericMana.calculate(game, source, this) + "}"; costValueMessage = "{" + genericMana.calculate(game, source, this) + "}";
} }
String message; String message = "";
if (costToPay instanceof ManaCost) { if (costToPay instanceof ManaCost) {
message = "Would you like to pay " + costValueMessage + " to prevent sacrifice effect?"; message += "Pay ";
} else {
message = costValueMessage + " to prevent sacrifice effect?";
} }
message += costValueMessage + '?';
costToPay.clearPaid(); costToPay.clearPaid();
if (!(player.chooseUse(Outcome.Benefit, message, source, game) if (!(player.chooseUse(Outcome.Benefit, message, source, game)

View file

@ -58,12 +58,11 @@ public class SacrificeSourceUnlessPaysEffect extends OneShotEffect {
costToPay = ManaUtil.createManaCost(genericMana, game, source, this); costToPay = ManaUtil.createManaCost(genericMana, game, source, this);
costValueMessage = "{" + genericMana.calculate(game, source, this) + "}"; costValueMessage = "{" + genericMana.calculate(game, source, this) + "}";
} }
String message; String message = "";
if (costToPay instanceof ManaCost) { if (costToPay instanceof ManaCost) {
message = "Would you like to pay " + costValueMessage + " to prevent sacrifice effect?"; message += "Pay ";
} else {
message = costValueMessage + " to prevent sacrifice effect?";
} }
message += costValueMessage + '?';
costToPay.clearPaid(); costToPay.clearPaid();
if (costToPay.canPay(source, source, source.getControllerId(), game) if (costToPay.canPay(source, source, source.getControllerId(), game)

View file

@ -4297,7 +4297,7 @@ public abstract class PlayerImpl implements Player, Serializable {
if (userData.askMoveToGraveOrder()) { if (userData.askMoveToGraveOrder()) {
if (cards.size() > 1) { if (cards.size() > 1) {
chooseOrder = choosingPlayer.chooseUse(Outcome.Neutral, chooseOrder = choosingPlayer.chooseUse(Outcome.Neutral,
"Would you like to choose the order the cards go to graveyard?", source, game); "Choose the order in which the cards go to the graveyard?", source, game);
} }
} }
if (chooseOrder) { if (chooseOrder) {