Updated choose color dialog: added mana value and ability source

This commit is contained in:
Oleg Agafonov 2017-12-27 06:32:24 +04:00
parent 75cec526dc
commit 534e00e41f

View file

@ -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) {