v0.3.1d: added custom tiles to the weak floor room, as a hint for the pit room below

This commit is contained in:
Evan Debenham 2015-09-14 00:40:22 -04:00
parent 44f8e32beb
commit bae3815475
3 changed files with 20 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -107,6 +107,8 @@ public class Assets {
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";
public static final String SPELL_ICONS = "spell_icons.png";

View File

@ -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);
}
}