diff --git a/Projektgruppe_175/src/game/players/BasicAI.java b/Projektgruppe_175/src/game/players/BasicAI.java index de989c7..918bb12 100644 --- a/Projektgruppe_175/src/game/players/BasicAI.java +++ b/Projektgruppe_175/src/game/players/BasicAI.java @@ -13,6 +13,8 @@ import game.Game; import game.map.Castle; import gui.AttackThread; +import gui.components.JokerPanel.JokerTypes; + public class BasicAI extends AI { public BasicAI(String name, Color color) { @@ -43,6 +45,24 @@ public class BasicAI extends AI { } } else { + // JOKER + if(getJokers()[0] == JokerTypes.ADD_TROOPS) { + playTroopsJoker(); + } + + // SCARE-JOKER + if(getJokers()[1] == JokerTypes.SCARE_TROOPS) { + for(Castle c : game.getMap().getCastles()) { + System.out.print(c.getName() + " " + c.getTroopCount() + " " + c.getOwner().getName()); + if(c.getOwner() != game.getCurrentPlayer() && c.getTroopCount() > 1) { + playScareJoker(c, game); + break; + } + } + } + + + // 1. Distribute remaining troops Graph graph = game.getMap().getGraph(); List castleNearEnemy = new ArrayList<>();