diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-14 15:00:11 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-14 15:00:11 +0000 |
commit | ee2afdbd1610f7a204808056bf1a5826085b89c8 (patch) | |
tree | debd3aee3946d707716e13b86e53d3b8539a29a0 /crawl-ref/source/travel.cc | |
parent | 4d430b2328d6922783a0dd256428de1585691eb9 (diff) | |
download | crawl-ref-ee2afdbd1610f7a204808056bf1a5826085b89c8.tar.gz crawl-ref-ee2afdbd1610f7a204808056bf1a5826085b89c8.zip |
FR 1962016: Make hydra headedness more obvious.
You now get messages like "The seven-headed hydra bites."
and "You slice the 12-headed hydra."
FR 1963606: Take a note when you pick up a rune (or the Orb!) for the
first time.
There are a couple of other files I changed, but I can't remember any
big stuff, so it was probably just cleanup.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5029 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/travel.cc')
-rw-r--r-- | crawl-ref/source/travel.cc | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index ddd295e162..d93c31df8d 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -144,7 +144,8 @@ inline bool is_trap(int x, int y) return grid_is_trap( grd[x][y] ); } -// Returns true if this feature takes extra time to cross. +// Returns an estimate for the time needed to cross this feature. +// This is done, so traps etc. will usually be circumvented where possible. inline int feature_traverse_cost(dungeon_feature_type feature) { if (feature == DNGN_SHALLOW_WATER || feature == DNGN_CLOSED_DOOR) @@ -412,9 +413,10 @@ static bool is_reseedable(int x, int y) { if (is_excluded(coord_def(x, y))) return (true); + int grid = grd[x][y]; - return (grid == DNGN_DEEP_WATER || grid == DNGN_SHALLOW_WATER || - grid == DNGN_LAVA || is_trap(x, y) || is_monster_blocked(x, y)); + return (grid == DNGN_DEEP_WATER || grid == DNGN_SHALLOW_WATER + || grid == DNGN_LAVA || is_trap(x, y) || is_monster_blocked(x, y)); } /* @@ -452,13 +454,12 @@ bool is_travelsafe_square(int x, int y, bool ignore_hostile, return (is_traversable(grid) #ifdef CLUA_BINDINGS - || - (is_trap(x, y) && - clua.callbooleanfn(false, "ch_cross_trap", - "s", trap_name(x, y))) + || (is_trap(x, y) + && clua.callbooleanfn(false, "ch_cross_trap", + "s", trap_name(x, y))) #endif ) - && !is_excluded(coord_def(x, y)); + && !is_excluded(coord_def(x, y)); } // Returns true if the location at (x,y) is monster-free and contains no clouds. @@ -488,7 +489,9 @@ static bool is_safe_move(int x, int y) "s", trap_name(x, y)) #endif ) + { return (false); + } const int cloud = env.cgrid[x][y]; if (cloud == EMPTY_CLOUD) @@ -1691,8 +1694,8 @@ bool travel_pathfind::path_flood(const coord_def &c, const coord_def &dc) // this number, since this square is unsafe for travel. point_distance[dc.x][dc.y] = is_exclude_root(dc) ? PD_EXCLUDED : - is_excluded(dc) ? PD_EXCLUDED_RADIUS : - PD_TRAP; + is_excluded(dc) ? PD_EXCLUDED_RADIUS + : PD_TRAP; } return (false); } |