- Support detecting blocking threatened creatures in AILogic$ MoveCounter.

This commit is contained in:
Agetian
2018-12-06 08:03:00 +03:00
parent e8ebfebaca
commit 7f7a033f12
2 changed files with 3 additions and 3 deletions

View File

@@ -1012,7 +1012,7 @@ public class CountersPutAi extends SpellAbilityAi {
final int creatDiff = sa.getParam("AILogic").contains("IsCounterUser") ? 450 : 1;
final Combat combat = ai.getGame().getCombat();
final boolean threatened = ComputerUtil.predictThreatenedObjects(ai, null, true).contains(sa.getHostCard())
|| (combat != null && combat.isBlocked(sa.getHostCard()) && ComputerUtilCombat.attackerWouldBeDestroyed(ai, sa.getHostCard(), combat));
|| (combat != null && ((combat.isBlocked(sa.getHostCard()) && ComputerUtilCombat.attackerWouldBeDestroyed(ai, sa.getHostCard(), combat)) || (combat.isBlocking(sa.getHostCard()) && ComputerUtilCombat.blockerWouldBeDestroyed(ai, sa.getHostCard(), combat))));
if (!(threatened || (ph.is(PhaseType.END_OF_TURN) && ph.getNextTurn() == ai))) {
return false;
@@ -1024,7 +1024,7 @@ public class CountersPutAi extends SpellAbilityAi {
targets = CardLists.filter(targets, new Predicate<Card>() {
@Override
public boolean apply(Card card) {
boolean tgtThreatened = ComputerUtil.predictThreatenedObjects(ai, null, true).contains(card) || (combat != null && combat.isBlocked(card) && ComputerUtilCombat.attackerWouldBeDestroyed(ai, card, combat));
boolean tgtThreatened = ComputerUtil.predictThreatenedObjects(ai, null, true).contains(card) || (combat != null && ((combat.isBlocked(card) && ComputerUtilCombat.attackerWouldBeDestroyed(ai, card, combat)) || (combat.isBlocking(card) && ComputerUtilCombat.blockerWouldBeDestroyed(ai, card, combat))));
// when threatened, any non-threatened target is good to preserve the counter
return !tgtThreatened && (threatened || ComputerUtilCard.evaluateCreature(card, false, false) > ComputerUtilCard.evaluateCreature(sa.getHostCard(), false, false) + creatDiff);
}