mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
Inform players of combat damage assignment order in log
This commit is contained in:
parent
493a9d2c6c
commit
ecd43c07e2
1 changed files with 34 additions and 0 deletions
|
@ -655,6 +655,9 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
|
|||
blockerList.remove(blockerId);
|
||||
}
|
||||
}
|
||||
if (!game.isSimulation() && blockerOrder.size() > 1) {
|
||||
logDamageAssignmentOrder("Creatures blocking ", attackers, blockerOrder, game);
|
||||
}
|
||||
}
|
||||
|
||||
public void pickAttackerOrder(UUID playerId, Game game) {
|
||||
|
@ -681,6 +684,37 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
|
|||
attackerList.remove(attackerId);
|
||||
}
|
||||
}
|
||||
if (!game.isSimulation() && attackerOrder.size() > 1) {
|
||||
logDamageAssignmentOrder("Creatures blocked by ", blockers, attackerOrder, game);
|
||||
}
|
||||
}
|
||||
|
||||
private void logDamageAssignmentOrder(String prefix, List<UUID> assignedFor, List<UUID> assignedOrder, Game game) {
|
||||
StringBuilder sb = new StringBuilder(prefix);
|
||||
boolean first = true;
|
||||
for (UUID id : assignedFor) {
|
||||
Permanent perm = game.getPermanent(id);
|
||||
if (perm != null) {
|
||||
if (!first) {
|
||||
sb.append(", ");
|
||||
}
|
||||
sb.append(perm.getLogName());
|
||||
first = false;
|
||||
}
|
||||
}
|
||||
sb.append(" are ordered: ");
|
||||
first = true;
|
||||
for (UUID id : assignedOrder) {
|
||||
Permanent perm = game.getPermanent(id);
|
||||
if (perm != null) {
|
||||
if (!first) {
|
||||
sb.append(", ");
|
||||
}
|
||||
sb.append(perm.getLogName());
|
||||
first = false;
|
||||
}
|
||||
}
|
||||
game.informPlayers(sb.toString());
|
||||
}
|
||||
|
||||
public int totalAttackerDamage(Game game) {
|
||||
|
|
Loading…
Reference in a new issue