diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-03-29 12:43:34 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-03-29 12:43:34 +0000 |
commit | 996361d167065bc29bef5da248e3d18bd0d9cbab (patch) | |
tree | bac3e756a6c0a8d10988563761cdb297652cd9c6 /crawl-ref/source/view.cc | |
parent | 262fc856ccb0dbc4462aa71cfb7f56d81cd9b03d (diff) | |
download | crawl-ref-996361d167065bc29bef5da248e3d18bd0d9cbab.tar.gz crawl-ref-996361d167065bc29bef5da248e3d18bd0d9cbab.zip |
* When Xom decides to cast Magic Mapping or send you on a teleportation
journey, use a random sample of level grids as a guesstimate of the
explored portion of the level, and reduce chances for mostly explored
levels.
* Don't attempt to cast spells you wouldn't be able to cast (e.g. the
transformations for undead).
* Tweak random uselessness messages as per FR 2595700.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9565 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/view.cc')
-rw-r--r-- | crawl-ref/source/view.cc | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index 7fedaa0110..d641ac4f02 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -3836,9 +3836,6 @@ bool magic_mapping(int map_radius, int proportion, bool suppress_msg, return (false); } - if (!suppress_msg) - mpr( "You feel aware of your surroundings." ); - if (map_radius > 50 && map_radius != 1000) map_radius = 50; else if (map_radius < 5) @@ -3848,8 +3845,10 @@ bool magic_mapping(int map_radius, int proportion, bool suppress_msg, const int pfar = (map_radius * 7) / 10; const int very_far = (map_radius * 9) / 10; - const bool wizard_map = map_radius == 1000 && you.wizard; - for ( radius_iterator ri(you.pos(), map_radius, true, false); ri; ++ri ) + const bool wizard_map = (you.wizard && map_radius == 1000); + + bool did_map = false; + for (radius_iterator ri(you.pos(), map_radius, true, false); ri; ++ri) { if (proportion < 100 && random2(100) >= proportion) continue; // note that proportion can be over 100 @@ -3875,7 +3874,7 @@ bool magic_mapping(int map_radius, int proportion, bool suppress_msg, } #endif - if (!wizard_map && is_terrain_known(*ri)) + if (!wizard_map && (is_terrain_known(*ri) || is_terrain_seen(*ri))) continue; bool open = true; @@ -3883,7 +3882,7 @@ bool magic_mapping(int map_radius, int proportion, bool suppress_msg, if (grid_is_solid(grd(*ri)) && grd(*ri) != DNGN_CLOSED_DOOR) { open = false; - for ( adjacent_iterator ai(*ri); ai; ++ai ) + for (adjacent_iterator ai(*ri); ai; ++ai) { if (map_bounds(*ai) && (!grid_is_opaque(grd(*ai)) || grd(*ai) == DNGN_CLOSED_DOOR)) @@ -3894,7 +3893,7 @@ bool magic_mapping(int map_radius, int proportion, bool suppress_msg, } } - if (open > 0) + if (open) { if (wizard_map || !get_envmap_obj(*ri)) set_envmap_obj(*ri, grd(*ri)); @@ -3903,10 +3902,18 @@ bool magic_mapping(int map_radius, int proportion, bool suppress_msg, set_terrain_seen(*ri); else set_terrain_mapped(*ri); + + did_map = true; } } - return (true); + if (!suppress_msg) + { + mpr(did_map ? "You feel aware of your surroundings." + : "You feel momentarily disoriented."); + } + + return (did_map); } // Realize that this is simply a repackaged version of |