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) {
|
if(((jaffa.getZPMCount() + oneill.getZPMCount()) % 2) == 0) {
|
||||||
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(); i++) {
|
||||||
compare = source.getAdjacentTile(Direction.getRandom());
|
compare = source.getAdjacentTile(Direction.getRandom());
|
||||||
if (compare != null)
|
if (compare != null)
|
||||||
source = compare;
|
source = compare;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!source.canHazZPM()) {
|
while (!source.canHazZPM()) {
|
||||||
compare = source.getAdjacentTile(Direction.getRandom());
|
int j = 0;
|
||||||
if (compare != null)
|
|
||||||
if(!compare.hasZPM() && (compare.playerBaseOnTile == null))
|
for (int i = 0; i < dungeon.getMapHeight(); i++) {
|
||||||
|
compare = source.getAdjacentTile(Direction.getRandom());
|
||||||
|
if (compare != null)
|
||||||
source = compare;
|
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());
|
source.setZPMOnTile(new ZPM());
|
||||||
|
Loading…
Reference in New Issue
Block a user