summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dungeon.cc
Commit message (Collapse)AuthorAgeFilesLines
* Another clean up, and add some new weapon speech.j-p-e-g2008-07-071-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6439 c06c8d41-db1a-0410-9941-cceddc491573
* Add a function x_chance_in_y(x,y) to replace the variousj-p-e-g2008-07-061-39/+41
| | | | | | | | 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
* [2010990] [2010344] Fixing issues where a disconnected region would not be ↵ennewalker2008-07-041-1/+38
| | | | | | considered disconnected if it contained a branch entry. The level builder should now properly veto this when it occurs. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6401 c06c8d41-db1a-0410-9941-cceddc491573
* Disallow vampires from draining summoned creatures to be consistent withj-p-e-g2008-07-041-38/+38
| | | | | | | | | | | | | summoned creatures being incapable of bleeding on the floor. This makes things more difficult for Vampires; on the other hand there was a (more or less) recent change that lets them regain 1 hp *per turn* when draining corpses. We might also increase the duration of blood potions... Apart from that, various clean-ups. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6393 c06c8d41-db1a-0410-9941-cceddc491573
* Many code cleanups, mostly involving using stack_iterator andharanp2008-07-021-3/+1
| | | | | | | radius_iterator instead of the previous setup. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6347 c06c8d41-db1a-0410-9941-cceddc491573
* For Tiles, use some of the other wall types in the Abyss as well to makej-p-e-g2008-07-011-0/+1
| | | | | | | it more interesting. The rest is mostly clean-up. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6307 c06c8d41-db1a-0410-9941-cceddc491573
* Add yet more miscellaneous minor fixes.dolorous2008-06-301-2/+0
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6258 c06c8d41-db1a-0410-9941-cceddc491573
* Add more minor cosmetic fixes.dolorous2008-06-301-1/+0
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6256 c06c8d41-db1a-0410-9941-cceddc491573
* Enable Chaos Knights of Lugonu starting out in the Abyss.j-p-e-g2008-06-301-4/+4
| | | | | | | | | | | | | | | | | | | I've marked these characters with GDT_GAME_START, so that * the player starts out on an altar to Lugonu * there's an exit back to the Dungeon near-by * returning into the Dungeon always places them into the entry vault on level 1 * no abyssal runes are ever generated * item generation matches that of level 1 * monster spawn rates are that of the orb run to enforce a quick return into the Dungeon Once the player returns to the Dungeon (via an exit or with Lugonu's first power) char_direction is properly set to GDT_DESCENDING and from then on the game continues as if they had started in the Dungeon. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6245 c06c8d41-db1a-0410-9941-cceddc491573
* For amphibious creatures with HT_WATER, don't force replacing floor compatible j-p-e-g2008-06-271-1/+4
| | | | | | | | terrain with deep water when placing them by map definition or in wizard mode. (Suggested in BR 2000631.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6168 c06c8d41-db1a-0410-9941-cceddc491573
* Misc. minor cleanups. (Yes, a huge amount of them but still...)j-p-e-g2008-06-261-7/+7
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6146 c06c8d41-db1a-0410-9941-cceddc491573
* Fix the Vestibule having no upstairs. o_Oj-p-e-g2008-06-151-2/+4
| | | | | | | Fix fleeing monsters shooting at you. (BR 1994462) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5861 c06c8d41-db1a-0410-9941-cceddc491573
* Add more miscellaneous minor fixes.dolorous2008-06-151-16/+20
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5860 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 1948131: Quiver slot name wraps around the screen.j-p-e-g2008-06-151-9/+9
| | | | | | | | Also fixes tile issues where the inventory was partly covered or not shown at all. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5844 c06c8d41-db1a-0410-9941-cceddc491573
* Add more minor cosmetic fixes.dolorous2008-06-141-2/+3
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5817 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 1992604: monster_los asserting for positions out of bounds.j-p-e-g2008-06-131-3/+5
| | | | | | | Mark bees created in bee hives as patrolling. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5789 c06c8d41-db1a-0410-9941-cceddc491573
* Fixing logic error so that D:1 can be created again.ennewalker2008-06-121-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5764 c06c8d41-db1a-0410-9941-cceddc491573
* Remove unneeded methods (including the old resistance screen), renamej-p-e-g2008-06-121-34/+15
| | | | | | | debugging functions, and some other clean-up. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5757 c06c8d41-db1a-0410-9941-cceddc491573
* Overhaul god gift handling again so that we can tell which god sent dolorous2008-06-121-1/+1
| | | | | | | | | | | which gift. There was an unused god parameter in the monsters struct, which was probably intended to hold which god a monster worshipped. I've used it as an indicator of which god sent the monster, under the assumption that gods would send their own worshippers as gifts. (I hope this isn't an abuse of it.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5748 c06c8d41-db1a-0410-9941-cceddc491573
* Clean-up (renaming static methods and comments) in a number of files.j-p-e-g2008-06-101-73/+73
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5703 c06c8d41-db1a-0410-9941-cceddc491573
* Add minor cosmetic fixes.dolorous2008-06-101-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5678 c06c8d41-db1a-0410-9941-cceddc491573
* [1982933] [1790502] Fixing issue with vaults being generated on lava.ennewalker2008-06-071-0/+6
| | | | | | | 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
* Enable pathfinding for patrolling monsters who lost their patrol point.j-p-e-g2008-06-071-1/+1
| | | | | | | | | | | | | | | | | | | | | Fixed patrol definitions in maps not actually working. Tested both by teleporting the minotaur in a labyrinth. About 50 turns later it arrived back in its lair. :) Since the minotaur proved to have a high magic resistance, it had plenty of time to loot the stash at the labyrinth entrance once I'd woken it before I finally managed to teleport it away (in wizmode you can force monsters not noticing you). This resulted in "A minotaur, wielding the demon trident "Suyn Oma", and wearing a heavily runed ring mail." o_O It had also picked up a scroll and a wand. Ouch... (but cool!) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5536 c06c8d41-db1a-0410-9941-cceddc491573
* Create random blood spatter in the Abyss and Pandemonium (FR 1986241).j-p-e-g2008-06-071-1/+1
| | | | | | | | | | | | | How it works: * Pick 12 random grids on the map and make them bloody. * Recursively and with decreasing chances, allow their neighbours to get spattered as well. I think the effect is rather nice but the numbers might need to be tweaked anyway. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5533 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 1984593: all monster being generated awake.j-p-e-g2008-06-051-2/+3
| | | | | | | Some modifications to the pathfind travel_cost function. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5491 c06c8d41-db1a-0410-9941-cceddc491573
* I'm not sure I actually coded anything worthwhile, though I experimentedj-p-e-g2008-06-021-2/+2
| | | | | | | | | | | | | | | | a fair bit and as usually ended up doing lots of clean-up. Oh wait, I modified eat_from_floor prompts to only force a more if there was actually a message before trying the inventory (whoops), and also modified the corpses in pack hint to take into account that a saccing player won't be interested in butchering rotten corpses. Also implemented a modified FR 1981119: when Detect Creatures only detects plants already seen before, print a different message ("You detect no further creatures."). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5435 c06c8d41-db1a-0410-9941-cceddc491573
* Add yet more minor cosmetic fixes.dolorous2008-06-021-3/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5427 c06c8d41-db1a-0410-9941-cceddc491573
* Fix wizard mode being unable to create monsters of nonfloor habitat.j-p-e-g2008-06-011-9/+9
| | | | | | | | | | | | | | | | Changed labyrinth handling for minotaurs: Instead of being magic mappable, labyrinths are plain mappable. Yes, that makes everything much easier, but allowing magic mapping and yet you still have to trudge along by hand (rather than use autotravel) is worse. To make up for it, we might want to boost the monster minotaur (trying to defend its home against a rival?) Or we could just remove the difference altogether... Cleaned up debug.cc a bit. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5401 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 1937489: Remove map markers overwritten by lakes or rivers, as wasj-p-e-g2008-06-011-4/+17
| | | | | | | | | | | | | already done for vaults. Modify monster speech to make the beast only use some selected shouts (i.e. not "You hear an irritating whine") and NEVER do the demon taunts since it cannot speak. Demon lords can use almost the whole array of speaking verbs except for "buzz" and "whine". git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5400 c06c8d41-db1a-0410-9941-cceddc491573
* Modify num_feats_between to return early if a feature has beenj-p-e-g2008-05-271-0/+1
| | | | | | | | encountered and we're only interested in whether the path is clear or not. Also, more whitespace/comment changes. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5298 c06c8d41-db1a-0410-9941-cceddc491573
* Update documentation on coding conventions, and apply a few of them. :)j-p-e-g2008-05-271-24/+28
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5295 c06c8d41-db1a-0410-9941-cceddc491573
* Added "error" channel for runtime errors, and changed error messages thatzelgadis2008-05-271-2/+3
| | | | | | | | | 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-191/+207
| | | | | | | | | | | | | | | | | 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-3/+35
| | | | | | | | | | | | | | | | 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
* Fix aborting unchivalric attacks costing a turn.j-p-e-g2008-05-251-34/+30
| | | | | | | | | | | | | | | | | | Implement ordering your friends to stay where they are. To do this, I've added a new variable to the monster struct: patrol_point, that is set by the new t sub-command "Wait here!" Once this is set, monsters will spend their time wandering around within the LOS radius centred on the patrol point. If they are attacked, or the player or other friends are attacked, they'll stop wandering to fight, but once the foe is gone, they continue doing so. Currently, the only way to make them stop again is to issue another command, "Follow me!" that is basically the already existing "Come here!" command. I've also added a "Stop fighting!" command that for non-patrolling monsters has the same effect as "Follow me!" - patrolling monsters are supposed to take up their wanderings again. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5247 c06c8d41-db1a-0410-9941-cceddc491573
* Pushing some dungeon-related lua functions back into C++.ennewalker2008-05-221-51/+60
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5176 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 1941612: Zapping wands known to be empty shouldn't cost a turn, butj-p-e-g2008-05-211-17/+17
| | | | | | | | | | | | | | empty wands with unknown charges should cost a turn. Experimentally add a "Really fire through friendly creature?" prompt when a beam tracer passes through a friend. This currently uses the existing monster tracer and probably has huge problems because of this. In any case, it appears to only work sometimes, though consistently for wands in my testing, possibly because the range is fixed (?) when compared to spells. (This is part of FR 1962548.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5171 c06c8d41-db1a-0410-9941-cceddc491573
* Adding _plan_1() (the donut room) into layout.des. Vaults can now have zero ↵ennewalker2008-05-171-66/+10
| | | | | | size. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5099 c06c8d41-db1a-0410-9941-cceddc491573
* Outsourced the cross and the large octagon room to the (new) layout.des ↵ennewalker2008-05-171-45/+19
| | | | | | | | | | | | 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
* [1947491] Fixing minor issues in dungeon.cc. Some cases have too few ↵ennewalker2008-05-151-9/+18
| | | | | | stairs. Some cases create twice as many. There's now the possibility of actually having a roguey_level on its own, where before there wasn't. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5051 c06c8d41-db1a-0410-9941-cceddc491573
* Improve labyrinth loot, fixed assert when labyrinth minivaults try to place ↵dshaligram2008-05-101-20/+15
| | | | | | traps. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4994 c06c8d41-db1a-0410-9941-cceddc491573
* [1959633] Fix an issue where too few stone stairs on the previous level ↵ennewalker2008-05-101-10/+34
| | | | | | caused stone stairs on the current level to have a destination collision. Other than branch entrance/exits, all levels now get extra (randomly placed) stone stairs to bring them up to one of each kind if needed. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4985 c06c8d41-db1a-0410-9941-cceddc491573
* Fixing a bug with inconsistent monster inventory state. Now monster ↵ennewalker2008-05-091-1/+1
| | | | | | inventories are reset with level reset so that they aren't stale and pointing at invalid items. This eliminates periodic "BUG WARNING: unlinked item..." messages. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4971 c06c8d41-db1a-0410-9941-cceddc491573
* Comment fix.dolorous2008-05-061-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4890 c06c8d41-db1a-0410-9941-cceddc491573
* Hopefully fix debug build, based partially on Josh's patch.dolorous2008-05-061-3/+3
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4889 c06c8d41-db1a-0410-9941-cceddc491573
* Cleaned up monster generation functions, separate monster zombie type from ↵dshaligram2008-05-051-274/+114
| | | | | | | | | monster number. May be buggy. Allow hydra zombies (they currently do not get the right number of heads). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4872 c06c8d41-db1a-0410-9941-cceddc491573
* [1948047] Fixing slime pit minimap bug. Walls that are out-of-sight when ↵ennewalker2008-04-221-1/+1
| | | | | | the royal jelly dies are not updated until the player sees them again. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4460 c06c8d41-db1a-0410-9941-cceddc491573
* [1914620] Adjusting duplicate stair removal logic (such as extra stone ↵ennewalker2008-04-201-2/+46
| | | | | | | | stairs being created by vaults) to try to preserve stone stairs from vaults. Extra stone stairs (still) become escape hatches, except in Zot where they now become non-stairs, to coerce players into traveling through vaults. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4396 c06c8d41-db1a-0410-9941-cceddc491573
* Fixes to compile with Visual C++. Moved direct.cc and direct.h to directn.* ↵dshaligram2008-04-191-1/+1
| | | | | | to avoid conflict with VC++ direct.h header. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4390 c06c8d41-db1a-0410-9941-cceddc491573
* [1945524] Fixed minivaults not being generatable.dshaligram2008-04-181-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4330 c06c8d41-db1a-0410-9941-cceddc491573