- A little improvement to the previous commit.

git-svn-id: http://svn.slightlymagic.net/forge/trunk@35708 269b9781-a132-4a9b-9d4e-f004f1b56b58
This commit is contained in:
Agetian 2017-09-22 05:55:17 +00:00
parent 75b2097313
commit 491d7b8dcd

View File

@ -2533,6 +2533,7 @@ public class ComputerUtilCombat {
// (currently looks for the creature with maximum raw power since that's what the AI usually judges by when // (currently looks for the creature with maximum raw power since that's what the AI usually judges by when
// deciding whether the creature is worth blocking). // deciding whether the creature is worth blocking).
// If the creature doesn't change into anything, returns the original creature. // If the creature doesn't change into anything, returns the original creature.
if (attacker == null) { return null; }
Card attackerAfterTrigs = attacker; Card attackerAfterTrigs = attacker;
// Test for some special triggers that can change the creature in combat // Test for some special triggers that can change the creature in combat
@ -2547,7 +2548,7 @@ public class ComputerUtilCombat {
// while attacking // while attacking
int maxPwr = 0; int maxPwr = 0;
for (Card c : attacker.getController().getCreaturesInPlay()) { for (Card c : attacker.getController().getCreaturesInPlay()) {
if (c.getNetPower() > maxPwr) { if (c.getNetPower() > maxPwr || (c.getNetPower() == maxPwr && ComputerUtilCard.evaluateCreature(c) > ComputerUtilCard.evaluateCreature(attackerAfterTrigs))) {
maxPwr = c.getNetPower(); maxPwr = c.getNetPower();
attackerAfterTrigs = c; attackerAfterTrigs = c;
} }