mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
refactor: removed outdated Player::assignDamage by multi amount dialog, fixed getMultiAmount to work with min values, added additional checks
This commit is contained in:
parent
86fc0028c1
commit
2d9ac4e732
12 changed files with 50 additions and 127 deletions
|
|
@ -2875,11 +2875,11 @@ public class TestPlayer implements Player {
|
|||
|
||||
@Override
|
||||
public List<Integer> getMultiAmountWithIndividualConstraints(Outcome outcome, List<MultiAmountMessage> messages,
|
||||
int min, int max, MultiAmountType type, Game game) {
|
||||
int totalMin, int totalMax, MultiAmountType type, Game game) {
|
||||
assertAliasSupportInChoices(false);
|
||||
|
||||
int needCount = messages.size();
|
||||
List<Integer> defaultList = MultiAmountType.prepareDefaltValues(messages, min, max);
|
||||
List<Integer> defaultList = MultiAmountType.prepareDefaltValues(messages, totalMin, totalMax);
|
||||
if (needCount == 0) {
|
||||
return defaultList;
|
||||
}
|
||||
|
|
@ -2905,7 +2905,7 @@ public class TestPlayer implements Player {
|
|||
}
|
||||
|
||||
// extra check
|
||||
if (!MultiAmountType.isGoodValues(answer, messages, min, max)) {
|
||||
if (!MultiAmountType.isGoodValues(answer, messages, totalMin, totalMax)) {
|
||||
Assert.fail("Wrong choices in multi amount: " + answer
|
||||
.stream()
|
||||
.map(String::valueOf)
|
||||
|
|
@ -2916,7 +2916,7 @@ public class TestPlayer implements Player {
|
|||
}
|
||||
|
||||
this.chooseStrictModeFailed("choice", game, "Multi amount: " + type.getHeader());
|
||||
return computerPlayer.getMultiAmountWithIndividualConstraints(outcome, messages, min, max, type, game);
|
||||
return computerPlayer.getMultiAmountWithIndividualConstraints(outcome, messages, totalMin, totalMax, type, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -4384,14 +4384,6 @@ public class TestPlayer implements Player {
|
|||
return computerPlayer.chooseBlockerOrder(blockers, combatGroup, blockerOrder, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void assignDamage(int damage, List<UUID> targets,
|
||||
String singleTargetName, UUID attackerId, Ability source,
|
||||
Game game
|
||||
) {
|
||||
computerPlayer.assignDamage(damage, targets, singleTargetName, attackerId, source, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sideboard(Match match, Deck deck
|
||||
) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue