summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dungeon.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-10 20:12:02 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-10 20:12:02 +0000
commit8db0ca8a4d7f4b5444737594e70ea1d8606a230f (patch)
tree1eafbce04463dbe07867c8909aeb181ad27bea88 /crawl-ref/source/dungeon.cc
parent67bca4d45d81d00a382c4d697b36b599b9cdecc8 (diff)
downloadcrawl-ref-8db0ca8a4d7f4b5444737594e70ea1d8606a230f.tar.gz
crawl-ref-8db0ca8a4d7f4b5444737594e70ea1d8606a230f.zip
Improve labyrinth loot, fixed assert when labyrinth minivaults try to place traps.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4994 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/dungeon.cc')
-rw-r--r--crawl-ref/source/dungeon.cc35
1 files changed, 15 insertions, 20 deletions
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc
index a27ff77b61..cc89f1e8a8 100644
--- a/crawl-ref/source/dungeon.cc
+++ b/crawl-ref/source/dungeon.cc
@@ -6266,25 +6266,26 @@ static void _labyrinth_build_maze(coord_def &e, const dgn_region &lab)
static void _labyrinth_place_items(const coord_def &end)
{
- int num_items = 8 + random2avg(9, 2);
+ int num_items = 8 + random2avg(12, 2);
for (int i = 0; i < num_items; i++)
{
- int temp_rand = random2(11);
-
- const object_class_type
- glopop = ((temp_rand == 0 || temp_rand == 9) ? OBJ_WEAPONS :
- (temp_rand == 1 || temp_rand == 10) ? OBJ_ARMOUR :
- (temp_rand == 2) ? OBJ_MISSILES :
- (temp_rand == 3) ? OBJ_WANDS :
- (temp_rand == 4) ? OBJ_MISCELLANY :
- (temp_rand == 5) ? OBJ_SCROLLS :
- (temp_rand == 6) ? OBJ_JEWELLERY :
- (temp_rand == 7) ? OBJ_BOOKS
- /* (temp_rand == 8) */ : OBJ_STAVES);
+ const object_class_type glopop =
+ static_cast<object_class_type>(
+ random_choose_weighted(14, OBJ_WEAPONS,
+ 14, OBJ_ARMOUR,
+ 3, OBJ_MISSILES,
+ 3, OBJ_MISCELLANY,
+ 10, OBJ_WANDS,
+ 10, OBJ_SCROLLS,
+ 10, OBJ_JEWELLERY,
+ 8, OBJ_BOOKS,
+ 8, OBJ_STAVES,
+ 0));
const int treasure_item =
items( 1, glopop, OBJ_RANDOM, true,
- you.your_level * 3, MAKE_ITEM_RANDOM_RACE );
+ one_chance_in(3)? you.your_level * 3 : MAKE_GOOD_ITEM,
+ MAKE_ITEM_RANDOM_RACE );
if (treasure_item != NON_ITEM)
{
@@ -6502,12 +6503,6 @@ static void _labyrinth_level(int level_number)
_labyrinth_place_entry_point(lab, end);
- // turn rock walls into undiggable stone or metal:
- // dungeon_feature_type wall_xform =
- // ((random2(50) > 10) ? DNGN_STONE_WALL // 78.0%
- // : DNGN_METAL_WALL); // 22.0%
- //replace_area(0, 0, GXM - 1, GYM - 1, DNGN_ROCK_WALL, wall_xform, vaults);
-
link_items();
} // end labyrinth_level()