v3.1.0: sewer barrels can now break or burn
This commit is contained in:
@@ -930,6 +930,12 @@ public abstract class Level implements Bundlable {
|
|||||||
level.pit[cell] = (flags & Terrain.PIT) != 0;
|
level.pit[cell] = (flags & Terrain.PIT) != 0;
|
||||||
level.water[cell] = terrain == Terrain.WATER;
|
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){
|
for (int i : PathFinder.NEIGHBOURS9){
|
||||||
i = cell + i;
|
i = cell + i;
|
||||||
if (level.solid[i]){
|
if (level.solid[i]){
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
|||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Ghost;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Ripple;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Ripple;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Splash;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Amulet;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Amulet;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.features.LevelTransition;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.features.LevelTransition;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||||
@@ -181,8 +182,32 @@ public class SewerLevel extends RegularLevel {
|
|||||||
addSewerVisuals(this, visuals);
|
addSewerVisuals(this, visuals);
|
||||||
return visuals;
|
return visuals;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void addSewerVisuals( Level level, Group group ) {
|
@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++) {
|
for (int i=0; i < level.length(); i++) {
|
||||||
if (level.map[i] == Terrain.WALL_DECO) {
|
if (level.map[i] == Terrain.WALL_DECO) {
|
||||||
group.add( new Sink( i ) );
|
group.add( new Sink( i ) );
|
||||||
|
|||||||
Reference in New Issue
Block a user