v1.2.0: fixed a bug with purity and adjusted some blob logic
This commit is contained in:
parent
f34c6f3471
commit
463c3a3781
|
@ -219,6 +219,10 @@ public class Blob extends Actor {
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -91,6 +91,16 @@ public class Web extends Blob {
|
|||
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");
|
||||
|
|
|
@ -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;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (Dungeon.level.heroFOV[i]) {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user