mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
Updated choose color dialog: added mana value and ability source
This commit is contained in:
parent
75cec526dc
commit
534e00e41f
1 changed files with 4 additions and 2 deletions
|
|
@ -69,11 +69,13 @@ public class AddManaOfAnyColorEffect extends BasicManaEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
ChoiceColor choice = new ChoiceColor(true);
|
||||
String mes = String.format("Select color of %d mana to add it to your mana pool", this.amount);
|
||||
ChoiceColor choice = new ChoiceColor(true, mes, game.getObject(source.getSourceId()));
|
||||
|
||||
if (controller.choose(outcome, choice, game)) {
|
||||
if (choice.getColor() == null) {
|
||||
return false; // it happens, don't know how
|
||||
// on user's reconnect choice dialog close and return null even with required settings
|
||||
return false;
|
||||
}
|
||||
Mana createdMana = choice.getMana(amount);
|
||||
if (createdMana != null) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue