mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-14 17:58:01 +00:00
Fix AI not playing Sky Swallower trigger
This commit is contained in:
@@ -272,7 +272,16 @@ public class ControlGainAi extends SpellAbilityAi {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else {
|
} 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);
|
List<Card> list = CardLists.getTargetableCards(ai.getCardsIn(ZoneType.Battlefield), sa);
|
||||||
if (list.isEmpty()) {
|
if (list.isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public class AddPhaseEffect extends SpellAbilityEffect {
|
|||||||
extraPhaseList.addAll(PhaseType.PHASE_GROUPS.get(0));
|
extraPhaseList.addAll(PhaseType.PHASE_GROUPS.get(0));
|
||||||
} else if (extra.equals("Combat")) {
|
} else if (extra.equals("Combat")) {
|
||||||
extraPhaseList.addAll(PhaseType.PHASE_GROUPS.get(2));
|
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));
|
extraPhaseList.add(PhaseType.smartValueOf(extra));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user