A ZPM is generated after every 2 picked up ZPMs.

This commit is contained in:
ericnerdo
2016-05-14 22:37:43 +02:00
parent 97622f7298
commit 68253e7a5b
4 changed files with 34 additions and 0 deletions

View File

@ -195,4 +195,28 @@ public class Game {
stopGame(GameoverCause.JAFFAWON);
}
}
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++) {
compare = source.getAdjacentTile(Direction.getRandom());
if (compare != null)
source = compare;
}
while (!source.canHazZPM() && !source.hasZPM() && (source.playerBaseOnTile != null)) {
compare = source.getAdjacentTile(Direction.getRandom());
if (compare != null)
source = compare;
}
System.out.println(source.getX() + " " + source.getY());
source.setZPMOnTile(new ZPM());
}
}
}