mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
parent
b4a58a339d
commit
35f4a898f9
8 changed files with 24 additions and 7 deletions
|
|
@ -106,7 +106,7 @@ class CommanderIdentityManaEffect extends ManaEffect {
|
|||
}
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
Choice choice = new ChoiceImpl();
|
||||
Choice choice = new ChoiceImpl().setManaColorChoice(true);
|
||||
choice.setMessage("Pick a mana color");
|
||||
for (UUID commanderId : game.getCommandersIds(controller, CommanderCardType.COMMANDER_OR_OATHBREAKER, false)) {
|
||||
Card commander = game.getCard(commanderId);
|
||||
|
|
|
|||
|
|
@ -41,6 +41,10 @@ public interface Choice extends Serializable, Copyable<Choice> {
|
|||
|
||||
ChoiceHintType getHintType();
|
||||
|
||||
boolean isManaColorChoice();
|
||||
|
||||
Choice setManaColorChoice(boolean manaColorChoice);
|
||||
|
||||
// string choice
|
||||
void setChoices(Set<String> choices);
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ public class ChoiceColor extends ChoiceImpl {
|
|||
|
||||
this.setMessage(chooseMessage);
|
||||
this.setSubMessage(chooseSubMessage);
|
||||
this.manaColorChoice = true;
|
||||
}
|
||||
|
||||
protected ChoiceColor(final ChoiceColor choice) {
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ public class ChoiceImpl implements Choice {
|
|||
protected String specialText = "";
|
||||
protected String specialHint = "";
|
||||
|
||||
protected boolean manaColorChoice = false; // set true to allow automatic choosing with Outcome.PutManaInPool
|
||||
|
||||
public ChoiceImpl() {
|
||||
this(false);
|
||||
}
|
||||
|
|
@ -65,6 +67,7 @@ public class ChoiceImpl implements Choice {
|
|||
this.specialCanBeEmpty = choice.specialCanBeEmpty;
|
||||
this.specialText = choice.specialText;
|
||||
this.specialHint = choice.specialHint;
|
||||
this.manaColorChoice = choice.manaColorChoice;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -328,6 +331,17 @@ public class ChoiceImpl implements Choice {
|
|||
return this.hintType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isManaColorChoice() {
|
||||
return manaColorChoice;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChoiceImpl setManaColorChoice(boolean manaColorChoice) {
|
||||
this.manaColorChoice = manaColorChoice;
|
||||
return this;
|
||||
}
|
||||
|
||||
private void protectFromEmptyChoices() {
|
||||
// if there are no choices then required must be disabled to allow user to close a dialog
|
||||
// example: database error on too low memory, see Brain Pry and 500 Mb server
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue