mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- AiController: a more robust check for potential targets in order to avoid the AI activating an ability it can't legally target due to restrictions (e.g. Wicked Akuba).
This commit is contained in:
@@ -662,6 +662,11 @@ public class AiController {
|
|||||||
if (sa instanceof SpellPermanent) {
|
if (sa instanceof SpellPermanent) {
|
||||||
return canPlayFromEffectAI((SpellPermanent)sa, false, true);
|
return canPlayFromEffectAI((SpellPermanent)sa, false, true);
|
||||||
}
|
}
|
||||||
|
if (sa.usesTargeting()) {
|
||||||
|
if (!sa.getTargetRestrictions().hasCandidates(sa, true)) {
|
||||||
|
return AiPlayDecision.TargetingFailed;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (sa instanceof Spell) {
|
if (sa instanceof Spell) {
|
||||||
if (ComputerUtil.getDamageForPlaying(player, sa) >= player.getLife()
|
if (ComputerUtil.getDamageForPlaying(player, sa) >= player.getLife()
|
||||||
&& !player.cantLoseForZeroOrLessLife() && player.canLoseLife()) {
|
&& !player.cantLoseForZeroOrLessLife() && player.canLoseLife()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user