v3.1.0: sewer barrels can now break or burn

This commit is contained in:
Evan Debenham
2025-05-20 15:30:49 -04:00
parent 15fe48d785
commit 5048fa8615
2 changed files with 33 additions and 2 deletions

View File

@@ -930,6 +930,12 @@ public abstract class Level implements Bundlable {
level.pit[cell] = (flags & Terrain.PIT) != 0;
level.water[cell] = terrain == Terrain.WATER;
if (level instanceof SewerLevel){
if (level.map[cell] == Terrain.REGION_DECO || level.map[cell] == Terrain.REGION_DECO_ALT){
level.flamable[cell] = true;
}
}
for (int i : PathFinder.NEIGHBOURS9){
i = cell + i;
if (level.solid[i]){

View File

@@ -29,6 +29,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Statistics;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost;
import com.shatteredpixel.shatteredpixeldungeon.effects.Ripple;
import com.shatteredpixel.shatteredpixeldungeon.effects.Splash;
import com.shatteredpixel.shatteredpixeldungeon.items.Amulet;
import com.shatteredpixel.shatteredpixeldungeon.levels.features.LevelTransition;
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
@@ -182,6 +183,30 @@ public class SewerLevel extends RegularLevel {
return visuals;
}
@Override
public void buildFlagMaps() {
super.buildFlagMaps();
for (int i=0; i < length(); i++) {
if (map[i] == Terrain.REGION_DECO || map[i] == Terrain.REGION_DECO_ALT){
flamable[i] = true;
}
}
}
@Override
public void destroy(int pos) {
//if we're burning sewers barrels
int terr = map[pos];
if (terr == Terrain.REGION_DECO){
set(pos, Terrain.WATER);
Splash.at(pos, 0xFF507B5D, 10);
} else if (terr == Terrain.REGION_DECO_ALT){
set(pos, Terrain.EMPTY_SP);
Splash.at(pos, 0xFF507B5D, 10);
}
super.destroy(pos);
}
public static void addSewerVisuals(Level level, Group group ) {
for (int i=0; i < level.length(); i++) {
if (level.map[i] == Terrain.WALL_DECO) {