Tested and now it works, unfortunately it's not as smart as I originally wanted, but it'll do.

This commit is contained in:
Seravy
2018-02-11 18:34:33 +01:00
parent 3662bb8e84
commit 15715cec10

View File

@@ -1092,18 +1092,12 @@ public class AiAttackController {
// Check if the card actually has an ability the AI can and wants to play, if not, attacking is fine! // Check if the card actually has an ability the AI can and wants to play, if not, attacking is fine!
boolean wantability = false; boolean wantability = false;
for (SpellAbility sa : attacker.getSpellAbilities()) { for (SpellAbility sa : attacker.getSpellAbilities()) {
// Do not attack if we can afford using the ability.
if (sa.isAbility()) { if (sa.isAbility()) {
if (ai.getController().isAI()) { if (ComputerUtilCost.canPayCost(sa, ai)) {
AiPlayDecision canplay = ((PlayerControllerAi) ai.getController()).getAi().canPlaySa(sa); return false;
switch (canplay) {
case WillPlay:
case WaitForMain2:
case AnotherTime:
// Might be an ability that requires a target not present right now, like Ertai, Wizard Adept
case TargetingFailed:
return false;
}
} }
// TODO Eventually The Ai will need to learn to predict if they have any use for the ability before next untap or not.
} }
} }
} }