Fixed Butcher Orgg handling attackers/blockers leaving combat

This commit is contained in:
Zzooouhh 2017-12-07 01:04:31 +01:00 committed by GitHub
parent e1fdc3093a
commit d8daec11d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -244,7 +244,7 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
} }
private void butcherOrggDamage(Permanent attacker, Player player, boolean first, Game game, boolean isAttacking) { private void butcherOrggDamage(Permanent attacker, Player player, boolean first, Game game, boolean isAttacking) {
if (!(blocked && blockers.isEmpty()) && (!first || hasFirstOrDoubleStrike(game))) { if (!((blocked && blockers.isEmpty() && isAttacking) || (attackers.isEmpty() && !isAttacking)) && (!first || hasFirstOrDoubleStrike(game))) {
if (attacker == null) { if (attacker == null) {
return; return;
} }
@ -806,9 +806,12 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
// for handling Butcher Orgg // for handling Butcher Orgg
if (creature.getAbilities().containsKey(ControllerDivideCombatDamageAbility.getInstance().getId())) { if (creature.getAbilities().containsKey(ControllerDivideCombatDamageAbility.getInstance().getId())) {
Player player = game.getPlayer(defenderControlsDefensiveFormation(game) ? defendingPlayerId : playerId); Player player = game.getPlayer(defenderControlsDefensiveFormation(game) ? defendingPlayerId : playerId);
if (player.chooseUse(Outcome.Damage, "Do you wish to divide " + creature.getLogName() + "'s combat damage among defending player and/or any number of defending creatures?", null, game)) { // 10/4/2004 If it is blocked but then all of its blockers are removed before combat damage is assigned, then it wont be able to deal combat damage and you wont be able to use its ability.
butcherOrggDamage(creature, player, first, game, isAttacking); if (!((blocked && blockers.isEmpty() && isAttacking) || (attackers.isEmpty() && !isAttacking))) {
return true; if (player.chooseUse(Outcome.Damage, "Do you wish to divide " + creature.getLogName() + "'s combat damage among defending player and/or any number of defending creatures?", null, game)) {
butcherOrggDamage(creature, player, first, game, isAttacking);
return true;
}
} }
} }
return false; return false;