mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-12 08:48:39 +00:00
- Fix AI not ordering combatants for damage in non-legacy mode.
This commit is contained in:
@@ -492,7 +492,7 @@ public class Combat {
|
|||||||
|
|
||||||
/** If there are multiple blockers, the Attacker declares the Assignment Order */
|
/** If there are multiple blockers, the Attacker declares the Assignment Order */
|
||||||
public void orderBlockersForDamageAssignment(Card attacker, CardCollection blockers) { // this method performs controller's role
|
public void orderBlockersForDamageAssignment(Card attacker, CardCollection blockers) { // this method performs controller's role
|
||||||
if (blockers.size() <= 1 || !this.legacyOrderCombatants) {
|
if (blockers.size() <= 1 || (!this.legacyOrderCombatants && !playerWhoAttacks.isAI())) {
|
||||||
blockersOrderedForDamageAssignment.get().put(attacker, new CardCollection(blockers));
|
blockersOrderedForDamageAssignment.get().put(attacker, new CardCollection(blockers));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -529,7 +529,7 @@ public class Combat {
|
|||||||
final CardCollection oldBlockers = blockersOrderedForDamageAssignment.get().get(attacker);
|
final CardCollection oldBlockers = blockersOrderedForDamageAssignment.get().get(attacker);
|
||||||
if (oldBlockers == null || oldBlockers.isEmpty()) {
|
if (oldBlockers == null || oldBlockers.isEmpty()) {
|
||||||
blockersOrderedForDamageAssignment.get().put(attacker, new CardCollection(blocker));
|
blockersOrderedForDamageAssignment.get().put(attacker, new CardCollection(blocker));
|
||||||
} else if (this.legacyOrderCombatants) {
|
} else if (this.legacyOrderCombatants || playerWhoAttacks.isAI()) {
|
||||||
CardCollection orderedBlockers = playerWhoAttacks.getController().orderBlocker(attacker, blocker, oldBlockers);
|
CardCollection orderedBlockers = playerWhoAttacks.getController().orderBlocker(attacker, blocker, oldBlockers);
|
||||||
blockersOrderedForDamageAssignment.get().put(attacker, orderedBlockers);
|
blockersOrderedForDamageAssignment.get().put(attacker, orderedBlockers);
|
||||||
} else {
|
} else {
|
||||||
@@ -550,7 +550,7 @@ public class Combat {
|
|||||||
// They need a reverse map here: Blocker => List<Attacker>
|
// They need a reverse map here: Blocker => List<Attacker>
|
||||||
|
|
||||||
Player blockerCtrl = blocker.getController();
|
Player blockerCtrl = blocker.getController();
|
||||||
CardCollection orderedAttacker = attackers.size() <= 1 || !this.legacyOrderCombatants ? attackers : blockerCtrl.getController().orderAttackers(blocker, attackers);
|
CardCollection orderedAttacker = attackers.size() <= 1 || (!this.legacyOrderCombatants && !blockerCtrl.getController().isAI()) ? attackers : blockerCtrl.getController().orderAttackers(blocker, attackers);
|
||||||
|
|
||||||
// Damage Ordering needs to take cards like Melee into account, is that happening?
|
// Damage Ordering needs to take cards like Melee into account, is that happening?
|
||||||
attackersOrderedForDamageAssignment.get().put(blocker, orderedAttacker);
|
attackersOrderedForDamageAssignment.get().put(blocker, orderedAttacker);
|
||||||
|
|||||||
Reference in New Issue
Block a user