diff --git a/core/src/main/assets/custom_tiles/halls_special.png b/core/src/main/assets/custom_tiles/halls_special.png new file mode 100644 index 000000000..e48bc1059 Binary files /dev/null and b/core/src/main/assets/custom_tiles/halls_special.png differ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Assets.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Assets.java index 2c7d7ae19..efd2f7a26 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Assets.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/Assets.java @@ -136,6 +136,7 @@ public class Assets { public static final String PRISON_EXIT_NEW = "custom_tiles/prison_exit_new.png"; public static final String CAVES_BOSS = "custom_tiles/caves_boss.png"; public static final String CITY_BOSS = "custom_tiles/city_boss.png"; + public static final String HALLS_SP = "custom_tiles/halls_special.png"; public static final String BUFFS_SMALL = "buffs.png"; public static final String BUFFS_LARGE = "large_buffs.png"; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/DemonSpawnerRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/DemonSpawnerRoom.java index 21913c758..21532e17b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/DemonSpawnerRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/special/DemonSpawnerRoom.java @@ -21,15 +21,17 @@ package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special; +import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.DemonSpawner; -import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.RipperDemon; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room; import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.standard.EntranceRoom; +import com.shatteredpixel.shatteredpixeldungeon.tiles.CustomTilemap; +import com.watabou.noosa.Tilemap; import com.watabou.utils.Point; -import com.watabou.utils.Random; public class DemonSpawnerRoom extends SpecialRoom { @Override @@ -49,6 +51,10 @@ public class DemonSpawnerRoom extends SpecialRoom { spawner.pos = cx + cy * level.width(); level.mobs.add( spawner ); + CustomFloor vis = new CustomFloor(); + vis.setRect(left+1, top+1, width()-2, height()-2); + level.customTiles.add(vis); + } @Override @@ -57,4 +63,36 @@ public class DemonSpawnerRoom extends SpecialRoom { if (room instanceof EntranceRoom) return false; else return super.connect(room); } + + @Override + public boolean canPlaceTrap(Point p) { + return false; + } + + @Override + public boolean canPlaceWater(Point p) { + return false; + } + + private static class CustomFloor extends CustomTilemap { + + { + texture = Assets.HALLS_SP; + } + + @Override + public Tilemap create() { + Tilemap v = super.create(); + int top = tileX + tileY* Dungeon.level.width(); + int[] map = Dungeon.level.map; + int[] data = new int[tileW*tileH]; + for (int i = 0; i < data.length; i++){ + if (map[i+top] == Terrain.EMPTY_DECO) data[i] = 1; + else data[i] = 0; + } + v.map( data, tileW ); + return v; + } + + } }