A ZPM is generated after every 2 picked up ZPMs.
This commit is contained in:
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user