diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-07-21 12:17:29 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-07-21 12:17:29 +0000 |
commit | 9843737e73a47ef6f1da0554b7ca73018d52d345 (patch) | |
tree | 9381ef8b914bc801386f62ce2713c59c17b6a9e8 /crawl-ref/source/files.cc | |
parent | b27a757b68bf8a1dcbcb9b3a5cfea5c1278c9bb4 (diff) | |
download | crawl-ref-9843737e73a47ef6f1da0554b7ca73018d52d345.tar.gz crawl-ref-9843737e73a47ef6f1da0554b7ca73018d52d345.zip |
Updated level-design.txt.
Moved map markers to mapmark.cc.
Added support for timer markers that remove a feature after a certain timeout.
Need to hook up messaging to Lua.
Added bazaars (need more bazaar layouts).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1899 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/files.cc')
-rw-r--r-- | crawl-ref/source/files.cc | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc index ad8baf87c1..d2ec409aca 100644 --- a/crawl-ref/source/files.cc +++ b/crawl-ref/source/files.cc @@ -65,6 +65,7 @@ #include "itemprop.h" #include "items.h" #include "libutil.h" +#include "mapmark.h" #include "message.h" #include "misc.h" #include "monstuff.h" @@ -552,6 +553,8 @@ static std::string get_level_suffix(int level, branch_type where, return ("abs"); case LEVEL_PANDEMONIUM: return ("pan"); + case LEVEL_BAZAAR: + return ("bzr"); } } @@ -700,6 +703,14 @@ static void place_player_on_stair(branch_type old_branch, int stair_taken) // when entering a hell or pandemonium stair_taken = DNGN_STONE_STAIRS_UP_I; } + else if (stair_taken == DNGN_ENTER_BAZAAR) + { + stair_taken = DNGN_STONE_ARCH; + } + else if (stair_taken == DNGN_EXIT_BAZAAR) + { + stair_taken = DNGN_STONE_STAIRS_DOWN_I; + } else // Note: stair_taken can equal things like DNGN_FLOOR { // just find a nice empty square @@ -718,14 +729,13 @@ static void close_level_gates() { for ( int j = 0; j < GYM; ++j ) { - if (you.char_direction == DIR_ASCENDING + if (you.char_direction == GDT_ASCENDING && you.level_type != LEVEL_PANDEMONIUM) { - if (grd[i][j] == DNGN_ENTER_HELL - || grd[i][j] == DNGN_ENTER_ABYSS - || grd[i][j] == DNGN_ENTER_PANDEMONIUM) + if (grid_sealable_portal(grd[i][j])) { grd[i][j] = DNGN_STONE_ARCH; + env_remove_markers_at(coord_def(i,j), MAT_ANY); } } } @@ -744,6 +754,11 @@ static void clear_clouds() env.cgrid.init(EMPTY_CLOUD); } +static bool level_type_allows_followers(level_area_type type) +{ + return (type == LEVEL_DUNGEON || type == LEVEL_PANDEMONIUM); +} + static void grab_followers() { for (int i = you.x_pos - 1; i < you.x_pos + 2; i++) @@ -815,6 +830,9 @@ bool load( dungeon_feature_type stair_taken, load_mode_type load_mode, if (load_mode != LOAD_RESTART_GAME) clear_clouds(); + // Lose all listeners. + dungeon_events.clear(); + // This block is to grab followers and save the old level to disk. if (load_mode == LOAD_ENTER_LEVEL && old_level != -1) { @@ -873,7 +891,7 @@ bool load( dungeon_feature_type stair_taken, load_mode_type load_mode, } // closes all the gates if you're on the way out - if (you.char_direction == DIR_ASCENDING && + if (you.char_direction == GDT_ASCENDING && you.level_type != LEVEL_PANDEMONIUM) close_level_gates(); @@ -898,8 +916,7 @@ bool load( dungeon_feature_type stair_taken, load_mode_type load_mode, monster_teleport(&menv[mgrd[you.x_pos][you.y_pos]], true, true); // actually "move" the followers if applicable - if ((you.level_type == LEVEL_DUNGEON - || you.level_type == LEVEL_PANDEMONIUM) + if (level_type_allows_followers(you.level_type) && load_mode == LOAD_ENTER_LEVEL) { place_followers(); @@ -916,6 +933,12 @@ bool load( dungeon_feature_type stair_taken, load_mode_type load_mode, // Things to update for player entering level if (load_mode == LOAD_ENTER_LEVEL) { + // Activate markers that want activating, but only when + // entering a new level in an existing game. If we're starting + // a new game, or reloading an existing game, + // env_activate_markers() is done in acr.cc. + env_activate_markers(); + // update corpses and fountains if (env.elapsed_time != 0.0) update_level( you.elapsed_time - env.elapsed_time ); |