From 73f81361a085be7e8598f53c58958c1c10d025fe Mon Sep 17 00:00:00 2001 From: Sloth Date: Wed, 15 May 2013 17:15:35 +0000 Subject: [PATCH] - Added a default logic to ProtectionEffect AI. --- .../card/ability/effects/ProtectEffect.java | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/main/java/forge/card/ability/effects/ProtectEffect.java b/src/main/java/forge/card/ability/effects/ProtectEffect.java index 17fe860dfb1..98e5a385b95 100644 --- a/src/main/java/forge/card/ability/effects/ProtectEffect.java +++ b/src/main/java/forge/card/ability/effects/ProtectEffect.java @@ -113,19 +113,17 @@ public class ProtectEffect extends SpellAbilityEffect { } else { Player ai = sa.getActivatingPlayer(); String choice = choices.get(0); - if (sa.hasParam("AILogic")) { - final String logic = sa.getParam("AILogic"); - if (logic.equals("MostProminentHumanCreatures")) { - List list = new ArrayList(); - for (Player opp : ai.getOpponents()) { - list.addAll(opp.getCreaturesInPlay()); - } - if (list.isEmpty()) { - list = CardLists.filterControlledBy(game.getCardsInGame(), ai.getOpponents()); - } - if (!list.isEmpty()) { - choice = ComputerUtilCard.getMostProminentColor(list); - } + final String logic = sa.getParam("AILogic"); + if (logic == null || logic.equals("MostProminentHumanCreatures")) { + List list = new ArrayList(); + for (Player opp : ai.getOpponents()) { + list.addAll(opp.getCreaturesInPlay()); + } + if (list.isEmpty()) { + list = CardLists.filterControlledBy(game.getCardsInGame(), ai.getOpponents()); + } + if (!list.isEmpty()) { + choice = ComputerUtilCard.getMostProminentColor(list); } } gains.add(choice);