v2.2.0: the DM-300 fight now have a guaranteed safe path to each pylon
This commit is contained in:
@@ -168,6 +168,17 @@ public class CavesBossLevel extends Level {
|
|||||||
customVisuals.setRect(0, 12, width(), 27);
|
customVisuals.setRect(0, 12, width(), 27);
|
||||||
customTiles.add(customVisuals);
|
customTiles.add(customVisuals);
|
||||||
|
|
||||||
|
//ensures that all pylons can be reached without stepping over water or wires
|
||||||
|
boolean[] pass = new boolean[length];
|
||||||
|
for (int i = 0; i < length; i++){
|
||||||
|
pass[i] = map[i] == Terrain.EMPTY || map[i] == Terrain.EMPTY_SP || map[i] == Terrain.EMPTY_DECO;
|
||||||
|
}
|
||||||
|
PathFinder.buildDistanceMap(16 + 25*width(), pass);
|
||||||
|
for (int i : pylonPositions){
|
||||||
|
if (PathFinder.distance[i] == Integer.MAX_VALUE){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user