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) { protected boolean canPlayAI(Player ai, SpellAbility sa) {
if (sa.hasParam("AILogic")) { if (sa.hasParam("AILogic")) {
String AILogic = sa.getParam("AILogic"); String AILogic = sa.getParam("AILogic");
if (AILogic.equals("Never")) { if (AILogic.equals("Never")) {
return false; return false;
} else if (AILogic.equals("PhaseOut")) { } else if (AILogic.equals("PhaseOut")) {
if (!ComputerUtil.predictThreatenedObjects(sa.getActivatingPlayer(), sa).contains(sa.getHostCard())) { if (!ComputerUtil.predictThreatenedObjects(sa.getActivatingPlayer(), sa).contains(sa.getHostCard())) {
return false; return false;
} }
} else if (AILogic.equals("KillOrcs")) { } else if (AILogic.equals("KillOrcs")) {
if (ai.getGame().getPhaseHandler().getPhase().isBefore(PhaseType.END_OF_TURN) ) { if (ai.getGame().getPhaseHandler().getPhase().isBefore(PhaseType.END_OF_TURN) ) {
return false; return false;
} }
sa.resetTargets(); sa.resetTargets();
for (Card c : ai.getOpponent().getCreaturesInPlay()) { for (Card c : ai.getOpponents().getCreaturesInPlay()) {
if (sa.canTarget(c)) { if (sa.canTarget(c)) {
sa.getTargets().add(c); sa.getTargets().add(c);
return true; return true;
} }
} }
return false; return false;
} }