- 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);

View File

@@ -4,7 +4,7 @@ Types:Legendary Creature Elder Dragon
PT:6/6
K:Flying
T:Mode$ Attacks | ValidCard$ Card.Self | Execute$ TrigTarget | TriggerDescription$ Whenever CARDNAME attacks, for each player, choose target permanent that player controls. Those players sacrifice those permanents. Each player who sacrificed a permanent this way reveals the top card of their library, then puts it onto the battlefield if it's a permanent card.
SVar:TrigTarget:DB$ Pump | ValidTgts$ Permanent | TgtPrompt$ Select target permanent a players controls to be sacrificed. | TargetMin$ OneEach | TargetMax$ OneEach | References$ OneEach | TargetsWithDifferentControllers$ True | SubAbility$ DBSacrificeAll
SVar:TrigTarget:DB$ Pump | ValidTgts$ Permanent | TgtPrompt$ Select target permanent a player controls to be sacrificed. | TargetMin$ OneEach | TargetMax$ OneEach | References$ OneEach | TargetsWithDifferentControllers$ True | SubAbility$ DBSacrificeAll | AILogic$ SacOneEach
SVar:DBSacrificeAll:DB$ SacrificeAll | Defined$ Targeted | RememberSacrificed$ True | SubAbility$ DBRepeatEach
SVar:DBRepeatEach:DB$ RepeatEach | DefinedCards$ Remembered | UseImprinted$ True | RepeatSubAbility$ DBDig | SubAbility$ DBCleanup
SVar:DBDig:DB$ Dig | Defined$ ImprintedController | DigNum$ 1 | Reveal$ True | DestinationZone$ Battlefield | DestinationZone2$ Library | LibraryPosition2$ 0 | ChangeNum$ All | ChangeValid$ Permanent