diff --git a/assets/custom_tiles/weak_floor.png b/assets/custom_tiles/weak_floor.png new file mode 100644 index 000000000..e00819139 Binary files /dev/null and b/assets/custom_tiles/weak_floor.png differ diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/Assets.java b/src/com/shatteredpixel/shatteredpixeldungeon/Assets.java index 394f5e4d2..6c63f1a53 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/Assets.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/Assets.java @@ -106,6 +106,8 @@ public class Assets { public static final String WATER_CAVES = "water2.png"; public static final String WATER_CITY = "water3.png"; public static final String WATER_HALLS = "water4.png"; + + public static final String WEAK_FLOOR = "custom_tiles/weak_floor.png"; public static final String BUFFS_SMALL = "buffs.png"; public static final String BUFFS_LARGE = "large_buffs.png"; diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/levels/painters/WeakFloorPainter.java b/src/com/shatteredpixel/shatteredpixeldungeon/levels/painters/WeakFloorPainter.java index 337901e30..f31652b8b 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/levels/painters/WeakFloorPainter.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/levels/painters/WeakFloorPainter.java @@ -20,9 +20,12 @@ */ package com.shatteredpixel.shatteredpixeldungeon.levels.painters; +import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Room; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; +import com.shatteredpixel.shatteredpixeldungeon.sprites.CustomTileVisual; import com.watabou.utils.Point; import com.watabou.utils.Random; @@ -53,5 +56,20 @@ public class WeakFloorPainter extends Painter { drawInside( level, room, new Point( i, room.bottom ), Random.IntRange( 1, room.height() - 2 ), Terrain.EMPTY_SP ); } } + + Point well = null; + if (door.x == room.left) { + well = new Point( room.right-1, Random.Int( 2 ) == 0 ? room.top + 2 : room.bottom - 1 ); + } else if (door.x == room.right) { + well = new Point( room.left+1, Random.Int( 2 ) == 0 ? room.top + 2 : room.bottom - 1 ); + } else if (door.y == room.top) { + well = new Point( Random.Int( 2 ) == 0 ? room.left + 1 : room.right - 1, room.bottom-1 ); + } else if (door.y == room.bottom) { + well = new Point( Random.Int( 2 ) == 0 ? room.left + 1 : room.right - 1, room.top+2 ); + } + set(level, well, Terrain.CHASM); + CustomTileVisual vis = new CustomTileVisual(Assets.WEAK_FLOOR, Dungeon.depth/5, 0, 1, 1); + vis.pos(well.x, well.y); + level.customTiles.add(vis); } }