if (attacker != null && canDamage(attacker, first)) {
for (UUID blockerId: blockerOrder) {
Permanent blocker = game.getPermanent(blockerId);
int lethalDamage = blocker.getToughness().getValue() - blocker.getDamage();
if (lethalDamage >= damage) {
blocker.damage(damage, attacker.getId(), game, true, true);
damage = 0;
break;
}
int damageAssigned = player.getAmount(lethalDamage, damage, "Assign damage to " + blocker.getName(), game);
blocker.damage(damageAssigned, attacker.getId(), game, true, true);