summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/maps.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove my debugging statements.j-p-e-g2008-11-081-2/+0
| | | | | | | And I forgot to mention: of course my previous commit breaks saves! git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7415 c06c8d41-db1a-0410-9941-cceddc491573
* Change floor_property (blood, sanctuary) to flags, and add two newj-p-e-g2008-11-071-2/+10
| | | | | | | | | | | | | | | settings: vault and highlight. Vault means a grid is part of a vault (set in dungeon.cc), and currently used to exempt vault grids when shifting labyrinths. Highlight is a meta flag currently only used to highlight labyrinth changes on the 'X' map in wizard mode, but I can think of a couple of other uses, mostly for debugging purposes. Also replace a few for loops in the lab shift function with rectangle_iterators. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7414 c06c8d41-db1a-0410-9941-cceddc491573
* Remove pre-Stone Soup change history from source files, and push it allj-p-e-g2008-09-141-6/+0
| | | | | | | | | | into a file crawlhistory.txt in docs/obsolete. I used a perl script to do this under the assumption that all these change logs used the same system following the keyword "Change History". git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6930 c06c8d41-db1a-0410-9941-cceddc491573
* Add a function x_chance_in_y(x,y) to replace the variousj-p-e-g2008-07-061-3/+3
| | | | | | | | random2(y) < x checks, e.g. x_chance_in_y(weight, totalweight). This should make things a bit more readable. Apply it to a number of files. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6428 c06c8d41-db1a-0410-9941-cceddc491573
* Misc. minor cleanups. (Yes, a huge amount of them but still...)j-p-e-g2008-06-261-1/+3
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6146 c06c8d41-db1a-0410-9941-cceddc491573
* [1982933] [1790502] Fixing issue with vaults being generated on lava.ennewalker2008-06-071-2/+1
| | | | | | | Lava and deep water now prevent (non-clobber) vaults from being placed. Additionally, items will modify the dungeon square they're placed on so that they are placed on floor or shallow water. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5544 c06c8d41-db1a-0410-9941-cceddc491573
* Added "error" channel for runtime errors, and changed error messages thatzelgadis2008-05-271-4/+4
| | | | | | | | | used the "danger" or "warning" channels to use that. Sending an error message to the error channel has the side effect of interrupting all activity. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5276 c06c8d41-db1a-0410-9941-cceddc491573
* Add a "patrolling" flag to monster creation in mapdef and dungeon.cc, j-p-e-g2008-05-261-9/+9
| | | | | | | | | | | | | | | | | and add it to Orb Guardians in Zot:5. At least in theory, they should now be returning to their starting points if you flee and stay away for long enough. "In theory" because the bad monster pathfinding prevents them from actually finding their way back. We've got the same problem with minotaurs in labyrinths, who've also got this flag set. Because of these restrictions it's almost impossible to test whether it would work without such problems. In any case, it's there for later. Also: spacing and commenting fixes in dungeon.cc. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5253 c06c8d41-db1a-0410-9941-cceddc491573
* FR 1822931: Vaults can now include tags of the form "layout_foo" tozelgadis2008-05-261-0/+13
| | | | | | | | | | | | | | | | indicate which level layout types it's compatible with, where "foo" can be: rooms, caves, open, city, or cross (plus swamp, shoals and labyrinth, even though random vaults aren't used in those places). Having no "layout_foo" tag means that the vault is compatible with all layout types, which is the current behavior. Also, fixed bug where layouts plan_1 (donut levels), plan_2 (cross levels) and plan_6 (octagon with circle of pillars) were choosing randomly from the three Lua defined layouts in dat/layout.des, rather than choosing exactly the chosen layout. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5251 c06c8d41-db1a-0410-9941-cceddc491573
* Outsourced the cross and the large octagon room to the (new) layout.des ↵ennewalker2008-05-171-0/+2
| | | | | | | | | | | | file. The octagon room is especially more random now, with different types, sizes, and numbers of pillars as well as more interesting stair placement. Vaults with the "layout" tag: 1) Aren't ever chosen as a random vault. 2) Are treated as normal level, so that other vaults can be placed over top. 3) Should probably be encompassing. 4) Currently only occur with the same frequency as the cross/octagon did. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5096 c06c8d41-db1a-0410-9941-cceddc491573
* Apply Horst von Brand's (first) patch 1887488: gcc-4.3 compile failures.j-p-e-g2008-04-141-28/+30
| | | | | | | I'm not sure what to do about the rest of that tracker item. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4233 c06c8d41-db1a-0410-9941-cceddc491573
* The level-builder now enforces the constraint that every contiguous region ↵dshaligram2008-04-101-1/+1
| | | | | | on a level must include at least one stair (ekiM). This guarantee does not apply to areas inside vaults (the builder assumes vault-designers are sane) and does not apply to certain branches (Swamp, Shoals, the branches of Hell), or the non-Dungeon areas (Abyss, Pan, Bazaars). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4169 c06c8d41-db1a-0410-9941-cceddc491573
* This was originally going to be a small refactor of stash.cc beforepauldubois2008-03-231-26/+35
| | | | | | | | | | | | | | | | | getting into stash/item finding, but it ended up big. Removed the read/writeThing API in favor of the marshall/unmarshallThing API. It was slightly awkward in a couple spots where the format of writeThing and marshallThing differed slightly (strings, level_id, level_pos). Doesn't affect savegames. When it's is okay to break savegames (maybe just before releasing 0.4?) it would be nice to remove the few remaining redundancies listed above. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3828 c06c8d41-db1a-0410-9941-cceddc491573
* Another batch of msvc compile fixes.pauldubois2008-03-101-0/+2
| | | | | | | | | | | | | | Added wrapper implementation for opendir/readdir Other functions left stubbed out. It's a shame that crawl's "direct.h" conflicts with <direct.h>. Fixed up use of AppHdr.h in a couple places (it must be included first); changed project to use precompiled headers. crawl now compiles cleanly but doesn't link. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3573 c06c8d41-db1a-0410-9941-cceddc491573
* Sort maps by weight in mapgen.log output (random map listing).dshaligram2007-10-291-1/+9
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2664 c06c8d41-db1a-0410-9941-cceddc491573
* Removed obsolete "levels" option. des files to load should be specified in ↵dshaligram2007-10-291-9/+0
| | | | | | loadmaps.lua and nowhere else. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2663 c06c8d41-db1a-0410-9941-cceddc491573
* Tweaked -mapstat to show random maps available by depth. Added a floating ↵dshaligram2007-10-291-1/+76
| | | | | | dummy vault to correct probabilities of vaults in non-dungeon branches. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2653 c06c8d41-db1a-0410-9941-cceddc491573
* dgn_place_map takes a coord_def to specify the centre of the map for ↵dshaligram2007-10-251-22/+36
| | | | | | minivaults and floating vaults. This placement can be activated using an asterisk (mapname*) when entering the name of the map in the &L command. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2559 c06c8d41-db1a-0410-9941-cceddc491573
* Split off portions of externs.h and enum.h into other files. Thezelgadis2007-09-151-0/+2
| | | | | | | | | | | | | crawl_environment, player and monsters classes have been left in externs.h, which necessitates that all of the enums references by those classes stay in enums.h, since you can't forward declare an enum. However, it's a start. Also, portions of misc.{cc,h} have been split off into traps.{cc,h}, place.{cc,h} and terrain.{cc,h} git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2095 c06c8d41-db1a-0410-9941-cceddc491573
* Implemented patch 1773718 (improved wizard commands) andj-p-e-g2007-09-021-0/+11
| | | | | | | patch 1783003 (ímproved menu sorting), both by zelgadis. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2041 c06c8d41-db1a-0410-9941-cceddc491573
* &L can place encompass levels, and is more aggressive about overwritingdshaligram2007-07-291-3/+2
| | | | | | | | existing dungeon features. Dungeon features of importance - such as stairs, shops, and altars - and map markers are shifted out of the way, to the nearest free floor square. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1947 c06c8d41-db1a-0410-9941-cceddc491573
* Added wizmode &L command to place a map on the current level by name. Thisdshaligram2007-07-281-12/+30
| | | | | | | | only really works for non-encompass vaults, and dungeon fixups are not applied (so random deep water -> shallow water conversion, auto-placement of water creatures, etc. will not happen). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1942 c06c8d41-db1a-0410-9941-cceddc491573
* Bazaar vaults were being placed in the main dungeon, fixed.dshaligram2007-07-231-0/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1915 c06c8d41-db1a-0410-9941-cceddc491573
* Added elf arrival vaults (Eino).dshaligram2007-07-191-3/+25
| | | | | | | | | | | | | Tweaked dungeon builder so you always land on { on level 1 of a branch (using a map marker to identify which stair was a {). Maps with the "uniq" tag will be used only once in a game. Maps with a "uniq_foo" tag will be used only once, and will also prevent any other maps tagged "uniq_foo" from being used thereafter. Breaks saves. Oklob plants should not receive stab brands, fixed. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1897 c06c8d41-db1a-0410-9941-cceddc491573
* Allow full-level (encompass) vaults to be placed outside the main dungeon.dshaligram2007-07-111-12/+15
| | | | | | Fixed a bug where secondary vaults and minivaults could overwrite special rooms. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1834 c06c8d41-db1a-0410-9941-cceddc491573
* More debug stats for maps.dshaligram2007-07-091-0/+5
| | | | | | | | | | | | | | level_range was segfaulting when compared against Abyss and Pan level_ids, fixed. Fixed level_id operator < (). Enabled use of vaults in non-Dungeon areas (Lair specific vaults were unused). These vaults are placed as extras, and are subject to the same constraints as branch entry vaults (the smaller the vault, the better the chance of being placed). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1811 c06c8d41-db1a-0410-9941-cceddc491573
* Tweak map stat output, fixed a couple of bugs.dshaligram2007-07-081-8/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1806 c06c8d41-db1a-0410-9941-cceddc491573
* Added debugging code to generate multiple dungeons (all branches and levels)dshaligram2007-07-081-1/+14
| | | | | | | | | and gather statistics on maps used and Lua errors encountered. To use it, run "crawl -mapstat" with a full-debug build. Output will be mapgen.log in the current directory. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1805 c06c8d41-db1a-0410-9941-cceddc491573
* Fixed inappropriate maps being selected for dungeon levels.dshaligram2007-07-081-3/+5
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1803 c06c8d41-db1a-0410-9941-cceddc491573
* Fixed level-compiler not warning of maps with the same name consistently.dshaligram2007-07-081-2/+7
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1799 c06c8d41-db1a-0410-9941-cceddc491573
* Vault collision checks were still assuming rectangles, fixed.dshaligram2007-07-081-25/+11
| | | | | | More minor vault tweaks. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1793 c06c8d41-db1a-0410-9941-cceddc491573
* Extend rectangular vault support for regular vaults.dshaligram2007-07-071-1/+1
| | | | | | | | Vault collision checking is also non-rectangular now. Fixed Windows builds not reporting line numbers in .des file error messages. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1784 c06c8d41-db1a-0410-9941-cceddc491573
* Allow non-rectangular minivaults and branch entry vaults (use space padding).dshaligram2007-07-061-5/+13
| | | | | | | | | | They're still rectangular for collision detection with other vaults; that'll need more effort to fix. Space padding can also be used for regular vaults, but it'll be ignored at the moment (but soon...! :-)). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1778 c06c8d41-db1a-0410-9941-cceddc491573
* Fix level compiler to validate PLACE: declarations.dshaligram2007-07-061-5/+5
| | | | | | Places are saved as level_ids, not strings. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1776 c06c8d41-db1a-0410-9941-cceddc491573
* [1742338] Fixed Hell portals not being revealed correctly when the horn isdshaligram2007-06-301-3/+10
| | | | | | sounded. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1701 c06c8d41-db1a-0410-9941-cceddc491573
* Moved the list of required .des files into loadmaps.lua.dshaligram2007-06-291-8/+8
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1687 c06c8d41-db1a-0410-9941-cceddc491573
* Updated level-design.txt with a basic overview of the Lua possibilities.dshaligram2007-06-281-2/+7
| | | | | | | Fixed some inconsistencies in the handling of Lua errors. Tweaked the lexer to allow spaces before Lua chunk prefixes. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1676 c06c8d41-db1a-0410-9941-cceddc491573
* Added glyphs_connected and friends for maps to test connectedness of pointsdshaligram2007-06-271-0/+1
| | | | | | | | after map transforms are applied. Fixed conflicts in bison grammar. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1669 c06c8d41-db1a-0410-9941-cceddc491573
* The dungeon builder now caches compiled Lua chunks instead of Lua source in thedshaligram2007-06-271-5/+3
| | | | | | .dsc to save on compile time (at the expense of larger .dsc files). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1663 c06c8d41-db1a-0410-9941-cceddc491573
* Added support for a validation hook for maps to check if they're A-Ok.dshaligram2007-06-261-11/+26
| | | | | | | | | Tweaked savefile format (breaks saves) to allow the game to perform emergency saves if level-generation fails (followers are lost, needs to be fixed). [1743698] Re-refixed SP_ELF stub (Eino). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1659 c06c8d41-db1a-0410-9941-cceddc491573
* .des files can use a global Lua prelude (before maps are defined) that runsdshaligram2007-06-251-10/+36
| | | | | | | at start of game, before any maps are loaded, and does not run in the context of any specific map. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1654 c06c8d41-db1a-0410-9941-cceddc491573
* Fixed compile for Windows.dshaligram2007-06-241-0/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1640 c06c8d41-db1a-0410-9941-cceddc491573
* Implemented .des file caching (speeds startup a fair bit): .des files aredshaligram2007-06-241-4/+189
| | | | | | | | | | parsed only once (unless they're modified again). Crawl also keeps only map stubs in memory (name, place, orient, tags) and loads the map body only when it is actually selected by the dungeon builder. This probably breaks the Windows build, will be fixed soonish. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1637 c06c8d41-db1a-0410-9941-cceddc491573
* Step 1 of .des file Lua-isation. The dungeon compiler converts .des files todshaligram2007-06-231-4/+9
| | | | | | | | | | Lua (Lua code can be embedded with {{ <lua code here> }} constructs) that is run to produce the final map. Some maps may be broken, this is untested, lots more work needs to be done. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1629 c06c8d41-db1a-0410-9941-cceddc491573
* Allow minivaults tagged "lab" to be used for labyrinth exits.dshaligram2007-06-211-0/+3
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1616 c06c8d41-db1a-0410-9941-cceddc491573
* [1738010] Stash-tracker now also tracks traps and other dungeon features.dshaligram2007-06-171-1/+1
| | | | | | | | Changed env.grid to dungeon_feature_type. (The special-level builder still stores map characters directly into env.grid and then translates them to features.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1592 c06c8d41-db1a-0410-9941-cceddc491573
* Added Lemuel's mines minivaults.dshaligram2007-05-091-7/+7
| | | | | | | Extended map DEPTH: attribute to support branch specifiers and negated depth specifiers. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1442 c06c8d41-db1a-0410-9941-cceddc491573
* Moved entry vaults and branch entries into their own .des files.dshaligram2007-05-071-0/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1415 c06c8d41-db1a-0410-9941-cceddc491573
* Branch entry vaults now respect DEPTH: declarations so you can put tough ↵dshaligram2007-04-251-2/+6
| | | | | | | | branch entries deeper. Detect creatures no longer clears the level map of detected items. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1366 c06c8d41-db1a-0410-9941-cceddc491573
* Allow "any trap" and "any shop" (alternatives to "random trap" and "randomdshaligram2007-04-101-15/+0
| | | | | | | | | | shop") in des files. Allow using '8', '9' and '0' in monster specifications. Tossed out some unused functions. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1281 c06c8d41-db1a-0410-9941-cceddc491573