mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 10:40:06 -08:00
Fix message for choose target dialog for distributing +1/+1 counters (#9202)
This commit is contained in:
parent
69f9331d87
commit
5e7f145e3d
2 changed files with 9 additions and 4 deletions
|
|
@ -832,6 +832,10 @@ public class HumanPlayer extends PlayerImpl {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (source == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
UUID abilityControllerId = playerId;
|
UUID abilityControllerId = playerId;
|
||||||
if (target.getAbilityController() != null) {
|
if (target.getAbilityController() != null) {
|
||||||
abilityControllerId = target.getAbilityController();
|
abilityControllerId = target.getAbilityController();
|
||||||
|
|
@ -876,8 +880,7 @@ public class HumanPlayer extends PlayerImpl {
|
||||||
prepareForResponse(game);
|
prepareForResponse(game);
|
||||||
if (!isExecutingMacro()) {
|
if (!isExecutingMacro()) {
|
||||||
// target amount uses for damage only, if you see another use case then message must be changed here and on getMultiAmount call
|
// target amount uses for damage only, if you see another use case then message must be changed here and on getMultiAmount call
|
||||||
String message = String.format("Select targets to distribute %d damage (selected %d)", amountTotal, target.getTargets().size());
|
game.fireSelectTargetEvent(playerId, new MessageToClient(target.getMessage(), getRelatedObjectName(source, game)), possibleTargets, required, options);
|
||||||
game.fireSelectTargetEvent(playerId, new MessageToClient(message, getRelatedObjectName(source, game)), possibleTargets, required, options);
|
|
||||||
}
|
}
|
||||||
waitForResponse(game);
|
waitForResponse(game);
|
||||||
|
|
||||||
|
|
@ -923,8 +926,9 @@ public class HumanPlayer extends PlayerImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MultiAmountType multiAmountType = source.toString().contains("counters") ? MultiAmountType.P1P1 : MultiAmountType.DAMAGE;
|
||||||
// ask and assign new amount
|
// ask and assign new amount
|
||||||
List<Integer> targetValues = getMultiAmount(outcome, targetNames, 1, amountTotal, MultiAmountType.DAMAGE, game);
|
List<Integer> targetValues = getMultiAmount(outcome, targetNames, 1, amountTotal, multiAmountType, game);
|
||||||
for (int i = 0; i < targetValues.size(); i++) {
|
for (int i = 0; i < targetValues.size(); i++) {
|
||||||
int newAmount = targetValues.get(i);
|
int newAmount = targetValues.get(i);
|
||||||
UUID targetId = targets.get(i);
|
UUID targetId = targets.get(i);
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,8 @@ import java.util.stream.IntStream;
|
||||||
public enum MultiAmountType {
|
public enum MultiAmountType {
|
||||||
|
|
||||||
MANA("Add mana", "Distribute mana among colors"),
|
MANA("Add mana", "Distribute mana among colors"),
|
||||||
DAMAGE("Assign damage", "Assign damage among targets");
|
DAMAGE("Assign damage", "Assign damage among targets"),
|
||||||
|
P1P1("Add +1/+1 counters", "Distribute +1/+1 counters among creatures");
|
||||||
|
|
||||||
private final String title;
|
private final String title;
|
||||||
private final String header;
|
private final String header;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue