mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-12 00:38:44 +00:00
Update EffectAi.java
This commit is contained in:
@@ -414,11 +414,11 @@ public class EffectAi extends SpellAbilityAi {
|
|||||||
|
|
||||||
// TODO add more cases later
|
// TODO add more cases later
|
||||||
if (!cantAttack && !cantBlock && !cantActivate) {
|
if (!cantAttack && !cantBlock && !cantActivate) {
|
||||||
return false;
|
return new AiAbilityDecision(0, AiPlayDecision.CantPlayAi);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cantBlock && duraction == null && phase.isPlayerTurn(ai) && !phase.getPhase().isBefore(PhaseType.COMBAT_DECLARE_BLOCKERS)) {
|
if (cantBlock && duraction == null && phase.isPlayerTurn(ai) && !phase.getPhase().isBefore(PhaseType.COMBAT_DECLARE_BLOCKERS)) {
|
||||||
return false;
|
return new AiAbilityDecision(0, AiPlayDecision.CantPlayAi);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sa.usesTargeting()) {
|
if (sa.usesTargeting()) {
|
||||||
@@ -429,7 +429,7 @@ public class EffectAi extends SpellAbilityAi {
|
|||||||
list = ComputerUtil.filterAITgts(sa, ai, list, true);
|
list = ComputerUtil.filterAITgts(sa, ai, list, true);
|
||||||
|
|
||||||
if (list.isEmpty()) {
|
if (list.isEmpty()) {
|
||||||
return false;
|
return new AiAbilityDecision(0, AiPlayDecision.CantPlayAi);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Card> oppCreatures = CardLists.filterAsList(list, c -> {
|
List<Card> oppCreatures = CardLists.filterAsList(list, c -> {
|
||||||
@@ -443,7 +443,7 @@ public class EffectAi extends SpellAbilityAi {
|
|||||||
if (cantAttack || cantBlock) {
|
if (cantAttack || cantBlock) {
|
||||||
if (oppCreatures.isEmpty()) {
|
if (oppCreatures.isEmpty()) {
|
||||||
if (!cantActivate || oppWithAbilities.isEmpty()) {
|
if (!cantActivate || oppWithAbilities.isEmpty()) {
|
||||||
return false;
|
return new AiAbilityDecision(0, AiPlayDecision.CantPlayAi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -480,10 +480,10 @@ public class EffectAi extends SpellAbilityAi {
|
|||||||
if (choice == null) { // can't find anything left
|
if (choice == null) { // can't find anything left
|
||||||
if (!sa.isMinTargetChosen() || sa.isZeroTargets()) {
|
if (!sa.isMinTargetChosen() || sa.isZeroTargets()) {
|
||||||
sa.resetTargets();
|
sa.resetTargets();
|
||||||
return false;
|
return new AiAbilityDecision(0, AiPlayDecision.CantPlayAi);
|
||||||
} else {
|
} else {
|
||||||
if (!ComputerUtil.shouldCastLessThanMax(ai, sa.getHostCard())) {
|
if (!ComputerUtil.shouldCastLessThanMax(ai, sa.getHostCard())) {
|
||||||
return false;
|
return new AiAbilityDecision(0, AiPlayDecision.CantPlayAi);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -493,10 +493,10 @@ public class EffectAi extends SpellAbilityAi {
|
|||||||
oppCreatures.remove(choice);
|
oppCreatures.remove(choice);
|
||||||
sa.getTargets().add(choice);
|
sa.getTargets().add(choice);
|
||||||
}
|
}
|
||||||
return true;
|
return new AiAbilityDecision(100, AiPlayDecision.WillPlay);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return new AiAbilityDecision(0, AiPlayDecision.CantPlayAi);
|
||||||
} else { //no AILogic
|
} else { //no AILogic
|
||||||
return new AiAbilityDecision(0, AiPlayDecision.CantPlayAi);
|
return new AiAbilityDecision(0, AiPlayDecision.CantPlayAi);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user