Butcher Orgg!!!

This commit is contained in:
Tim Mocny
2020-12-30 02:35:25 +00:00
committed by Sol
parent 136c99377d
commit f700b9d43b
12 changed files with 87 additions and 21 deletions

View File

@@ -74,6 +74,7 @@ public class VAssignCombatDamage {
private final int totalDamageToAssign;
private boolean attackerHasDeathtouch = false;
private boolean attackerHasDivideDamage = false;
private boolean attackerHasTrample = false;
private boolean attackerHasInfect = false;
private boolean overrideCombatantOrder = false;
@@ -152,6 +153,7 @@ public class VAssignCombatDamage {
attackerHasDeathtouch = attacker.getCurrentState().hasDeathtouch();
attackerHasInfect = attacker.getCurrentState().hasInfect();
attackerHasTrample = defender != null && attacker.getCurrentState().hasTrample();
attackerHasDivideDamage = attacker.getCurrentState().hasDivideDamage();
overrideCombatantOrder = overrideOrder;
// Top-level UI stuff
@@ -173,7 +175,7 @@ public class VAssignCombatDamage {
// Defenders area
final JPanel pnlDefenders = new JPanel();
pnlDefenders.setOpaque(false);
int cols = attackerHasTrample ? blockers.size() + 1 : blockers.size();
int cols = ((attackerHasTrample) || (attackerHasDivideDamage && overrideCombatantOrder)) ? blockers.size() + 1 : blockers.size();
final String wrap = "wrap " + cols;
pnlDefenders.setLayout(new MigLayout("insets 0, gap 0, ax center, " + wrap));
@@ -187,7 +189,7 @@ public class VAssignCombatDamage {
addPanelForDefender(pnlDefenders, c);
}
if (attackerHasTrample) {
if ((attackerHasTrample) || (attackerHasDivideDamage && overrideCombatantOrder)) {
final DamageTarget dt = new DamageTarget(null, new FLabel.Builder().text("0").fontSize(18).fontAlign(SwingConstants.CENTER).build());
damage.put(null, dt);
defenders.add(dt);
@@ -275,10 +277,12 @@ public class VAssignCombatDamage {
source = null;
// If trying to assign to the defender, follow the normal assignment rules
// No need to check for "active" creature assignee when overiding combatant order
if ((source == null || source == defender || !overrideCombatantOrder) && isAdding &&
!VAssignCombatDamage.this.canAssignTo(source)) {
return;
// No need to check for "active" creature assignee when overriding combatant order
if (!attackerHasDivideDamage) { // Creatures with this can assign to defender
if ((source == null || source == defender || !overrideCombatantOrder) && isAdding &&
!VAssignCombatDamage.this.canAssignTo(source)) {
return;
}
}
// If lethal damage has already been assigned just act like it's 0.
@@ -316,6 +320,9 @@ public class VAssignCombatDamage {
}
private void checkDamageQueue() {
if (overrideCombatantOrder && attackerHasDivideDamage) {
return;
}
// Clear out any Damage that shouldn't be assigned to other combatants
boolean hasAliveEnemy = false;
for(DamageTarget dt : defenders) {