FlipACoinAi: format and remove getOpponent

This commit is contained in:
Hanmac
2017-04-01 14:57:50 +00:00
parent b4438cebf8
commit a2579834cd

View File

@@ -16,23 +16,23 @@ public class FlipACoinAi extends SpellAbilityAi {
protected boolean canPlayAI(Player ai, SpellAbility sa) {
if (sa.hasParam("AILogic")) {
String AILogic = sa.getParam("AILogic");
String AILogic = sa.getParam("AILogic");
if (AILogic.equals("Never")) {
return false;
} else if (AILogic.equals("PhaseOut")) {
if (!ComputerUtil.predictThreatenedObjects(sa.getActivatingPlayer(), sa).contains(sa.getHostCard())) {
return false;
return false;
}
} else if (AILogic.equals("KillOrcs")) {
if (ai.getGame().getPhaseHandler().getPhase().isBefore(PhaseType.END_OF_TURN) ) {
return false;
return false;
}
sa.resetTargets();
for (Card c : ai.getOpponent().getCreaturesInPlay()) {
if (sa.canTarget(c)) {
sa.getTargets().add(c);
return true;
}
for (Card c : ai.getOpponents().getCreaturesInPlay()) {
if (sa.canTarget(c)) {
sa.getTargets().add(c);
return true;
}
}
return false;
}