mirror of
https://github.com/magefree/mage.git
synced 2026-01-23 03:39:54 -08:00
Added an easier way to put custom text on buttons in a chooseUse prompt.
This commit is contained in:
parent
d70f424d1b
commit
bc0f53973d
9 changed files with 38 additions and 41 deletions
|
|
@ -50,7 +50,6 @@ import mage.players.Player;
|
|||
import mage.target.common.TargetCardInGraveyard;
|
||||
import mage.target.common.TargetCardInOpponentsGraveyard;
|
||||
import mage.target.common.TargetOpponent;
|
||||
import mage.util.MessageToClient;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -157,10 +156,14 @@ class DawnbreakReclaimerEffect extends OneShotEffect {
|
|||
cards.add(controllerCreatureCard);
|
||||
}
|
||||
if (!cards.isEmpty()) {
|
||||
MessageToClient message = new MessageToClient("Return those cards to the battlefield under their owners' control?",
|
||||
"Opponent's creature card: " + (cardOpponentGraveyard == null ? "none" : cardOpponentGraveyard.getLogName())
|
||||
+ ", your creature card: " + (controllerCreatureCard == null ? "none" : controllerCreatureCard.getLogName()));
|
||||
if (controller.chooseUse(outcome, message, source, game)) {
|
||||
if (controller.chooseUse(
|
||||
outcome,
|
||||
"Return those cards to the battlefield under their owners' control?",
|
||||
"Opponent's creature card: " + (cardOpponentGraveyard == null ? "none" : cardOpponentGraveyard.getLogName()) + ", your creature card: " + (controllerCreatureCard == null ? "none" : controllerCreatureCard.getLogName()),
|
||||
null,
|
||||
null,
|
||||
source,
|
||||
game)) {
|
||||
controller.moveCards(cards, Zone.BATTLEFIELD, source, game, false, false, true, null);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ import mage.game.Game;
|
|||
import mage.players.Player;
|
||||
import mage.target.TargetCard;
|
||||
import mage.target.common.TargetOpponent;
|
||||
import mage.util.MessageToClient;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -102,8 +101,7 @@ class FortunesFavorEffect extends OneShotEffect {
|
|||
cards.removeAll(target.getTargets());
|
||||
controller.revealCards(sourceObject.getIdName() + " - cards in face-up pile", cards, game);
|
||||
game.informPlayers(targetOpponent.getLogName() + " puts " + faceDownPile.size() + " card(s) into the face-down pile");
|
||||
MessageToClient message = new MessageToClient("Put the face-down pile into your hand?", "(If you say yes, the face-up pile goes to the graveyard.)");
|
||||
if (controller.chooseUse(outcome, message, source, game)) {
|
||||
if (controller.chooseUse(outcome, "Choose a pile to put in your hand.", null, "Face-down", "Face-up", source, game)) {
|
||||
controller.moveCards(faceDownPile, Zone.HAND, source, game);
|
||||
controller.moveCards(cards, Zone.GRAVEYARD, source, game);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ import mage.game.permanent.Permanent;
|
|||
import mage.players.Player;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetOpponent;
|
||||
import mage.util.MessageToClient;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -95,26 +94,22 @@ class RemorselessPunishmentEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player opponent = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
if (opponent != null) {
|
||||
handleBaseEffect(game, source, opponent, 1);
|
||||
handleBaseEffect(game, source, opponent, 2);
|
||||
handleBaseEffect(game, source, opponent, "1st");
|
||||
handleBaseEffect(game, source, opponent, "2nd");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void handleBaseEffect(Game game, Ability source, Player opponent, int iteration) {
|
||||
private void handleBaseEffect(Game game, Ability source, Player opponent, String iteration) {
|
||||
if (opponent.getHand().size() > 1) {
|
||||
MessageToClient mtc = new MessageToClient("Discards two cards to prevent to lose 5 life?",
|
||||
"If you want to sacrifice a creature or planeswalker instead click \"No\". (Iteration " + iteration + ")");
|
||||
if (opponent.chooseUse(outcome, mtc, source, game)) {
|
||||
if (opponent.chooseUse(outcome, "Choose your " + iteration + " punishment.", null, "Discard two cards", "Choose another option", source, game)) {
|
||||
opponent.discard(2, false, source, game);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (game.getBattlefield().contains(filter, opponent.getId(), 1, game)) {
|
||||
MessageToClient mtc = new MessageToClient("Sacrifice a creature or planeswalker?",
|
||||
"If you don't sacrifice a creature or planeswalker, you lose 5 life instead. (Iteration " + iteration + ")");
|
||||
if (opponent.chooseUse(outcome, mtc, source, game)) {
|
||||
if (opponent.chooseUse(outcome, "Choose your " + iteration + " punishment.", null, "Sacrifice a creature or planeswalker", "Lose 5 life", source, game)) {
|
||||
TargetPermanent target = new TargetPermanent(1, 1, filter, true);
|
||||
if (target.choose(Outcome.Sacrifice, opponent.getId(), source.getId(), game)) {
|
||||
for (UUID targetId : target.getTargets()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue