From 8db0ca8a4d7f4b5444737594e70ea1d8606a230f Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sat, 10 May 2008 20:12:02 +0000 Subject: 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 --- crawl-ref/source/dungeon.cc | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) (limited to 'crawl-ref/source/dungeon.cc') 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( + 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() -- cgit v1.2.3-54-g00ecf