v2.2.0: the DM-300 fight now have a guaranteed safe path to each pylon

This commit is contained in:
Evan Debenham
2023-08-21 14:48:18 -04:00
parent 5dcf2f0176
commit d2b8bc5dab

View File

@@ -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;
} }