summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dungeon.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* Apply Horst von Brand's (first) patch 1887488: gcc-4.3 compile failures.j-p-e-g2008-04-141-177/+178
| | | | | | | 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
* Level-builder was treating secret doors as walls when considering isolated ↵dshaligram2008-04-101-2/+3
| | | | | | regions, fixed. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4174 c06c8d41-db1a-0410-9941-cceddc491573
* The level-builder now enforces the constraint that every contiguous region ↵dshaligram2008-04-101-61/+143
| | | | | | 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
* Added Water card. Might need some rebalancing.haranp2008-04-081-3/+3
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4127 c06c8d41-db1a-0410-9941-cceddc491573
* Ha, I knew there was a reason to cleaning up dungeon.cc - learning by j-p-e-g2008-03-311-4/+25
| | | | | | | | | | | | | | | | | | | | | | osmosis... :p Anyway, killing the royal jelly now turns all stone walls on the level into clear rock, together with a cute message. This currently only works if you actually kill it on the bottom level - other than the lua magic, which sets a marker to work no matter where you kill the jelly (I think). Still, it's better than nothing. Instead of introducing a wrapper function I probably should have made replace_area non-static, but I wasn't sure if there might be a better way to do this, and wanted to avoid having to change (and then possibly change back) all calls and their indenting. I would have changed the rune probability as well, but I wasn't entirely sure, how. If I had to guess, I'd say that changing P -> O on the branch map is the way to go. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3986 c06c8d41-db1a-0410-9941-cceddc491573
* Code cleanup and renaming of static methods, mostly for decks.cc and j-p-e-g2008-03-311-789/+814
| | | | | | | dungeon.cc. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3984 c06c8d41-db1a-0410-9941-cceddc491573
* Prevent shafts from being created in corridors, at least untilj-p-e-g2008-03-291-476/+459
| | | | | | | | | | | | | | | | | around dungeon level 7. Rename ROCK_STAIRS to ESCAPE_HATCH, as well as the corresponding function, since I think that the escape hatches are such a cool concept that we won't be going back, and the current coding name is a bit confusing. Clean up dungeon.cc. I'll probably have to add stuff into our new conventions file as I've been making up a lot of new rules in trying to make the code more readable. (Rules concerning nested brackets, and function indentation, etc.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3927 c06c8d41-db1a-0410-9941-cceddc491573
* Add fountains of blood (as suggested by Lemuel), and tidy up j-p-e-g2008-03-261-4/+6
| | | | | | | | | | | | | | | the existing fountains: change their order and remove all those superfluous dry fountain types. I couldn't find any place for random generation of fountains, so if that is possible it will have to be disabled for blood fountains outside the hells. I've added a shortcut (Y) for vault creation, though. :) Drinking from such a fountain has a 33% chance of leaving it dry. I think that's it... for now. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3886 c06c8d41-db1a-0410-9941-cceddc491573
* Another batch of msvc compile fixes.pauldubois2008-03-101-1/+1
| | | | | | | | | | | | | | 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
* Batch of tiny changes for MSVC compiles.pauldubois2008-03-101-1/+1
| | | | | | | | | | | | | | | Most of these fall into the category: - don't use struct to refer to a class, and vice versa - msvc doesn't like unistd.h or dirent.h Doesn't fix all the struct/class problems; I think I'll silence those for now and move on because it's not all that important. Tested on OS X. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3571 c06c8d41-db1a-0410-9941-cceddc491573
* [1868908] Fixed undiscovered traps being a different colour from surrounding ↵dshaligram2008-01-251-1/+3
| | | | | | coloured floor. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3326 c06c8d41-db1a-0410-9941-cceddc491573
* New Zot levels, courtesy Lemuel (David).dshaligram2008-01-121-5/+6
| | | | | | | | | | Added more control when specifying draconians in maps (any yellow draconian, green draconian knight, any nonbase red draconian, any base draconian, etc.). Fixed crash when dragon or draconian breathes and the player is unarmed. Replaced magic number 250 in monster creation with enum constant MONS_PROGRAM_BUG. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3253 c06c8d41-db1a-0410-9941-cceddc491573
* Fixed missing upstairs in Hall of Blades (uru).dshaligram2008-01-101-2/+2
| | | | | | Corrected some minivault depths. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3243 c06c8d41-db1a-0410-9941-cceddc491573
* Monsters get multilevel resists (incomplete). Monster data needs to bedshaligram2008-01-091-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | adjusted per monster to hand out the right resists. The current MR_RES_FIRE gives one level of resistance only. Added a real ghost structure, discarded the old ghost values array. Adjusted bones file format so bones will work out-of-the-box with Hearse. Breaks bones format, older bones will be rejected. Fixed some maps with bad DEPTHs. Added more safe answers in Y/N prompts, added a check to make it less likely that Crawl will spin in a tight loop reading input from a closed tty. (Experimental) !a will override existing foe of friendlies in LOS. Blademasters no longer pick up stuff to throw (Erik). Zombies of swimming things are also swimming things. Currently applies only to zombies explicitly placed in .des files, since fish zombies cannot be generated otherwise (can of worms). Morgue is now saved before showing the inventory and other boring end-of-game stuff. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3231 c06c8d41-db1a-0410-9941-cceddc491573
* Add more habitat cleanups: rename HT_NORMAL to HT_LAND, remove dolorous2008-01-041-4/+4
| | | | | | | HT_SHALLOW_WATER, and rename HT_DEEP_WATER to HT_WATER. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3183 c06c8d41-db1a-0410-9941-cceddc491573
* Add rock wall to the habitats list (for rock worms), and move monster dolorous2008-01-041-3/+3
| | | | | | | classes' associated habitats into the monsterentry struct. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3182 c06c8d41-db1a-0410-9941-cceddc491573
* Add miscellaneous type cleanups and comment fixes.dolorous2008-01-031-9/+8
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3177 c06c8d41-db1a-0410-9941-cceddc491573
* Add minor comment updates.dolorous2008-01-021-2/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3172 c06c8d41-db1a-0410-9941-cceddc491573
* Made labyrinths bigger, removed padding around minivaults.dshaligram2007-12-271-62/+0
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3114 c06c8d41-db1a-0410-9941-cceddc491573
* Fix message typos.dolorous2007-12-161-2/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3075 c06c8d41-db1a-0410-9941-cceddc491573
* mapdef/vault items can now have their race type and ego explicitly set.zelgadis2007-12-131-8/+103
| | | | | | | mapdef/vault monsters can now be given an explicit list of items. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3055 c06c8d41-db1a-0410-9941-cceddc491573
* Items can now fall through shaft traps (trap doors). The code is ratherzelgadis2007-12-031-6/+6
| | | | | | | | | | | | | | simplistic, and it's not currently possible to make a "baited" shaft; also, there is no threshold weight, so even a single dart will open up (and thus reveal) a shaft trap. Breaks savefile compatibility. Monsters which fall through a shaft now show up 100% of the time on the player's next visit to the shaft's destination level. Also, the monster is placed close to the spot where the player would end up if s/he went through the same shaft. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2988 c06c8d41-db1a-0410-9941-cceddc491573
* Fixing [1832064] stair bug. Added a cleanup function to ensure that there ↵ennewalker2007-11-211-0/+126
| | | | | | is at most one stone stair of each type on the level. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2887 c06c8d41-db1a-0410-9941-cceddc491573
* Extraneous up stairs on dungeon level 1 are confusing to new users. ↵ennewalker2007-11-201-1/+5
| | | | | | Removing the generation of extra up stairs there. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2876 c06c8d41-db1a-0410-9941-cceddc491573
* The number of traps randomly generated on a level, and which types ofzelgadis2007-11-131-49/+49
| | | | | | | | | | | traps are randomly selected, can now easily be controlled on a branch by branch basis (and for Pan and the Abyss), similar to how monster level and rarity is controlled (via function pointers in the Branch data structure). The same can be done for fog machines (though this feature isn't being used as of yet). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2846 c06c8d41-db1a-0410-9941-cceddc491573
* Fixed labyrinth sizes for trunk.dshaligram2007-10-251-6/+6
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2574 c06c8d41-db1a-0410-9941-cceddc491573
* Fixed bug that consistently placed characters too near the exit in labyrinths.dshaligram2007-10-251-4/+5
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2573 c06c8d41-db1a-0410-9941-cceddc491573
* [1804809] Fixed buggy handling of colour overlays.dshaligram2007-10-251-0/+77
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2570 c06c8d41-db1a-0410-9941-cceddc491573
* Added a flag to disable generation of exits from a vault. Need to clean up ↵dshaligram2007-10-251-16/+27
| | | | | | vault placement to make it easier to parameterise it. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2567 c06c8d41-db1a-0410-9941-cceddc491573
* dgn_place_map takes a coord_def to specify the centre of the map for ↵dshaligram2007-10-251-71/+85
| | | | | | 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
* Removed amnesia/forgetfullness trap, mutation and scroll. Thezelgadis2007-10-151-1/+1
| | | | | | | | | | | | | mutation has been replaced with an involuntary shouting mutation, and the trap with an alarm trap. The scroll hasn't been replaced with anything, and the frequency of scrolls of random uselessness has thus doubled; someone needs to re-do the scroll frequencies. Also added a "drifting" mutation, which causes the player to sometimes drift in a random direction after moving. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2464 c06c8d41-db1a-0410-9941-cceddc491573
* Added to classes actor, monsters and player the method can_pass_through(),zelgadis2007-10-141-2/+6
| | | | | | | | | which returns true for a grid that the monster or player can pass trhough. Also added new monster type "rock worm" to demonstrate a monster which can pass through solid walls. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2459 c06c8d41-db1a-0410-9941-cceddc491573
* Implementing merfolk monsters. There are two types, merfolk fighters,j-p-e-g2007-10-131-0/+7
| | | | | | | | | | | | | | | | | | | | and mermaids. The latter are more interesting. ;) Whenever a mermaid sings there's a chance you get beheld, meaning you cannot move away from the mermaid, that is cannot increase the distance between you and her. (Because of the distance pecularities this means at dist 1 you can only be NSW or E of the mermaid but not the diagonal directions.) If you manage to be beheld by several mermaids at the same time, your movements have to respect the distance to all of them. I've added a vector beheld_by that keeps track of beholding monsters and makes checking distance and updating beholding status easier. Merfolk are immune to the mermaid song. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2453 c06c8d41-db1a-0410-9941-cceddc491573
* Fixed minimum distance of lab entrance from exit.dshaligram2007-10-111-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2431 c06c8d41-db1a-0410-9941-cceddc491573
* [1809278][1809633] Fixed spotty level badness.dshaligram2007-10-101-4/+4
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2410 c06c8d41-db1a-0410-9941-cceddc491573
* Allow bargains in bazaars, ranging from 60% to 95%.j-p-e-g2007-10-091-0/+25
| | | | | | | | | | | | | | The value of created items is also increased by a fair bit. I also changed species MR as in the last post of FR 1787813: all Elves get 4, Ogre Mage 5, and Demigods also 4. Someone (Darshan?) will probably want to twiddle with the numbers, at least for the bazaars, so for now, I'll put off committing this into 0.3. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2394 c06c8d41-db1a-0410-9941-cceddc491573
* Fixed bad comparison with string literal (bobbens).dshaligram2007-10-071-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2354 c06c8d41-db1a-0410-9941-cceddc491573
* Allow overriding monster colours in map specs using col:<newcolour>.dshaligram2007-10-071-5/+12
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2353 c06c8d41-db1a-0410-9941-cceddc491573
* First steps toward removing the need for 6-deep rock-wall padding around ↵dshaligram2007-10-061-23/+23
| | | | | | dungeon maps. This is likely to be buggy for a while. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2341 c06c8d41-db1a-0410-9941-cceddc491573
* Randomly generate shaft traps.zelgadis2007-10-051-0/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2331 c06c8d41-db1a-0410-9941-cceddc491573
* init_pandemonium() needs to re-do dgn_set_colours_from_monsters(),zelgadis2007-10-051-2/+4
| | | | | | | since it is called after level generation is complete. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2330 c06c8d41-db1a-0410-9941-cceddc491573
* Oops, was calling dgn_set_floor_colours() in wrong place, leading to somezelgadis2007-10-051-5/+20
| | | | | | | | levels getting the wrong colours. Also, make dgn_set_colours_from_monsters() be paranoid about improprely set up env.mons_alloc[]. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2329 c06c8d41-db1a-0410-9941-cceddc491573
* Shaft traps (trap doors) [1792195] and level annotation [1769009]zelgadis2007-10-051-2/+18
| | | | | | | | | | added, with the shaft traps changed as per comments on SF; shafts aren't randomly generated yet, so this doesn't change gameplay. Changed DNGN_TRAP_III to DNGN_TRAP_NATURAL, of which trap type the shaft traps are the only current member. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2328 c06c8d41-db1a-0410-9941-cceddc491573
* Another cleanup of dungeon features. Adding general markersj-p-e-g2007-10-041-2/+2
| | | | | | | | for first branch/last branch and first altar/last altar that should hopefully make adding new ones easier. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2324 c06c8d41-db1a-0410-9941-cceddc491573
* Moved all of the bazaar specific logic/code to dat/bazaar (or turned thezelgadis2007-10-041-105/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | code into Lua utility functions which can be reused by things other than bazaars). Related changes: * Portal vault entrances now work if they have destinations ("dst" property) besides "bazaar" (though it still causes an assert if no matchng maps for the destination can be found). * The floor and rock colour for a level are generated once and then stored in the save file, rather than being constantly regenerated (which means that bazaar floor colours are now truly random, rather than being tied to the depth of the bazaar entrance). * The floor and rock colour for a portal vault (or for any level containing any vault) can be set with ROCKCOL and FLOORCOL (which currently only accepts a single colour, unlike COLOUR); there are also Lua functions for querying and setting the colours. * Each portal vault level_type_name can have an associated Lua callback which is called when level generation is complete; it can be used for things like stair fixup. I also moved the Halls of Zot rock/floor colour special casing to the dat/zot.des file, since it was easy once ROCKCOL and FLOORCOL had been implemented. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2314 c06c8d41-db1a-0410-9941-cceddc491573
* Bumped piety cost for brothers-in-arms and greater healing.dshaligram2007-09-271-5/+7
| | | | | | | Added COLOUR: directive to maps to allow custom colouring of features by glyph, and tweaked the strawberry fields variants to use it. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2227 c06c8d41-db1a-0410-9941-cceddc491573
* All vaults are now "uniq" (one-use-per-game) by default. Vaults that wantdshaligram2007-09-261-1/+1
| | | | | | to be reused must be tagged "allow_dup". git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2213 c06c8d41-db1a-0410-9941-cceddc491573
* Removed hard tabs.dshaligram2007-09-261-4/+4
| | | | | | | | | | | | | | Corrected sling bullet description. Targeting forward wrap-around was broken, fixed. Dropped damage bonus for kenku clawed-kick. Don't show {tried} for equipped items. Removed Elyvilon's protection from high-damage hits even when not praying. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2207 c06c8d41-db1a-0410-9941-cceddc491573
* This change moves the logic for when a level or branch prohibitszelgadis2007-09-191-0/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | teleport control from the C++ code into the vault .des files. This is done with the additions of two things: * Changeable, persistent per-level and per-branch flags which affect game play. * Dungeon events for the killing of monsters, picking up of objects and changing of features. The current level and branch flags are for teleport control prevention, making a level unmappable (like the Abyss or a Labyrinth), and preventing magic mapping from working (like the Abyss or a Labyrinth). Some related changes: * The new .des header KMASK allows for dungeon grid masks like no_monster_gen to be applied to specific symbols rather than the entire vault. * If the wizard mapping command (&{) is used in a place which is unmappable, it will ask if you wish to force the area to be mappable (so you can see what an entire Labyrinth or Abyss level looks like without having to hack the source). * A new wizard-mode level-map command, 'T', will teleport the player to wherever the cursor is pointing. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2146 c06c8d41-db1a-0410-9941-cceddc491573
* Introduces three new wall types, translucent versions of the normalzelgadis2007-09-191-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rock wall, stone wall and permanent rock wall. These are for use in vaults, and are never randomly generated. Magically translucent versions of the normal wall types are used, rather than glass, so we don't have to figure out how glass would react to things like digging and Shatter, but can re-use the code for the normal wall types. I've tried to fix all the places where the old code assumes that any square which is visible to the player has no walls between it and the player, but I've probably missed lots; this will require a lot of play testing before its ready for non-developers. viewwindow() now has two calls to losight(), the second one determining what squares would be visible if all translucent walls were made transparent, so that there's a quick way to see if there's any translucent walls between the player and a square. This second call to losight() doesn't cause any noticeable slowdown for me, but it might on an older system. Other than viewwindow() making a second call to losight(), there shouldn't be any changes to game-play or game-logic if there aren't any translucent walls around. The wizard blinking command (&b) has been changed so that it ignores all normal restrictions except for needing to see the target square and not landing on monsters; if the player lands on a wall square it's changed to floor. Wizard blinking also doesn't increase magical contamination. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2145 c06c8d41-db1a-0410-9941-cceddc491573