summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/database.cc
Commit message (Collapse)AuthorAgeFilesLines
* Misc. minor cleanups. (Yes, a huge amount of them but still...)j-p-e-g2008-06-261-5/+7
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6146 c06c8d41-db1a-0410-9941-cceddc491573
* Add spelling fix.dolorous2008-06-261-6/+6
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6143 c06c8d41-db1a-0410-9941-cceddc491573
* Swap '.' and '!' in the targetting interface.j-p-e-g2008-06-221-3/+3
| | | | | | | | | | Forbid bats wearing hats/caps or rings. (That makes amulets the only type of equipment Vampires can keep on when transforming.) To make up for it, increase their damage stats again. Also fix it being possible to (un)equip the allowed items in Tiles while in bat form. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6055 c06c8d41-db1a-0410-9941-cceddc491573
* Fix ?immolation not being autoID'd upon reading.j-p-e-g2008-06-221-2/+2
| | | | | | | Fix ?uselessness not using the misc. descriptions. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6051 c06c8d41-db1a-0410-9941-cceddc491573
* Add the framework for descriptions for abilities to be read from thej-p-e-g2008-06-181-5/+6
| | | | | | | | | | | | | | ability menu (a!) Currently only contains descriptions for Zin, TSO and "Renounce Religion". Also, now I'm worried that players might accidentally press '?' instead of '!' and then apply an ability when they only wanted to read its description. (Of course, with some of them you can opt out, e.g. because they need targeting, but for others it's a real problem.) There must be a good solution around somewhere. Abilities are not (yet) searchable in the database. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5958 c06c8d41-db1a-0410-9941-cceddc491573
* Outsource the tutorial descriptions of skills, and make them searchablej-p-e-g2008-06-181-2/+3
| | | | | | | | | | | | in the database. Apply Zaba's patch to view skills from the skill menu ('m'). The melee, ranged and magic skills currently only have really generic descriptions shamelessly copied from the tutorial. There's a front end function get_skill_description that appends extra information like what types of unarmed attacks the current character is capable of (kicking, clawing, punching, ...) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5955 c06c8d41-db1a-0410-9941-cceddc491573
* Clean-up (renaming static methods and comments) in a number of files.j-p-e-g2008-06-101-2/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5703 c06c8d41-db1a-0410-9941-cceddc491573
* Lowercase the last of the the miscellaneous names text, and move it out dolorous2008-06-011-2/+20
| | | | | | | of the randart name database into its own database. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5385 c06c8d41-db1a-0410-9941-cceddc491573
* Comment fix.dolorous2008-05-271-2/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5280 c06c8d41-db1a-0410-9941-cceddc491573
* Outsource more miscellaneous names besides colors (glowing color types, dolorous2008-05-261-0/+2
| | | | | | | | | writing types for Tomes of Destruction), and move them into their own file. Also, tweak the message for glowing colors used by scrolls of random uselessness so that they no longer have to start with consonants. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5269 c06c8d41-db1a-0410-9941-cceddc491573
* Typo fixes.dolorous2008-05-261-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5268 c06c8d41-db1a-0410-9941-cceddc491573
* Change friendly pickup from a toggle to a more userfriendly, easilyj-p-e-g2008-04-261-0/+2
| | | | | | | abortable prompt, and move orc names into a file of their own. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4670 c06c8d41-db1a-0410-9941-cceddc491573
* Replace the dire lajatang with the cloak of Starlight (rElec, rC+, EV+4,j-p-e-g2008-04-231-3/+6
| | | | | | | | | Stlth-). I already added a new tile, which looks rather atrocious, I think. The dire lajatang tile is now used for any branded lajatang. Also renamed a few tile files. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4527 c06c8d41-db1a-0410-9941-cceddc491573
* Modify descriptions of artefact-capable items to allow for unquoted j-p-e-g2008-04-221-1/+7
| | | | | | | | descriptions for artefacts, so as not to drown the actually important information in flavour quotes. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4483 c06c8d41-db1a-0410-9941-cceddc491573
* Fixes to compile with Visual C++. Moved direct.cc and direct.h to directn.* ↵dshaligram2008-04-191-2/+2
| | | | | | 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
* Another code cleanup.j-p-e-g2008-04-151-27/+27
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4244 c06c8d41-db1a-0410-9941-cceddc491573
* Fix database lookup for features, and add fountain of blood, as well as pj-p-e-g2008-03-271-1/+1
| | | | | | | | | | | | | | | | | | otion of coagulated blood to items. Also copy the more interesting branch stair descriptions into branches.txt. Most of them still have the generic "Describe branch here", and I lack the imagination to change that. Ideally, the branch entries should get distinct descriptions closer to describing the atmosphere, e.g. "Putrid smell fills your nostrils." (Tomb), "A moss-covered staircase. From below you can hear squeaking noises, and odd deep croaks." (Lair), or "The sound of clanging weapons reaches your ears." (Blades), with the branch descriptions pulled up after that when describing the staircases in-game. (Or maybe vice versa.) Hmm, did I say I was lacking imagination? :p git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3897 c06c8d41-db1a-0410-9941-cceddc491573
* Modify database lookup to allow for lookup of the nth entry for a j-p-e-g2008-03-231-47/+86
| | | | | | | | | | | | | | | | | given keyword. Used for more varied recite speech, so that the same prechosen synonym can be used for all of start/continue/stop/finish reciting. The number of the entry is calculated in an embarassingly hacky way: (recite power + hp at beginning of recite + x_pos + y_pos) modulo total weight of the keyword. This makes sure that different synonyms get used, though always the same one (plus its shorter variant) during one round of recite, but it's not as random as I'd like. It works well enough for now, though, and adds some much needed flavour to Zin. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3818 c06c8d41-db1a-0410-9941-cceddc491573
* Fix probable 64-bit portability problem.pauldubois2008-03-201-5/+5
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3742 c06c8d41-db1a-0410-9941-cceddc491573
* Outsourcing Xom speech.j-p-e-g2008-03-191-6/+18
| | | | | | | | "You hear the rejoicing of dolorous and dpeg!" Xom is fascinated! git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3723 c06c8d41-db1a-0410-9941-cceddc491573
* Morphed SingleFileDB into TextDB, a class that accepts any number ofpauldubois2008-03-171-285/+133
| | | | | | | | | | | | | | | | input files. Use it for all the databases, at least all the ones managed by database.cc. Gets rid of 150 lines of code :) Also, fix 1910634 by adding insult.txt to the shout db. It results in some duplication in the dbs on disk, but it's an OK fix for now, I think. The DBs are now in the subdirectory saves/db/ ; is this a problem for distribution? I poke around in that directory occasionally and it's convenient to have the DBs out of the way. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3680 c06c8d41-db1a-0410-9941-cceddc491573
* Make global variables follow conventions.pauldubois2008-03-161-27/+29
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3677 c06c8d41-db1a-0410-9941-cceddc491573
* Another of those commits on monster speech, hopefully the last one forj-p-e-g2008-03-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | some time, though. I added a new prefix "related" if the player character has the same genus as the monster. My new prefix additions (hostile, related and religion) can now be skipped in the speech lookup, which fixes a couple of problems where several monsters were forced silent because of lookup problems. Also clean up the lookup process for silence, allow charmed monsters to sometimes speak (if rarely) and added several debugging statements that are also mentioned in monster_speech.txt that is now clearer than ever before (I hope). Fixed a couple of bugs in the monster shape calculation where the old glyphs were still being used. Also, a Draconian character eating any type of Draconian will now count as cannibalism. Also: FR 1894060: Level annotations now prompt for confirmation if they contain an exclamation mark (rather than "WARN"). Fix 1859443: Arriving on a square via staircase now calls request_autopickup and will describe items on the square. Oh, and fix init.txt to really allow reading in macros from external files. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3604 c06c8d41-db1a-0410-9941-cceddc491573
* Rename speak.txt to monspeak.txt, and noise.xt to wpnnoise.txtj-p-e-g2008-03-101-3/+3
| | | | | | | | as I keep thinking noise should refer to dungeon noises. Also, fix a wrong variable name for orc speech. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3585 c06c8d41-db1a-0410-9941-cceddc491573
* Batch of tiny changes for MSVC compiles.pauldubois2008-03-101-1/+3
| | | | | | | | | | | | | | | 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
* [Bug 1907221] Add "Modified for Crawl Reference" statement and author to aj-p-e-g2008-03-081-1/+2
| | | | | | | | huge number of files. Also correct file name comments. No coding changes. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3539 c06c8d41-db1a-0410-9941-cceddc491573
* Apply Paul's patch 1901892: reorganize/rewrite docs/monster_speech.txtj-p-e-g2008-02-261-3/+69
| | | | | | | | | | | And, while on the topic, of monster speech: * move weapon noises to a file of its own: noise.txt * finally outsource imp/demon insults (making insult.cc/h superfluous) This also activates the hitherto commented-out special racial insults pertaining to player species. As usual, more input welcome. :) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3465 c06c8d41-db1a-0410-9941-cceddc491573
* Outsource randart names.j-p-e-g2008-02-241-4/+92
| | | | | | | | | | | Also: - Move database text files into subfolder "database", yay! - Don't print "uncursed" for identified randart weapons/jewellery as the status should be obvious once the name is known. - A bit of code cleanup (change in enum.h breaks saves!) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3460 c06c8d41-db1a-0410-9941-cceddc491573
* Added help for stash-search (dpeg).dshaligram2008-01-261-23/+34
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3338 c06c8d41-db1a-0410-9941-cceddc491573
* Database entries fetched with getLongDescription() can contain embededzelgadis2007-12-061-1/+42
| | | | | | | | | Lua code. The code will be replaced with its return value before being displayed to the user. The Lua code has no access to the thing being described, and so can only rely on global data. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3011 c06c8d41-db1a-0410-9941-cceddc491573
* "?/" can now be used to look up items. A side effect of this is thatzelgadis2007-12-061-0/+1
| | | | | | | | | | | | | item descriptions have been moved to dat/descript/items.txt and dat/descript/unident.txt. STL maps are now used to look up exact matches for the names of monsters, features and spells, so that looking them up with "?/" won't get too slow if there's a large descriptions DB and each key has to be tested if its a monster/spell/etc. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3009 c06c8d41-db1a-0410-9941-cceddc491573
* Added gods and branches to the "?/" describe command; branch descriptionszelgadis2007-12-051-0/+2
| | | | | | | | | | need to be filled out. List of monsters described by "?/" now starts out sorted by toughness, rather than alphabetically. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3002 c06c8d41-db1a-0410-9941-cceddc491573
* ?/ now asks if you want to describe a monster, spell, or feature, andzelgadis2007-09-241-19/+19
| | | | | | | | | | | | | | | | | | | filters out matches if they aren't of the desired type. If there's more than one match, after selecting a match to look at, exiting from the description will return you to the menu, rather than to the dungeon. If you've asked for monsters, you can toggle sorting of the menu between alphabetical and by aproximated monster toughness (this probably still needs some work, since it seems to say that ordinary worms are tougher than brain worms). Only the monster symbol is coloured when showing a menu of monsters to describe. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2185 c06c8d41-db1a-0410-9941-cceddc491573
* If there are multiple matches to the "?/" describe command, thenzelgadis2007-09-221-1/+49
| | | | | | | | | | | | | | | | | | | | they will be displayed in a menu, which the user can select from. Menu entries for monsters will be given the same color as the monster, with the monster's symbol added to the end of the string. Entering a single character as input to the "?/" describe command lists all monsters with that display symbol. Monsters sharing the same display symbol can now have the same string appended or prepended to their description (implemented to make the "?/" command have to deal with less special cases). Currently only used by nagas with __N_suffix. Has the side-effect advantage that the naga subspicies description and the "attractive/repulsive" description goes before the big block of quoted text, rather than after it. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2177 c06c8d41-db1a-0410-9941-cceddc491573
* Can now search the description database by name (keyword) with '?/'.zelgadis2007-09-211-0/+33
| | | | | | | Not adding to 0.3-branch yet in case it needs some tweaks. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2170 c06c8d41-db1a-0410-9941-cceddc491573
* Applying Enne's database.cc cleanup patch (1792896).j-p-e-g2007-09-121-61/+59
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2077 c06c8d41-db1a-0410-9941-cceddc491573
* Implementing patch 1775415 (outsourcing monster speech) byj-p-e-g2007-09-041-60/+297
| | | | | | | | | | | zelgadis. Currently, shout.txt and speak.txt share in with the .des files in /dat. That should be changed, but I've no idea how to do this. Also implementing a bug fix by ennewalker (1787428). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2052 c06c8d41-db1a-0410-9941-cceddc491573
* [1773753] Split and sort the description db input file (zelgadis).dshaligram2007-08-151-6/+42
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2003 c06c8d41-db1a-0410-9941-cceddc491573
* Implemented .des file caching (speeds startup a fair bit): .des files aredshaligram2007-06-241-23/+0
| | | | | | | | | | 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
* And the beat goes on (stringstreams).haranp2007-04-281-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1386 c06c8d41-db1a-0410-9941-cceddc491573
* Fixed trunk build for DOS and Windows. DOS and Windows builds use a SQLite db,dshaligram2007-04-221-2/+0
| | | | | | | | | | with a dbm-like wrapper so database.cc builds unchanged. Added SQLite to the source tree. Only DOS and Windows builds use it at the moment, but it can be added to Unix builds easily (and will be added automatically if a suitable db.h or ndbm.h is not found). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1342 c06c8d41-db1a-0410-9941-cceddc491573
* Unlink db file if it is stale.dshaligram2007-04-201-2/+4
| | | | | | Function signature was wrong for getLongDescription, fixed. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1338 c06c8d41-db1a-0410-9941-cceddc491573
* Fixed source to build on Linux. Should still build on Mac OS, but this isdshaligram2007-04-201-79/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | untested. Will probably not build out-of-the-box on other BSDs (we need an autoconf script to use the right dbm headers). DOS and Windows builds are still broken pending adding Berkeley DB 1.x sources to the Crawl tree, which I'll probably do sometime tomorrow. Renamed descriptions.txt -> descript.txt to fit into DOS filename limits. The descript.txt -> descript.db conversion is now performed automatically by Crawl on startup if descript.txt is newer than descript.db (or descript.db does not exist). descript.db is saved in the save directory which is a convenient directory that is guaranteed writable by Crawl. The makedb.pl script is no longer necessary (and is unreliable anyway, because it's easy to have multiple dbm versions with incompatible db formats and have the installed Perl link with one while Crawl uses the other, leading to nasty segfaults). Some .des file changes (Erik). Deep elf sorcerers are M_EVIL. Ghosts get mephitic cloud. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1337 c06c8d41-db1a-0410-9941-cceddc491573
* First cut at db/flat text file based descriptions.peterb122007-04-171-0/+139
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1331 c06c8d41-db1a-0410-9941-cceddc491573