summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/l_dgnbld.cc
Commit message (Collapse)AuthorAgeFilesLines
* Fix incorrect math in make_box_doors.Jude Brown2010-01-121-1/+15
| | | | | | | | | In most settings, three passable glyphs are those on the inside of the room; we want some passable glyphs on the *outside* of the room as well. This does mean that immediate corners of doors will now be excluded from possible door spots, but this can be hacked around. The other solution is to look "outside" of the room, which could probably be calculated from the specified side.
* Die noisily on invalid box_side (mostly to silence compiler warnings).Adam Borowski2010-01-121-0/+1
|
* More new dungeon build functions, and some adjustments.Jude Brown2010-01-121-8/+147
| | | | | | | | | | | | | | | | | Adjusted _valid_coord to allow the checking of a coordinate without generating an error message; moved fill_area's filling code to its own function so that it can be called by multiple functions; implemented count_passable_neighbors in C++ instead of Lua, to make it more accessible in multiple layouts. Implemented "make_box" and "make_box_doors"; both work on a series of two coordinates (top left and bottom right corners), the first making a box of specified width and using specified glyphs for walls and floor, while the second function will randomly add doors to the box, ignoring corners. make_box_doors will not work on instances where the wall thickness is more than 1 square; this could be adjusted at a later date.
* Some new Lua wrappers for dungeon building and ranges.Jude Brown2010-01-121-0/+73
| | | | | | | | | | | Introduces util.range(start, stop), returning an array consisting of the numeric values between start and stop inclusive. Also introduces "is_valid_coord" Lua wrapper, which does the same work as _valid_coord but does not generate an error message for invalid coordinates, "find_in_area" (a straight translation of the function in dungeon.cc), and "is_passable_coord" which checks the glyph at that location against traversable_glyphs.
* Change mapgrd and mapbld funcs to be 0-indexed.Enne Walker2009-11-291-17/+12
| | | | | | | | | All the other dgn and map functions in Crawl are 0-indexed, so this makes everything more consistent. I've changed all the uses in the master branch, but if you're using these functions in another branch (dpeg and due), then you'll need to adjust all your coordinates to match.
* Add formatting fixes.David Lawrence Ramsey2009-11-211-8/+8
| | | | This mostly puts && and || on the proper lines, per the style guide.
* Flatten header dependencies a bit.Robert Vollmert2009-11-171-0/+1
| | | | | | This removes a couple of unnecessary includes from header files. I may have missed adding some tiles includes.
* Add whitespace fixes.David Lawrence Ramsey2009-11-021-11/+11
|
* Lua builder funcs act on map_lines, not grd.Enne Walker2009-11-021-248/+597
| | | | | | | This lets regular vaults use the same Lua functions that layout vaults do. Convert functions in l_dgnbld that acted on grd. Update layout vaults to use these new functions. Also, remove l_dgn_bf, as all of its functionality is now in l_dgnbld.
* Splitting up stuff.cc.Robert Vollmert2009-10-301-0/+2
| | | | New: colour.cc, coord.cc, coordit.cc, random.cc, rng.cc.
* Move more macros and functions to cluautil.cc.Robert Vollmert2009-10-211-1/+1
|
* Complete rename to mapgrd.Robert Vollmert2009-10-211-2/+2
| | | | | | Previously, I had renamed only the C++-side of things. Also update documentation.
* cosmetic: strip trailing whitespaceSteven Noonan2009-10-201-45/+45
| | | | Signed-off-by: Steven Noonan <steven@uplinklabs.net>
* Move grd_lib out of clua.cc into l_mapgrd.cc.Robert Vollmert2009-10-201-1/+1
| | | | | | | | | | | | | | Rest of commit comment only as accurate as my understanding... Renaming from grd to mapgrd to avoid confusion with grd == env.grid: This grd is the maplines-section of a vault definition. Also move mapgrd_lib from clua to dlua since it's only used for dungeon building. clua and dlua need more descriptive names.
* Move clua crawl_lib from clua to l_crawl.cc.Robert Vollmert2009-10-201-1/+1
| | | | To avoid name clashes, rename dlua libs from *_lib to *_dlib.
* Split builder functions out from l_dgn.cc.Robert Vollmert2009-10-201-0/+365
Now sub-2k lines of code.