Fix zone choosing when searching

This commit is contained in:
tool4EvEr
2022-11-28 09:08:09 +01:00
parent b64f20d0a7
commit cfc92a54f0
3 changed files with 17 additions and 6 deletions

View File

@@ -216,8 +216,9 @@ public class EffectAi extends SpellAbilityAi {
} else if (logic.equals("Fight")) {
return FightAi.canFightAi(ai, sa, 0, 0);
} else if (logic.equals("Pump")) {
List<Card> options = ai.getCreaturesInPlay();
if (phase.isPlayerTurn(ai) && phase.getPhase().isBefore(PhaseType.COMBAT_DECLARE_BLOCKERS) && !options.isEmpty()) {
CardCollection options = CardLists.getValidCards(ai.getCardsIn(ZoneType.Battlefield), sa.getTargetRestrictions().getValidTgts(), ai, sa.getHostCard(), sa);
options = CardLists.getTargetableCards(options, sa);
if (!options.isEmpty() && phase.isPlayerTurn(ai) && phase.getPhase().isBefore(PhaseType.COMBAT_DECLARE_BLOCKERS)) {
sa.getTargets().add(ComputerUtilCard.getBestCreatureAI(options));
return true;
}
@@ -239,8 +240,7 @@ public class EffectAi extends SpellAbilityAi {
}
return true;
} else if (logic.equals("ReplaySpell")) {
CardCollection list = new CardCollection(game.getCardsIn(ZoneType.Graveyard));
list = CardLists.getValidCards(list, sa.getTargetRestrictions().getValidTgts(), ai, sa.getHostCard(), sa);
CardCollection list = CardLists.getValidCards(game.getCardsIn(ZoneType.Graveyard), sa.getTargetRestrictions().getValidTgts(), ai, sa.getHostCard(), sa);
if (!ComputerUtil.targetPlayableSpellCard(ai, list, sa, false, false)) {
return false;
}