This commit is contained in:
TRT
2023-01-27 13:48:19 +01:00
parent 639c20123c
commit 4162ec4ceb
3 changed files with 4 additions and 19 deletions

View File

@@ -738,11 +738,7 @@ public class DamageDealAi extends DamageAiBase {
dump = true;
}
final int assignedDamage = dump ? dmg : ComputerUtilCombat.getEnoughDamageToKill(c, dmg, source, false, noPrevention);
if (assignedDamage <= dmg) {
sa.addDividedAllocation(c, assignedDamage);
} else {
sa.addDividedAllocation(c, dmg);
}
sa.addDividedAllocation(c, Math.min(assignedDamage, dmg));
dmg = dmg - assignedDamage;
if (dmg <= 0) {
break;
@@ -752,10 +748,12 @@ public class DamageDealAi extends DamageAiBase {
}
} else if ("OppAtTenLife".equals(logic)) {
for (final Player p : ai.getOpponents()) {
if (sa.canTarget(p) && p.getLife() == 10 && tcs.size() < tgt.getMaxTargets(source, sa)) {
if (sa.canTarget(p) && p.getLife() == 10) {
tcs.add(p);
return true;
}
}
return false;
}
// TODO: Improve Damage, we shouldn't just target the player just because we can
if (sa.canTarget(enemy) && tcs.size() < tgt.getMaxTargets(source, sa)) {