diff --git a/cicaprojekt/Game.java b/cicaprojekt/Game.java index 0890761..11b3087 100644 --- a/cicaprojekt/Game.java +++ b/cicaprojekt/Game.java @@ -102,6 +102,11 @@ public class Game { new ImageIcon("Deal_with_iit.png")); Application.frameInstance.backToMapSelection(); break; + case DRAW: + JOptionPane.showMessageDialog(null, "Draw! While O'Neill and the Jaffa struggled against eachother, Anubis has enslaved the world.", + "Game over", + JOptionPane.INFORMATION_MESSAGE, + new ImageIcon("Anubis.png")); } display.stopMusic(); @@ -170,6 +175,15 @@ public class Game { private void checkZPMStatus() { + if (oneill.getZPMCount() + jaffa.getZPMCount() >= dungeon.getZPMsToWin()) { + if (oneill.getZPMCount() > jaffa.getZPMCount()) + stopGame(GameoverCause.ONEILLWON); + else if (oneill.getZPMCount() < jaffa.getZPMCount()) + stopGame(GameoverCause.JAFFAWON); + else + stopGame(GameoverCause.DRAW); + } + if (oneill.getZPMCount() >= dungeon.getZPMsToWin()) { flowoftime.stopTime(); diff --git a/cicaprojekt/GameoverCause.java b/cicaprojekt/GameoverCause.java index a6fe1e1..766921d 100644 --- a/cicaprojekt/GameoverCause.java +++ b/cicaprojekt/GameoverCause.java @@ -1,5 +1,5 @@ package cicaprojekt; public enum GameoverCause { - TIMEOUT, ONEILLWON, JAFFAWON + TIMEOUT, ONEILLWON, JAFFAWON, DRAW }