v1.2.0: fixed a bug with purity and adjusted some blob logic

This commit is contained in:
Evan Debenham 2022-03-08 16:03:36 -05:00
parent f34c6f3471
commit 463c3a3781
4 changed files with 19 additions and 18 deletions

View File

@ -218,6 +218,10 @@ public class Blob extends Actor {
cur = new int[Dungeon.level.length()];
off = new int[Dungeon.level.length()];
}
public void onBuildFlagMaps( Level l ){
//do nothing by default, only some blobs affect flags
}
public String tileDesc() {
return null;

View File

@ -90,7 +90,17 @@ public class Web extends Blob {
super.fullyClear();
Dungeon.level.buildFlagMaps();
}
@Override
public void onBuildFlagMaps(Level l) {
if (volume > 0){
for (int i=0; i < l.length(); i++) {
l.solid[i] = l.solid[i] || cur[i] > 0;
l.flamable[i] = l.flamable[i] || cur[i] > 0;
}
}
}
@Override
public String tileDesc() {
return Messages.get(this, "desc");

View File

@ -67,16 +67,7 @@ public class PotionOfPurity extends Potion {
if (PathFinder.distance[i] < Integer.MAX_VALUE) {
for (Blob blob : blobs) {
int value = blob.cur[i];
if (value > 0) {
blob.clear(i);
blob.cur[i] = 0;
blob.volume -= value;
}
blob.clear(i);
}
if (Dungeon.level.heroFOV[i]) {

View File

@ -657,12 +657,8 @@ public abstract class Level implements Bundlable {
pit[i] = (flags & Terrain.PIT) != 0;
}
Web w = (Web) blobs.get(Web.class);
if (w != null && w.volume > 0){
for (int i=0; i < length(); i++) {
solid[i] = solid[i] || w.cur[i] > 0;
flamable[i] = flamable[i] || w.cur[i] > 0;
}
for (Blob b : blobs.values()){
b.onBuildFlagMaps(this);
}
int lastRow = length() - width();
@ -680,7 +676,7 @@ public abstract class Level implements Bundlable {
}
//an open space is large enough to fit large mobs. A space is open when it is not solid
// and there is and open corner with both adjacent cells opens
// and there is an open corner with both adjacent cells opens
for (int i=0; i < length(); i++) {
if (solid[i]){
openSpace[i] = false;