Cascade and other "cast spell without paying" abilities - added card popup support for casting card (closes #11355)

This commit is contained in:
Oleg Agafonov 2023-11-27 00:49:37 +04:00
parent 1dc040a2c9
commit 6e3fe7ec46
3 changed files with 4 additions and 7 deletions

View file

@ -62,7 +62,6 @@ public class MageTextArea extends MageEditorPane {
SwingUtilities.invokeLater(() -> {
String promptText = buffer.toString();
System.out.println(promptText);
MageTextArea.super.setText(promptText);
// in case the text don't fit in the panel a tooltip with the text is added
if (panelWidth > 0 && MageTextArea.this.getPreferredSize().getWidth() > panelWidth) {

View file

@ -101,10 +101,9 @@ class AnrakyrTheTravellerEffect extends OneShotEffect {
List<Card> partsToCast = cardMap.get(cardToCast.getId());
String partsInfo = partsToCast
.stream()
.map(MageObject::getIdName)
.map(MageObject::getLogName)
.collect(Collectors.joining(" or "));
if (cardToCast == null
|| partsToCast.size() < 1
if (partsToCast.size() < 1
|| !player.chooseUse(
Outcome.PlayForFree, "Cast spell by paying life equal to its mana value rather than paying its mana cost (" + partsInfo + ")?", source, game
)) {

View file

@ -1377,10 +1377,9 @@ public final class CardUtil {
List<Card> partsToCast = cardMap.get(cardToCast.getId());
String partsInfo = partsToCast
.stream()
.map(MageObject::getIdName)
.map(MageObject::getLogName)
.collect(Collectors.joining(" or "));
if (cardToCast == null
|| partsToCast.size() < 1
if (partsToCast.size() < 1
|| !player.chooseUse(
Outcome.PlayForFree, "Cast spell without paying its mana cost (" + partsInfo + ")?", source, game
)) {