ZPM generation fixed.
This commit is contained in:
parent
74a34e61ad
commit
b92f164948
@ -198,10 +198,7 @@ public class Game {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void generateZPM() {
|
public void generateZPM() {
|
||||||
int temp = jaffa.getZPMCount() + oneill.getZPMCount();
|
|
||||||
System.out.println(temp);
|
|
||||||
if(((jaffa.getZPMCount() + oneill.getZPMCount()) % 2) == 0) {
|
if(((jaffa.getZPMCount() + oneill.getZPMCount()) % 2) == 0) {
|
||||||
System.out.println("cica");
|
|
||||||
Tile source = oneill.getCurrentTile();
|
Tile source = oneill.getCurrentTile();
|
||||||
Tile compare;
|
Tile compare;
|
||||||
for (int i = 0; i < dungeon.getMapHeight() * dungeon.getMapWidth(); i++) {
|
for (int i = 0; i < dungeon.getMapHeight() * dungeon.getMapWidth(); i++) {
|
||||||
@ -210,12 +207,12 @@ public class Game {
|
|||||||
source = compare;
|
source = compare;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!source.canHazZPM() && !source.hasZPM() && (source.playerBaseOnTile != null)) {
|
while (!source.canHazZPM()) {
|
||||||
compare = source.getAdjacentTile(Direction.getRandom());
|
compare = source.getAdjacentTile(Direction.getRandom());
|
||||||
if (compare != null)
|
if (compare != null)
|
||||||
source = compare;
|
if(!compare.hasZPM() && (compare.playerBaseOnTile == null))
|
||||||
|
source = compare;
|
||||||
}
|
}
|
||||||
System.out.println(source.getX() + " " + source.getY());
|
|
||||||
|
|
||||||
source.setZPMOnTile(new ZPM());
|
source.setZPMOnTile(new ZPM());
|
||||||
}
|
}
|
||||||
|
@ -55,4 +55,9 @@ public class Scale extends Field {
|
|||||||
else
|
else
|
||||||
gateConnected.setOpen(false);
|
gateConnected.setOpen(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canHazZPM() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user