fix #11643 (choice for add mana of any type produced)

This commit is contained in:
xenohedron 2024-01-13 16:26:54 -05:00
parent dba8725b26
commit 341d8b9add
2 changed files with 68 additions and 8 deletions

View file

@ -100,14 +100,18 @@ public class AddManaOfAnyTypeProducedEffect extends ManaEffect {
choice.getChoices().add("Colorless");
}
if (choice.getChoices().isEmpty()) {
return newMana;
switch (choice.getChoices().size()) {
case 0: // no mana possible to add
return newMana;
case 1: // no choice necessary for one option
choice.setChoice(choice.getChoices().iterator().next());
break;
default:
// attempt to make choice
if (!targetController.choose(outcome, choice, game)) {
return newMana; // no mana if no choice made
}
}
if (choice.getChoices().size() != 1
&& !targetController.choose(outcome, choice, game)) {
return newMana;
}
choice.setChoice(choice.getChoices().iterator().next());
switch (choice.getChoice()) {
case "White":
@ -128,6 +132,7 @@ public class AddManaOfAnyTypeProducedEffect extends ManaEffect {
case "Colorless":
newMana.setColorless(1);
break;
default:
}
return newMana;
}