GenerateZPM fixed, now it doesn't reach infinite purrs.
This commit is contained in:
parent
4054d4a728
commit
e16aa6824a
@ -219,17 +219,30 @@ public class Game {
|
||||
if(((jaffa.getZPMCount() + oneill.getZPMCount()) % 2) == 0) {
|
||||
Tile source = oneill.getCurrentTile();
|
||||
Tile compare;
|
||||
for (int i = 0; i < dungeon.getMapHeight() * dungeon.getMapWidth(); i++) {
|
||||
|
||||
|
||||
for (int i = 0; i < dungeon.getMapHeight(); i++) {
|
||||
compare = source.getAdjacentTile(Direction.getRandom());
|
||||
if (compare != null)
|
||||
source = compare;
|
||||
}
|
||||
|
||||
while (!source.canHazZPM()) {
|
||||
compare = source.getAdjacentTile(Direction.getRandom());
|
||||
if (compare != null)
|
||||
if(!compare.hasZPM() && (compare.playerBaseOnTile == null))
|
||||
int j = 0;
|
||||
|
||||
for (int i = 0; i < dungeon.getMapHeight(); i++) {
|
||||
compare = source.getAdjacentTile(Direction.getRandom());
|
||||
if (compare != null)
|
||||
source = compare;
|
||||
}
|
||||
|
||||
while(j != 20) {
|
||||
compare = source.getAdjacentTile(Direction.getRandom());
|
||||
if (compare != null)
|
||||
if (!compare.hasZPM() && (compare.playerBaseOnTile == null))
|
||||
source = compare;
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
source.setZPMOnTile(new ZPM());
|
||||
|
Loading…
Reference in New Issue
Block a user