- Fixed Vaevictis Asmadi, the Dire AI targeting logic.

This commit is contained in:
Agetian
2018-12-10 19:24:53 +03:00
parent 0be13468bc
commit dcd2fade4a
2 changed files with 16 additions and 1 deletions

View File

@@ -481,6 +481,21 @@ public class PumpAi extends PumpAiBase {
} else if (sa.getParam("AILogic").equals("DonateTargetPerm")) {
// Donate step 2 - target a donatable permanent.
return SpecialCardAi.Donate.considerDonatingPermanent(ai, sa);
} else if (sa.getParam("AILogic").equals("SacOneEach")) {
// each player sacrifices one permanent, e.g. Vaevictis, Asmadi the Dire - grab the worst for allied and
// the best for opponents
sa.resetTargets();
for (Player p : game.getPlayers()) {
CardCollection targetable = CardLists.filter(p.getCardsIn(ZoneType.Battlefield), CardPredicates.isTargetableBy(sa));
if (!targetable.isEmpty()) {
if (p.isOpponentOf(ai)) {
sa.getTargets().add(ComputerUtilCard.getBestAI(targetable));
} else {
sa.getTargets().add(ComputerUtilCard.getWorstAI(targetable));
}
}
}
return true;
}
if (isFight) {
return FightAi.canFightAi(ai, sa, attack, defense);