Fix AI not playing Sky Swallower trigger

This commit is contained in:
tool4EvEr
2021-11-20 13:01:52 +01:00
parent 87dc410bd5
commit d8cceefe39
2 changed files with 11 additions and 2 deletions

View File

@@ -272,7 +272,16 @@ public class ControlGainAi extends SpellAbilityAi {
return true;
}
} else {
if(sa.hasParam("TargetingPlayer") || (!this.canPlayAI(ai, sa) && mandatory)) {
if (sa.hasParam("TargetingPlayer") || (!this.canPlayAI(ai, sa) && mandatory)) {
if (sa.getTargetRestrictions().canOnlyTgtOpponent()) {
List<Player> oppList = ai.getOpponents().filter(PlayerPredicates.isTargetableBy(sa));
if (oppList.isEmpty()) {
return false;
}
sa.getTargets().add(Aggregates.random(oppList));
return true;
}
List<Card> list = CardLists.getTargetableCards(ai.getCardsIn(ZoneType.Battlefield), sa);
if (list.isEmpty()) {
return false;

View File

@@ -49,7 +49,7 @@ public class AddPhaseEffect extends SpellAbilityEffect {
extraPhaseList.addAll(PhaseType.PHASE_GROUPS.get(0));
} else if (extra.equals("Combat")) {
extraPhaseList.addAll(PhaseType.PHASE_GROUPS.get(2));
} else { // Currently no effect will add End Phase
} else { // Currently no effect will add End Phase
extraPhaseList.add(PhaseType.smartValueOf(extra));
}