mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- Simplified removal of likely blockers in chooseCardsForConvoke()
This commit is contained in:
@@ -817,27 +817,21 @@ public class PlayerControllerAi extends PlayerController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Do not convoke potential blockers until after opponent's attack
|
//Do not convoke potential blockers until after opponent's attack
|
||||||
final List<Card> notBlocking = CardLists.filter(untappedCreats, new Predicate<Card>() {
|
final List<Card> blockers = ComputerUtilCard.getLikelyBlockers(ai, null);
|
||||||
@Override
|
|
||||||
public boolean apply(final Card c) {
|
|
||||||
return !ComputerUtilCard.doesSpecifiedCreatureBlock(ai, c);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
boolean nonBlockers = false;
|
|
||||||
if ((ph.isPlayerTurn(ai) && ph.getPhase().isAfter(PhaseType.COMBAT_BEGIN)) ||
|
if ((ph.isPlayerTurn(ai) && ph.getPhase().isAfter(PhaseType.COMBAT_BEGIN)) ||
|
||||||
(!ph.isPlayerTurn(ai) && ph.getPhase().isBefore(PhaseType.COMBAT_DECLARE_BLOCKERS))) {
|
(!ph.isPlayerTurn(ai) && ph.getPhase().isBefore(PhaseType.COMBAT_DECLARE_BLOCKERS))) {
|
||||||
nonBlockers = true;
|
untappedCreats.removeAll(blockers);
|
||||||
//Add threatened creatures
|
//Add threatened creatures
|
||||||
if (!ai.getGame().getStack().isEmpty()) {
|
if (!ai.getGame().getStack().isEmpty()) {
|
||||||
final List<GameObject> objects = ComputerUtil.predictThreatenedObjects(sa.getActivatingPlayer(), null);
|
final List<GameObject> objects = ComputerUtil.predictThreatenedObjects(sa.getActivatingPlayer(), null);
|
||||||
for (Card c : untappedCreats) {
|
for (Card c : blockers) {
|
||||||
if (objects.contains(c) && !notBlocking.contains(c)) {
|
if (objects.contains(c) && blockers.contains(c)) {
|
||||||
notBlocking.add(c);
|
untappedCreats.add(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ComputerUtilMana.getConvokeFromList(manaCost, nonBlockers ? notBlocking : untappedCreats);
|
return ComputerUtilMana.getConvokeFromList(manaCost, untappedCreats);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user