forked from External/mage
[READY FOR REVIEW] Implement a "multi-amount" dialog (#7528)
* Implemented chooseTargetAmount and new GUI dialog (distribute damage, distribute mana) * Added tests and AI support; * Test framework: added aliases support in TargetAmount dialogs; Co-authored-by: Oleg Agafonov <jaydi85@gmail.com>
This commit is contained in:
parent
042aa61ad4
commit
600cac6fc7
35 changed files with 1209 additions and 232 deletions
|
|
@ -72,21 +72,19 @@ public class TargetCardInLibrary extends TargetCard {
|
|||
}
|
||||
cards.sort(Comparator.comparing(MageObject::getName));
|
||||
Cards cardsId = new CardsImpl();
|
||||
cards.forEach((card) -> {
|
||||
cardsId.add(card);
|
||||
});
|
||||
cards.forEach(cardsId::add);
|
||||
|
||||
while (!isChosen() && !doneChosing()) {
|
||||
chosen = targets.size() >= getMinNumberOfTargets();
|
||||
do {
|
||||
if (!player.canRespond()) {
|
||||
return chosen = targets.size() >= minNumberOfTargets;
|
||||
return chosen;
|
||||
}
|
||||
chosen = targets.size() >= minNumberOfTargets;
|
||||
if (!player.chooseTarget(outcome, cardsId, this, null, game)) {
|
||||
return chosen;
|
||||
}
|
||||
chosen = targets.size() >= minNumberOfTargets;
|
||||
}
|
||||
return chosen = true;
|
||||
chosen = targets.size() >= getMinNumberOfTargets();
|
||||
} while (!isChosen() && !doneChosing());
|
||||
return chosen;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue