- Some improvements in ComputerUtilCombat regarding predicting attack clone effects and MustBeBlocked.

git-svn-id: http://svn.slightlymagic.net/forge/trunk@35710 269b9781-a132-4a9b-9d4e-f004f1b56b58
This commit is contained in:
Agetian 2017-09-22 09:04:47 +00:00
parent bb602eb5af
commit 851845fcf3

View File

@ -407,7 +407,11 @@ public class ComputerUtilCombat {
if (blockers.isEmpty()) {
if (!attacker.getSVar("MustBeBlocked").equals("")) {
return true;
boolean cond = !"attackingplayer".equalsIgnoreCase(attacker.getSVar("MustBeBlocked"))
|| combat.getDefenderByAttacker(attacker) instanceof Player;
if (cond) {
return true;
}
}
}
if (threateningCommanders.contains(attacker)) {
@ -2543,9 +2547,12 @@ public class ComputerUtilCombat {
if (exec != null) {
if (exec.getApi() == ApiType.Clone && "Self".equals(exec.getParam("CloneTarget"))
&& exec.hasParam("ValidTgts") && exec.getParam("ValidTgts").contains("Creature")
&& exec.getParam("ValidTgts").contains("+attacking")) {
&& exec.getParam("ValidTgts").contains("attacking")) {
// Tilonalli's Skinshifter and potentially other similar cards that can clone other stuff
// while attacking
if (exec.getParam("ValidTgts").contains("nonLegendary") && attacker.getType().isLegendary()) {
continue;
}
int maxPwr = 0;
for (Card c : attacker.getController().getCreaturesInPlay()) {
if (c.getNetPower() > maxPwr || (c.getNetPower() == maxPwr && ComputerUtilCard.evaluateCreature(c) > ComputerUtilCard.evaluateCreature(attackerAfterTrigs))) {