Optimization edit for assignDamageToBlockers

This commit is contained in:
Zzooouhh 2017-12-06 20:31:54 +01:00 committed by GitHub
parent c6e69868fa
commit 5fec04935d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -142,13 +142,12 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
public void assignDamageToBlockers(boolean first, Game game) {
if (!attackers.isEmpty() && (!first || hasFirstOrDoubleStrike(game))) {
Permanent attacker = game.getPermanent(attackers.get(0));
if (isButcherOrgg(attacker, attacker.getControllerId(), first, game, true)) {
return;
}
if (blockers.isEmpty()) {
unblockedDamage(first, game);
} else {
return;
}
Permanent attacker = game.getPermanent(attackers.get(0));
if (!isButcherOrgg(attacker, attacker.getControllerId(), first, game, true)) {
if (attacker.getAbilities().containsKey(DamageAsThoughNotBlockedAbility.getInstance().getId())) { // for handling creatures like Thorn Elemental
Player player = game.getPlayer(defenderControlsDefensiveFormation(game) ? defendingPlayerId : attacker.getControllerId());
if (player.chooseUse(Outcome.Damage, "Do you wish to assign damage for " + attacker.getLogName() + " as though it weren't blocked?", null, game)) {