summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/traps.cc
Commit message (Collapse)AuthorAgeFilesLines
* Another clean up, and add some new weapon speech.j-p-e-g2008-07-071-23/+27
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6439 c06c8d41-db1a-0410-9941-cceddc491573
* A few more cleanups.haranp2008-07-021-9/+5
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6349 c06c8d41-db1a-0410-9941-cceddc491573
* Only apply targeting via monster list to spells and such wherej-p-e-g2008-07-021-1/+1
| | | | | | | targeting monsters is actually needed. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6338 c06c8d41-db1a-0410-9941-cceddc491573
* Let a level_id be directly compared to a branch type with == and != tozelgadis2008-06-221-3/+2
| | | | | | | | determine if a level_id is (not) in BRANCH_FOO; takes care of comparing level_type to LEVEL_DUNGEON. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6034 c06c8d41-db1a-0410-9941-cceddc491573
* Fix logical error in which traps can be disarmed. (BR 1997834)j-p-e-g2008-06-191-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5979 c06c8d41-db1a-0410-9941-cceddc491573
* Fix 1996770: shafts being capable of disarming.j-p-e-g2008-06-181-1/+50
| | | | | | | Fix 1996304: the Swap card incorrectly swapping monsters/player caught in a net git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5941 c06c8d41-db1a-0410-9941-cceddc491573
* More progress on making pacified monsters leave the level. They'll now dolorous2008-06-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | find the nearest exit, and disappear once they reach it. There's a new travel target, MTRAV_EXIT. Notes: This is currently very simplistic. The monsters still don't use pathfinding, so if they're blocked, they'll just stand there again. With shaft traps, the monsters shouldn't try to go directly to the target, since they can't disappear at the same time they fall through to another level. With teleport traps, they should only go to them when all paths to exits are blocked, and they shouldn't disappear when they hit them. There may also be issues if a monster hits one and reappears nearby, since it won't be far enough outside the player's LOS to disappear. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5935 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
* Implement pathfinding for monsters, using the A* algorithm.j-p-e-g2008-06-041-6/+6
| | | | | | | | | | | | | | | | It's not actually used anywhere yet, but I've implemented a wizmode testing function (x on monster, then 'w') that calculates the shortest path to any playerchosen destination on the level, and it seems to work quite well. The monsters tend to take zigzag paths but that should be easy enough to smooth out and in any case doesn't matter all that much since the player usually won't witness this. Oh, and though I tested the whole thing in a labyrinth, it went ridiculously fast! I'd rather doubted that but Darshan was completely right, as usually. :p Please don't remove the debugging output yet, I still need them. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5476 c06c8d41-db1a-0410-9941-cceddc491573
* Fix a recent bug of mine that blocked the friendly fire prompts.j-p-e-g2008-06-021-14/+15
| | | | | | | | | | | | | | | | | | Fix 1943573: Weird message order when attacking charmed monsters. Fix 1826896: NOTE_ID could have line breaks in mid-word Modify the "This feature has more information" hint to mention mouseclicking for Tiles players rather than 'v' like for purists. Oh, and when trying to look into BR 1952908 (buggy trap in the Abyss) I found that traps can be generated in the Abyss after all. I don't know when that was changed but the last time I checked I remember seeing something like "if (level == ABYSS) return false" in a "Can there be traps here?" check. Is my memory playing tricks on me or was that really changed, and if so, was it intentional? git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5445 c06c8d41-db1a-0410-9941-cceddc491573
* Yet another session of comment/whitespace cleanups.j-p-e-g2008-05-271-14/+14
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5291 c06c8d41-db1a-0410-9941-cceddc491573
* Added "error" channel for runtime errors, and changed error messages thatzelgadis2008-05-271-1/+1
| | | | | | | | | 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
* FR 1962016: Make hydra headedness more obvious.j-p-e-g2008-05-141-11/+8
| | | | | | | | | | | | | | You now get messages like "The seven-headed hydra bites." and "You slice the 12-headed hydra." FR 1963606: Take a note when you pick up a rune (or the Orb!) for the first time. There are a couple of other files I changed, but I can't remember any big stuff, so it was probably just cleanup. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5029 c06c8d41-db1a-0410-9941-cceddc491573
* Improve labyrinth loot, fixed assert when labyrinth minivaults try to place ↵dshaligram2008-05-101-4/+0
| | | | | | traps. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4994 c06c8d41-db1a-0410-9941-cceddc491573
* Revert shaft exception for Dlvl 27. Jeez, how should I know? I've neverj-p-e-g2008-04-251-1/+1
| | | | | | | been down there! git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4618 c06c8d41-db1a-0410-9941-cceddc491573
* FR 1951252: Make an exception for shafts leading to Dlvl 27: only shaftsj-p-e-g2008-04-251-1/+3
| | | | | | | | directly above that level (thus, level 26) will drop you into 27, else you'll at most land in Dlvl 26. Still, shafts may be placed on level creation. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4616 c06c8d41-db1a-0410-9941-cceddc491573
* FR 1951252: Modify shafts to usually (50%) drop you two levels, andj-p-e-g2008-04-251-1/+8
| | | | | | | | | | | sometimes (25% each) one or three. FR 1951309: Disallow SeeInv + rPois properties for randart naga bardings since naga already have those two as innate mutations, and there's no one else capable of wearing them. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4615 c06c8d41-db1a-0410-9941-cceddc491573
* Fix [1951429] Mutations being miscoloured after listing innate j-p-e-g2008-04-251-2/+0
| | | | | | | boosted mutations. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4614 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
* Apply Horst von Brand's (first) patch 1887488: gcc-4.3 compile failures.j-p-e-g2008-04-141-31/+33
| | | | | | | 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
* Added Water card. Might need some rebalancing.haranp2008-04-081-0/+14
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4127 c06c8d41-db1a-0410-9941-cceddc491573
* Prevent shafts from being created in corridors, at least untilj-p-e-g2008-03-291-3/+4
| | | | | | | | | | | | | | | | | 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
* - Move "shaft disappears in a puff of logic" logic further down, so it'spauldubois2008-03-171-11/+13
| | | | | | | | | easier to test floating over traps - Don't yesno if an airborne player tries to move over a shaft. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3684 c06c8d41-db1a-0410-9941-cceddc491573
* Make being caught in a net interrupt the stair delay, and disallow beholding j-p-e-g2008-02-021-0/+3
| | | | | | | | | | attempts (mermaid) while the player is taking some stairs. Also add a message for wielding a weapon of distortion. (I'm afraid there already used to be one that I've accidentally removed.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3385 c06c8d41-db1a-0410-9941-cceddc491573
* Add "active stealth-training" (FR 1833916):j-p-e-g2008-01-311-0/+3
| | | | | | | | | | | | | | | | | Everytime a monster in your LOS doesn't wake up (= you pass the Stealth check), there's a 5% chance of exercising Stealth by 1. Yes, this is probably much too frequent (normal Stealth exercising happens with 1/18 chance once every 20 turns), but I'd prefer decreasing the probability of plain Stealth training in favour of the active training, anyway, though I've no idea what the actual numbers should be. Add "passive trap-training" (FR 1865590): Everytime you detect a trap by setting it off, T&D gets exercised by 1 or 2 (50% chance each), same as for detecting a trap by searching. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3382 c06c8d41-db1a-0410-9941-cceddc491573
* Add gore and splatter to Crawl - in the form of Jarmo's j-p-e-g2008-01-091-2/+4
| | | | | | | | | | | | | | | | | | | | | | (strongly modified, I admit) blood patch. Whenever the player or a monster capable of bleeding suffers damage (currently only in melee) or when you dissect a corpse there's a chance (depending on damage/corpse weight) that the square will turn bloody and be coloured red, with a much lower chance of additionally spattering some of the surrounding squares. These chances are probably still a bit too high for later values of possible damage dealt. Also, ranged and some of the magic attacks (earth-based, mostly) should also be able to send blood flying. :p For now, this is flavour only, but it shouldn't be too difficult to introduce relations to Necromancy or evil gods. Also consider dragons to be warm-blooded, like dinosaurs. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3230 c06c8d41-db1a-0410-9941-cceddc491573
* Add comment typo and indentation fixes.dolorous2007-12-301-8/+8
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3145 c06c8d41-db1a-0410-9941-cceddc491573
* Don't bother checking for and skipping over throwing nets when dolorous2007-12-171-7/+5
| | | | | | | generating racial traps, as set_equip_race() won't make them racial. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3082 c06c8d41-db1a-0410-9941-cceddc491573
* Items can now fall through shaft traps (trap doors). The code is ratherzelgadis2007-12-031-0/+84
| | | | | | | | | | | | | | 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
* make player::has_claws() return an int indicating the level of claws dolorous2007-11-221-4/+3
| | | | | | | | available; this removes the need for some special cases dealing with trolls' and ghouls' built-in claws git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2890 c06c8d41-db1a-0410-9941-cceddc491573
* A few changes to shafts:j-p-e-g2007-11-201-1/+8
| | | | | | | | | | | | | | * shafts cannot be created above level 3 in the main dungeon * intelligent fleeing monsters will jump into shafts -> this will reveal the shaft to the player * rename "shaft trap" to "shaft" * ask for confirmation before stepping into a shaft Also finally fix colour from post-death inventory bleeding into the highscore and prompt. (This has always bugged me.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2884 c06c8d41-db1a-0410-9941-cceddc491573
* The number of traps randomly generated on a level, and which types ofzelgadis2007-11-131-0/+194
| | | | | | | | | | | 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
* latest net improvement (make switching damage -> escape rarer) for trunkj-p-e-g2007-11-071-19/+23
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2783 c06c8d41-db1a-0410-9941-cceddc491573
* Corrections to manual (patch by maiermirk) and j-p-e-g2007-11-061-1/+1
| | | | | | | fix to freeing self from net. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2775 c06c8d41-db1a-0410-9941-cceddc491573
* claw mutation fix for net damage, courtesy of dolorousj-p-e-g2007-11-051-2/+4
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2773 c06c8d41-db1a-0410-9941-cceddc491573
* Net fix (reduced trapping turns) also for trunk.j-p-e-g2007-11-051-14/+34
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2769 c06c8d41-db1a-0410-9941-cceddc491573
* [1821098] Fixed bat transform not conferring flight. Fixed ↵dshaligram2007-10-271-4/+4
| | | | | | player_is_levitating and renamed it to player_is_airborne to describe the function better. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2613 c06c8d41-db1a-0410-9941-cceddc491573
* Fix bug 1814617: teleport/banish not clearing being trapped in netj-p-e-g2007-10-261-0/+12
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2588 c06c8d41-db1a-0410-9941-cceddc491573
* Refixed labyrinth entry point.dshaligram2007-10-251-1/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2576 c06c8d41-db1a-0410-9941-cceddc491573
* Removed amnesia/forgetfullness trap, mutation and scroll. Thezelgadis2007-10-151-5/+13
| | | | | | | | | | | | | 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
* Make mechanical traps in Orcish Mines and Elven Halls ofj-p-e-g2007-10-091-9/+36
| | | | | | | | | | | appropriate racial type. I'd prefer it if there was a chance involved but IMHO a given trap should shoot the same (racial) type of ammo, so this is now always the case in these two branches, for all of needle, arrow, bolt, spear and axe traps. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2395 c06c8d41-db1a-0410-9941-cceddc491573
* Minor changes to net, one shoving debug information intoj-p-e-g2007-10-081-1/+1
| | | | | | | | DEBUG_DIAGNOSTICS compile, another changing net descriptions. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2385 c06c8d41-db1a-0410-9941-cceddc491573
* Remove trap-door-like logic from shaft traps, since shafts are justzelgadis2007-10-051-1/+1
| | | | | | | supposed to be holes hidden by debris. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2337 c06c8d41-db1a-0410-9941-cceddc491573
* Shaft traps (trap doors) [1792195] and level annotation [1769009]zelgadis2007-10-051-0/+39
| | | | | | | | | | 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
* Overhaul trapping net escape functions.j-p-e-g2007-10-011-32/+136
| | | | | | | | | | With the help of several factors (such as size, wielded weapon or stats) the game decides whether you should try to destroy the net to come free, or try to slip out of it. The same calculation also influences how long this will take. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2278 c06c8d41-db1a-0410-9941-cceddc491573
* Introducing shortcut for searching the current level asj-p-e-g2007-09-301-1/+2
| | | | | | | | | | requested in FR 1801705. Also adding feedback when auto-travel fails to kick in. And trying to get out of a net no longer stops travel, only being caught in one does (FR 1800821). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2263 c06c8d41-db1a-0410-9941-cceddc491573
* Fixing a number of bugs on throwing nets, so it's all in j-p-e-g2007-09-191-6/+12
| | | | | | | | | | | | | | | all a net improvement. ;) I'm reusing item.plus2 as a marker for trapping monsters or not. AFAIK, missiles don't need those, and it makes stacking so much easier. Gladiators start with Throwing skill 1, except for Kobolds (don't get a net) who get an additional level at Dodging. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2149 c06c8d41-db1a-0410-9941-cceddc491573
* Didn't have svn autoprops set properly for the new files that I addedzelgadis2007-09-161-1/+1
| | | | | | | for my code refactoring. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2103 c06c8d41-db1a-0410-9941-cceddc491573
* Add missing AppHdr.h includes for these new files to un-break the Mac build.nlanza2007-09-161-0/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2099 c06c8d41-db1a-0410-9941-cceddc491573
* Split off portions of externs.h and enum.h into other files. Thezelgadis2007-09-151-0/+701
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