From b92f1649486f24e336107bd0c68d96ff7206df10 Mon Sep 17 00:00:00 2001 From: ericnerdo Date: Sat, 14 May 2016 23:18:29 +0200 Subject: [PATCH] ZPM generation fixed. --- cicaprojekt/Game.java | 9 +++------ cicaprojekt/Scale.java | 5 +++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cicaprojekt/Game.java b/cicaprojekt/Game.java index ce52326..aeefed6 100644 --- a/cicaprojekt/Game.java +++ b/cicaprojekt/Game.java @@ -198,10 +198,7 @@ public class Game { } public void generateZPM() { - int temp = jaffa.getZPMCount() + oneill.getZPMCount(); - System.out.println(temp); if(((jaffa.getZPMCount() + oneill.getZPMCount()) % 2) == 0) { - System.out.println("cica"); Tile source = oneill.getCurrentTile(); Tile compare; for (int i = 0; i < dungeon.getMapHeight() * dungeon.getMapWidth(); i++) { @@ -210,12 +207,12 @@ public class Game { source = compare; } - while (!source.canHazZPM() && !source.hasZPM() && (source.playerBaseOnTile != null)) { + while (!source.canHazZPM()) { compare = source.getAdjacentTile(Direction.getRandom()); if (compare != null) - source = compare; + if(!compare.hasZPM() && (compare.playerBaseOnTile == null)) + source = compare; } - System.out.println(source.getX() + " " + source.getY()); source.setZPMOnTile(new ZPM()); } diff --git a/cicaprojekt/Scale.java b/cicaprojekt/Scale.java index 2a9a3ba..8f74d67 100644 --- a/cicaprojekt/Scale.java +++ b/cicaprojekt/Scale.java @@ -55,4 +55,9 @@ public class Scale extends Field { else gateConnected.setOpen(false); } + + @Override + public boolean canHazZPM() { + return false; + } }