Merging 1.9.1 source: level changes

Differences:
- Altar room turned off for now
- Keep the guaranteed transmutation well
This commit is contained in:
Evan Debenham
2015-11-09 15:23:22 -05:00
committed by Evan Debenham
parent d894c7297f
commit 648246641a
12 changed files with 109 additions and 18 deletions
@@ -615,13 +615,7 @@ public abstract class Level implements Bundlable {
for (int i=WIDTH; i < LENGTH - WIDTH; i++) {
if (water[i]) {
int t = Terrain.WATER_TILES;
for (int j=0; j < NEIGHBOURS4.length; j++) {
if ((Terrain.flags[map[i + NEIGHBOURS4[j]]] & Terrain.UNSTITCHABLE) != 0) {
t += 1 << j;
}
}
map[i] = t;
map[i] = getWaterTile( i );
}
if (pit[i]) {
@@ -640,7 +634,38 @@ public abstract class Level implements Bundlable {
}
}
}
private int getWaterTile( int pos ) {
int t = Terrain.WATER_TILES;
for (int j=0; j < NEIGHBOURS4.length; j++) {
if ((Terrain.flags[map[pos + NEIGHBOURS4[j]]] & Terrain.UNSTITCHABLE) != 0) {
t += 1 << j;
}
}
return t;
}
public void destroy( int pos ) {
if ((Terrain.flags[map[pos]] & Terrain.UNSTITCHABLE) == 0) {
set( pos, Terrain.EMBERS );
} else {
boolean flood = false;
for (int j=0; j < NEIGHBOURS4.length; j++) {
if (water[pos + NEIGHBOURS4[j]]) {
flood = true;
break;
}
}
if (flood) {
set( pos, getWaterTile( pos ) );
} else {
set( pos, Terrain.EMBERS );
}
}
}
protected void cleanWalls() {
for (int i=0; i < LENGTH; i++) {