diff options
-rw-r--r-- | crawl-ref/source/acr.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/arena.cc | 13 | ||||
-rw-r--r-- | crawl-ref/source/dat/arena.des | 62 | ||||
-rw-r--r-- | crawl-ref/source/newgame.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/newgame.h | 1 |
5 files changed, 77 insertions, 5 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 4f8ee05493..1f4e2e528c 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -3883,6 +3883,8 @@ static bool _initialise(void) if (crawl_state.arena) { + run_map_preludes(); + initialise_item_descriptions(); #ifdef USE_TILE tiles.initialise_items(); #endif diff --git a/crawl-ref/source/arena.cc b/crawl-ref/source/arena.cc index 2d66ba2c88..fdd0cc40e9 100644 --- a/crawl-ref/source/arena.cc +++ b/crawl-ref/source/arena.cc @@ -6,6 +6,7 @@ #include "cio.h" #include "dungeon.h" #include "initfile.h" +#include "items.h" #include "libutil.h" #include "maps.h" #include "message.h" @@ -201,8 +202,16 @@ namespace arena if (!map) throw make_stringf("No arena maps named \"%s\"", arena_type.c_str()); +#ifdef USE_TILE + tile_init_default_flavour(); + tile_clear_flavour(); +#endif + ASSERT(map); - dgn_place_map(map, true, true); + bool success = dgn_place_map(map, true, true); + if (!success) + throw make_stringf("Failed to create arena named \"%s\"", arena_type.c_str()); + link_items(); if (!env.rock_colour) env.rock_colour = CYAN; @@ -210,8 +219,6 @@ namespace arena env.floor_colour = LIGHTGREY; #ifdef USE_TILE - tile_init_default_flavour(); - tile_clear_flavour(); TileNewLevel(true); #endif } diff --git a/crawl-ref/source/dat/arena.des b/crawl-ref/source/dat/arena.des index aa500d1f0f..b860911ca2 100644 --- a/crawl-ref/source/dat/arena.des +++ b/crawl-ref/source/dat/arena.des @@ -1,3 +1,34 @@ +lua {{ +function randomise_colours(e) + local colours = { + "blue", "green", "cyan", "red", "magenta", "brown", + "lightgrey", "darkgrey", "lightblue", "lightgreen", "lightcyan", + "lightred", "lightmagenta", "yellow", "white" + } + + local walls = { + "wall_normal", "wall_hall", "wall_hive", "wall_ice", "wall_lair", + "wall_orc", "wall_snake", "wall_swamp", "wall_tomb", "wall_vault", + "wall_zot_blue", "wall_zot_cyan", "wall_zot_gray", "wall_zot_green", + "wall_zot_magenta", "wall_zot_red", "wall_zot_yellow", "wall_flesh", + "wall_vines", "wall_pebble_red", "wall_yellow_rock", "wall_brick_gray", + "wall_stone_gray", "wall_undead" + } + + local floors = { + "floor_normal", "floor_hall", "floor_hive", "floor_ice", "floor_lair", + "floor_orc", "floor_snake", "floor_swamp", "floor_tomb", "floor_vault", + "floor_vines", "floor_rough_red", "floor_sand_stone", "floor_grass", + "floor_nerves", "floor_dirt" + } + + e.rockcol(util.random_from(colours)) + e.floorcol(util.random_from(colours)) + e.rocktile(util.random_from(walls)) + e.floortile(util.random_from(floors)) +end +}} + NAME: arena_default TAGS: arena_default no_mons_gen MARKER: A = feat: stone_stairs_up_i @@ -329,3 +360,34 @@ o.o.o.o.o.o.o.o.o o...o...A...o...o ooooooooooooooooo ENDMAP + +NAME: arena_items +TAGS: arena_items no_mons_gen no_item_gen +MARKER: A = feat: stone_stairs_up_i +MARKER: B = feat: stone_stairs_down_i +MARKER: O = feat: escape_hatch_up +SUBST: A = ., B = ., O = . +ORIENT: encompass +ITEM: any +ITEM: any potion +ITEM: any wand +: randomise_colours(_G) +MAP +XXXXXXXXXXXXXXXXX +XX.............XX +X.......B.......X +X.....ddddd.....X +X.....eeeee.....X +X......fff......X +X......ddd......X +X...............X +X.......O.......X +X...............X +X......ddd......X +X......fff......X +X.....eeeee.....X +X.....ddddd.....X +X.......A.......X +XX.............XX +XXXXXXXXXXXXXXXXX +ENDMAP diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc index e05ef0e8ee..3152a55439 100644 --- a/crawl-ref/source/newgame.cc +++ b/crawl-ref/source/newgame.cc @@ -733,7 +733,7 @@ static int _get_random_coagulated_blood_desc() return PDESCQ(qualifier, colour); } -static void _initialise_item_descriptions() +void initialise_item_descriptions() { // Must remember to check for already existing colours/combinations. you.item_description.init(255); @@ -1232,7 +1232,7 @@ game_start: _give_basic_spells(you.char_class); _give_basic_knowledge(you.char_class); - _initialise_item_descriptions(); + initialise_item_descriptions(); _reassess_starting_skills(); calc_total_skill_points(); diff --git a/crawl-ref/source/newgame.h b/crawl-ref/source/newgame.h index 81de2b7748..129f199116 100644 --- a/crawl-ref/source/newgame.h +++ b/crawl-ref/source/newgame.h @@ -37,6 +37,7 @@ undead_state_type get_undead_state(const species_type sp); * called from: acr * *********************************************************************** */ bool new_game(); +void initialise_item_descriptions(); int give_first_conjuration_book(); bool choose_race(void); |