diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-11-04 22:25:25 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-11-04 22:25:25 +0000 |
commit | a7bf0d48fb863282d7d93209505b518fd507285b (patch) | |
tree | 4efe6cee2818f2a478b8c34bc217378483650383 /crawl-ref/source/monplace.h | |
parent | 7c805921b8b0847c39c20ed508c0d8e6b76ae55a (diff) | |
download | crawl-ref-a7bf0d48fb863282d7d93209505b518fd507285b.tar.gz crawl-ref-a7bf0d48fb863282d7d93209505b518fd507285b.zip |
Implement second part of labyrinth tweaks:
* allow mapping of labyrinths, but apply heavy map rot
* lab walls shift from time to time
* added a wizmode command (&k) to test the changes
My usual sequence goes something like &l, >, &{, #,
(copy map dump elsewhere), X, Ctrl-F, y, Esc, &k, &{, #.
I've tweaked my monster pathfinding A* algorithm to only work for
non-monsters, so I've been using that.
Because of the mapping, labyrinths are now actually easier to solve.
(It's a bit hard to tell, though, since I got *really* good at solving
labyrinths over the 40 something trial runs. :) )
At the same time they are now much more interesting and flavourful
because of the map rot, and the shifting provides some wonderful excitement.
So, whoever came up with that idea, thanks! :D
Still to do:
* Exceptions for vaults. (Distinction between vault/non-vault walls.)
* Better handling of walls. (They currently "teleport" to the chosen
floor grid, leading to unusual wall types appearing somewhere else.)
* Improve the feel of the shifted mazes. (They come really close to
the original now but still do not look exactly the same.)
The numbers may need tweaking. Currently, they are:
shift rate : 10% chance, every 20 turns
map rot rate: 45% of the map, every 20 turns
size of shifted area: 12x12 to 24x24
number of shifted walls per round: 12-45
Shifting will only ever take place between unexplored (or forgotten)
grids. Thus, the chance of changes taking place is greater in areas
away from the player.
I also increased the starting distance from the centre from 20*20 to 28*28.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7387 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monplace.h')
-rw-r--r-- | crawl-ref/source/monplace.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/crawl-ref/source/monplace.h b/crawl-ref/source/monplace.h index d17c6938a8..ac87a555f3 100644 --- a/crawl-ref/source/monplace.h +++ b/crawl-ref/source/monplace.h @@ -315,7 +315,11 @@ public: // public methods void set_range(int r); - bool start_pathfind(monsters *mon, coord_def dest, bool msg = false); + bool init_pathfind(monsters *mon, coord_def dest, + bool diag = true, bool msg = false); + bool init_pathfind(coord_def src, coord_def dest, + bool diag = true, bool msg = false); + bool start_pathfind(bool msg = false); std::vector<coord_def> backtrack(void); std::vector<coord_def> calc_waypoints(void); @@ -324,6 +328,8 @@ protected: bool calc_path_to_neighbours(void); bool traversable(coord_def p); int travel_cost(coord_def npos); + bool mons_traversable(coord_def p); + int mons_travel_cost(coord_def npos); int estimated_cost(coord_def npos); void add_new_pos(coord_def pos, int total); void update_pos(coord_def pos, int total); @@ -336,6 +342,9 @@ protected: // Our destination, and the current position we're looking at. coord_def start, target, pos; + // Do not move diagonally along the path. + bool allow_diagonals; + // Maximum range to search between start and target. None, if zero. int range; |